hikari-components 0.2.1

Core UI components (40+) for the Hikari design system
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
// Use theme variables with namespace to avoid conflicts
@use 'variables' as vars;
@use 'mixins' as mix;

// ============================================
// Hikari Header Component
// Features: Glass/acrylic effects, bottom accent bar, glow effects
// ============================================

// ============================================
// Base Header Styles
// ============================================

.hi-header {
  // Layout
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;

  // Fixed height - 64px for consistent header sizing
  height: 64px;
  min-height: 64px;

  // Spacing - 减小内边距
  padding: 0 1rem;
  margin: 0;

  // Appearance - 移除圆角
  border-radius: 0;

  // Semi-transparent surface background (theme-aware, mint-tinted for legacy match)
  background: var(--hi-header-surface, var(--hi-surface));
  backdrop-filter: blur(4px);

  // Simple border (mint-tinted to match legacy)
  border-bottom: 1px solid var(--hi-color-background, var(--hi-border));
  box-shadow: 0 1px 3px var(--hi-black-10, rgba(0, 0, 0, 0.05));

  // Transitions - smooth GSAP-style easing
  // DISABLED - migrated to JS animation

  // transition: all vars.$hikari-duration-normal vars.$hikari-ease-smooth;

  // Position
  position: relative;

  // Sticky positioning
  &.hi-header-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  // Fixed positioning
  &.hi-header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-radius: 0;
  }

  // Scrolled state (applied via JS)
  &.hi-header-scrolled {
    background: var(--hi-card-bg);
    backdrop-filter: blur(4px);
    --hi-glow-transparent: false;
    --hi-glow-bg-color: var(--hi-card-bg);
    box-shadow:
      0 8px 24px var(--hi-glow-primary-sm, rgba(255, 179, 167, 0.2)),
      0 0 40px var(--hi-glow-color);

    &::before {
      opacity: 1;
      height: 4px;
    }
  }

  // Responsive padding - 固定64px高度,调整内边距
  @include mix.mobile {
    padding: 0 0.75rem;
  }

  @include mix.tablet {
    padding: 0 1rem;
  }

  @include mix.desktop {
    padding: 0 1rem;
  }
}

// ============================================
// Header Left Section
// ============================================

.hi-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 0 1 auto; // 改为不自动扩展,根据内容自适应宽度
  min-width: 0;
}

// ============================================
// Header Logo Area
// ============================================

.hi-header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--hi-color-text-primary);
  // DISABLED - migrated to JS animation

  // transition: all vars.$hikari-duration-fast vars.$hikari-ease-smooth;
  position: relative;

  // Logo icon/image
  .hi-header-logo-icon {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    // Glow effect
    border-radius: vars.$hikari-radius-fui-sm;
    background: linear-gradient(135deg, var(--hi-primary), rgba(238, 162, 164, 0.2));
    --hi-glow-transparent: false;
    --hi-glow-bg-color: var(--hi-primary);
    box-shadow:
      0 0 12px var(--hi-glow-color),
      inset 0 0 8px var(--hi-glow-color);

    svg {
      width: 100%;
      height: 100%;
      filter: drop-shadow(0 0 4px var(--hi-glow-color));
      // DISABLED - migrated to JS animation

      // transition: all vars.$hikari-duration-fast vars.$hikari-ease-smooth;
    }

    // Animation on hover
    .hi-header-logo:hover & {
      box-shadow:
        0 0 20px var(--hi-glow-color),
        inset 0 0 12px var(--hi-glow-color);
      transform: scale(1.05);

      svg {
        filter: drop-shadow(0 0 8px var(--hi-glow-color));
      }
    }
  }

  // Logo text
  .hi-header-logo-text {
    font-family: vars.$hikari-font-family-sans;
    font-size: vars.$hikari-font-size-lg;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;

    // Subtle text glow
    --hi-glow-transparent: true;
    --hi-glow-bg-color: transparent;
    text-shadow: 0 0 8px var(--hi-glow-color);

    // Truncate on small screens
    @include mix.mobile {
      @include mix.text-ellipsis;
      max-width: 120px;
    }

    @include mix.tablet {
      max-width: 200px;
    }
  }

  // Logo subtitle
  .hi-header-logo-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--hi-color-text-secondary);
    margin-top: 0.125rem;

    @include mix.mobile {
      display: none;
    }
  }

  // Hover state
  &:hover {
    color: var(--hi-color-text-primary);

    .hi-header-logo-text {
      --hi-glow-transparent: true;
      --hi-glow-bg-color: transparent;
      text-shadow: 0 0 12px var(--hi-glow-color);
    }
  }
}

// ============================================
// Header Center Section (Menu)
// ============================================

.hi-header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 2;

  @include mix.mobile {
    display: none;
  }
}

// Navigation menu in header
.hi-header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;

  .hi-header-nav-item {
    position: relative;
    padding: 0.5rem 1rem;
    font-family: vars.$hikari-font-family-sans;
    font-size: vars.$hikari-font-size-sm;
    font-weight: 500;
    color: var(--hi-color-text-secondary);
    text-decoration: none;
    border-radius: vars.$hikari-radius-fui-sm;
    // DISABLED - migrated to JS animation

    // transition: all vars.$hikari-duration-fast vars.$hikari-ease-smooth;

    // Hover state
    &:hover {
      color: var(--hi-color-text-primary);
      background: var(--hi-primary);
    }

    // Active state
    &.hi-header-nav-item-active {
      color: var(--hi-color-text-primary);
      background: var(--hi-primary);
      --hi-glow-transparent: false;
      --hi-glow-bg-color: var(--hi-primary);

      // Bottom accent line
      &::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 1rem;
        right: 1rem;
        height: 2px;
        background: var(--hi-color-primary);
        box-shadow: 0 0 8px var(--hi-glow-color);
        border-radius: 1px;
      }
    }
  }
}

// ============================================
// Header Right Section (Actions)
// ============================================

.hi-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  justify-content: flex-end;
}

// ============================================
// Header Action Buttons
// ============================================

.hi-header-action {
  // Layout
  display: inline-flex;
  align-items: center;
  justify-content: center;

  // Sizing
  width: 2.25rem;
  height: 2.25rem;

  // Appearance
  border-radius: vars.$hikari-radius-fui-sm;
  border: 1px solid transparent;
  background: transparent;
  color: var(--hi-color-text-secondary);

  // Cursor
  cursor: pointer;
  outline: none;

  // Transitions
  // DISABLED - migrated to JS animation

  // transition: all vars.$hikari-duration-fast vars.$hikari-ease-smooth;

  // Icon
  svg {
    width: 1.125rem;
    height: 1.125rem;
    // DISABLED - migrated to JS animation

    // transition: all vars.$hikari-duration-fast vars.$hikari-ease-smooth;
  }

  // Hover state
  &:hover {
    color: var(--hi-color-text-primary);
    background: var(--hi-primary);
    border-color: var(--hi-primary);
    --hi-glow-transparent: false;
    --hi-glow-bg-color: var(--hi-primary);
    box-shadow:
      0 0 12px var(--hi-glow-color),
      inset 0 0 8px var(--hi-glow-color);

    svg {
      filter: drop-shadow(0 0 4px var(--hi-glow-color));
      transform: scale(1.1);
    }
  }

  // Active state
  &:active {
    transform: scale(0.95);
  }

  // Focus state
  &:focus-visible {
    outline: none;
    border-color: var(--hi-color-primary);
    --hi-glow-transparent: false;
    --hi-glow-bg-color: var(--hi-primary);
    box-shadow:
      0 0 0 2px var(--hi-primary),
      0 0 12px var(--hi-glow-color);
  }

  // Badge indicator
  &.hi-header-action-badge {
    &::after {
      content: '';
      position: absolute;
      top: 0.25rem;
      right: 0.25rem;
      width: 0.5rem;
      height: 0.5rem;
      background: var(--hi-color-danger);
      border-radius: 50%;
      box-shadow: 0 0 6px rgba(255, 76, 0, 0.8);
      // DISABLED - migrated to JS animation

      // animation: header-badge-pulse 2s ease-in-out infinite;
    }
  }
}

// DISABLED - migrated to JS animation
// @keyframes header-badge-pulse {
//   0%, 100% {
//     opacity: 1;
//     transform: scale(1);
//   }
//   50% {
//     opacity: 0.7;
//     transform: scale(1.1);
//   }
// }

// ============================================
// Header Search
// ============================================

.hi-header-search {
  position: relative;
  width: 240px;

  @include mix.mobile {
    display: none;
  }

  @include mix.tablet {
    width: 200px;
  }

  // Search input
  .hi-header-search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    font-family: vars.$hikari-font-family-sans;
    font-size: vars.$hikari-font-size-sm;
    color: var(--hi-color-text-primary);
    background: var(--hi-tertiary-bg, rgba(240, 240, 244, 0.5));
    border: 1px solid var(--hi-primary);
    border-radius: vars.$hikari-radius-fui-sm;
    outline: none;
    // DISABLED - migrated to JS animation

    // transition: all vars.$hikari-duration-fast vars.$hikari-ease-smooth;

    &::placeholder {
      color: var(--hi-color-text-secondary);
      opacity: 0.7;
    }

    // Hover state
    &:hover {
      border-color: var(--hi-primary);
      background: var(--hi-button-primary-light, rgba(255, 192, 203, 0.15));
    }

    // Focus state
    &:focus {
      border-color: var(--hi-color-primary);
      background: var(--hi-input-bg-focus, #FFFFFF);
      --hi-glow-transparent: false;
      --hi-glow-bg-color: var(--hi-button-primary-light, #FFE4E9);
      box-shadow:
        0 0 0 2px var(--hi-primary),
        0 0 12px var(--hi-glow-color);
    }
  }

  // Search icon
  .hi-header-search-icon {
    position: absolute;
    left: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--hi-color-text-secondary);
    pointer-events: none;

    svg {
      width: 100%;
      height: 100%;
    }
  }

  // Focus state on icon
  .hi-header-search-input:focus + .hi-header-search-icon {
    color: var(--hi-color-primary);
  }
}

// ============================================
// Header User/Profile
// ============================================

.hi-header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: vars.$hikari-radius-fui-sm;
  cursor: pointer;
  // DISABLED - migrated to JS animation

  // transition: all vars.$hikari-duration-fast vars.$hikari-ease-smooth;
  text-decoration: none;
  color: var(--hi-color-text-primary);

  // Avatar
  .hi-header-user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: vars.$hikari-radius-fui-sm;
    object-fit: cover;
    border: 2px solid var(--hi-primary);
    --hi-glow-transparent: false;
    --hi-glow-bg-color: var(--hi-color-surface);
    box-shadow: 0 0 8px var(--hi-glow-color);
    // DISABLED - migrated to JS animation

    // transition: all vars.$hikari-duration-fast vars.$hikari-ease-smooth;
  }

  // User info
  .hi-header-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;

    @include mix.mobile {
      display: none;
    }

    // Username
    .hi-header-user-name {
      font-size: vars.$hikari-font-size-sm;
      font-weight: 500;
      line-height: 1.2;
      color: var(--hi-color-text-primary);
    }

    // User role/status
    .hi-header-user-role {
      font-size: 0.75rem;
      font-weight: 400;
      color: var(--hi-color-text-secondary);
    }
  }

  // Dropdown arrow
  .hi-header-user-arrow {
    width: 0.75rem;
    height: 0.75rem;
    color: var(--hi-color-text-secondary);
    // DISABLED - migrated to JS animation

    // transition: all vars.$hikari-duration-fast vars.$hikari-ease-smooth;

    @include mix.mobile {
      display: none;
    }

    svg {
      width: 100%;
      height: 100%;
    }
  }

  // Hover state
  &:hover {
    background: var(--hi-primary);

    .hi-header-user-avatar {
      border-color: var(--hi-primary);
      --hi-glow-transparent: false;
      --hi-glow-bg-color: var(--hi-color-surface);
      box-shadow: 0 0 16px var(--hi-glow-color);
    }
  }

  // Open state
  &.hi-header-user-open {
    background: var(--hi-primary);

    .hi-header-user-arrow {
      transform: rotate(180deg);
      color: var(--hi-color-primary);
    }
  }
}

// ============================================
// Header Mobile Menu Toggle
// ============================================

.hi-header-toggle {
  display: none;
  align-items: center;
  justify-content: center;

  @include mix.mobile {
    display: inline-flex;
  }

  // Inherits styles from .hi-header-action
  @extend .hi-header-action;
}

// ============================================
// Header Size Variants
// ============================================

.hi-header-sm {
  padding: 0.5rem 1rem;
  min-height: 3rem;

  .hi-header-logo-icon {
    width: 1.5rem;
    height: 1.5rem;
  }

  .hi-header-logo-text {
    font-size: vars.$hikari-font-size-base;
  }

  .hi-header-action {
    width: 2rem;
    height: 2rem;

    svg {
      width: 1rem;
      height: 1rem;
    }
  }
}

.hi-header-md {
  // Inherits 64px height from base .hi-header
  padding: 0 1rem;
}

.hi-header-lg {
  padding: 1rem 2rem;
  min-height: 5rem;

  .hi-header-logo-icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  .hi-header-logo-text {
    font-size: vars.$hikari-font-size-xl;
  }

  .hi-header-action {
    width: 2.5rem;
    height: 2.5rem;

    svg {
      width: 1.25rem;
      height: 1.25rem;
    }
  }
}

// ============================================
// Header Color Variants
// ============================================

// Primary variant
.hi-header-primary {
  background: linear-gradient(135deg, rgba(238, 162, 164, 0.9), rgba(216, 139, 142, 0.9));

  &::before {
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.6) 50%,
      transparent 100%
    );
  }
}

// Transparent variant
.hi-header-transparent {
  background: transparent;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: none;
  border-bottom: 1px solid transparent;

  &.hi-header-scrolled {
    background: var(--hi-card-bg);
    backdrop-filter: blur(4px);
  }
}

// ============================================
// Header Collapsible (Mobile)
// ============================================

.hi-header-collapsible {
  @include mix.mobile {
    flex-wrap: wrap;

    &.hi-header-collapsed {
      .hi-header-center,
      .hi-header-right {
        display: none;
      }
    }

    &.hi-header-expanded {
      .hi-header-center,
      .hi-header-right {
        display: flex;
        flex-basis: 100%;
        order: 3;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--hi-primary);
      }
    }
  }
}

// ============================================
// Header Animations
// ============================================

// Slide down animation
.hi-header-slide-down {
  // DISABLED - migrated to JS animation

  // animation: header-slide-down vars.$hikari-duration-normal vars.$hikari-ease-smooth forwards;
}

// DISABLED - migrated to JS animation
// @keyframes header-slide-down {
//   from {
//     opacity: 0;
//     transform: translateY(-100%);
//   }
//   to {
//     opacity: 1;
//     transform: translateY(0);
//   }
// }

// Fade in animation
.hi-header-fade-in {
  // DISABLED - migrated to JS animation

  // animation: header-fade-in vars.$hikari-duration-normal vars.$hikari-ease-smooth forwards;
}

// DISABLED - migrated to JS animation
// @keyframes header-fade-in {
//   from {
//     opacity: 0;
//   }
//   to {
//     opacity: 1;
//   }
// }

// ============================================
// Header with Breadcrumb
// ============================================

.hi-header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--hi-primary);

  @include mix.mobile {
    display: none;
  }

  .hi-header-breadcrumb-item {
    font-size: vars.$hikari-font-size-sm;
    color: var(--hi-color-text-secondary);

    &.hi-header-breadcrumb-active {
      color: var(--hi-color-text-primary);
    }

    &:not(:last-child)::after {
      content: '/';
      margin-left: 0.5rem;
      opacity: 0.5;
    }
  }
}