@sdxc/kit 0.0.0-pre.1 → 2026.10.16

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 (115) hide show
  1. package/changelog.jsonl +1040 -0
  2. package/dist/make/declare.js +13 -13
  3. package/dist/make/generate.d.ts +6 -0
  4. package/dist/make/generate.js +22 -7
  5. package/dist/make/imports.js +2 -1
  6. package/dist/make/migrations.d.ts +26 -6
  7. package/dist/make/migrations.js +84 -16
  8. package/dist/releases.js +1 -1
  9. package/dist/testing.d.ts +4 -1
  10. package/dist/testing.js +5 -2
  11. package/dist/upgrade/prompt.js +1 -1
  12. package/package.json +8 -8
  13. package/registry/ui/accordion.json +15 -0
  14. package/registry/ui/alert-dialog.json +20 -0
  15. package/registry/ui/alert.json +15 -0
  16. package/registry/ui/aspect-ratio.json +13 -0
  17. package/registry/ui/attachment.json +15 -0
  18. package/registry/ui/avatar.json +15 -0
  19. package/registry/ui/badge.json +13 -0
  20. package/registry/ui/breadcrumbs.json +15 -0
  21. package/registry/ui/bubble.json +13 -0
  22. package/registry/ui/button.json +16 -0
  23. package/registry/ui/calendar.json +16 -0
  24. package/registry/ui/card.json +18 -0
  25. package/registry/ui/carousel.json +15 -0
  26. package/registry/ui/chart.json +13 -0
  27. package/registry/ui/checkbox-group.json +13 -0
  28. package/registry/ui/checkbox.json +16 -0
  29. package/registry/ui/color-area.json +13 -0
  30. package/registry/ui/color-field.json +20 -0
  31. package/registry/ui/color-picker.json +17 -0
  32. package/registry/ui/color-slider.json +13 -0
  33. package/registry/ui/color-swatch-picker.json +15 -0
  34. package/registry/ui/color-swatch.json +13 -0
  35. package/registry/ui/color-wheel.json +13 -0
  36. package/registry/ui/combobox.json +15 -0
  37. package/registry/ui/command.json +13 -0
  38. package/registry/ui/confirm.json +19 -0
  39. package/registry/ui/context-menu.json +16 -0
  40. package/registry/ui/date-field.json +19 -0
  41. package/registry/ui/date-picker.json +15 -0
  42. package/registry/ui/date-range-picker.json +16 -0
  43. package/registry/ui/description.json +13 -0
  44. package/registry/ui/dialog.json +19 -0
  45. package/registry/ui/disclosure.json +18 -0
  46. package/registry/ui/drawer.json +18 -0
  47. package/registry/ui/drop-indicator.json +13 -0
  48. package/registry/ui/drop-zone.json +13 -0
  49. package/registry/ui/empty.json +15 -0
  50. package/registry/ui/field-error.json +13 -0
  51. package/registry/ui/file-trigger.json +13 -0
  52. package/registry/ui/form.json +21 -0
  53. package/registry/ui/grid-list.json +18 -0
  54. package/registry/ui/group.json +13 -0
  55. package/registry/ui/header.json +13 -0
  56. package/registry/ui/heading-scope.json +20 -0
  57. package/registry/ui/heading.json +15 -0
  58. package/registry/ui/highlight.json +16 -0
  59. package/registry/ui/hover-card.json +13 -0
  60. package/registry/ui/image-placeholder.json +16 -0
  61. package/registry/ui/input.json +13 -0
  62. package/registry/ui/item.json +13 -0
  63. package/registry/ui/keyboard.json +13 -0
  64. package/registry/ui/label.json +13 -0
  65. package/registry/ui/link-button.json +16 -0
  66. package/registry/ui/link.json +13 -0
  67. package/registry/ui/listbox.json +15 -0
  68. package/registry/ui/logo.json +15 -0
  69. package/registry/ui/marker.json +13 -0
  70. package/registry/ui/menu.json +19 -0
  71. package/registry/ui/menubar.json +13 -0
  72. package/registry/ui/message-scroller.json +16 -0
  73. package/registry/ui/message.json +13 -0
  74. package/registry/ui/meter.json +13 -0
  75. package/registry/ui/modal.json +15 -0
  76. package/registry/ui/nav-link.json +13 -0
  77. package/registry/ui/navigation-menu.json +15 -0
  78. package/registry/ui/number-field.json +15 -0
  79. package/registry/ui/otp-field.json +15 -0
  80. package/registry/ui/overlay-arrow.json +13 -0
  81. package/registry/ui/pagination.json +16 -0
  82. package/registry/ui/popover.json +13 -0
  83. package/registry/ui/progress-bar.json +13 -0
  84. package/registry/ui/radio-group.json +13 -0
  85. package/registry/ui/range-calendar.json +16 -0
  86. package/registry/ui/resizable.json +13 -0
  87. package/registry/ui/scroll-area.json +13 -0
  88. package/registry/ui/search-field.json +16 -0
  89. package/registry/ui/section.json +13 -0
  90. package/registry/ui/select.json +13 -0
  91. package/registry/ui/selection-indicator.json +13 -0
  92. package/registry/ui/sentinel-row.json +16 -0
  93. package/registry/ui/separator.json +13 -0
  94. package/registry/ui/shared-element.json +13 -0
  95. package/registry/ui/sheet.json +15 -0
  96. package/registry/ui/shortcut-list.json +18 -0
  97. package/registry/ui/sidebar.json +20 -0
  98. package/registry/ui/skeleton.json +13 -0
  99. package/registry/ui/slider.json +16 -0
  100. package/registry/ui/spinner.json +13 -0
  101. package/registry/ui/switch.json +16 -0
  102. package/registry/ui/table.json +16 -0
  103. package/registry/ui/tabs.json +17 -0
  104. package/registry/ui/tag-group.json +18 -0
  105. package/registry/ui/text-field.json +19 -0
  106. package/registry/ui/text.json +13 -0
  107. package/registry/ui/textarea.json +13 -0
  108. package/registry/ui/time-field.json +19 -0
  109. package/registry/ui/toast.json +16 -0
  110. package/registry/ui/toggle-button.json +17 -0
  111. package/registry/ui/toolbar.json +13 -0
  112. package/registry/ui/tooltip.json +16 -0
  113. package/registry/ui/tree.json +18 -0
  114. package/registry/ui/typeset.json +16 -0
  115. package/registry/ui/youtube-embed.json +16 -0
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "resizable",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "Resizable"
7
+ ],
8
+ "source": {
9
+ "path": "resizable.tsx",
10
+ "content": "/**\n * A split-pane layout arranging {@link Resizable.Panel} and\n * {@link Resizable.Handle} parts along a shared axis, each panel taking up\n * its own declared share of the group's main axis and each handle between\n * two panels reserving a fixed track across the cross axis. Every part\n * mirrors the root's orientation onto itself through component context, so a\n * panel's own minimum and maximum share and a handle's cursor and track both\n * switch axis together without a consumer repeating the orientation on each\n * one.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, border, fg, outline, outlineStyle } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor, pseudoContent, touchAction, userSelect } from \"@sdxc/u/general\";\nimport {\n\tbasis,\n\tflex,\n\tflexCol,\n\tflexRow,\n\tgrow,\n\titems,\n\tjustify,\n\trelative,\n\tshrink,\n} from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { bs, is, maxBs, maxIs, minBs, minIs } from \"@sdxc/u/size\";\nimport { before, data, focusVisible, hover, when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { hitArea } from \"@sdxc/ui/styles\";\nimport { mergeStyle } from \"@sdxc/ui/utils\";\n\n/** Default {@link Resizable.Props} orientation, applied when `orientation` is omitted. */\nconst DEFAULT_ORIENTATION: Resizable.Orientation = \"horizontal\";\n\n/** `role=\"separator\"` applied to {@link Resizable.Handle} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_HANDLE_ROLE = \"separator\";\n\n/**\n * Default {@link Resizable.HandleProps} tab index, applied through\n * {@link attrs} unless a consumer supplies its own, keeping a handle\n * reachable in Tab order per the WAI-ARIA window splitter pattern.\n */\nconst DEFAULT_HANDLE_TAB_INDEX = 0;\n\n/**\n * Prop types for {@link Resizable} and its compound parts.\n */\nexport namespace Resizable {\n\t/**\n\t * Axis the panels lay out along: a row of panels side by side, or a\n\t * column of panels stacked one above another.\n\t */\n\texport type Orientation = \"horizontal\" | \"vertical\";\n\n\t/**\n\t * Value {@link Resizable} stores in component context so every\n\t * {@link Resizable.Panel} and {@link Resizable.Handle} nested inside reads\n\t * the same axis for its own `data-orientation`, sizing, and cursor.\n\t */\n\texport interface Context {\n\t\t/** The root's resolved layout axis. */\n\t\torientation: Orientation;\n\t}\n\n\t/**\n\t * Props accepted by {@link Resizable}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Layout axis. Defaults to {@link DEFAULT_ORIENTATION}. */\n\t\torientation?: Orientation;\n\t}\n\n\t/**\n\t * Props accepted by {@link Resizable.Panel}.\n\t */\n\texport interface PanelProps extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Starting share of the group's main axis, as a percentage (e.g. `30`\n\t\t * for 30%). Panels left without one split whatever share remains\n\t\t * evenly among themselves.\n\t\t */\n\t\tdefaultSize?: number;\n\t\t/**\n\t\t * Smallest share of the group's main axis this panel will shrink to,\n\t\t * as a percentage. Left unset, the panel can shrink down to nothing.\n\t\t */\n\t\tminSize?: number;\n\t\t/**\n\t\t * Largest share of the group's main axis this panel will grow to, as\n\t\t * a percentage. Left unset, the panel can grow up to the group's\n\t\t * entire main axis.\n\t\t */\n\t\tmaxSize?: number;\n\t}\n\n\t/**\n\t * Props accepted by {@link Resizable.Handle}. Its accessible name comes\n\t * entirely from `aria-label` or `aria-labelledby`; pair it with\n\t * `aria-controls` naming the panels on either side.\n\t */\n\texport interface HandleProps extends TagProps<\"div\"> {}\n}\n\n/**\n * Renders the root host: a `<div>` laying {@link Resizable.Panel} and\n * {@link Resizable.Handle} children out in a row, or a column when\n * `orientation` is `\"vertical\"`, sharing the resolved axis through context; set `aria-disabled=\"true\"` to dim the whole group.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props and providing {@link Resizable.Context}.\n * @returns The render function producing the root's markup.\n * @example\n * <Resizable aria-label={t(\"layout.panes\")}>\n * \t<Resizable.Panel id=\"sidebar\" defaultSize={30} minSize={15}>\n * \t\t{t(\"layout.sidebar\")}\n * \t</Resizable.Panel>\n * \t<Resizable.Handle aria-label={t(\"layout.resizeSidebar\")} aria-controls=\"sidebar main\" />\n * \t<Resizable.Panel id=\"main\" defaultSize={70}>\n * \t\t{t(\"layout.main\")}\n * \t</Resizable.Panel>\n * </Resizable>\n * @example\n * <Resizable orientation=\"vertical\" aria-label={t(\"layout.panes\")}>\n * \t<Resizable.Panel defaultSize={60}>{t(\"layout.top\")}</Resizable.Panel>\n * \t<Resizable.Handle aria-label={t(\"layout.resizeVertically\")} />\n * \t<Resizable.Panel defaultSize={40}>{t(\"layout.bottom\")}</Resizable.Panel>\n * </Resizable>\n */\nexport function Resizable(handle: Handle<Resizable.Props, Resizable.Context>) {\n\treturn () => {\n\t\tlet { orientation, mix, ...rest } = handle.props;\n\t\tlet resolvedOrientation = orientation ?? DEFAULT_ORIENTATION;\n\n\t\thandle.context.set({ orientation: resolvedOrientation });\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-orientation={resolvedOrientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexRow(),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\toverflow(\"hidden\"),\n\t\t\t\t\twhen('&[data-orientation=\"vertical\"]', flexCol()),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', opacity(70)),\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tborder({ color: \"neutral\", width: 1 }),\n\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders a single pane: a `<div>` that grows and shrinks to fill its share\n * of the group's main axis, clipping overflow with scrolling. Each of\n * `defaultSize`/`minSize`/`maxSize` lives on a `--ui-resizable-panel-*` custom property a pointer-tracking behavior can update to resize it live.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the pane's markup.\n * @example\n * <Resizable.Panel defaultSize={30} minSize={15} maxSize={50}>\n * \t{t(\"layout.sidebar\")}\n * </Resizable.Panel>\n */\nResizable.Panel = function ResizablePanel(handle: Handle<Resizable.PanelProps>) {\n\treturn () => {\n\t\tlet { mix, style, defaultSize, minSize, maxSize, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Resizable);\n\n\t\tlet resolvedStyle = mergeStyle(style, {\n\t\t\t\"--ui-resizable-panel-size\": defaultSize == null ? null : `${defaultSize}%`,\n\t\t\t\"--ui-resizable-panel-min-size\": minSize == null ? null : `${minSize}%`,\n\t\t\t\"--ui-resizable-panel-max-size\": maxSize == null ? null : `${maxSize}%`,\n\t\t});\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-orientation={context.orientation}\n\t\t\t\tdata-default-size={defaultSize}\n\t\t\t\tdata-min-size={minSize}\n\t\t\t\tdata-max-size={maxSize}\n\t\t\t\t{...rest}\n\t\t\t\tstyle={resolvedStyle}\n\t\t\t\tmix={[\n\t\t\t\t\tgrow(),\n\t\t\t\t\tshrink(1),\n\t\t\t\t\tbasis(\"var(--ui-resizable-panel-size, 0%)\"),\n\t\t\t\t\tminBs(0),\n\t\t\t\t\tminIs(0),\n\t\t\t\t\tdata(\"orientation\", \"horizontal\", [\n\t\t\t\t\t\tminIs(\"var(--ui-resizable-panel-min-size, 0%)\"),\n\t\t\t\t\t\tmaxIs(\"var(--ui-resizable-panel-max-size, 100%)\"),\n\t\t\t\t\t]),\n\t\t\t\t\tdata(\"orientation\", \"vertical\", [\n\t\t\t\t\t\tminBs(\"var(--ui-resizable-panel-min-size, 0%)\"),\n\t\t\t\t\t\tmaxBs(\"var(--ui-resizable-panel-max-size, 100%)\"),\n\t\t\t\t\t]),\n\t\t\t\t\toverflow(\"auto\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a draggable divider between two adjacent panels: a\n * `role=\"separator\"` `<div>` reachable in Tab order, its bar darkening on\n * hover and ready for `&[data-resizing]` to color it during a drag. Its accessible name comes entirely from `aria-label`/`aria-labelledby`, paired with `aria-controls` naming the panels it resizes.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the handle's markup.\n * @example\n * <Resizable.Handle aria-label={t(\"layout.resizeSidebar\")} aria-controls=\"sidebar main\" />\n * @example\n * <Resizable.Handle aria-label={t(\"layout.resizeSidebar\")} aria-disabled=\"true\" />\n */\nResizable.Handle = function ResizableHandle(handle: Handle<Resizable.HandleProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Resizable);\n\n\t\tif (import.meta.env.DEV && !rest[\"aria-label\"] && !rest[\"aria-labelledby\"]) {\n\t\t\tconsole.warn(\n\t\t\t\t\"Resizable.Handle: a resize handle with no `aria-label` or `aria-labelledby` needs one describing what it resizes — assistive technology has no accessible name to announce otherwise.\",\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-orientation={context.orientation}\n\t\t\t\taria-orientation={context.orientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_HANDLE_ROLE, tabIndex: DEFAULT_HANDLE_TAB_INDEX }),\n\t\t\t\t\trelative(),\n\t\t\t\t\tflex(),\n\t\t\t\t\tgrow(0),\n\t\t\t\t\tshrink(0),\n\t\t\t\t\tbasis(\"var(--ui-resizable-handle-size, 0.75rem)\"),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\tuserSelect(),\n\t\t\t\t\ttouchAction(),\n\t\t\t\t\toutlineStyle(\"none\"),\n\t\t\t\t\twhen('&[data-orientation=\"horizontal\"]', cursor(\"col-resize\")),\n\t\t\t\t\twhen('&[data-orientation=\"vertical\"]', cursor(\"row-resize\")),\n\t\t\t\t\tbefore(pseudoContent('\"\"')),\n\t\t\t\t\tdata(\"orientation\", \"horizontal\", before([bs(\"2.5rem\"), is(\"0.125rem\")])),\n\t\t\t\t\tdata(\"orientation\", \"vertical\", before([bs(\"0.125rem\"), is(\"2.5rem\")])),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', [cursor(\"not-allowed\"), opacity(50)]),\n\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\twhen(\"&::before\", [rounded(\"full\"), bg(\"neutral.border\")]),\n\t\t\t\t\thover(when(\"&::before\", bg(\"neutral.strong\"))),\n\t\t\t\t\twhen(\"&[data-resizing]::before\", bg(\"brand.solid\")),\n\t\t\t\t\tfocusVisible(outline({ color: \"brand.ring\" })),\n\t\t\t\t\t/**\n\t\t\t\t\t * The handle's thin axis grows to `--ui-target-size` through an invisible box\n\t\t\t\t\t * over the panels' edges, leaving the layout and the drawn line unchanged.\n\t\t\t\t\t */\n\t\t\t\t\thitArea(),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
11
+ },
12
+ "test": null
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "scroll-area",
3
+ "changedIn": "2026.10.2",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "ScrollArea"
7
+ ],
8
+ "source": {
9
+ "path": "scroll-area.tsx",
10
+ "content": "/**\n * A scrollable region wrapping long or overflowing content — a chat log, a\n * table, a tall list — so it scrolls its own axis inside a bordered panel\n * instead of pushing the surrounding page. {@link ScrollArea.Viewport} is the\n * element that actually scrolls; the root only supplies the panel's border\n * and rounding.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, border, outline } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { raw } from \"@sdxc/u/general\";\nimport { relative } from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { media } from \"@sdxc/u/responsive\";\nimport { bs, is } from \"@sdxc/u/size\";\nimport { data, hover, when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { panelChrome } from \"@sdxc/ui/styles\";\n\n/**\n * Native tab-stop order applied to {@link ScrollArea.Viewport} through\n * {@link attrs} unless a consumer supplies its own `tabIndex`, keeping it\n * reachable via keyboard even when none of its content is focusable.\n */\nconst DEFAULT_TAB_INDEX = 0;\n\n/**\n * Default {@link ScrollArea.Viewport} axis, applied whenever a consumer\n * omits `orientation`.\n */\nconst DEFAULT_ORIENTATION: ScrollArea.Orientation = \"vertical\";\n\n/**\n * Prop types for {@link ScrollArea} and its compound parts.\n */\nexport namespace ScrollArea {\n\t/**\n\t * Axis {@link ScrollArea.Viewport} scrolls along: only the block axis\n\t * (`\"vertical\"`), only the inline axis (`\"horizontal\"`), or both at once\n\t * (`\"both\"`).\n\t */\n\texport type Orientation = \"vertical\" | \"horizontal\" | \"both\";\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * `orientation` defaults to {@link DEFAULT_ORIENTATION}; `tabIndex` defaults\n\t * to {@link DEFAULT_TAB_INDEX}, overridable to `-1` when content is reachable.\n\t */\n\texport interface ViewportProps extends TagProps<\"div\"> {\n\t\t/** Axis the viewport scrolls along. Defaults to {@link DEFAULT_ORIENTATION}. */\n\t\torientation?: Orientation;\n\t}\n}\n\n/**\n * Renders the scroll area's outer panel: a relatively positioned, rounded,\n * bordered `<div>` that frames whatever {@link ScrollArea.Viewport} scrolls\n * inside it, staying a fixed border around the scrolling content.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the panel's markup.\n * @example\n * <ScrollArea>\n * \t<ScrollArea.Viewport>\n * \t\t<p>{t(\"changelog.body\")}</p>\n * \t</ScrollArea.Viewport>\n * </ScrollArea>\n */\nexport function ScrollArea(handle: Handle<ScrollArea.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <div {...rest} data-slot=\"scroll-area\" mix={[panelChrome(), relative(), mix]} />;\n\t};\n}\n\n/**\n * Renders the scroll area's scrolling surface: a `<div>` filling its parent\n * panel, clipping and scrolling along the axis named by `data-orientation`\n * with a thin native scrollbar that gains a focus ring when focus-visible.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the viewport's markup.\n * @example\n * <ScrollArea.Viewport>\n * \t<Table>...</Table>\n * </ScrollArea.Viewport>\n * @example\n * <ScrollArea.Viewport orientation=\"horizontal\">\n * \t<Toolbar aria-label={t(\"gallery.filmstrip\")}>...</Toolbar>\n * </ScrollArea.Viewport>\n */\nScrollArea.Viewport = function ScrollAreaViewport(handle: Handle<ScrollArea.ViewportProps>) {\n\treturn () => {\n\t\tlet { orientation, mix, ...rest } = handle.props;\n\t\tlet resolvedOrientation = orientation ?? DEFAULT_ORIENTATION;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-orientation={resolvedOrientation}\n\t\t\t\tdata-slot=\"viewport\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ tabIndex: DEFAULT_TAB_INDEX }),\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\tbs(\"full\"),\n\t\t\t\t\traw({\n\t\t\t\t\t\tscrollBehavior: \"smooth\",\n\t\t\t\t\t\tscrollbarWidth: \"thin\",\n\t\t\t\t\t\tscrollbarGutter: \"stable\",\n\t\t\t\t\t}),\n\t\t\t\t\tdata(\"orientation\", \"vertical\", raw({ overflowBlock: \"auto\", overflowInline: \"hidden\" })),\n\t\t\t\t\tdata(\n\t\t\t\t\t\t\"orientation\",\n\t\t\t\t\t\t\"horizontal\",\n\t\t\t\t\t\traw({ overflowInline: \"auto\", overflowBlock: \"hidden\" }),\n\t\t\t\t\t),\n\t\t\t\t\tdata(\"orientation\", \"both\", overflow(\"auto\")),\n\t\t\t\t\twhen(\"&::-webkit-scrollbar\", raw({ width: \"0.75rem\", height: \"0.75rem\" })),\n\t\t\t\t\twhen(\"&::-webkit-scrollbar-track\", bg(\"transparent\")),\n\t\t\t\t\twhen(\"&::-webkit-scrollbar-thumb\", [\n\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\tbg(\"neutral.border\"),\n\t\t\t\t\t\tborder({ color: \"transparent\", width: \"3px\" }),\n\t\t\t\t\t\traw({ backgroundClip: \"content-box\" }),\n\t\t\t\t\t\thover(bg(\"neutral.strong\")),\n\t\t\t\t\t]),\n\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", raw({ scrollBehavior: \"auto\" })),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
11
+ },
12
+ "test": null
13
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "search-field",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [
5
+ "button",
6
+ "input"
7
+ ],
8
+ "exports": [
9
+ "SearchField"
10
+ ],
11
+ "source": {
12
+ "path": "search-field.tsx",
13
+ "content": "/**\n * A single-line search field: a `<search>` landmark stacking a caption, a\n * decorated control, and optional supporting or validation copy, composed\n * from whatever compound parts a given field needs. Its own\n * {@link SearchField.Input} part pairs a leading glyph with the native\n * `<input type=\"search\">` control it decorates, building on {@link Input} for\n * that control's box, color, and state styling, and\n * {@link SearchField.Control} rows that input with the\n * {@link SearchField.Clear} button that empties it.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { SearchIcon, XIcon } from \"@sdxc/icons\";\nimport { fg } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { pointerEvents } from \"@sdxc/u/general\";\nimport {\n\tabsolute,\n\tappearance,\n\tflex,\n\tgrow,\n\thidden,\n\tinsBs,\n\tinsIe,\n\tinsIs,\n\titems,\n\trelative,\n} from \"@sdxc/u/layout\";\nimport { bs, is, p, pis } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { translateY } from \"@sdxc/u/transform\";\n\nimport { clearField, SEARCH_FIELD_CLEAR_COMMAND } from \"@sdxc/ui/mixins\";\nimport { fieldStackLayout } from \"@sdxc/ui/styles\";\n\nimport { Button } from \"@sdxc/ui/button\";\nimport { Input } from \"@sdxc/ui/input\";\n\n/**\n * Prop types for {@link SearchField} and its compound parts.\n */\nexport namespace SearchField {\n\t/**\n\t * Every native `<search>` attribute, unchanged, plus the `mix` passthrough.\n\t * `children` composes this field's parts — typically a caption, the\n\t * {@link SearchField.Input} control, and validation copy — in a single column.\n\t */\n\texport interface Props extends TagProps<\"search\"> {\n\t\t/** The field's compound parts: a caption, the control, and any supporting or validation copy. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Every prop {@link Input} accepts except `type`, `list`, and `role`,\n\t * which this control fixes to `\"search\"` and the platform's own implicit\n\t * `searchbox` role on the consumer's behalf, plus the `mix` passthrough.\n\t */\n\texport interface InputProps extends Omit<Input.Props, \"type\" | \"list\" | \"role\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * `children` holds one control row: the {@link SearchField.Input} and the\n\t * {@link SearchField.Clear} button that empties it.\n\t */\n\texport interface ControlProps extends TagProps<\"div\"> {\n\t\t/** The row's contents: the search input, and the clear button reading it. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Every prop {@link Button} accepts except `type`, `variant`, `size`, and\n\t * `command`, which this control fixes on the consumer's behalf, plus the\n\t * `mix` passthrough.\n\t */\n\texport interface ClearProps extends Omit<\n\t\tButton.Props,\n\t\t\"type\" | \"variant\" | \"size\" | \"command\" | \"children\"\n\t> {\n\t\t/** The `id` of the input this button empties, naming the control it belongs to. */\n\t\tcommandfor: string;\n\t\t/** Glyph or label the button shows. Defaults to a decorative {@link XIcon}. */\n\t\tchildren?: RemixNode;\n\t}\n}\n\n/**\n * Renders a `<search>` landmark — the platform's own role for a search\n * region, needing no explicit `role` attribute — stacking a caption,\n * {@link SearchField.Input}, and validation copy in a single column.\n *\n * @param handle Runtime handle carrying the host `<search>`'s props.\n * @returns The render function producing the field's markup.\n * @example\n * <SearchField>\n * \t<Label htmlFor=\"site-search\">{t(\"search.label\")}</Label>\n * \t<SearchField.Input id=\"site-search\" name=\"q\" placeholder={t(\"search.placeholder\")} />\n * </SearchField>\n * @example\n * <SearchField aria-label={t(\"search.label\")}>\n * \t<SearchField.Input name=\"q\" />\n * </SearchField>\n */\nexport function SearchField(handle: Handle<SearchField.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <search {...rest} data-slot=\"search-field\" mix={[fieldStackLayout(), mix]} />;\n\t};\n}\n\n/**\n * Renders {@link SearchField}'s control: a positioning wrapper pairing a\n * muted, decorative {@link SearchIcon} with a native `<input type=\"search\">`\n * built on {@link Input}, inheriting its box, color, and state styling.\n *\n * The user agent's own cancel affordance is suppressed, so clearing the field is\n * {@link SearchField.Clear}'s job — one glyph the field styles and places, sitting\n * alone in the trailing corner.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <SearchField.Input aria-label={t(\"search.label\")} placeholder={t(\"search.placeholder\")} />\n * @example\n * <SearchField.Input name=\"q\" color=\"brand\" defaultValue=\"remix\" />\n */\nSearchField.Input = function SearchFieldInput(handle: Handle<SearchField.InputProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div data-slot=\"input-wrapper\" mix={[relative(), flex(), items(\"center\")]}>\n\t\t\t\t<SearchIcon\n\t\t\t\t\tsize={16}\n\t\t\t\t\tdata-slot=\"icon\"\n\t\t\t\t\tmix={[absolute(), insIs(\"0.75rem\"), pointerEvents(), fg(\"neutral.muted\")]}\n\t\t\t\t/>\n\t\t\t\t<Input\n\t\t\t\t\ttype=\"search\"\n\t\t\t\t\t{...rest}\n\t\t\t\t\tmix={[\n\t\t\t\t\t\tpis(\"2.25rem\"),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * {@link SearchField.Clear} draws the clear affordance, so the one the user agent draws\n\t\t\t\t\t\t * inside a search input holding a value is hidden to keep the two from stacking.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen(\"&::-webkit-search-cancel-button\", [appearance(\"none\"), hidden()]),\n\t\t\t\t\t\twhen(\"&::-webkit-search-decoration\", [appearance(\"none\"), hidden()]),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t]}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders the row holding {@link SearchField.Input} and the\n * {@link SearchField.Clear} button beside it, and the positioning context that\n * anchors the clear button to the input's trailing edge.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the control row's markup.\n * @example\n * <SearchField.Control>\n * \t<SearchField.Input id=\"site-search\" name=\"q\" />\n * \t<SearchField.Clear commandfor=\"site-search\" aria-label={t(\"search.clear\")} />\n * </SearchField.Control>\n */\nSearchField.Control = function SearchFieldControl(handle: Handle<SearchField.ControlProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"control\"\n\t\t\t\tmix={[\n\t\t\t\t\trelative(),\n\t\t\t\t\tflex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * The input spans the row, so the field keeps the width its container offers.\n\t\t\t\t\t */\n\t\t\t\t\twhen('& > [data-slot=\"input-wrapper\"]', grow()),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link SearchField}'s clear button: a round, icon-sized ghost\n * {@link Button} centred on the input's trailing edge, carrying `clearField()`\n * so it empties the `commandfor` input it names and shows while that input holds text.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the clear button's markup.\n * @example\n * <SearchField.Clear commandfor=\"site-search\" aria-label={t(\"search.clear\")} />\n * @example\n * <SearchField.Clear commandfor=\"site-search\">{t(\"search.clear\")}</SearchField.Clear>\n */\nSearchField.Clear = function SearchFieldClear(handle: Handle<SearchField.ClearProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\ttype=\"button\"\n\t\t\t\t{...rest}\n\t\t\t\thidden\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\tcommand={SEARCH_FIELD_CLEAR_COMMAND}\n\t\t\t\tdata-slot=\"clear\"\n\t\t\t\tmix={[\n\t\t\t\t\tclearField(),\n\t\t\t\t\t/**\n\t\t\t\t\t * A round, icon-sized target centred on the field, so its hover tint reads as a\n\t\t\t\t\t * disc beside the text, and its glyph sits as far from the trailing edge as the\n\t\t\t\t\t * search glyph sits from the leading one.\n\t\t\t\t\t */\n\t\t\t\t\tis(7),\n\t\t\t\t\tbs(7),\n\t\t\t\t\tp(0),\n\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\tabsolute(),\n\t\t\t\t\tinsIe(\"0.375rem\"),\n\t\t\t\t\tinsBs(\"50%\"),\n\t\t\t\t\ttranslateY(\"-50%\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children ?? <XIcon size={16} />}\n\t\t\t</Button>\n\t\t);\n\t};\n};\n"
14
+ },
15
+ "test": null
16
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "section",
3
+ "changedIn": "2026.10.2",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "Section"
7
+ ],
8
+ "source": {
9
+ "path": "section.tsx",
10
+ "content": "/**\n * A grouping wrapper for a set of related items inside a listbox, menu, or\n * combobox — a native `<section>` element carrying the small block-axis\n * padding that sets one group apart from the next. Pairing it with a\n * `Header` as its first child gives the group a visible label.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { pb } from \"@sdxc/u/size\";\n\n/**\n * Props accepted by {@link Section}.\n */\nexport namespace Section {\n\t/**\n\t * Every native `<section>` attribute, unchanged, plus the `mix`\n\t * passthrough. Content is whatever `children` the consumer supplies,\n\t * most often a `Header` label followed by the group's items.\n\t */\n\texport interface Props extends TagProps<\"section\"> {}\n}\n\n/**\n * Renders its children inside a `<section>` element with small block-axis\n * padding, separating one group of items from its siblings inside a\n * listbox, menu, or combobox; pair it with a `Header` to label the group.\n *\n * @param handle Runtime handle carrying the host `<section>`'s props.\n * @returns The render function producing the group's markup.\n * @example\n * <Section aria-labelledby=\"account-heading\">\n * \t<Header id=\"account-heading\">{t(\"settings.account\")}</Header>\n * \t<ListBox.Item id=\"profile\">{t(\"settings.profile\")}</ListBox.Item>\n * \t<ListBox.Item id=\"billing\">{t(\"settings.billing\")}</ListBox.Item>\n * </Section>\n */\nexport function Section(handle: Handle<Section.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <section {...rest} mix={[pb(\"0.25rem\"), mix]} />;\n\t};\n}\n"
11
+ },
12
+ "test": null
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "select",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "Select"
7
+ ],
8
+ "source": {
9
+ "path": "select.tsx",
10
+ "content": "/**\n * A native `<select>` styled as a bordered, rounded field and progressively\n * upgraded with customizable-select rendering — a custom trigger button, a\n * value slot mirroring the current selection, and richly styled options and\n * groups — wherever the browser resolves `appearance: base-select`. The\n * trigger, value, and picker styling layer on top of ordinary\n * `<option>`/`<optgroup>` markup, so every browser renders a working\n * dropdown from that same markup.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { ChevronDownIcon } from \"@sdxc/icons\";\nimport { bg, border, borderEdge, fg, outline, outlineStyle, outlineWidth } from \"@sdxc/u/color\";\nimport {\n\topacity,\n\trounded,\n\ttransition,\n\ttransitionBehavior,\n\ttransitionDuration,\n} from \"@sdxc/u/effects\";\nimport { cursor, raw } from \"@sdxc/u/general\";\nimport {\n\tappearance,\n\tbasis,\n\tflex,\n\tgap,\n\tgrow,\n\tinlineFlex,\n\tinset,\n\titems,\n\tjustify,\n\tshrink,\n} from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { media, startingStyle } from \"@sdxc/u/responsive\";\nimport { bs, is, m, maxBs, p, pb, pi } from \"@sdxc/u/size\";\nimport { data, hover, when } from \"@sdxc/u/state\";\nimport { text, textAlign, truncate } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { durations } from \"@sdxc/ui/animations\";\nimport { mirrorSelectedOption } from \"@sdxc/ui/mixins\";\nimport { floatingSurface, surfaceInset } from \"@sdxc/ui/styles\";\n\n/**\n * The `<selectedcontent>` element mirrors the currently selected\n * `<option>`'s rendered content inside a customized `<select>`'s trigger\n * button, its attribute shape declared here to match a plain `<span>`'s.\n */\ndeclare global {\n\tnamespace JSX {\n\t\tinterface IntrinsicHTMLElements {\n\t\t\tselectedcontent: IntrinsicHTMLElements[\"span\"];\n\t\t}\n\t}\n}\n\n/** Semantic color role {@link Select} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: Select.Color = \"neutral\";\n\n/**\n * `type` {@link Select.Trigger} falls back to when a consumer doesn't supply\n * one, keeping a click on the trigger from submitting a surrounding `<form>`\n * the way a bare `<button>`'s default type otherwise would.\n */\nconst DEFAULT_TRIGGER_TYPE: NonNullable<Select.TriggerProps[\"type\"]> = \"button\";\n\n/**\n * `aria-hidden` applied through {@link attrs} to {@link Select.Trigger}'s\n * default chevron glyph unless a consumer overrides it, keeping the\n * decorative icon out of the accessibility tree.\n */\nconst DEFAULT_ICON_ARIA_HIDDEN = \"true\";\n\n/**\n * Prop types for {@link Select} and its compound parts.\n */\nexport namespace Select {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` variables.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Every native `<select>` attribute, unchanged, plus the `mix` passthrough.\n\t * `multiple` and a `size` greater than `1` remain functional but switch\n\t * rendering back to the plain list-box; `role` is already implicit.\n\t */\n\t/**\n\t * `value` and `defaultValue` are left out on purpose. A `<select>` takes its selection\n\t * from the option carrying `selected` and nothing else reads either attribute, so a\n\t * value passed here goes unread and the field quietly shows its first option. Mark the\n\t * option instead: `<Select.Option value=\"eu\" selected>`.\n\t */\n\texport interface Props extends Omit<TagProps<\"select\">, \"role\" | \"defaultValue\" | \"value\"> {\n\t\t/** Semantic color role for the focus-visible ring. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t}\n\n\t/**\n\t * Every native `<button>` attribute, unchanged, plus the `mix` passthrough.\n\t * `type` defaults to {@link DEFAULT_TRIGGER_TYPE}.\n\t */\n\texport interface TriggerProps extends TagProps<\"button\"> {}\n\n\t/**\n\t * Every attribute a plain `<span>` accepts, unchanged, plus the `mix`\n\t * passthrough. Any `children` supplied render as a fallback in browsers\n\t * treating `<selectedcontent>` as unknown — see {@link Select.Value}.\n\t */\n\texport interface ValueProps extends TagProps<\"selectedcontent\"> {}\n\n\t/**\n\t * Every native `<option>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface OptionProps extends TagProps<\"option\"> {}\n\n\t/**\n\t * Every native `<optgroup>` attribute, unchanged, plus the `mix`\n\t * passthrough.\n\t */\n\texport interface GroupProps extends TagProps<\"optgroup\"> {}\n}\n\n/**\n * Renders a native `<select>` styled as a bordered, rounded field that\n * progressively upgrades to customizable-select rendering via\n * `appearance: base-select`, falling back to the platform's own dropdown.\n *\n * @param handle Runtime handle carrying the host `<select>`'s props.\n * @returns The render function producing the field's markup.\n * @example\n * <Select aria-label={t(\"form.country.label\")} required>\n * \t<Select.Option value=\"\">{t(\"form.country.placeholder\")}</Select.Option>\n * \t<Select.Option value=\"us\">{t(\"countries.us\")}</Select.Option>\n * \t<Select.Option value=\"ca\">{t(\"countries.ca\")}</Select.Option>\n * </Select>\n * @example\n * <Select aria-label={t(\"form.plan.label\")} color=\"brand\">\n * \t<Select.Trigger />\n * \t<Select.Group label={t(\"form.plan.groups.personal\")}>\n * \t\t<Select.Option value=\"free\">{t(\"plans.free\")}</Select.Option>\n * \t\t<Select.Option value=\"pro\">{t(\"plans.pro\")}</Select.Option>\n * \t</Select.Group>\n * </Select>\n */\nexport function Select(handle: Handle<Select.Props>) {\n\treturn () => {\n\t\tlet { color, multiple, size, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\tif (import.meta.env.DEV && (multiple || (typeof size === \"number\" && size > 1))) {\n\t\t\tconsole.warn(\n\t\t\t\t\"Select: `appearance: base-select` styling has no effect on a `multiple` select or one with a `size` greater than 1 — the browser keeps its plain list-box rendering there instead of the customized trigger, value, and option styling.\",\n\t\t\t);\n\t\t}\n\n\t\tlet fieldMix = [\n\t\t\tflex(),\n\t\t\titems(\"center\"),\n\t\t\tjustify(\"between\"),\n\t\t\tcursor(\"default\"),\n\t\t\ttext(\"sm\"),\n\t\t\t/**\n\t\t\t * Focus draws a ring standing off the field and the border steps only to its hover weight,\n\t\t\t * so the field keeps its shape. The pointer and keyboard selectors exclude each other because\n\t\t\t * `outline: none` is a shorthand that, from a later layer, resets the whole ring.\n\t\t\t */\n\t\t\twhen(\"&:focus:not(:focus-visible)\", outline(\"none\")),\n\t\t\twhen(\"&:focus-visible\", [\n\t\t\t\tborder(\"neutral.border-hover\"),\n\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\tdata(\"color\", \"success\", outline(\"success.ring\")),\n\t\t\t\tdata(\"color\", \"warning\", outline(\"warning.ring\")),\n\t\t\t\tdata(\"color\", \"danger\", outline(\"danger.ring\")),\n\t\t\t]),\n\t\t\twhen('&[aria-invalid=\"true\"], &:user-invalid', [\n\t\t\t\toutlineWidth(\"2px\"),\n\t\t\t\toutlineStyle(\"solid\"),\n\t\t\t\traw({ outlineOffset: \"2px\" }),\n\t\t\t]),\n\t\t\twhen(\"&:disabled\", [cursor(\"not-allowed\"), opacity(50)]),\n\n\t\t\twhen(\"&::picker(select)\", [\n\t\t\t\tfloatingSurface(),\n\t\t\t\tsurfaceInset(),\n\t\t\t\tm(0),\n\t\t\t\tinset(\"auto\"),\n\t\t\t\tmaxBs(\"15rem\"),\n\t\t\t\toverflow(\"auto\"),\n\t\t\t\toutline(\"none\"),\n\t\t\t\topacity(0),\n\t\t\t\ttransition(\"opacity, display, overlay\", { duration: durations.fast }),\n\t\t\t\ttransitionBehavior(\"allow-discrete\"),\n\t\t\t]),\n\t\t\twhen(\"&:open::picker(select)\", opacity(100)),\n\t\t\tstartingStyle(when(\"&:open::picker(select)\", opacity(0))),\n\t\t\tmedia(\n\t\t\t\t\"(prefers-reduced-motion: reduce)\",\n\t\t\t\twhen(\"&::picker(select)\", transitionDuration(\"0s\")),\n\t\t\t),\n\t\t\traw({\n\t\t\t\t\"&:open\": {\n\t\t\t\t\t'& [data-slot=\"icon\"]': {\n\t\t\t\t\t\ttransform: \"rotate(180deg)\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t\"&:has(option:checked:disabled)\": {\n\t\t\t\t\t\"& selectedcontent\": {\n\t\t\t\t\t\tcolor: \"var(--ui-neutral-fg-muted)\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t\tgap(\"0.5rem\"),\n\t\t\tis(\"full\"),\n\t\t\tbs(\"2.5rem\"),\n\t\t\trounded(\"md\"),\n\t\t\tborder({ color: \"neutral\", width: 1 }),\n\t\t\tbg(\"neutral.tint\"),\n\t\t\tfg(\"neutral.emphasis\"),\n\t\t\tpi(\"0.75rem\"),\n\t\t\tpb(\"0.5rem\"),\n\t\t\tappearance(\"base-select\"),\n\t\t\ttransition(\n\t\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter\",\n\t\t\t),\n\t\t\thover(border(\"neutral.border-hover\")),\n\t\t\twhen(\"&:focus\", border(\"neutral.border-hover\")),\n\t\t\twhen('&[aria-invalid=\"true\"], &:user-invalid', [\n\t\t\t\tborder(\"danger\"),\n\t\t\t\toutline({ color: \"danger.ring\", offset: 2 }),\n\t\t\t]),\n\t\t\twhen(\"&:disabled\", bg(\"neutral.bg-tint-hover\")),\n\t\t\traw({\n\t\t\t\t\"&::picker(select)\": {\n\t\t\t\t\tborderRadius: \"var(--ui-radius-lg, 0.5rem)\",\n\t\t\t\t\tborderWidth: \"1px\",\n\t\t\t\t\tborderStyle: \"solid\",\n\t\t\t\t\tborderColor: \"var(--ui-neutral-border)\",\n\t\t\t\t\tbackgroundColor: \"var(--ui-neutral-bg-tint)\",\n\t\t\t\t},\n\t\t\t\t\"&::picker-icon\": {\n\t\t\t\t\tcolor: \"var(--ui-neutral-fg-muted)\",\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmix,\n\t\t] as unknown as Select.Props[\"mix\"];\n\n\t\treturn (\n\t\t\t<select multiple={multiple} size={size} data-color={resolvedColor} {...rest} mix={fieldMix} />\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Select}'s customizable trigger: a native `<button>` placed\n * as {@link Select}'s first child, showing {@link Select.Value} and a\n * rotating chevron by default, filling the field's box edge to edge.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the trigger's markup.\n * @example\n * <Select.Trigger />\n * @example\n * <Select.Trigger>\n * \t<Select.Value>{t(\"form.plan.placeholder\")}</Select.Value>\n * </Select.Trigger>\n */\nSelect.Trigger = function SelectTrigger(handle: Handle<Select.TriggerProps>) {\n\treturn () => {\n\t\tlet { type, children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype={type ?? DEFAULT_TRIGGER_TYPE}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"between\"),\n\t\t\t\t\tgap(\"0.5rem\"),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\tbs(\"full\"),\n\t\t\t\t\tm(0),\n\t\t\t\t\tp(0),\n\t\t\t\t\tborder({ width: 0, style: \"none\" }),\n\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\tfg(\"inherit\"),\n\t\t\t\t\traw({ font: \"inherit\" }),\n\t\t\t\t\ttextAlign(\"start\"),\n\t\t\t\t\tcursor(\"inherit\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children ?? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Select.Value />\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tdata-slot=\"icon\"\n\t\t\t\t\t\t\tmix={[\n\t\t\t\t\t\t\t\tattrs({ \"aria-hidden\": DEFAULT_ICON_ARIA_HIDDEN }),\n\t\t\t\t\t\t\t\tinlineFlex(),\n\t\t\t\t\t\t\t\tshrink(),\n\t\t\t\t\t\t\t\ttransition(\"transform\"),\n\t\t\t\t\t\t\t\twhen(\"& svg\", [is(\"1rem\"), bs(\"1rem\")]),\n\t\t\t\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", transitionDuration(\"0s\")),\n\t\t\t\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ChevronDownIcon />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</button>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<selectedcontent>` element inside {@link Select.Trigger},\n * mirroring the currently selected {@link Select.Option}'s content via the\n * platform; `children` render as a fallback where it's treated as unknown.\n *\n * @param handle Runtime handle carrying the host element's props.\n * @returns The render function producing the value slot's markup.\n * @example\n * <Select.Value />\n * @example\n * <Select.Value>{t(\"form.plan.placeholder\")}</Select.Value>\n */\nSelect.Value = function SelectValue(handle: Handle<Select.ValueProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<selectedcontent\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tmirrorSelectedOption(),\n\t\t\t\t\tgrow(),\n\t\t\t\t\tshrink(1),\n\t\t\t\t\tbasis(\"0%\"),\n\t\t\t\t\ttruncate(),\n\t\t\t\t\ttextAlign(\"start\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<option>` styled for the rounded, padded row a\n * supporting browser shows inside {@link Select}'s `::picker(select)`\n * dropdown, reading its own hover, focus, checked, and disabled states.\n *\n * @param handle Runtime handle carrying the host `<option>`'s props.\n * @returns The render function producing the option's markup.\n * @example\n * <Select.Option value=\"us\">{t(\"countries.us\")}</Select.Option>\n * @example\n * <Select.Option value=\"\" disabled>{t(\"form.country.placeholder\")}</Select.Option>\n */\nSelect.Option = function SelectOption(handle: Handle<Select.OptionProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<option\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\tpi(\"0.75rem\"),\n\t\t\t\t\tpb(\"0.5rem\"),\n\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\toutline(\"none\"),\n\t\t\t\t\twhen(\"&:disabled\", opacity(50)),\n\t\t\t\t\twhen(\"&::checkmark\", fg(\"currentColor\")),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\ttransition(\n\t\t\t\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke\",\n\t\t\t\t\t),\n\t\t\t\t\twhen(\"&:hover\", bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\twhen(\"&:active\", bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\twhen(\"&:focus\", bg(\"brand.tint\")),\n\t\t\t\t\twhen(\"&:checked\", [bg(\"brand.solid\"), fg(\"brand.onSolid\")]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<optgroup>` styled as a padded run of\n * {@link Select.Option}s, set off from the group before it by a\n * block-start divider on every group after the first.\n *\n * @param handle Runtime handle carrying the host `<optgroup>`'s props.\n * @returns The render function producing the group's markup.\n * @example\n * <Select.Group label={t(\"form.plan.groups.personal\")}>\n * \t<Select.Option value=\"free\">{t(\"plans.free\")}</Select.Option>\n * \t<Select.Option value=\"pro\">{t(\"plans.pro\")}</Select.Option>\n * </Select.Group>\n */\nSelect.Group = function SelectGroup(handle: Handle<Select.GroupProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\tif (import.meta.env.DEV && !rest.label) {\n\t\t\tconsole.warn(\n\t\t\t\t\"Select.Group: an `optgroup` with no `label` renders with no visible heading for its options — pass a `label` describing the group.\",\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<optgroup\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:not(:first-child)\", borderEdge(\"block-start\", { width: 1 })),\n\t\t\t\t\tpb(\"0.25rem\"),\n\t\t\t\t\twhen(\"&:not(:first-child)\", border(\"neutral\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
11
+ },
12
+ "test": null
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "selection-indicator",
3
+ "changedIn": "2026.10.2",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "SelectionIndicator"
7
+ ],
8
+ "source": {
9
+ "path": "selection-indicator.tsx",
10
+ "content": "/**\n * A small marker that stays invisible, while still reserving its own layout\n * slot, until the element carrying it is the current selection. Anchors a\n * menu or listbox option's checkmark, a tab strip's active-tab underline, or\n * any similar per-item selection cue to a fixed spot so neighboring content\n * never reflows between the selected and unselected states.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { fg } from \"@sdxc/u/color\";\nimport { visibility } from \"@sdxc/u/effects\";\nimport { bs, is } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\n/**\n * `aria-hidden=\"true\"` applied through {@link attrs} unless a consumer\n * overrides it. The indicator restates a selection state already exposed\n * via `aria-selected`/`aria-current`, so assistive technology gains nothing.\n */\nconst DEFAULT_ARIA_HIDDEN = \"true\";\n\n/**\n * Prop types for {@link SelectionIndicator}.\n */\nexport namespace SelectionIndicator {\n\t/**\n\t * Every native `<div>` attribute, plus the `mix` passthrough. Selection\n\t * state reads directly from `aria-selected`/`aria-current` already set on\n\t * the host, so there is no separate boolean prop to duplicate it.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n}\n\n/**\n * Renders a marker that stays present in the layout at all times but only\n * becomes visible once its host carries `aria-selected=\"true\"` or a truthy\n * `aria-current`, so sibling content never reflows on selection change.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the indicator's markup.\n * @example\n * <Menu.Item aria-selected={isChecked}>\n * \t<SelectionIndicator aria-selected={isChecked}>\n * \t\t<CheckIcon />\n * \t</SelectionIndicator>\n * \t<Text slot=\"label\">{t(\"menu.autosave\")}</Text>\n * </Menu.Item>\n * @example\n * <Tabs.Trigger id=\"billing\" aria-selected={activeTab === \"billing\"}>\n * \t{t(\"settings.tabs.billing\")}\n * \t<SelectionIndicator\n * \t\taria-selected={activeTab === \"billing\"}\n * \t\tmix={css({ position: \"absolute\", insetBlockEnd: \"0\", insetInline: \"0\", blockSize: \"2px\" })}\n * \t/>\n * </Tabs.Trigger>\n */\nexport function SelectionIndicator(handle: Handle<SelectionIndicator.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ \"aria-hidden\": DEFAULT_ARIA_HIDDEN }),\n\t\t\t\t\tis(\"var(--ui-selection-indicator-size, 1rem)\"),\n\t\t\t\t\tbs(\"var(--ui-selection-indicator-size, 1rem)\"),\n\t\t\t\t\tfg(\"currentColor\"),\n\t\t\t\t\tvisibility(\"hidden\"),\n\t\t\t\t\twhen('&[aria-selected=\"true\"]', visibility()),\n\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', visibility()),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n"
11
+ },
12
+ "test": null
13
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "sentinel-row",
3
+ "changedIn": "2026.10.2",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "SentinelRow"
7
+ ],
8
+ "source": {
9
+ "path": "sentinel-row.tsx",
10
+ "content": "/**\n * A decorative sentinel row shared by every list-shaped compound component\n * that renders a trailing loading placeholder: a `<div>` styled as centered,\n * muted small text, sized to match its enclosing list's own row rhythm.\n * Every trailing-row part across these compound components assigns this\n * same implementation, keeping the markup, styling, and behavior identical.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { fg } from \"@sdxc/u/color\";\nimport { flex, items, justify } from \"@sdxc/u/layout\";\nimport { pb } from \"@sdxc/u/size\";\nimport { text } from \"@sdxc/u/typography\";\n\n/**\n * Renders a decorative sentinel row: a `<div>` styled as centered, muted\n * small text, ready to hold whatever loading indicator or \"load more\"\n * trigger a paired enhancement supplies as `children`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the sentinel row's markup.\n * @example\n * <ListBox.LoadMoreItem>{t(\"list.loadingMore\")}</ListBox.LoadMoreItem>\n */\nexport function SentinelRow(handle: Handle<TagProps<\"div\">>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\tpb(\"0.5rem\"),\n\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n"
11
+ },
12
+ "test": {
13
+ "path": "sentinel-row.test.tsx",
14
+ "content": "/**\n * Tests for {@link SentinelRow}: covers its base centered/muted styling,\n * merging a consumer-supplied `mix` alongside that styling, and forwarding\n * every other prop through to the rendered host `<div>`.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { css } from \"remix/component\";\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { SentinelRow } from \"@sdxc/ui/sentinel-row\";\n\ndescribe(SentinelRow.name, () => {\n\ttest(\"renders a div holding its children\", async () => {\n\t\tlet html = await renderToString(<SentinelRow>Loading more…</SentinelRow>);\n\n\t\texpect(html).toContain(\"<div\");\n\t\texpect(html).toContain(\"Loading more…\");\n\t});\n\n\ttest(\"applies its centered, muted sentinel styling\", async () => {\n\t\tlet html = await renderToString(<SentinelRow>Loading more…</SentinelRow>);\n\n\t\texpect(html).toContain(\"display: flex;\");\n\t\texpect(html).toContain(\"justify-content: center;\");\n\t\texpect(html).toContain(\"color: var(--ui-neutral-fg-muted);\");\n\t});\n\n\ttest(\"merges a consumer-supplied mix alongside its own styling\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<SentinelRow mix={css({ color: \"red\" })}>Loading more…</SentinelRow>,\n\t\t);\n\n\t\texpect(html).toContain(\"color: red;\");\n\t\texpect(html.match(/class=\"[^\"]*\\s[^\"]*\"/)).not.toBeNull();\n\t});\n\n\ttest(\"forwards arbitrary host props through to the rendered div\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<SentinelRow id=\"loading-row\" aria-live=\"polite\">\n\t\t\t\tLoading more…\n\t\t\t</SentinelRow>,\n\t\t);\n\n\t\texpect(html).toContain('id=\"loading-row\"');\n\t\texpect(html).toContain('aria-live=\"polite\"');\n\t});\n});\n"
15
+ }
16
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "separator",
3
+ "changedIn": "2026.10.2",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "Separator"
7
+ ],
8
+ "source": {
9
+ "path": "separator.tsx",
10
+ "content": "/**\n * A thin visual divider marking a boundary between two groups of content —\n * a menu's sections, a toolbar's clusters, a page's regions. It renders as\n * a single hairline element whose axis and length come from the semantic\n * border color and the orientation it carries.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg } from \"@sdxc/u/color\";\nimport { bs, is, minBs } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\n/**\n * ARIA role applied through {@link attrs} so the host `<div>` is announced\n * as a divider between content groups without requiring the consumer to\n * repeat it on every instance.\n */\nconst DEFAULT_ROLE = \"separator\";\n\n/**\n * Default `aria-orientation` value applied through {@link attrs}. Keeping\n * the accessibility attribute and the CSS variant selector on the same\n * value lets a consumer flip the axis by setting `aria-orientation=\"vertical\"`.\n */\nconst DEFAULT_ORIENTATION = \"horizontal\";\n\n/**\n * Props accepted by {@link Separator}.\n */\nexport namespace Separator {\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * Setting `aria-orientation=\"vertical\"` switches both the accessibility\n\t * contract and the rendered axis to a vertical divider.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n}\n\n/**\n * Renders a static hairline divider between two groups of content, carrying\n * the `separator` role and defaulting to a full-width horizontal line;\n * setting `aria-orientation=\"vertical\"` flips it to a full-height vertical line.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the divider's markup.\n * @example\n * <Separator />\n * @example\n * <Separator aria-orientation=\"vertical\" />\n */\nexport function Separator(handle: Handle<Separator.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_ROLE, \"aria-orientation\": DEFAULT_ORIENTATION }),\n\t\t\t\t\twhen('&[aria-orientation=\"horizontal\"]', [\n\t\t\t\t\t\tbs(\"var(--ui-separator-thickness, 1px)\"),\n\t\t\t\t\t\tis(\"100%\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('&[aria-orientation=\"vertical\"]', [\n\t\t\t\t\t\tbs(\"100%\"),\n\t\t\t\t\t\tminBs(\"var(--ui-separator-min-size, 1rem)\"),\n\t\t\t\t\t\tis(\"var(--ui-separator-thickness, 1px)\"),\n\t\t\t\t\t]),\n\t\t\t\t\tbg(\"neutral.border\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n"
11
+ },
12
+ "test": null
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "shared-element",
3
+ "changedIn": "2026.10.2",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "SharedElement"
7
+ ],
8
+ "source": {
9
+ "path": "shared-element.tsx",
10
+ "content": "/**\n * A plain host that carries a stable view-transition identity across\n * separate page loads, so a same-origin, cross-document navigation morphs it\n * from its old position, size, and appearance into its new one instead of\n * replacing it outright. Its identity comes straight from its own `id`,\n * matched against the same `id` on the corresponding element in the document\n * being navigated to or from — no script, snapshotting, or scope wrapper\n * required for this baseline.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { block } from \"@sdxc/u/layout\";\n\nimport { mergeStyle } from \"@sdxc/ui/utils\";\n\n/**\n * Written as plain CSS text inside a `<style>` element: `@view-transition`\n * accepts only descriptors, and `::view-transition-group(*)` selects from\n * the browser's own transition tree, both needing selectors written directly in CSS.\n */\nconst CROSS_DOCUMENT_TRANSITION_STYLESHEET = `\n@view-transition {\n\tnavigation: auto;\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t::view-transition-group(*) {\n\t\tanimation: none;\n\t}\n}\n`;\n\n/**\n * Prop types for {@link SharedElement}.\n */\nexport namespace SharedElement {\n\t/**\n\t * Props accepted by {@link SharedElement}: every native `<div>` attribute\n\t * plus the `mix` passthrough. `id` doubles as the view transition identity,\n\t * matched against the same `id` in the document navigated to or from.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n}\n\n/**\n * Renders a plain `<div>` host whose `view-transition-name` comes from its\n * own `id`, so a same-origin, cross-document navigation matching that `id`\n * on the other side morphs the element instead of replacing it outright.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the host's markup.\n * @example\n * // On the listing page\n * <SharedElement id={`cover-${book.slug}`}>\n * \t<img src={book.coverUrl} alt={book.title} />\n * </SharedElement>\n * @example\n * // On the book's own page — the matching `id` lets the browser morph\n * // between the two instead of swapping the image outright.\n * <SharedElement id={`cover-${book.slug}`}>\n * \t<img src={book.coverUrl} alt={book.title} />\n * </SharedElement>\n */\nexport function SharedElement(handle: Handle<SharedElement.Props>) {\n\treturn () => {\n\t\tlet { id, mix, style, ...rest } = handle.props;\n\n\t\tif (import.meta.env.DEV && !id) {\n\t\t\tconsole.warn(\n\t\t\t\t'SharedElement rendered without an \"id\" — the browser has nothing to match it against on the other side of a cross-document view transition.',\n\t\t\t);\n\t\t}\n\n\t\tlet resolvedStyle = mergeStyle(style, { \"view-transition-name\": id });\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<style>{CROSS_DOCUMENT_TRANSITION_STYLESHEET}</style>\n\t\t\t\t<div {...rest} id={id} style={resolvedStyle} mix={[block(), mix]} />\n\t\t\t</>\n\t\t);\n\t};\n}\n"
11
+ },
12
+ "test": null
13
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "sheet",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [
5
+ "dialog"
6
+ ],
7
+ "exports": [
8
+ "Sheet"
9
+ ],
10
+ "source": {
11
+ "path": "sheet.tsx",
12
+ "content": "/**\n * An edge-docked panel that renders through {@link Dialog} — the same native\n * `<dialog>` host, Invoker Commands, backdrop dimming, and missing-`id` dev\n * warning — repositioned from a centered panel to a fixed inline-side column\n * entirely through CSS keyed off a `data-side` attribute. Compound parts\n * cover a header, title, description, footer, and a dismiss control shaped\n * for a column-docked panel's own layout rather than a centered dialog's.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle } from \"remix/component\";\n\nimport { borderEdge, fg } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { vars, willChange } from \"@sdxc/u/general\";\nimport {\n\tfixed,\n\tflex,\n\tgap,\n\tinsBe,\n\tinsBs,\n\tinsLeft,\n\tinsRight,\n\titems,\n\tjustify,\n\tvstack,\n} from \"@sdxc/u/layout\";\nimport { is, m, maxBs, maxIs, mbs, paddingLeft, paddingRight, pbe, pbs } from \"@sdxc/u/size\";\nimport { data } from \"@sdxc/u/state\";\nimport { fontSize, pretty } from \"@sdxc/u/typography\";\n\nimport { durations, easings } from \"@sdxc/ui/animations\";\nimport { enterExit } from \"@sdxc/ui/animations\";\n\nimport { Dialog } from \"@sdxc/ui/dialog\";\n\n/**\n * Physical side of the viewport {@link Sheet} docks to when `side` is left\n * unset.\n */\nconst DEFAULT_SIDE: Sheet.Side = \"right\";\n\n/**\n * How far toward its side the panel drifts while it fades out on close: a\n * hint of the direction it came from, short of the full slide it entered with.\n */\nconst EXIT_DISTANCE = \"1rem\";\n\n/** Blur radius in pixels the panel softens to as it fades out. */\nconst EXIT_BLUR_PX = 4;\n\n/**\n * Prop types for {@link Sheet} and its compound parts.\n */\nexport namespace Sheet {\n\t/**\n\t * Physical side of the viewport the panel docks to and slides in from,\n\t * fixed rather than reading-direction-relative so it keeps docking to the\n\t * same edge under any `dir` value, matching the safe-area padding's edge.\n\t */\n\texport type Side = \"left\" | \"right\";\n\n\t/** Every prop {@link Dialog.Props} accepts, plus which side the panel docks to. */\n\texport interface Props extends Dialog.Props {\n\t\t/** Physical side of the viewport to dock to. Defaults to {@link DEFAULT_SIDE}. */\n\t\tside?: Side;\n\t}\n\n\t/** Every prop {@link Dialog.HeaderProps} accepts, unchanged. */\n\texport interface HeaderProps extends Dialog.HeaderProps {}\n\n\t/** Every prop {@link Dialog.TitleProps} accepts, unchanged. */\n\texport interface TitleProps extends Dialog.TitleProps {}\n\n\t/** Every prop {@link Dialog.DescriptionProps} accepts, unchanged. */\n\texport interface DescriptionProps extends Dialog.DescriptionProps {}\n\n\t/** Every prop {@link Dialog.FooterProps} accepts, unchanged. */\n\texport interface FooterProps extends Dialog.FooterProps {}\n\n\t/** Every prop {@link Dialog.CloseProps} accepts, unchanged. */\n\texport interface CloseProps extends Dialog.CloseProps {}\n}\n\n/**\n * Renders the panel through {@link Dialog}: fixed, pinned to whichever\n * inline edge `side` names with the far edge released to `auto`, and slid\n * via `@starting-style`/`allow-discrete` so the close animates too.\n *\n * @param handle Runtime handle carrying the host `<dialog>`'s props, plus `side`.\n * @returns The render function producing the panel's markup.\n * @example\n * <Button commandfor=\"cart\" command=\"show-modal\">{t(\"cart.open\")}</Button>\n * <Sheet id=\"cart\" side=\"right\" aria-labelledby=\"cart-title\">\n * \t<Sheet.Header>\n * \t\t<Sheet.Title id=\"cart-title\">{t(\"cart.title\")}</Sheet.Title>\n * \t\t<Sheet.Description>{t(\"cart.description\")}</Sheet.Description>\n * \t</Sheet.Header>\n * \t<Sheet.Footer>\n * \t\t<Button commandfor=\"cart\" command=\"close\">{t(\"actions.checkout\")}</Button>\n * \t</Sheet.Footer>\n * \t<Sheet.Close commandfor=\"cart\" aria-label={t(\"actions.close\")} />\n * </Sheet>\n * @example\n * <Sheet id=\"filters\" side=\"left\" aria-labelledby=\"filters-title\">\n * \t<Sheet.Header>\n * \t\t<Sheet.Title id=\"filters-title\">{t(\"filters.title\")}</Sheet.Title>\n * \t</Sheet.Header>\n * </Sheet>\n */\nexport function Sheet(handle: Handle<Sheet.Props>) {\n\treturn () => {\n\t\tlet { side, mix, ...rest } = handle.props;\n\t\tlet resolvedSide = side ?? DEFAULT_SIDE;\n\n\t\treturn (\n\t\t\t<Dialog\n\t\t\t\t{...rest}\n\t\t\t\tdata-side={resolvedSide}\n\t\t\t\tmix={[\n\t\t\t\t\tfixed(),\n\t\t\t\t\tm(0),\n\t\t\t\t\trounded(\"none\"),\n\t\t\t\t\tmaxBs(\"none\"),\n\t\t\t\t\tmaxIs(\"none\"),\n\t\t\t\t\tis(\"min(90vw, var(--ui-sheet-size, 24rem))\"),\n\t\t\t\t\tinsBs(\"0\"),\n\t\t\t\t\tinsBe(\"0\"),\n\t\t\t\t\tenterExit({\n\t\t\t\t\t\ttranslate: \"var(--ui-sheet-enter-offset)\",\n\t\t\t\t\t\tduration: durations.slow,\n\t\t\t\t\t\teasing: easings.decelerate,\n\t\t\t\t\t\texit: { translate: \"var(--ui-sheet-exit-offset)\", opacity: 0, blur: EXIT_BLUR_PX },\n\t\t\t\t\t\texitDuration: durations.fast,\n\t\t\t\t\t\texitEasing: easings.accelerate,\n\t\t\t\t\t}),\n\t\t\t\t\twillChange(\"translate\"),\n\t\t\t\t\tdata(\"side\", \"right\", [\n\t\t\t\t\t\tborderEdge(\"left\", { width: 1, color: \"neutral\" }),\n\t\t\t\t\t\tvars({\n\t\t\t\t\t\t\t\"ui-sheet-enter-offset\": \"100% 0\",\n\t\t\t\t\t\t\t\"ui-sheet-exit-offset\": `${EXIT_DISTANCE} 0`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tinsRight(\"0\"),\n\t\t\t\t\t\tinsLeft(\"auto\"),\n\t\t\t\t\t\tpaddingLeft(\"1.5rem\"),\n\t\t\t\t\t\tpaddingRight(\"calc(1.5rem + env(safe-area-inset-right, 0px))\"),\n\t\t\t\t\t]),\n\n\t\t\t\t\tdata(\"side\", \"left\", [\n\t\t\t\t\t\tborderEdge(\"right\", { width: 1, color: \"neutral\" }),\n\t\t\t\t\t\tvars({\n\t\t\t\t\t\t\t\"ui-sheet-enter-offset\": \"-100% 0\",\n\t\t\t\t\t\t\t\"ui-sheet-exit-offset\": `-${EXIT_DISTANCE} 0`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tinsLeft(\"0\"),\n\t\t\t\t\t\tinsRight(\"auto\"),\n\t\t\t\t\t\tpaddingRight(\"1.5rem\"),\n\t\t\t\t\t\tpaddingLeft(\"calc(1.5rem + env(safe-area-inset-left, 0px))\"),\n\t\t\t\t\t]),\n\t\t\t\t\tgap(\"1rem\"),\n\t\t\t\t\tpbs(`calc(1.5rem + env(safe-area-inset-top, 0px))`),\n\t\t\t\t\tpbe(`calc(1.5rem + env(safe-area-inset-bottom, 0px))`),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Sheet.HeaderProps.children} as the panel's header slot: a\n * tightly-stacked column of {@link Sheet.Title} and {@link Sheet.Description},\n * start-aligned at every width rather than centering like {@link Dialog.Header}.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the header slot's markup.\n * @example\n * <Sheet.Header>\n * \t<Sheet.Title>{t(\"cart.title\")}</Sheet.Title>\n * \t<Sheet.Description>{t(\"cart.description\")}</Sheet.Description>\n * </Sheet.Header>\n */\nSheet.Header = function SheetHeader(handle: Handle<Sheet.HeaderProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <div {...rest} data-slot=\"header\" mix={[vstack({ gap: \"0.25rem\" }), mix]} />;\n\t};\n};\n\n/**\n * Renders {@link Sheet.TitleProps.children} as the panel's heading: identical\n * to {@link Dialog.Title}, since both name a panel with the same size and\n * weight of heading text.\n *\n * @param handle Runtime handle carrying the host `<h2>`'s props.\n * @returns The render function producing the heading's markup.\n * @example\n * <Sheet.Title>{t(\"cart.title\")}</Sheet.Title>\n */\nSheet.Title = Dialog.Title;\n\n/**\n * Renders {@link Sheet.DescriptionProps.children} as the panel's supporting\n * copy, in a native `<p>` set to the panel's own foreground color rather\n * than {@link Dialog.Description}'s more muted one.\n *\n * @param handle Runtime handle carrying the host `<p>`'s props.\n * @returns The render function producing the description's markup.\n * @example\n * <Sheet.Description>{t(\"cart.description\")}</Sheet.Description>\n */\nSheet.Description = function SheetDescription(handle: Handle<Sheet.DescriptionProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<p {...rest} data-slot=\"description\" mix={[fontSize(\"sm\"), fg(\"neutral\"), pretty(), mix]}>\n\t\t\t\t{rest.children}\n\t\t\t</p>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Sheet.FooterProps.children} as the panel's action row: a\n * single end-aligned row pinned to the block-end edge at every width, unlike\n * {@link Dialog.Footer}'s column that only becomes a row as its container grows.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the action row's markup.\n * @example\n * <Sheet.Footer>\n * \t<Button commandfor=\"cart\" command=\"close\" variant=\"outline\">{t(\"actions.cancel\")}</Button>\n * \t<Button commandfor=\"cart\" command=\"close\">{t(\"actions.checkout\")}</Button>\n * </Sheet.Footer>\n */\nSheet.Footer = function SheetFooter(handle: Handle<Sheet.FooterProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"footer\"\n\t\t\t\tmix={[mbs(\"auto\"), flex(), items(\"center\"), justify(\"end\"), gap(\"0.5rem\"), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a dismiss control for the ancestor {@link Sheet} named by\n * `commandfor`: identical to {@link Dialog.Close}.\n *\n * @param handle Runtime handle carrying the host button's props.\n * @returns The render function producing the dismiss control's markup.\n * @example\n * <Sheet.Close commandfor=\"cart\" aria-label={t(\"actions.close\")} />\n */\nSheet.Close = Dialog.Close;\n"
13
+ },
14
+ "test": null
15
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "shortcut-list",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [
5
+ "keyboard"
6
+ ],
7
+ "exports": [
8
+ "ShortcutList"
9
+ ],
10
+ "source": {
11
+ "path": "shortcut-list.tsx",
12
+ "content": "/**\n * The list a keyboard-shortcuts panel shows: a native `<dl>` pairing each action with the\n * key caps that run it, laid out in two columns so every key lands on one vertical line\n * and the list reads down that line instead of across ragged hints.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { fg } from \"@sdxc/u/color\";\nimport { contents, flex, gap, grid, gridTemplate, items, justify } from \"@sdxc/u/layout\";\nimport { m } from \"@sdxc/u/size\";\nimport { pretty, text, weight } from \"@sdxc/u/typography\";\n\nimport { Keyboard } from \"@sdxc/ui/keyboard\";\n\n/**\n * Prop types for {@link ShortcutList} and its compound parts.\n */\nexport namespace ShortcutList {\n\t/**\n\t * Props accepted by {@link ShortcutList}.\n\t */\n\texport interface Props extends TagProps<\"dl\"> {\n\t\t/** One {@link ShortcutList.Item} per binding, in the order the panel lists them. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link ShortcutList.Item}.\n\t */\n\texport interface ItemProps extends TagProps<\"div\"> {\n\t\t/**\n\t\t * The caps to press, in press order, each already the glyph to print — a combo\n\t\t * formatted for the reader's keyboard by `keyComboGlyphs()`, or a bare character.\n\t\t */\n\t\tkeys: string[];\n\t\t/** What pressing the keys does. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders the list's host `<dl>`, a two-column grid whose first column takes the actions\n * and whose second sizes itself to the widest run of caps.\n *\n * @param handle Runtime handle carrying the host `<dl>`'s props.\n * @returns The render function producing the list's markup.\n * @example\n * <ShortcutList>\n * \t<ShortcutList.Item keys={keyComboGlyphs(\"mod+k\", apple)}>{t(\"openSearch\")}</ShortcutList.Item>\n * \t<ShortcutList.Item keys={[\"?\"]}>{t(\"showShortcuts\")}</ShortcutList.Item>\n * </ShortcutList>\n */\nexport function ShortcutList(handle: Handle<ShortcutList.Props>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<dl\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"shortcut-list\"\n\t\t\t\tmix={[m(0), grid(), gap(2, 4), items(\"center\"), gridTemplate({ columns: \"1fr auto\" }), mix]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</dl>\n\t\t);\n\t};\n}\n\n/**\n * Renders one binding as a `<dt>` naming the action and a `<dd>` holding a cap per key.\n * The wrapping `<div>` lays out as its children, so both cells join the list's own grid.\n *\n * @param handle Runtime handle carrying the wrapping `<div>`'s props.\n * @returns The render function producing the binding's markup.\n * @example\n * <ShortcutList.Item keys={[\"⌘\", \"K\"]}>{t(\"openSearch\")}</ShortcutList.Item>\n */\nShortcutList.Item = function ShortcutListItem(handle: Handle<ShortcutList.ItemProps>) {\n\treturn () => {\n\t\tlet { children, keys, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"shortcut\" mix={[contents(), mix]}>\n\t\t\t\t<dt mix={[text(\"sm\"), fg(\"neutral\"), pretty()]}>{children}</dt>\n\t\t\t\t<dd mix={[m(0), flex(), gap(1), items(\"center\"), justify(\"end\")]}>\n\t\t\t\t\t{keys.map((key, index) => (\n\t\t\t\t\t\t<Keyboard key={`${index}-${key}`} mix={[m(0), weight(\"medium\")]}>\n\t\t\t\t\t\t\t{key}\n\t\t\t\t\t\t</Keyboard>\n\t\t\t\t\t))}\n\t\t\t\t</dd>\n\t\t\t</div>\n\t\t);\n\t};\n};\n"
13
+ },
14
+ "test": {
15
+ "path": "shortcut-list.test.tsx",
16
+ "content": "/**\n * Tests for the markup {@link ShortcutList} renders: a description list whose terms are\n * the actions and whose definitions hold one key cap per key.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { ShortcutList } from \"@sdxc/ui/shortcut-list\";\n\ndescribe(ShortcutList.name, () => {\n\ttest(\"pairs each action with a cap per key, in press order\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<ShortcutList aria-label=\"Shortcuts\">\n\t\t\t\t<ShortcutList.Item keys={[\"⌘\", \"K\"]}>Open search</ShortcutList.Item>\n\t\t\t\t<ShortcutList.Item keys={[\"?\"]}>Show shortcuts</ShortcutList.Item>\n\t\t\t</ShortcutList>,\n\t\t);\n\n\t\texpect(html).toMatch(/<dl[^>]*aria-label=\"Shortcuts\"/);\n\t\texpect(html).toMatch(\n\t\t\t/<dt[^>]*>Open search<\\/dt><dd[^>]*><kbd[^>]*>⌘<\\/kbd><kbd[^>]*>K<\\/kbd><\\/dd>/,\n\t\t);\n\t\texpect(html).toMatch(/<dt[^>]*>Show shortcuts<\\/dt><dd[^>]*><kbd[^>]*>\\?<\\/kbd><\\/dd>/);\n\t});\n\n\ttest(\"keeps a repeated key as two caps\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<ShortcutList>\n\t\t\t\t<ShortcutList.Item keys={[\"G\", \"G\"]}>Go to the top</ShortcutList.Item>\n\t\t\t</ShortcutList>,\n\t\t);\n\n\t\texpect(html.match(/<kbd/g)).toHaveLength(2);\n\t});\n});\n"
17
+ }
18
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "sidebar",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [
5
+ "dialog",
6
+ "scroll-area",
7
+ "separator"
8
+ ],
9
+ "exports": [
10
+ "Sidebar"
11
+ ],
12
+ "source": {
13
+ "path": "sidebar.tsx",
14
+ "content": "/**\n * An application shell's primary navigation rail, composed from a layout\n * root, a collapsible rail, a main-content inset, and a family of\n * group/menu/item parts for organizing links. Collapsing rides a single\n * checkbox's native `:checked` state, so the whole shell works with zero\n * library JavaScript.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { PanelLeftIcon } from \"@sdxc/icons\";\nimport { visuallyHidden } from \"@sdxc/u/a11y\";\nimport { bg, border, borderEdge, colorMix, fg, outline, outlineStyle } from \"@sdxc/u/color\";\nimport {\n\tbackdropBlur,\n\tbackdropSaturate,\n\topacity,\n\trounded,\n\tshadow,\n\ttransition,\n\ttransitionBehavior,\n\ttransitionDuration,\n\ttransitionProperty,\n} from \"@sdxc/u/effects\";\nimport { cursor, pseudoContent, userSelect, willChange } from \"@sdxc/u/general\";\nimport { var as varUtility } from \"@sdxc/u/general/var\";\nimport {\n\tabsolute,\n\tcontainer,\n\tfixed,\n\tflex,\n\tflexCol,\n\tgap,\n\tgrow,\n\thidden,\n\tinlineFlex,\n\tinsBe,\n\tinsBs,\n\tinsIe,\n\tinsIs,\n\tinsLeft,\n\tinsRight,\n\titems,\n\tjustify,\n\trelative,\n\tshrink,\n\tvstack,\n} from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { media, supports } from \"@sdxc/u/responsive\";\nimport {\n\tbs,\n\tis,\n\tm,\n\tmaxBs,\n\tmaxIs,\n\tmbe,\n\tmbs,\n\tminBs,\n\tminIs,\n\tmis,\n\tp,\n\tpb,\n\tpbe,\n\tpbs,\n\tpi,\n\tpis,\n\tsafeAreaPadding,\n} from \"@sdxc/u/size\";\nimport { z } from \"@sdxc/u/stacking\";\nimport { after, data, focusVisible, hover, when } from \"@sdxc/u/state\";\nimport { scaleProperty, translateProperty, translateX } from \"@sdxc/u/transform\";\nimport {\n\tfontSize,\n\ttabularNums,\n\ttextAlign,\n\ttextDecoration,\n\ttextTransform,\n\ttracking,\n\ttruncate,\n\tweight,\n} from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { durations, easings } from \"@sdxc/ui/animations\";\nimport { hitArea } from \"@sdxc/ui/styles\";\nimport { warnIfNoAccessibleName } from \"@sdxc/ui/utils\";\n\nimport { Dialog } from \"@sdxc/ui/dialog\";\nimport { ScrollArea } from \"@sdxc/ui/scroll-area\";\nimport { Separator } from \"@sdxc/ui/separator\";\n\n/** Visual treatment {@link Sidebar} falls back to when `variant` is omitted. */\nconst DEFAULT_VARIANT: Sidebar.Variant = \"sidebar\";\n\n/** Collapse behavior {@link Sidebar} falls back to when `collapsible` is omitted. */\nconst DEFAULT_COLLAPSIBLE: Sidebar.Collapsible = \"offcanvas\";\n\n/**\n * Physical edge {@link Sidebar} docks against, and the edge\n * {@link Sidebar.MobileNav} slides in from, when `side` is omitted.\n */\nconst DEFAULT_SIDE: Sidebar.Side = \"left\";\n\n/** Semantic color role {@link Sidebar.Item} falls back to when `color` is omitted. */\nconst DEFAULT_ITEM_COLOR: Sidebar.Color = \"neutral\";\n\n/** Size variant {@link Sidebar.MenuButton} and {@link Sidebar.MenuLink} fall back to when `size` is omitted. */\nconst DEFAULT_MENU_BUTTON_SIZE: Sidebar.MenuButtonSize = \"md\";\n\n/** Whether {@link Sidebar.MenuAction} stays hidden until its row is hovered or focused, when `showOnHover` is omitted. */\nconst DEFAULT_SHOW_ON_HOVER = true;\n\n/** Whether {@link Sidebar.MenuSkeleton} renders a leading icon placeholder, when `showIcon` is omitted. */\nconst DEFAULT_SHOW_ICON = false;\n\n/**\n * Named container {@link Sidebar.Provider} declares on its own host, so\n * {@link Sidebar} and {@link Sidebar.Rail} can query the shell's overall\n * width for room to show a persistent rail, regardless of nesting depth.\n */\nconst PROVIDER_CONTAINER_NAME = \"ui-sidebar-provider\";\n\n/**\n * Named container {@link Sidebar.Inset} declares on its own host, so content\n * rendered inside it — a Card, a Table, anything sized by its surroundings —\n * responds to the inset's own available width as the rail expands or collapses.\n */\nconst INSET_CONTAINER_NAME = \"ui-sidebar-inset\";\n\n/**\n * Container query matching a shell wide enough to host the persistent rail\n * alongside its inset; below this width, {@link Sidebar}'s `\"icon\"` and\n * `\"offcanvas\"` collapse modes step aside for {@link Sidebar.MobileNav}.\n */\nconst WIDE_SHELL_QUERY = `@container ${PROVIDER_CONTAINER_NAME} (min-width: 48rem)`;\n\n/**\n * Selector matching {@link Sidebar.Trigger}'s own checkbox input once it\n * carries the platform's native `:checked` state — the single source of\n * truth every collapse-driven rule in {@link Sidebar.Provider} reads from.\n */\nconst TOGGLE_CHECKED_SELECTOR = '[data-slot=\"toggle\"]:checked';\n\n/**\n * Resolves the `aria-current` value an anchor-based nav part renders with:\n * an explicit `aria-current` always wins, and a `current`/`active`\n * shorthand of `true` falls back to `\"page\"` when nothing else was given.\n */\nfunction resolveAriaCurrent(\n\tcurrent: boolean | undefined,\n\tariaCurrent: TagProps<\"a\">[\"aria-current\"],\n): TagProps<\"a\">[\"aria-current\"] {\n\treturn ariaCurrent ?? (current ? \"page\" : undefined);\n}\n\n/**\n * Prop types for {@link Sidebar} and its compound parts.\n */\nexport namespace Sidebar {\n\t/**\n\t * Visual treatment the rail renders with: `\"sidebar\"` sits flush against\n\t * its edge, `\"floating\"` insets itself with a margin, a rounded, shadowed\n\t * panel, and a blurred backdrop; `\"inset\"` renders the same panel without blur.\n\t */\n\texport type Variant = \"sidebar\" | \"floating\" | \"inset\";\n\n\t/**\n\t * How the rail collapses: `\"none\"` always renders at full width, `\"icon\"`\n\t * narrows to an icon-only rail, and `\"offcanvas\"` narrows to nothing. Every\n\t * mode but `\"none\"` yields to {@link Sidebar.MobileNav} on narrow shells.\n\t */\n\texport type Collapsible = \"none\" | \"offcanvas\" | \"icon\";\n\n\t/**\n\t * Physical edge of the shell the rail docks against and, for\n\t * {@link Sidebar.MobileNav}, slides in from. `\"left\"` and `\"right\"` name\n\t * that edge regardless of `dir`, staying pinned to one physical side.\n\t */\n\texport type Side = \"left\" | \"right\";\n\n\t/**\n\t * Semantic color role {@link Sidebar.Item} renders its current-page\n\t * treatment in, each mapped to its matching `--ui-*` variables.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Size variant controlling {@link Sidebar.MenuButton}'s and\n\t * {@link Sidebar.MenuLink}'s padding, font size, and icon size.\n\t */\n\texport type MenuButtonSize = \"sm\" | \"md\" | \"lg\";\n\n\t/**\n\t * Every native `<div>` attribute, plus the `mix` passthrough. Establishes\n\t * the shell's row layout — {@link Sidebar} beside {@link Sidebar.Inset} —\n\t * plus the {@link PROVIDER_CONTAINER_NAME} container and `:checked` collapse rules.\n\t */\n\texport interface ProviderProps extends TagProps<\"div\"> {\n\t\t/** {@link Sidebar} and {@link Sidebar.Inset}, in either order. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Every native `<aside>` attribute, plus the `mix` passthrough.\n\t */\n\texport interface Props extends TagProps<\"aside\"> {\n\t\t/** Visual treatment. Defaults to {@link DEFAULT_VARIANT}. */\n\t\tvariant?: Variant;\n\t\t/** Collapse behavior. Defaults to {@link DEFAULT_COLLAPSIBLE}. */\n\t\tcollapsible?: Collapsible;\n\t\t/** Physical docking edge. Defaults to {@link DEFAULT_SIDE}. */\n\t\tside?: Side;\n\t}\n\n\t/**\n\t * Every prop {@link Dialog.Props} accepts, plus `side`. `id` stays the id\n\t * a trigger elsewhere on the page opens this drawer with — see\n\t * {@link Dialog.Props} for the full Invoker Commands contract.\n\t */\n\texport interface MobileNavProps extends Dialog.Props {\n\t\t/** Physical edge to dock against and slide in from. Defaults to {@link DEFAULT_SIDE}. */\n\t\tside?: Side;\n\t}\n\n\t/**\n\t * Every native `<header>` attribute, plus the `mix` passthrough.\n\t */\n\texport interface HeaderProps extends TagProps<\"header\"> {}\n\n\t/**\n\t * Every prop {@link ScrollArea.ViewportProps} accepts, unchanged.\n\t */\n\texport interface ContentProps extends ScrollArea.ViewportProps {}\n\n\t/**\n\t * Every native `<footer>` attribute, plus the `mix` passthrough.\n\t */\n\texport interface FooterProps extends TagProps<\"footer\"> {}\n\n\t/**\n\t * Every native `<nav>` attribute, plus the `mix` passthrough.\n\t */\n\texport interface NavProps extends TagProps<\"nav\"> {}\n\n\t/**\n\t * Props accepted by {@link Sidebar.Item}, built as an intersection because\n\t * the underlying anchor prop type is a union keyed on `href` — the\n\t * accessible-anchor contract restricts `role` once `href` is present.\n\t */\n\texport type ItemProps = TagProps<\"a\"> & {\n\t\t/** Destination the item navigates to. */\n\t\thref: string;\n\t\t/** Semantic color role applied once the item is current. Defaults to {@link DEFAULT_ITEM_COLOR}. */\n\t\tcolor?: Color;\n\t\t/** Shorthand setting `aria-current=\"page\"` when true and `aria-current` is otherwise unset. */\n\t\tcurrent?: boolean;\n\t};\n\n\t/**\n\t * Every native `<section>` attribute, plus the `mix` passthrough.\n\t */\n\texport interface GroupProps extends TagProps<\"section\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, plus the `mix` passthrough.\n\t */\n\texport interface GroupLabelProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<button>` attribute, plus the `mix` passthrough.\n\t */\n\texport interface GroupActionProps extends TagProps<\"button\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, plus the `mix` passthrough.\n\t */\n\texport interface GroupContentProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<ul>` attribute, plus the `mix` passthrough.\n\t */\n\texport interface MenuProps extends TagProps<\"ul\"> {}\n\n\t/**\n\t * Every native `<li>` attribute, plus the `mix` passthrough. Its own\n\t * `:hover`/`:focus-within` state reveals a nested {@link Sidebar.MenuAction}\n\t * that would otherwise stay hidden.\n\t */\n\texport interface MenuItemProps extends TagProps<\"li\"> {}\n\n\t/**\n\t * Props accepted by {@link Sidebar.MenuButton}.\n\t */\n\texport interface MenuButtonProps extends TagProps<\"button\"> {\n\t\t/** Size variant. Defaults to {@link DEFAULT_MENU_BUTTON_SIZE}. */\n\t\tsize?: MenuButtonSize;\n\t\t/** Marks the row as the current selection, independent of navigation. */\n\t\tactive?: boolean;\n\t}\n\n\t/**\n\t * Props accepted by {@link Sidebar.MenuLink}. Built as an intersection for\n\t * the same reason as {@link Sidebar.ItemProps}.\n\t */\n\texport type MenuLinkProps = TagProps<\"a\"> & {\n\t\t/** Destination the link navigates to. */\n\t\thref: string;\n\t\t/** Size variant. Defaults to {@link DEFAULT_MENU_BUTTON_SIZE}. */\n\t\tsize?: MenuButtonSize;\n\t\t/** Shorthand setting `aria-current=\"page\"` when true and `aria-current` is otherwise unset. */\n\t\tactive?: boolean;\n\t};\n\n\t/**\n\t * Props accepted by {@link Sidebar.MenuAction}.\n\t */\n\texport interface MenuActionProps extends TagProps<\"button\"> {\n\t\t/**\n\t\t * Whether the control stays invisible until its ancestor\n\t\t * {@link Sidebar.MenuItem} is hovered or focused. Defaults to\n\t\t * {@link DEFAULT_SHOW_ON_HOVER}; set `false` to keep it always visible.\n\t\t */\n\t\tshowOnHover?: boolean;\n\t}\n\n\t/**\n\t * Every native `<span>` attribute, plus the `mix` passthrough.\n\t */\n\texport interface MenuBadgeProps extends TagProps<\"span\"> {}\n\n\t/**\n\t * Props accepted by {@link Sidebar.MenuSkeleton}.\n\t */\n\texport interface MenuSkeletonProps extends TagProps<\"div\"> {\n\t\t/** Whether to render a leading icon-shaped placeholder. Defaults to {@link DEFAULT_SHOW_ICON}. */\n\t\tshowIcon?: boolean;\n\t}\n\n\t/**\n\t * Every native `<ul>` attribute, plus the `mix` passthrough.\n\t */\n\texport interface MenuSubProps extends TagProps<\"ul\"> {}\n\n\t/**\n\t * Every native `<li>` attribute, plus the `mix` passthrough.\n\t */\n\texport interface MenuSubItemProps extends TagProps<\"li\"> {}\n\n\t/**\n\t * Props accepted by {@link Sidebar.MenuSubButton}.\n\t */\n\texport interface MenuSubButtonProps extends TagProps<\"button\"> {\n\t\t/** Marks the row as the current selection, independent of navigation. */\n\t\tactive?: boolean;\n\t}\n\n\t/**\n\t * Props accepted by {@link Sidebar.MenuSubLink}. Built as an intersection\n\t * for the same reason as {@link Sidebar.ItemProps}.\n\t */\n\texport type MenuSubLinkProps = TagProps<\"a\"> & {\n\t\t/** Destination the link navigates to. */\n\t\thref: string;\n\t\t/** Shorthand setting `aria-current=\"page\"` when true and `aria-current` is otherwise unset. */\n\t\tactive?: boolean;\n\t};\n\n\t/**\n\t * Props accepted by {@link Sidebar.Rail}: every native `<label>` attribute\n\t * except `htmlFor`, narrowed to required since it names the id of\n\t * {@link Sidebar.Trigger}'s own checkbox, the control this rail mirrors.\n\t */\n\texport interface RailProps extends Omit<TagProps<\"label\">, \"htmlFor\"> {\n\t\t/** Id of the {@link Sidebar.Trigger} checkbox this rail toggles. */\n\t\thtmlFor: string;\n\t}\n\n\t/**\n\t * Props accepted by {@link Sidebar.Trigger}: every native `<input>`\n\t * attribute except `type` and `role`, fixed by the platform's checkbox\n\t * semantics, so `id`, `checked`, `defaultChecked`, and `disabled` all work.\n\t */\n\texport interface TriggerProps extends Omit<TagProps<\"input\">, \"type\" | \"role\"> {\n\t\t/**\n\t\t * Accessible label for the icon-only control — required, since the\n\t\t * control carries no visible text for assistive technology to read.\n\t\t */\n\t\t\"aria-label\": string;\n\t}\n\n\t/**\n\t * Every prop {@link ScrollArea.ViewportProps} accepts, unchanged.\n\t */\n\texport interface InsetProps extends ScrollArea.ViewportProps {}\n\n\t/**\n\t * Every prop {@link Separator.Props} accepts, unchanged.\n\t */\n\texport interface SeparatorProps extends Separator.Props {}\n}\n\n/**\n * Renders the rail itself: a native `<aside>` sized and styled through its\n * `data-variant`, `data-collapsible`, and `data-side` attributes, with\n * every collapse rule keyed off {@link Sidebar.Provider}'s `:has()` state.\n *\n * @param handle Runtime handle carrying the host `<aside>`'s props.\n * @returns The render function producing the rail's markup.\n * @example\n * <Sidebar.Provider>\n * \t<Sidebar variant=\"floating\" collapsible=\"icon\" side=\"right\">\n * \t\t<Sidebar.Header>{logo}</Sidebar.Header>\n * \t\t<Sidebar.Content>{nav}</Sidebar.Content>\n * \t</Sidebar>\n * \t<Sidebar.Inset>{children}</Sidebar.Inset>\n * </Sidebar.Provider>\n */\nexport function Sidebar(handle: Handle<Sidebar.Props>) {\n\treturn () => {\n\t\tlet { variant, collapsible, side, mix, ...rest } = handle.props;\n\t\tlet resolvedVariant = variant ?? DEFAULT_VARIANT;\n\t\tlet resolvedCollapsible = collapsible ?? DEFAULT_COLLAPSIBLE;\n\t\tlet resolvedSide = side ?? DEFAULT_SIDE;\n\n\t\treturn (\n\t\t\t<aside\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"sidebar\"\n\t\t\t\tdata-variant={resolvedVariant}\n\t\t\t\tdata-collapsible={resolvedCollapsible}\n\t\t\t\tdata-side={resolvedSide}\n\t\t\t\tmix={[\n\t\t\t\t\trelative(),\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tshrink(),\n\t\t\t\t\tbs(\"full\"),\n\t\t\t\t\tis(varUtility(\"sidebar-width\", \"16rem\")),\n\t\t\t\t\twillChange(\"transform\"),\n\t\t\t\t\tdata(\"side\", \"left\", [\n\t\t\t\t\t\tborderEdge(\"right\", { width: 1, style: \"solid\", color: \"neutral\" }),\n\t\t\t\t\t\tsafeAreaPadding(\"left\"),\n\t\t\t\t\t]),\n\t\t\t\t\tdata(\"side\", \"right\", [\n\t\t\t\t\t\tborderEdge(\"left\", { width: 1, style: \"solid\", color: \"neutral\" }),\n\t\t\t\t\t\tsafeAreaPadding(\"right\"),\n\t\t\t\t\t]),\n\t\t\t\t\tdata(\"variant\", \"floating\", [\n\t\t\t\t\t\tm(\"0.5rem\"),\n\t\t\t\t\t\tshadow(\"lg\"),\n\t\t\t\t\t\tsupports(\n\t\t\t\t\t\t\t\"(backdrop-filter: blur(0))\",\n\t\t\t\t\t\t\tmedia(\"(prefers-reduced-transparency: no-preference)\", [\n\t\t\t\t\t\t\t\tborder(\n\t\t\t\t\t\t\t\t\tcolorMix(\n\t\t\t\t\t\t\t\t\t\t\"oklab\",\n\t\t\t\t\t\t\t\t\t\t{ color: \"var(--ui-neutral-border)\", weight: 80 },\n\t\t\t\t\t\t\t\t\t\t\"transparent\",\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tbg(\n\t\t\t\t\t\t\t\t\tcolorMix(\n\t\t\t\t\t\t\t\t\t\t\"oklab\",\n\t\t\t\t\t\t\t\t\t\t{ color: \"var(--ui-neutral-bg-tint)\", weight: 95 },\n\t\t\t\t\t\t\t\t\t\t\"transparent\",\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tbackdropBlur(\"md\"),\n\t\t\t\t\t\t\t\tbackdropSaturate(1.4),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t\tdata(\"variant\", \"inset\", shadow(\"base\")),\n\t\t\t\t\twhen(\n\t\t\t\t\t\t`@container ${PROVIDER_CONTAINER_NAME} (max-width: 47.9375rem)`,\n\t\t\t\t\t\twhen('&[data-collapsible=\"icon\"], &[data-collapsible=\"offcanvas\"]', hidden()),\n\t\t\t\t\t),\n\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", transitionProperty(\"none\")),\n\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\ttransition(\"inline-size, transform\", {\n\t\t\t\t\t\tduration: durations.normal,\n\t\t\t\t\t\teasing: easings.standard,\n\t\t\t\t\t}),\n\t\t\t\t\tdata(\"variant\", \"floating\", [rounded(\"xl\"), border({ color: \"neutral\", width: 1 })]),\n\t\t\t\t\tdata(\"variant\", \"inset\", [rounded(\"xl\"), border({ color: \"neutral\", width: 1 })]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders the shell's layout root: a flex row placing {@link Sidebar} beside\n * {@link Sidebar.Inset}, hosting every collapse rule keyed purely off\n * {@link Sidebar.Trigger}'s checkbox reaching `:checked` in this subtree.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the shell's markup.\n * @example\n * <Sidebar.Provider>\n * \t<Sidebar collapsible=\"icon\">\n * \t\t<Sidebar.Header>\n * \t\t\t<Sidebar.Trigger id=\"app-sidebar-toggle\" aria-label={t(\"nav.toggleSidebar\")} />\n * \t\t</Sidebar.Header>\n * \t\t<Sidebar.Content>\n * \t\t\t<Sidebar.Menu>\n * \t\t\t\t<Sidebar.MenuItem>\n * \t\t\t\t\t<Sidebar.MenuLink href=\"/dashboard\" active>\n * \t\t\t\t\t\t<HomeIcon aria-hidden />\n * \t\t\t\t\t\t<span data-sidebar-collapsed-hide>{t(\"nav.dashboard\")}</span>\n * \t\t\t\t\t</Sidebar.MenuLink>\n * \t\t\t\t</Sidebar.MenuItem>\n * \t\t\t</Sidebar.Menu>\n * \t\t</Sidebar.Content>\n * \t\t<Sidebar.Rail htmlFor=\"app-sidebar-toggle\" />\n * \t</Sidebar>\n * \t<Sidebar.Inset>{children}</Sidebar.Inset>\n * </Sidebar.Provider>\n */\nSidebar.Provider = function SidebarProvider(handle: Handle<Sidebar.ProviderProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"provider\"\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\titems(\"stretch\"),\n\t\t\t\t\tminBs(\"100dvh\"),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\twhen(`&:has(${TOGGLE_CHECKED_SELECTOR})`, [\n\t\t\t\t\t\twhen('[data-slot=\"sidebar\"][data-collapsible=\"icon\"]', [\n\t\t\t\t\t\t\tis(varUtility(\"sidebar-width-icon\", \"3rem\")),\n\t\t\t\t\t\t\twhen(\"[data-sidebar-collapsed-hide]\", visuallyHidden()),\n\t\t\t\t\t\t\twhen('[data-slot=\"group-label\"]', visuallyHidden()),\n\t\t\t\t\t\t\twhen('[data-slot=\"menu-badge\"]', hidden()),\n\t\t\t\t\t\t\twhen('[data-slot=\"menu-sub\"]', hidden()),\n\t\t\t\t\t\t\twhen('[data-slot=\"menu-button\"], [data-slot=\"menu-link\"]', [\n\t\t\t\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\t\t\t\tpi(\"0\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('[data-slot=\"sidebar\"][data-collapsible=\"offcanvas\"][data-side=\"left\"]', [\n\t\t\t\t\t\t\ttranslateX(\"-100%\"),\n\t\t\t\t\t\t\tis(\"0\"),\n\t\t\t\t\t\t\toverflow(\"hidden\"),\n\t\t\t\t\t\t\tborder({ width: \"0\", noStyleDefault: true }),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('[data-slot=\"sidebar\"][data-collapsible=\"offcanvas\"][data-side=\"right\"]', [\n\t\t\t\t\t\t\ttranslateX(\"100%\"),\n\t\t\t\t\t\t\tis(\"0\"),\n\t\t\t\t\t\t\toverflow(\"hidden\"),\n\t\t\t\t\t\t\tborder({ width: \"0\", noStyleDefault: true }),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]),\n\t\t\t\t\tcontainer(PROVIDER_CONTAINER_NAME),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders the docked, edge-to-edge mobile substitute for {@link Sidebar}:\n * {@link Sidebar}'s nav content re-composed inside {@link Dialog}, docked\n * to `side` and opened via Invoker Commands, not a viewport check. A press\n * outside it closes it, which is the dismissal a touch device has.\n *\n * @param handle Runtime handle carrying the host `<dialog>`'s props, plus `side`.\n * @returns The render function producing the drawer's markup.\n * @example\n * <button commandfor=\"mobile-nav\" command=\"show-modal\" aria-label={t(\"nav.openMenu\")}>\n * \t<MenuIcon aria-hidden />\n * </button>\n * <Sidebar.MobileNav id=\"mobile-nav\" aria-label={t(\"nav.mainNavigation\")}>\n * \t<Sidebar.Header>{logo}</Sidebar.Header>\n * \t<Sidebar.Content>{nav}</Sidebar.Content>\n * </Sidebar.MobileNav>\n */\nSidebar.MobileNav = function SidebarMobileNav(handle: Handle<Sidebar.MobileNavProps>) {\n\treturn () => {\n\t\tlet { side, mix, ...rest } = handle.props;\n\t\tlet resolvedSide = side ?? DEFAULT_SIDE;\n\n\t\treturn (\n\t\t\t<Dialog\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"mobile-nav\"\n\t\t\t\tdata-side={resolvedSide}\n\t\t\t\tmix={[\n\t\t\t\t\t/**\n\t\t\t\t\t * A press outside closes the drawer, the way a drawer is dismissed on a phone: a modal\n\t\t\t\t\t * dialog otherwise closes only on Escape, which a touch device lacks. A consumer\n\t\t\t\t\t * holding the drawer open passes its own `closedby`.\n\t\t\t\t\t */\n\t\t\t\t\tattrs({ closedby: \"any\" }),\n\t\t\t\t\tfixed(),\n\t\t\t\t\tinsBs(\"0\"),\n\t\t\t\t\tinsBe(\"0\"),\n\t\t\t\t\tm(\"0\"),\n\t\t\t\t\trounded(\"none\"),\n\t\t\t\t\tp(\"0\"),\n\t\t\t\t\tmaxBs(\"none\"),\n\t\t\t\t\tbs(\"full\"),\n\t\t\t\t\tis(varUtility(\"sidebar-width-mobile\", \"18rem\")),\n\t\t\t\t\tmaxIs(\"90vw\"),\n\t\t\t\t\t/** Gated on `[open]` so the UA's own `dialog:not([open])` hiding still applies. */\n\t\t\t\t\twhen(\"&[open]\", flex()),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\toverflow(\"hidden\"),\n\t\t\t\t\twillChange(\"transform\"),\n\t\t\t\t\ttransitionBehavior(\"allow-discrete\"),\n\t\t\t\t\tdata(\"side\", \"left\", [insLeft(\"0\"), safeAreaPadding(\"left\"), translateX(\"-100%\")]),\n\t\t\t\t\twhen('&[data-side=\"left\"][open]', translateX(\"0\")),\n\t\t\t\t\tdata(\"side\", \"right\", [insRight(\"0\"), safeAreaPadding(\"right\"), translateX(\"100%\")]),\n\t\t\t\t\twhen('&[data-side=\"right\"][open]', translateX(\"0\")),\n\t\t\t\t\twhen(\"@starting-style\", [\n\t\t\t\t\t\twhen('&[data-side=\"left\"][open]', translateX(\"-100%\")),\n\t\t\t\t\t\twhen('&[data-side=\"right\"][open]', translateX(\"100%\")),\n\t\t\t\t\t]),\n\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", transitionProperty(\"none\")),\n\t\t\t\t\tpbs(\"env(safe-area-inset-top, 0px)\"),\n\t\t\t\t\tpbe(\"env(safe-area-inset-bottom, 0px)\"),\n\t\t\t\t\ttransition(\"transform, display, overlay\", {\n\t\t\t\t\t\tduration: durations.slow,\n\t\t\t\t\t\teasing: easings.decelerate,\n\t\t\t\t\t}),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders the rail's header slot: a `<header>` laying out its children in\n * a centered row, block-sized to a fixed height with a divider border\n * below it and safe-area padding on its block-start edge.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the header slot's markup.\n * @example\n * <Sidebar.Header>\n * \t<Sidebar.Trigger id=\"app-sidebar-toggle\" aria-label={t(\"nav.toggleSidebar\")} />\n * </Sidebar.Header>\n */\nSidebar.Header = function SidebarHeader(handle: Handle<Sidebar.HeaderProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<header\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"header\"\n\t\t\t\tmix={[\n\t\t\t\t\t/**\n\t\t\t\t\t * The slot paints the rail's background, so content scrolling behind a row held\n\t\t\t\t\t * against the viewport stays hidden; inheriting it matches whichever surface hosts\n\t\t\t\t\t * the row, the docked rail or the drawer.\n\t\t\t\t\t */\n\t\t\t\t\tbg(\"inherit\"),\n\t\t\t\t\tflex(),\n\t\t\t\t\tbs(\"4rem\"),\n\t\t\t\t\tshrink(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tborderEdge(\"block-end\", {\n\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\tstyle: \"solid\",\n\t\t\t\t\t\tcolor: colorMix(\n\t\t\t\t\t\t\t\"oklab\",\n\t\t\t\t\t\t\t{ color: \"var(--ui-neutral-border)\", weight: 80 },\n\t\t\t\t\t\t\t\"transparent\",\n\t\t\t\t\t\t),\n\t\t\t\t\t}),\n\t\t\t\t\tgap(\"0.5rem\"),\n\t\t\t\t\tpi(\"1rem\"),\n\t\t\t\t\tpbs(\"calc(0.5rem + env(safe-area-inset-top, 0px))\"),\n\t\t\t\t\tpbe(\"0.5rem\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders the rail's own scrollable nav region: {@link ScrollArea.Viewport}\n * laid out as a padded, gap-separated column that scrolls independently of\n * {@link Sidebar.Header} and {@link Sidebar.Footer} once it overflows.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the content region's markup.\n * @example\n * <Sidebar.Content>\n * \t<Sidebar.Group>\n * \t\t<Sidebar.GroupLabel>{t(\"nav.workspace\")}</Sidebar.GroupLabel>\n * \t\t<Sidebar.Menu>...</Sidebar.Menu>\n * \t</Sidebar.Group>\n * </Sidebar.Content>\n */\nSidebar.Content = function SidebarContent(handle: Handle<Sidebar.ContentProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<ScrollArea.Viewport\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"content\"\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tgrow(),\n\t\t\t\t\tminBs(\"0\"),\n\t\t\t\t\tbs(\"auto\"),\n\t\t\t\t\tgap(\"1rem\"),\n\t\t\t\t\tpi(\"0.5rem\"),\n\t\t\t\t\tpb(\"1rem\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders the rail's footer slot: a `<footer>` laying out its children in\n * a centered row with a divider border above it and safe-area padding on\n * its block-end edge.\n *\n * @param handle Runtime handle carrying the host `<footer>`'s props.\n * @returns The render function producing the footer slot's markup.\n * @example\n * <Sidebar.Footer>\n * \t<Sidebar.MenuButton>{t(\"nav.account\")}</Sidebar.MenuButton>\n * </Sidebar.Footer>\n */\nSidebar.Footer = function SidebarFooter(handle: Handle<Sidebar.FooterProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<footer\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"footer\"\n\t\t\t\tmix={[\n\t\t\t\t\tbg(\"inherit\"),\n\t\t\t\t\tflex(),\n\t\t\t\t\tshrink(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tborderEdge(\"block-start\", {\n\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\tstyle: \"solid\",\n\t\t\t\t\t\tcolor: colorMix(\n\t\t\t\t\t\t\t\"oklab\",\n\t\t\t\t\t\t\t{ color: \"var(--ui-neutral-border)\", weight: 80 },\n\t\t\t\t\t\t\t\"transparent\",\n\t\t\t\t\t\t),\n\t\t\t\t\t}),\n\t\t\t\t\tgap(\"0.5rem\"),\n\t\t\t\t\tpi(\"0.5rem\"),\n\t\t\t\t\tpbs(\"1rem\"),\n\t\t\t\t\tpbe(\"calc(1rem + env(safe-area-inset-bottom, 0px))\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a flat navigation list: a `<nav>` stacking its {@link Sidebar.Item}\n * children in a column with a small gap, suited to a rail with a simple,\n * ungrouped set of links.\n *\n * @param handle Runtime handle carrying the host `<nav>`'s props.\n * @returns The render function producing the list's markup.\n * @example\n * <Sidebar.Nav aria-label={t(\"nav.mainNavigation\")}>\n * \t<Sidebar.Item href=\"/dashboard\" current>{t(\"nav.dashboard\")}</Sidebar.Item>\n * \t<Sidebar.Item href=\"/settings\">{t(\"nav.settings\")}</Sidebar.Item>\n * </Sidebar.Nav>\n */\nSidebar.Nav = function SidebarNav(handle: Handle<Sidebar.NavProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <nav {...rest} data-slot=\"nav\" mix={[vstack({ gap: \"0.25rem\" }), mix]} />;\n\t};\n};\n\n/**\n * Renders a single row inside {@link Sidebar.Nav}: a native `<a>` colored\n * through `data-color`, tinted once `aria-current` is set, matching\n * {@link Sidebar.MenuLink}; its focus ring always reads in that same color.\n *\n * @param handle Runtime handle carrying the host `<a>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <Sidebar.Item href=\"/dashboard\" current>\n * \t<HomeIcon aria-hidden />\n * \t{t(\"nav.dashboard\")}\n * </Sidebar.Item>\n * @example\n * <Sidebar.Item href=\"/billing/cancel\" color=\"danger\" aria-current={pathname === \"/billing/cancel\" ? \"page\" : undefined}>\n * \t<XCircleIcon aria-hidden />\n * \t{t(\"nav.cancelPlan\")}\n * </Sidebar.Item>\n */\nSidebar.Item = function SidebarItem(handle: Handle<Sidebar.ItemProps>) {\n\treturn () => {\n\t\tlet { color, current, \"aria-current\": ariaCurrent, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_ITEM_COLOR;\n\t\tlet resolvedAriaCurrent = resolveAriaCurrent(current, ariaCurrent);\n\n\t\treturn (\n\t\t\t<a\n\t\t\t\t{...rest}\n\t\t\t\taria-current={resolvedAriaCurrent}\n\t\t\t\tdata-slot=\"item\"\n\t\t\t\tdata-color={resolvedColor}\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:focus-visible\", [\n\t\t\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\t\t\tdata(\"color\", \"neutral\", outline(\"neutral.ring\")),\n\t\t\t\t\t\tdata(\"color\", \"success\", outline(\"success.ring\")),\n\t\t\t\t\t\tdata(\"color\", \"warning\", outline(\"warning.ring\")),\n\t\t\t\t\t\tdata(\"color\", \"danger\", outline(\"danger.ring\")),\n\t\t\t\t\t]),\n\t\t\t\t\tflex(),\n\t\t\t\t\tminBs(\"2.25rem\"),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tfontSize(\"sm\"),\n\t\t\t\t\tweight(500),\n\t\t\t\t\ttextDecoration(\"none\"),\n\t\t\t\t\twhen(\"& > svg, & > [data-slot='icon']\", [is(\"1rem\"), bs(\"1rem\"), shrink()]),\n\t\t\t\t\twhen(\"&:active\", scaleProperty(0.98)),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', [cursor(\"not-allowed\"), opacity(50)]),\n\t\t\t\t\tgap(\"0.75rem\"),\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tpi(\"0.5rem\"),\n\t\t\t\t\tpb(\"0.5rem\"),\n\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\ttransition(\n\t\t\t\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke\",\n\t\t\t\t\t),\n\t\t\t\t\twhen(\"&:hover\", [bg(\"neutral.bg-tint-hover\"), fg(\"neutral.emphasis\")]),\n\t\t\t\t\twhen(\"& > svg, & > [data-slot='icon']\", fg(\"neutral.muted\")),\n\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\tbg(\"neutral.bg-tint-hover\"),\n\t\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t\twhen(\"& > svg, & > [data-slot='icon']\", fg(\"neutral.emphasis\")),\n\t\t\t\t\t]),\n\t\t\t\t\tdata(\n\t\t\t\t\t\t\"color\",\n\t\t\t\t\t\t\"brand\",\n\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\tbg(\"brand.tint\"),\n\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\twhen(\"& > svg, & > [data-slot='icon']\", fg(\"brand\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t),\n\t\t\t\t\tdata(\n\t\t\t\t\t\t\"color\",\n\t\t\t\t\t\t\"success\",\n\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\tbg(\"success.tint\"),\n\t\t\t\t\t\t\tfg(\"success\"),\n\t\t\t\t\t\t\twhen(\"& > svg, & > [data-slot='icon']\", fg(\"success\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t),\n\t\t\t\t\tdata(\n\t\t\t\t\t\t\"color\",\n\t\t\t\t\t\t\"warning\",\n\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\tbg(\"warning.tint\"),\n\t\t\t\t\t\t\tfg(\"warning\"),\n\t\t\t\t\t\t\twhen(\"& > svg, & > [data-slot='icon']\", fg(\"warning\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t),\n\t\t\t\t\tdata(\n\t\t\t\t\t\t\"color\",\n\t\t\t\t\t\t\"danger\",\n\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\tbg(\"danger.tint\"),\n\t\t\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\t\t\twhen(\"& > svg, & > [data-slot='icon']\", fg(\"danger\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t),\n\t\t\t\t\twhen(\"&:active\", bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a related cluster of {@link Sidebar.Menu} items: a `<section>`\n * stacking its children in a column, gaining a divider border and extra\n * space above itself whenever it follows another {@link Sidebar.Group}.\n *\n * @param handle Runtime handle carrying the host `<section>`'s props.\n * @returns The render function producing the group's markup.\n * @example\n * <Sidebar.Group>\n * \t<Sidebar.GroupLabel>{t(\"nav.workspace\")}</Sidebar.GroupLabel>\n * \t<Sidebar.GroupContent>\n * \t\t<Sidebar.Menu>...</Sidebar.Menu>\n * \t</Sidebar.GroupContent>\n * </Sidebar.Group>\n */\nSidebar.Group = function SidebarGroup(handle: Handle<Sidebar.GroupProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<section\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"group\"\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\twhen(\"& + &\", [\n\t\t\t\t\t\tmbs(\"0.5rem\"),\n\t\t\t\t\t\tborderEdge(\"block-start\", {\n\t\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\t\tstyle: \"solid\",\n\t\t\t\t\t\t\tcolor: colorMix(\n\t\t\t\t\t\t\t\t\"oklab\",\n\t\t\t\t\t\t\t\t{ color: \"var(--ui-neutral-border)\", weight: 60 },\n\t\t\t\t\t\t\t\t\"transparent\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}),\n\t\t\t\t\t]),\n\t\t\t\t\tgap(\"0.25rem\"),\n\t\t\t\t\twhen(\"& + &\", pbs(\"1rem\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Sidebar.Group}'s label: a small, muted, uppercase heading\n * row, visually clipped once the ancestor {@link Sidebar} collapses to\n * icon-only, while staying announced to assistive technology.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the label's markup.\n * @example\n * <Sidebar.GroupLabel>{t(\"nav.workspace\")}</Sidebar.GroupLabel>\n */\nSidebar.GroupLabel = function SidebarGroupLabel(handle: Handle<Sidebar.GroupLabelProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"group-label\"\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"between\"),\n\t\t\t\t\tmbe(\"0.25rem\"),\n\t\t\t\t\tweight(600),\n\t\t\t\t\tfontSize(\"xs\"),\n\t\t\t\t\ttextTransform(\"uppercase\"),\n\t\t\t\t\ttracking(\"wider\"),\n\t\t\t\t\tuserSelect(),\n\t\t\t\t\tpi(\"0.5rem\"),\n\t\t\t\t\tpb(\"0.375rem\"),\n\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a small icon-only action button anchored to {@link Sidebar.GroupLabel}'s\n * trailing edge, its pointer target grown to `--ui-target-size`. In dev mode, an\n * action with no plain text and no `aria-label`/`aria-labelledby` logs a `console.warn`.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the action's markup.\n * @example\n * <Sidebar.GroupLabel>\n * \t{t(\"nav.workspace\")}\n * \t<Sidebar.GroupAction aria-label={t(\"nav.addWorkspace\")}>\n * \t\t<PlusIcon aria-hidden />\n * \t</Sidebar.GroupAction>\n * </Sidebar.GroupLabel>\n */\nSidebar.GroupAction = function SidebarGroupAction(handle: Handle<Sidebar.GroupActionProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\twarnIfNoAccessibleName(\n\t\t\thandle.props,\n\t\t\tchildren,\n\t\t\t\"Sidebar.GroupAction: an icon-only action needs an `aria-label` describing what it does — assistive technology has no accessible text to announce otherwise.\",\n\t\t);\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"group-action\"\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\trelative(),\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\tis(\"1.25rem\"),\n\t\t\t\t\tbs(\"1.25rem\"),\n\t\t\t\t\thitArea(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\twhen(\"&:disabled\", [cursor(\"not-allowed\"), opacity(50)]),\n\t\t\t\t\trounded(\"sm\"),\n\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\ttransition(\n\t\t\t\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke\",\n\t\t\t\t\t),\n\t\t\t\t\thover([bg(\"neutral.bg-tint-hover\"), fg(\"neutral\")]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</button>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Sidebar.Group}'s body slot: a `<div>` stacking its children\n * — typically a {@link Sidebar.Menu} — in a column with a small gap.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the body slot's markup.\n * @example\n * <Sidebar.GroupContent>\n * \t<Sidebar.Menu>...</Sidebar.Menu>\n * </Sidebar.GroupContent>\n */\nSidebar.GroupContent = function SidebarGroupContent(handle: Handle<Sidebar.GroupContentProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <div {...rest} data-slot=\"group-content\" mix={[vstack({ gap: \"0.125rem\" }), mix]} />;\n\t};\n};\n\n/**\n * Renders a list of nav rows: a native `<ul>` stacking {@link Sidebar.MenuItem}\n * children in a column with a small gap.\n *\n * @param handle Runtime handle carrying the host `<ul>`'s props.\n * @returns The render function producing the list's markup.\n * @example\n * <Sidebar.Menu>\n * \t<Sidebar.MenuItem>\n * \t\t<Sidebar.MenuLink href=\"/dashboard\">{t(\"nav.dashboard\")}</Sidebar.MenuLink>\n * \t</Sidebar.MenuItem>\n * </Sidebar.Menu>\n */\nSidebar.Menu = function SidebarMenu(handle: Handle<Sidebar.MenuProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<ul\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"menu\"\n\t\t\t\tmix={[is(\"full\"), minIs(\"0\"), vstack({ gap: \"0.125rem\" }), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a single row inside {@link Sidebar.Menu}: a relatively positioned\n * `<li>` whose own `:hover`/`:focus-within` state reveals a nested\n * {@link Sidebar.MenuAction} that stays invisible at rest.\n *\n * @param handle Runtime handle carrying the host `<li>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <Sidebar.MenuItem>\n * \t<Sidebar.MenuLink href=\"/inbox\">{t(\"nav.inbox\")}</Sidebar.MenuLink>\n * \t<Sidebar.MenuAction aria-label={t(\"nav.inboxSettings\")}>\n * \t\t<SettingsIcon aria-hidden />\n * \t</Sidebar.MenuAction>\n * </Sidebar.MenuItem>\n */\nSidebar.MenuItem = function SidebarMenuItem(handle: Handle<Sidebar.MenuItemProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<li\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"menu-item\"\n\t\t\t\tmix={[\n\t\t\t\t\trelative(),\n\t\t\t\t\tflex(),\n\t\t\t\t\t/**\n\t\t\t\t\t * A plain row centres what it holds and a row carrying a sub-menu stacks, putting the\n\t\t\t\t\t * nested list under it at full width. The selectors never match at once, so the layout\n\t\t\t\t\t * holds whichever order the cascade puts the pair in.\n\t\t\t\t\t */\n\t\t\t\t\twhen('&:not(:has([data-slot=\"menu-sub\"]))', items(\"center\")),\n\t\t\t\t\twhen('&:has([data-slot=\"menu-sub\"])', [flexCol(), items(\"stretch\")]),\n\t\t\t\t\twhen(\n\t\t\t\t\t\t\"&:hover [data-slot='menu-action'], &:focus-within [data-slot='menu-action']\",\n\t\t\t\t\t\topacity(100),\n\t\t\t\t\t),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<button>` row for an in-page action inside\n * {@link Sidebar.Menu}, sized through `data-size` and marked current via\n * `active`; its leading icon is muted, and a trailing label truncates.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <Sidebar.MenuButton onClick={openCommandPalette}>\n * \t<SearchIcon aria-hidden />\n * \t<span data-sidebar-collapsed-hide>{t(\"nav.search\")}</span>\n * </Sidebar.MenuButton>\n */\nSidebar.MenuButton = function SidebarMenuButton(handle: Handle<Sidebar.MenuButtonProps>) {\n\treturn () => {\n\t\tlet { size, active, mix, ...rest } = handle.props;\n\t\tlet resolvedSize = size ?? DEFAULT_MENU_BUTTON_SIZE;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"menu-button\"\n\t\t\t\tdata-size={resolvedSize}\n\t\t\t\tdata-active={active || undefined}\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t...menuRowMixins(),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<a>` row for navigation inside {@link Sidebar.Menu},\n * visually identical to {@link Sidebar.MenuButton}. `active` sets\n * `aria-current=\"page\"` when unset, with styling reading that attribute directly.\n *\n * @param handle Runtime handle carrying the host `<a>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <Sidebar.MenuLink href=\"/dashboard\" active>\n * \t<HomeIcon aria-hidden />\n * \t<span data-sidebar-collapsed-hide>{t(\"nav.dashboard\")}</span>\n * </Sidebar.MenuLink>\n */\nSidebar.MenuLink = function SidebarMenuLink(handle: Handle<Sidebar.MenuLinkProps>) {\n\treturn () => {\n\t\tlet { size, active, \"aria-current\": ariaCurrent, mix, ...rest } = handle.props;\n\t\tlet resolvedSize = size ?? DEFAULT_MENU_BUTTON_SIZE;\n\t\tlet resolvedAriaCurrent = resolveAriaCurrent(active, ariaCurrent);\n\n\t\treturn (\n\t\t\t<a\n\t\t\t\t{...rest}\n\t\t\t\taria-current={resolvedAriaCurrent}\n\t\t\t\tdata-slot=\"menu-link\"\n\t\t\t\tdata-size={resolvedSize}\n\t\t\t\tdata-active={active || undefined}\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t...menuRowMixins(),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Shared `@sdxc/u` mixins for {@link Sidebar.MenuButton} and\n * {@link Sidebar.MenuLink}, factored out since the two differ only in host\n * element and how their current/active state is expressed.\n */\nfunction menuRowMixins() {\n\treturn [\n\t\tflex(),\n\t\tis(\"full\"),\n\t\tminIs(\"0\"),\n\t\titems(\"center\"),\n\t\toverflow(\"hidden\"),\n\t\ttextAlign(\"start\"),\n\t\tweight(500),\n\t\ttextDecoration(\"none\"),\n\t\tfontSize(\"sm\"),\n\t\toutlineStyle(\"none\"),\n\t\twhen(\"& > svg:first-child, & > [data-slot='icon']:first-child\", [\n\t\t\tis(\"1rem\"),\n\t\t\tbs(\"1rem\"),\n\t\t\tshrink(),\n\t\t]),\n\t\twhen(\"& > span\", truncate()),\n\t\tdata(\"size\", \"sm\", [\n\t\t\tminBs(\"1.75rem\"),\n\t\t\tpb(\"0.375rem\"),\n\t\t\tfontSize(\"xs\"),\n\t\t\twhen(\"& > svg:first-child, & > [data-slot='icon']:first-child\", [\n\t\t\t\tis(\"0.875rem\"),\n\t\t\t\tbs(\"0.875rem\"),\n\t\t\t]),\n\t\t]),\n\t\tdata(\"size\", \"md\", minBs(\"2.25rem\")),\n\t\tdata(\"size\", \"lg\", [\n\t\t\tminBs(\"2.75rem\"),\n\t\t\tpb(\"0.625rem\"),\n\t\t\tfontSize(\"base\"),\n\t\t\twhen(\"& > svg:first-child, & > [data-slot='icon']:first-child\", [\n\t\t\t\tis(\"1.25rem\"),\n\t\t\t\tbs(\"1.25rem\"),\n\t\t\t]),\n\t\t]),\n\t\twhen(\"&:active\", scaleProperty(0.98)),\n\t\twhen(\"&:disabled\", [cursor(\"not-allowed\"), opacity(50)]),\n\t\twhen('&[aria-disabled=\"true\"]', [cursor(\"not-allowed\"), opacity(50)]),\n\t\tgap(\"0.75rem\"),\n\t\trounded(\"lg\"),\n\t\tpi(\"0.5rem\"),\n\t\tpb(\"0.5rem\"),\n\t\tfg(\"neutral\"),\n\t\ttransition(\n\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke\",\n\t\t),\n\t\thover([bg(\"neutral.bg-tint-hover\"), fg(\"neutral.emphasis\")]),\n\t\twhen(\"& > svg:first-child, & > [data-slot='icon']:first-child\", fg(\"neutral.muted\")),\n\t\twhen('&[data-active], &[aria-current]:not([aria-current=\"false\"])', [\n\t\t\tbg(\"neutral.bg-tint-hover\"),\n\t\t\tfg(\"neutral.emphasis\"),\n\t\t\twhen(\"& > svg:first-child, & > [data-slot='icon']:first-child\", fg(\"neutral.emphasis\")),\n\t\t]),\n\t\twhen(\"&:active\", bg(\"neutral.bg-tint-pressed\")),\n\t];\n}\n\n/**\n * Renders a small icon-only action anchored to {@link Sidebar.MenuItem}'s trailing\n * edge, revealed by `showOnHover`, with its pointer target grown to `--ui-target-size`.\n * In dev mode, an action with no accessible name logs a `console.warn`.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the action's markup.\n * @example\n * <Sidebar.MenuAction aria-label={t(\"nav.inboxSettings\")}>\n * \t<SettingsIcon aria-hidden />\n * </Sidebar.MenuAction>\n * @example\n * <Sidebar.MenuAction showOnHover={false} aria-label={t(\"nav.starred\")}>\n * \t<StarIcon aria-hidden />\n * </Sidebar.MenuAction>\n */\nSidebar.MenuAction = function SidebarMenuAction(handle: Handle<Sidebar.MenuActionProps>) {\n\treturn () => {\n\t\tlet { showOnHover, children, mix, ...rest } = handle.props;\n\t\tlet resolvedShowOnHover = showOnHover ?? DEFAULT_SHOW_ON_HOVER;\n\n\t\twarnIfNoAccessibleName(\n\t\t\thandle.props,\n\t\t\tchildren,\n\t\t\t\"Sidebar.MenuAction: an icon-only action needs an `aria-label` describing what it does — assistive technology has no accessible text to announce otherwise.\",\n\t\t);\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"menu-action\"\n\t\t\t\tdata-show-on-hover={resolvedShowOnHover ? undefined : \"false\"}\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\tabsolute(),\n\t\t\t\t\tinsIe(\"0.375rem\"),\n\t\t\t\t\tinsBs(\"50%\"),\n\t\t\t\t\ttranslateProperty(\"0 -50%\"),\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\tis(\"1.5rem\"),\n\t\t\t\t\tbs(\"1.5rem\"),\n\t\t\t\t\thitArea(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\topacity(0),\n\t\t\t\t\tfocusVisible(opacity(100)),\n\t\t\t\t\twhen(\"&:disabled\", [cursor(\"not-allowed\"), opacity(50)]),\n\t\t\t\t\tdata(\"show-on-hover\", \"false\", opacity(100)),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\ttransition(\n\t\t\t\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke\",\n\t\t\t\t\t),\n\t\t\t\t\thover([bg(\"neutral.bg-tint-pressed\"), fg(\"neutral\")]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</button>\n\t\t);\n\t};\n};\n\n/**\n * Renders a small count or status pill pinned to the trailing edge of a\n * {@link Sidebar.MenuButton} or {@link Sidebar.MenuLink} row, hidden once\n * the ancestor {@link Sidebar} collapses to its icon-only rail.\n *\n * @param handle Runtime handle carrying the host `<span>`'s props.\n * @returns The render function producing the pill's markup.\n * @example\n * <Sidebar.MenuLink href=\"/inbox\">\n * \t{t(\"nav.inbox\")}\n * \t<Sidebar.MenuBadge>24</Sidebar.MenuBadge>\n * </Sidebar.MenuLink>\n */\nSidebar.MenuBadge = function SidebarMenuBadge(handle: Handle<Sidebar.MenuBadgeProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<span\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"menu-badge\"\n\t\t\t\tmix={[\n\t\t\t\t\tmis(\"auto\"),\n\t\t\t\t\tshrink(),\n\t\t\t\t\tfontSize(\"xs\"),\n\t\t\t\t\tweight(600),\n\t\t\t\t\ttabularNums(),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tpi(\"0.375rem\"),\n\t\t\t\t\tpb(\"0.125rem\"),\n\t\t\t\t\tbg(\"neutral.bg-tint-hover\"),\n\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a static loading placeholder shaped like {@link Sidebar.MenuButton}:\n * an optional icon-shaped {@link Skeleton} block followed by a text-shaped\n * one; compose `pulse()` or `shimmer()` through `mix` for a loading cue.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the placeholder's markup.\n * @example\n * <Sidebar.MenuSkeleton showIcon />\n * @example\n * <Sidebar.MenuSkeleton style={{ inlineSize: \"70%\" }} />\n */\nSidebar.MenuSkeleton = function SidebarMenuSkeleton(handle: Handle<Sidebar.MenuSkeletonProps>) {\n\treturn () => {\n\t\tlet { showIcon, mix, ...rest } = handle.props;\n\t\tlet resolvedShowIcon = showIcon ?? DEFAULT_SHOW_ICON;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"menu-skeleton\"\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tbs(\"2.25rem\"),\n\t\t\t\t\tgap(\"0.75rem\"),\n\t\t\t\t\tpi(\"0.5rem\"),\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{resolvedShowIcon && (\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tdata-slot=\"menu-skeleton-icon\"\n\t\t\t\t\t\tmix={[is(\"1rem\"), bs(\"1rem\"), shrink(), rounded(\"sm\"), bg(\"neutral.border\")]}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<span\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tdata-slot=\"menu-skeleton-text\"\n\t\t\t\t\tmix={[bs(\"1rem\"), grow(), is(\"60%\"), rounded(\"md\"), bg(\"neutral.border\")]}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders a nested list of sub-rows beneath a {@link Sidebar.MenuItem}: a\n * `<ul>` indented from and bordered against the rail's inline-start edge,\n * hidden once the ancestor {@link Sidebar} collapses to its icon-only rail.\n *\n * @param handle Runtime handle carrying the host `<ul>`'s props.\n * @returns The render function producing the nested list's markup.\n * @example\n * <Sidebar.MenuSub>\n * \t<Sidebar.MenuSubItem>\n * \t\t<Sidebar.MenuSubLink href=\"/settings/profile\">{t(\"nav.profile\")}</Sidebar.MenuSubLink>\n * \t</Sidebar.MenuSubItem>\n * </Sidebar.MenuSub>\n */\nSidebar.MenuSub = function SidebarMenuSub(handle: Handle<Sidebar.MenuSubProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<ul\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"menu-sub\"\n\t\t\t\tmix={[\n\t\t\t\t\trelative(),\n\t\t\t\t\tmis(\"1rem\"),\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tborderEdge(\"inline-start\", { width: 1, style: \"solid\" }),\n\t\t\t\t\tpis(\"0.625rem\"),\n\t\t\t\t\tgap(\"0.125rem\"),\n\t\t\t\t\tborder(\"neutral\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a single row inside {@link Sidebar.MenuSub}: a plain `<li>`.\n *\n * @param handle Runtime handle carrying the host `<li>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <Sidebar.MenuSubItem>\n * \t<Sidebar.MenuSubLink href=\"/settings/profile\">{t(\"nav.profile\")}</Sidebar.MenuSubLink>\n * </Sidebar.MenuSubItem>\n */\nSidebar.MenuSubItem = function SidebarMenuSubItem(handle: Handle<Sidebar.MenuSubItemProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <li {...rest} data-slot=\"menu-sub-item\" mix={[flex(), items(\"center\"), mix]} />;\n\t};\n};\n\n/**\n * Renders a native `<button>` row for an in-page action inside\n * {@link Sidebar.MenuSub}, smaller and more muted than\n * {@link Sidebar.MenuButton}, marked current through `active`.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <Sidebar.MenuSubButton onClick={runQuickAction}>{t(\"nav.markAllRead\")}</Sidebar.MenuSubButton>\n */\nSidebar.MenuSubButton = function SidebarMenuSubButton(handle: Handle<Sidebar.MenuSubButtonProps>) {\n\treturn () => {\n\t\tlet { active, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"menu-sub-button\"\n\t\t\t\tdata-active={active || undefined}\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t...menuSubRowMixins(),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<a>` row for navigation inside {@link Sidebar.MenuSub},\n * visually identical to {@link Sidebar.MenuSubButton}. `active` sets\n * `aria-current=\"page\"` when `aria-current` is otherwise unset.\n *\n * @param handle Runtime handle carrying the host `<a>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <Sidebar.MenuSubLink href=\"/settings/profile\" active>{t(\"nav.profile\")}</Sidebar.MenuSubLink>\n */\nSidebar.MenuSubLink = function SidebarMenuSubLink(handle: Handle<Sidebar.MenuSubLinkProps>) {\n\treturn () => {\n\t\tlet { active, \"aria-current\": ariaCurrent, mix, ...rest } = handle.props;\n\t\tlet resolvedAriaCurrent = resolveAriaCurrent(active, ariaCurrent);\n\n\t\treturn (\n\t\t\t<a\n\t\t\t\t{...rest}\n\t\t\t\taria-current={resolvedAriaCurrent}\n\t\t\t\tdata-slot=\"menu-sub-link\"\n\t\t\t\tdata-active={active || undefined}\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t...menuSubRowMixins(),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Shared `@sdxc/u` mixins for {@link Sidebar.MenuSubButton} and\n * {@link Sidebar.MenuSubLink}.\n */\nfunction menuSubRowMixins() {\n\treturn [\n\t\tflex(),\n\t\tminBs(\"2rem\"),\n\t\tis(\"full\"),\n\t\titems(\"center\"),\n\t\ttextAlign(\"start\"),\n\t\ttextDecoration(\"none\"),\n\t\tfontSize(\"sm\"),\n\t\twhen('&[data-active], &[aria-current]:not([aria-current=\"false\"])', weight(500)),\n\t\twhen(\"&:active\", scaleProperty(0.98)),\n\t\twhen(\"&:disabled\", [cursor(\"not-allowed\"), opacity(50)]),\n\t\twhen('&[aria-disabled=\"true\"]', [cursor(\"not-allowed\"), opacity(50)]),\n\t\tgap(\"0.5rem\"),\n\t\trounded(\"lg\"),\n\t\tpi(\"0.625rem\"),\n\t\tpb(\"0.375rem\"),\n\t\tfg(\"neutral.muted\"),\n\t\ttransition(\n\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke\",\n\t\t),\n\t\thover([bg(\"neutral.bg-tint-hover\"), fg(\"neutral.emphasis\")]),\n\t\twhen('&[data-active], &[aria-current]:not([aria-current=\"false\"])', [\n\t\t\tbg(\"neutral.bg-tint-hover\"),\n\t\t\tfg(\"neutral.emphasis\"),\n\t\t]),\n\t\twhen(\"&:active\", bg(\"neutral.bg-tint-pressed\")),\n\t];\n}\n\n/**\n * Renders a thin drag-styled affordance along {@link Sidebar}'s own edge,\n * toggling {@link Sidebar.Trigger}'s checkbox through a native `<label>`\n * association; marked `aria-hidden` since that checkbox is the accessible control.\n *\n * @param handle Runtime handle carrying the host `<label>`'s props.\n * @returns The render function producing the rail's markup.\n * @example\n * <Sidebar>\n * \t<Sidebar.Header>...</Sidebar.Header>\n * \t<Sidebar.Rail htmlFor=\"app-sidebar-toggle\" />\n * </Sidebar>\n */\nSidebar.Rail = function SidebarRail(handle: Handle<Sidebar.RailProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<label\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"rail\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ \"aria-hidden\": \"true\" }),\n\t\t\t\t\tabsolute(),\n\t\t\t\t\tinsBs(\"0\"),\n\t\t\t\t\tinsBe(\"0\"),\n\t\t\t\t\tis(\"1rem\"),\n\t\t\t\t\tz(20),\n\t\t\t\t\thidden(),\n\t\t\t\t\tcursor(\"col-resize\"),\n\t\t\t\t\twhen('[data-side=\"left\"] &', insRight(\"-1rem\")),\n\t\t\t\t\twhen('[data-side=\"right\"] &', insLeft(\"-1rem\")),\n\t\t\t\t\tafter([\n\t\t\t\t\t\tabsolute(),\n\t\t\t\t\t\tis(\"2px\"),\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\tinsBs(\"0\"),\n\t\t\t\t\t\tinsBe(\"0\"),\n\t\t\t\t\t\tinsIs(\"50%\"),\n\t\t\t\t\t\ttranslateProperty(\"-50% 0\"),\n\t\t\t\t\t\tpseudoContent('\"\"'),\n\t\t\t\t\t\ttransitionProperty(\"background-color\"),\n\t\t\t\t\t\ttransitionDuration(\"150ms\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(WIDE_SHELL_QUERY, [flex(), items(\"center\"), justify(\"center\")]),\n\t\t\t\t\thover(after(bg(\"neutral.border\"))),\n\t\t\t\t\twhen(\"&:active\", after(bg(\"brand.ring\"))),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders the collapse toggle: a native, keyboard-reachable `<input type=\"checkbox\">`\n * in a button-styled `<label>` whose pointer target grows to `--ui-target-size`; its\n * `:checked` state drives every collapse rule in {@link Sidebar.Provider}.\n *\n * @param handle Runtime handle carrying the host checkbox's props.\n * @returns The render function producing the toggle's markup.\n * @example\n * <Sidebar.Trigger id=\"app-sidebar-toggle\" aria-label={t(\"nav.toggleSidebar\")} />\n * @example\n * <Sidebar.Trigger id=\"app-sidebar-toggle\" defaultChecked aria-label={t(\"nav.toggleSidebar\")} />\n */\nSidebar.Trigger = function SidebarTrigger(handle: Handle<Sidebar.TriggerProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<label\n\t\t\t\tdata-slot=\"trigger\"\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:has(input:focus-visible)\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\trelative(),\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\tis(\"2rem\"),\n\t\t\t\t\tbs(\"2rem\"),\n\t\t\t\t\thitArea(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tcursor(\"pointer\"),\n\t\t\t\t\twhen(\"& > svg\", [is(\"1rem\"), bs(\"1rem\")]),\n\t\t\t\t\twhen(\"&:has(input:disabled)\", [cursor(\"not-allowed\"), opacity(50)]),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\ttransition(\n\t\t\t\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke\",\n\t\t\t\t\t),\n\t\t\t\t\thover([bg(\"neutral.bg-tint-hover\"), fg(\"neutral.emphasis\")]),\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<PanelLeftIcon />\n\t\t\t\t<input type=\"checkbox\" {...rest} data-slot=\"toggle\" mix={[visuallyHidden(), mix]} />\n\t\t\t</label>\n\t\t);\n\t};\n};\n\n/**\n * Renders the shell's main content region: {@link ScrollArea.Viewport}\n * laid out as a growing flex column that resizes as {@link Sidebar}\n * collapses or expands, declaring {@link INSET_CONTAINER_NAME} for nested sizing.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the inset's markup.\n * @example\n * <Sidebar.Inset>\n * \t<Sidebar.Trigger id=\"app-sidebar-toggle\" aria-label={t(\"nav.toggleSidebar\")} />\n * \t<main>{children}</main>\n * </Sidebar.Inset>\n */\nSidebar.Inset = function SidebarInset(handle: Handle<Sidebar.InsetProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<ScrollArea.Viewport\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"inset\"\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tgrow(),\n\t\t\t\t\tminIs(\"0\"),\n\t\t\t\t\tminBs(\"0\"),\n\t\t\t\t\tbs(\"auto\"),\n\t\t\t\t\tcontainer(INSET_CONTAINER_NAME),\n\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a hairline divider between two stretches of rail content:\n * identical to {@link Separator}, with the small block-axis and inline-axis\n * margins {@link Sidebar}'s own content regions expect around one.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the divider's markup.\n * @example\n * <Sidebar.Group>...</Sidebar.Group>\n * <Sidebar.Separator />\n * <Sidebar.Group>...</Sidebar.Group>\n */\nSidebar.Separator = function SidebarSeparator(handle: Handle<Sidebar.SeparatorProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <Separator {...rest} data-slot=\"separator\" mix={[m(\"0.5rem\"), mix]} />;\n\t};\n};\n"
15
+ },
16
+ "test": {
17
+ "path": "sidebar.test.tsx",
18
+ "content": "/**\n * Tests for {@link \"./sidebar\"}, covering the rail slots a consumer holds\n * against the viewport: a header or footer that lets the rail's background\n * show through paints the scrolling nav behind it in plain sight, so each\n * slot's own paint is asserted over `renderToString`'s output, as is the drawer\n * staying hidden while closed.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { Sidebar } from \"@sdxc/ui/sidebar\";\n\ndescribe(\"Sidebar.Header\", () => {\n\ttest(\"paints the surface it sits on rather than letting it show through\", async () => {\n\t\tlet html = await renderToString(<Sidebar.Header>sdxc</Sidebar.Header>);\n\n\t\texpect(String(html)).toMatch(/background-color:\\s*inherit/);\n\t});\n});\n\ndescribe(\"Sidebar.Footer\", () => {\n\ttest(\"paints the surface it sits on rather than letting it show through\", async () => {\n\t\tlet html = await renderToString(<Sidebar.Footer>account</Sidebar.Footer>);\n\n\t\texpect(String(html)).toMatch(/background-color:\\s*inherit/);\n\t});\n});\n\ndescribe(\"Sidebar.MobileNav\", () => {\n\ttest(\"lays the drawer out only while it is open, so a closed one stays hidden\", async () => {\n\t\tlet html = String(\n\t\t\tawait renderToString(\n\t\t\t\t<Sidebar.MobileNav id=\"mobile-nav\" aria-label=\"Main\">\n\t\t\t\t\tnav\n\t\t\t\t</Sidebar.MobileNav>,\n\t\t\t),\n\t\t);\n\t\tlet css = [...html.matchAll(/<style[^>]*>([\\s\\S]*?)<\\/style>/g)]\n\t\t\t.map((match) => match[1])\n\t\t\t.join(\"\\n\");\n\n\t\tlet displays = css.match(/display:\\s*flex/g) ?? [];\n\t\tlet gated = css.match(/&\\[open\\]\\s*\\{\\s*display:\\s*flex/g) ?? [];\n\n\t\texpect(displays.length).toBeGreaterThan(0);\n\t\texpect(gated.length).toBe(displays.length);\n\t});\n});\n\ndescribe(\"small sidebar controls\", () => {\n\ttest.each([\n\t\t[\"Sidebar.GroupAction\", <Sidebar.GroupAction aria-label=\"Add\">+</Sidebar.GroupAction>],\n\t\t[\"Sidebar.MenuAction\", <Sidebar.MenuAction aria-label=\"Settings\">…</Sidebar.MenuAction>],\n\t\t[\"Sidebar.Trigger\", <Sidebar.Trigger id=\"toggle\" aria-label=\"Toggle sidebar\" />],\n\t])(\"%s grows its pointer target to the minimum target size\", async (_, node) => {\n\t\tlet html = String(await renderToString(node));\n\n\t\texpect(html).toContain(\"--ui-target-size\");\n\t\texpect(html).toMatch(/position:\\s*relative|position:\\s*absolute/);\n\t});\n});\n"
19
+ }
20
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "skeleton",
3
+ "changedIn": "2026.10.10",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "Skeleton"
7
+ ],
8
+ "source": {
9
+ "path": "skeleton.tsx",
10
+ "content": "/**\n * A decorative loading placeholder rendered as a single static block,\n * sized to stand in for the content it precedes and showing a still,\n * inert silhouette while data loads.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { bs, is } from \"@sdxc/u/size\";\nimport { attrs } from \"remix/component\";\n\n/**\n * Default `aria-hidden` value applied through {@link attrs}, keeping a\n * placeholder out of the accessibility tree unless a consumer sets\n * `aria-hidden=\"false\"` to expose a loading label to assistive tech.\n */\nconst DEFAULT_ARIA_HIDDEN = \"true\";\n\n/**\n * Props accepted by {@link Skeleton}.\n */\nexport namespace Skeleton {\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * A placeholder's box shape comes from the space it renders into, tuned\n\t * through `style`, a wrapping layout, or a `css()` mixin via `mix`.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n}\n\n/**\n * A static loading placeholder: a rounded block filled with the neutral\n * border color, sized to its container and one text line tall by default.\n * Compose `pulse()` or `shimmer()` through `mix` for a motion cue.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the placeholder's markup.\n * @example\n * <Skeleton mix={[pulse()]} />\n * @example\n * <Skeleton style={{ blockSize: \"2.5rem\", inlineSize: \"2.5rem\", borderRadius: \"9999px\" }} />\n * @example\n * <Skeleton aria-hidden=\"false\" aria-label={t(\"status.loadingProfile\")} />\n */\nexport function Skeleton(handle: Handle<Skeleton.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ \"aria-hidden\": DEFAULT_ARIA_HIDDEN }),\n\t\t\t\t\tbs(\"var(--ui-skeleton-block-size, 1rem)\"),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tbg(\"neutral.border\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n"
11
+ },
12
+ "test": null
13
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "slider",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "Slider"
7
+ ],
8
+ "source": {
9
+ "path": "slider.tsx",
10
+ "content": "/**\n * A single-value range control built on a native `<input type=\"range\">`,\n * paired with a track that draws its own background rail and a live fill\n * bar, plus an `<output>` for reporting the current value. The root shares\n * the resolved range and value with every part through component context,\n * so a track's fill bar and a thumb's native attributes always agree\n * without a consumer repeating the same numbers twice.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport {\n\tabsolute,\n\tafter,\n\tappearance,\n\tbasis,\n\tbefore,\n\tbg,\n\tborder,\n\tbs,\n\tcursor,\n\tgrow,\n\tinsBe,\n\tinsBs,\n\tinsIe,\n\tinsIs,\n\tinset,\n\tis,\n\titems,\n\tm,\n\tminBs,\n\tminIs,\n\toutlineStyle,\n\tpseudoContent,\n\traw,\n\trelative,\n\trounded,\n\tshrink,\n\ttabularNums,\n\ttranslateX,\n\ttranslateY,\n\tvstack,\n\twhen,\n\tz,\n} from \"@sdxc/u\";\n\nimport { outputCaptionText } from \"@sdxc/ui/styles\";\nimport { rangeThumbAppearance } from \"@sdxc/ui/styles\";\nimport { mergeStyle } from \"@sdxc/ui/utils\";\nimport { resolveFillPercent } from \"@sdxc/ui/utils\";\n\n/** Default {@link Slider.Props} orientation, applied when `orientation` is omitted. */\nconst DEFAULT_ORIENTATION: Slider.Orientation = \"horizontal\";\n\n/** Default {@link Slider.Props} lower bound, applied when `min` is omitted. */\nconst DEFAULT_MIN = 0;\n\n/** Default {@link Slider.Props} upper bound, applied when `max` is omitted. */\nconst DEFAULT_MAX = 100;\n\n/** Default {@link Slider.ThumbProps} step, applied when `step` is omitted. */\nconst DEFAULT_STEP = 1;\n\n/**\n * Negative inset growing {@link Slider.Thumb}'s native input across the track's thin\n * axis to the larger of the thumb and `--ui-target-size`, clamped at zero so a track\n * already that thick keeps its own box.\n */\nconst THUMB_HIT_INSET =\n\t\"min(0px, calc((100% - max(var(--ui-slider-thumb-size, 1.25rem), var(--ui-target-size, 1.5rem))) / 2))\";\n\n/**\n * Prop types for {@link Slider} and its compound parts.\n */\nexport namespace Slider {\n\t/**\n\t * Axis the track's fill bar and thumb travel along: a full-width row, or\n\t * a full-height column.\n\t */\n\texport type Orientation = \"horizontal\" | \"vertical\";\n\n\t/**\n\t * Value {@link Slider} shares through component context so every nested\n\t * {@link Slider.Track}, {@link Slider.Thumb}, and {@link Slider.Output}\n\t * reads the same resolved range, value, orientation, and thumb id.\n\t */\n\texport interface Context {\n\t\t/** Resolved lower bound of the range, shared with {@link Slider.Thumb}. */\n\t\tmin: number;\n\t\t/** Resolved upper bound of the range, shared with {@link Slider.Thumb}. */\n\t\tmax: number;\n\t\t/** Resolved current value, used to compute {@link Slider.Track}'s fill bar and default {@link Slider.Thumb}'s own value. */\n\t\tvalue: number;\n\t\t/** Layout axis, read by {@link Slider.Thumb} to set its accessible orientation. */\n\t\torientation: Orientation;\n\t\t/**\n\t\t * Id shared by {@link Slider.Thumb} (as its own `id`) and\n\t\t * {@link Slider.Output} (as its `htmlFor`) so the two associate\n\t\t * natively without either needing an explicit id from the consumer.\n\t\t */\n\t\tthumbId: string;\n\t}\n\n\t/**\n\t * Props accepted by {@link Slider}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Layout axis. Defaults to {@link DEFAULT_ORIENTATION}. */\n\t\torientation?: Orientation;\n\t\t/** Lower bound of the range. Defaults to {@link DEFAULT_MIN}. */\n\t\tmin?: number;\n\t\t/** Upper bound of the range. Defaults to {@link DEFAULT_MAX}. */\n\t\tmax?: number;\n\t\t/** Current value, for a slider whose value the consumer tracks itself. */\n\t\tvalue?: number;\n\t\t/** Starting value, for a slider that never tracks its own value. */\n\t\tdefaultValue?: number;\n\t}\n\n\t/**\n\t * Props accepted by {@link Slider.Track}.\n\t */\n\texport interface TrackProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<input>` attribute except `type` and `role`, fixed to\n\t * `\"range\"` and the platform's implicit `\"slider\"` role. `min`/`max`/`step`\n\t * override the range inherited from the nearest ancestor {@link Slider}.\n\t */\n\texport interface ThumbProps extends Omit<TagProps<\"input\">, \"type\" | \"role\"> {}\n\n\t/**\n\t * Props accepted by {@link Slider.Output}.\n\t */\n\texport interface OutputProps extends TagProps<\"output\"> {}\n}\n\n/**\n * Renders the root `<div>`, stacking its children and resolving range, value, orientation\n * and thumb id into context. Nested parts scope orientation rules to its `data-slot`, so an\n * ancestor carrying `data-orientation` (a toolbar, a scroll viewport) leaves its layout alone.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props and providing {@link Slider.Context}.\n * @returns The render function producing the root's markup.\n * @example\n * <Slider aria-label={t(\"settings.volume\")} min={0} max={100} defaultValue={40}>\n * \t<Slider.Output />\n * \t<Slider.Track>\n * \t\t<Slider.Thumb />\n * \t</Slider.Track>\n * </Slider>\n * @example\n * <Slider orientation=\"vertical\" min={0} max={10} defaultValue={6}>\n * \t<Slider.Track>\n * \t\t<Slider.Thumb aria-label={t(\"equalizer.band\", { hz: 250 })} />\n * \t</Slider.Track>\n * </Slider>\n */\nexport function Slider(handle: Handle<Slider.Props, Slider.Context>) {\n\treturn () => {\n\t\tlet { orientation, min, max, value, defaultValue, mix, ...rest } = handle.props;\n\t\tlet resolvedOrientation = orientation ?? DEFAULT_ORIENTATION;\n\t\tlet resolvedMin = min ?? DEFAULT_MIN;\n\t\tlet resolvedMax = max ?? DEFAULT_MAX;\n\t\tlet resolvedValue = value ?? defaultValue ?? resolvedMin;\n\n\t\thandle.context.set({\n\t\t\tmin: resolvedMin,\n\t\t\tmax: resolvedMax,\n\t\t\tvalue: resolvedValue,\n\t\t\torientation: resolvedOrientation,\n\t\t\tthumbId: handle.id,\n\t\t});\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-slot=\"slider\"\n\t\t\t\tdata-orientation={resolvedOrientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tvstack({ gap: \"0.5rem\" }),\n\t\t\t\t\twhen('&[data-orientation=\"horizontal\"]', [is(\"100%\"), minIs(\"10rem\")]),\n\t\t\t\t\twhen('&[data-orientation=\"vertical\"]', [bs(\"10rem\"), items(\"center\")]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders the visual track: a `position: relative` `<div>` that draws a rail\n * and fill bar as pseudo-elements sized from context's resolved value, and\n * overlays a nested {@link Slider.Thumb} so native drag spans its full length.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the track's markup.\n * @example\n * <Slider.Track>\n * \t<Slider.Thumb />\n * </Slider.Track>\n */\nSlider.Track = function SliderTrack(handle: Handle<Slider.TrackProps>) {\n\treturn () => {\n\t\tlet { mix, style, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Slider);\n\t\tlet fillPercent = resolveFillPercent(context.min, context.max, context.value);\n\t\tlet resolvedStyle = mergeStyle(style, { \"--ui-slider-fill\": `${fillPercent}%` });\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tstyle={resolvedStyle}\n\t\t\t\tmix={[\n\t\t\t\t\trelative(),\n\t\t\t\t\twhen('[data-orientation=\"horizontal\"] &', [\n\t\t\t\t\t\tis(\"100%\"),\n\t\t\t\t\t\tbs(\"var(--ui-slider-thumb-size, 1.25rem)\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('[data-slot=\"slider\"][data-orientation=\"vertical\"] &', [\n\t\t\t\t\t\tis(\"var(--ui-slider-thumb-size, 1.25rem)\"),\n\t\t\t\t\t\tminBs(\"0\"),\n\t\t\t\t\t]),\n\t\t\t\t\tbefore([absolute(), rounded(\"full\"), bg(\"neutral.border\"), pseudoContent('\"\"')]),\n\t\t\t\t\tafter([absolute(), rounded(\"full\"), bg(\"brand.solid\"), pseudoContent('\"\"')]),\n\t\t\t\t\twhen('[data-slot=\"slider\"][data-orientation=\"vertical\"] &', [\n\t\t\t\t\t\tgrow(),\n\t\t\t\t\t\tshrink(1),\n\t\t\t\t\t\tbasis(\"0%\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('[data-orientation=\"horizontal\"] &::before', [\n\t\t\t\t\t\tbs(\"var(--ui-slider-track-thickness, 0.5rem)\"),\n\t\t\t\t\t\tinsIs(\"0\"),\n\t\t\t\t\t\tinsIe(\"0\"),\n\t\t\t\t\t\tinsBs(\"50%\"),\n\t\t\t\t\t\ttranslateY(\"-50%\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('[data-orientation=\"horizontal\"] &::after', [\n\t\t\t\t\t\tbs(\"var(--ui-slider-track-thickness, 0.5rem)\"),\n\t\t\t\t\t\tis(\"var(--ui-slider-fill, 0%)\"),\n\t\t\t\t\t\tinsIs(\"0\"),\n\t\t\t\t\t\tinsBs(\"50%\"),\n\t\t\t\t\t\ttranslateY(\"-50%\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('[data-slot=\"slider\"][data-orientation=\"vertical\"] &::before', [\n\t\t\t\t\t\tis(\"var(--ui-slider-track-thickness, 0.5rem)\"),\n\t\t\t\t\t\tbs(\"100%\"),\n\t\t\t\t\t\tinsBs(\"0\"),\n\t\t\t\t\t\tinsIs(\"50%\"),\n\t\t\t\t\t\ttranslateX(\"-50%\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('[data-slot=\"slider\"][data-orientation=\"vertical\"] &::after', [\n\t\t\t\t\t\tis(\"var(--ui-slider-track-thickness, 0.5rem)\"),\n\t\t\t\t\t\tbs(\"var(--ui-slider-fill, 0%)\"),\n\t\t\t\t\t\tinsBe(\"0\"),\n\t\t\t\t\t\tinsIs(\"50%\"),\n\t\t\t\t\t\ttranslateX(\"-50%\"),\n\t\t\t\t\t]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders the interactive thumb: a native `<input type=\"range\">` reset to\n * cover {@link Slider.Track}'s full box so native drag and keyboard control\n * span its whole length, rotating with `writing-mode` when vertical.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the thumb's markup.\n * @example\n * <Slider.Thumb aria-label={t(\"settings.volume\")} />\n * @example\n * <Slider.Thumb aria-label={t(\"settings.brightness\")} disabled />\n */\nSlider.Thumb = function SliderThumb(handle: Handle<Slider.ThumbProps>) {\n\treturn () => {\n\t\tlet { id, min, max, step, value, defaultValue, mix, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Slider);\n\t\tlet resolvedStep = step ?? DEFAULT_STEP;\n\t\tlet resolvedValue = value ?? defaultValue ?? context.value;\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"range\"\n\t\t\t\tid={id ?? context.thumbId}\n\t\t\t\tmin={min ?? context.min}\n\t\t\t\tmax={max ?? context.max}\n\t\t\t\tstep={resolvedStep}\n\t\t\t\tdefaultValue={resolvedValue}\n\t\t\t\taria-orientation={context.orientation === \"vertical\" ? \"vertical\" : undefined}\n\t\t\t\tmix={[\n\t\t\t\t\trangeThumbAppearance(\"--ui-slider-thumb-size\", \"--ui-slider-thumb-border-width\"),\n\t\t\t\t\tabsolute(),\n\t\t\t\t\tinset(\"0\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * The native input reaches past the track across its thin axis to a full pointer\n\t\t\t\t\t * target, centred so the thumb stays on the visible rail. Its block axis is that\n\t\t\t\t\t * thin axis in both orientations, since a vertical input runs `vertical-lr`.\n\t\t\t\t\t */\n\t\t\t\t\tinsBs(THUMB_HIT_INSET),\n\t\t\t\t\tinsBe(THUMB_HIT_INSET),\n\t\t\t\t\tz(10),\n\t\t\t\t\tm(\"0\"),\n\t\t\t\t\tappearance(),\n\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\tcursor(\"pointer\"),\n\t\t\t\t\twhen(\"&:disabled\", cursor(\"not-allowed\")),\n\t\t\t\t\toutlineStyle(\"none\"),\n\t\t\t\t\twhen(\"&::-webkit-slider-runnable-track\", [appearance(), bs(\"100%\"), bg(\"transparent\")]),\n\t\t\t\t\twhen(\"&::-moz-range-track\", [\n\t\t\t\t\t\tappearance(),\n\t\t\t\t\t\tbs(\"100%\"),\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\tborder({ style: \"none\" }),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\n\t\t\t\t\t\t'[data-slot=\"slider\"][data-orientation=\"vertical\"] &',\n\t\t\t\t\t\traw({ writingMode: \"vertical-lr\", direction: \"rtl\" }),\n\t\t\t\t\t),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a live readout: a native `<output>` associated by default with\n * the nearest ancestor {@link Slider}'s thumb via `htmlFor`, so assistive\n * technology knows which control it reports on. Pass the value as `children`.\n *\n * @param handle Runtime handle carrying the host `<output>`'s props.\n * @returns The render function producing the readout's markup.\n * @example\n * <Slider.Output>{new Intl.NumberFormat(locale, { style: \"percent\" }).format(0.4)}</Slider.Output>\n */\nSlider.Output = function SliderOutput(handle: Handle<Slider.OutputProps>) {\n\treturn () => {\n\t\tlet { htmlFor, mix, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Slider);\n\n\t\treturn (\n\t\t\t<output\n\t\t\t\t{...rest}\n\t\t\t\thtmlFor={htmlFor ?? context.thumbId}\n\t\t\t\tmix={[outputCaptionText(), tabularNums(), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
11
+ },
12
+ "test": {
13
+ "path": "slider.test.tsx",
14
+ "content": "/**\n * Tests for {@link Slider}: the native input's pointer target across the track's thin\n * axis, which a vertical slider reaches through the input's own `vertical-lr` block axis,\n * and the track leaving that wider input unclipped.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { Slider } from \"@sdxc/ui/slider\";\n\n/** The negative block inset every orientation's input carries, as the server emits it. */\nconst HIT_INSET =\n\t\"min\\\\(0px, calc\\\\(\\\\(100% - max\\\\(var\\\\(--ui-slider-thumb-size, 1\\\\.25rem\\\\), var\\\\(--ui-target-size, 1\\\\.5rem\\\\)\\\\)\\\\) / 2\\\\)\\\\)\";\n\ndescribe(Slider.name, () => {\n\ttest(\"grows a vertical slider's input to --ui-target-size across the track's width\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Slider orientation=\"vertical\" defaultValue={6} max={10}>\n\t\t\t\t<Slider.Track>\n\t\t\t\t\t<Slider.Thumb aria-label=\"Gain\" />\n\t\t\t\t</Slider.Track>\n\t\t\t</Slider>,\n\t\t);\n\n\t\texpect(html).toMatch(new RegExp(`\\\\.rmxc-\\\\w+ \\\\{\\\\s*inset-block-start: ${HIT_INSET};`));\n\t\texpect(html).toMatch(new RegExp(`\\\\.rmxc-\\\\w+ \\\\{\\\\s*inset-block-end: ${HIT_INSET};`));\n\t\texpect(html).not.toMatch(/data-orientation=\"horizontal\"\\] & \\{ inset-block-start/);\n\t\texpect(html).not.toContain(\"overflow: hidden\");\n\t});\n\n\ttest(\"keeps a horizontal slider's input reaching --ui-target-size across the track's height\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Slider defaultValue={40}>\n\t\t\t\t<Slider.Track>\n\t\t\t\t\t<Slider.Thumb aria-label=\"Volume\" />\n\t\t\t\t</Slider.Track>\n\t\t\t</Slider>,\n\t\t);\n\n\t\texpect(html).toMatch(new RegExp(`inset-block-start: ${HIT_INSET};`));\n\t\texpect(html).toMatch(new RegExp(`inset-block-end: ${HIT_INSET};`));\n\t});\n});\n"
15
+ }
16
+ }