sherick-ui 2.1.1 → 2.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 (139) hide show
  1. package/README.md +24 -1
  2. package/dist/cjs/components/Badge.cjs +1 -1
  3. package/dist/cjs/components/Badge.cjs.map +1 -1
  4. package/dist/cjs/components/Button.cjs +11 -2
  5. package/dist/cjs/components/Button.cjs.map +1 -1
  6. package/dist/cjs/components/Calendar.cjs +2 -2
  7. package/dist/cjs/components/Calendar.cjs.map +1 -1
  8. package/dist/cjs/components/Card.cjs +3 -2
  9. package/dist/cjs/components/Card.cjs.map +1 -1
  10. package/dist/cjs/components/Chip.cjs +3 -3
  11. package/dist/cjs/components/Chip.cjs.map +1 -1
  12. package/dist/cjs/components/Combobox.cjs +1 -1
  13. package/dist/cjs/components/Combobox.cjs.map +1 -1
  14. package/dist/cjs/components/Command.cjs +2 -2
  15. package/dist/cjs/components/Command.cjs.map +1 -1
  16. package/dist/cjs/components/CommandPalette.cjs +1 -1
  17. package/dist/cjs/components/CommandPalette.cjs.map +1 -1
  18. package/dist/cjs/components/DateRangePicker.cjs +1 -1
  19. package/dist/cjs/components/DateRangePicker.cjs.map +1 -1
  20. package/dist/cjs/components/DialogHeader.cjs +1 -1
  21. package/dist/cjs/components/DialogHeader.cjs.map +1 -1
  22. package/dist/cjs/components/Drawer.cjs +1 -1
  23. package/dist/cjs/components/Drawer.cjs.map +1 -1
  24. package/dist/cjs/components/Field.cjs +1 -1
  25. package/dist/cjs/components/Field.cjs.map +1 -1
  26. package/dist/cjs/components/FileUpload.cjs +2 -2
  27. package/dist/cjs/components/FileUpload.cjs.map +1 -1
  28. package/dist/cjs/components/IconButton.cjs +1 -1
  29. package/dist/cjs/components/IconButton.cjs.map +1 -1
  30. package/dist/cjs/components/Input.cjs +1 -1
  31. package/dist/cjs/components/Input.cjs.map +1 -1
  32. package/dist/cjs/components/NavItem.cjs +3 -3
  33. package/dist/cjs/components/NavItem.cjs.map +1 -1
  34. package/dist/cjs/components/NumberField.cjs +1 -1
  35. package/dist/cjs/components/NumberField.cjs.map +1 -1
  36. package/dist/cjs/components/Pagination.cjs +1 -1
  37. package/dist/cjs/components/Pagination.cjs.map +1 -1
  38. package/dist/cjs/components/Progress.cjs +7 -4
  39. package/dist/cjs/components/Progress.cjs.map +1 -1
  40. package/dist/cjs/components/RadioGroup.cjs +3 -2
  41. package/dist/cjs/components/RadioGroup.cjs.map +1 -1
  42. package/dist/cjs/components/Select.cjs +1 -1
  43. package/dist/cjs/components/Select.cjs.map +1 -1
  44. package/dist/cjs/components/Slider.cjs +1 -1
  45. package/dist/cjs/components/Slider.cjs.map +1 -1
  46. package/dist/cjs/components/Stepper.cjs +5 -1
  47. package/dist/cjs/components/Stepper.cjs.map +1 -1
  48. package/dist/cjs/components/Table.cjs +10 -2
  49. package/dist/cjs/components/Table.cjs.map +1 -1
  50. package/dist/cjs/components/Tabs.cjs +1 -1
  51. package/dist/cjs/components/Tabs.cjs.map +1 -1
  52. package/dist/cjs/components/Textarea.cjs +1 -1
  53. package/dist/cjs/components/Textarea.cjs.map +1 -1
  54. package/dist/cjs/components/Toast.cjs +5 -2
  55. package/dist/cjs/components/Toast.cjs.map +1 -1
  56. package/dist/cjs/components/Tooltip.cjs +1 -1
  57. package/dist/cjs/components/Tooltip.cjs.map +1 -1
  58. package/dist/cjs/components/TreeView.cjs +43 -10
  59. package/dist/cjs/components/TreeView.cjs.map +1 -1
  60. package/dist/cjs/components/ui.common.cjs +109 -44
  61. package/dist/cjs/components/ui.common.cjs.map +1 -1
  62. package/dist/cjs/components/ui.motion.cjs +37 -13
  63. package/dist/cjs/components/ui.motion.cjs.map +1 -1
  64. package/dist/cjs/dev.cjs +10 -0
  65. package/dist/cjs/dev.cjs.map +1 -1
  66. package/dist/esm/components/Badge.js +2 -2
  67. package/dist/esm/components/Badge.js.map +1 -1
  68. package/dist/esm/components/Button.js +12 -3
  69. package/dist/esm/components/Button.js.map +1 -1
  70. package/dist/esm/components/Calendar.js +3 -3
  71. package/dist/esm/components/Calendar.js.map +1 -1
  72. package/dist/esm/components/Card.js +4 -3
  73. package/dist/esm/components/Card.js.map +1 -1
  74. package/dist/esm/components/Chip.js +3 -3
  75. package/dist/esm/components/Chip.js.map +1 -1
  76. package/dist/esm/components/CodeBlock.js +5 -4
  77. package/dist/esm/components/CodeBlock.js.map +1 -1
  78. package/dist/esm/components/Combobox.js +2 -2
  79. package/dist/esm/components/Combobox.js.map +1 -1
  80. package/dist/esm/components/Command.js +3 -3
  81. package/dist/esm/components/Command.js.map +1 -1
  82. package/dist/esm/components/CommandPalette.js +2 -2
  83. package/dist/esm/components/CommandPalette.js.map +1 -1
  84. package/dist/esm/components/DateRangePicker.js +2 -2
  85. package/dist/esm/components/DateRangePicker.js.map +1 -1
  86. package/dist/esm/components/DialogHeader.js +2 -2
  87. package/dist/esm/components/DialogHeader.js.map +1 -1
  88. package/dist/esm/components/Drawer.js +2 -2
  89. package/dist/esm/components/Drawer.js.map +1 -1
  90. package/dist/esm/components/Field.js +2 -2
  91. package/dist/esm/components/Field.js.map +1 -1
  92. package/dist/esm/components/FileUpload.js +3 -3
  93. package/dist/esm/components/FileUpload.js.map +1 -1
  94. package/dist/esm/components/IconButton.js +1 -1
  95. package/dist/esm/components/IconButton.js.map +1 -1
  96. package/dist/esm/components/Input.js +2 -2
  97. package/dist/esm/components/Input.js.map +1 -1
  98. package/dist/esm/components/Markdown.js +3 -2
  99. package/dist/esm/components/Markdown.js.map +1 -1
  100. package/dist/esm/components/NavItem.js +5 -5
  101. package/dist/esm/components/NavItem.js.map +1 -1
  102. package/dist/esm/components/NumberField.js +2 -2
  103. package/dist/esm/components/NumberField.js.map +1 -1
  104. package/dist/esm/components/Pagination.js +2 -2
  105. package/dist/esm/components/Pagination.js.map +1 -1
  106. package/dist/esm/components/Progress.js +8 -5
  107. package/dist/esm/components/Progress.js.map +1 -1
  108. package/dist/esm/components/RadioGroup.js +5 -4
  109. package/dist/esm/components/RadioGroup.js.map +1 -1
  110. package/dist/esm/components/Select.js +2 -2
  111. package/dist/esm/components/Select.js.map +1 -1
  112. package/dist/esm/components/Slider.js +1 -1
  113. package/dist/esm/components/Slider.js.map +1 -1
  114. package/dist/esm/components/Stepper.js +6 -2
  115. package/dist/esm/components/Stepper.js.map +1 -1
  116. package/dist/esm/components/Table.js +11 -3
  117. package/dist/esm/components/Table.js.map +1 -1
  118. package/dist/esm/components/Tabs.js +2 -2
  119. package/dist/esm/components/Tabs.js.map +1 -1
  120. package/dist/esm/components/Textarea.js +2 -2
  121. package/dist/esm/components/Textarea.js.map +1 -1
  122. package/dist/esm/components/Toast.js +6 -3
  123. package/dist/esm/components/Toast.js.map +1 -1
  124. package/dist/esm/components/Tooltip.js +2 -2
  125. package/dist/esm/components/Tooltip.js.map +1 -1
  126. package/dist/esm/components/TreeView.js +45 -12
  127. package/dist/esm/components/TreeView.js.map +1 -1
  128. package/dist/esm/components/ui.common.js +105 -46
  129. package/dist/esm/components/ui.common.js.map +1 -1
  130. package/dist/esm/components/ui.motion.js +34 -14
  131. package/dist/esm/components/ui.motion.js.map +1 -1
  132. package/dist/esm/dev.js +2 -2
  133. package/dist/styles.css +173 -61
  134. package/dist/theme.css +33 -4
  135. package/dist/types/dev.d.cts +56 -35
  136. package/dist/types/dev.d.ts +56 -35
  137. package/dist/types/index.d.cts +15 -3
  138. package/dist/types/index.d.ts +15 -3
  139. package/package.json +1 -1
@@ -36,15 +36,28 @@ var utils = require('../libs/utils.cjs');
36
36
  const motionFeedback = "transition-[background-color,color,box-shadow,opacity] duration-press ease-press motion-reduce:transition-none";
37
37
  /** A control answers a press immediately and settles on its release.
38
38
  *
39
- * The recipe owns the *amplitude* of that answer as well as its timing, because how far a
40
- * press travels is the system's physical character rather than a component's anatomy: a
41
- * control whose outline is what the user sees compresses 4%, which is about two pixels at the
42
- * size of the ink it moves. A control whose visible ink is far smaller than the target it is
43
- * aimed at takes `motionInkPress` on that ink instead, so the target itself never moves. The
44
- * interpolation and the compression are neutralised together under reduced motion. */
39
+ * The recipe owns the *amplitude* of that answer as well as its timing, because how far a press
40
+ * travels is the system's physical character rather than a component's anatomy. A percentage is a
41
+ * distance only once it meets a size, so the amplitude comes in tiers chosen by the control's role:
42
+ *
43
+ * - `motionTactile`: a content-width control — a button, a chip, a segment — compresses 4%, about
44
+ * two pixels at the size of the ink it moves.
45
+ * - `motionTactileWide`: a control that spans a track — a tab — compresses 1.5%, so its edges move
46
+ * about as far as a button's.
47
+ * - `motionTactileField`: a list-opening field — a Select trigger, an editable Combobox — spans
48
+ * its whole container, and 4% of a 580px field moved each edge 11.6px. It compresses 0.7%, about
49
+ * two pixels at that width: the field acknowledges the press without lurching.
50
+ *
51
+ * The press leg runs on `duration-tactile`, short enough to land inside a tap; the release settles
52
+ * on the release timing. A control whose visible ink is far smaller than its target takes
53
+ * `motionInkPress` on that ink instead, so the target itself never moves. The interpolation and
54
+ * the compression are neutralised together under reduced motion. */
45
55
  /* Base may disable the surface itself or the value control inside a Select wrapper.
46
- Neither is a pressable surface. Timing and amplitude are otherwise unchanged. */
47
- const motionTactile = "transition-[background-color,color,box-shadow,transform,opacity] duration-release ease-release active:duration-press active:ease-press motion-safe:[&:not([data-disabled],:disabled,:has(>[role=combobox][data-disabled]))]:active:scale-[0.96] motion-reduce:transition-none";
56
+ Neither is a pressable surface. Timing is otherwise shared by every tier. */
57
+ const tactileTiming = "transition-[background-color,color,box-shadow,transform,opacity] duration-release ease-release active:duration-tactile active:ease-press motion-reduce:transition-none";
58
+ const motionTactile = /* @__PURE__ */ utils.cx(tactileTiming, "motion-safe:[&:not([data-disabled],:disabled,:has(>[role=combobox][data-disabled]))]:active:scale-[0.96]");
59
+ const motionTactileWide = /* @__PURE__ */ utils.cx(tactileTiming, "motion-safe:[&:not([data-disabled],:disabled)]:active:scale-[0.985]");
60
+ const motionTactileField = /* @__PURE__ */ utils.cx(tactileTiming, "motion-safe:[&:not([data-disabled],:disabled,:has(>[role=combobox][data-disabled]))]:active:scale-[0.993]");
48
61
  /** The spatial half of a compact press, applied to the *mark* rather than to the control.
49
62
  *
50
63
  * A control whose visible ink is much smaller than the target it is aimed at — a dialog's close
@@ -54,7 +67,7 @@ const motionTactile = "transition-[background-color,color,box-shadow,transform,o
54
67
  * release lands), so the mark takes the twelve percent and the target keeps its geometry. The
55
68
  * target still owns the focus ring and the state layer, and still carries the tone and depth
56
69
  * response, so the boundary a press happens inside never moves. */
57
- const motionInkPress = "transition-transform duration-release ease-release group-active:duration-press group-active:ease-press group-active:scale-[0.88] motion-reduce:transition-none motion-reduce:group-active:scale-100";
70
+ const motionInkPress = "transition-transform duration-release ease-release group-active:duration-tactile group-active:ease-press group-active:scale-[0.88] motion-reduce:transition-none motion-reduce:group-active:scale-100";
58
71
  /* Motion is not owned here — but the recipes above are the whole vocabulary: every press, arrival,
59
72
  travel, presence and activity in the library is one of these names plus its owner's own target
60
73
  geometry. */
@@ -83,6 +96,9 @@ const motionOrient = "transition-transform duration-release ease-release motion-
83
96
  * settle together, and an interrupted move retargets from wherever it currently is
84
97
  * because it is a transition and not a keyframe. */
85
98
  const motionRelocate = "transition-[left,inset-inline-start,top,width,height,transform,background-color,color,box-shadow,opacity] duration-release ease-glide motion-reduce:transition-none";
99
+ /** The same travel across a whole track — a tab indicator — on the longer travel timing, so a
100
+ * movement of hundreds of pixels is followed rather than skipped. */
101
+ const motionRelocateLong = "transition-[left,inset-inline-start,top,width,height,transform,background-color,color,box-shadow,opacity] duration-travel ease-glide motion-reduce:transition-none";
86
102
  /** Direct manipulation: the pointer owns the geometry, so a positional transition would be
87
103
  * lag. While the primitive reports a drag, position and size are removed from the
88
104
  * transition list and only tone and engagement geometry remain; a keyboard or programmatic
@@ -134,7 +150,7 @@ const motionPresenceTooltip = /* @__PURE__ */ utils.cx("transition-[opacity,tran
134
150
  const motionPresenceModal = /* @__PURE__ */ utils.cx("transition-[opacity,transform] duration-overlay ease-glide", "data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit", "motion-reduce:transition-[opacity]", modalFrom);
135
151
  /** The plane behind a surface that owns the viewport. Opacity only: a blur or a filter is
136
152
  * never animated, so the plane can never animate the page behind it. */
137
- const motionPresenceScrim = "transition-opacity duration-overlay ease-release data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit";
153
+ const motionPresenceScrim = "transition-opacity duration-overlay ease-release data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit";
138
154
  /** Continuous activity is a distinct intent, not an exception to interaction motion: it
139
155
  * reports work rather than answering an event, and it has no entrance of its own. */
140
156
  const motionActivitySpin = "animate-spin motion-reduce:animate-none";
@@ -149,13 +165,17 @@ const motionActivityPulse = "animate-pulse motion-reduce:animate-none";
149
165
  const motionActivityIndeterminate = "animate-sherick-indeterminate [[dir=rtl]_&]:[--sui-indeterminate-direction:-1] motion-reduce:animate-none";
150
166
  /** The state layer is a composited overlay, so its own opacity is the only thing that
151
167
  * moves. Shared here because four interaction states across the library ride it. */
152
- const motionStateLayer = "before:transition-opacity before:duration-release before:ease-release active:before:duration-press active:before:ease-press group-active:before:duration-press group-active:before:ease-press motion-reduce:before:transition-none";
168
+ /** A row in a collection moves its highlight rather than fading it: a highlight is where the reader
169
+ * is, and arrowing through a list with a soft fade on every row leaves a smear of half-lit rows.
170
+ * The row's layer therefore changes in one step, for the pointer and the keyboard alike. */
171
+ const motionRowLayer = "before:transition-none";
172
+ const motionStateLayer = "before:transition-opacity before:duration-release before:ease-release active:before:duration-tactile active:before:ease-press group-active:before:duration-tactile group-active:before:ease-press motion-reduce:before:transition-none";
153
173
  /* `disclose` is the in-flow counterpart of presence: nothing mounts or unmounts, and nothing
154
174
  leaves the page — one region changes its own height where it sits. Base measures the panel and
155
175
  publishes that height, so the geometry is the primitive's and only the interpolation is here.
156
176
  The panel states the height it opens to; this recipe owns how it gets there, and reduced
157
177
  motion applies the layout state in one step rather than travelling through it. */
158
- const motionDisclose = "transition-[height] duration-release ease-release data-[starting-style]:h-0 data-[ending-style]:h-0 motion-reduce:transition-none";
178
+ const motionDisclose = "transition-[height] duration-release ease-release data-[starting-style]:h-0 data-[ending-style]:h-0 data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit motion-reduce:transition-none";
159
179
  /* A sheet is a surface that owns the viewport and is attached to one edge of it, so its presence is
160
180
  a slide out of that edge rather than the modal lift, and it never bounces. The component names the
161
181
  edge by setting exactly one of `--sui-sheet-from-x` / `--sui-sheet-from-y` to a full own-extent
@@ -166,7 +186,7 @@ const motionDisclose = "transition-[height] duration-release ease-release data-[
166
186
  component did not set would translate a side sheet on both axes at once, so a sheet attached to
167
187
  the right edge would enter from the bottom-right corner and travel diagonally instead of
168
188
  straight in. One edge means one axis. */
169
- const motionPresenceSheet = /* @__PURE__ */ utils.cx("transition-[transform,opacity] duration-overlay ease-glide", "data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit", "motion-reduce:transition-[opacity]", "data-[starting-style]:opacity-0", "data-[ending-style]:opacity-0", "data-[starting-style]:[transform:translate(var(--sui-sheet-from-x,0px),var(--sui-sheet-from-y,0px))]", "data-[ending-style]:[transform:translate(var(--sui-sheet-from-x,0px),var(--sui-sheet-from-y,0px))]", "motion-reduce:data-[starting-style]:transform-none", "motion-reduce:data-[ending-style]:transform-none");
189
+ const motionPresenceSheet = /* @__PURE__ */ utils.cx("transition-[transform,opacity] duration-sheet ease-glide", "data-[ending-style]:duration-sheet-exit data-[ending-style]:ease-exit", "motion-reduce:transition-[opacity]", "data-[starting-style]:opacity-0", "data-[ending-style]:opacity-0", "data-[starting-style]:[transform:translate(var(--sui-sheet-from-x,0px),var(--sui-sheet-from-y,0px))]", "data-[ending-style]:[transform:translate(var(--sui-sheet-from-x,0px),var(--sui-sheet-from-y,0px))]", "motion-reduce:data-[starting-style]:transform-none", "motion-reduce:data-[ending-style]:transform-none");
170
190
  /* A toast is a stack, not a single surface: several independent surfaces share one corner,
171
191
  re-flow when one of them leaves, and can each be flung away by the pointer. That is one
172
192
  spatial owner on one node, and this is it.
@@ -195,6 +215,10 @@ exports.motionPresenceSheet = motionPresenceSheet;
195
215
  exports.motionPresenceToast = motionPresenceToast;
196
216
  exports.motionPresenceTooltip = motionPresenceTooltip;
197
217
  exports.motionRelocate = motionRelocate;
218
+ exports.motionRelocateLong = motionRelocateLong;
219
+ exports.motionRowLayer = motionRowLayer;
198
220
  exports.motionStateLayer = motionStateLayer;
199
221
  exports.motionTactile = motionTactile;
222
+ exports.motionTactileField = motionTactileField;
223
+ exports.motionTactileWide = motionTactileWide;
200
224
  //# sourceMappingURL=ui.motion.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ui.motion.cjs","sources":["../../../src/components/ui.motion.ts"],"sourcesContent":["/* Sherick UI motion grammar\n =========================\n Components describe what changes; this module exclusively describes how change moves.\n\n The canonical intents are:\n - feedback: non-spatial state response;\n - tactile: temporary physical response to activation;\n - arrive: a meaningful subordinate part appears or leaves;\n - orient: a persistent part changes orientation in place;\n - relocate: a persistent part moves or resizes between stable states;\n - direct: geometry continuously follows the user;\n - disclose: in-flow content expands and collapses;\n - presence: an independent surface enters/leaves;\n - activity: continuous motion that communicates ongoing work.\n\n Every recipe here owns the transition property, the duration, the curve and the\n `prefers-reduced-motion` behavior for one physical event. The durations and curves\n themselves are the authored tokens in `src/styles/tokens.ts`; nothing in this file\n writes a literal duration or an animation keyframe beyond the two activity loops.\n\n `docs/DESIGN_LANGUAGE.md` owns the semantics. Target geometry, material, tone and\n elevation remain component/anatomy concerns: a component says where something ends\n up, and this module says how it gets there. */\n\n/* A recipe that is composed from other recipes is built through `cx`, whose call is marked pure.\n That is load-bearing for the published bundles rather than a bundler detail: an unused recipe\n whose value is a template literal with a substitution in it is not provably side-effect-free, so\n it survives tree-shaking and every consumer that imports any part of this module pays for every\n recipe in it — including the families it never uses. See `libs/utils.ts`. */\nimport { cx } from \"@/libs/utils\";\n\nexport type MotionIntent =\n | \"feedback\"\n | \"tactile\"\n | \"arrive\"\n | \"orient\"\n | \"relocate\"\n | \"direct\"\n | \"disclose\"\n | \"presence\"\n | \"activity\";\n\n/** Non-spatial feedback: hover, focus, field tone, a highlighted row, a filled surface.\n * It never translates, scales or resizes; reduced motion simply drops the interpolation\n * and the state still arrives. */\nexport const motionFeedback =\n \"transition-[background-color,color,box-shadow,opacity] duration-press ease-press motion-reduce:transition-none\";\n\n/** A control answers a press immediately and settles on its release.\n *\n * The recipe owns the *amplitude* of that answer as well as its timing, because how far a\n * press travels is the system's physical character rather than a component's anatomy: a\n * control whose outline is what the user sees compresses 4%, which is about two pixels at the\n * size of the ink it moves. A control whose visible ink is far smaller than the target it is\n * aimed at takes `motionInkPress` on that ink instead, so the target itself never moves. The\n * interpolation and the compression are neutralised together under reduced motion. */\n/* Base may disable the surface itself or the value control inside a Select wrapper.\n Neither is a pressable surface. Timing and amplitude are otherwise unchanged. */\nexport const motionTactile =\n \"transition-[background-color,color,box-shadow,transform,opacity] duration-release ease-release active:duration-press active:ease-press motion-safe:[&:not([data-disabled],:disabled,:has(>[role=combobox][data-disabled]))]:active:scale-[0.96] motion-reduce:transition-none\";\n\n/** The spatial half of a compact press, applied to the *mark* rather than to the control.\n *\n * A control whose visible ink is much smaller than the target it is aimed at — a dialog's close\n * control, a stepper, a search field's submit — is a large target around a small glyph, and only\n * the glyph is visible at rest. Compressing the whole control would shrink the ground the pointer\n * is already on (a 44px target becomes 38.7px while held, which is exactly where a near-edge\n * release lands), so the mark takes the twelve percent and the target keeps its geometry. The\n * target still owns the focus ring and the state layer, and still carries the tone and depth\n * response, so the boundary a press happens inside never moves. */\nexport const motionInkPress =\n \"transition-transform duration-release ease-release group-active:duration-press group-active:ease-press group-active:scale-[0.88] motion-reduce:transition-none motion-reduce:group-active:scale-100\";\n\n/* Motion is not owned here — but the recipes above are the whole vocabulary: every press, arrival,\n travel, presence and activity in the library is one of these names plus its owner's own target\n geometry. */\n\n/* A field that opens a list — a `Select`'s trigger, an editable `Combobox`'s field — takes\n `motionTactile` as a whole, which is what makes the two forms of the same control press\n identically. The *field* is the element that carries the compression in both: a press activates\n the whole chain, so a descendant being pressed is what makes the field itself match `:active`\n (and a select trigger's own active state is suppressed by the primitive, so its field's wrapper\n is the only element left to carry it). Typing, focus and hover never match it, so the field is\n perfectly still while it is used as a text field; a press that places a caret or drags across a\n word is the same press the field already answers, and distinguishing it would take pointer\n bookkeeping inside a component for a case that reads as one interaction either way. */\n\n/** A meaningful subordinate part arrives. Spring is reserved for this intent: a mark is\n * made by overshooting the position it lands in. It leaves without the overshoot, and\n * reduced motion lands it in one step — which takes a *state-specific* override, because the\n * starting state is a higher-specificity rule than a plain `transform: none` and would otherwise\n * win under reduced motion while the transition was gone, turning a spring into an instant jump. */\nexport const motionArrive =\n \"transition-[background-color,color,box-shadow,transform,opacity] duration-release ease-spring data-[starting-style]:scale-50 data-[ending-style]:scale-50 data-[ending-style]:opacity-0 data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit motion-reduce:transition-none motion-reduce:transform-none motion-reduce:data-[starting-style]:scale-100 motion-reduce:data-[ending-style]:scale-100\";\n\n/** A persistent affordance changes orientation in place: a disclosure chevron. It reaches\n * its target orientation consistently and never overshoots. */\nexport const motionOrient =\n \"transition-transform duration-release ease-release motion-reduce:transition-none\";\n\n/** A persistent object travels between stable destinations: a tab indicator, a switch\n * thumb. The travel itself is the event, so it takes the glide curve rather than the\n * arrival curve, and it never overshoots: a destination that is passed and come back\n * from reads as a defect. Position, size and the tone the object picks up on the way\n * settle together, and an interrupted move retargets from wherever it currently is\n * because it is a transition and not a keyframe. */\nexport const motionRelocate =\n \"transition-[left,inset-inline-start,top,width,height,transform,background-color,color,box-shadow,opacity] duration-release ease-glide motion-reduce:transition-none\";\n\n/** Direct manipulation: the pointer owns the geometry, so a positional transition would be\n * lag. While the primitive reports a drag, position and size are removed from the\n * transition list and only tone and engagement geometry remain; a keyboard or programmatic\n * step still settles. Reduced motion never changes direct manipulation. */\nexport const motionDirect =\n \"transition-[inset-inline-start,width,height,background-color,color,box-shadow,transform,opacity] duration-release ease-release active:duration-press active:ease-press data-[dragging]:transition-[background-color,color,box-shadow,transform,opacity] motion-reduce:transition-none motion-reduce:transform-none\";\n\n/* Anchored popup, tooltip, modal, sheet, toast and scrim presence share three states:\n settled, `data-starting-style` and `data-ending-style`. The primitive decides\n when the node mounts and unmounts.\n None of them writes an animation keyframe or a timer, so a rapid open → close → open\n retargets from the current painted value instead of restarting.\n\n The anchored roles read their entrance direction from the resolved side. Base publishes\n the side on the popup after collision handling and the origin as `--transform-origin`, so\n a surface below its trigger rises into place, one above it settles down into it, and one\n flipped by a collision animates the way it is actually placed. */\n\nconst anchoredGeometry = /* @__PURE__ */ cx(\n \"[transform-origin:var(--transform-origin)]\",\n \"[--sui-overlay-from-shift-y:-4px]\",\n \"data-[side=top]:[--sui-overlay-from-shift-y:4px]\",\n \"data-[side=left]:[--sui-overlay-from-shift-y:0px] data-[side=left]:[--sui-overlay-from-shift-x:4px]\",\n \"data-[side=right]:[--sui-overlay-from-shift-y:0px] data-[side=right]:[--sui-overlay-from-shift-x:-4px]\",\n /* The logical sides resolve against the writing direction: `inline-start` puts the popup at the\n anchor's inline-start edge, which is its physical *left* on a left-to-right page and its\n physical *right* on a right-to-left one, so the four pixels that travel toward the anchor\n change sign with the page while the physical sides above never do. The direction is read from\n the `dir` attribute — the attribute that lays the page out, and the only one a portaled\n surface can see. The primitive resolves the side from the direction *it* is told about\n (`DirectionProvider`), so a consumer whose page is right-to-left declares that direction to\n both, exactly as the workbench's RTL specimens do. */\n \"data-[side=inline-start]:[--sui-overlay-from-shift-y:0px] data-[side=inline-start]:[--sui-overlay-from-shift-x:4px]\",\n \"[[dir=rtl]_&]:data-[side=inline-start]:[--sui-overlay-from-shift-x:-4px]\",\n \"data-[side=inline-end]:[--sui-overlay-from-shift-y:0px] data-[side=inline-end]:[--sui-overlay-from-shift-x:-4px]\",\n \"[[dir=rtl]_&]:data-[side=inline-end]:[--sui-overlay-from-shift-x:4px]\",\n);\n\n/* Both ends of a presence animation start from the same state, and reduced motion drops the\n spatial half of it: presence still reads as arriving, but only through opacity. The\n transform is a literal class rather than an interpolated one, because the stylesheet\n compiler reads class names as text: a name that only exists once a template is evaluated\n compiles to no rule at all. */\nconst anchoredFrom = /* @__PURE__ */ cx(\n \"data-[starting-style]:opacity-0\",\n \"data-[starting-style]:[transform:translate(var(--sui-overlay-from-shift-x,0px),var(--sui-overlay-from-shift-y,0px))scale(var(--sui-overlay-from-scale,1))]\",\n \"data-[ending-style]:opacity-0\",\n \"data-[ending-style]:[transform:translate(var(--sui-overlay-from-shift-x,0px),var(--sui-overlay-from-shift-y,0px))scale(var(--sui-overlay-from-scale,1))]\",\n \"motion-reduce:data-[starting-style]:transform-none\",\n \"motion-reduce:data-[ending-style]:transform-none\",\n);\n\nconst modalFrom = /* @__PURE__ */ cx(\n \"data-[starting-style]:opacity-0\",\n \"data-[starting-style]:[transform:translate(0,12px)scale(0.96)]\",\n \"data-[ending-style]:opacity-0\",\n \"data-[ending-style]:[transform:translate(0,12px)scale(0.96)]\",\n \"motion-reduce:data-[starting-style]:transform-none\",\n \"motion-reduce:data-[ending-style]:transform-none\",\n);\n\n/** An anchored surface: `Select`, `Combobox`, `Menu` and `Popover`. It grows out of the edge\n * it is attached to, enters on the overlay timing, and leaves on the shorter exit.\n *\n * The grow is the motion's signature and the four pixels of travel only support it, so the\n * entrance takes the glide curve rather than the arrival curve. With a front-loaded curve the\n * opacity and the scale both jump in the first frames, which means the surface is already half\n * grown by the time it is visible at all — a pop, not a grow. The glide curve spends its whole\n * duration visible, so the eye actually sees the surface open out of its anchor. */\nexport const motionPresenceAnchored = /* @__PURE__ */ cx(\n \"transition-[opacity,transform] duration-overlay ease-glide\",\n \"data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit\",\n \"motion-reduce:transition-[opacity]\",\n \"[--sui-overlay-from-scale:0.94]\",\n anchoredGeometry,\n anchoredFrom,\n);\n\n/** A tooltip: the same side-aware model and the same grow as an anchored popup, deliberately\n * lighter — it settles on the local timing rather than the overlay timing, and it never\n * bounces. */\nexport const motionPresenceTooltip = /* @__PURE__ */ cx(\n \"transition-[opacity,transform] duration-release ease-glide\",\n \"data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit\",\n \"motion-reduce:transition-[opacity]\",\n \"[--sui-overlay-from-scale:0.94]\",\n anchoredGeometry,\n anchoredFrom,\n);\n\n/** A modal surface: anchored to the viewport rather than to a trigger, so it has no side\n * to grow from. A large surface never bounces; it fades, rises a little and settles, and its\n * scale stays restrained because a plane this big grows visibly even from a few percent. */\nexport const motionPresenceModal = /* @__PURE__ */ cx(\n \"transition-[opacity,transform] duration-overlay ease-glide\",\n \"data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit\",\n \"motion-reduce:transition-[opacity]\",\n modalFrom,\n);\n\n/** The plane behind a surface that owns the viewport. Opacity only: a blur or a filter is\n * never animated, so the plane can never animate the page behind it. */\nexport const motionPresenceScrim =\n \"transition-opacity duration-overlay ease-release data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit\";\n\n/** Continuous activity is a distinct intent, not an exception to interaction motion: it\n * reports work rather than answering an event, and it has no entrance of its own. */\nexport const motionActivitySpin = \"animate-spin motion-reduce:animate-none\";\nexport const motionActivityPulse = \"animate-pulse motion-reduce:animate-none\";\n\n/** The indeterminate half of a progress bar. A task with no known value cannot report a\n * position, so it reports *work* instead: the fill sweeps across its own track on the one loop\n * that is paced, because a loop that reports rather than answers cannot arrive. The travel is a\n * composited transform rather than a laid-out edge, and an endless loop must never sit on the\n * layout path; the direction is a value the recipe flips with the writing direction, because a\n * transform is physical and the sweep follows the page. Under reduced motion the loop stops and\n * the fill rests where it starts: a static status glyph, exactly as the spin and the pulse rest. */\nexport const motionActivityIndeterminate =\n \"animate-sherick-indeterminate [[dir=rtl]_&]:[--sui-indeterminate-direction:-1] motion-reduce:animate-none\";\n\n/** The state layer is a composited overlay, so its own opacity is the only thing that\n * moves. Shared here because four interaction states across the library ride it. */\nexport const motionStateLayer =\n \"before:transition-opacity before:duration-release before:ease-release active:before:duration-press active:before:ease-press group-active:before:duration-press group-active:before:ease-press motion-reduce:before:transition-none\";\n\n/* `disclose` is the in-flow counterpart of presence: nothing mounts or unmounts, and nothing\n leaves the page — one region changes its own height where it sits. Base measures the panel and\n publishes that height, so the geometry is the primitive's and only the interpolation is here.\n The panel states the height it opens to; this recipe owns how it gets there, and reduced\n motion applies the layout state in one step rather than travelling through it. */\nexport const motionDisclose =\n \"transition-[height] duration-release ease-release data-[starting-style]:h-0 data-[ending-style]:h-0 motion-reduce:transition-none\";\n\n/* A sheet is a surface that owns the viewport and is attached to one edge of it, so its presence is\n a slide out of that edge rather than the modal lift, and it never bounces. The component names the\n edge by setting exactly one of `--sui-sheet-from-x` / `--sui-sheet-from-y` to a full own-extent\n offset, because which edge a sheet is attached to is anatomy; how far it travels and how long it\n takes are not.\n\n The other axis is `0px`, and that default is load-bearing: a fallback of `100%` on the axis the\n component did not set would translate a side sheet on both axes at once, so a sheet attached to\n the right edge would enter from the bottom-right corner and travel diagonally instead of\n straight in. One edge means one axis. */\nexport const motionPresenceSheet = /* @__PURE__ */ cx(\n \"transition-[transform,opacity] duration-overlay ease-glide\",\n \"data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit\",\n \"motion-reduce:transition-[opacity]\",\n \"data-[starting-style]:opacity-0\",\n \"data-[ending-style]:opacity-0\",\n \"data-[starting-style]:[transform:translate(var(--sui-sheet-from-x,0px),var(--sui-sheet-from-y,0px))]\",\n \"data-[ending-style]:[transform:translate(var(--sui-sheet-from-x,0px),var(--sui-sheet-from-y,0px))]\",\n \"motion-reduce:data-[starting-style]:transform-none\",\n \"motion-reduce:data-[ending-style]:transform-none\",\n);\n\n/* A toast is a stack, not a single surface: several independent surfaces share one corner,\n re-flow when one of them leaves, and can each be flung away by the pointer. That is one\n spatial owner on one node, and this is it.\n\n The component owns where a toast rests — its stacked offset, its clamped height and the\n expanded fan are geometry — and sets `--sui-toast-from-y` to the direction the stack grows in.\n This recipe owns the entrance, the exit, the stack's re-flow, and the gesture: while\n `data-swiping` is set the node follows the pointer with no interpolation at all, and a\n dismissal carries the movement it was flung with so the toast keeps travelling the way it was\n already going instead of turning around. */\nexport const motionPresenceToast = /* @__PURE__ */ cx(\n \"transition-[transform,opacity,height] duration-overlay ease-glide\",\n \"data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit\",\n \"data-[swiping]:transition-none\",\n \"motion-reduce:transition-[opacity]\",\n \"data-[starting-style]:opacity-0\",\n \"data-[ending-style]:opacity-0\",\n \"data-[starting-style]:[transform:translateY(var(--sui-toast-from-y,150%))]\",\n \"[&[data-ending-style]:not([data-swipe-direction])]:[transform:translateY(var(--sui-toast-from-y,150%))]\",\n \"data-[ending-style]:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y,0px)+150%))]\",\n \"data-[ending-style]:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y,0px)-150%))]\",\n \"data-[ending-style]:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x,0px)-150%))]\",\n \"data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x,0px)+150%))]\",\n \"motion-reduce:data-[starting-style]:transform-none\",\n \"motion-reduce:data-[ending-style]:transform-none\",\n);\n"],"names":["cx"],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;;;;AAsBiD;AAEjD;;;;AAI+E;AAc/E;;AAEmC;AAC5B,MAAM,cAAc,GACzB;AAEF;;;;;;;AAOuF;AACvF;AACmF;AAC5E,MAAM,aAAa,GACxB;AAEF;;;;;;;;AAQoE;AAC7D,MAAM,cAAc,GACzB;AAEF;;AAEe;AAEf;;;;;;;;AAQyF;AAEzF;;;;AAIqG;AAC9F,MAAM,YAAY,GACvB;AAEF;AACgE;AACzD,MAAM,YAAY,GACvB;AAEF;;;;;AAKqD;AAC9C,MAAM,cAAc,GACzB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E,oCAAoC,EACpC,iCAAiC,EACjC,+BAA+B,EAC/B,sGAAsG,EACtG,oGAAoG,EACpG,oDAAoD,EACpD,kDAAkD;AAGpD;;;;;;;;;AAS8C;AACvC,MAAM,mBAAmB,mBAAmBA,QAAE,CACnD,mEAAmE,EACnE,yEAAyE,EACzE,gCAAgC,EAChC,oCAAoC,EACpC,iCAAiC,EACjC,+BAA+B,EAC/B,4EAA4E,EAC5E,yGAAyG,EACzG,sHAAsH,EACtH,oHAAoH,EACpH,sHAAsH,EACtH,uHAAuH,EACvH,oDAAoD,EACpD,kDAAkD;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ui.motion.cjs","sources":["../../../src/components/ui.motion.ts"],"sourcesContent":["/* Sherick UI motion grammar\n =========================\n Components describe what changes; this module exclusively describes how change moves.\n\n The canonical intents are:\n - feedback: non-spatial state response;\n - tactile: temporary physical response to activation;\n - arrive: a meaningful subordinate part appears or leaves;\n - orient: a persistent part changes orientation in place;\n - relocate: a persistent part moves or resizes between stable states;\n - direct: geometry continuously follows the user;\n - disclose: in-flow content expands and collapses;\n - presence: an independent surface enters/leaves;\n - activity: continuous motion that communicates ongoing work.\n\n Every recipe here owns the transition property, the duration, the curve and the\n `prefers-reduced-motion` behavior for one physical event. The durations and curves\n themselves are the authored tokens in `src/styles/tokens.ts`; nothing in this file\n writes a literal duration or an animation keyframe beyond the two activity loops.\n\n `docs/DESIGN_LANGUAGE.md` owns the semantics. Target geometry, material, tone and\n elevation remain component/anatomy concerns: a component says where something ends\n up, and this module says how it gets there. */\n\n/* A recipe that is composed from other recipes is built through `cx`, whose call is marked pure.\n That is load-bearing for the published bundles rather than a bundler detail: an unused recipe\n whose value is a template literal with a substitution in it is not provably side-effect-free, so\n it survives tree-shaking and every consumer that imports any part of this module pays for every\n recipe in it — including the families it never uses. See `libs/utils.ts`. */\nimport { cx } from \"@/libs/utils\";\n\nexport type MotionIntent =\n | \"feedback\"\n | \"tactile\"\n | \"arrive\"\n | \"orient\"\n | \"relocate\"\n | \"direct\"\n | \"disclose\"\n | \"presence\"\n | \"activity\";\n\n/** Non-spatial feedback: hover, focus, field tone, a highlighted row, a filled surface.\n * It never translates, scales or resizes; reduced motion simply drops the interpolation\n * and the state still arrives. */\nexport const motionFeedback =\n \"transition-[background-color,color,box-shadow,opacity] duration-press ease-press motion-reduce:transition-none\";\n\n/** A control answers a press immediately and settles on its release.\n *\n * The recipe owns the *amplitude* of that answer as well as its timing, because how far a press\n * travels is the system's physical character rather than a component's anatomy. A percentage is a\n * distance only once it meets a size, so the amplitude comes in tiers chosen by the control's role:\n *\n * - `motionTactile`: a content-width control — a button, a chip, a segment — compresses 4%, about\n * two pixels at the size of the ink it moves.\n * - `motionTactileWide`: a control that spans a track — a tab — compresses 1.5%, so its edges move\n * about as far as a button's.\n * - `motionTactileField`: a list-opening field — a Select trigger, an editable Combobox — spans\n * its whole container, and 4% of a 580px field moved each edge 11.6px. It compresses 0.7%, about\n * two pixels at that width: the field acknowledges the press without lurching.\n *\n * The press leg runs on `duration-tactile`, short enough to land inside a tap; the release settles\n * on the release timing. A control whose visible ink is far smaller than its target takes\n * `motionInkPress` on that ink instead, so the target itself never moves. The interpolation and\n * the compression are neutralised together under reduced motion. */\n/* Base may disable the surface itself or the value control inside a Select wrapper.\n Neither is a pressable surface. Timing is otherwise shared by every tier. */\nconst tactileTiming =\n \"transition-[background-color,color,box-shadow,transform,opacity] duration-release ease-release active:duration-tactile active:ease-press motion-reduce:transition-none\";\n\nexport const motionTactile = /* @__PURE__ */ cx(\n tactileTiming,\n \"motion-safe:[&:not([data-disabled],:disabled,:has(>[role=combobox][data-disabled]))]:active:scale-[0.96]\"\n);\n\nexport const motionTactileWide = /* @__PURE__ */ cx(\n tactileTiming,\n \"motion-safe:[&:not([data-disabled],:disabled)]:active:scale-[0.985]\"\n);\n\nexport const motionTactileField = /* @__PURE__ */ cx(\n tactileTiming,\n \"motion-safe:[&:not([data-disabled],:disabled,:has(>[role=combobox][data-disabled]))]:active:scale-[0.993]\"\n);\n\n/** The spatial half of a compact press, applied to the *mark* rather than to the control.\n *\n * A control whose visible ink is much smaller than the target it is aimed at — a dialog's close\n * control, a stepper, a search field's submit — is a large target around a small glyph, and only\n * the glyph is visible at rest. Compressing the whole control would shrink the ground the pointer\n * is already on (a 44px target becomes 38.7px while held, which is exactly where a near-edge\n * release lands), so the mark takes the twelve percent and the target keeps its geometry. The\n * target still owns the focus ring and the state layer, and still carries the tone and depth\n * response, so the boundary a press happens inside never moves. */\nexport const motionInkPress =\n \"transition-transform duration-release ease-release group-active:duration-tactile group-active:ease-press group-active:scale-[0.88] motion-reduce:transition-none motion-reduce:group-active:scale-100\";\n\n/* Motion is not owned here — but the recipes above are the whole vocabulary: every press, arrival,\n travel, presence and activity in the library is one of these names plus its owner's own target\n geometry. */\n\n/* A field that opens a list — a `Select`'s trigger, an editable `Combobox`'s field — takes\n `motionTactile` as a whole, which is what makes the two forms of the same control press\n identically. The *field* is the element that carries the compression in both: a press activates\n the whole chain, so a descendant being pressed is what makes the field itself match `:active`\n (and a select trigger's own active state is suppressed by the primitive, so its field's wrapper\n is the only element left to carry it). Typing, focus and hover never match it, so the field is\n perfectly still while it is used as a text field; a press that places a caret or drags across a\n word is the same press the field already answers, and distinguishing it would take pointer\n bookkeeping inside a component for a case that reads as one interaction either way. */\n\n/** A meaningful subordinate part arrives. Spring is reserved for this intent: a mark is\n * made by overshooting the position it lands in. It leaves without the overshoot, and\n * reduced motion lands it in one step — which takes a *state-specific* override, because the\n * starting state is a higher-specificity rule than a plain `transform: none` and would otherwise\n * win under reduced motion while the transition was gone, turning a spring into an instant jump. */\nexport const motionArrive =\n \"transition-[background-color,color,box-shadow,transform,opacity] duration-release ease-spring data-[starting-style]:scale-50 data-[ending-style]:scale-50 data-[ending-style]:opacity-0 data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit motion-reduce:transition-none motion-reduce:transform-none motion-reduce:data-[starting-style]:scale-100 motion-reduce:data-[ending-style]:scale-100\";\n\n/** A persistent affordance changes orientation in place: a disclosure chevron. It reaches\n * its target orientation consistently and never overshoots. */\nexport const motionOrient =\n \"transition-transform duration-release ease-release motion-reduce:transition-none\";\n\n/** A persistent object travels between stable destinations: a tab indicator, a switch\n * thumb. The travel itself is the event, so it takes the glide curve rather than the\n * arrival curve, and it never overshoots: a destination that is passed and come back\n * from reads as a defect. Position, size and the tone the object picks up on the way\n * settle together, and an interrupted move retargets from wherever it currently is\n * because it is a transition and not a keyframe. */\nexport const motionRelocate =\n \"transition-[left,inset-inline-start,top,width,height,transform,background-color,color,box-shadow,opacity] duration-release ease-glide motion-reduce:transition-none\";\n\n/** The same travel across a whole track — a tab indicator — on the longer travel timing, so a\n * movement of hundreds of pixels is followed rather than skipped. */\nexport const motionRelocateLong =\n \"transition-[left,inset-inline-start,top,width,height,transform,background-color,color,box-shadow,opacity] duration-travel ease-glide motion-reduce:transition-none\";\n\n/** Direct manipulation: the pointer owns the geometry, so a positional transition would be\n * lag. While the primitive reports a drag, position and size are removed from the\n * transition list and only tone and engagement geometry remain; a keyboard or programmatic\n * step still settles. Reduced motion never changes direct manipulation. */\nexport const motionDirect =\n \"transition-[inset-inline-start,width,height,background-color,color,box-shadow,transform,opacity] duration-release ease-release active:duration-press active:ease-press data-[dragging]:transition-[background-color,color,box-shadow,transform,opacity] motion-reduce:transition-none motion-reduce:transform-none\";\n\n/* Anchored popup, tooltip, modal, sheet, toast and scrim presence share three states:\n settled, `data-starting-style` and `data-ending-style`. The primitive decides\n when the node mounts and unmounts.\n None of them writes an animation keyframe or a timer, so a rapid open → close → open\n retargets from the current painted value instead of restarting.\n\n The anchored roles read their entrance direction from the resolved side. Base publishes\n the side on the popup after collision handling and the origin as `--transform-origin`, so\n a surface below its trigger rises into place, one above it settles down into it, and one\n flipped by a collision animates the way it is actually placed. */\n\nconst anchoredGeometry = /* @__PURE__ */ cx(\n \"[transform-origin:var(--transform-origin)]\",\n \"[--sui-overlay-from-shift-y:-4px]\",\n \"data-[side=top]:[--sui-overlay-from-shift-y:4px]\",\n \"data-[side=left]:[--sui-overlay-from-shift-y:0px] data-[side=left]:[--sui-overlay-from-shift-x:4px]\",\n \"data-[side=right]:[--sui-overlay-from-shift-y:0px] data-[side=right]:[--sui-overlay-from-shift-x:-4px]\",\n /* The logical sides resolve against the writing direction: `inline-start` puts the popup at the\n anchor's inline-start edge, which is its physical *left* on a left-to-right page and its\n physical *right* on a right-to-left one, so the four pixels that travel toward the anchor\n change sign with the page while the physical sides above never do. The direction is read from\n the `dir` attribute — the attribute that lays the page out, and the only one a portaled\n surface can see. The primitive resolves the side from the direction *it* is told about\n (`DirectionProvider`), so a consumer whose page is right-to-left declares that direction to\n both, exactly as the workbench's RTL specimens do. */\n \"data-[side=inline-start]:[--sui-overlay-from-shift-y:0px] data-[side=inline-start]:[--sui-overlay-from-shift-x:4px]\",\n \"[[dir=rtl]_&]:data-[side=inline-start]:[--sui-overlay-from-shift-x:-4px]\",\n \"data-[side=inline-end]:[--sui-overlay-from-shift-y:0px] data-[side=inline-end]:[--sui-overlay-from-shift-x:-4px]\",\n \"[[dir=rtl]_&]:data-[side=inline-end]:[--sui-overlay-from-shift-x:4px]\",\n);\n\n/* Both ends of a presence animation start from the same state, and reduced motion drops the\n spatial half of it: presence still reads as arriving, but only through opacity. The\n transform is a literal class rather than an interpolated one, because the stylesheet\n compiler reads class names as text: a name that only exists once a template is evaluated\n compiles to no rule at all. */\nconst anchoredFrom = /* @__PURE__ */ cx(\n \"data-[starting-style]:opacity-0\",\n \"data-[starting-style]:[transform:translate(var(--sui-overlay-from-shift-x,0px),var(--sui-overlay-from-shift-y,0px))scale(var(--sui-overlay-from-scale,1))]\",\n \"data-[ending-style]:opacity-0\",\n \"data-[ending-style]:[transform:translate(var(--sui-overlay-from-shift-x,0px),var(--sui-overlay-from-shift-y,0px))scale(var(--sui-overlay-from-scale,1))]\",\n \"motion-reduce:data-[starting-style]:transform-none\",\n \"motion-reduce:data-[ending-style]:transform-none\",\n);\n\nconst modalFrom = /* @__PURE__ */ cx(\n \"data-[starting-style]:opacity-0\",\n \"data-[starting-style]:[transform:translate(0,12px)scale(0.96)]\",\n \"data-[ending-style]:opacity-0\",\n \"data-[ending-style]:[transform:translate(0,12px)scale(0.96)]\",\n \"motion-reduce:data-[starting-style]:transform-none\",\n \"motion-reduce:data-[ending-style]:transform-none\",\n);\n\n/** An anchored surface: `Select`, `Combobox`, `Menu` and `Popover`. It grows out of the edge\n * it is attached to, enters on the overlay timing, and leaves on the shorter exit.\n *\n * The grow is the motion's signature and the four pixels of travel only support it, so the\n * entrance takes the glide curve rather than the arrival curve. With a front-loaded curve the\n * opacity and the scale both jump in the first frames, which means the surface is already half\n * grown by the time it is visible at all — a pop, not a grow. The glide curve spends its whole\n * duration visible, so the eye actually sees the surface open out of its anchor. */\nexport const motionPresenceAnchored = /* @__PURE__ */ cx(\n \"transition-[opacity,transform] duration-overlay ease-glide\",\n \"data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit\",\n \"motion-reduce:transition-[opacity]\",\n \"[--sui-overlay-from-scale:0.94]\",\n anchoredGeometry,\n anchoredFrom,\n);\n\n/** A tooltip: the same side-aware model and the same grow as an anchored popup, deliberately\n * lighter — it settles on the local timing rather than the overlay timing, and it never\n * bounces. */\nexport const motionPresenceTooltip = /* @__PURE__ */ cx(\n \"transition-[opacity,transform] duration-release ease-glide\",\n \"data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit\",\n \"motion-reduce:transition-[opacity]\",\n \"[--sui-overlay-from-scale:0.94]\",\n anchoredGeometry,\n anchoredFrom,\n);\n\n/** A modal surface: anchored to the viewport rather than to a trigger, so it has no side\n * to grow from. A large surface never bounces; it fades, rises a little and settles, and its\n * scale stays restrained because a plane this big grows visibly even from a few percent. */\nexport const motionPresenceModal = /* @__PURE__ */ cx(\n \"transition-[opacity,transform] duration-overlay ease-glide\",\n \"data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit\",\n \"motion-reduce:transition-[opacity]\",\n modalFrom,\n);\n\n/** The plane behind a surface that owns the viewport. Opacity only: a blur or a filter is\n * never animated, so the plane can never animate the page behind it. */\nexport const motionPresenceScrim =\n \"transition-opacity duration-overlay ease-release data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit\";\n\n/** Continuous activity is a distinct intent, not an exception to interaction motion: it\n * reports work rather than answering an event, and it has no entrance of its own. */\nexport const motionActivitySpin = \"animate-spin motion-reduce:animate-none\";\nexport const motionActivityPulse = \"animate-pulse motion-reduce:animate-none\";\n\n/** The indeterminate half of a progress bar. A task with no known value cannot report a\n * position, so it reports *work* instead: the fill sweeps across its own track on the one loop\n * that is paced, because a loop that reports rather than answers cannot arrive. The travel is a\n * composited transform rather than a laid-out edge, and an endless loop must never sit on the\n * layout path; the direction is a value the recipe flips with the writing direction, because a\n * transform is physical and the sweep follows the page. Under reduced motion the loop stops and\n * the fill rests where it starts: a static status glyph, exactly as the spin and the pulse rest. */\nexport const motionActivityIndeterminate =\n \"animate-sherick-indeterminate [[dir=rtl]_&]:[--sui-indeterminate-direction:-1] motion-reduce:animate-none\";\n\n/** The state layer is a composited overlay, so its own opacity is the only thing that\n * moves. Shared here because four interaction states across the library ride it. */\n/** A row in a collection moves its highlight rather than fading it: a highlight is where the reader\n * is, and arrowing through a list with a soft fade on every row leaves a smear of half-lit rows.\n * The row's layer therefore changes in one step, for the pointer and the keyboard alike. */\nexport const motionRowLayer = \"before:transition-none\";\n\nexport const motionStateLayer =\n \"before:transition-opacity before:duration-release before:ease-release active:before:duration-tactile active:before:ease-press group-active:before:duration-tactile group-active:before:ease-press motion-reduce:before:transition-none\";\n\n/* `disclose` is the in-flow counterpart of presence: nothing mounts or unmounts, and nothing\n leaves the page — one region changes its own height where it sits. Base measures the panel and\n publishes that height, so the geometry is the primitive's and only the interpolation is here.\n The panel states the height it opens to; this recipe owns how it gets there, and reduced\n motion applies the layout state in one step rather than travelling through it. */\nexport const motionDisclose =\n \"transition-[height] duration-release ease-release data-[starting-style]:h-0 data-[ending-style]:h-0 data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit motion-reduce:transition-none\";\n\n/* A sheet is a surface that owns the viewport and is attached to one edge of it, so its presence is\n a slide out of that edge rather than the modal lift, and it never bounces. The component names the\n edge by setting exactly one of `--sui-sheet-from-x` / `--sui-sheet-from-y` to a full own-extent\n offset, because which edge a sheet is attached to is anatomy; how far it travels and how long it\n takes are not.\n\n The other axis is `0px`, and that default is load-bearing: a fallback of `100%` on the axis the\n component did not set would translate a side sheet on both axes at once, so a sheet attached to\n the right edge would enter from the bottom-right corner and travel diagonally instead of\n straight in. One edge means one axis. */\nexport const motionPresenceSheet = /* @__PURE__ */ cx(\n \"transition-[transform,opacity] duration-sheet ease-glide\",\n \"data-[ending-style]:duration-sheet-exit data-[ending-style]:ease-exit\",\n \"motion-reduce:transition-[opacity]\",\n \"data-[starting-style]:opacity-0\",\n \"data-[ending-style]:opacity-0\",\n \"data-[starting-style]:[transform:translate(var(--sui-sheet-from-x,0px),var(--sui-sheet-from-y,0px))]\",\n \"data-[ending-style]:[transform:translate(var(--sui-sheet-from-x,0px),var(--sui-sheet-from-y,0px))]\",\n \"motion-reduce:data-[starting-style]:transform-none\",\n \"motion-reduce:data-[ending-style]:transform-none\",\n);\n\n/* A toast is a stack, not a single surface: several independent surfaces share one corner,\n re-flow when one of them leaves, and can each be flung away by the pointer. That is one\n spatial owner on one node, and this is it.\n\n The component owns where a toast rests — its stacked offset, its clamped height and the\n expanded fan are geometry — and sets `--sui-toast-from-y` to the direction the stack grows in.\n This recipe owns the entrance, the exit, the stack's re-flow, and the gesture: while\n `data-swiping` is set the node follows the pointer with no interpolation at all, and a\n dismissal carries the movement it was flung with so the toast keeps travelling the way it was\n already going instead of turning around. */\nexport const motionPresenceToast = /* @__PURE__ */ cx(\n \"transition-[transform,opacity,height] duration-overlay ease-glide\",\n \"data-[ending-style]:duration-overlay-exit data-[ending-style]:ease-exit\",\n \"data-[swiping]:transition-none\",\n \"motion-reduce:transition-[opacity]\",\n \"data-[starting-style]:opacity-0\",\n \"data-[ending-style]:opacity-0\",\n \"data-[starting-style]:[transform:translateY(var(--sui-toast-from-y,150%))]\",\n \"[&[data-ending-style]:not([data-swipe-direction])]:[transform:translateY(var(--sui-toast-from-y,150%))]\",\n \"data-[ending-style]:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y,0px)+150%))]\",\n \"data-[ending-style]:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y,0px)-150%))]\",\n \"data-[ending-style]:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x,0px)-150%))]\",\n \"data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x,0px)+150%))]\",\n \"motion-reduce:data-[starting-style]:transform-none\",\n \"motion-reduce:data-[ending-style]:transform-none\",\n);\n"],"names":["cx"],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;;;;AAsBiD;AAEjD;;;;AAI+E;AAc/E;;AAEmC;AAC5B,MAAM,cAAc,GACzB;AAEF;;;;;;;;;;;;;;;;;AAiBqE;AACrE;AAC+E;AAC/E,MAAM,aAAa,GACjB,wKAAwK;AAEnK,MAAM,aAAa,mBAAmBA,QAAE,CAC7C,aAAa,EACb,0GAA0G;AAGrG,MAAM,iBAAiB,mBAAmBA,QAAE,CACjD,aAAa,EACb,qEAAqE;AAGhE,MAAM,kBAAkB,mBAAmBA,QAAE,CAClD,aAAa,EACb,2GAA2G;AAG7G;;;;;;;;AAQoE;AAC7D,MAAM,cAAc,GACzB;AAEF;;AAEe;AAEf;;;;;;;;AAQyF;AAEzF;;;;AAIqG;AAC9F,MAAM,YAAY,GACvB;AAEF;AACgE;AACzD,MAAM,YAAY,GACvB;AAEF;;;;;AAKqD;AAC9C,MAAM,cAAc,GACzB;AAEF;AACsE;AAC/D,MAAM,kBAAkB,GAC7B;AAEF;;;AAG4E;AACrE,MAAM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EAAuE,EACvE,oCAAoC,EACpC,iCAAiC,EACjC,+BAA+B,EAC/B,sGAAsG,EACtG,oGAAoG,EACpG,oDAAoD,EACpD,kDAAkD;AAGpD;;;;;;;;;AAS8C;AACvC,MAAM,mBAAmB,mBAAmBA,QAAE,CACnD,mEAAmE,EACnE,yEAAyE,EACzE,gCAAgC,EAChC,oCAAoC,EACpC,iCAAiC,EACjC,+BAA+B,EAC/B,4EAA4E,EAC5E,yGAAyG,EACzG,sHAAsH,EACtH,oHAAoH,EACpH,sHAAsH,EACtH,uHAAuH,EACvH,oDAAoD,EACpD,kDAAkD;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/cjs/dev.cjs CHANGED
@@ -6,6 +6,7 @@ var utils = require('./libs/utils.cjs');
6
6
 
7
7
 
8
8
 
9
+ exports.currentDestination = ui_common.currentDestination;
9
10
  exports.density = ui_common.density;
10
11
  exports.detail = ui_common.detail;
11
12
  exports.disclosure = ui_common.disclosure;
@@ -13,6 +14,7 @@ exports.edge = ui_common.edge;
13
14
  exports.edgeTone = ui_common.edgeTone;
14
15
  exports.elevation = ui_common.elevation;
15
16
  exports.fieldLayout = ui_common.fieldLayout;
17
+ exports.fieldMessage = ui_common.fieldMessage;
16
18
  exports.focusRing = ui_common.focusRing;
17
19
  exports.focusRingDrag = ui_common.focusRingDrag;
18
20
  exports.focusRingHeld = ui_common.focusRingHeld;
@@ -20,6 +22,7 @@ exports.focusRingInset = ui_common.focusRingInset;
20
22
  exports.focusRingWithin = ui_common.focusRingWithin;
21
23
  exports.groupFocusRing = ui_common.groupFocusRing;
22
24
  exports.hitArea = ui_common.hitArea;
25
+ exports.iconSlot = ui_common.iconSlot;
23
26
  exports.list = ui_common.list;
24
27
  exports.material = ui_common.material;
25
28
  exports.matteInset = ui_common.matteInset;
@@ -29,12 +32,15 @@ exports.parentFocusRingInset = ui_common.parentFocusRingInset;
29
32
  exports.recessedTop = ui_common.recessedTop;
30
33
  exports.recipeAlphas = ui_common.recipeAlphas;
31
34
  exports.selectable = ui_common.selectable;
35
+ exports.selectableRowSurface = ui_common.selectableRowSurface;
32
36
  exports.shape = ui_common.shape;
33
37
  exports.stacking = ui_common.stacking;
34
38
  exports.state = ui_common.state;
35
39
  exports.stateLayer = ui_common.stateLayer;
40
+ exports.stateLayerQuietComposite = ui_common.stateLayerQuietComposite;
36
41
  exports.text = ui_common.text;
37
42
  exports.tone = ui_common.tone;
43
+ exports.type = ui_common.type;
38
44
  exports.motionActivityIndeterminate = ui_motion.motionActivityIndeterminate;
39
45
  exports.motionActivityPulse = ui_motion.motionActivityPulse;
40
46
  exports.motionActivitySpin = ui_motion.motionActivitySpin;
@@ -51,7 +57,11 @@ exports.motionPresenceSheet = ui_motion.motionPresenceSheet;
51
57
  exports.motionPresenceToast = ui_motion.motionPresenceToast;
52
58
  exports.motionPresenceTooltip = ui_motion.motionPresenceTooltip;
53
59
  exports.motionRelocate = ui_motion.motionRelocate;
60
+ exports.motionRelocateLong = ui_motion.motionRelocateLong;
61
+ exports.motionRowLayer = ui_motion.motionRowLayer;
54
62
  exports.motionStateLayer = ui_motion.motionStateLayer;
55
63
  exports.motionTactile = ui_motion.motionTactile;
64
+ exports.motionTactileField = ui_motion.motionTactileField;
65
+ exports.motionTactileWide = ui_motion.motionTactileWide;
56
66
  exports.cn = utils.cn;
57
67
  //# sourceMappingURL=dev.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dev.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"dev.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,9 +1,9 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { cn } from '../libs/utils.js';
3
- import { tone, text, shape } from './ui.common.js';
3
+ import { tone, text, shape, type } from './ui.common.js';
4
4
 
5
5
  const Badge = ({ children, variant = "primary", icon, className, ...props }) => {
6
- return (jsxs("span", { ...props, className: cn("inline-flex min-h-7 min-w-0 max-w-full items-center justify-center gap-1.5 px-3 py-1 text-xs font-semibold", shape.pill, tone.soft[variant], text.high, className), children: [icon && (jsx("span", { className: cn("inline-flex size-3.5 shrink-0 items-center justify-center [&>svg]:size-3.5", tone.text[variant]), "aria-hidden": "true", children: icon })), jsx("span", { className: cn("min-w-0 truncate"), children: children })] }));
6
+ return (jsxs("span", { ...props, className: cn("inline-flex min-h-7 min-w-0 max-w-full items-center justify-center gap-1.5 px-3 py-1 font-semibold", type.caption, shape.pill, tone.soft[variant], text.high, className), children: [icon && (jsx("span", { className: cn("inline-flex size-3.5 shrink-0 items-center justify-center [&>svg]:size-3.5", tone.text[variant]), "aria-hidden": "true", children: icon })), jsx("span", { className: cn("min-w-0 truncate"), children: children })] }));
7
7
  };
8
8
 
9
9
  export { Badge as default };
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sources":["../../../src/components/Badge.tsx"],"sourcesContent":["import React, { type HTMLAttributes, type ReactNode } from \"react\";\nimport { cn } from \"@/libs/utils\";\nimport { shape, text, tone } from \"./ui.common\";\nimport { Variant } from \"./ui.types\";\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode;\n variant?: Variant;\n icon?: ReactNode;\n}\n\nconst Badge = ({\n children,\n variant = \"primary\",\n icon,\n className,\n ...props\n}: BadgeProps) => {\n return (\n <span\n {...props}\n className={cn(\n \"inline-flex min-h-7 min-w-0 max-w-full items-center justify-center gap-1.5 px-3 py-1 text-xs font-semibold\",\n shape.pill,\n tone.soft[variant],\n text.high,\n className\n )}\n >\n {/* A badge gives its leading mark one predictable slot: 14px, held at that size whatever artwork\n a caller hands in, with the box — not the artwork's own whitespace — aligned to the label. */}\n {icon && (\n <span className={cn(\"inline-flex size-3.5 shrink-0 items-center justify-center [&>svg]:size-3.5\", tone.text[variant])} aria-hidden=\"true\">\n {icon}\n </span>\n )}\n <span className={cn(\"min-w-0 truncate\")}>{children}</span>\n </span>\n );\n};\n\nexport default Badge;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;AAWA,MAAM,KAAK,GAAG,CAAC,EACb,QAAQ,EACR,OAAO,GAAG,SAAS,EACnB,IAAI,EACJ,SAAS,EACT,GAAG,KAAK,EACG,KAAI;AACf,IAAA,QACEA,IAAA,CAAA,MAAA,EAAA,EAAA,GACM,KAAK,EACT,SAAS,EAAE,EAAE,CACX,4GAA4G,EAC5G,KAAK,CAAC,IAAI,EACV,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAClB,IAAI,CAAC,IAAI,EACT,SAAS,CACV,EAAA,QAAA,EAAA,CAIA,IAAI,KACHC,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,EAAE,CAAC,4EAA4E,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAA,aAAA,EAAc,MAAM,EAAA,QAAA,EACtI,IAAI,EAAA,CACA,CACR,EACDA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAQ,CAAA,EAAA,CACrD;AAEX;;"}
1
+ {"version":3,"file":"Badge.js","sources":["../../../src/components/Badge.tsx"],"sourcesContent":["import React, { type HTMLAttributes, type ReactNode } from \"react\";\nimport { cn } from \"@/libs/utils\";\nimport { shape, text, tone, type } from \"./ui.common\";\nimport { Variant } from \"./ui.types\";\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode;\n variant?: Variant;\n icon?: ReactNode;\n}\n\nconst Badge = ({\n children,\n variant = \"primary\",\n icon,\n className,\n ...props\n}: BadgeProps) => {\n return (\n <span\n {...props}\n className={cn(\n \"inline-flex min-h-7 min-w-0 max-w-full items-center justify-center gap-1.5 px-3 py-1 font-semibold\",\n type.caption,\n shape.pill,\n tone.soft[variant],\n text.high,\n className\n )}\n >\n {/* A badge gives its leading mark one predictable slot: 14px, held at that size whatever artwork\n a caller hands in, with the box — not the artwork's own whitespace — aligned to the label. */}\n {icon && (\n <span className={cn(\"inline-flex size-3.5 shrink-0 items-center justify-center [&>svg]:size-3.5\", tone.text[variant])} aria-hidden=\"true\">\n {icon}\n </span>\n )}\n <span className={cn(\"min-w-0 truncate\")}>{children}</span>\n </span>\n );\n};\n\nexport default Badge;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;AAWA,MAAM,KAAK,GAAG,CAAC,EACb,QAAQ,EACR,OAAO,GAAG,SAAS,EACnB,IAAI,EACJ,SAAS,EACT,GAAG,KAAK,EACG,KAAI;AACf,IAAA,QACEA,IAAA,CAAA,MAAA,EAAA,EAAA,GACM,KAAK,EACT,SAAS,EAAE,EAAE,CACX,oGAAoG,EACpG,IAAI,CAAC,OAAO,EACZ,KAAK,CAAC,IAAI,EACV,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAClB,IAAI,CAAC,IAAI,EACT,SAAS,CACV,aAIA,IAAI,KACHC,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,EAAE,CAAC,4EAA4E,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,iBAAc,MAAM,EAAA,QAAA,EACtI,IAAI,EAAA,CACA,CACR,EACDA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAQ,CAAA,EAAA,CACrD;AAEX;;"}
@@ -3,10 +3,16 @@ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { Button as Button$1 } from '@base-ui/react/button';
4
4
  import { forwardRef } from 'react';
5
5
  import { cn } from '../libs/utils.js';
6
- import { state, elevation, stateLayer, tone, focusRing, density, shape } from './ui.common.js';
6
+ import { iconSlot, state, elevation, stateLayer, tone, focusRing, density, shape } from './ui.common.js';
7
7
  import { motionTactile } from './ui.motion.js';
8
8
  import { Spinner } from './Spinner.js';
9
9
 
10
+ /* The mark follows the type step beside it (§10): a compact label takes the compact slot. */
11
+ const slotMap = {
12
+ sm: iconSlot.compact,
13
+ md: iconSlot.normal,
14
+ lg: iconSlot.prominent,
15
+ };
10
16
  const sizeMap = {
11
17
  sm: `${density.compact} px-4 py-2`,
12
18
  md: `${density.normal} px-6 py-3`,
@@ -14,8 +20,11 @@ const sizeMap = {
14
20
  };
15
21
  const Button = forwardRef(({ children, variant = "primary", appearance = "tonal", size = "md", icon, className, loading = false, disabled, type = "button", ...props }, ref) => {
16
22
  const isDisabled = disabled || loading;
17
- const isTactile = appearance === "tonal" && !isDisabled;
18
- return (jsxs(Button$1, { ...props, render: jsx("button", { ref: ref }), type: type, disabled: isDisabled, "aria-busy": loading || undefined, className: cn("relative inline-flex min-w-0 max-w-full items-center justify-center gap-2 font-medium tracking-[-0.01em]", shape.pill, sizeMap[size], motionTactile, focusRing, appearance === "filled" && tone.strong[variant], appearance === "filled" && !isDisabled && stateLayer.filled, appearance === "tonal" && tone.tonal[variant], appearance === "tonal" && tone.text[variant], appearance === "tonal" && !isDisabled && stateLayer.tonal, appearance === "text" && tone.text[variant], appearance === "text" && !isDisabled && stateLayer.quiet, appearance === "tonal" && elevation.raised, isTactile && state.recess, isDisabled ? state.disabled : state.enabled, className), children: [loading ? (jsx("span", { className: cn("inline-flex size-5 shrink-0 items-center justify-center", !icon && "absolute"), children: jsx(Spinner, { size: "small", className: cn("size-5") }) })) : icon ? (jsx("span", { className: cn("inline-flex size-5 shrink-0 items-center justify-center [&>svg]:size-5"), "aria-hidden": "true", children: icon })) : null, jsx("span", { className: cn("min-w-0 [overflow-wrap:anywhere]", loading && !icon && "opacity-0"), children: children })] }));
23
+ /* The action ladder: text sits flat, tonal and filled are raised and recess while held. The
24
+ priority action is never flatter than the one beside it. */
25
+ const isRaised = appearance !== "text";
26
+ const isTactile = isRaised && !isDisabled;
27
+ return (jsxs(Button$1, { ...props, render: jsx("button", { ref: ref }), type: type, disabled: isDisabled, "aria-busy": loading || undefined, className: cn("relative inline-flex min-w-0 max-w-full items-center justify-center gap-2 font-medium tracking-[-0.01em]", shape.pill, sizeMap[size], motionTactile, focusRing, appearance === "filled" && tone.strong[variant], appearance === "filled" && !isDisabled && stateLayer.filled, appearance === "tonal" && tone.tonal[variant], appearance === "tonal" && tone.text[variant], appearance === "tonal" && !isDisabled && (variant === "secondary" ? stateLayer.tonalNeutral : stateLayer.tonal), appearance === "text" && tone.text[variant], appearance === "text" && !isDisabled && stateLayer.quiet, isRaised && elevation.raised, isTactile && state.recess, isDisabled ? state.disabled : state.enabled, className), children: [loading ? (jsx("span", { className: cn(slotMap[size], !icon && "absolute"), children: jsx(Spinner, { size: "small", className: cn("size-full") }) })) : icon ? (jsx("span", { className: cn(slotMap[size]), "aria-hidden": "true", children: icon })) : null, jsx("span", { className: cn("min-w-0 [overflow-wrap:anywhere]", loading && !icon && "opacity-0"), children: children })] }));
19
28
  });
20
29
  Button.displayName = "Button";
21
30
 
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../src/components/Button.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button as BaseButton } from \"@base-ui/react/button\";\nimport React, { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { cn } from \"@/libs/utils\";\nimport {\n density,\n elevation,\n focusRing,\n shape,\n state,\n stateLayer,\n tone,\n} from \"./ui.common\";\nimport { motionTactile } from \"./ui.motion\";\nimport { Variant } from \"./ui.types\";\nimport { Spinner } from \"./Spinner\";\n\nexport type ButtonAppearance = \"filled\" | \"tonal\" | \"text\";\nexport type ButtonSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n children: ReactNode;\n variant?: Variant;\n appearance?: ButtonAppearance;\n size?: ButtonSize;\n icon?: ReactNode;\n loading?: boolean;\n}\n\nconst sizeMap: Record<ButtonSize, string> = {\n sm: `${density.compact} px-4 py-2`,\n md: `${density.normal} px-6 py-3`,\n lg: `${density.prominent} px-8 py-4`,\n};\n\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({\n children,\n variant = \"primary\",\n appearance = \"tonal\",\n size = \"md\",\n icon,\n className,\n loading = false,\n disabled,\n type = \"button\",\n ...props\n }, ref) => {\n const isDisabled = disabled || loading;\n const isTactile = appearance === \"tonal\" && !isDisabled;\n\n return (\n <BaseButton\n {...props}\n render={<button ref={ref} />}\n type={type}\n disabled={isDisabled}\n aria-busy={loading || undefined}\n className={cn(\n \"relative inline-flex min-w-0 max-w-full items-center justify-center gap-2 font-medium tracking-[-0.01em]\",\n shape.pill,\n sizeMap[size],\n motionTactile,\n focusRing,\n appearance === \"filled\" && tone.strong[variant],\n appearance === \"filled\" && !isDisabled && stateLayer.filled,\n appearance === \"tonal\" && tone.tonal[variant],\n appearance === \"tonal\" && tone.text[variant],\n appearance === \"tonal\" && !isDisabled && stateLayer.tonal,\n appearance === \"text\" && tone.text[variant],\n appearance === \"text\" && !isDisabled && stateLayer.quiet,\n appearance === \"tonal\" && elevation.raised,\n isTactile && state.recess,\n isDisabled ? state.disabled : state.enabled,\n className\n )}\n >\n {/* A mark occupies one slot whatever is inside it. The slot is a fixed 20px box, so a nested\n node — a wrapped mark, a status dot — cannot change the control's width, and the loading\n mark lands in the box the icon had. `[&>svg]` normalizes direct SVG artwork; sizing nested\n artwork is the caller's business, as §17 says. */}\n {loading ? (\n <span className={cn(\"inline-flex size-5 shrink-0 items-center justify-center\", !icon && \"absolute\")}>\n <Spinner size=\"small\" className={cn(\"size-5\")} />\n </span>\n ) : icon ? (\n <span className={cn(\"inline-flex size-5 shrink-0 items-center justify-center [&>svg]:size-5\")} aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n {/* Retain one label subtree and its accessible name while the spinner occupies its footprint. */}\n <span className={cn(\"min-w-0 [overflow-wrap:anywhere]\", loading && !icon && \"opacity-0\")}>{children}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AC,CAAA;AAGH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ;;"}
1
+ {"version":3,"file":"Button.js","sources":["../../../src/components/Button.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button as BaseButton } from \"@base-ui/react/button\";\nimport React, { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { cn } from \"@/libs/utils\";\nimport {\n density,\n elevation,\n focusRing,\n iconSlot,\n shape,\n state,\n stateLayer,\n tone,\n} from \"./ui.common\";\nimport { motionTactile } from \"./ui.motion\";\nimport { Variant } from \"./ui.types\";\nimport { Spinner } from \"./Spinner\";\n\nexport type ButtonAppearance = \"filled\" | \"tonal\" | \"text\";\nexport type ButtonSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n children: ReactNode;\n variant?: Variant;\n appearance?: ButtonAppearance;\n size?: ButtonSize;\n icon?: ReactNode;\n loading?: boolean;\n}\n\n/* The mark follows the type step beside it (§10): a compact label takes the compact slot. */\nconst slotMap: Record<ButtonSize, string> = {\n sm: iconSlot.compact,\n md: iconSlot.normal,\n lg: iconSlot.prominent,\n};\n\nconst sizeMap: Record<ButtonSize, string> = {\n sm: `${density.compact} px-4 py-2`,\n md: `${density.normal} px-6 py-3`,\n lg: `${density.prominent} px-8 py-4`,\n};\n\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({\n children,\n variant = \"primary\",\n appearance = \"tonal\",\n size = \"md\",\n icon,\n className,\n loading = false,\n disabled,\n type = \"button\",\n ...props\n }, ref) => {\n const isDisabled = disabled || loading;\n /* The action ladder: text sits flat, tonal and filled are raised and recess while held. The\n priority action is never flatter than the one beside it. */\n const isRaised = appearance !== \"text\";\n const isTactile = isRaised && !isDisabled;\n\n return (\n <BaseButton\n {...props}\n render={<button ref={ref} />}\n type={type}\n disabled={isDisabled}\n aria-busy={loading || undefined}\n className={cn(\n \"relative inline-flex min-w-0 max-w-full items-center justify-center gap-2 font-medium tracking-[-0.01em]\",\n shape.pill,\n sizeMap[size],\n motionTactile,\n focusRing,\n appearance === \"filled\" && tone.strong[variant],\n appearance === \"filled\" && !isDisabled && stateLayer.filled,\n appearance === \"tonal\" && tone.tonal[variant],\n appearance === \"tonal\" && tone.text[variant],\n appearance === \"tonal\" && !isDisabled && (variant === \"secondary\" ? stateLayer.tonalNeutral : stateLayer.tonal),\n appearance === \"text\" && tone.text[variant],\n appearance === \"text\" && !isDisabled && stateLayer.quiet,\n isRaised && elevation.raised,\n isTactile && state.recess,\n isDisabled ? state.disabled : state.enabled,\n className\n )}\n >\n {/* A mark occupies one slot whatever is inside it. The slot is a fixed box sized by the\n button's type step, so a nested node — a wrapped mark, a status dot — cannot change the\n control's width, and the loading mark lands in the box the icon had. `[&>svg]` normalizes\n direct SVG artwork; sizing nested artwork is the caller's business, as §17 says. */}\n {loading ? (\n <span className={cn(slotMap[size], !icon && \"absolute\")}>\n <Spinner size=\"small\" className={cn(\"size-full\")} />\n </span>\n ) : icon ? (\n <span className={cn(slotMap[size])} aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n {/* Retain one label subtree and its accessible name while the spinner occupies its footprint. */}\n <span className={cn(\"min-w-0 [overflow-wrap:anywhere]\", loading && !icon && \"opacity-0\")}>{children}</span>\n </BaseButton>\n );\n }\n);\n\nButton.displayName = \"Button\";\n\nexport default Button;\n"],"names":["_jsxs","BaseButton","_jsx"],"mappings":";;;;;;;;;AA+BA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CA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CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAQ,CAAA,EAAA,CAChG,CAAA;AAEjB,CAAC,CAAA;AAGH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ;;"}
@@ -4,7 +4,7 @@ import { useDirection } from '@base-ui/react/direction-provider';
4
4
  import { ArrowLeft, ArrowRight } from 'lucide-react';
5
5
  import { forwardRef, useMemo, useCallback, useState, useRef, useEffect, useId } from 'react';
6
6
  import { cn } from '../libs/utils.js';
7
- import { state, density, shape, text, focusRingInset, stateLayer, tone, elevation } from './ui.common.js';
7
+ import { state, density, shape, text, focusRingInset, stateLayer, type, tone, elevation } from './ui.common.js';
8
8
  import { motionInkPress, motionFeedback, motionTactile } from './ui.motion.js';
9
9
  import { resolveCalendarLabels, createCalendarFormat, normalizeCalendarDate, todayCalendarDate, parseCalendarDate, normalizeDateRange, daysInMonth, dayOfWeek, toCalendarDate, compareCalendarDates, rangeIncludesDate, addCalendarMonths, addCalendarDays } from './date-family.js';
10
10
 
@@ -262,7 +262,7 @@ const Calendar = forwardRef((props, ref) => {
262
262
  }
263
263
  }, className: cn("w-full table-fixed border-separate border-spacing-0"), children: [jsx("thead", { children: jsx("tr", { children: Array.from({ length: 7 }, (_, index) => {
264
264
  const name = format.weekdayNames[(index + weekStartsOn) % 7];
265
- return (jsxs("th", { scope: "col", abbr: name.long, className: cn("h-8 px-0 text-center text-xs font-medium", text.medium), children: [jsx("span", { "aria-hidden": "true", children: name.short }), jsx("span", { className: cn("sr-only"), children: name.long })] }, name.long));
265
+ return (jsxs("th", { scope: "col", abbr: name.long, className: cn("h-8 px-0 text-center font-medium", type.caption, text.medium), children: [jsx("span", { "aria-hidden": "true", children: name.short }), jsx("span", { className: cn("sr-only"), children: name.long })] }, name.long));
266
266
  }) }) }), jsx("tbody", { children: rows.map((row, rowIndex) => (jsx("tr", { children: row.map((day, columnIndex) => {
267
267
  if (day === null) {
268
268
  return (jsx("td", { role: "gridcell", className: cn("p-0 text-center align-middle") }, `blank-${rowIndex}-${columnIndex}`));
@@ -286,7 +286,7 @@ const Calendar = forwardRef((props, ref) => {
286
286
  if (day !== activeDayState)
287
287
  setActiveDayState(day);
288
288
  }, className: cn(dayButtonClassName, text.high, isToday && `${tone.text.primary} underline underline-offset-4`, selected && isEdge && "font-medium", selected && !joinedRange && cn(invalid ? tone.selected.danger : tone.selected.primary, elevation.control), !disabled && !unavailable && `${stateLayer.quiet} ${state.enabled}`, unavailable && !disabled && state.disabled, disabled && state.disabledDescendant), children: format.formatDayNumber(day) })] }, date));
289
- }) }, rowIndex))) })] }), jsxs("div", { className: cn("mt-3 flex items-center justify-between gap-3"), children: [jsx("button", { type: "button", disabled: disabled, onClick: goToToday, className: cn(todayButtonClassName, disabled ? state.disabledDescendant : state.enabled), children: labels.today }), jsx("div", { role: "status", className: cn("min-w-0 text-xs", tone.text.danger), children: rangeMessage !== null && rangeMessage !== void 0 ? rangeMessage : "" })] }), jsx("p", { id: hintId, className: cn("sr-only"), children: isRange ? labels.selectRange : labels.selectDate })] }));
289
+ }) }, rowIndex))) })] }), jsxs("div", { className: cn("mt-3 flex items-center justify-between gap-3"), children: [jsx("button", { type: "button", disabled: disabled, onClick: goToToday, className: cn(todayButtonClassName, disabled ? state.disabledDescendant : state.enabled), children: labels.today }), jsx("div", { role: "status", className: cn("min-w-0", type.supporting, tone.text.danger), children: rangeMessage !== null && rangeMessage !== void 0 ? rangeMessage : "" })] }), jsx("p", { id: hintId, className: cn("sr-only"), children: isRange ? labels.selectRange : labels.selectDate })] }));
290
290
  });
291
291
  Calendar.displayName = "Calendar";
292
292