@sdxc/ui 2026.10.12 → 2026.10.13

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 (103) hide show
  1. package/README.md +522 -668
  2. package/dist/animations/transitions.d.ts +45 -20
  3. package/dist/animations/transitions.js +104 -35
  4. package/dist/behaviors/announcer.js +2 -1
  5. package/dist/behaviors/toaster.js +2 -1
  6. package/dist/components/accordion.js +5 -9
  7. package/dist/components/alert-dialog.js +3 -3
  8. package/dist/components/alert.js +11 -2
  9. package/dist/components/attachment.js +1 -1
  10. package/dist/components/badge.js +2 -1
  11. package/dist/components/breadcrumbs.js +17 -9
  12. package/dist/components/bubble.js +6 -5
  13. package/dist/components/button.d.ts +14 -0
  14. package/dist/components/button.js +61 -20
  15. package/dist/components/calendar.js +12 -8
  16. package/dist/components/card.d.ts +5 -3
  17. package/dist/components/card.js +32 -14
  18. package/dist/components/carousel.js +4 -6
  19. package/dist/components/chart.js +5 -4
  20. package/dist/components/checkbox.js +2 -2
  21. package/dist/components/color-picker.js +8 -11
  22. package/dist/components/color-slider.js +16 -5
  23. package/dist/components/color-swatch-picker.js +7 -4
  24. package/dist/components/color-wheel.js +7 -9
  25. package/dist/components/combobox.js +5 -1
  26. package/dist/components/command.d.ts +3 -3
  27. package/dist/components/command.js +25 -28
  28. package/dist/components/context-menu.js +4 -4
  29. package/dist/components/date-field.js +2 -1
  30. package/dist/components/date-picker.js +12 -16
  31. package/dist/components/description.js +2 -2
  32. package/dist/components/dialog.js +19 -15
  33. package/dist/components/disclosure.js +15 -17
  34. package/dist/components/drawer.d.ts +5 -5
  35. package/dist/components/drawer.js +38 -33
  36. package/dist/components/drop-indicator.js +4 -10
  37. package/dist/components/empty.js +13 -6
  38. package/dist/components/field-error.js +2 -1
  39. package/dist/components/file-trigger.js +7 -10
  40. package/dist/components/grid-list.js +15 -16
  41. package/dist/components/group.js +5 -6
  42. package/dist/components/heading.js +2 -1
  43. package/dist/components/hover-card.js +4 -5
  44. package/dist/components/image-placeholder.js +17 -12
  45. package/dist/components/input.js +8 -11
  46. package/dist/components/item.js +4 -7
  47. package/dist/components/keyboard.js +9 -9
  48. package/dist/components/link-button.js +26 -8
  49. package/dist/components/listbox.d.ts +3 -2
  50. package/dist/components/listbox.js +9 -8
  51. package/dist/components/menu.js +6 -6
  52. package/dist/components/menubar.js +6 -5
  53. package/dist/components/message-scroller.js +4 -6
  54. package/dist/components/message.js +2 -2
  55. package/dist/components/meter.js +2 -2
  56. package/dist/components/modal.d.ts +2 -2
  57. package/dist/components/modal.js +12 -24
  58. package/dist/components/navigation-menu.js +5 -4
  59. package/dist/components/number-field.js +6 -6
  60. package/dist/components/overlay-arrow.js +2 -2
  61. package/dist/components/pagination.js +3 -1
  62. package/dist/components/popover.js +7 -19
  63. package/dist/components/progress-bar.js +2 -2
  64. package/dist/components/range-calendar.js +5 -3
  65. package/dist/components/resizable.js +8 -3
  66. package/dist/components/search-field.js +7 -7
  67. package/dist/components/select.js +26 -39
  68. package/dist/components/sheet.js +30 -22
  69. package/dist/components/shortcut-list.js +2 -2
  70. package/dist/components/sidebar.js +24 -22
  71. package/dist/components/slider.d.ts +3 -3
  72. package/dist/components/slider.js +18 -6
  73. package/dist/components/switch.js +2 -2
  74. package/dist/components/table.d.ts +15 -2
  75. package/dist/components/table.js +36 -14
  76. package/dist/components/tag-group.js +10 -5
  77. package/dist/components/text.js +2 -2
  78. package/dist/components/time-field.js +2 -1
  79. package/dist/components/toast.js +5 -2
  80. package/dist/components/toggle-button.js +28 -12
  81. package/dist/components/tree.js +9 -5
  82. package/dist/components/typeset.js +5 -2
  83. package/dist/mixins/carousel-controls.js +11 -15
  84. package/dist/mixins/clear-field.js +4 -5
  85. package/dist/mixins/context-menu.js +5 -8
  86. package/dist/mixins/grid-list-keys.js +5 -2
  87. package/dist/mixins/listbox-keys.js +1 -1
  88. package/dist/mixins/message-follow.js +7 -13
  89. package/dist/mixins/treeKeys.js +5 -3
  90. package/dist/styles/floating-surface.d.ts +62 -14
  91. package/dist/styles/floating-surface.js +67 -10
  92. package/dist/styles/hit-area.d.ts +36 -0
  93. package/dist/styles/hit-area.js +48 -0
  94. package/dist/styles/index.d.ts +1 -0
  95. package/dist/styles/index.js +1 -0
  96. package/dist/styles/output-caption-text.d.ts +3 -2
  97. package/dist/styles/output-caption-text.js +4 -3
  98. package/dist/styles/range-thumb-appearance.js +17 -18
  99. package/dist/utils/glyph-edges.d.ts +24 -0
  100. package/dist/utils/glyph-edges.js +46 -0
  101. package/package.json +5 -4
  102. package/src/reset.css +4 -1
  103. package/src/theme.css +49 -2
@@ -1,20 +1,13 @@
1
1
  import { jsx as _jsx } from "remix/component/jsx-runtime";
2
- import { opacity, transition, transitionBehavior, transitionProperty } from "@sdxc/u/effects";
3
- import { media, startingStyle } from "@sdxc/u/responsive";
4
- import { when } from "@sdxc/u/state";
5
- import { scaleProperty } from "@sdxc/u/transform";
6
2
  import { durations, easings } from "../animations/tokens.js";
3
+ import { enterExit } from "../animations/transitions.js";
7
4
  import { Dialog } from "./dialog.js";
8
- /**
9
- * Exit-state `scale` factor {@link Modal}'s panel animates from on entry and
10
- * back down to on exit.
11
- */
12
- const PANEL_EXIT_SCALE = "0.95";
13
- /**
14
- * Entered-state `scale` factor — the platform's own reset value, undoing
15
- * {@link PANEL_EXIT_SCALE} once the panel is open.
16
- */
17
- const PANEL_ENTERED_SCALE = "none";
5
+ /** `scale` factor {@link Modal}'s panel grows from on entry. */
6
+ const PANEL_ENTRY_SCALE = 0.95;
7
+ /** `scale` factor the panel shrinks to on exit, halfway back toward its entry scale. */
8
+ const PANEL_EXIT_SCALE = 0.975;
9
+ /** Blur radius in pixels the panel softens to as it fades out. */
10
+ const PANEL_EXIT_BLUR_PX = 2;
18
11
  /**
19
12
  * Renders {@link Dialog} with its panel's pop-in/pop-out motion pre-wired
20
13
  * through `mix`, collapsing to an opacity-only fade under reduced motion.
@@ -45,19 +38,14 @@ export function Modal(handle) {
45
38
  return () => {
46
39
  let { mix, ...rest } = handle.props;
47
40
  return (_jsx(Dialog, { ...rest, mix: [
48
- scaleProperty(PANEL_EXIT_SCALE),
49
- transitionBehavior("allow-discrete"),
50
- opacity(0),
51
- transition("opacity, scale, display, overlay", {
41
+ enterExit({
42
+ opacity: 0,
43
+ scale: PANEL_ENTRY_SCALE,
52
44
  duration: durations.normal,
53
45
  easing: easings.standard,
46
+ exit: { scale: PANEL_EXIT_SCALE, blur: PANEL_EXIT_BLUR_PX },
47
+ exitDuration: durations.fast,
54
48
  }),
55
- when("&[open]", [scaleProperty(PANEL_ENTERED_SCALE), opacity(100)]),
56
- startingStyle(when("&[open]", [scaleProperty(PANEL_EXIT_SCALE), opacity(0)])),
57
- media("(prefers-reduced-motion: reduce)", [
58
- scaleProperty(PANEL_ENTERED_SCALE),
59
- transitionProperty("opacity, display, overlay"),
60
- ]),
61
49
  mix,
62
50
  ] }));
63
51
  };
@@ -1,18 +1,18 @@
1
1
  import { jsx as _jsx } from "remix/component/jsx-runtime";
2
2
  import { bg, fg, outline, outlineStyle } from "@sdxc/u/color";
3
3
  import { opacity, rounded, transition, transitionBehavior, transitionProperty, } from "@sdxc/u/effects";
4
- import { cursor, userSelect } from "@sdxc/u/general";
4
+ import { cursor, raw, userSelect } from "@sdxc/u/general";
5
5
  import { container, flex, flexCol, gap, grid, gridTemplate, inlineFlex, items, justify, relative, } from "@sdxc/u/layout";
6
6
  import { overflow } from "@sdxc/u/overflow";
7
7
  import { at, media, startingStyle } from "@sdxc/u/responsive";
8
- import { bs, is, maxIs, mbs, minIs, p, pb, pi } from "@sdxc/u/size";
8
+ import { bs, is, maxIs, mbs, minIs, pb, pi } from "@sdxc/u/size";
9
9
  import { z } from "@sdxc/u/stacking";
10
10
  import { data, disabled, hover, when } from "@sdxc/u/state";
11
11
  import { scaleProperty } from "@sdxc/u/transform";
12
12
  import { fontSize, leading, text, textDecoration, weight } from "@sdxc/u/typography";
13
13
  import { attrs } from "remix/component";
14
14
  import { durations, easings } from "../animations/tokens.js";
15
- import { floatingSurface } from "../styles/floating-surface.js";
15
+ import { concentricRadius, floatingSurface, surfaceInset, surfacePadding, } from "../styles/floating-surface.js";
16
16
  import { interactiveTransition } from "../styles/interactive-transition.js";
17
17
  import { Popover } from "./popover.js";
18
18
  /**
@@ -211,7 +211,7 @@ NavigationMenu.Content = function NavigationMenuContent(handle) {
211
211
  when("&:focus-visible", outline({ color: "brand.ring", offset: 2 })),
212
212
  is("max-content"),
213
213
  minIs("11rem"),
214
- p(2),
214
+ surfaceInset({ scale: 2 }),
215
215
  z(50),
216
216
  opacity(0),
217
217
  when('& [data-slot="link"]', [is("full"), justify("start")]),
@@ -291,6 +291,7 @@ NavigationMenu.Viewport = function NavigationMenuViewport(handle) {
291
291
  let { mix, ...rest } = handle.props;
292
292
  return (_jsx("div", { ...rest, mix: [
293
293
  floatingSurface(),
294
+ raw({ borderRadius: concentricRadius(surfacePadding(2)) }),
294
295
  relative(),
295
296
  mbs(2),
296
297
  overflow(),
@@ -6,7 +6,7 @@ import { cursor, raw } from "@sdxc/u/general";
6
6
  import { basis, flex, grow, inlineFlex, items, justify, shrink } from "@sdxc/u/layout";
7
7
  import { bs, is } from "@sdxc/u/size";
8
8
  import { active, focusVisible, hover, invalid, when } from "@sdxc/u/state";
9
- import { textAlign } from "@sdxc/u/typography";
9
+ import { tabularNums, textAlign } from "@sdxc/u/typography";
10
10
  import { attrs } from "remix/component";
11
11
  import { fieldStackLayout } from "../styles/field-stack-layout.js";
12
12
  import { interactiveTransition } from "../styles/interactive-transition.js";
@@ -100,11 +100,10 @@ NumberField.Group = function NumberFieldGroup(handle) {
100
100
  bg("neutral.tint"),
101
101
  fg("neutral.emphasis"),
102
102
  hover(border("neutral.border-hover")),
103
- /*
104
- * The wrapper wears the focus of whichever part holds it, drawn as a ring
105
- * standing off the field the way every button in this library draws one; the
106
- * border only steps to its hover weight, since a ring sat flush against a
107
- * darkened border reads as one thick slab rather than as focus.
103
+ /**
104
+ * The wrapper wears the focus of whichever part holds it as a ring standing off the
105
+ * field, as every button here does; the border steps only to its hover weight, since a
106
+ * darkened border flush with the ring reads as one thick slab.
108
107
  */
109
108
  when("&:focus-within", [
110
109
  outline({ color: "brand.ring", offset: 2 }),
@@ -131,6 +130,7 @@ NumberField.Input = function NumberFieldInput(handle) {
131
130
  let { mix, ...rest } = handle.props;
132
131
  return (_jsx(Input, { type: "number", ...rest, mix: [
133
132
  textAlign("center"),
133
+ tabularNums(),
134
134
  rounded("none"),
135
135
  grow(),
136
136
  shrink(1),
@@ -42,7 +42,7 @@ export function OverlayArrow(handle) {
42
42
  return (_jsx("div", { "data-placement": resolvedPlacement, ...rest, mix: [
43
43
  attrs({ "aria-hidden": DEFAULT_ARIA_HIDDEN }),
44
44
  absolute(),
45
- /*
45
+ /**
46
46
  * The host spans the whole edge it attaches to, so centring the glyph inside it
47
47
  * is what puts the point under the trigger the surface is anchored to.
48
48
  */
@@ -64,7 +64,7 @@ export function OverlayArrow(handle) {
64
64
  insIs("0"),
65
65
  insIe("0"),
66
66
  ]),
67
- /*
67
+ /**
68
68
  * A side placement sits past the surface's own inline edge, where the space
69
69
  * left to grow into is none, so the glyph is sized from its own content the
70
70
  * way the block placements are sized from theirs.
@@ -5,7 +5,7 @@ import { cursor, listStyle, pointerEvents } from "@sdxc/u/general";
5
5
  import { flex, gap, inlineFlex, items, justify } from "@sdxc/u/layout";
6
6
  import { bs, m, minIs, p, pi } from "@sdxc/u/size";
7
7
  import { active, hover, when } from "@sdxc/u/state";
8
- import { text, textDecoration, weight } from "@sdxc/u/typography";
8
+ import { tabularNums, text, textDecoration, weight } from "@sdxc/u/typography";
9
9
  import { interactiveTransition } from "../styles/interactive-transition.js";
10
10
  import { warnIfNoAccessibleLabel, warnIfNoAccessibleName, } from "../utils/warn-if-no-accessible-name.js";
11
11
  /**
@@ -113,6 +113,7 @@ Pagination.Link = function PaginationLink(handle) {
113
113
  when("&:focus-visible", outline({ color: "brand.ring", offset: 2 })),
114
114
  when('&[aria-disabled="true"]', opacity(50)),
115
115
  text("sm"),
116
+ tabularNums(),
116
117
  textDecoration("none"),
117
118
  when('&[aria-disabled="true"]', [cursor("not-allowed"), pointerEvents()]),
118
119
  mix,
@@ -157,6 +158,7 @@ Pagination.Button = function PaginationButton(handle) {
157
158
  when("&:focus-visible", outline({ color: "brand.ring", offset: 2 })),
158
159
  when("&:disabled", opacity(50)),
159
160
  text("sm"),
161
+ tabularNums(),
160
162
  when("&:disabled", cursor("not-allowed")),
161
163
  mix,
162
164
  ], children: children }));
@@ -51,11 +51,9 @@ export function Popover(handle) {
51
51
  when('&[data-placement^="left"]', marginRight("var(--ui-popover-offset, 0.5rem)")),
52
52
  when('&[data-placement^="right"]', marginLeft("var(--ui-popover-offset, 0.5rem)")),
53
53
  positionTryFallbacks("flip-block", "flip-inline", "flip-block flip-inline"),
54
- /*
55
- * A corner placement aligns one pair of edges and grows away from it, so the
56
- * surface occupies the anchor's own track and spans the one beyond it. Naming
57
- * the neighbouring cell instead — `bottom left` for `bottom-start` — would sit
58
- * the surface past the anchor's edge rather than flush with it.
54
+ /**
55
+ * A corner placement aligns one pair of edges and grows away from it, so the surface
56
+ * occupies the anchor's own track and spans the one beyond it, flush with the anchor's edge.
59
57
  */
60
58
  data("placement", "top", positionArea("top")),
61
59
  data("placement", "top-start", positionArea("top span-right")),
@@ -69,20 +67,10 @@ export function Popover(handle) {
69
67
  data("placement", "right", positionArea("right")),
70
68
  data("placement", "right-start", positionArea("right span-bottom")),
71
69
  data("placement", "right-end", positionArea("right span-top")),
72
- /*
73
- * A part built on this surface that lays its contents out — a stack, a grid —
74
- * sets `display` in the author origin and beats the user agent's
75
- * `[popover]:not(:popover-open) { display: none }`, leaving the surface on
76
- * screen with nothing having opened it. The closed state is marked important
77
- * because every `mix` entry compiles into its own cascade sublayer ordered by
78
- * first appearance, and a consumer's entry is appended after these: later layer
79
- * wins whatever the selectors say, so importance is what settles it.
80
- *
81
- * A `"hint"` surface is left out: that mode is the one a hint reveals itself
82
- * in, from CSS state on its trigger rather than from an invoker, so it stays
83
- * closed the whole time it is on screen and owns its own hidden state. An
84
- * important rule here would be the one thing its reveal could not answer,
85
- * since importance reverses layer order and this entry comes first.
70
+ /**
71
+ * Layout parts on this surface set `display` and beat the UA's closed `display: none`, so
72
+ * the closed state is important to outrank a consumer's later sublayer. A `"hint"` surface
73
+ * reveals itself from CSS state on its trigger, so it keeps its own hidden state.
86
74
  */
87
75
  when('&:not(:popover-open):not([popover="hint"])', raw({ display: "none !important" })),
88
76
  mix,
@@ -6,7 +6,7 @@ import { overflow } from "@sdxc/u/overflow";
6
6
  import { media } from "@sdxc/u/responsive";
7
7
  import { bs, is, m, p } from "@sdxc/u/size";
8
8
  import { when } from "@sdxc/u/state";
9
- import { text } from "@sdxc/u/typography";
9
+ import { tabularNums, text } from "@sdxc/u/typography";
10
10
  import { warnIfNoAccessibleLabel } from "../utils/warn-if-no-accessible-name.js";
11
11
  /** Native `max` value {@link ProgressBar.Indicator} falls back to when `max` is omitted, so a bare `value` reads as a percentage without passing `max={100}` every time. */
12
12
  const DEFAULT_MAX = 100;
@@ -85,6 +85,6 @@ ProgressBar.Indicator = function ProgressBarIndicator(handle) {
85
85
  ProgressBar.ValueLabel = function ProgressBarValueLabel(handle) {
86
86
  return () => {
87
87
  let { mix, ...rest } = handle.props;
88
- return _jsx("span", { ...rest, mix: [fg("neutral"), text("sm"), mix] });
88
+ return _jsx("span", { ...rest, mix: [fg("neutral"), text("sm"), tabularNums(), mix] });
89
89
  };
90
90
  };
@@ -190,7 +190,7 @@ RangeCalendar.Cell = function RangeCalendarCell(handle) {
190
190
  return () => {
191
191
  let { mix, ...rest } = handle.props;
192
192
  return (_jsx(Calendar.Cell, { ...rest, mix: [
193
- /*
193
+ /**
194
194
  * A day is the range's opening, its closing, both at once, or one of the days
195
195
  * between. The four are written under selectors that match one apiece, so each
196
196
  * day keeps its own shape however the cascade orders the set.
@@ -207,13 +207,15 @@ RangeCalendar.Cell = function RangeCalendarCell(handle) {
207
207
  roundedCorner("start-start", "none"),
208
208
  roundedCorner("end-start", "none"),
209
209
  ]),
210
- // A range of one day opens and closes on itself, so it reads as a single day.
210
+ /**
211
+ * A range of one day opens and closes on itself, so it reads as a single day.
212
+ */
211
213
  when("&[data-selection-start][data-selection-end]", [
212
214
  bg("brand.solid"),
213
215
  fg("brand.onSolid"),
214
216
  ]),
215
217
  when('&[aria-selected="true"]:not([data-selection-start]):not([data-selection-end])', [
216
- /*
218
+ /**
217
219
  * The days between carry the range across the row, so the band reads as one
218
220
  * run at a glance while the two ends stay the strongest thing in the month.
219
221
  */
@@ -1,12 +1,13 @@
1
1
  import { jsx as _jsx } from "remix/component/jsx-runtime";
2
2
  import { bg, border, fg, outline, outlineStyle } from "@sdxc/u/color";
3
3
  import { opacity, rounded } from "@sdxc/u/effects";
4
- import { cursor, raw, touchAction, userSelect } from "@sdxc/u/general";
4
+ import { cursor, pseudoContent, touchAction, userSelect } from "@sdxc/u/general";
5
5
  import { basis, flex, flexCol, flexRow, grow, items, justify, relative, shrink, } from "@sdxc/u/layout";
6
6
  import { overflow } from "@sdxc/u/overflow";
7
7
  import { bs, is, maxBs, maxIs, minBs, minIs } from "@sdxc/u/size";
8
8
  import { before, data, focusVisible, hover, when } from "@sdxc/u/state";
9
9
  import { attrs } from "remix/component";
10
+ import { hitArea } from "../styles/hit-area.js";
10
11
  import { mergeStyle } from "../utils/merge-style.js";
11
12
  /** Default {@link Resizable.Props} orientation, applied when `orientation` is omitted. */
12
13
  const DEFAULT_ORIENTATION = "horizontal";
@@ -135,8 +136,7 @@ Resizable.Handle = function ResizableHandle(handle) {
135
136
  outlineStyle("none"),
136
137
  when('&[data-orientation="horizontal"]', cursor("col-resize")),
137
138
  when('&[data-orientation="vertical"]', cursor("row-resize")),
138
- /** `raw()` sets the bare CSS `content` property directly, its only utility path. */
139
- before(raw({ content: '""' })),
139
+ before(pseudoContent('""')),
140
140
  data("orientation", "horizontal", before([bs("2.5rem"), is("0.125rem")])),
141
141
  data("orientation", "vertical", before([bs("0.125rem"), is("2.5rem")])),
142
142
  when('&[aria-disabled="true"]', [cursor("not-allowed"), opacity(50)]),
@@ -145,6 +145,11 @@ Resizable.Handle = function ResizableHandle(handle) {
145
145
  hover(when("&::before", bg("neutral.strong"))),
146
146
  when("&[data-resizing]::before", bg("brand.solid")),
147
147
  focusVisible(outline({ color: "brand.ring" })),
148
+ /**
149
+ * The handle's thin axis grows to `--ui-target-size` through an invisible box
150
+ * over the panels' edges, leaving the layout and the drawn line unchanged.
151
+ */
152
+ hitArea(),
148
153
  mix,
149
154
  ] }));
150
155
  };
@@ -55,11 +55,9 @@ SearchField.Input = function SearchFieldInput(handle) {
55
55
  let { mix, ...rest } = handle.props;
56
56
  return (_jsxs("div", { "data-slot": "input-wrapper", mix: [relative(), flex(), items("center")], children: [_jsx(SearchIcon, { size: 16, "data-slot": "icon", mix: [absolute(), insIs("0.75rem"), pointerEvents(), fg("neutral.muted")] }), _jsx(Input, { type: "search", ...rest, mix: [
57
57
  pis("2.25rem"),
58
- /*
59
- * The field owns its own chrome, and {@link SearchField.Clear} draws the
60
- * clear affordance. The user agent draws one of its own inside a search
61
- * input that holds a value, unstyled and in the same corner, so the two
62
- * would sit on top of each other.
58
+ /**
59
+ * {@link SearchField.Clear} draws the clear affordance, so the one the user agent draws
60
+ * inside a search input holding a value is hidden to keep the two from stacking.
63
61
  */
64
62
  when("&::-webkit-search-cancel-button", [appearance("none"), hidden()]),
65
63
  when("&::-webkit-search-decoration", [appearance("none"), hidden()]),
@@ -87,7 +85,9 @@ SearchField.Control = function SearchFieldControl(handle) {
87
85
  relative(),
88
86
  flex(),
89
87
  items("center"),
90
- /* The input spans the row, so the field keeps the width its container offers. */
88
+ /**
89
+ * The input spans the row, so the field keeps the width its container offers.
90
+ */
91
91
  when('& > [data-slot="input-wrapper"]', grow()),
92
92
  mix,
93
93
  ] }));
@@ -110,7 +110,7 @@ SearchField.Clear = function SearchFieldClear(handle) {
110
110
  let { children, mix, ...rest } = handle.props;
111
111
  return (_jsx(Button, { type: "button", ...rest, hidden: true, variant: "ghost", size: "sm", command: SEARCH_FIELD_CLEAR_COMMAND, "data-slot": "clear", mix: [
112
112
  clearField(),
113
- /*
113
+ /**
114
114
  * A round, icon-sized target centred on the field, so its hover tint reads as a
115
115
  * disc beside the text, and its glyph sits as far from the trailing edge as the
116
116
  * search glyph sits from the leading one.
@@ -1,15 +1,18 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "remix/component/jsx-runtime";
2
2
  import { ChevronDownIcon } from "@sdxc/icons";
3
3
  import { bg, border, borderEdge, fg, outline, outlineStyle, outlineWidth } from "@sdxc/u/color";
4
- import { opacity, rounded, transition, transitionDuration } from "@sdxc/u/effects";
4
+ import { opacity, rounded, transition, transitionBehavior, transitionDuration, } from "@sdxc/u/effects";
5
5
  import { cursor, raw } from "@sdxc/u/general";
6
- import { appearance, basis, flex, gap, grow, inlineFlex, items, justify, shrink, } from "@sdxc/u/layout";
7
- import { media } from "@sdxc/u/responsive";
8
- import { bs, is, m, p, pb, pi } from "@sdxc/u/size";
6
+ import { appearance, basis, flex, gap, grow, inlineFlex, inset, items, justify, shrink, } from "@sdxc/u/layout";
7
+ import { overflow } from "@sdxc/u/overflow";
8
+ import { media, startingStyle } from "@sdxc/u/responsive";
9
+ import { bs, is, m, maxBs, p, pb, pi } from "@sdxc/u/size";
9
10
  import { data, hover, when } from "@sdxc/u/state";
10
11
  import { text, textAlign, truncate } from "@sdxc/u/typography";
11
12
  import { attrs } from "remix/component";
13
+ import { durations } from "../animations/tokens.js";
12
14
  import { mirrorSelectedOption } from "../mixins/mirror-selected-option.js";
15
+ import { floatingSurface, surfaceInset } from "../styles/floating-surface.js";
13
16
  /** Semantic color role {@link Select} falls back to when `color` is omitted. */
14
17
  const DEFAULT_COLOR = "neutral";
15
18
  /**
@@ -59,17 +62,10 @@ export function Select(handle) {
59
62
  justify("between"),
60
63
  cursor("default"),
61
64
  text("sm"),
62
- /*
63
- * Focus is drawn as a ring standing off the field, the same way every button in
64
- * this library draws it, rather than by darkening the border: a border promoted
65
- * to its strong weight and a ring sat flush against it read as one thick slab,
66
- * which says the field changed shape rather than that it took focus. The border
67
- * only steps to its hover weight, so nothing jumps.
68
- *
69
- * Pointer focus drops the platform outline and keyboard focus keeps the ring. The
70
- * two selectors exclude each other because `outline: none` is a shorthand, and a
71
- * shorthand reaching this element from a later cascade layer resets the ring's
72
- * color, width and style all at once.
65
+ /**
66
+ * Focus draws a ring standing off the field and the border steps only to its hover weight,
67
+ * so the field keeps its shape. The pointer and keyboard selectors exclude each other because
68
+ * `outline: none` is a shorthand that, from a later layer, resets the whole ring.
73
69
  */
74
70
  when("&:focus:not(:focus-visible)", outline("none")),
75
71
  when("&:focus-visible", [
@@ -85,27 +81,23 @@ export function Select(handle) {
85
81
  raw({ outlineOffset: "2px" }),
86
82
  ]),
87
83
  when("&:disabled", [cursor("not-allowed"), opacity(50)]),
84
+ when("&::picker(select)", [
85
+ floatingSurface(),
86
+ surfaceInset(),
87
+ m(0),
88
+ inset("auto"),
89
+ maxBs("15rem"),
90
+ overflow("auto"),
91
+ outline("none"),
92
+ opacity(0),
93
+ transition("opacity, display, overlay", { duration: durations.fast }),
94
+ transitionBehavior("allow-discrete"),
95
+ ]),
96
+ when("&:open::picker(select)", opacity(100)),
97
+ startingStyle(when("&:open::picker(select)", opacity(0))),
98
+ media("(prefers-reduced-motion: reduce)", when("&::picker(select)", transitionDuration("0s"))),
88
99
  raw({
89
- "&::picker(select)": {
90
- margin: "0",
91
- inset: "auto",
92
- boxShadow: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
93
- maxBlockSize: "15rem",
94
- overflow: "auto",
95
- padding: "0.25rem",
96
- outline: "none",
97
- opacity: "0",
98
- transitionProperty: "opacity, display, overlay",
99
- transitionDuration: "150ms",
100
- transitionBehavior: "allow-discrete",
101
- "@starting-style": {
102
- opacity: "0",
103
- },
104
- },
105
100
  "&:open": {
106
- "&::picker(select)": {
107
- opacity: "1",
108
- },
109
101
  '& [data-slot="icon"]': {
110
102
  transform: "rotate(180deg)",
111
103
  },
@@ -115,11 +107,6 @@ export function Select(handle) {
115
107
  color: "var(--ui-neutral-fg-muted)",
116
108
  },
117
109
  },
118
- "@media (prefers-reduced-motion: reduce)": {
119
- "&::picker(select)": {
120
- transitionDuration: "0s",
121
- },
122
- },
123
110
  }),
124
111
  gap("0.5rem"),
125
112
  is("full"),
@@ -1,20 +1,26 @@
1
1
  import { jsx as _jsx } from "remix/component/jsx-runtime";
2
2
  import { borderEdge, fg } from "@sdxc/u/color";
3
- import { rounded, transition, transitionBehavior, transitionProperty } from "@sdxc/u/effects";
4
- import { willChange } from "@sdxc/u/general";
3
+ import { rounded } from "@sdxc/u/effects";
4
+ import { vars, willChange } from "@sdxc/u/general";
5
5
  import { fixed, flex, gap, insBe, insBs, insLeft, insRight, items, justify, vstack, } from "@sdxc/u/layout";
6
- import { media, startingStyle } from "@sdxc/u/responsive";
7
6
  import { is, m, maxBs, maxIs, mbs, paddingLeft, paddingRight, pbe, pbs } from "@sdxc/u/size";
8
- import { data, when } from "@sdxc/u/state";
9
- import { translateX } from "@sdxc/u/transform";
10
- import { fontSize } from "@sdxc/u/typography";
7
+ import { data } from "@sdxc/u/state";
8
+ import { fontSize, pretty } from "@sdxc/u/typography";
11
9
  import { durations, easings } from "../animations/tokens.js";
10
+ import { enterExit } from "../animations/transitions.js";
12
11
  import { Dialog } from "./dialog.js";
13
12
  /**
14
13
  * Physical side of the viewport {@link Sheet} docks to when `side` is left
15
14
  * unset.
16
15
  */
17
16
  const DEFAULT_SIDE = "right";
17
+ /**
18
+ * How far toward its side the panel drifts while it fades out on close: a
19
+ * hint of the direction it came from, short of the full slide it entered with.
20
+ */
21
+ const EXIT_DISTANCE = "1rem";
22
+ /** Blur radius in pixels the panel softens to as it fades out. */
23
+ const EXIT_BLUR_PX = 4;
18
24
  /**
19
25
  * Renders the panel through {@link Dialog}: fixed, pinned to whichever
20
26
  * inline edge `side` names with the far edge released to `auto`, and slid
@@ -54,38 +60,40 @@ export function Sheet(handle) {
54
60
  is("min(90vw, var(--ui-sheet-size, 24rem))"),
55
61
  insBs("0"),
56
62
  insBe("0"),
57
- transitionBehavior("allow-discrete"),
58
- willChange("transform"),
63
+ enterExit({
64
+ translate: "var(--ui-sheet-enter-offset)",
65
+ duration: durations.slow,
66
+ easing: easings.decelerate,
67
+ exit: { translate: "var(--ui-sheet-exit-offset)", opacity: 0, blur: EXIT_BLUR_PX },
68
+ exitDuration: durations.fast,
69
+ exitEasing: easings.accelerate,
70
+ }),
71
+ willChange("translate"),
59
72
  data("side", "right", [
60
73
  borderEdge("left", { width: 1, color: "neutral" }),
61
- translateX("100%"),
74
+ vars({
75
+ "ui-sheet-enter-offset": "100% 0",
76
+ "ui-sheet-exit-offset": `${EXIT_DISTANCE} 0`,
77
+ }),
62
78
  insRight("0"),
63
79
  insLeft("auto"),
64
80
  paddingLeft("1.5rem"),
65
81
  paddingRight("calc(1.5rem + env(safe-area-inset-right, 0px))"),
66
82
  ]),
67
- data("side", "right", when("&[open]", translateX("0"))),
68
83
  data("side", "left", [
69
84
  borderEdge("right", { width: 1, color: "neutral" }),
70
- translateX("-100%"),
85
+ vars({
86
+ "ui-sheet-enter-offset": "-100% 0",
87
+ "ui-sheet-exit-offset": `-${EXIT_DISTANCE} 0`,
88
+ }),
71
89
  insLeft("0"),
72
90
  insRight("auto"),
73
91
  paddingRight("1.5rem"),
74
92
  paddingLeft("calc(1.5rem + env(safe-area-inset-left, 0px))"),
75
93
  ]),
76
- data("side", "left", when("&[open]", translateX("0"))),
77
- startingStyle([
78
- when('&[data-side="right"][open]', translateX("100%")),
79
- when('&[data-side="left"][open]', translateX("-100%")),
80
- ]),
81
- media("(prefers-reduced-motion: reduce)", transitionProperty("none")),
82
94
  gap("1rem"),
83
95
  pbs(`calc(1.5rem + env(safe-area-inset-top, 0px))`),
84
96
  pbe(`calc(1.5rem + env(safe-area-inset-bottom, 0px))`),
85
- transition("transform, display, overlay", {
86
- duration: durations.slow,
87
- easing: easings.decelerate,
88
- }),
89
97
  mix,
90
98
  ] }));
91
99
  };
@@ -133,7 +141,7 @@ Sheet.Title = Dialog.Title;
133
141
  Sheet.Description = function SheetDescription(handle) {
134
142
  return () => {
135
143
  let { mix, ...rest } = handle.props;
136
- return (_jsx("p", { ...rest, "data-slot": "description", mix: [fontSize("sm"), fg("neutral"), mix], children: rest.children }));
144
+ return (_jsx("p", { ...rest, "data-slot": "description", mix: [fontSize("sm"), fg("neutral"), pretty(), mix], children: rest.children }));
137
145
  };
138
146
  };
139
147
  /**
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
2
2
  import { fg } from "@sdxc/u/color";
3
3
  import { contents, flex, gap, grid, gridTemplate, items, justify } from "@sdxc/u/layout";
4
4
  import { m } from "@sdxc/u/size";
5
- import { text, weight } from "@sdxc/u/typography";
5
+ import { pretty, text, weight } from "@sdxc/u/typography";
6
6
  import { Keyboard } from "./keyboard.js";
7
7
  /**
8
8
  * Renders the list's host `<dl>`, a two-column grid whose first column takes the actions
@@ -34,6 +34,6 @@ export function ShortcutList(handle) {
34
34
  ShortcutList.Item = function ShortcutListItem(handle) {
35
35
  return () => {
36
36
  let { children, keys, mix, ...rest } = handle.props;
37
- return (_jsxs("div", { ...rest, "data-slot": "shortcut", mix: [contents(), mix], children: [_jsx("dt", { mix: [text("sm"), fg("neutral")], children: children }), _jsx("dd", { mix: [m(0), flex(), gap(1), items("center"), justify("end")], children: keys.map((key, index) => (_jsx(Keyboard, { mix: [m(0), weight("medium")], children: key }, `${index}-${key}`))) })] }));
37
+ return (_jsxs("div", { ...rest, "data-slot": "shortcut", mix: [contents(), mix], children: [_jsx("dt", { mix: [text("sm"), fg("neutral"), pretty()], children: children }), _jsx("dd", { mix: [m(0), flex(), gap(1), items("center"), justify("end")], children: keys.map((key, index) => (_jsx(Keyboard, { mix: [m(0), weight("medium")], children: key }, `${index}-${key}`))) })] }));
38
38
  };
39
39
  };