@teamofsilicons/silicon-ui 0.1.0 → 0.3.0

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 (112) hide show
  1. package/README.md +21 -2
  2. package/check.mjs +245 -0
  3. package/components/activity-heatmap/activity-heatmap.module.css +4 -4
  4. package/components/alert/alert.module.css +1 -1
  5. package/components/announcement-bar/announcement-bar.module.css +6 -6
  6. package/components/avatar/avatar.d.ts +2 -2
  7. package/components/avatar/avatar.js +1 -1
  8. package/components/avatar/avatar.module.css +5 -2
  9. package/components/avatar-group/avatar-group.module.css +4 -4
  10. package/components/badge/badge.module.css +4 -4
  11. package/components/bar-chart/bar-chart.module.css +4 -4
  12. package/components/billing-toggle/billing-toggle.module.css +10 -10
  13. package/components/bottom-sheet/bottom-sheet.module.css +4 -5
  14. package/components/breadcrumb/breadcrumb.d.ts +8 -2
  15. package/components/breadcrumb/breadcrumb.js +21 -9
  16. package/components/breadcrumb/breadcrumb.module.css +7 -3
  17. package/components/brush-chart/brush-chart.module.css +9 -9
  18. package/components/button/button.d.ts +7 -2
  19. package/components/button/button.js +3 -1
  20. package/components/button/button.module.css +10 -1
  21. package/components/button-group/button-group.module.css +6 -6
  22. package/components/calendar/calendar.module.css +7 -7
  23. package/components/card/card.module.css +2 -2
  24. package/components/card-stack/card-stack.module.css +2 -3
  25. package/components/carousel/carousel.module.css +2 -2
  26. package/components/chat-thread/chat-thread.module.css +41 -41
  27. package/components/checkbox/checkbox.module.css +1 -1
  28. package/components/chip-group/chip-group.module.css +2 -2
  29. package/components/code-block/code-block.module.css +7 -14
  30. package/components/color-picker/color-picker.module.css +20 -21
  31. package/components/combobox/combobox.module.css +2 -2
  32. package/components/command-palette/command-palette.module.css +18 -18
  33. package/components/comment-thread/comment-thread.module.css +35 -35
  34. package/components/confirm-morph/confirm-morph.module.css +9 -9
  35. package/components/context-menu/context-menu.module.css +3 -3
  36. package/components/countdown/countdown.module.css +4 -4
  37. package/components/date-picker/date-picker.module.css +6 -6
  38. package/components/date-range-picker/date-range-picker.module.css +21 -21
  39. package/components/dialog/dialog.module.css +2 -2
  40. package/components/donut-chart/donut-chart.module.css +4 -4
  41. package/components/drawer/drawer.module.css +5 -5
  42. package/components/dropdown-menu/dropdown-menu.d.ts +71 -1
  43. package/components/dropdown-menu/dropdown-menu.js +100 -6
  44. package/components/dropdown-menu/dropdown-menu.module.css +15 -5
  45. package/components/elastic-slider/elastic-slider.module.css +4 -4
  46. package/components/expandable-card/expandable-card.module.css +1 -1
  47. package/components/expanding-button-group/expanding-button-group.module.css +1 -1
  48. package/components/expanding-search/expanding-search.module.css +9 -9
  49. package/components/file-dropzone/file-dropzone.module.css +21 -21
  50. package/components/file-upload/file-upload.module.css +7 -7
  51. package/components/filter-toolbar/filter-toolbar.module.css +9 -9
  52. package/components/floating-button-group/floating-button-group.module.css +6 -6
  53. package/components/gauge/gauge.module.css +2 -2
  54. package/components/hover-card/hover-card.module.css +2 -2
  55. package/components/image-compare/image-compare.module.css +4 -4
  56. package/components/inline-edit/inline-edit.module.css +12 -12
  57. package/components/json-viewer/json-viewer.module.css +12 -12
  58. package/components/line-chart/line-chart.module.css +8 -8
  59. package/components/mention-input/mention-input.module.css +8 -8
  60. package/components/metric-card/metric-card.module.css +1 -1
  61. package/components/money-input/money-input.module.css +9 -9
  62. package/components/morph-select/morph-select.module.css +13 -13
  63. package/components/multi-select/multi-select.module.css +6 -6
  64. package/components/nav-list/nav-list.d.ts +64 -0
  65. package/components/nav-list/nav-list.js +103 -0
  66. package/components/nav-list/nav-list.module.css +25 -0
  67. package/components/notification-center/notification-center.module.css +27 -27
  68. package/components/number-field/number-field.module.css +2 -2
  69. package/components/otp-input/otp-input.module.css +4 -4
  70. package/components/password-field/password-field.module.css +1 -1
  71. package/components/password-strength/password-strength.module.css +7 -7
  72. package/components/phone-input/phone-input.module.css +19 -19
  73. package/components/popover/popover.module.css +2 -2
  74. package/components/progress/progress.module.css +1 -1
  75. package/components/radio-cards/radio-cards.module.css +8 -8
  76. package/components/radio-group/radio-group.module.css +1 -1
  77. package/components/resizable-panels/resizable-panels.module.css +5 -5
  78. package/components/rich-text-editor/rich-text-editor.module.css +12 -12
  79. package/components/ridgeline/ridgeline.module.css +7 -7
  80. package/components/scroll-area/scroll-area.module.css +8 -8
  81. package/components/segmented-control/segmented-control.d.ts +3 -1
  82. package/components/segmented-control/segmented-control.js +2 -2
  83. package/components/segmented-control/segmented-control.module.css +7 -4
  84. package/components/select/select.module.css +5 -5
  85. package/components/shortcut-recorder/shortcut-recorder.module.css +15 -15
  86. package/components/signature-pad/signature-pad.module.css +11 -11
  87. package/components/slider/slider.module.css +4 -4
  88. package/components/slope-chart/slope-chart.module.css +7 -7
  89. package/components/sortable-data-table/sortable-data-table.module.css +4 -4
  90. package/components/split-button/split-button.module.css +5 -5
  91. package/components/stepper/stepper.module.css +3 -3
  92. package/components/streamgraph/streamgraph.module.css +7 -7
  93. package/components/swipe-actions/swipe-actions.module.css +5 -5
  94. package/components/switch/switch.module.css +1 -1
  95. package/components/tabs/tabs.d.ts +9 -2
  96. package/components/tabs/tabs.js +4 -2
  97. package/components/tabs/tabs.module.css +7 -2
  98. package/components/tag-input/tag-input.module.css +4 -4
  99. package/components/time-picker/time-picker.module.css +3 -3
  100. package/components/timeline/timeline.module.css +3 -3
  101. package/components/toast/toast.module.css +5 -5
  102. package/components/toast-stack/toast-stack.module.css +5 -5
  103. package/components/tooltip/tooltip.module.css +1 -1
  104. package/components/tree-view/tree-view.module.css +7 -7
  105. package/components/treemap/treemap.module.css +13 -13
  106. package/components/usage-meter/usage-meter.module.css +5 -5
  107. package/components/user-menu/user-menu.module.css +22 -22
  108. package/components/waffle-chart/waffle-chart.module.css +7 -7
  109. package/components.json +416 -1
  110. package/eslint.js +85 -0
  111. package/package.json +12 -2
  112. package/styles.css +44 -4
@@ -5,7 +5,7 @@
5
5
  .field[data-level="3"], .field[data-level="4"] { --tone: var(--success); }
6
6
  .label { margin-bottom: var(--space-related); color: var(--foreground); font-size: var(--text-sm); font-weight: 500; line-height: var(--leading-body); }
7
7
  /* The shell only transitions color; its sideways shake is a spring on transform, so the two never fight. */
8
- .shell { display: flex; min-height: var(--control-height-md); align-items: center; gap: var(--space-tight); padding: 0 5px 0 var(--space-inset); border: 1px solid var(--border-strong); border-radius: var(--radius-control); corner-shape: var(--corner-shape); background: var(--surface); transition: border-color var(--duration-fast) var(--ease-standard); }
8
+ .shell { display: flex; min-height: var(--control-height-md); align-items: center; gap: var(--space-tight); padding: 0 var(--space-tight) 0 var(--space-inset); border: 1px solid var(--border-strong); border-radius: var(--radius-control); corner-shape: var(--corner-shape); background: var(--surface); transition: border-color var(--duration-fast) var(--ease-standard); }
9
9
  @media (hover: hover) and (pointer: fine) { .shell:hover:not(:focus-within) { border-color: var(--text-muted); } }
10
10
  .shell:focus-within { border-color: var(--foreground); }
11
11
  .shell:has(.input[aria-invalid="true"]) { border-color: var(--danger); }
@@ -18,7 +18,7 @@
18
18
  .input[data-reveal="hidden"] { animation: resolve-hidden var(--duration-standard) var(--ease-enter); }
19
19
  @keyframes resolve-shown { from { opacity: .35; filter: blur(2px); } }
20
20
  @keyframes resolve-hidden { from { opacity: .35; filter: blur(2px); } }
21
- .reveal { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; padding: 0; border: 0; border-radius: calc(var(--radius-control) - 5px); corner-shape: var(--corner-shape); background: transparent; color: var(--text-muted); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), transform var(--duration-spring) var(--ease-spring); }
21
+ .reveal { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; padding: 0; border: 0; border-radius: calc(var(--radius-control) - var(--space-tight)); corner-shape: var(--corner-shape); background: transparent; color: var(--text-muted); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), transform var(--duration-spring) var(--ease-spring); }
22
22
  @media (hover: hover) and (pointer: fine) { .reveal:hover { background: var(--surface-muted); color: var(--foreground); } }
23
23
  .reveal:active { transform: scale(.94); transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), transform 100ms var(--ease-standard); }
24
24
  .reveal[aria-pressed="true"] { color: var(--foreground); }
@@ -27,22 +27,22 @@
27
27
  .error { position: relative; display: block; padding-top: var(--space-related); color: var(--danger); font-size: var(--text-xs); line-height: var(--leading-body); }
28
28
  .errorText { display: block; }
29
29
  .meterRow { display: flex; align-items: center; gap: var(--space-group); margin-top: var(--space-group); }
30
- .meter { display: grid; flex: 1 1 auto; min-width: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
30
+ .meter { display: grid; flex: 1 1 auto; min-width: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-tight); }
31
31
  /* Each fill slides in from the left inside its clipped track, so the rounded ends keep their shape at every frame. */
32
32
  .segment { position: relative; height: 4px; overflow: hidden; isolation: isolate; border-radius: var(--radius-full); corner-shape: round; background: var(--border); }
33
33
  .fill { position: absolute; inset: 0; border-radius: inherit; corner-shape: inherit; background: var(--tone); transition: background-color var(--duration-standard) var(--ease-standard); }
34
34
  /* A fixed slot: the meter never resizes when the word changes, and the word stays flush with the field's edge. */
35
35
  .word { position: relative; display: block; flex: 0 0 4.5rem; height: 1.4em; color: var(--foreground); font-size: var(--text-sm); font-weight: 500; line-height: var(--leading-body); text-align: right; white-space: nowrap; }
36
36
  .wordText { display: inline-block; }
37
- .rules { display: grid; gap: 6px; margin: var(--space-inset) 0 0; padding: 0; list-style: none; }
38
- .rule { display: flex; min-height: 1.25rem; align-items: center; gap: 10px; color: var(--text-muted); font-size: var(--text-sm); line-height: var(--leading-body); transition: color var(--duration-standard) var(--ease-standard); }
37
+ .rules { display: grid; gap: var(--space-related); margin: var(--space-inset) 0 0; padding: 0; list-style: none; }
38
+ .rule { display: flex; min-height: 1.25rem; align-items: center; gap: var(--space-group); color: var(--text-muted); font-size: var(--text-sm); line-height: var(--leading-body); transition: color var(--duration-standard) var(--ease-standard); }
39
39
  .rule[data-met] { color: var(--foreground); }
40
40
  .ruleLabel { min-width: 0; }
41
41
  /* The outline hands over to a faint tint while the tick draws on top; most of the color sits on the tick. */
42
42
  .mark { position: relative; display: block; width: 16px; height: 16px; flex: 0 0 16px; border: 1.25px solid var(--border-strong); border-radius: var(--radius-full); corner-shape: round; color: var(--success); transition: border-color var(--duration-fast) var(--ease-standard); }
43
43
  .rule[data-met] .mark { border-color: transparent; }
44
- .markFill { position: absolute; inset: -1.25px; border-radius: inherit; corner-shape: inherit; background: color-mix(in oklab, var(--success) 16%, transparent); }
45
- .tick { position: absolute; inset: -1.25px; width: 16px; height: 16px; }
44
+ .markFill { position: absolute; inset: calc(var(--space-hair) * -1); border-radius: inherit; corner-shape: inherit; background: color-mix(in oklab, var(--success) 16%, transparent); }
45
+ .tick { position: absolute; inset: calc(var(--space-hair) * -1); width: 16px; height: 16px; }
46
46
  .remaining { position: relative; display: block; margin-left: auto; padding-left: var(--space-related); color: var(--text-muted); font-size: var(--text-xs); white-space: nowrap; }
47
47
  .remainingText { display: inline-flex; align-items: baseline; gap: .28em; }
48
48
  .number { display: inline-flex; font-variant-numeric: tabular-nums; }
@@ -1,6 +1,6 @@
1
1
  /* No row gap: grid tracks clamp a negative margin at zero, so a closed message row would still pay the gap. Each row carries its own space instead. */
2
2
  .field { --pi-h: var(--control-height-md); --pi-panel-w: 320px; position: relative; display: grid; min-width: 0; font-family: var(--font-body); letter-spacing: var(--tracking-body); }
3
- .field[data-open] { z-index: 30; }
3
+ .field[data-open] { z-index: var(--layer-dropdown); }
4
4
  .label { justify-self: start; margin-bottom: var(--space-related); color: var(--foreground); font-size: var(--text-sm); font-weight: 500; line-height: var(--leading-body); }
5
5
 
6
6
  /* The shell matches the labeled input: one border, one radius, and a quiet border change on hover and focus. */
@@ -12,7 +12,7 @@
12
12
 
13
13
  /* The anchor holds the closed button's place and springs to a new width when the calling code changes length. */
14
14
  .anchor { position: relative; flex: none; height: 100%; }
15
- .anchor::after { content: ""; position: absolute; top: 10px; right: 0; bottom: 10px; width: 1px; background: var(--border); transition: opacity var(--duration-fast) var(--ease-standard); }
15
+ .anchor::after { content: ""; position: absolute; top: var(--space-group); right: 0; bottom: var(--space-group); width: 1px; background: var(--border); transition: opacity var(--duration-fast) var(--ease-standard); }
16
16
  .field[data-open] .anchor::after { opacity: 0; }
17
17
 
18
18
  /* One material for both states. Open, it steps out over the shell's own border so the two edges never double up. */
@@ -24,8 +24,8 @@
24
24
 
25
25
  .lid { position: absolute; z-index: 1; top: 0; right: 0; left: 0; height: calc(var(--pi-h) - 2px); }
26
26
 
27
- .trigger { box-sizing: border-box; display: flex; height: calc(var(--pi-h) - 2px); align-items: center; padding: 0 36px 0 12px; font-size: var(--text-sm); font-weight: 500; white-space: nowrap; }
28
- .lid .trigger { position: absolute; inset: 3px auto 3px 3px; width: calc(100% - 6px); height: auto; margin: 0; padding: 0 33px 0 9px; border: 0; border-radius: calc(var(--radius-control) - 4px); corner-shape: var(--corner-shape); background: transparent; color: var(--foreground); cursor: pointer; font-family: inherit; letter-spacing: inherit; text-align: left; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: background-color var(--duration-fast) var(--ease-standard); }
27
+ .trigger { box-sizing: border-box; display: flex; height: calc(var(--pi-h) - 2px); align-items: center; padding: 0 var(--space-block) 0 var(--space-group); font-size: var(--text-sm); font-weight: 500; white-space: nowrap; }
28
+ .lid .trigger { position: absolute; inset: var(--space-tight) auto var(--space-tight) var(--space-tight); width: calc(100% - 6px); height: auto; margin: 0; padding: 0 var(--space-block) 0 var(--space-related); border: 0; border-radius: calc(var(--radius-control) - var(--space-tight)); corner-shape: var(--corner-shape); background: transparent; color: var(--foreground); cursor: pointer; font-family: inherit; letter-spacing: inherit; text-align: left; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: background-color var(--duration-fast) var(--ease-standard); }
29
29
  @media (hover: hover) and (pointer: fine) { .field:not([data-open], [data-disabled]) .lid .trigger:hover { background: var(--surface-muted); } }
30
30
  .lid .trigger:active:not(:disabled) { background: var(--surface-muted); }
31
31
  .lid .trigger:disabled { cursor: not-allowed; }
@@ -37,14 +37,14 @@
37
37
 
38
38
  .slot { position: relative; display: block; min-width: 0; height: 100%; flex: 1; }
39
39
  .slot[data-hidden] { opacity: 0; transition: opacity var(--duration-instant) var(--ease-standard); }
40
- .layer { position: absolute; inset: 0; display: flex; align-items: center; gap: 6px; }
41
- .flag { display: inline-grid; width: 20px; flex: none; place-items: center; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font-body); font-size: 17px; font-weight: 400; line-height: 1; }
40
+ .layer { position: absolute; inset: 0; display: flex; align-items: center; gap: var(--space-related); }
41
+ .flag { display: inline-grid; width: 20px; flex: none; place-items: center; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font-body); font-size: var(--text-lg); font-weight: 400; line-height: 1; }
42
42
  .dial { font-variant-numeric: tabular-nums; }
43
43
 
44
- .chevron { position: absolute; top: 50%; right: 12px; display: grid; width: 16px; height: 16px; margin-top: -8px; place-items: center; color: var(--text-muted); pointer-events: none; }
44
+ .chevron { position: absolute; top: 50%; right: var(--space-group); display: grid; width: 16px; height: 16px; margin-top: calc(var(--space-related) * -1); place-items: center; color: var(--text-muted); pointer-events: none; }
45
45
 
46
46
  /* Search takes the lid's place while the list is open. */
47
- .searchRow { position: absolute; inset: 0; display: flex; align-items: center; gap: var(--space-related); padding: 0 2px 0 13px; }
47
+ .searchRow { position: absolute; inset: 0; display: flex; align-items: center; gap: var(--space-related); padding: 0 var(--space-hair) 0 var(--space-group); }
48
48
  .searchRow[inert] { pointer-events: none; }
49
49
  .searchIcon { flex: none; color: var(--text-muted); }
50
50
  .search { min-width: 0; height: 100%; flex: 1; padding: 0; border: 0; background: transparent; color: var(--foreground); font: inherit; font-size: var(--text-sm); letter-spacing: var(--tracking-body); outline: none; }
@@ -58,31 +58,31 @@
58
58
  }
59
59
 
60
60
  /* The list hangs under the lid at its final width, so rows never reflow while the surface springs open. */
61
- .listFace { position: absolute; top: calc(var(--pi-h) - 2px); left: 0; box-sizing: border-box; width: var(--pi-panel-w); padding: 0 6px 6px; }
62
- .listFace::before { content: ""; position: absolute; top: 0; right: 14px; left: 14px; height: 1px; background: var(--border-subtle); }
61
+ .listFace { position: absolute; top: calc(var(--pi-h) - var(--space-hair)); left: 0; box-sizing: border-box; width: var(--pi-panel-w); padding: 0 var(--space-related) var(--space-related); }
62
+ .listFace::before { content: ""; position: absolute; top: 0; right: var(--space-inset); left: var(--space-inset); height: 1px; background: var(--border-subtle); }
63
63
  .listFace[inert] { pointer-events: none; }
64
- .scroll { max-height: 280px; overflow-y: auto; overscroll-behavior: contain; padding-top: 6px; scrollbar-width: thin; }
65
- .options { position: relative; display: grid; gap: 2px; }
64
+ .scroll { max-height: 280px; overflow-y: auto; overscroll-behavior: contain; padding-top: var(--space-related); scrollbar-width: thin; }
65
+ .options { position: relative; display: grid; gap: var(--space-hair); }
66
66
  .highlight { position: absolute; top: 0; right: 0; left: 0; border-radius: var(--radius-control); corner-shape: var(--corner-shape); background: color-mix(in oklab, var(--foreground) 6.5%, transparent); pointer-events: none; }
67
- .group { display: grid; gap: 2px; }
68
- .group + .group { margin-top: 4px; }
69
- .groupLabel { padding: 8px 10px 4px; color: var(--text-muted); font-size: var(--text-xs); }
70
- .option { position: relative; display: flex; min-height: 36px; box-sizing: border-box; align-items: center; gap: 10px; padding: 0 10px; border-radius: var(--radius-control); corner-shape: var(--corner-shape); color: var(--text-secondary); cursor: pointer; font-size: var(--text-sm); user-select: none; -webkit-user-select: none; transition: color var(--duration-fast) var(--ease-standard); }
67
+ .group { display: grid; gap: var(--space-hair); }
68
+ .group + .group { margin-top: var(--space-tight); }
69
+ .groupLabel { padding: var(--space-related) var(--space-group) var(--space-tight); color: var(--text-muted); font-size: var(--text-xs); }
70
+ .option { position: relative; display: flex; min-height: 36px; box-sizing: border-box; align-items: center; gap: var(--space-group); padding: 0 var(--space-group); border-radius: var(--radius-control); corner-shape: var(--corner-shape); color: var(--text-secondary); cursor: pointer; font-size: var(--text-sm); user-select: none; -webkit-user-select: none; transition: color var(--duration-fast) var(--ease-standard); }
71
71
  .option[data-active], .option[aria-selected="true"] { color: var(--foreground); }
72
72
  .name { min-width: 0; flex: 1; overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
73
73
  .meta { flex: none; color: var(--text-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
74
74
  .check { display: grid; width: 16px; height: 16px; flex: none; place-items: center; color: var(--foreground); opacity: 0; transform: scale(.6); transition: opacity var(--duration-fast) var(--ease-standard), transform var(--duration-spring) var(--ease-spring); }
75
75
  .check[data-on] { opacity: 1; transform: none; }
76
- .empty { margin: 0; padding: 12px 10px 14px; color: var(--text-muted); font-size: var(--text-sm); }
76
+ .empty { margin: 0; padding: var(--space-group) var(--space-group) var(--space-inset); color: var(--text-muted); font-size: var(--text-sm); }
77
77
 
78
78
  /* The number and its guide share one box. The guide paints the typed part invisibly, then the rest of the example faintly after it. */
79
79
  .numberWrap { position: relative; display: flex; min-width: 0; flex: 1; align-items: center; }
80
- .number, .guide { box-sizing: border-box; padding: 0 36px 0 12px; font-family: inherit; font-size: var(--text-sm); font-variant-numeric: tabular-nums; letter-spacing: var(--tracking-body); line-height: var(--leading-body); }
80
+ .number, .guide { box-sizing: border-box; padding: 0 var(--space-block) 0 var(--space-group); font-family: inherit; font-size: var(--text-sm); font-variant-numeric: tabular-nums; letter-spacing: var(--tracking-body); line-height: var(--leading-body); }
81
81
  .number { position: relative; z-index: 1; width: 100%; height: 100%; min-width: 0; margin: 0; border: 0; border-radius: 0 var(--radius-control) var(--radius-control) 0; corner-shape: var(--corner-shape); background: transparent; color: var(--foreground); outline: none; }
82
82
  .number:disabled { cursor: not-allowed; }
83
83
  .guide { position: absolute; inset: 0; display: flex; align-items: center; overflow: hidden; color: color-mix(in oklab, var(--text-muted) 72%, transparent); pointer-events: none; white-space: pre; }
84
84
  .guideTyped { visibility: hidden; }
85
- .valid { position: absolute; z-index: 1; top: 50%; right: 12px; display: grid; width: 18px; height: 18px; margin-top: -9px; place-items: center; color: var(--success); pointer-events: none; }
85
+ .valid { position: absolute; z-index: 1; top: 50%; right: var(--space-group); display: grid; width: 18px; height: 18px; margin-top: calc(var(--space-related) * -1); place-items: center; color: var(--success); pointer-events: none; }
86
86
 
87
87
  /* The row's space is padding inside the clipped slot, so the height animates from a true zero. */
88
88
  .messageSlot { position: relative; display: block; overflow: hidden; }
@@ -3,10 +3,10 @@
3
3
  .content {
4
4
  --popover-x: 0px;
5
5
  --popover-y: -5px;
6
- z-index: 80;
6
+ z-index: var(--layer-popover);
7
7
  min-width: 12rem;
8
8
  max-width: min(22rem, calc(100vw - 20px));
9
- padding: 1rem;
9
+ padding: var(--space-inset);
10
10
  border: 1px solid var(--border);
11
11
  border-radius: var(--radius-container);
12
12
  background: var(--surface-raised);
@@ -1 +1 @@
1
- .progress { width: 100%; color: var(--text-secondary); font-size: var(--text-sm); } .meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; line-height: var(--leading-body); } .label { position: relative; min-width: 0; } .line { display: block; } .value { display: inline-flex; flex: none; align-items: center; gap: 4px; color: var(--text-muted); font-variant-numeric: tabular-nums; } .count { display: inline-grid; justify-items: end; } /* A hidden "100%" row reserves the widest count, so the check never shifts as the number gains a digit. */ .count::before { content: "100%"; height: 0; overflow: hidden; visibility: hidden; } .done { display: grid; place-items: center; color: var(--success); } .track { height: 7px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-full); corner-shape: round; background: var(--surface-muted); } .fill { display: block; width: 100%; height: 100%; border-radius: inherit; corner-shape: inherit; background: var(--accent); transition: background-color var(--duration-standard) var(--ease-standard); } .progress[data-complete] .fill { background: var(--success); transition-delay: 200ms; } @media (prefers-reduced-motion: reduce) { .fill, .progress[data-complete] .fill { transition: none; } }
1
+ .progress { width: 100%; color: var(--text-secondary); font-size: var(--text-sm); } .meta { display: flex; justify-content: space-between; gap: var(--space-group); margin-bottom: var(--space-related); line-height: var(--leading-body); } .label { position: relative; min-width: 0; } .line { display: block; } .value { display: inline-flex; flex: none; align-items: center; gap: var(--space-tight); color: var(--text-muted); font-variant-numeric: tabular-nums; } .count { display: inline-grid; justify-items: end; } /* A hidden "100%" row reserves the widest count, so the check never shifts as the number gains a digit. */ .count::before { content: "100%"; height: 0; overflow: hidden; visibility: hidden; } .done { display: grid; place-items: center; color: var(--success); } .track { height: 7px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-full); corner-shape: round; background: var(--surface-muted); } .fill { display: block; width: 100%; height: 100%; border-radius: inherit; corner-shape: inherit; background: var(--accent); transition: background-color var(--duration-standard) var(--ease-standard); } .progress[data-complete] .fill { background: var(--success); transition-delay: 200ms; } @media (prefers-reduced-motion: reduce) { .fill, .progress[data-complete] .fill { transition: none; } }
@@ -1,7 +1,7 @@
1
1
  .root {
2
2
  position: relative;
3
3
  display: grid;
4
- gap: 10px;
4
+ gap: var(--space-group);
5
5
  color: var(--foreground);
6
6
  font-family: var(--font-body);
7
7
  font-size: var(--text-sm);
@@ -10,7 +10,7 @@
10
10
  }
11
11
  .root *, .root *::before, .root *::after { box-sizing: border-box; }
12
12
  .root[data-layout="grid"] { grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min-column, 180px)), 1fr)); }
13
- .root[data-layout="list"] { grid-template-columns: minmax(0, 1fr); gap: 8px; }
13
+ .root[data-layout="list"] { grid-template-columns: minmax(0, 1fr); gap: var(--space-related); }
14
14
 
15
15
  /* The one moving part: a ring that springs from card to card. It sits over the card border so the card itself never changes size. */
16
16
  .ring {
@@ -28,8 +28,8 @@
28
28
  display: grid;
29
29
  min-width: 0;
30
30
  align-items: start;
31
- gap: 4px 12px;
32
- padding: 14px 16px;
31
+ gap: var(--space-tight) var(--space-group);
32
+ padding: var(--space-inset) var(--space-inset);
33
33
  border: 1px solid var(--border);
34
34
  border-radius: var(--radius-control); corner-shape: var(--corner-shape);
35
35
  background: var(--surface);
@@ -40,7 +40,7 @@
40
40
  }
41
41
  /* The body row takes any spare height, so prices sit on one baseline across a row even when a description wraps. */
42
42
  .root[data-layout="grid"] .card { grid-template-areas: "body indicator" "meta meta"; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto; }
43
- .root[data-layout="list"] .card { grid-template-areas: "indicator body meta"; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; padding: 13px 16px 13px 14px; }
43
+ .root[data-layout="list"] .card { grid-template-areas: "indicator body meta"; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; padding: var(--space-group) var(--space-inset) var(--space-group) var(--space-inset); }
44
44
  .card[data-checked] { background: color-mix(in oklab, var(--control-on) 4%, var(--surface)); }
45
45
  .card[aria-disabled="true"] { background: var(--surface-muted); cursor: not-allowed; }
46
46
  .card[aria-disabled="true"] :is(.label, .meta) { color: var(--text-muted); }
@@ -61,8 +61,8 @@
61
61
  .indicatorDot { width: 6px; height: 6px; border-radius: 50%; corner-shape: round; background: var(--control-glyph); }
62
62
  .card[aria-disabled="true"] .indicator { border-color: var(--border); }
63
63
 
64
- .body { display: grid; min-width: 0; gap: 2px; grid-area: body; }
65
- .label { display: flex; min-width: 0; align-items: center; gap: 8px; font-weight: 500; }
64
+ .body { display: grid; min-width: 0; gap: var(--space-hair); grid-area: body; }
65
+ .label { display: flex; min-width: 0; align-items: center; gap: var(--space-related); font-weight: 500; }
66
66
  .labelText { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
67
67
  .icon { display: grid; width: 18px; height: 18px; flex: none; place-items: center; color: var(--text-secondary); }
68
68
  .icon > svg { width: 18px; height: 18px; }
@@ -70,7 +70,7 @@
70
70
  .description { color: var(--text-secondary); font-size: var(--text-xs); line-height: var(--leading-body); text-wrap: pretty; }
71
71
 
72
72
  .meta { grid-area: meta; color: var(--foreground); font-variant-numeric: tabular-nums; white-space: nowrap; }
73
- .root[data-layout="grid"] .meta { margin-top: 10px; font-size: var(--text-lg); }
73
+ .root[data-layout="grid"] .meta { margin-top: var(--space-group); font-size: var(--text-lg); }
74
74
  .root[data-layout="list"] .meta { font-weight: 500; }
75
75
 
76
76
  @media (hover: hover) and (pointer: fine) {
@@ -26,5 +26,5 @@
26
26
  .option strong, .option small { display: block; }
27
27
  .option strong { color: var(--text-secondary); font-size: var(--text-sm); font-weight: 500; transition: color var(--duration-standard) var(--ease-standard); }
28
28
  .option:has(input:checked) strong { color: var(--foreground); }
29
- .option small { margin-top: 2px; color: var(--text-muted); font-size: var(--text-xs); }
29
+ .option small { margin-top: var(--space-hair); color: var(--text-muted); font-size: var(--text-xs); }
30
30
  @media (prefers-reduced-motion: reduce) { .option, .mark, .mark::after, .option strong { transition: none; } .option:active .mark { transform: none; } }
@@ -14,7 +14,7 @@
14
14
 
15
15
  /* The divider is a one pixel line with a 13px grab area, and a grip that forms while it is hovered, focused, or dragged. */
16
16
  .handle { position: relative; z-index: 2; flex: 0 0 1px; background: var(--border); cursor: col-resize; touch-action: none; outline: none; -webkit-tap-highlight-color: transparent; transition: background-color var(--duration-fast) var(--ease-standard); }
17
- .handle::before { position: absolute; inset: 0 -6px; content: ""; }
17
+ .handle::before { position: absolute; inset: 0 calc(var(--space-related) * -1); content: ""; }
18
18
  .handle[data-collapsed] { background: transparent; cursor: pointer; }
19
19
  .grip { position: absolute; top: 50%; left: 50%; width: 4px; height: 32px; border-radius: var(--radius-full); corner-shape: round; background: var(--border-strong); opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scaleY(.6); transition: opacity var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard), transform var(--duration-spring) var(--ease-spring); }
20
20
  @media (hover: hover) and (pointer: fine) {
@@ -28,10 +28,10 @@
28
28
  .handle[data-collapsed]:focus-visible .restore { border-color: var(--border-strong); color: var(--foreground); }
29
29
 
30
30
  /* Once a neighbour is hidden, a tab on the divider points the way it will come back. */
31
- .restore { position: absolute; top: 50%; display: grid; width: 18px; height: 40px; margin-top: -20px; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-full); corner-shape: round; background: var(--surface); box-shadow: var(--shadow-resting); color: var(--text-secondary); pointer-events: none; transition: border-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
32
- .restore[data-side="before"] { left: 5px; transform-origin: 0 50%; }
33
- .restore[data-side="after"] { right: 5px; transform-origin: 100% 50%; }
34
- .handle[data-collapsed]::before { inset: 0 -30px; }
31
+ .restore { position: absolute; top: 50%; display: grid; width: 18px; height: 40px; margin-top: calc(var(--space-comfort) * -1); place-items: center; border: 1px solid var(--border); border-radius: var(--radius-full); corner-shape: round; background: var(--surface); box-shadow: var(--shadow-resting); color: var(--text-secondary); pointer-events: none; transition: border-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
32
+ .restore[data-side="before"] { left: var(--space-tight); transform-origin: 0 50%; }
33
+ .restore[data-side="after"] { right: var(--space-tight); transform-origin: 100% 50%; }
34
+ .handle[data-collapsed]::before { inset: 0 calc(var(--space-block) * -1); }
35
35
  .handle[data-collapsed="before"]::before { left: 0; }
36
36
  .handle[data-collapsed="after"]::before { right: 0; }
37
37
 
@@ -10,7 +10,7 @@
10
10
  /* The writing surface. Everything inside is plain semantic HTML, styled here so pasted and typed content look the same. */
11
11
  .editor {
12
12
  min-height: 8rem;
13
- padding: 2px 0;
13
+ padding: var(--space-hair) 0;
14
14
  outline: none;
15
15
  color: var(--foreground);
16
16
  font-size: var(--text-base);
@@ -48,7 +48,7 @@
48
48
  font-size: .86em;
49
49
  }
50
50
 
51
- .editor blockquote { padding-left: 14px; border-left: 2px solid var(--border-strong); color: var(--text-secondary); }
51
+ .editor blockquote { padding-left: var(--space-inset); border-left: 2px solid var(--border-strong); color: var(--text-secondary); }
52
52
 
53
53
  .editor ul,
54
54
  .editor ol { margin-block: 0; padding-left: 1.45em; }
@@ -63,7 +63,7 @@
63
63
  .editor ol > li::marker { font-variant-numeric: tabular-nums; }
64
64
 
65
65
  .editor pre {
66
- padding: 12px 14px;
66
+ padding: var(--space-group) var(--space-inset);
67
67
  overflow-x: auto;
68
68
  border: 1px solid var(--border-subtle);
69
69
  border-radius: var(--radius-control);
@@ -91,7 +91,7 @@
91
91
  /* Floating toolbar. One surface whose size springs between its two faces. */
92
92
  .toolbar {
93
93
  position: absolute;
94
- z-index: 40;
94
+ z-index: var(--layer-popover);
95
95
  translate: -50% -100%;
96
96
  overflow: hidden;
97
97
  border: 1px solid var(--border);
@@ -104,11 +104,11 @@
104
104
  .face[inert] { pointer-events: none; }
105
105
 
106
106
  .row,
107
- .linkRow { display: flex; align-items: center; gap: 2px; padding: 4px; }
108
- .blockTools { display: flex; align-items: center; gap: 2px; }
107
+ .linkRow { display: flex; align-items: center; gap: var(--space-hair); padding: var(--space-tight); }
108
+ .blockTools { display: flex; align-items: center; gap: var(--space-hair); }
109
109
  /* Narrow editors keep the inline marks; block types stay one slash away. */
110
110
  @container (max-width: 330px) { .blockTools { display: none; } }
111
- .divider { width: 1px; height: 18px; margin: 0 4px; background: var(--border); }
111
+ .divider { width: 1px; height: 18px; margin: 0 var(--space-tight); background: var(--border); }
112
112
 
113
113
  .tool {
114
114
  display: grid;
@@ -134,7 +134,7 @@
134
134
  width: min(15rem, 60vw);
135
135
  height: 32px;
136
136
  min-width: 0;
137
- padding: 0 8px;
137
+ padding: 0 var(--space-related);
138
138
  border: 0;
139
139
  background: transparent;
140
140
  color: var(--foreground);
@@ -163,7 +163,7 @@
163
163
  /* Slash menu. */
164
164
  .slash {
165
165
  position: absolute;
166
- z-index: 40;
166
+ z-index: var(--layer-dropdown);
167
167
  width: 240px;
168
168
  max-width: calc(100% - 8px);
169
169
  overflow-x: hidden;
@@ -176,7 +176,7 @@
176
176
  box-shadow: var(--shadow-floating);
177
177
  }
178
178
  .slash[data-above] { translate: 0 -100%; }
179
- .slashBody { padding: 6px; }
179
+ .slashBody { padding: var(--space-related); }
180
180
  .slashList { position: relative; display: grid; margin: 0; padding: 0; list-style: none; }
181
181
  .slashHighlight { position: absolute; top: 0; right: 0; left: 0; border-radius: var(--radius-control); background: color-mix(in oklab, var(--foreground) 6.5%, transparent); pointer-events: none; }
182
182
  .slashOption {
@@ -184,8 +184,8 @@
184
184
  display: flex;
185
185
  height: 34px;
186
186
  align-items: center;
187
- gap: 10px;
188
- padding: 0 10px;
187
+ gap: var(--space-group);
188
+ padding: 0 var(--space-group);
189
189
  border-radius: var(--radius-control);
190
190
  color: var(--text-secondary);
191
191
  cursor: pointer;
@@ -35,19 +35,19 @@
35
35
 
36
36
  .message { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--text-muted); font-size: var(--text-sm); pointer-events: none; }
37
37
 
38
- .tooltip { position: absolute; top: 0; left: 0; z-index: 2; display: grid; min-width: 170px; max-width: min(240px, 100%); gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface-raised); box-shadow: var(--shadow-floating); opacity: 0; pointer-events: none; scale: .96; transition: opacity var(--duration-fast) var(--ease-standard), scale var(--duration-fast) var(--ease-standard); }
38
+ .tooltip { position: absolute; top: 0; left: 0; z-index: 2; display: grid; min-width: 170px; max-width: min(240px, 100%); gap: var(--space-hair); padding: var(--space-group) var(--space-group); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface-raised); box-shadow: var(--shadow-floating); opacity: 0; pointer-events: none; scale: .96; transition: opacity var(--duration-fast) var(--ease-standard), scale var(--duration-fast) var(--ease-standard); }
39
39
  .plot[data-active] .tooltip { opacity: 1; scale: 1; }
40
- .tipTitle { margin: 0 0 2px; color: var(--text-secondary); font-size: var(--text-xs); line-height: var(--leading-body); }
41
- .tipValue, .tipRow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
40
+ .tipTitle { margin: 0 0 var(--space-hair); color: var(--text-secondary); font-size: var(--text-xs); line-height: var(--leading-body); }
41
+ .tipValue, .tipRow { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-group); margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
42
42
  .tipValue { color: var(--foreground); font-size: var(--text-sm); font-weight: 500; line-height: 1.4; }
43
43
  .tipRow { color: var(--foreground); font-size: var(--text-xs); line-height: var(--leading-body); }
44
44
  .tipKey { color: var(--text-muted); font-weight: 400; }
45
45
  .tipValue .tipKey { font-size: var(--text-xs); }
46
- .tipNote { margin: 4px 0 0; color: var(--text-muted); font-size: var(--text-xs); line-height: var(--leading-body); font-variant-numeric: tabular-nums; }
46
+ .tipNote { margin: var(--space-tight) 0 0; color: var(--text-muted); font-size: var(--text-xs); line-height: var(--leading-body); font-variant-numeric: tabular-nums; }
47
47
 
48
- .scale { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: var(--space-group); color: var(--text-muted); font-size: var(--text-xs); line-height: var(--leading-body); font-variant-numeric: tabular-nums; }
49
- .scaleLabel { margin-right: 4px; color: var(--text-secondary); }
50
- .steps { display: inline-flex; gap: 2px; }
48
+ .scale { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-related); margin-top: var(--space-group); color: var(--text-muted); font-size: var(--text-xs); line-height: var(--leading-body); font-variant-numeric: tabular-nums; }
49
+ .scaleLabel { margin-right: var(--space-tight); color: var(--text-secondary); }
50
+ .steps { display: inline-flex; gap: var(--space-hair); }
51
51
  .step { width: 18px; height: 10px; border-radius: var(--radius-detail); background: var(--ridge); }
52
52
 
53
53
  .srOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@@ -40,10 +40,10 @@
40
40
  touch-action: none;
41
41
  transition: opacity var(--duration-considered) var(--ease-standard);
42
42
  }
43
- .track[data-axis="y"] { top: 3px; right: 1px; bottom: 3px; width: 11px; }
44
- .track[data-axis="x"] { right: 3px; bottom: 1px; left: 3px; height: 11px; }
45
- .root[data-orientation="both"] > .track[data-axis="y"] { bottom: 13px; }
46
- .root[data-orientation="both"] > .track[data-axis="x"] { right: 13px; }
43
+ .track[data-axis="y"] { top: var(--space-tight); right: 1px; bottom: var(--space-tight); width: 11px; }
44
+ .track[data-axis="x"] { right: var(--space-tight); bottom: 1px; left: var(--space-tight); height: 11px; }
45
+ .root[data-orientation="both"] > .track[data-axis="y"] { bottom: var(--space-group); }
46
+ .root[data-orientation="both"] > .track[data-axis="x"] { right: var(--space-group); }
47
47
  .track[data-hidden] { display: none; }
48
48
 
49
49
  .thumb { position: absolute; top: 0; left: 0; will-change: transform; }
@@ -56,8 +56,8 @@
56
56
  background: color-mix(in oklab, var(--foreground) 30%, transparent);
57
57
  transition: width var(--duration-fast) var(--ease-standard), height var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard);
58
58
  }
59
- .track[data-axis="y"] .thumb::after { top: 0; right: 3px; bottom: 0; width: 5px; }
60
- .track[data-axis="x"] .thumb::after { right: 0; bottom: 3px; left: 0; height: 5px; }
59
+ .track[data-axis="y"] .thumb::after { top: 0; right: var(--space-tight); bottom: 0; width: 5px; }
60
+ .track[data-axis="x"] .thumb::after { right: 0; bottom: var(--space-tight); left: 0; height: 5px; }
61
61
 
62
62
  /* Visible while scrolling, while the pointer is over the area, and always when asked. Appearing is quick; leaving lingers. */
63
63
  .root[data-scrolling] > .track,
@@ -69,9 +69,9 @@
69
69
  .track:hover .thumb::after,
70
70
  .root[data-dragging] .thumb::after { background: color-mix(in oklab, var(--foreground) 46%, transparent); }
71
71
  .track[data-axis="y"]:hover .thumb::after,
72
- .root[data-dragging="y"] .track[data-axis="y"] .thumb::after { width: 7px; right: 2px; }
72
+ .root[data-dragging="y"] .track[data-axis="y"] .thumb::after { width: 7px; right: var(--space-hair); }
73
73
  .track[data-axis="x"]:hover .thumb::after,
74
- .root[data-dragging="x"] .track[data-axis="x"] .thumb::after { height: 7px; bottom: 2px; }
74
+ .root[data-dragging="x"] .track[data-axis="x"] .thumb::after { height: 7px; bottom: var(--space-hair); }
75
75
  }
76
76
 
77
77
  @media (prefers-reduced-motion: reduce) {
@@ -11,6 +11,8 @@ export interface SegmentedControlProps {
11
11
  label?: string;
12
12
  /** Called when the pointer or focus reaches an option, before it is chosen. Use it to start loading what that option shows. */
13
13
  onOptionIntent?: (value: string) => void;
14
+ /** `sm` (default) or `xs`, a compact 24px control for dense UI such as an Edit/Read toggle in a toolbar. */
15
+ size?: "sm" | "xs";
14
16
  className?: string;
15
17
  }
16
- export default function SegmentedControl({ options, value, onValueChange, label, onOptionIntent, className }: SegmentedControlProps): import("react").JSX.Element;
18
+ export default function SegmentedControl({ options, value, onValueChange, label, onOptionIntent, size, className }: SegmentedControlProps): import("react").JSX.Element;
@@ -4,7 +4,7 @@ import { useEffect, useId, useLayoutEffect, useRef } from "react";
4
4
  import { LayoutGroup, motion, useReducedMotion } from "motion/react";
5
5
  import { motionTokens } from "../../lib/motion-tokens.js";
6
6
  import styles from "./segmented-control.module.css";
7
- export default function SegmentedControl({ options, value, onValueChange, label, onOptionIntent, className }) {
7
+ export default function SegmentedControl({ options, value, onValueChange, label, onOptionIntent, size = "sm", className }) {
8
8
  const id = useId();
9
9
  const reduced = useReducedMotion();
10
10
  const track = useRef(null);
@@ -52,5 +52,5 @@ export default function SegmentedControl({ options, value, onValueChange, label,
52
52
  onValueChange(options[target].value);
53
53
  track.current?.querySelector(`[data-value="${CSS.escape(options[target].value)}"]`)?.focus({ preventScroll: true });
54
54
  };
55
- return _jsx("div", { className: `${styles.root} ${className ?? ""}`, role: "group", "aria-label": label, children: _jsx(LayoutGroup, { id: id, children: _jsx(motion.div, { ref: track, layoutScroll: true, className: styles.track, children: options.map((option, index) => _jsxs("button", { id: `${id}-${option.value}`, className: styles.button, type: "button", "data-value": option.value, "aria-pressed": value === option.value, tabIndex: index === selectedIndex ? 0 : -1, onClick: () => onValueChange(option.value), onKeyDown: onKeyDown, onPointerEnter: onOptionIntent ? () => onOptionIntent(option.value) : undefined, onFocus: onOptionIntent ? () => onOptionIntent(option.value) : undefined, children: [value === option.value && _jsx(motion.span, { className: styles.selection, layoutId: "selection", layoutDependency: value, transition: reduced ? { duration: 0 } : motionTokens.spring.morph, "aria-hidden": "true" }), _jsxs("span", { className: styles.label, children: [option.label, option.accessory] })] }, option.value)) }) }) });
55
+ return _jsx("div", { className: `${styles.root} ${className ?? ""}`, role: "group", "aria-label": label, "data-size": size, children: _jsx(LayoutGroup, { id: id, children: _jsx(motion.div, { ref: track, layoutScroll: true, className: styles.track, children: options.map((option, index) => _jsxs("button", { id: `${id}-${option.value}`, className: styles.button, type: "button", "data-value": option.value, "aria-pressed": value === option.value, tabIndex: index === selectedIndex ? 0 : -1, onClick: () => onValueChange(option.value), onKeyDown: onKeyDown, onPointerEnter: onOptionIntent ? () => onOptionIntent(option.value) : undefined, onFocus: onOptionIntent ? () => onOptionIntent(option.value) : undefined, children: [value === option.value && _jsx(motion.span, { className: styles.selection, layoutId: "selection", layoutDependency: value, transition: reduced ? { duration: 0 } : motionTokens.spring.morph, "aria-hidden": "true" }), _jsxs("span", { className: styles.label, children: [option.label, option.accessory] })] }, option.value)) }) }) });
56
56
  }
@@ -1,15 +1,18 @@
1
1
  /* The frame can shrink below its content inside flex and grid parents; the track then scrolls inside it. */
2
2
  .root { display: inline-flex; min-width: 0; max-width: 100%; flex-shrink: 1; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface-muted); }
3
3
  /* The track owns the stacking context so the gliding highlight passes under every label, not over earlier ones. */
4
- .track { --fade-start: 0px; --fade-end: 0px; isolation: isolate; display: flex; min-width: 0; gap: 2px; overflow-x: auto; overscroll-behavior-x: contain; padding: 3px; border-radius: inherit; corner-shape: inherit; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent); mask-image: linear-gradient(to right, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent); }
4
+ .track { --fade-start: 0px; --fade-end: 0px; isolation: isolate; display: flex; min-width: 0; gap: var(--space-hair); overflow-x: auto; overscroll-behavior-x: contain; padding: var(--space-tight); border-radius: inherit; corner-shape: inherit; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent); mask-image: linear-gradient(to right, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent); }
5
5
  .track::-webkit-scrollbar { display: none; }
6
6
  .track[data-fade-start] { --fade-start: 20px; }
7
7
  .track[data-fade-end] { --fade-end: 20px; }
8
8
  /* Items never scale or change weight; only the highlight travels and the label color follows it. */
9
- .button { position: relative; flex: 0 0 auto; min-height: var(--control-height-sm); border: 0; border-radius: calc(var(--radius-control) - 4px); padding: 0 12px; background: transparent; color: var(--text-muted); font: inherit; font-size: var(--text-sm); font-weight: 500; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color var(--duration-fast) var(--ease-standard); }
9
+ .button { position: relative; flex: 0 0 auto; min-height: var(--control-height-sm); border: 0; border-radius: calc(var(--radius-control) - var(--space-tight)); padding: 0 var(--space-group); background: transparent; color: var(--text-muted); font: inherit; font-size: var(--text-sm); font-weight: 500; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color var(--duration-fast) var(--ease-standard); }
10
10
  @media (hover: hover) and (pointer: fine) { .button:hover { color: var(--foreground); } }
11
11
  .button:active, .button[aria-pressed="true"] { color: var(--foreground); }
12
12
  .selection { position: absolute; z-index: -1; inset: 0; border: 1px solid var(--border); border-radius: inherit; corner-shape: inherit; background: var(--surface); box-shadow: var(--shadow-resting); }
13
- .label { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; }
14
- @media (max-width: 380px) { .button { padding: 0 10px; } }
13
+ .label { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: var(--space-related); }
14
+ /* Compact: 24px segments in a thinner track, at the small type step. */
15
+ .root[data-size="xs"] .track { padding: var(--space-hair); }
16
+ .root[data-size="xs"] .button { min-height: var(--control-height-xs); padding: 0 var(--space-related); font-size: var(--text-xs); }
17
+ @media (max-width: 380px) { .button { padding: 0 var(--space-group); } }
15
18
  @media (prefers-reduced-motion: reduce) { .button { transition: none; } }
@@ -14,17 +14,17 @@
14
14
  .trigger[data-state="open"] .chevron { transform: rotate(180deg); }
15
15
  .hint { color: var(--text-muted); font-size: var(--text-xs); }
16
16
  /* Radix holds the animation until the menu is positioned, so it always grows from the trigger edge. */
17
- .content { --menu-x: 0px; --menu-y: -6px; box-sizing: border-box; z-index: 1000; width: var(--radix-select-trigger-width); min-width: var(--radix-select-trigger-width); max-width: min(24rem, calc(100vw - 20px)); max-height: min(320px, var(--radix-select-content-available-height)); overflow: hidden; border: 1px solid var(--border); border-radius: calc(var(--radius-control) + 2px); padding: 6px; background: var(--surface-raised); color: var(--foreground); box-shadow: var(--shadow-floating); transform-origin: var(--radix-select-content-transform-origin); animation: select-in var(--duration-standard) var(--ease-enter) both; }
17
+ .content { --menu-x: 0px; --menu-y: -6px; box-sizing: border-box; z-index: var(--layer-dropdown); width: var(--radix-select-trigger-width); min-width: var(--radix-select-trigger-width); max-width: min(24rem, calc(100vw - 20px)); max-height: min(320px, var(--radix-select-content-available-height)); overflow: hidden; border: 1px solid var(--border); border-radius: calc(var(--radius-control) + var(--space-hair)); padding: var(--space-related); background: var(--surface-raised); color: var(--foreground); box-shadow: var(--shadow-floating); transform-origin: var(--radix-select-content-transform-origin); animation: select-in var(--duration-standard) var(--ease-enter) both; }
18
18
  .content[data-side="top"] { --menu-y: 6px; }
19
19
  .content[data-side="left"] { --menu-x: 6px; --menu-y: 0px; }
20
20
  .content[data-side="right"] { --menu-x: -6px; --menu-y: 0px; }
21
21
  .content[data-state="closed"] { animation: select-out var(--duration-instant) var(--ease-standard) both; }
22
- .viewport { position: relative; padding: 2px 0; }
22
+ .viewport { position: relative; padding: var(--space-hair) 0; }
23
23
  /* One highlight glides between options for the pointer and jumps instantly for the keyboard (lib/menu-highlight). */
24
- .highlight { position: absolute; top: 0; right: 0; left: 0; border-radius: calc(var(--radius-control) - 4px); background: var(--surface-muted); opacity: 0; pointer-events: none; }
25
- .item { position: relative; display: flex; align-items: center; min-height: 36px; border-radius: calc(var(--radius-control) - 4px); padding: 0 34px 0 11px; color: var(--foreground); font-size: var(--text-sm); cursor: default; outline: none; user-select: none; transition: background-color var(--duration-instant) var(--ease-standard), color var(--duration-instant) var(--ease-standard); }
24
+ .highlight { position: absolute; top: 0; right: 0; left: 0; border-radius: calc(var(--radius-control) - var(--space-tight)); background: var(--surface-muted); opacity: 0; pointer-events: none; }
25
+ .item { position: relative; display: flex; align-items: center; min-height: 36px; border-radius: calc(var(--radius-control) - var(--space-tight)); padding: 0 var(--space-block) 0 var(--space-group); color: var(--foreground); font-size: var(--text-sm); cursor: default; outline: none; user-select: none; transition: background-color var(--duration-instant) var(--ease-standard), color var(--duration-instant) var(--ease-standard); }
26
26
  .item[data-disabled] { opacity: .45; }
27
- .indicator { position: absolute; right: 10px; display: inline-flex; align-items: center; color: var(--foreground); animation: indicator-in var(--duration-standard) var(--ease-enter) 40ms both; }
27
+ .indicator { position: absolute; right: var(--space-group); display: inline-flex; align-items: center; color: var(--foreground); animation: indicator-in var(--duration-standard) var(--ease-enter) 40ms both; }
28
28
  .scrollButton { display: grid; height: 28px; place-items: center; color: var(--text-muted); }
29
29
  @keyframes select-in { from { opacity: 0; transform: translate(var(--menu-x), var(--menu-y)) scale(.97); } }
30
30
  @keyframes select-out { to { opacity: 0; transform: translate(calc(var(--menu-x) / 2), calc(var(--menu-y) / 2)) scale(.98); } }
@@ -1,11 +1,11 @@
1
1
  /* ---------------------------------------------- Kbd ---------------------------------------------- */
2
2
 
3
3
  /* A key cap: a one pixel edge with a slightly heavier bottom, so it reads as a key without a shadow. Held, it drops a pixel and takes the accent. */
4
- .kbd { display: inline-grid; min-width: 26px; height: 26px; box-sizing: border-box; place-items: center; padding: 0 7px 1px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--radius-detail); corner-shape: var(--corner-shape); background: var(--surface-raised); color: var(--foreground); font-family: var(--font-body); font-size: var(--text-xs); font-weight: 500; line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums; white-space: nowrap; transition: transform var(--duration-spring) var(--ease-spring), border-color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), border-bottom-width var(--duration-fast) var(--ease-standard); }
5
- .kbd[data-size="sm"] { min-width: 22px; height: 22px; padding: 0 5px 1px; border-radius: var(--radius-detail); corner-shape: var(--corner-shape); font-size: var(--text-xs); }
4
+ .kbd { display: inline-grid; min-width: 26px; height: 26px; box-sizing: border-box; place-items: center; padding: 0 var(--space-related) 1px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--radius-detail); corner-shape: var(--corner-shape); background: var(--surface-raised); color: var(--foreground); font-family: var(--font-body); font-size: var(--text-xs); font-weight: 500; line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums; white-space: nowrap; transition: transform var(--duration-spring) var(--ease-spring), border-color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), border-bottom-width var(--duration-fast) var(--ease-standard); }
5
+ .kbd[data-size="sm"] { min-width: 22px; height: 22px; padding: 0 var(--space-tight) 1px; border-radius: var(--radius-detail); corner-shape: var(--corner-shape); font-size: var(--text-xs); }
6
6
  .kbd[data-pressed] { transform: translateY(1px); border-color: color-mix(in oklab, var(--accent) 55%, var(--border-strong)); border-bottom-width: 1px; background: var(--accent-subtle); color: var(--accent-strong); transition-duration: 90ms; }
7
7
  .kbd[data-tone="warning"] { border-color: color-mix(in oklab, var(--warning) 55%, var(--border-strong)); background: color-mix(in oklab, var(--warning) 12%, var(--surface-raised)); color: var(--foreground); }
8
- .keys { display: inline-flex; flex: none; align-items: center; gap: 4px; }
8
+ .keys { display: inline-flex; flex: none; align-items: center; gap: var(--space-tight); }
9
9
 
10
10
  /* ---------------------------------------------- Recorder ---------------------------------------------- */
11
11
 
@@ -19,27 +19,27 @@
19
19
  .control[data-state="conflict"] { border-color: var(--warning); }
20
20
  .field[data-disabled] .control { opacity: .5; background: var(--surface-muted); }
21
21
 
22
- .recorder { display: flex; min-width: 0; height: 100%; flex: 1; align-items: center; padding: 0 6px 0 9px; border: 0; border-radius: var(--radius-control); corner-shape: var(--corner-shape); background: transparent; color: var(--foreground); cursor: pointer; font: inherit; text-align: left; -webkit-tap-highlight-color: transparent; touch-action: manipulation; outline: none; }
22
+ .recorder { display: flex; min-width: 0; height: 100%; flex: 1; align-items: center; padding: 0 var(--space-related) 0 var(--space-related); border: 0; border-radius: var(--radius-control); corner-shape: var(--corner-shape); background: transparent; color: var(--foreground); cursor: pointer; font: inherit; text-align: left; -webkit-tap-highlight-color: transparent; touch-action: manipulation; outline: none; }
23
23
  .recorder:disabled { cursor: not-allowed; }
24
- .row { position: relative; display: flex; min-width: 0; align-items: center; gap: 4px; }
24
+ .row { position: relative; display: flex; min-width: 0; align-items: center; gap: var(--space-tight); }
25
25
  .chipSlot { display: inline-flex; }
26
- .placeholder { padding-left: 3px; color: var(--text-muted); font-size: var(--text-sm); white-space: nowrap; }
26
+ .placeholder { padding-left: var(--space-tight); color: var(--text-muted); font-size: var(--text-sm); white-space: nowrap; }
27
27
  .placeholder[data-recording] { color: var(--text-secondary); }
28
28
  /* A recording light: steady in reduced motion, a slow breath otherwise. */
29
- .dot { width: 7px; height: 7px; flex: none; margin: 0 6px 0 3px; border-radius: 50%; corner-shape: round; background: var(--accent); animation: breathe 1.4s var(--ease-in-out) infinite; }
29
+ .dot { width: 7px; height: 7px; flex: none; margin: 0 var(--space-related) 0 var(--space-tight); border-radius: 50%; corner-shape: round; background: var(--accent); animation: breathe 1.4s var(--ease-in-out) infinite; }
30
30
  .dot[data-reduced] { animation: none; }
31
31
  @keyframes breathe { 50% { opacity: .35; } }
32
32
 
33
- .actions { display: flex; flex: none; align-items: center; gap: 2px; padding-right: 4px; }
34
- .action { display: grid; width: 32px; height: 32px; place-items: center; padding: 0; border: 0; border-radius: calc(var(--radius-control) - 5px); corner-shape: var(--corner-shape); background: transparent; color: var(--text-muted); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
33
+ .actions { display: flex; flex: none; align-items: center; gap: var(--space-hair); padding-right: var(--space-tight); }
34
+ .action { display: grid; width: 32px; height: 32px; place-items: center; padding: 0; border: 0; border-radius: calc(var(--radius-control) - var(--space-tight)); corner-shape: var(--corner-shape); background: transparent; color: var(--text-muted); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
35
35
  @media (hover: hover) and (pointer: fine) { .action:hover { background: var(--surface-muted); color: var(--foreground); } }
36
36
  .action:active, .action:focus-visible { background: var(--surface-muted); color: var(--foreground); outline: none; }
37
37
 
38
38
  .messageSlot { position: relative; overflow: hidden; }
39
- .message { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px var(--space-group); padding-top: var(--space-related); font-size: var(--text-xs); line-height: var(--leading-body); }
39
+ .message { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-hair) var(--space-group); padding-top: var(--space-related); font-size: var(--text-xs); line-height: var(--leading-body); }
40
40
  .message[data-tone="hint"] { color: var(--text-muted); }
41
41
  .message[data-tone="warning"] { color: var(--text-secondary); }
42
- .message[data-tone="warning"] .messageText::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 7px 1px 1px; border-radius: 50%; corner-shape: round; background: var(--warning); vertical-align: middle; }
42
+ .message[data-tone="warning"] .messageText::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 var(--space-related) 1px 1px; border-radius: 50%; corner-shape: round; background: var(--warning); vertical-align: middle; }
43
43
  .strong { color: var(--foreground); font-weight: 500; }
44
44
  .messageActions { display: inline-flex; gap: var(--space-group); }
45
45
  .link { padding: 0; border: 0; background: none; color: var(--foreground); cursor: pointer; font: inherit; font-weight: 500; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; transition: text-decoration-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
@@ -50,7 +50,7 @@
50
50
  /* ---------------------------------------------- Cheatsheet ---------------------------------------------- */
51
51
 
52
52
  .list { container-type: inline-size; display: grid; min-width: 0; gap: var(--space-group); font-family: var(--font-body); letter-spacing: var(--tracking-body); }
53
- .searchRow { display: flex; height: var(--control-height-sm); box-sizing: border-box; align-items: center; gap: var(--space-related); padding: 0 6px 0 12px; border: 1px solid var(--border); border-radius: var(--radius-control); corner-shape: var(--corner-shape); background: var(--surface); transition: border-color var(--duration-fast) var(--ease-standard); }
53
+ .searchRow { display: flex; height: var(--control-height-sm); box-sizing: border-box; align-items: center; gap: var(--space-related); padding: 0 var(--space-related) 0 var(--space-group); border: 1px solid var(--border); border-radius: var(--radius-control); corner-shape: var(--corner-shape); background: var(--surface); transition: border-color var(--duration-fast) var(--ease-standard); }
54
54
  .searchRow:focus-within { border-color: var(--foreground); }
55
55
  .searchIcon { flex: none; color: var(--text-muted); }
56
56
  .search { min-width: 0; height: 100%; flex: 1; padding: 0; border: 0; background: transparent; color: var(--foreground); font: inherit; font-size: var(--text-sm); outline: none; -webkit-appearance: none; appearance: none; }
@@ -62,12 +62,12 @@
62
62
 
63
63
  .groups { display: grid; align-items: start; gap: 0 var(--space-section); }
64
64
  @container (min-width: 520px) { .groups { grid-template-columns: 1fr 1fr; } }
65
- .group { overflow: hidden; margin-inline: -8px; padding-inline: 8px; }
65
+ .group { overflow: hidden; margin-inline: calc(var(--space-related) * -1); padding-inline: var(--space-related); }
66
66
  .groupLabel { margin: 0; padding: var(--space-group) 0 var(--space-tight); color: var(--text-muted); font-size: var(--text-xs); font-weight: 400; }
67
67
  .rows { display: grid; margin: 0; padding: 0; list-style: none; }
68
- .item { overflow: hidden; margin-inline: -8px; }
68
+ .item { overflow: hidden; margin-inline: calc(var(--space-related) * -1); }
69
69
  /* Rows fade when a held modifier is not in them, and light when their whole combination is down. */
70
- .itemInner { display: flex; min-height: 36px; align-items: center; justify-content: space-between; gap: var(--space-group); padding: 0 8px; border-radius: var(--radius-detail); corner-shape: var(--corner-shape); transition: opacity var(--duration-standard) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard); }
70
+ .itemInner { display: flex; min-height: 36px; align-items: center; justify-content: space-between; gap: var(--space-group); padding: 0 var(--space-related); border-radius: var(--radius-detail); corner-shape: var(--corner-shape); transition: opacity var(--duration-standard) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard); }
71
71
  .item + .item .itemInner { box-shadow: inset 0 1px 0 var(--border-subtle); }
72
72
  .item[data-dim] .itemInner { opacity: .38; }
73
73
  .item[data-match] .itemInner { background: var(--accent-subtle); box-shadow: none; }