@tangible/ui 0.2.41 → 0.2.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/components/CommandPalette/CommandPalette.d.ts +30 -0
  2. package/components/CommandPalette/CommandPalette.js +409 -0
  3. package/components/CommandPalette/CommandPaletteContext.d.ts +31 -0
  4. package/components/CommandPalette/CommandPaletteContext.js +8 -0
  5. package/components/CommandPalette/index.d.ts +3 -0
  6. package/components/CommandPalette/index.js +2 -0
  7. package/components/CommandPalette/shortcut.d.ts +15 -0
  8. package/components/CommandPalette/shortcut.js +83 -0
  9. package/components/CommandPalette/types.d.ts +152 -0
  10. package/components/CommandPalette/types.js +16 -0
  11. package/components/IconTile/IconTile.d.ts +16 -0
  12. package/components/IconTile/IconTile.js +17 -0
  13. package/components/IconTile/index.d.ts +2 -0
  14. package/components/IconTile/index.js +1 -0
  15. package/components/IconTile/types.d.ts +29 -0
  16. package/components/IconTile/types.js +1 -0
  17. package/components/SegmentedControl/SegmentedControl.js +2 -2
  18. package/components/SegmentedControl/types.d.ts +10 -0
  19. package/components/Table/DataTable.js +1 -1
  20. package/components/Table/types.d.ts +6 -0
  21. package/components/Table/types.js +3 -0
  22. package/components/index.d.ts +4 -0
  23. package/components/index.js +2 -0
  24. package/figma-tokens.json +101 -3
  25. package/icons/icons.svg +1 -1
  26. package/icons/sprite-version.js +1 -1
  27. package/icons/sprite.php +1 -1
  28. package/package.json +13 -1
  29. package/skills/building-with-tui/SKILL.md +15 -1
  30. package/styles/all.css +1 -1
  31. package/styles/all.expanded.css +514 -63
  32. package/styles/all.expanded.unlayered.css +514 -63
  33. package/styles/all.unlayered.css +1 -1
  34. package/styles/components/_bundle.scss +8 -0
  35. package/styles/components/avatar.scss +6 -23
  36. package/styles/components/button.scss +15 -15
  37. package/styles/components/chip.scss +35 -11
  38. package/styles/components/command-palette.scss +314 -0
  39. package/styles/components/content-indicator.scss +6 -1
  40. package/styles/components/date-picker.scss +1 -1
  41. package/styles/components/icon-button.scss +6 -7
  42. package/styles/components/icon-tile.scss +89 -0
  43. package/styles/components/input/index.scss +4 -0
  44. package/styles/components/multi-select.scss +1 -1
  45. package/styles/components/progress.scss +23 -0
  46. package/styles/components/segmented-control.scss +11 -1
  47. package/styles/components/step-indicator.scss +1 -1
  48. package/styles/components/tabs.scss +1 -1
  49. package/styles/core.css +1 -1
  50. package/styles/core.unlayered.css +1 -1
  51. package/styles/system/_constants.scss +5 -0
  52. package/styles/system/_palettes.scss +1 -0
  53. package/styles/system/_tokens.scss +40 -1
  54. package/tui-manifest.json +166 -2
  55. package/utils/color/theme.d.ts +66 -0
  56. package/utils/color/theme.js +232 -0
  57. package/vanilla/styles.css +1 -1
  58. package/vanilla/styles.unlayered.css +1 -1
@@ -9,6 +9,7 @@
9
9
  @use "./chip-group" as chipgroup;
10
10
  @use "./chips" as chips;
11
11
  @use "./combobox" as combobox;
12
+ @use "./command-palette" as commandpalette;
12
13
  @use "./color-picker" as colorpicker;
13
14
  @use "./gradient-picker" as gradientpicker;
14
15
  @use "./multi-combobox" as multicombobox;
@@ -21,6 +22,7 @@
21
22
  @use "./input/index" as input;
22
23
  @use "./icon" as icon;
23
24
  @use "./icon-button" as iconbutton;
25
+ @use "./icon-tile" as icontile;
24
26
  @use "./modal" as modal;
25
27
  @use "./move-handle" as movehandle;
26
28
  @use "./notice" as notice;
@@ -91,6 +93,11 @@ $-input-dependents: (input, field, text-input, textarea, pager, search-input, se
91
93
  @if -wants($only, chip-group) { @include chipgroup.styles(); }
92
94
  @if -wants($only, chips) { @include chips.styles(); }
93
95
  @if -wants($only, combobox) { @include combobox.styles(); }
96
+ // command-palette composes Modal and Button at runtime, and its Trigger
97
+ // wears .tui-input-group (TextInput's styles): a subset build requesting it
98
+ // must also request modal, button and text-input. Same latent gap as the
99
+ // other input-group hosts.
100
+ @if -wants($only, command-palette) { @include commandpalette.styles(); }
94
101
  @if -wants($only, color-picker) { @include colorpicker.styles(); }
95
102
  @if -wants($only, gradient-picker) { @include gradientpicker.styles(); }
96
103
  @if -wants($only, multi-combobox) { @include multicombobox.styles(); }
@@ -105,6 +112,7 @@ $-input-dependents: (input, field, text-input, textarea, pager, search-input, se
105
112
  @if -needs-input($only) { @include input.styles(); }
106
113
  @include icon.styles();
107
114
  @if -wants($only, icon-button) { @include iconbutton.styles(); }
115
+ @if -wants($only, icon-tile) { @include icontile.styles(); }
108
116
  @if -wants($only, modal) { @include modal.styles(); }
109
117
  @if -wants($only, move-handle) { @include movehandle.styles(); }
110
118
  @if -wants($only, notice) { @include notice.styles(); }
@@ -78,28 +78,11 @@
78
78
  // -------------------------------------------------------------------------
79
79
  // Sizes
80
80
  // -------------------------------------------------------------------------
81
- &.is-size-xs {
82
- --_size: var(--#{sys.$prefix}avatar-size, 1.5rem);
83
- }
84
-
85
- &.is-size-sm {
86
- --_size: var(--#{sys.$prefix}avatar-size, 2rem);
87
- }
88
-
89
- &.is-size-md {
90
- --_size: var(--#{sys.$prefix}avatar-size, 2.5rem);
91
- }
92
-
93
- &.is-size-lg {
94
- --_size: var(--#{sys.$prefix}avatar-size, 3rem);
95
- }
96
-
97
- &.is-size-xl {
98
- --_size: var(--#{sys.$prefix}avatar-size, 4rem);
99
- }
100
-
101
- &.is-size-xxl {
102
- --_size: var(--#{sys.$prefix}avatar-size, 5rem);
81
+ // The box ladder is shared with IconTile (sys.$box-sizes)
82
+ @each $size, $value in sys.$box-sizes {
83
+ &.is-size-#{$size} {
84
+ --_size: var(--#{sys.$prefix}avatar-size, #{$value});
85
+ }
103
86
  }
104
87
 
105
88
  // -------------------------------------------------------------------------
@@ -179,7 +162,7 @@
179
162
  .#{sys.$prefix}avatar__indicator {
180
163
  --_indicator-size: calc(var(--_size) * 0.35);
181
164
  --_indicator-bg: var(--#{sys.$prefix}avatar-indicator-bg, var(--#{sys.$prefix}theme-danger-base));
182
- --_indicator-fg: var(--#{sys.$prefix}avatar-indicator-fg, var(--#{sys.$prefix}color-fg-on-accent));
165
+ --_indicator-fg: var(--#{sys.$prefix}avatar-indicator-fg, var(--#{sys.$prefix}theme-danger-on-base));
183
166
 
184
167
  position: absolute;
185
168
  display: flex;
@@ -139,14 +139,14 @@ $_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
139
139
  .#{sys.$prefix}interface .#{sys.$prefix}button {
140
140
  // Internal tokens — read component API with fallback to primitives
141
141
  --_bg: var(--#{sys.$prefix}button-bg, var(--#{sys.$prefix}theme-primary-base));
142
- --_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}color-fg-on-accent));
142
+ --_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}theme-primary-on-base));
143
143
  --_border: var(--#{sys.$prefix}button-border, var(--#{sys.$prefix}theme-primary-base));
144
144
  --_radius: var(--#{sys.$prefix}button-radius, var(--#{sys.$prefix}radius-md));
145
145
 
146
146
  // Interact state fallbacks (default to darker variant)
147
- --_bg-interact: var(--#{sys.$prefix}button-bg-interact, var(--#{sys.$prefix}theme-primary-stronger));
148
- --_fg-interact: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}color-fg-on-accent));
149
- --_border-interact: var(--#{sys.$prefix}button-border-interact, var(--#{sys.$prefix}theme-primary-stronger));
147
+ --_bg-interact: var(--#{sys.$prefix}button-bg-interact, var(--_fill-interact-primary, var(--#{sys.$prefix}theme-primary-stronger)));
148
+ --_fg-interact: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}theme-primary-on-base));
149
+ --_border-interact: var(--#{sys.$prefix}button-border-interact, var(--_fill-interact-primary, var(--#{sys.$prefix}theme-primary-stronger)));
150
150
 
151
151
  // Shared typography, layout, and motion
152
152
  @include button-base;
@@ -286,7 +286,7 @@ $_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
286
286
  &:focus-visible,
287
287
  &:is(:active, [aria-pressed="true"]) {
288
288
  --_bg: var(--#{sys.$prefix}button-bg-interact, var(--#{sys.$prefix}theme-secondary-subtlest));
289
- --_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}theme-primary-base));
289
+ --_fg: var(--#{sys.$prefix}button-fg-interact, var(--_fg-interact-secondary, var(--#{sys.$prefix}theme-primary-base)));
290
290
  --_border: var(--#{sys.$prefix}button-border-interact, var(--#{sys.$prefix}theme-secondary-subtlest));
291
291
  }
292
292
  }
@@ -296,15 +296,15 @@ $_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
296
296
  @each $status in (danger, success, warning, info) {
297
297
  &.is-theme-#{$status} {
298
298
  --_bg: var(--#{sys.$prefix}button-bg, var(--#{sys.$prefix}theme-#{$status}-base));
299
- --_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}color-fg-on-accent));
299
+ --_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}theme-#{$status}-on-base));
300
300
  --_border: var(--#{sys.$prefix}button-border, var(--#{sys.$prefix}theme-#{$status}-base));
301
301
 
302
302
  &:hover,
303
303
  &:focus-visible,
304
304
  &:is(:active, [aria-pressed="true"]) {
305
- --_bg: var(--#{sys.$prefix}button-bg-interact, var(--#{sys.$prefix}theme-#{$status}-stronger));
306
- --_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}color-fg-on-accent));
307
- --_border: var(--#{sys.$prefix}button-border-interact, var(--#{sys.$prefix}theme-#{$status}-stronger));
305
+ --_bg: var(--#{sys.$prefix}button-bg-interact, var(--_fill-interact-#{$status}, var(--#{sys.$prefix}theme-#{$status}-stronger)));
306
+ --_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}theme-#{$status}-on-base));
307
+ --_border: var(--#{sys.$prefix}button-border-interact, var(--_fill-interact-#{$status}, var(--#{sys.$prefix}theme-#{$status}-stronger)));
308
308
  }
309
309
  }
310
310
  }
@@ -321,7 +321,7 @@ $_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
321
321
  &:focus-visible,
322
322
  &:is(:active, [aria-pressed="true"]) {
323
323
  --_bg: var(--#{sys.$prefix}button-bg-interact, var(--#{sys.$prefix}theme-primary-base));
324
- --_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}color-fg-on-accent));
324
+ --_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}theme-primary-on-base));
325
325
  --_border: var(--#{sys.$prefix}button-border-interact, var(--#{sys.$prefix}theme-primary-base));
326
326
  }
327
327
  }
@@ -350,7 +350,7 @@ $_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
350
350
  &:focus-visible,
351
351
  &:is(:active, [aria-pressed="true"]) {
352
352
  --_bg: var(--#{sys.$prefix}button-bg-interact, var(--#{sys.$prefix}theme-#{$status}-base));
353
- --_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}color-fg-on-accent));
353
+ --_fg: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}theme-#{$status}-on-base));
354
354
  --_border: var(--#{sys.$prefix}button-border-interact, var(--#{sys.$prefix}theme-#{$status}-base));
355
355
  }
356
356
  }
@@ -482,12 +482,12 @@ $_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
482
482
  // white text (#116).
483
483
  &::file-selector-button {
484
484
  --_bg: var(--#{sys.$prefix}button-bg, var(--#{sys.$prefix}theme-primary-base));
485
- --_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}color-fg-on-accent));
485
+ --_fg: var(--#{sys.$prefix}button-fg, var(--#{sys.$prefix}theme-primary-on-base));
486
486
  --_border: var(--#{sys.$prefix}button-border, var(--#{sys.$prefix}theme-primary-base));
487
487
  --_radius: var(--#{sys.$prefix}button-radius, var(--#{sys.$prefix}radius-md));
488
- --_bg-interact: var(--#{sys.$prefix}button-bg-interact, var(--#{sys.$prefix}theme-primary-stronger));
489
- --_fg-interact: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}color-fg-on-accent));
490
- --_border-interact: var(--#{sys.$prefix}button-border-interact, var(--#{sys.$prefix}theme-primary-stronger));
488
+ --_bg-interact: var(--#{sys.$prefix}button-bg-interact, var(--_fill-interact-primary, var(--#{sys.$prefix}theme-primary-stronger)));
489
+ --_fg-interact: var(--#{sys.$prefix}button-fg-interact, var(--#{sys.$prefix}theme-primary-on-base));
490
+ --_border-interact: var(--#{sys.$prefix}button-border-interact, var(--_fill-interact-primary, var(--#{sys.$prefix}theme-primary-stronger)));
491
491
 
492
492
  @include button-base;
493
493
 
@@ -368,10 +368,17 @@
368
368
  --_border: var(--#{sys.$prefix}chip-border, var(--#{sys.$prefix}theme-danger-base));
369
369
  }
370
370
 
371
- // Outline selected: fill with border color
371
+ // Outline selected: fill with border color, text in that theme's
372
+ // on-base (dark mode puts dark text on the lighter status fills).
372
373
  &.is-selected.is-style-outline {
373
374
  --_bg: var(--_border);
374
- --_fg: var(--#{sys.$prefix}color-fg-on-accent);
375
+ --_fg: var(--#{sys.$prefix}theme-secondary-on-base);
376
+ }
377
+
378
+ @each $theme in (primary, secondary, success, warning, danger) {
379
+ &.is-selected.is-style-outline.is-theme-#{$theme} {
380
+ --_fg: var(--#{sys.$prefix}theme-#{$theme}-on-base);
381
+ }
375
382
  }
376
383
 
377
384
  // -------------------------------------------------------------------------
@@ -379,8 +386,8 @@
379
386
  // -------------------------------------------------------------------------
380
387
  &.is-style-solid {
381
388
  --_bg: var(--#{sys.$prefix}chip-bg, var(--#{sys.$prefix}theme-secondary-base));
382
- --_fg: var(--#{sys.$prefix}chip-fg, var(--#{sys.$prefix}color-fg-on-accent));
383
- --_icon: var(--#{sys.$prefix}chip-icon, var(--#{sys.$prefix}color-fg-on-accent));
389
+ --_fg: var(--#{sys.$prefix}chip-fg, var(--#{sys.$prefix}theme-secondary-on-base));
390
+ --_icon: var(--#{sys.$prefix}chip-icon, var(--#{sys.$prefix}theme-secondary-on-base));
384
391
  --_border: var(--#{sys.$prefix}chip-border, var(--#{sys.$prefix}theme-secondary-base));
385
392
 
386
393
  &.is-interactive,
@@ -403,7 +410,8 @@
403
410
 
404
411
  &.is-style-solid.is-theme-primary {
405
412
  --_bg: var(--#{sys.$prefix}chip-bg, var(--#{sys.$prefix}theme-primary-base));
406
- --_fg: var(--#{sys.$prefix}chip-fg, var(--#{sys.$prefix}color-fg-on-accent));
413
+ --_fg: var(--#{sys.$prefix}chip-fg, var(--#{sys.$prefix}theme-primary-on-base));
414
+ --_icon: var(--#{sys.$prefix}chip-icon, var(--#{sys.$prefix}theme-primary-on-base));
407
415
  --_border: var(--#{sys.$prefix}chip-border, var(--#{sys.$prefix}theme-primary-base));
408
416
 
409
417
  &.is-interactive,
@@ -411,22 +419,35 @@
411
419
  &:has(input[type="checkbox"], input[type="radio"]) {
412
420
  @media (hover: hover) {
413
421
  &:not(:disabled):not([aria-disabled="true"]):hover {
414
- --_bg: var(--#{sys.$prefix}theme-primary-strong);
415
- --_border: var(--#{sys.$prefix}theme-primary-strong);
422
+ --_bg: var(--_fill-interact-primary, var(--#{sys.$prefix}theme-primary-strong));
423
+ --_border: var(--_fill-interact-primary, var(--#{sys.$prefix}theme-primary-strong));
424
+
425
+ // A hovered selected chip. Light shows the hover rung, as before;
426
+ // dark keeps the selected fill, because its text is dark there.
427
+ &:is(:active, [aria-pressed="true"], .is-selected),
428
+ &:has(input:checked) {
429
+ --_bg: var(--_fill-selected-hover-primary, var(--#{sys.$prefix}theme-primary-strong));
430
+ --_border: var(--_fill-selected-hover-primary, var(--#{sys.$prefix}theme-primary-strong));
431
+ }
416
432
  }
417
433
  }
418
434
 
435
+ // Selected keeps the -stronger rung in both modes. In dark that rung
436
+ // is light, so the text goes dark, like the selected status chips.
419
437
  &:is(:active, [aria-pressed="true"], .is-selected),
420
438
  &:has(input:checked) {
421
439
  --_bg: var(--#{sys.$prefix}theme-primary-stronger);
422
440
  --_border: var(--#{sys.$prefix}theme-primary-stronger);
441
+ --_fg: var(--#{sys.$prefix}chip-fg, var(--_fg-selected-primary, var(--#{sys.$prefix}theme-primary-on-base)));
442
+ --_icon: var(--#{sys.$prefix}chip-icon, var(--_fg-selected-primary, var(--#{sys.$prefix}theme-primary-on-base)));
423
443
  }
424
444
  }
425
445
  }
426
446
 
427
447
  &.is-style-solid.is-theme-secondary {
428
448
  --_bg: var(--#{sys.$prefix}chip-bg, var(--#{sys.$prefix}theme-secondary-base));
429
- --_fg: var(--#{sys.$prefix}chip-fg, var(--#{sys.$prefix}color-fg-on-accent));
449
+ --_fg: var(--#{sys.$prefix}chip-fg, var(--#{sys.$prefix}theme-secondary-on-base));
450
+ --_icon: var(--#{sys.$prefix}chip-icon, var(--#{sys.$prefix}theme-secondary-on-base));
430
451
  --_border: var(--#{sys.$prefix}chip-border, var(--#{sys.$prefix}theme-secondary-base));
431
452
 
432
453
  &.is-interactive,
@@ -449,7 +470,8 @@
449
470
 
450
471
  &.is-style-solid.is-theme-success {
451
472
  --_bg: var(--#{sys.$prefix}chip-bg, var(--#{sys.$prefix}theme-success-base));
452
- --_fg: var(--#{sys.$prefix}chip-fg, var(--#{sys.$prefix}color-fg-on-accent));
473
+ --_fg: var(--#{sys.$prefix}chip-fg, var(--#{sys.$prefix}theme-success-on-base));
474
+ --_icon: var(--#{sys.$prefix}chip-icon, var(--#{sys.$prefix}theme-success-on-base));
453
475
  --_border: var(--#{sys.$prefix}chip-border, var(--#{sys.$prefix}theme-success-base));
454
476
 
455
477
  &.is-interactive,
@@ -472,7 +494,8 @@
472
494
 
473
495
  &.is-style-solid.is-theme-warning {
474
496
  --_bg: var(--#{sys.$prefix}chip-bg, var(--#{sys.$prefix}theme-warning-base));
475
- --_fg: var(--#{sys.$prefix}chip-fg, var(--#{sys.$prefix}color-fg-on-accent));
497
+ --_fg: var(--#{sys.$prefix}chip-fg, var(--#{sys.$prefix}theme-warning-on-base));
498
+ --_icon: var(--#{sys.$prefix}chip-icon, var(--#{sys.$prefix}theme-warning-on-base));
476
499
  --_border: var(--#{sys.$prefix}chip-border, var(--#{sys.$prefix}theme-warning-base));
477
500
 
478
501
  &.is-interactive,
@@ -495,7 +518,8 @@
495
518
 
496
519
  &.is-style-solid.is-theme-danger {
497
520
  --_bg: var(--#{sys.$prefix}chip-bg, var(--#{sys.$prefix}theme-danger-base));
498
- --_fg: var(--#{sys.$prefix}chip-fg, var(--#{sys.$prefix}color-fg-on-accent));
521
+ --_fg: var(--#{sys.$prefix}chip-fg, var(--#{sys.$prefix}theme-danger-on-base));
522
+ --_icon: var(--#{sys.$prefix}chip-icon, var(--#{sys.$prefix}theme-danger-on-base));
499
523
  --_border: var(--#{sys.$prefix}chip-border, var(--#{sys.$prefix}theme-danger-base));
500
524
 
501
525
  &.is-interactive,
@@ -0,0 +1,314 @@
1
+ @use "../system" as sys;
2
+
3
+ /* @tui-tokens
4
+ --tui-command-palette-width
5
+ --tui-command-palette-offset-top
6
+ --tui-command-palette-list-max-height
7
+ --tui-command-palette-option-bg-hover
8
+ --tui-command-palette-option-fg-hover
9
+ --tui-command-palette-option-indicator
10
+ --tui-command-palette-kbd-bg
11
+ --tui-command-palette-kbd-fg
12
+ --tui-command-palette-trigger-bg
13
+ --tui-command-palette-trigger-fg
14
+ --tui-command-palette-trigger-border
15
+ --tui-command-palette-trigger-border-hover
16
+ --tui-command-palette-trigger-radius
17
+ */
18
+
19
+ // The narrow sheet starts below this width: a viewport query, because the
20
+ // sheet IS the viewport, so there's no container to ask.
21
+ $_sheet-below: 48rem;
22
+
23
+ @mixin styles() {
24
+ // ==========================================================================
25
+ // CommandPalette
26
+ // ==========================================================================
27
+ //
28
+ // The palette is a Modal (.tui-modal__dialog.tui-command-palette), so the
29
+ // box itself (bg, border, radius, shadow, backdrop) reads --tui-modal-*.
30
+ // The highlighted item reads the shared --tui-listbox-* layer underneath
31
+ // its own token, like every listbox.
32
+ //
33
+ // Component API tokens (never defined here, only read via fallback):
34
+ // --tui-command-palette-width Box width (default --tui-modal-max, then 40rem)
35
+ // --tui-command-palette-offset-top Gap above the box (default min(12vh, 5rem))
36
+ // --tui-command-palette-list-max-height Results height before scrolling
37
+ // --tui-command-palette-option-bg-hover / -fg-hover Highlighted item
38
+ // --tui-command-palette-option-indicator The highlighted item's leading bar (NavMenu's vertical indicator shape)
39
+ // --tui-command-palette-kbd-bg / -fg Key hints
40
+ // --tui-command-palette-trigger-bg / -fg / -border / -border-hover / -radius
41
+ //
42
+ // ==========================================================================
43
+
44
+ // (0,3,0): out-weighs Modal's own size presets, which set --_max at (0,2,0).
45
+ .#{sys.$prefix}interface .#{sys.$prefix}modal__dialog.#{sys.$prefix}command-palette {
46
+ --_max: var(--#{sys.$prefix}command-palette-width, var(--#{sys.$prefix}modal-max, 40rem));
47
+ --_min-body: 0rem;
48
+
49
+ // Top-anchored, not centred: results grow downward without the field moving.
50
+ margin-block: var(--#{sys.$prefix}command-palette-offset-top, min(12vh, 5rem)) auto;
51
+ }
52
+
53
+ // ---- Search row ------------------------------------------------------------
54
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette__search {
55
+ display: flex;
56
+ flex: none;
57
+ align-items: center;
58
+ gap: var(--#{sys.$prefix}spacing-xs);
59
+ padding: var(--#{sys.$prefix}spacing-sm) var(--#{sys.$prefix}spacing-md);
60
+ border-block-end: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}color-divider);
61
+ }
62
+
63
+ // The field's focus indicator: the row's bottom edge in the focus colour,
64
+ // doubled with an inset shadow so the layout doesn't shift.
65
+ .#{sys.$prefix}interface .#{sys.$prefix}command-palette__search:has(> .#{sys.$prefix}command-palette__input:focus) {
66
+ border-block-end-color: var(--#{sys.$prefix}focus-ring-color);
67
+ box-shadow: inset 0 calc(-1 * var(--#{sys.$prefix}border-width)) 0 var(--#{sys.$prefix}focus-ring-color);
68
+ }
69
+
70
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette__search-icon {
71
+ flex: none;
72
+ color: var(--#{sys.$prefix}color-fg-muted);
73
+ }
74
+
75
+ // A full-specificity element rule: themed inputs need it to beat host CSS.
76
+ .#{sys.$prefix}interface .#{sys.$prefix}command-palette__input {
77
+ flex: 1;
78
+ min-width: 0;
79
+ margin: 0;
80
+ padding: var(--#{sys.$prefix}spacing-xxs) 0;
81
+ border: 0;
82
+ background: transparent;
83
+ color: inherit;
84
+ font: inherit;
85
+ font-size: var(--#{sys.$prefix}typography-size-lg);
86
+ box-shadow: none;
87
+
88
+ // A ring here would box the whole search row; the row's bottom edge
89
+ // carries the focus indicator instead (see __search above).
90
+ &:focus,
91
+ &:focus-visible {
92
+ outline: none;
93
+ }
94
+
95
+ &::placeholder {
96
+ color: var(--#{sys.$prefix}color-fg-muted);
97
+ opacity: 1;
98
+ }
99
+ }
100
+
101
+ // ---- Key hints -------------------------------------------------------------
102
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette__kbd {
103
+ display: inline-flex;
104
+ align-items: center;
105
+ justify-content: center;
106
+ min-inline-size: 1.5em;
107
+ padding: 0.125em 0.375em;
108
+ border-radius: var(--#{sys.$prefix}radius-xs);
109
+ background: var(--#{sys.$prefix}command-palette-kbd-bg, var(--#{sys.$prefix}color-fill-subtle));
110
+ color: var(--#{sys.$prefix}command-palette-kbd-fg, var(--#{sys.$prefix}color-fg-secondary));
111
+ font-family: inherit;
112
+ font-size: var(--#{sys.$prefix}typography-size-xs);
113
+ white-space: nowrap;
114
+ }
115
+
116
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette__esc {
117
+ flex: none;
118
+ }
119
+
120
+ // Narrow screens swap the Esc hint for a Cancel button (see the media query).
121
+ .#{sys.$prefix}interface .#{sys.$prefix}command-palette__search .#{sys.$prefix}command-palette__cancel {
122
+ display: none;
123
+ }
124
+
125
+ // ---- Results ---------------------------------------------------------------
126
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette__list {
127
+ flex: 0 1 auto;
128
+ max-block-size: var(--#{sys.$prefix}command-palette-list-max-height, min(60vh, 28rem));
129
+ overflow-y: auto;
130
+ overscroll-behavior: contain;
131
+ padding: var(--#{sys.$prefix}spacing-xs);
132
+
133
+ &:not(:has([role="option"])) {
134
+ display: none;
135
+ }
136
+ }
137
+
138
+ // A group whose items all filtered out hides, heading and all.
139
+ :where(.#{sys.$prefix}interface)
140
+ .#{sys.$prefix}command-palette__group:not(:has(.#{sys.$prefix}command-palette__item)) {
141
+ display: none;
142
+ }
143
+
144
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette__label {
145
+ padding: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-xxs);
146
+ @include sys.text-style(sys.$prefix, overline);
147
+ }
148
+
149
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette__item {
150
+ --_bg-active: var(--#{sys.$prefix}command-palette-option-bg-hover, var(--#{sys.$prefix}listbox-option-bg-hover, var(--#{sys.$prefix}color-fill-subtle)));
151
+ --_fg-active: var(--#{sys.$prefix}command-palette-option-fg-hover, var(--#{sys.$prefix}listbox-option-fg-hover, inherit));
152
+ --_indicator: var(--#{sys.$prefix}command-palette-option-indicator, var(--#{sys.$prefix}theme-primary-base));
153
+
154
+ position: relative;
155
+ display: flex;
156
+ align-items: center;
157
+ gap: var(--#{sys.$prefix}spacing-sm);
158
+ padding: var(--#{sys.$prefix}spacing-xs);
159
+ border-radius: var(--#{sys.$prefix}listbox-option-radius, var(--#{sys.$prefix}radius-sm));
160
+ color: inherit;
161
+ cursor: pointer;
162
+ user-select: none;
163
+
164
+ // The fill alone measures about 1.05:1 on the panel, and the highlight is
165
+ // where keyboard focus is (aria-activedescendant), so it also gets a bar:
166
+ // NavMenu's vertical indicator, a pseudo-element over the middle half of
167
+ // the row, so it never follows the row's rounded corner (an inset shadow
168
+ // or border-inline-start runs thick to thin round it).
169
+ &[data-highlighted] {
170
+ background-color: var(--_bg-active);
171
+ color: var(--_fg-active);
172
+
173
+ &::before {
174
+ content: "";
175
+ position: absolute;
176
+ inset-inline-start: 0;
177
+ inset-block: 25%;
178
+ inline-size: 3px;
179
+ border-start-end-radius: var(--#{sys.$prefix}radius-xs);
180
+ border-end-end-radius: var(--#{sys.$prefix}radius-xs);
181
+ background: var(--_indicator);
182
+ }
183
+ }
184
+
185
+ &[data-disabled] {
186
+ opacity: var(--#{sys.$prefix}opacity-disabled);
187
+ cursor: not-allowed;
188
+ }
189
+ }
190
+
191
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette__item-icon {
192
+ flex: none;
193
+ color: var(--#{sys.$prefix}color-fg-secondary);
194
+ }
195
+
196
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette__item-text {
197
+ display: grid;
198
+ flex: 1;
199
+ min-width: 0;
200
+ }
201
+
202
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette__item-label,
203
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette__item-description {
204
+ overflow: hidden;
205
+ text-overflow: ellipsis;
206
+ white-space: nowrap;
207
+ }
208
+
209
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette__item-description {
210
+ color: var(--#{sys.$prefix}color-fg-secondary);
211
+ font-size: var(--#{sys.$prefix}typography-size-sm);
212
+ }
213
+
214
+ // ---- Loading, error, no results -----------------------------------------------
215
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette__message {
216
+ display: flex;
217
+ flex-direction: column;
218
+ align-items: center;
219
+ gap: var(--#{sys.$prefix}spacing-sm);
220
+ padding: var(--#{sys.$prefix}spacing-lg) var(--#{sys.$prefix}spacing-md);
221
+ color: var(--#{sys.$prefix}color-fg-secondary);
222
+ text-align: center;
223
+
224
+ p {
225
+ margin: 0;
226
+ }
227
+ }
228
+
229
+ // ---- Hints footer ----------------------------------------------------------
230
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette__hints {
231
+ display: flex;
232
+ flex: none;
233
+ flex-wrap: wrap;
234
+ gap: var(--#{sys.$prefix}spacing-md);
235
+ padding: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-md);
236
+ border-block-start: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}color-divider);
237
+ color: var(--#{sys.$prefix}color-fg-secondary);
238
+ font-size: var(--#{sys.$prefix}typography-size-xs);
239
+ }
240
+
241
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette__hint {
242
+ display: inline-flex;
243
+ align-items: center;
244
+ gap: var(--#{sys.$prefix}spacing-xxs);
245
+ }
246
+
247
+ // ---- Narrow screens: a full-height sheet ------------------------------------
248
+ @media (width < #{$_sheet-below}) {
249
+ .#{sys.$prefix}interface .#{sys.$prefix}modal:has(> .#{sys.$prefix}command-palette) {
250
+ padding: 0;
251
+ }
252
+
253
+ .#{sys.$prefix}interface .#{sys.$prefix}modal__dialog.#{sys.$prefix}command-palette {
254
+ --_max: none;
255
+ block-size: 100dvh;
256
+ max-block-size: 100dvh;
257
+ margin: 0;
258
+ border: 0;
259
+ border-radius: 0;
260
+ }
261
+
262
+ .#{sys.$prefix}interface .#{sys.$prefix}command-palette__list {
263
+ flex: 1 1 auto;
264
+ max-block-size: none;
265
+ }
266
+
267
+ .#{sys.$prefix}interface .#{sys.$prefix}command-palette__esc,
268
+ .#{sys.$prefix}interface .#{sys.$prefix}command-palette__hints {
269
+ display: none;
270
+ }
271
+
272
+ .#{sys.$prefix}interface .#{sys.$prefix}command-palette__search .#{sys.$prefix}command-palette__cancel {
273
+ display: inline-flex;
274
+ }
275
+ }
276
+
277
+ // ---- Trigger ---------------------------------------------------------------
278
+ // Chrome from .tui-input-group (hosts set --_border-rest, not --_border).
279
+ .#{sys.$prefix}interface .#{sys.$prefix}command-palette-trigger {
280
+ --_bg: var(--#{sys.$prefix}command-palette-trigger-bg, var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface)));
281
+ --_fg: var(--#{sys.$prefix}command-palette-trigger-fg, var(--#{sys.$prefix}color-fg-muted));
282
+ --_border-rest: var(--#{sys.$prefix}command-palette-trigger-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control)));
283
+ --_border-hover: var(--#{sys.$prefix}command-palette-trigger-border-hover, var(--#{sys.$prefix}input-border-hover, var(--_border-rest)));
284
+ --_radius: var(--#{sys.$prefix}command-palette-trigger-radius, var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md)));
285
+
286
+ gap: var(--#{sys.$prefix}spacing-xs);
287
+ padding-inline: var(--#{sys.$prefix}spacing-xs);
288
+ cursor: pointer;
289
+ text-align: start;
290
+ }
291
+
292
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette-trigger__icon {
293
+ flex: none;
294
+ }
295
+
296
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}command-palette-trigger__text {
297
+ flex: 1;
298
+ overflow: hidden;
299
+ text-overflow: ellipsis;
300
+ white-space: nowrap;
301
+ }
302
+
303
+ @media (forced-colors: active) {
304
+ .#{sys.$prefix}interface .#{sys.$prefix}command-palette__item[data-highlighted] {
305
+ forced-color-adjust: none;
306
+ background: Highlight;
307
+ color: HighlightText;
308
+ }
309
+
310
+ .#{sys.$prefix}interface .#{sys.$prefix}command-palette__kbd {
311
+ border: 1px solid CanvasText;
312
+ }
313
+ }
314
+ }
@@ -79,7 +79,7 @@
79
79
  background: var(--_border); // Use border color as fill
80
80
 
81
81
  .#{sys.$prefix}icon {
82
- color: var(--#{sys.$prefix}color-fg-on-accent);
82
+ color: var(--_on, var(--#{sys.$prefix}theme-secondary-on-base));
83
83
  }
84
84
  }
85
85
 
@@ -87,26 +87,31 @@
87
87
  // Themes
88
88
  // -------------------------------------------------------------------------
89
89
  &.is-theme-default {
90
+ --_on: var(--#{sys.$prefix}theme-secondary-on-base);
90
91
  --_border: var(--#{sys.$prefix}color-fg-muted);
91
92
  --_fg: var(--#{sys.$prefix}color-fg-muted);
92
93
  }
93
94
 
94
95
  &.is-theme-info {
96
+ --_on: var(--#{sys.$prefix}theme-info-on-base);
95
97
  --_border: var(--#{sys.$prefix}theme-info-base);
96
98
  --_fg: var(--#{sys.$prefix}theme-info-base);
97
99
  }
98
100
 
99
101
  &.is-theme-success {
102
+ --_on: var(--#{sys.$prefix}theme-success-on-base);
100
103
  --_border: var(--#{sys.$prefix}theme-success-base);
101
104
  --_fg: var(--#{sys.$prefix}theme-success-base);
102
105
  }
103
106
 
104
107
  &.is-theme-warning {
108
+ --_on: var(--#{sys.$prefix}theme-warning-on-base);
105
109
  --_border: var(--#{sys.$prefix}theme-warning-base);
106
110
  --_fg: var(--#{sys.$prefix}theme-warning-base);
107
111
  }
108
112
 
109
113
  &.is-theme-danger {
114
+ --_on: var(--#{sys.$prefix}theme-danger-on-base);
110
115
  --_border: var(--#{sys.$prefix}theme-danger-base);
111
116
  --_fg: var(--#{sys.$prefix}theme-danger-base);
112
117
  }
@@ -49,7 +49,7 @@
49
49
  font-size: var(--#{sys.$prefix}control-font-size-md, inherit);
50
50
  --_cell-radius: var(--#{sys.$prefix}calendar-cell-radius, var(--#{sys.$prefix}radius-full, 999px));
51
51
  --_selected-bg: var(--#{sys.$prefix}calendar-selected-bg, var(--#{sys.$prefix}theme-primary-base));
52
- --_selected-fg: var(--#{sys.$prefix}calendar-selected-fg, var(--#{sys.$prefix}color-fg-on-accent));
52
+ --_selected-fg: var(--#{sys.$prefix}calendar-selected-fg, var(--#{sys.$prefix}theme-primary-on-base));
53
53
  --_range-bg: var(--#{sys.$prefix}calendar-range-bg, var(--#{sys.$prefix}color-bg-muted));
54
54
  --_today-bg: var(--#{sys.$prefix}calendar-today-bg, var(--#{sys.$prefix}color-bg-muted));
55
55
  --_caption: var(--#{sys.$prefix}calendar-caption-color, var(--#{sys.$prefix}theme-primary-base));