@sdxc/kit 2026.10.30 → 2026.11.3

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 (162) hide show
  1. package/README.md +59 -0
  2. package/changelog.jsonl +346 -0
  3. package/config.schema.json +14 -0
  4. package/dist/ci/install.d.ts +15 -0
  5. package/dist/ci/install.js +27 -0
  6. package/dist/ci/locate.d.ts +23 -0
  7. package/dist/ci/locate.js +43 -0
  8. package/dist/cli.js +5 -0
  9. package/dist/commands/ci/list.d.ts +16 -0
  10. package/dist/commands/ci/list.js +24 -0
  11. package/dist/commands/ci/run.d.ts +65 -0
  12. package/dist/commands/ci/run.js +36 -0
  13. package/dist/commands/ci/signoff.d.ts +15 -0
  14. package/dist/commands/ci/signoff.js +15 -0
  15. package/dist/commands/ci/verify.d.ts +17 -0
  16. package/dist/commands/ci/verify.js +15 -0
  17. package/dist/commands/create.js +3 -0
  18. package/dist/commands/pkg.d.ts +16 -0
  19. package/dist/commands/pkg.js +71 -0
  20. package/dist/commands/routes.d.ts +1 -1
  21. package/dist/config.d.ts +10 -4
  22. package/dist/config.js +8 -0
  23. package/dist/contract.d.ts +60 -1
  24. package/dist/contract.js +46 -0
  25. package/dist/create/workspace.d.ts +15 -0
  26. package/dist/create/workspace.js +42 -0
  27. package/dist/doctor/checks.js +4 -0
  28. package/dist/doctor/ci.d.ts +15 -0
  29. package/dist/doctor/ci.js +63 -0
  30. package/dist/doctor/translations.d.ts +19 -0
  31. package/dist/doctor/translations.js +144 -0
  32. package/dist/make/declare.js +32 -11
  33. package/dist/package-manager.d.ts +2 -0
  34. package/dist/package-manager.js +16 -2
  35. package/dist/pkg/catalog.d.ts +12 -0
  36. package/dist/pkg/catalog.js +153 -0
  37. package/dist/pkg/resolve.d.ts +67 -0
  38. package/dist/pkg/resolve.js +147 -0
  39. package/dist/upgrade/changelog.d.ts +2 -2
  40. package/dist/upgrade/project.d.ts +2 -2
  41. package/package.json +10 -8
  42. package/registry/ui/accordion.json +2 -2
  43. package/registry/ui/alert-dialog.json +2 -2
  44. package/registry/ui/alert.json +2 -2
  45. package/registry/ui/aspect-ratio.json +2 -2
  46. package/registry/ui/avatar.json +6 -3
  47. package/registry/ui/badge.json +2 -2
  48. package/registry/ui/banner.json +16 -0
  49. package/registry/ui/breadcrumbs.json +2 -2
  50. package/registry/ui/button.json +5 -3
  51. package/registry/ui/calendar.json +2 -2
  52. package/registry/ui/card.json +2 -2
  53. package/registry/ui/carousel.json +2 -2
  54. package/registry/ui/checkbox-group.json +2 -2
  55. package/registry/ui/checkbox.json +2 -2
  56. package/registry/ui/combobox.json +2 -2
  57. package/registry/ui/command.json +2 -2
  58. package/registry/ui/confirm.json +8 -4
  59. package/registry/ui/cta-group.json +2 -2
  60. package/registry/ui/date-field.json +2 -2
  61. package/registry/ui/date-picker.json +2 -2
  62. package/registry/ui/date-range-picker.json +2 -2
  63. package/registry/ui/description.json +2 -2
  64. package/registry/ui/dialog-dismiss.json +13 -0
  65. package/registry/ui/dialog.json +2 -2
  66. package/registry/ui/disclosure.json +2 -2
  67. package/registry/ui/drawer.json +2 -2
  68. package/registry/ui/field-error.json +2 -2
  69. package/registry/ui/form.json +2 -2
  70. package/registry/ui/group.json +2 -2
  71. package/registry/ui/header.json +2 -2
  72. package/registry/ui/heading-scope.json +2 -2
  73. package/registry/ui/heading.json +3 -3
  74. package/registry/ui/highlight.json +3 -3
  75. package/registry/ui/hover-card.json +2 -2
  76. package/registry/ui/image-placeholder.json +2 -2
  77. package/registry/ui/input.json +2 -2
  78. package/registry/ui/item.json +2 -2
  79. package/registry/ui/keyboard.json +2 -2
  80. package/registry/ui/label.json +2 -2
  81. package/registry/ui/link-button.json +5 -3
  82. package/registry/ui/link.json +2 -2
  83. package/registry/ui/listbox.json +2 -2
  84. package/registry/ui/menu.json +2 -2
  85. package/registry/ui/meter.json +2 -2
  86. package/registry/ui/modal.json +2 -2
  87. package/registry/ui/nav-link.json +2 -2
  88. package/registry/ui/navigation-menu.json +2 -2
  89. package/registry/ui/number-field.json +2 -2
  90. package/registry/ui/otp-field.json +2 -2
  91. package/registry/ui/overlay-arrow.json +2 -2
  92. package/registry/ui/pagination.json +2 -2
  93. package/registry/ui/popover.json +2 -2
  94. package/registry/ui/progress-bar.json +2 -2
  95. package/registry/ui/property-list.json +18 -0
  96. package/registry/ui/radio-group.json +2 -2
  97. package/registry/ui/range-calendar.json +2 -2
  98. package/registry/ui/relative-time.json +17 -0
  99. package/registry/ui/scroll-area.json +2 -2
  100. package/registry/ui/search-field.json +2 -2
  101. package/registry/ui/section.json +2 -2
  102. package/registry/ui/select.json +2 -2
  103. package/registry/ui/selection-indicator.json +2 -2
  104. package/registry/ui/sentinel-row.json +2 -2
  105. package/registry/ui/separator.json +2 -2
  106. package/registry/ui/shared-element.json +2 -2
  107. package/registry/ui/sheet.json +2 -2
  108. package/registry/ui/sidebar.json +2 -2
  109. package/registry/ui/slider.json +2 -2
  110. package/registry/ui/spinner.json +2 -2
  111. package/registry/ui/status-dot.json +16 -0
  112. package/registry/ui/switch.json +2 -2
  113. package/registry/ui/tabs.json +2 -2
  114. package/registry/ui/tag-group.json +2 -2
  115. package/registry/ui/text-field.json +7 -3
  116. package/registry/ui/text.json +2 -2
  117. package/registry/ui/textarea.json +2 -2
  118. package/registry/ui/time-field.json +2 -2
  119. package/registry/ui/timeline.json +16 -0
  120. package/registry/ui/toggle-button.json +2 -2
  121. package/registry/ui/tooltip.json +2 -2
  122. package/registry/ui/typeset.json +2 -2
  123. package/registry/ui/youtube-embed.json +2 -2
  124. package/stubs/scaffold.controller.index.stub +1 -1
  125. package/templates/app/.config/sdxc/ci.ts +26 -0
  126. package/templates/app/.github/workflows/ci.yml +46 -0
  127. package/templates/app/README.md +4 -0
  128. package/templates/app/package.json +1 -0
  129. package/templates/app/public/_headers +4 -0
  130. package/registry/ui/attachment.json +0 -15
  131. package/registry/ui/bubble.json +0 -13
  132. package/registry/ui/chart.json +0 -13
  133. package/registry/ui/color-area.json +0 -13
  134. package/registry/ui/color-field.json +0 -20
  135. package/registry/ui/color-picker.json +0 -17
  136. package/registry/ui/color-slider.json +0 -13
  137. package/registry/ui/color-swatch-picker.json +0 -15
  138. package/registry/ui/color-swatch.json +0 -13
  139. package/registry/ui/color-wheel.json +0 -13
  140. package/registry/ui/context-menu.json +0 -16
  141. package/registry/ui/drop-indicator.json +0 -13
  142. package/registry/ui/drop-zone.json +0 -13
  143. package/registry/ui/empty.json +0 -15
  144. package/registry/ui/feature.json +0 -18
  145. package/registry/ui/file-trigger.json +0 -13
  146. package/registry/ui/grid-list.json +0 -18
  147. package/registry/ui/logo-cloud.json +0 -16
  148. package/registry/ui/marker.json +0 -13
  149. package/registry/ui/marketing-header.json +0 -18
  150. package/registry/ui/marketing-section.json +0 -16
  151. package/registry/ui/menubar.json +0 -13
  152. package/registry/ui/message-scroller.json +0 -16
  153. package/registry/ui/message.json +0 -13
  154. package/registry/ui/resizable.json +0 -13
  155. package/registry/ui/shortcut-list.json +0 -18
  156. package/registry/ui/skeleton.json +0 -13
  157. package/registry/ui/split.json +0 -16
  158. package/registry/ui/stat-strip.json +0 -16
  159. package/registry/ui/table.json +0 -16
  160. package/registry/ui/toast.json +0 -16
  161. package/registry/ui/toolbar.json +0 -13
  162. package/registry/ui/tree.json +0 -18
@@ -1,13 +0,0 @@
1
- {
2
- "name": "marker",
3
- "changedIn": "2026.10.10",
4
- "dependencies": [],
5
- "exports": [
6
- "Marker"
7
- ],
8
- "source": {
9
- "path": "marker.tsx",
10
- "content": "/**\n * An inline row calling out a small event between two message rows — a\n * delivery status, a system note, a highlighted callout, or a labeled\n * divider — colored by a semantic tone and shaped by a variant.\n * {@link Marker.Icon} and {@link Marker.Content} compose beneath it for a\n * glyph-plus-caption row.\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 { bg, border, fg } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { pseudoContent } from \"@sdxc/u/general\";\nimport { basis, center, gap, grow, inlineFlex, items, shrink } from \"@sdxc/u/layout\";\nimport { bs, is, minIs, pb, pi } from \"@sdxc/u/size\";\nimport { data, when } from \"@sdxc/u/state\";\nimport { fontSize, leading, weight } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\n/** Visual shape {@link Marker} falls back to when `variant` is omitted. */\nconst DEFAULT_VARIANT: Marker.Variant = \"default\";\n\n/** Semantic color role {@link Marker} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: Marker.Color = \"neutral\";\n\n/**\n * Default `aria-hidden` applied to {@link Marker.Icon} through\n * {@link attrs}, keeping a decorative glyph out of the accessibility tree\n * unless a consumer overrides it for a control with its own name and role.\n */\nconst DEFAULT_ICON_ARIA_HIDDEN = \"true\";\n\n/**\n * `role` applied through {@link attrs} when `variant` is `\"separator\"`,\n * matching the accessibility contract a divider between groups of content\n * carries regardless of whether it's drawn as a bare line or a labeled one.\n */\nconst DEFAULT_SEPARATOR_ROLE = \"separator\";\n\n/**\n * `aria-orientation` applied through {@link attrs} alongside\n * {@link DEFAULT_SEPARATOR_ROLE}, since a labeled separator between message\n * rows always reads as a horizontal divider.\n */\nconst DEFAULT_SEPARATOR_ORIENTATION = \"horizontal\";\n\n/**\n * Prop types for {@link Marker} and its compound parts.\n */\nexport namespace Marker {\n\t/**\n\t * Visual shape the row renders with: `\"default\"` for a plain, centered\n\t * caption, `\"border\"` for a bordered, tinted callout panel, and\n\t * `\"separator\"` for a caption flanked by a hairline divider on either side.\n\t */\n\texport type Variant = \"default\" | \"border\" | \"separator\";\n\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 * Props accepted by {@link Marker}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Visual shape of the row. Defaults to {@link DEFAULT_VARIANT}. */\n\t\tvariant?: Variant;\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/** The row's compound parts: {@link Marker.Icon} followed by {@link Marker.Content}. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Marker.Icon}.\n\t */\n\texport interface IconProps extends TagProps<\"span\"> {\n\t\t/** The icon graphic, typically a single SVG icon, or a nested control such as {@link Spinner}. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Marker.Content}.\n\t */\n\texport interface ContentProps extends TagProps<\"span\"> {\n\t\t/** The row's caption text. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders the row's host element: a centered flex line framed through the\n * `data-variant` and `data-color` attributes, with `variant=\"separator\"`\n * also picking up `role=\"separator\"`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <Marker color=\"success\">\n * \t<Marker.Icon><CheckIcon /></Marker.Icon>\n * \t<Marker.Content>{t(\"marker.delivered\")}</Marker.Content>\n * </Marker>\n * @example\n * <Marker>\n * \t<Marker.Content>{t(\"marker.userJoined\", { name: user.name })}</Marker.Content>\n * </Marker>\n * @example\n * <Marker variant=\"border\" color=\"warning\">\n * \t<Marker.Icon><TriangleAlertIcon /></Marker.Icon>\n * \t<Marker.Content>{t(\"marker.reconnecting\")}</Marker.Content>\n * </Marker>\n * @example\n * <Marker variant=\"separator\">\n * \t<Marker.Content>{t(\"marker.today\")}</Marker.Content>\n * </Marker>\n */\nexport function Marker(handle: Handle<Marker.Props>) {\n\treturn () => {\n\t\tlet { variant, color, children, mix, ...rest } = handle.props;\n\t\tlet resolvedVariant = variant ?? DEFAULT_VARIANT;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-variant={resolvedVariant}\n\t\t\t\tdata-color={resolvedColor}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tresolvedVariant === \"separator\"\n\t\t\t\t\t\t? attrs({\n\t\t\t\t\t\t\t\trole: DEFAULT_SEPARATOR_ROLE,\n\t\t\t\t\t\t\t\t\"aria-orientation\": DEFAULT_SEPARATOR_ORIENTATION,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t: undefined,\n\t\t\t\t\tcenter(),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\tweight(\"medium\"),\n\t\t\t\t\tdata(\"color\", \"brand\", fg(\"brand.muted\")),\n\t\t\t\t\tdata(\"color\", \"neutral\", fg(\"neutral.muted\")),\n\t\t\t\t\tdata(\"color\", \"success\", fg(\"success.muted\")),\n\t\t\t\t\tdata(\"color\", \"warning\", fg(\"warning.muted\")),\n\t\t\t\t\tdata(\"color\", \"danger\", fg(\"danger.muted\")),\n\t\t\t\t\tdata(\"variant\", \"border\", [\n\t\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\t\tborder({ width: 1 }),\n\t\t\t\t\t\tpb(2),\n\t\t\t\t\t\tpi(3.5),\n\t\t\t\t\t\tdata(\"color\", \"brand\", [border(\"brand\"), bg(\"brand.tint\"), fg(\"brand.emphasis\")]),\n\t\t\t\t\t\tdata(\"color\", \"neutral\", [\n\t\t\t\t\t\t\tborder(\"neutral\"),\n\t\t\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"success\", [\n\t\t\t\t\t\t\tborder(\"success\"),\n\t\t\t\t\t\t\tbg(\"success.tint\"),\n\t\t\t\t\t\t\tfg(\"success.emphasis\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"warning\", [\n\t\t\t\t\t\t\tborder(\"warning\"),\n\t\t\t\t\t\t\tbg(\"warning.tint\"),\n\t\t\t\t\t\t\tfg(\"warning.emphasis\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"danger\", [border(\"danger\"), bg(\"danger.tint\"), fg(\"danger.emphasis\")]),\n\t\t\t\t\t]),\n\t\t\t\t\tgap(\"var(--ui-marker-gap, 0.375rem)\"),\n\t\t\t\t\tpb(\"0.375rem\"),\n\t\t\t\t\tfontSize(\"0.8125rem\"),\n\t\t\t\t\tleading(\"calc(1.25 / 0.8125)\"),\n\t\t\t\t\tdata(\n\t\t\t\t\t\t\"variant\",\n\t\t\t\t\t\t\"separator\",\n\t\t\t\t\t\twhen(\"&::before, &::after\", [\n\t\t\t\t\t\t\tpseudoContent('\"\"'),\n\t\t\t\t\t\t\tgrow(),\n\t\t\t\t\t\t\tshrink(1),\n\t\t\t\t\t\t\tbasis(\"0%\"),\n\t\t\t\t\t\t\tminIs(\"1.5rem\"),\n\t\t\t\t\t\t\tbs(\"var(--ui-separator-thickness, 1px)\"),\n\t\t\t\t\t\t\tbg(\"neutral.border\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t),\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</div>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Marker.IconProps.children} as the row's glyph slot,\n * hidden from assistive technology unless a consumer overrides it for a\n * nested accessible control like {@link Spinner}.\n *\n * @param handle Runtime handle carrying the host `<span>`'s props.\n * @returns The render function producing the icon slot's markup.\n * @example\n * <Marker.Icon><CheckIcon /></Marker.Icon>\n * @example\n * <Marker.Icon aria-hidden=\"false\">\n * \t<Spinner size=\"sm\" aria-label={t(\"status.generating\")} />\n * </Marker.Icon>\n */\nMarker.Icon = function MarkerIcon(handle: Handle<Marker.IconProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<span\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ \"aria-hidden\": DEFAULT_ICON_ARIA_HIDDEN }),\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\tshrink(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tfg(\"currentcolor\"),\n\t\t\t\t\twhen(\"& > svg\", [is(\"1em\"), bs(\"1em\")]),\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</span>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Marker.ContentProps.children} as the row's caption: a\n * `<span>` inheriting its color, size, and weight from the {@link Marker}\n * root so a single `data-color` drives the icon and caption together.\n *\n * @param handle Runtime handle carrying the host `<span>`'s props.\n * @returns The render function producing the caption's markup.\n * @example\n * <Marker.Content>{t(\"marker.today\")}</Marker.Content>\n * @example\n * <Marker.Content mix={[textShimmer()]}>{t(\"chat.generating\")}</Marker.Content>\n */\nMarker.Content = function MarkerContent(handle: Handle<Marker.ContentProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <span {...rest} mix={[minIs(0), mix]} />;\n\t};\n};\n"
11
- },
12
- "test": null
13
- }
@@ -1,18 +0,0 @@
1
- {
2
- "name": "marketing-header",
3
- "changedIn": "2026.10.29",
4
- "dependencies": [
5
- "heading"
6
- ],
7
- "exports": [
8
- "MarketingHeader"
9
- ],
10
- "source": {
11
- "path": "marketing-header.tsx",
12
- "content": "/**\n * Eyebrow, chapter title, and lead copy that open a marketing band. The title\n * uses display chapter typography; the lead stays on the marketing lead measure\n * so the claim reads first and the support follows.\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 { bg, border, fg } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { inlineFlex, items, vstack } from \"@sdxc/u/layout\";\nimport { m, mbe, mi, pb, pi } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport {\n\tfont,\n\tleading,\n\ttext,\n\ttextAlign,\n\ttextTransform,\n\ttracking,\n\tweight,\n} from \"@sdxc/u/typography\";\n\nimport { marketingLead } from \"@sdxc/ui/styles\";\n\nimport { Heading } from \"@sdxc/ui/heading\";\n\n/** Content alignment {@link MarketingHeader} applies when `align` is omitted. */\nconst DEFAULT_ALIGN: MarketingHeader.Align = \"start\";\n\n/** Eyebrow chrome {@link MarketingHeader} applies when `eyebrowVariant` is omitted. */\nconst DEFAULT_EYEBROW_VARIANT: MarketingHeader.EyebrowVariant = \"pill\";\n\n/**\n * Prop types for {@link MarketingHeader}.\n */\nexport namespace MarketingHeader {\n\t/**\n\t * Whether the stack stretches start-aligned or centers as one statement.\n\t */\n\texport type Align = \"start\" | \"center\";\n\n\t/**\n\t * How the optional eyebrow reads: a filled pill, a mono label, or a chip\n\t * with stronger tracking for short announcements.\n\t */\n\texport type EyebrowVariant = \"pill\" | \"mono\" | \"chip\";\n\n\t/**\n\t * Per-part styling for the elements the header renders besides its host.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the optional eyebrow label. */\n\t\teyebrow?: TagProps<\"span\">[\"mix\"];\n\t\t/** Styling for the title {@link Heading}. */\n\t\ttitle?: TagProps<\"h1\">[\"mix\"];\n\t\t/** Styling for the optional lead paragraph. */\n\t\tdescription?: TagProps<\"p\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link MarketingHeader}.\n\t */\n\texport interface Props extends TagProps<\"header\"> {\n\t\t/** Short label above the title. */\n\t\teyebrow?: RemixNode;\n\t\t/**\n\t\t * Eyebrow chrome. Defaults to {@link DEFAULT_EYEBROW_VARIANT} when an\n\t\t * eyebrow is present.\n\t\t */\n\t\teyebrowVariant?: EyebrowVariant;\n\t\t/** Supporting copy under the title. */\n\t\tdescription?: RemixNode;\n\t\t/** Stack alignment. Defaults to {@link DEFAULT_ALIGN}. */\n\t\talign?: Align;\n\t\t/** Per-part styling for eyebrow, title, and description. */\n\t\tparts?: PartsProps;\n\t\t/** Title copy — rendered through {@link Heading} at chapter display size. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders an optional eyebrow, a chapter-sized {@link Heading} from `children`,\n * and an optional lead paragraph. Nest inside a {@link HeadingScope} so the\n * title picks up the band's outline depth.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the header's markup.\n * @example\n * <MarketingHeader eyebrow={t(\"badge\")} description={t(\"lead\")} align=\"center\">\n * \t{t(\"title\")}\n * </MarketingHeader>\n * @example\n * <MarketingHeader eyebrow={t(\"new\")} eyebrowVariant=\"chip\" description={t(\"lead\")}>\n * \t{t(\"title\")}\n * </MarketingHeader>\n */\nexport function MarketingHeader(handle: Handle<MarketingHeader.Props>) {\n\treturn () => {\n\t\tlet { align, children, description, eyebrow, eyebrowVariant, mix, parts, ...rest } =\n\t\t\thandle.props;\n\t\tlet resolvedAlign = align ?? DEFAULT_ALIGN;\n\t\tlet resolvedEyebrowVariant = eyebrowVariant ?? DEFAULT_EYEBROW_VARIANT;\n\t\tlet isCenter = resolvedAlign === \"center\";\n\n\t\treturn (\n\t\t\t<header\n\t\t\t\t{...rest}\n\t\t\t\tdata-align={resolvedAlign}\n\t\t\t\tmix={[\n\t\t\t\t\tvstack({\n\t\t\t\t\t\talign: isCenter ? \"center\" : \"stretch\",\n\t\t\t\t\t\tgap: 2,\n\t\t\t\t\t}),\n\t\t\t\t\tisCenter ? [textAlign(\"center\"), mi(\"auto\")] : [],\n\t\t\t\t\tmbe(10),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{eyebrow ? (\n\t\t\t\t\t<span\n\t\t\t\t\t\tdata-variant={resolvedEyebrowVariant}\n\t\t\t\t\t\tmix={[\n\t\t\t\t\t\t\tinlineFlex(),\n\t\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\t\ttext(\"xs\"),\n\t\t\t\t\t\t\tweight(\"semibold\"),\n\t\t\t\t\t\t\twhen('&[data-variant=\"pill\"]', [\n\t\t\t\t\t\t\t\tpb(0.5),\n\t\t\t\t\t\t\t\tpi(2.5),\n\t\t\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\t\t\tborder({ color: \"brand\", width: 1, style: \"solid\" }),\n\t\t\t\t\t\t\t\tbg(\"brand.tint\"),\n\t\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\twhen('&[data-variant=\"mono\"]', [\n\t\t\t\t\t\t\t\tfont(\"mono\"),\n\t\t\t\t\t\t\t\ttracking(\"wide\"),\n\t\t\t\t\t\t\t\ttextTransform(\"uppercase\"),\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\twhen('&[data-variant=\"chip\"]', [\n\t\t\t\t\t\t\t\tpb(0.5),\n\t\t\t\t\t\t\t\tpi(2.5),\n\t\t\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\t\t\tborder({ color: \"brand\", width: 1, style: \"solid\" }),\n\t\t\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\t\t\ttracking(\"wider\"),\n\t\t\t\t\t\t\t\ttextTransform(\"uppercase\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tparts?.eyebrow,\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t{eyebrow}\n\t\t\t\t\t</span>\n\t\t\t\t) : null}\n\n\t\t\t\t<Heading size=\"chapter\" mix={[m(0), description ? mbe(2) : [], parts?.title]}>\n\t\t\t\t\t{children}\n\t\t\t\t</Heading>\n\n\t\t\t\t{description ? (\n\t\t\t\t\t<p\n\t\t\t\t\t\tmix={[\n\t\t\t\t\t\t\tmarketingLead(),\n\t\t\t\t\t\t\tleading(\"relaxed\"),\n\t\t\t\t\t\t\tisCenter ? mi(\"auto\") : [],\n\t\t\t\t\t\t\tparts?.description,\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t{description}\n\t\t\t\t\t</p>\n\t\t\t\t) : null}\n\t\t\t</header>\n\t\t);\n\t};\n}\n"
13
- },
14
- "test": {
15
- "path": "marketing-header.test.tsx",
16
- "content": "/**\n * Covers {@link MarketingHeader} eyebrow variants, chapter title sizing, and\n * centered alignment so section openers keep the marketing type contract.\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 { MarketingHeader } from \"@sdxc/ui/marketing-header\";\n\ndescribe(\"MarketingHeader\", () => {\n\ttest(\"renders a chapter title and optional lead\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<MarketingHeader description=\"Support copy for the claim.\">\n\t\t\t\tShip with shared measure\n\t\t\t</MarketingHeader>,\n\t\t);\n\n\t\texpect(html).toContain(\"Ship with shared measure\");\n\t\texpect(html).toContain(\"Support copy for the claim.\");\n\t\texpect(html).toContain('data-size=\"chapter\"');\n\t\texpect(html).toContain(\"var(--ui-marketing-chapter-size\");\n\t\texpect(html).toContain(\"var(--ui-marketing-lead-size\");\n\t});\n\n\ttest(\"applies eyebrow variants through data-variant\", async () => {\n\t\tlet pill = await renderToString(\n\t\t\t<MarketingHeader eyebrow=\"New\" eyebrowVariant=\"pill\">\n\t\t\t\tTitle\n\t\t\t</MarketingHeader>,\n\t\t);\n\t\tlet mono = await renderToString(\n\t\t\t<MarketingHeader eyebrow=\"Section\" eyebrowVariant=\"mono\">\n\t\t\t\tTitle\n\t\t\t</MarketingHeader>,\n\t\t);\n\t\tlet chip = await renderToString(\n\t\t\t<MarketingHeader eyebrow=\"Beta\" eyebrowVariant=\"chip\">\n\t\t\t\tTitle\n\t\t\t</MarketingHeader>,\n\t\t);\n\n\t\texpect(pill).toContain('data-variant=\"pill\"');\n\t\texpect(mono).toContain('data-variant=\"mono\"');\n\t\texpect(chip).toContain('data-variant=\"chip\"');\n\t\texpect(chip).toContain(\"text-transform: uppercase\");\n\t});\n\n\ttest(\"centers the stack when align is center\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<MarketingHeader align=\"center\" description=\"Lead\">\n\t\t\t\tCentered\n\t\t\t</MarketingHeader>,\n\t\t);\n\n\t\texpect(html).toContain('data-align=\"center\"');\n\t\texpect(html).toContain(\"text-align: center\");\n\t});\n});\n"
17
- }
18
- }
@@ -1,16 +0,0 @@
1
- {
2
- "name": "marketing-section",
3
- "changedIn": "2026.10.30",
4
- "dependencies": [],
5
- "exports": [
6
- "MarketingSection"
7
- ],
8
- "source": {
9
- "path": "marketing-section.tsx",
10
- "content": "/**\n * A landing-page band: a `<section>` host that applies marketing tone, spacing,\n * and content measure so pages share one rhythm. Distinct from the listbox\n * {@link Section}, which groups menu items.\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 { borderEdge } from \"@sdxc/u/color\";\nimport { raw } from \"@sdxc/u/general\";\nimport { container, relative, vstack } from \"@sdxc/u/layout\";\nimport { at } from \"@sdxc/u/responsive\";\nimport { is, maxIs, mi, pi } from \"@sdxc/u/size\";\nimport { after, before } from \"@sdxc/u/state\";\nimport { textAlign } from \"@sdxc/u/typography\";\n\nimport type { MarketingBandTone, MarketingSectionSpacing } from \"@sdxc/ui/styles\";\n\nimport {\n\tmarketingBandTone,\n\tmarketingContainer,\n\tmarketingHairline,\n\tmarketingSectionSpace,\n} from \"@sdxc/ui/styles\";\n\n/** Band fill {@link MarketingSection} applies when `tone` is omitted. */\nconst DEFAULT_TONE: MarketingSection.Tone = \"plain\";\n\n/** Block padding {@link MarketingSection} applies when `spacing` is omitted. */\nconst DEFAULT_SPACING: MarketingSection.Spacing = \"normal\";\n\n/** Content alignment {@link MarketingSection} applies when `align` is omitted. */\nconst DEFAULT_ALIGN: MarketingSection.Align = \"start\";\n\n/** Chrome {@link MarketingSection} applies when `variant` is omitted. */\nconst DEFAULT_VARIANT: MarketingSection.Variant = \"default\";\n\n/**\n * Prop types for {@link MarketingSection}.\n */\nexport namespace MarketingSection {\n\t/**\n\t * What sits behind the band: nothing, a quiet tint, a faded grid, or an\n\t * inverted solid for a closing call-to-action.\n\t */\n\texport type Tone = MarketingBandTone;\n\n\t/**\n\t * How much block padding the band leaves around its content.\n\t */\n\texport type Spacing = MarketingSectionSpacing;\n\n\t/**\n\t * Whether the inner column stretches start-aligned or centers as one\n\t * statement.\n\t */\n\texport type Align = \"start\" | \"center\";\n\n\t/**\n\t * Outer chrome: a plain band, or a framed column with dashed rails and\n\t * corner markers where a top rule meets them.\n\t */\n\texport type Variant = \"default\" | \"frame\";\n\n\t/**\n\t * Per-part styling for the elements the band renders besides its host.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the measured content column inside the band. */\n\t\tcontainer?: TagProps<\"div\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link MarketingSection}.\n\t */\n\texport interface Props extends TagProps<\"section\"> {\n\t\t/** Band fill. Defaults to {@link DEFAULT_TONE}. */\n\t\ttone?: Tone;\n\t\t/** Block padding step. Defaults to {@link DEFAULT_SPACING}. */\n\t\tspacing?: Spacing;\n\t\t/** Content alignment. Defaults to {@link DEFAULT_ALIGN}. */\n\t\talign?: Align;\n\t\t/**\n\t\t * Draws a low-contrast 1px rule along the block-start edge so stacked\n\t\t * bands separate cleanly.\n\t\t */\n\t\truled?: boolean;\n\t\t/** Outer chrome. Defaults to {@link DEFAULT_VARIANT}. */\n\t\tvariant?: Variant;\n\t\t/**\n\t\t * Zeroes block padding on a framed column so a flush strip (stats) keeps\n\t\t * full-height rails without the section gap. Ignored when `variant` is\n\t\t * not `\"frame\"`.\n\t\t */\n\t\tflush?: boolean;\n\t\t/** Per-part styling for the measured inner column. */\n\t\tparts?: PartsProps;\n\t\t/** Band content — headers, splits, feature grids, and so on. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders a marketing band: tone on the `<section>`, a named container for\n * descendant queries, and a measured inner column. When `variant=\"frame\"`,\n * block padding lives on that column with the dashed rails so the rails run\n * the full band height instead of stopping at the content box.\n *\n * @param handle Runtime handle carrying the host `<section>`'s props.\n * @returns The render function producing the band's markup.\n * @example\n * <MarketingSection tone=\"tinted\" spacing=\"normal\" ruled>\n * \t{children}\n * </MarketingSection>\n * @example\n * <MarketingSection tone=\"grid\" spacing=\"hero\" align=\"center\" variant=\"frame\">\n * \t{children}\n * </MarketingSection>\n */\nexport function MarketingSection(handle: Handle<MarketingSection.Props>) {\n\treturn () => {\n\t\tlet { align, children, flush, mix, parts, ruled, spacing, tone, variant, ...rest } =\n\t\t\thandle.props;\n\t\tlet resolvedTone = tone ?? DEFAULT_TONE;\n\t\tlet resolvedSpacing = spacing ?? DEFAULT_SPACING;\n\t\tlet resolvedAlign = align ?? DEFAULT_ALIGN;\n\t\tlet resolvedVariant = variant ?? DEFAULT_VARIANT;\n\t\tlet isCenter = resolvedAlign === \"center\";\n\t\tlet isFrame = resolvedVariant === \"frame\";\n\t\tlet isFlushFrame = isFrame && Boolean(flush);\n\n\t\treturn (\n\t\t\t<section\n\t\t\t\t{...rest}\n\t\t\t\tdata-tone={resolvedTone}\n\t\t\t\tdata-spacing={resolvedSpacing}\n\t\t\t\tdata-align={resolvedAlign}\n\t\t\t\tdata-variant={resolvedVariant}\n\t\t\t\tdata-flush={isFlushFrame ? \"true\" : undefined}\n\t\t\t\tmix={[\n\t\t\t\t\tcontainer(\"ui-marketing-section\"),\n\t\t\t\t\trelative(),\n\t\t\t\t\tvstack({ align: \"center\" }),\n\t\t\t\t\tis(\"100%\"),\n\t\t\t\t\traw({ isolation: \"isolate\" }),\n\t\t\t\t\tmarketingBandTone(resolvedTone),\n\t\t\t\t\t/**\n\t\t\t\t\t * Framed bands keep block padding on the measured column so the\n\t\t\t\t\t * dashed rails share that box and run the full band height.\n\t\t\t\t\t */\n\t\t\t\t\tisFrame ? [] : marketingSectionSpace(resolvedSpacing),\n\t\t\t\t\truled ? marketingHairline() : [],\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tmix={[\n\t\t\t\t\t\tisFrame\n\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\tmaxIs(\"var(--ui-marketing-measure, 72rem)\"),\n\t\t\t\t\t\t\t\t\tmi(\"auto\"),\n\t\t\t\t\t\t\t\t\tis(\"100%\"),\n\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t * Match the pre-migration framed band: quiet gutters that\n\t\t\t\t\t\t\t\t\t * open to 3rem above `lg`, so copy clears the rails.\n\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\tpi(5),\n\t\t\t\t\t\t\t\t\tisFlushFrame ? [] : marketingSectionSpace(resolvedSpacing),\n\t\t\t\t\t\t\t\t\tat(\"lg\", \"ui-marketing-section\", [\n\t\t\t\t\t\t\t\t\t\tpi(12),\n\t\t\t\t\t\t\t\t\t\tborderEdge(\"inline-start\", {\n\t\t\t\t\t\t\t\t\t\t\tcolor: \"neutral\",\n\t\t\t\t\t\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\t\t\t\t\t\tstyle: \"dashed\",\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\tborderEdge(\"inline-end\", {\n\t\t\t\t\t\t\t\t\t\t\tcolor: \"neutral\",\n\t\t\t\t\t\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\t\t\t\t\t\tstyle: \"dashed\",\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\truled\n\t\t\t\t\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t\t\t\t\tbefore(frameMarker({ insetInlineStart: \"-4px\" })),\n\t\t\t\t\t\t\t\t\t\t\t\t\tafter(frameMarker({ insetInlineEnd: \"-4px\" })),\n\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t: [],\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: marketingContainer(),\n\t\t\t\t\t\tvstack({\n\t\t\t\t\t\t\talign: isCenter ? \"center\" : \"stretch\",\n\t\t\t\t\t\t\tgap: 0,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trelative(),\n\t\t\t\t\t\tis(\"100%\"),\n\t\t\t\t\t\tisCenter ? textAlign(\"center\") : [],\n\t\t\t\t\t\tparts?.container,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</section>\n\t\t);\n\t};\n}\n\n/**\n * The square drawn where a framed band's top rule crosses a rail, so the rails\n * read as a frame the rule is fixed to.\n */\nfunction frameMarker(edge: { insetInlineStart: string } | { insetInlineEnd: string }) {\n\treturn raw({\n\t\tcontent: '\"\"',\n\t\tposition: \"absolute\",\n\t\tinsetBlockStart: \"-4px\",\n\t\t...edge,\n\t\tinlineSize: \"7px\",\n\t\tblockSize: \"7px\",\n\t\tbackgroundColor: \"var(--ui-brand-bg-solid)\",\n\t});\n}\n"
11
- },
12
- "test": {
13
- "path": "marketing-section.test.tsx",
14
- "content": "/**\n * Covers {@link MarketingSection} tone, spacing, ruled hairline, and frame\n * chrome so the band host keeps the marketing factory contract.\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 { MarketingSection } from \"@sdxc/ui/marketing-section\";\n\ndescribe(\"MarketingSection\", () => {\n\ttest(\"marks tone, spacing, and the named marketing container\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<MarketingSection tone=\"tinted\" spacing=\"hero\" id=\"proof\">\n\t\t\t\tContent\n\t\t\t</MarketingSection>,\n\t\t);\n\n\t\texpect(html).toContain('id=\"proof\"');\n\t\texpect(html).toContain('data-tone=\"tinted\"');\n\t\texpect(html).toContain('data-spacing=\"hero\"');\n\t\texpect(html).toContain(\"container: ui-marketing-section / inline-size\");\n\t\texpect(html).toContain(\"var(--ui-marketing-section-space-hero\");\n\t});\n\n\ttest(\"draws a hairline when ruled and frame rails when variant is frame\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<MarketingSection ruled variant=\"frame\">\n\t\t\t\tFramed\n\t\t\t</MarketingSection>,\n\t\t);\n\n\t\texpect(html).toContain('data-variant=\"frame\"');\n\t\texpect(html).toContain(\"border-block-start\");\n\t\texpect(html).toContain(\"border-inline-start\");\n\t\texpect(html).toContain(\"var(--ui-marketing-section-space\");\n\t});\n\n\ttest(\"puts framed block padding on the rail column so rails run the full band height\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<MarketingSection ruled variant=\"frame\" spacing=\"hero\">\n\t\t\t\tFramed\n\t\t\t</MarketingSection>,\n\t\t);\n\n\t\tlet spaceClass = html.match(\n\t\t\t/\\.([a-z0-9-]+) \\{\\s*padding-block: var\\(--ui-marketing-section-space-hero/,\n\t\t)?.[1];\n\t\tlet sectionClasses = html.match(/<section[^>]*data-variant=\"frame\"[^>]*class=\"([^\"]*)\"/)?.[1];\n\n\t\texpect(spaceClass).toBeTruthy();\n\t\texpect(sectionClasses).toBeTruthy();\n\t\texpect(sectionClasses).not.toContain(spaceClass!);\n\t\texpect(html).toMatch(new RegExp(`<div class=\"[^\"]*${spaceClass}`));\n\t\texpect(html).toContain(\"border-inline-start\");\n\t\texpect(html).toContain(\"padding-inline\");\n\t});\n\n\ttest(\"flush framed bands keep rails without section block padding\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<MarketingSection ruled variant=\"frame\" spacing=\"compact\" flush>\n\t\t\t\tStrip\n\t\t\t</MarketingSection>,\n\t\t);\n\n\t\texpect(html).toContain('data-flush=\"true\"');\n\t\texpect(html).toContain(\"border-inline-start\");\n\t\texpect(html).not.toContain(\"var(--ui-marketing-section-space-compact\");\n\t});\n});\n"
15
- }
16
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "menubar",
3
- "changedIn": "2026.10.13",
4
- "dependencies": [],
5
- "exports": [
6
- "Menubar"
7
- ],
8
- "source": {
9
- "path": "menubar.tsx",
10
- "content": "/**\n * A horizontal row of top-level triggers modeled on a native application's\n * menu bar, where each trigger opens its own dropdown built from the\n * existing {@link Menu} component.\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 } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor, raw, userSelect } from \"@sdxc/u/general\";\nimport { flex, gap, inlineFlex, items } from \"@sdxc/u/layout\";\nimport { p, pb, pi } from \"@sdxc/u/size\";\nimport { active, disabled, hover, when } from \"@sdxc/u/state\";\nimport { radius } from \"@sdxc/u/tokens\";\nimport { text, weight } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { concentricRadius, surfacePadding } from \"@sdxc/ui/styles\";\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport {\n\twarnIfNoAccessibleLabel,\n\twarnIfNoAccessibleName,\n} from \"@sdxc/ui/utils\";\n\n/**\n * `role=\"menubar\"` applied to {@link Menubar}'s host through {@link attrs}\n * unless a consumer supplies its own `role`, identifying the row as an ARIA\n * menubar.\n */\nconst DEFAULT_ROLE = \"menubar\";\n\n/**\n * `role` applied to {@link Menubar.Trigger} through {@link attrs} unless a\n * consumer supplies its own, identifying each top-level trigger as an ARIA\n * menu-bar item that owns a submenu.\n */\nconst DEFAULT_TRIGGER_ROLE = \"menuitem\";\n\n/**\n * `type` {@link Menubar.TriggerProps} falls back to when a consumer doesn't\n * supply one, keeping a click on the trigger from submitting a surrounding\n * `<form>` the way a bare `<button>`'s default type otherwise would.\n */\nconst DEFAULT_TRIGGER_TYPE: NonNullable<Menubar.TriggerProps[\"type\"]> = \"button\";\n\n/**\n * Invoker Commands verb {@link Menubar.TriggerProps.command} falls back to\n * when omitted: toggles the paired {@link Menu} between shown and hidden,\n * the same default a standalone {@link Menu} trigger uses.\n */\nconst DEFAULT_TRIGGER_COMMAND: NonNullable<Menubar.TriggerProps[\"command\"]> = \"toggle-popover\";\n\n/**\n * Prop types for {@link Menubar} and its compound parts.\n */\nexport namespace Menubar {\n\t/**\n\t * Every native `<div>` attribute, plus the `mix` passthrough.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<button>` attribute, plus the `mix` passthrough, with\n\t * `commandfor` narrowed to required so it always points at the `id` of\n\t * the {@link Menu} this trigger opens.\n\t */\n\texport interface TriggerProps extends Omit<TagProps<\"button\">, \"commandfor\"> {\n\t\t/** `id` of the {@link Menu} this trigger opens. */\n\t\tcommandfor: string;\n\t}\n}\n\n/**\n * Renders the row's host: a native `<div>` carrying the `menubar` role for\n * {@link Menubar.Trigger}s. In dev mode, a root missing an `aria-label` or\n * `aria-labelledby` logs a `console.warn`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <Menubar aria-label={t(\"app.menubar\")}>\n * \t<Menubar.Trigger commandfor=\"file-menu\">{t(\"menubar.file\")}</Menubar.Trigger>\n * \t<Menu id=\"file-menu\" aria-label={t(\"menubar.fileMenu\")}>\n * \t\t<Menu.Item>{t(\"actions.new\")}</Menu.Item>\n * \t\t<Menu.Item>{t(\"actions.open\")}</Menu.Item>\n * \t</Menu>\n *\n * \t<Menubar.Trigger commandfor=\"edit-menu\">{t(\"menubar.edit\")}</Menubar.Trigger>\n * \t<Menu id=\"edit-menu\" aria-label={t(\"menubar.editMenu\")}>\n * \t\t<Menu.Item>{t(\"actions.undo\")}</Menu.Item>\n * \t\t<Menu.Item>{t(\"actions.redo\")}</Menu.Item>\n * \t</Menu>\n * </Menubar>\n */\nexport function Menubar(handle: Handle<Menubar.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t'Menubar: needs an \"aria-label\" or \"aria-labelledby\" identifying this menu bar for assistive technology.',\n\t\t);\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 }),\n\t\t\t\t\tflex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tgap(\"0.125rem\"),\n\t\t\t\t\traw({ borderRadius: concentricRadius(surfacePadding(1), radius(\"sm\")) }),\n\t\t\t\t\tborder({ color: \"neutral\", width: 1 }),\n\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\tp(surfacePadding(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 a single top-level trigger: a native `<button>` pointed at the\n * `id` of the {@link Menu} it opens through `commandfor`, with `command`\n * defaulting to `\"toggle-popover\"` and `role` to `\"menuitem\"`.\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 * <Menubar.Trigger commandfor=\"file-menu\">{t(\"menubar.file\")}</Menubar.Trigger>\n * @example\n * <Menubar.Trigger commandfor=\"archived-menu\" aria-disabled=\"true\">\n * \t{t(\"menubar.archived\")}\n * </Menubar.Trigger>\n */\nMenubar.Trigger = function MenubarTrigger(handle: Handle<Menubar.TriggerProps>) {\n\treturn () => {\n\t\tlet { type, command, children, mix, ...rest } = handle.props;\n\t\tlet resolvedType = type ?? DEFAULT_TRIGGER_TYPE;\n\t\tlet resolvedCommand = command ?? DEFAULT_TRIGGER_COMMAND;\n\n\t\twarnIfNoAccessibleName(\n\t\t\thandle.props,\n\t\t\tchildren,\n\t\t\t\"Menubar.Trigger: a trigger with no visible text needs an `aria-label` describing it — assistive technology has no accessible name to announce otherwise.\",\n\t\t);\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype={resolvedType}\n\t\t\t\tcommand={resolvedCommand}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tattrs({ role: DEFAULT_TRIGGER_ROLE, \"aria-haspopup\": \"menu\" }),\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tgap(2),\n\t\t\t\t\trounded(\"sm\"),\n\t\t\t\t\tpi(3),\n\t\t\t\t\tpb(\"0.375rem\"),\n\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\thover([bg(\"neutral.bg-tint-hover\"), fg(\"neutral.emphasis\")]),\n\t\t\t\t\tactive(bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\twhen('&[aria-expanded=\"true\"]', [bg(\"brand.solid\"), fg(\"brand.onSolid\")]),\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\tdisabled([opacity(50), cursor(\"not-allowed\")]),\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\tweight(500),\n\t\t\t\t\tuserSelect(),\n\t\t\t\t\ttext(\"sm\"),\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"
11
- },
12
- "test": null
13
- }
@@ -1,16 +0,0 @@
1
- {
2
- "name": "message-scroller",
3
- "changedIn": "2026.10.20",
4
- "dependencies": [
5
- "button",
6
- "scroll-area"
7
- ],
8
- "exports": [
9
- "MessageScroller"
10
- ],
11
- "source": {
12
- "path": "message-scroller.tsx",
13
- "content": "/**\n * A scrollable frame for a conversational message log. Its viewport reuses\n * the same scrollbar treatment every scrolling surface in this catalog\n * shares and fades its own edges to hint at history above and replies still\n * below; its content region announces newly appended rows through the ARIA\n * log role; each row carries the message id and anchor data a scroll-follow\n * behavior reads; and a static jump-to-latest control sits ready for that\n * same behavior to reveal.\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 { border } from \"@sdxc/u/color\";\nimport { rounded, shadow } from \"@sdxc/u/effects\";\nimport { raw } from \"@sdxc/u/general\";\nimport {\n\tabsolute,\n\tcontainer,\n\tflex,\n\tflexCol,\n\tgap,\n\tinsIe,\n\tinsIs,\n\tinset,\n\tjustify,\n\trelative,\n} from \"@sdxc/u/layout\";\nimport { pb, pi } from \"@sdxc/u/size\";\nimport { z } from \"@sdxc/u/stacking\";\nimport { when } from \"@sdxc/u/state\";\nimport { translateProperty } from \"@sdxc/u/transform\";\nimport { attrs } from \"remix/component\";\n\nimport { Button } from \"@sdxc/ui/button\";\nimport { ScrollArea } from \"@sdxc/ui/scroll-area\";\n\n/**\n * Named container {@link MessageScroller} declares on its own host, so\n * {@link MessageScroller.Button} can size its own placement to the\n * frame's own width.\n */\nconst CONTAINER_NAME = \"ui-message-scroller\";\n\n/**\n * Container width under which {@link MessageScroller.Button} switches from a\n * centered floating pill to a bar stretched across the frame's own inline\n * size. It is measured against the frame's own width, which a conversation\n * column keeps well under a viewport's, so only a phone-width column reaches it.\n */\nconst BUTTON_NARROW_QUERY = `@container ${CONTAINER_NAME} (max-width: 20rem)`;\n\n/**\n * `role=\"log\"` applied to {@link MessageScroller.Content} through\n * {@link attrs} unless a consumer supplies its own `role`, whose implicit\n * `aria-live=\"polite\"` behavior announces each newly appended row.\n */\nconst DEFAULT_CONTENT_ROLE = \"log\";\n\n/**\n * `aria-relevant=\"additions\"` applied to {@link MessageScroller.Content}\n * through {@link attrs} unless overridden, scoping assistive-technology\n * announcements to newly appended rows.\n */\nconst DEFAULT_CONTENT_ARIA_RELEVANT = \"additions\";\n\n/** Semantic color role {@link MessageScroller.Button} falls back to when `color` is omitted. */\nconst DEFAULT_BUTTON_COLOR: Button.Color = \"neutral\";\n\n/**\n * Visual weight {@link MessageScroller.Button} falls back to when `variant` is omitted.\n * The control floats over a conversation it points at rather than competing with it, so\n * it reads as a surface of its own carrying an arrow.\n */\nconst DEFAULT_BUTTON_VARIANT: Button.Variant = \"outline\";\n\n/** Size variant {@link MessageScroller.Button} falls back to when `size` is omitted. */\nconst DEFAULT_BUTTON_SIZE: Button.Size = \"sm\";\n\n/**\n * `hidden` applied to {@link MessageScroller.Button} when a consumer omits\n * it: the control starts absent from rendering and the accessibility tree\n * until a paired scroll-follow behavior reveals it.\n */\nconst DEFAULT_BUTTON_HIDDEN = true;\n\n/**\n * Prop types for {@link MessageScroller} and its compound parts.\n */\nexport namespace MessageScroller {\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * Size the frame through `mix` since {@link MessageScroller.Viewport}\n\t * fills whatever block size this host resolves to.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** The frame's compound parts: {@link MessageScroller.Viewport} and, optionally, {@link MessageScroller.Button}. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface ViewportProps extends TagProps<\"div\"> {\n\t\t/** {@link MessageScroller.Content}, scrolling inside the viewport. */\n\t\tchildren?: RemixNode;\n\t}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface ContentProps extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Marks the log as busy while a row inside it is still being written\n\t\t * to — a reply still streaming in, for instance — forwarded to the host's\n\t\t * native `aria-busy` attribute. Clear it once the row settles.\n\t\t */\n\t\t\"aria-busy\"?: TagProps<\"div\">[\"aria-busy\"];\n\t\t/** The {@link MessageScroller.Item} rows to render in document order. */\n\t\tchildren?: RemixNode;\n\t}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface ItemProps extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Stable id of the message this row renders, mirrored onto the host's\n\t\t * `data-message-id` attribute so a scroll-follow behavior can find,\n\t\t * measure, and scroll to this exact row directly.\n\t\t */\n\t\tmessageId: string;\n\t\t/**\n\t\t * Marks this row as a candidate anchor point — typically the first row\n\t\t * of a new turn — mirrored onto `data-scroll-anchor` so a scroll-follow\n\t\t * behavior can tell which rows are worth anchoring the viewport to.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tscrollAnchor?: boolean;\n\t\t/** The row's own content, typically a conversational row composed inside it. */\n\t\tchildren?: RemixNode;\n\t}\n\n\t/**\n\t * Every {@link Button.Props} field, unchanged, except `hidden`, which\n\t * defaults to `true`.\n\t */\n\texport interface ButtonProps extends Button.Props {\n\t\t/**\n\t\t * Whether the control is absent from rendering and the accessibility tree.\n\t\t * A paired scroll-follow behavior clears this attribute as the reader\n\t\t * scrolls away from the live edge and sets it again on return or press.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\thidden?: boolean;\n\t}\n}\n\n/**\n * Renders the frame's root host: a bordered, rounded `<div>` that\n * declares the `ui-message-scroller` container queried by\n * {@link MessageScroller.Button} for its own placement.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the frame's markup.\n * @example\n * <MessageScroller mix={css({ blockSize: \"32rem\" })}>\n * \t<MessageScroller.Viewport>\n * \t\t<MessageScroller.Content aria-busy={isStreaming}>\n * \t\t\t<MessageScroller.Item messageId={turn.id} scrollAnchor>\n * \t\t\t\t{turn.content}\n * \t\t\t</MessageScroller.Item>\n * \t\t</MessageScroller.Content>\n * \t</MessageScroller.Viewport>\n * \t<MessageScroller.Button aria-label={t(\"chat.jumpToLatest\")} />\n * </MessageScroller>\n */\nexport function MessageScroller(handle: Handle<MessageScroller.Props>) {\n\treturn () => {\n\t\tlet { children, 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=\"message-scroller\"\n\t\t\t\tmix={[\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tborder({ color: \"neutral\", width: 1 }),\n\t\t\t\t\trelative(),\n\t\t\t\t\tcontainer(CONTAINER_NAME),\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</div>\n\t\t);\n\t};\n}\n\n/**\n * Renders the frame's scrolling surface as {@link ScrollArea.Viewport},\n * fixed to the block axis. Compose `scrollFade()` through `mix` to fade\n * this viewport's edges when more content is off-screen.\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 * <MessageScroller.Viewport mix={scrollFade({ axis: \"block\" })}>\n * \t<MessageScroller.Content>...</MessageScroller.Content>\n * </MessageScroller.Viewport>\n */\nMessageScroller.Viewport = function MessageScrollerViewport(\n\thandle: Handle<MessageScroller.ViewportProps>,\n) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <ScrollArea.Viewport {...rest} orientation=\"vertical\" mix={mix} />;\n\t};\n};\n\n/**\n * Renders the frame's live region: a `<div>` carrying the ARIA log role,\n * stacking its {@link MessageScroller.Item} rows in a column and\n * announcing each added row via `aria-relevant=\"additions\"`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the log region's markup.\n * @example\n * <MessageScroller.Content aria-busy={isStreaming}>\n * \t<MessageScroller.Item messageId={turn.id}>{turn.content}</MessageScroller.Item>\n * </MessageScroller.Content>\n */\nMessageScroller.Content = function MessageScrollerContent(\n\thandle: Handle<MessageScroller.ContentProps>,\n) {\n\treturn () => {\n\t\tlet { children, 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=\"content\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_CONTENT_ROLE, \"aria-relevant\": DEFAULT_CONTENT_ARIA_RELEVANT }),\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tgap(4),\n\t\t\t\t\tpb(4),\n\t\t\t\t\tpi(4),\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</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders a single message row: a `<div>` mirroring `messageId` onto\n * `data-message-id` and, when `scrollAnchor` is set, an empty\n * `data-scroll-anchor` attribute for a scroll-follow behavior to read.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <MessageScroller.Item messageId={turn.id} scrollAnchor={turn.startsNewTurn}>\n * \t{turn.content}\n * </MessageScroller.Item>\n */\nMessageScroller.Item = function MessageScrollerItem(handle: Handle<MessageScroller.ItemProps>) {\n\treturn () => {\n\t\tlet { messageId, scrollAnchor, children, mix, ...rest } = handle.props;\n\n\t\tif (import.meta.env?.DEV && !messageId) {\n\t\t\tconsole.warn(\n\t\t\t\t'MessageScroller.Item: needs a \"messageId\" — a scroll-follow behavior matches rows against this instead of parsing rendered children.',\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"item\"\n\t\t\t\tdata-message-id={messageId}\n\t\t\t\tdata-scroll-anchor={scrollAnchor || undefined}\n\t\t\t\tmix={[\n\t\t\t\t\traw({\n\t\t\t\t\t\tscrollMarginBlockStart: \"var(--ui-message-scroller-anchor-offset, 0px)\",\n\t\t\t\t\t}),\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</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders a static jump-to-latest control as {@link Button}, floating\n * over the frame's block-end edge and starting `hidden` until a paired\n * scroll-follow behavior clears the attribute.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <MessageScroller.Button aria-label={t(\"chat.jumpToLatest\")}>\n * \t{t(\"chat.jumpToLatest\")}\n * </MessageScroller.Button>\n */\nMessageScroller.Button = function MessageScrollerButton(\n\thandle: Handle<MessageScroller.ButtonProps>,\n) {\n\treturn () => {\n\t\tlet { hidden, color, variant, size, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"button\"\n\t\t\t\tcolor={color ?? DEFAULT_BUTTON_COLOR}\n\t\t\t\tvariant={variant ?? DEFAULT_BUTTON_VARIANT}\n\t\t\t\tsize={size ?? DEFAULT_BUTTON_SIZE}\n\t\t\t\thidden={hidden ?? DEFAULT_BUTTON_HIDDEN}\n\t\t\t\tdata-slot=\"jump-button\"\n\t\t\t\tmix={[\n\t\t\t\t\tz(1),\n\t\t\t\t\tabsolute(),\n\t\t\t\t\tinset(\"auto\", \"auto\", \"1rem\", \"50%\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * The control floats over the log, so it carries an opaque surface of its own to stay\n\t\t\t\t\t * legible. `!important` settles it: each mix entry gets its own cascade sublayer, and\n\t\t\t\t\t * the variant's own fill may land in a later one.\n\t\t\t\t\t */\n\t\t\t\t\traw({ backgroundColor: \"var(--ui-bg, Canvas) !important\" }),\n\t\t\t\t\tshadow(\"md\"),\n\t\t\t\t\ttranslateProperty(\"-50% 0\"),\n\t\t\t\t\twhen(BUTTON_NARROW_QUERY, [\n\t\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\t\tinsIs(\"1rem\"),\n\t\t\t\t\t\tinsIe(\"1rem\"),\n\t\t\t\t\t\ttranslateProperty(\"0 0\"),\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"
14
- },
15
- "test": null
16
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "message",
3
- "changedIn": "2026.10.13",
4
- "dependencies": [],
5
- "exports": [
6
- "Message"
7
- ],
8
- "source": {
9
- "path": "message.tsx",
10
- "content": "/**\n * A single conversational turn in a message log: a row composing a\n * bottom-anchored avatar, a header for the sender's identity and timing, a\n * content slot for the message's own surface, and an optional footer for its\n * actions. Compound parts lay out entirely through CSS grid areas keyed off\n * each part's `data-slot`, so the avatar's vertical anchor and the footer's\n * presence never need to be tracked as state.\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 {\n\tcontainer,\n\tflex,\n\tflexWrap,\n\tgap,\n\tgrid,\n\tgridArea,\n\tgridTemplate,\n\thstack,\n\titems,\n\tjustify,\n\trelative,\n\tself,\n\tvstack,\n} from \"@sdxc/u/layout\";\nimport { at } from \"@sdxc/u/responsive\";\nimport { maxIs, minIs } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { fontSize, tabularNums, weight } from \"@sdxc/u/typography\";\n\n/**\n * Named container {@link Message} declares on its own host, so\n * {@link Message.Header} can query the row's own width instead of the\n * page's, matching whether it renders full-page or in a narrower panel.\n */\nconst CONTAINER_NAME = \"ui-message\";\n\n/**\n * Prop types for {@link Message} and its compound parts.\n */\nexport namespace Message {\n\t/**\n\t * Props accepted by {@link Message}.\n\t */\n\texport interface Props extends TagProps<\"article\"> {\n\t\t/** The row's compound parts: {@link Message.Avatar}, {@link Message.Header}, {@link Message.Content}, and an optional {@link Message.Footer}. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Message.Avatar}.\n\t */\n\texport interface AvatarProps extends TagProps<\"div\"> {\n\t\t/** An Avatar instance identifying the message's sender. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Message.Header}.\n\t */\n\texport interface HeaderProps extends TagProps<\"header\"> {\n\t\t/** The sender's name, typically followed by a timestamp. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Message.Content}.\n\t */\n\texport interface ContentProps extends TagProps<\"div\"> {\n\t\t/** The message's own surface — a Bubble, an attachment card, or any other rendered turn content. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Message.Footer}.\n\t */\n\texport interface FooterProps extends TagProps<\"footer\"> {\n\t\t/** The row's actions, typically a copy Button and a like Button. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Message.Group}.\n\t */\n\texport interface GroupProps extends TagProps<\"div\"> {\n\t\t/** A run of consecutive {@link Message} rows sharing the same sender. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders the message row as a two-column grid whose `\"avatar\"` area spans only the\n * header and content rows, anchoring {@link Message.Avatar} to the bottom edge\n * of {@link Message.Content}, regardless of whether {@link Message.Footer} renders.\n *\n * @param handle Runtime handle carrying the host `<article>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <Message>\n * \t<Message.Avatar>\n * \t\t<Avatar>\n * \t\t\t<Avatar.Image src={sender.avatarUrl} alt={sender.name} />\n * \t\t\t<Avatar.Fallback>{sender.initials}</Avatar.Fallback>\n * \t\t</Avatar>\n * \t</Message.Avatar>\n * \t<Message.Header>\n * \t\t<strong>{sender.name}</strong>\n * \t\t<time dateTime={message.sentAt}>{formattedTime}</time>\n * \t</Message.Header>\n * \t<Message.Content>\n * \t\t<Bubble>{message.text}</Bubble>\n * \t</Message.Content>\n * \t<Message.Footer>\n * \t\t<Button\n * \t\t\taria-label={t(\"message.copy\")}\n * \t\t\tcommandfor={`${message.id}-text`}\n * \t\t\tcommand={COPY_COMMAND}\n * \t\t\tmix={copyToClipboard()}\n * \t\t>\n * \t\t\t<CopyIcon />\n * \t\t</Button>\n * \t\t<Button aria-label={t(\"message.like\")} onClick={likeMessage}>\n * \t\t\t<ThumbsUpIcon />\n * \t\t</Button>\n * \t</Message.Footer>\n * </Message>\n */\nexport function Message(handle: Handle<Message.Props>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<article\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"message\"\n\t\t\t\tmix={[\n\t\t\t\t\trelative(),\n\t\t\t\t\tgrid(),\n\t\t\t\t\tgap(\"var(--ui-message-row-gap, 0.25rem)\", \"var(--ui-message-gap, 0.75rem)\"),\n\t\t\t\t\tcontainer(CONTAINER_NAME),\n\t\t\t\t\tgridTemplate({\n\t\t\t\t\t\tcolumns: \"auto 1fr\",\n\t\t\t\t\t\tareas: `\"avatar header\" \"avatar content\" \". footer\"`,\n\t\t\t\t\t}),\n\t\t\t\t\twhen('& > [data-slot=\"avatar\"]', [gridArea(\"avatar\"), self(\"end\")]),\n\t\t\t\t\twhen('& > [data-slot=\"header\"]', gridArea(\"header\")),\n\t\t\t\t\twhen('& > [data-slot=\"content\"]', gridArea(\"content\")),\n\t\t\t\t\twhen('& > [data-slot=\"footer\"]', gridArea(\"footer\")),\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</article>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Message.AvatarProps.children} as the row's avatar slot,\n * aligned to the `\"avatar\"` area's block-end edge so it tracks the bottom\n * edge of {@link Message.Content}. Nest an Avatar instance inside it.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the avatar slot's markup.\n * @example\n * <Message.Avatar>\n * \t<Avatar>\n * \t\t<Avatar.Image src={sender.avatarUrl} alt={sender.name} />\n * \t\t<Avatar.Fallback>{sender.initials}</Avatar.Fallback>\n * \t</Avatar>\n * </Message.Avatar>\n */\nMessage.Avatar = function MessageAvatar(handle: Handle<Message.AvatarProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"avatar\" mix={[flex(), mix]}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Message.HeaderProps.children} as the row's identity line,\n * wrapping until the `ui-message` container passes `26rem`, then settling\n * onto one row with the sender's name first and later children as secondary metadata.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the identity line's markup.\n * @example\n * <Message.Header>\n * \t<strong>{sender.name}</strong>\n * \t<time dateTime={message.sentAt}>{formattedTime}</time>\n * </Message.Header>\n */\nMessage.Header = function MessageHeader(handle: Handle<Message.HeaderProps>) {\n\treturn () => {\n\t\tlet { children, 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\tflex(),\n\t\t\t\t\tflexWrap(\"wrap\"),\n\t\t\t\t\titems(\"baseline\"),\n\t\t\t\t\tgap(\"0.125rem\", \"0.5rem\"),\n\t\t\t\t\twhen(\"& > :first-child\", [fontSize(\"sm\"), weight(\"semibold\"), fg(\"neutral.emphasis\")]),\n\t\t\t\t\twhen(\"& > :not(:first-child)\", [fontSize(\"xs\"), fg(\"neutral.muted\"), tabularNums()]),\n\t\t\t\t\tat(\"26rem\", CONTAINER_NAME, [flexWrap(\"nowrap\"), justify(\"between\")]),\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</header>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Message.ContentProps.children} as the row's content slot,\n * capped to a comfortable reading measure and never narrower than its grid\n * area. Nest a Bubble, attachment card, or other turn content inside it.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the content slot's markup.\n * @example\n * <Message.Content>\n * \t<Bubble>{message.text}</Bubble>\n * </Message.Content>\n */\nMessage.Content = function MessageContent(handle: Handle<Message.ContentProps>) {\n\treturn () => {\n\t\tlet { children, 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=\"content\"\n\t\t\t\tmix={[\n\t\t\t\t\tvstack({ gap: \"0.375rem\" }),\n\t\t\t\t\tminIs(\"0\"),\n\t\t\t\t\tmaxIs(\"var(--ui-message-content-max-size, 36rem)\"),\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</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Message.FooterProps.children} as the row's action slot,\n * occupying the grid's `\"footer\"` area beneath {@link Message.Content} and\n * never reached by {@link Message.Avatar}'s bottom anchor.\n *\n * @param handle Runtime handle carrying the host `<footer>`'s props.\n * @returns The render function producing the action slot's markup.\n * @example\n * <Message.Footer>\n * \t<Button\n * \t\taria-label={t(\"message.copy\")}\n * \t\tcommandfor={`${message.id}-text`}\n * \t\tcommand={COPY_COMMAND}\n * \t\tmix={copyToClipboard()}\n * \t>\n * \t\t<CopyIcon />\n * \t</Button>\n * \t<Button aria-label={t(\"message.like\")} onClick={likeMessage}>\n * \t\t<ThumbsUpIcon />\n * \t</Button>\n * </Message.Footer>\n */\nMessage.Footer = function MessageFooter(handle: Handle<Message.FooterProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<footer {...rest} data-slot=\"footer\" mix={[hstack({ align: \"center\", gap: \"0.25rem\" }), mix]}>\n\t\t\t\t{children}\n\t\t\t</footer>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Message.GroupProps.children} as a run of consecutive\n * {@link Message} rows sharing the same sender, stacked with a hairline gap\n * that reads as one continuous turn.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the group's markup.\n * @example\n * <Message.Group>\n * \t<Message>\n * \t\t<Message.Header>{sender.name}</Message.Header>\n * \t\t<Message.Content><Bubble>{firstReply.text}</Bubble></Message.Content>\n * \t</Message>\n * \t<Message>\n * \t\t<Message.Avatar>\n * \t\t\t<Avatar>\n * \t\t\t\t<Avatar.Image src={sender.avatarUrl} alt={sender.name} />\n * \t\t\t\t<Avatar.Fallback>{sender.initials}</Avatar.Fallback>\n * \t\t\t</Avatar>\n * \t\t</Message.Avatar>\n * \t\t<Message.Content><Bubble>{secondReply.text}</Bubble></Message.Content>\n * \t</Message>\n * </Message.Group>\n */\nMessage.Group = function MessageGroup(handle: Handle<Message.GroupProps>) {\n\treturn () => {\n\t\tlet { children, 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\"\n\t\t\t\tmix={[vstack({ gap: \"var(--ui-message-group-gap, 0.125rem)\" }), mix]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n};\n"
11
- },
12
- "test": null
13
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "resizable",
3
- "changedIn": "2026.10.20",
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
- }
@@ -1,18 +0,0 @@
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
- }
@@ -1,13 +0,0 @@
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
- }
@@ -1,16 +0,0 @@
1
- {
2
- "name": "split",
3
- "changedIn": "2026.10.30",
4
- "dependencies": [],
5
- "exports": [
6
- "Split"
7
- ],
8
- "source": {
9
- "path": "split.tsx",
10
- "content": "/**\n * Two-column marketing band content: prose on one side and the media it\n * describes on the other. Stacks to a single column under the nearest\n * container; `lean` hands the wider track to copy or media.\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 { raw } from \"@sdxc/u/general\";\nimport { container, gap, grid, gridTemplate, items, vstack } from \"@sdxc/u/layout\";\nimport { at } from \"@sdxc/u/responsive\";\nimport { minIs } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { leading, text } from \"@sdxc/u/typography\";\n\n/** Which column gets the wider track when `lean` is omitted. */\nconst DEFAULT_LEAN: Split.Lean = \"media\";\n\n/** The check each claim list item is marked with, drawn as a brand-filled mask. */\nconst CHECK_MASK = `url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E\") center / contain no-repeat`;\n\n/**\n * Prop types for {@link Split} and its compound parts.\n */\nexport namespace Split {\n\t/**\n\t * Which column receives the wider track above the stack breakpoint.\n\t */\n\texport type Lean = \"copy\" | \"media\";\n\n\t/**\n\t * Props accepted by {@link Split}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Which column is wider. Defaults to {@link DEFAULT_LEAN} so media\n\t\t * usually leads the layout.\n\t\t */\n\t\tlean?: Lean;\n\t\t/** {@link Split.Copy} and {@link Split.Media} columns. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Split.Copy}.\n\t */\n\texport interface CopyProps extends TagProps<\"div\"> {\n\t\t/**\n\t\t * When set, unordered lists inside the copy render as checked claims\n\t\t * rather than bullets.\n\t\t */\n\t\tchecks?: boolean;\n\t\t/** Prose, claims, and supporting copy for the column. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Split.Media}.\n\t */\n\texport interface MediaProps extends TagProps<\"div\"> {\n\t\t/** Media, samples, or staged UI for the column. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Lays {@link Split.Copy} and {@link Split.Media} as a two-track grid. The host\n * is the named sizing container; an inner wrapper holds the tracks and\n * `@container` column rules so the query can restyle a descendant. Collapses\n * to one column below `xl` (64rem), matching the landing's original viewport\n * threshold so copy and media do not squeeze side-by-side too early.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the split's markup.\n * @example\n * <Split lean=\"copy\">\n * \t<Split.Copy checks>{claims}</Split.Copy>\n * \t<Split.Media>{shot}</Split.Media>\n * </Split>\n */\nexport function Split(handle: Handle<Split.Props>) {\n\treturn () => {\n\t\tlet { children, lean, mix, ...rest } = handle.props;\n\t\tlet resolvedLean = lean ?? DEFAULT_LEAN;\n\t\tlet columns =\n\t\t\tresolvedLean === \"copy\"\n\t\t\t\t? \"minmax(0, 1.15fr) minmax(0, 0.85fr)\"\n\t\t\t\t: \"minmax(0, 0.85fr) minmax(0, 1.15fr)\";\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-lean={resolvedLean}\n\t\t\t\tdata-slot=\"split\"\n\t\t\t\tmix={[container(\"ui-marketing-split\"), mix]}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tmix={[\n\t\t\t\t\t\tgrid(),\n\t\t\t\t\t\tgap(12),\n\t\t\t\t\t\titems(\"start\"),\n\t\t\t\t\t\tgridTemplate({ columns: \"minmax(0, 1fr)\" }),\n\t\t\t\t\t\tat(\"xl\", \"ui-marketing-split\", gridTemplate({ columns })),\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t};\n}\n\n/**\n * The prose column of a {@link Split}. Pass `checks` so nested unordered\n * lists read as claim rows with brand check marks.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the copy column.\n * @example\n * <Split.Copy checks>\n * \t<ul><li>{t(\"claim.one\")}</li></ul>\n * </Split.Copy>\n */\nSplit.Copy = function SplitCopy(handle: Handle<Split.CopyProps>) {\n\treturn () => {\n\t\tlet { checks, 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=\"split-copy\"\n\t\t\t\tdata-checks={checks ? \"true\" : undefined}\n\t\t\t\tmix={[\n\t\t\t\t\tvstack({ gap: 6, align: \"stretch\" }),\n\t\t\t\t\ttext(\"lg\"),\n\t\t\t\t\tleading(\"relaxed\"),\n\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\tchecks\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t\t\t\"& ul\",\n\t\t\t\t\t\t\t\t\traw({\n\t\t\t\t\t\t\t\t\t\tlistStyle: \"none\",\n\t\t\t\t\t\t\t\t\t\tpadding: \"0\",\n\t\t\t\t\t\t\t\t\t\tmargin: \"0\",\n\t\t\t\t\t\t\t\t\t\tdisplay: \"grid\",\n\t\t\t\t\t\t\t\t\t\tgap: \"0.625rem\",\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\twhen(\n\t\t\t\t\t\t\t\t\t\"& li\",\n\t\t\t\t\t\t\t\t\traw({\n\t\t\t\t\t\t\t\t\t\tposition: \"relative\",\n\t\t\t\t\t\t\t\t\t\tpaddingInlineStart: \"1.75rem\",\n\t\t\t\t\t\t\t\t\t\tfontSize: \"1rem\",\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\twhen(\n\t\t\t\t\t\t\t\t\t\"& li::before\",\n\t\t\t\t\t\t\t\t\traw({\n\t\t\t\t\t\t\t\t\t\tcontent: '\"\"',\n\t\t\t\t\t\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\t\t\t\t\t\tinsetInlineStart: \"0\",\n\t\t\t\t\t\t\t\t\t\tinsetBlockStart: \"0.3em\",\n\t\t\t\t\t\t\t\t\t\tinlineSize: \"1rem\",\n\t\t\t\t\t\t\t\t\t\tblockSize: \"1rem\",\n\t\t\t\t\t\t\t\t\t\tbackgroundColor: \"var(--ui-brand-fg)\",\n\t\t\t\t\t\t\t\t\t\tmask: CHECK_MASK,\n\t\t\t\t\t\t\t\t\t\tWebkitMask: CHECK_MASK,\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]\n\t\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 * The media column of a {@link Split}, sized to the track rather than its\n * content so a long sample does not tower over the copy beside it.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the media column.\n * @example\n * <Split.Media>\n * \t<img src={shot} alt={alt} />\n * </Split.Media>\n */\nSplit.Media = function SplitMedia(handle: Handle<Split.MediaProps>) {\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=\"split-media\"\n\t\t\t\tmix={[\n\t\t\t\t\tvstack({ gap: 4, align: \"stretch\" }),\n\t\t\t\t\tminIs(0),\n\t\t\t\t\ttext(\"base\"),\n\t\t\t\t\twhen(\"& pre\", raw({ maxBlockSize: \"22rem\", overflowY: \"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": {
13
- "path": "split.test.tsx",
14
- "content": "/**\n * Covers {@link Split} lean tracks, check-styled copy lists, and media column\n * sizing.\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 { Split } from \"@sdxc/ui/split\";\n\ndescribe(\"Split\", () => {\n\ttest(\"leans the wider track toward copy when requested\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Split lean=\"copy\">\n\t\t\t\t<Split.Copy>Claims</Split.Copy>\n\t\t\t\t<Split.Media>Shot</Split.Media>\n\t\t\t</Split>,\n\t\t);\n\n\t\texpect(html).toContain('data-lean=\"copy\"');\n\t\texpect(html).toContain(\"container: ui-marketing-split / inline-size\");\n\t\texpect(html).toContain(\"1.15fr\");\n\t\texpect(html).toContain(\"0.85fr\");\n\t\texpect(html).toContain('data-slot=\"split-copy\"');\n\t\texpect(html).toContain('data-slot=\"split-media\"');\n\t});\n\n\ttest(\"marks checked claim lists when checks is set\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Split.Copy checks>\n\t\t\t\t<ul>\n\t\t\t\t\t<li>Claim one</li>\n\t\t\t\t</ul>\n\t\t\t</Split.Copy>,\n\t\t);\n\n\t\texpect(html).toContain('data-checks=\"true\"');\n\t\texpect(html).toContain(\"list-style: none\");\n\t\texpect(html).toContain(\"-webkit-mask:\");\n\t});\n\n\ttest(\"keeps the named container on the host and the column tracks on an inner wrapper\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Split lean=\"media\">\n\t\t\t\t<Split.Copy>Claims</Split.Copy>\n\t\t\t\t<Split.Media>Shot</Split.Media>\n\t\t\t</Split>,\n\t\t);\n\n\t\texpect(html).toMatch(/data-slot=\"split\"[^>]*>\\s*<div\\b/);\n\t\texpect(html).toContain(\"container: ui-marketing-split / inline-size\");\n\t\texpect(html).toContain(\"@container ui-marketing-split (min-width: 64rem)\");\n\n\t\tlet hostClasses = new Set(\n\t\t\t(html.match(/data-slot=\"split\"[^>]*class=\"([^\"]+)\"/)?.[1] ?? \"\").split(/\\s+/).filter(Boolean),\n\t\t);\n\t\tlet tracksMatch = html.match(\n\t\t\t/@container ui-marketing-split \\(min-width:[^)]+\\)\\s*\\{\\s*\\.([a-z0-9-]+)\\s*\\{/,\n\t\t);\n\t\texpect(tracksMatch?.[1]).toBeTruthy();\n\t\texpect(hostClasses.has(tracksMatch![1]!)).toBe(false);\n\t});\n});\n"
15
- }
16
- }
@@ -1,16 +0,0 @@
1
- {
2
- "name": "stat-strip",
3
- "changedIn": "2026.10.30",
4
- "dependencies": [],
5
- "exports": [
6
- "StatStrip"
7
- ],
8
- "source": {
9
- "path": "stat-strip.tsx",
10
- "content": "/**\n * A numeric proof strip for marketing bands: each cell carries a value and a\n * label supplied by the page, laid out as a responsive grid with ruled or\n * gapped seams.\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 { borderEdge, fg } from \"@sdxc/u/color\";\nimport { container, gap, grid, gridTemplate, repeat, vstack } from \"@sdxc/u/layout\";\nimport { at } from \"@sdxc/u/responsive\";\nimport { p } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { balance, leading, text, tracking, weight } from \"@sdxc/u/typography\";\n\n/** Seam treatment {@link StatStrip} applies when `variant` is omitted. */\nconst DEFAULT_VARIANT: StatStrip.Variant = \"ruled\";\n\n/**\n * Prop types for {@link StatStrip} and its compound parts.\n */\nexport namespace StatStrip {\n\t/**\n\t * How cells meet: a hairline between them, or a gap with no rule.\n\t */\n\texport type Variant = \"ruled\" | \"gap\";\n\n\t/**\n\t * Props accepted by {@link StatStrip}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Seam treatment. Defaults to {@link DEFAULT_VARIANT}. */\n\t\tvariant?: Variant;\n\t\t/** One or more {@link StatStrip.Item} cells. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link StatStrip.Item}.\n\t */\n\texport interface ItemProps extends TagProps<\"div\"> {\n\t\t/** What the number counts — always supplied by the page. */\n\t\tlabel: RemixNode;\n\t\t/** The figure itself. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Lays {@link StatStrip.Item} children in a responsive grid. The host is the\n * named sizing container; an inner wrapper holds the tracks and `@container`\n * column / seam rules so the query can restyle a descendant. Starts at two\n * columns and opens to five above `xl` (64rem), matching the landing's original\n * viewport threshold so mid-width viewports stay a readable pair.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the strip's markup.\n * @example\n * <StatStrip>\n * \t<StatStrip.Item label={t(\"stats.packages\")}>42</StatStrip.Item>\n * \t<StatStrip.Item label={t(\"stats.apps\")}>12</StatStrip.Item>\n * </StatStrip>\n */\nexport function StatStrip(handle: Handle<StatStrip.Props>) {\n\treturn () => {\n\t\tlet { children, mix, variant, ...rest } = handle.props;\n\t\tlet resolvedVariant = variant ?? DEFAULT_VARIANT;\n\t\tlet isRuled = resolvedVariant === \"ruled\";\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-variant={resolvedVariant}\n\t\t\t\tdata-slot=\"stat-strip\"\n\t\t\t\tmix={[container(\"ui-marketing-stat-strip\"), mix]}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tmix={[\n\t\t\t\t\t\tgrid(),\n\t\t\t\t\t\tisRuled ? gap(0) : gap(6),\n\t\t\t\t\t\tgridTemplate({ columns: repeat(2, \"minmax(0, 1fr)\") }),\n\t\t\t\t\t\tat(\n\t\t\t\t\t\t\t\"xl\",\n\t\t\t\t\t\t\t\"ui-marketing-stat-strip\",\n\t\t\t\t\t\t\tgridTemplate({ columns: repeat(5, \"minmax(0, 1fr)\") }),\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen(\"& > *\", [p(6, 5), at(\"lg\", \"ui-marketing-stat-strip\", p(8, 8))]),\n\t\t\t\t\t\tisRuled\n\t\t\t\t\t\t\t? when(\n\t\t\t\t\t\t\t\t\t\"& > * + *\",\n\t\t\t\t\t\t\t\t\tat(\n\t\t\t\t\t\t\t\t\t\t\"xl\",\n\t\t\t\t\t\t\t\t\t\t\"ui-marketing-stat-strip\",\n\t\t\t\t\t\t\t\t\t\tborderEdge(\"inline-start\", {\n\t\t\t\t\t\t\t\t\t\t\tcolor: \"neutral\",\n\t\t\t\t\t\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\t\t\t\t\t\tstyle: \"solid\",\n\t\t\t\t\t\t\t\t\t\t}),\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: [],\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t};\n}\n\n/**\n * One proof cell: the figure as `children`, and what it counts as `label`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the cell's markup.\n * @example\n * <StatStrip.Item label={t(\"stats.uptime\")}>99.99%</StatStrip.Item>\n */\nStatStrip.Item = function StatStripItem(handle: Handle<StatStrip.ItemProps>) {\n\treturn () => {\n\t\tlet { children, label, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"stat-strip-item\" mix={[vstack({ gap: 1, align: \"start\" }), mix]}>\n\t\t\t\t<span\n\t\t\t\t\tmix={[\n\t\t\t\t\t\ttext(\"3xl\"),\n\t\t\t\t\t\tweight(\"medium\"),\n\t\t\t\t\t\ttracking(\"tight\"),\n\t\t\t\t\t\tleading(\"none\"),\n\t\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</span>\n\t\t\t\t<span mix={[text(\"sm\"), leading(\"snug\"), balance(), fg(\"neutral\")]}>{label}</span>\n\t\t\t</div>\n\t\t);\n\t};\n};\n"
11
- },
12
- "test": {
13
- "path": "stat-strip.test.tsx",
14
- "content": "/**\n * Covers {@link StatStrip} ruled and gap variants plus item value/label slots.\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 { StatStrip } from \"@sdxc/ui/stat-strip\";\n\ndescribe(\"StatStrip\", () => {\n\ttest(\"renders ruled cells with value and label\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<StatStrip>\n\t\t\t\t<StatStrip.Item label=\"Packages\">42</StatStrip.Item>\n\t\t\t\t<StatStrip.Item label=\"Apps\">12</StatStrip.Item>\n\t\t\t</StatStrip>,\n\t\t);\n\n\t\texpect(html).toContain('data-variant=\"ruled\"');\n\t\texpect(html).toContain(\"42\");\n\t\texpect(html).toContain(\"Packages\");\n\t\texpect(html).toContain(\"border-inline-start\");\n\t\texpect(html).toContain(\"container: ui-marketing-stat-strip / inline-size\");\n\t});\n\n\ttest(\"uses a gap seam when variant is gap\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<StatStrip variant=\"gap\">\n\t\t\t\t<StatStrip.Item label=\"Uptime\">99.99%</StatStrip.Item>\n\t\t\t</StatStrip>,\n\t\t);\n\n\t\texpect(html).toContain('data-variant=\"gap\"');\n\t\texpect(html).toContain(\"99.99%\");\n\t});\n\n\ttest(\"keeps the named container on the host and the column tracks on an inner wrapper\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<StatStrip>\n\t\t\t\t<StatStrip.Item label=\"Packages\">42</StatStrip.Item>\n\t\t\t\t<StatStrip.Item label=\"Apps\">12</StatStrip.Item>\n\t\t\t</StatStrip>,\n\t\t);\n\n\t\texpect(html).toMatch(/data-slot=\"stat-strip\"[^>]*>\\s*<div\\b/);\n\t\texpect(html).toContain(\"container: ui-marketing-stat-strip / inline-size\");\n\t\texpect(html).toContain(\"@container ui-marketing-stat-strip (min-width: 64rem)\");\n\t\texpect(html).toContain(\"repeat(5, minmax(0, 1fr))\");\n\n\t\tlet hostClasses = new Set(\n\t\t\t(html.match(/data-slot=\"stat-strip\"[^>]*class=\"([^\"]+)\"/)?.[1] ?? \"\")\n\t\t\t\t.split(/\\s+/)\n\t\t\t\t.filter(Boolean),\n\t\t);\n\t\tlet tracksMatch = html.match(\n\t\t\t/@container ui-marketing-stat-strip \\(min-width:[^)]+\\)\\s*\\{\\s*\\.([a-z0-9-]+)\\s*\\{/,\n\t\t);\n\t\texpect(tracksMatch?.[1]).toBeTruthy();\n\t\texpect(hostClasses.has(tracksMatch![1]!)).toBe(false);\n\t});\n});\n"
15
- }
16
- }
@@ -1,16 +0,0 @@
1
- {
2
- "name": "table",
3
- "changedIn": "2026.10.13",
4
- "dependencies": [],
5
- "exports": [
6
- "Table"
7
- ],
8
- "source": {
9
- "path": "table.tsx",
10
- "content": "/**\n * A tabular data display built on the native `<table>` element, with column\n * headers that become sort links and a trailing row that becomes a\n * \"load more\" link — both driven entirely by URLs a consumer computes, so the\n * sorted or paginated result renders back from the server with no client\n * state to track.\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 { ArrowDownIcon, ArrowUpDownIcon, ArrowUpIcon } from \"@sdxc/icons\";\nimport {\n\tbg,\n\tborderEdge,\n\tcenter,\n\tcontainer,\n\tcursor,\n\tfg,\n\tflex,\n\tfontSize,\n\tgap,\n\thover,\n\tis,\n\titems,\n\tjustify,\n\topacity,\n\toutline,\n\toverflow,\n\tp,\n\tpb,\n\tpi,\n\traw,\n\trelative,\n\tshrink,\n\ttabularNums,\n\ttextAlign,\n\ttextDecoration,\n\tuserSelect,\n\tvirtualize,\n\tweight,\n\twhen,\n} from \"@sdxc/u\";\nimport { attrs } from \"remix/component\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { warnIfNoAccessibleLabel } from \"@sdxc/ui/utils\";\n\n/**\n * Named container {@link Table.Container} declares on its own host, so a\n * consumer's own descendant styles can query the wrapper's width instead of\n * the page's.\n */\nconst CONTAINER_NAME = \"ui-table\";\n\n/** Text alignment {@link Table.Column} falls back to when `align` is omitted. */\nconst DEFAULT_ALIGN: Table.Align = \"start\";\n\n/**\n * Text alignment a `numeric` {@link Table.Column} falls back to when `align` is\n * omitted, lining its header up with the end-aligned figures beneath it.\n */\nconst DEFAULT_NUMERIC_ALIGN: Table.Align = \"end\";\n\n/**\n * Flex alignment a sortable header's link takes for each column alignment, so the\n * link fills the whole cell and still places its label where `align` puts it.\n */\nconst JUSTIFY_BY_ALIGN = { start: \"start\", center: \"center\", end: \"end\" } as const;\n\n/**\n * Prop types for {@link Table} and its compound parts.\n */\nexport namespace Table {\n\t/**\n\t * Text alignment for a column's header and, by convention, its cells.\n\t * `\"start\"`/`\"end\"` follow the writing direction, so a column stays\n\t * left- or right-aligned correctly under `dir=\"rtl\"`.\n\t */\n\texport type Align = \"start\" | \"center\" | \"end\";\n\n\t/**\n\t * Current sort direction for a sortable column, matching the values the\n\t * native `aria-sort` attribute accepts. Leaving it unset while `href` is\n\t * set renders the column as sortable but not the active sort key.\n\t */\n\texport type SortDirection = \"ascending\" | \"descending\";\n\n\t/**\n\t * Every native `<table>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface Props extends TagProps<\"table\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface ContainerProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<thead>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface HeaderProps extends TagProps<\"thead\"> {}\n\n\t/**\n\t * Every native `<tbody>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface BodyProps extends TagProps<\"tbody\"> {}\n\n\t/**\n\t * Per-part styling for the elements a sortable {@link Table.Column} renders\n\t * besides its own `<th>` host.\n\t */\n\texport interface ColumnPartsProps {\n\t\t/** Styling for the header's inner link, rendered only when `href` is set. */\n\t\tlink?: TagProps<\"a\">[\"mix\"];\n\t}\n\n\t/**\n\t * Every native `<th>` attribute, plus the `mix` passthrough. Setting\n\t * `href` turns the header into a sort link exposing `aria-sort`; `align`\n\t * shadows the deprecated native `align` with the logical values above.\n\t */\n\texport interface ColumnProps extends Omit<TagProps<\"th\">, \"align\"> {\n\t\t/**\n\t\t * Text alignment for the header and its indicator. Defaults to {@link DEFAULT_ALIGN},\n\t\t * or {@link DEFAULT_NUMERIC_ALIGN} for a `numeric` column.\n\t\t */\n\t\talign?: Align;\n\t\t/**\n\t\t * Marks the column as holding numbers, exposed as `data-numeric`: the header aligns\n\t\t * to the end unless `align` says otherwise, matching `numeric` cells beneath it.\n\t\t */\n\t\tnumeric?: boolean;\n\t\t/** Target URL that re-requests the table sorted by this column. Omit for an unsortable column. */\n\t\thref?: string;\n\t\t/** This column's current sort direction, when it's the active sort key. */\n\t\tsortDirection?: SortDirection;\n\t\t/** Per-part styling for the sortable header's internal elements. */\n\t\tparts?: ColumnPartsProps;\n\t}\n\n\t/**\n\t * Every native `<tr>` attribute, unchanged, plus the `mix` passthrough.\n\t * Set `aria-selected=\"true\"` directly to mark a row selected — the row's\n\t * own selection tint rides that native attribute.\n\t */\n\texport interface RowProps extends TagProps<\"tr\"> {}\n\n\t/**\n\t * Every native `<td>` attribute plus the `mix` passthrough and `numeric`.\n\t */\n\texport interface CellProps extends TagProps<\"td\"> {\n\t\t/**\n\t\t * Marks the cell as a number, exposed as `data-numeric`: its figures render at\n\t\t * tabular widths and align to the end, so digits line up down the column.\n\t\t */\n\t\tnumeric?: boolean;\n\t}\n\n\t/**\n\t * Per-part styling for the elements {@link Table.LoadMore} renders besides\n\t * its own `<tr>` host.\n\t */\n\texport interface LoadMorePartsProps {\n\t\t/** Styling for the `<td>` spanning the row beneath the link. */\n\t\tcell?: TagProps<\"td\">[\"mix\"];\n\t\t/** Styling for the link itself. */\n\t\tlink?: TagProps<\"a\">[\"mix\"];\n\t}\n\n\t/**\n\t * Every native `<tr>` attribute, plus the `mix` passthrough. `colSpan`\n\t * should match the number of columns the surrounding table renders so\n\t * the link spans the full row width.\n\t */\n\texport interface LoadMoreProps extends TagProps<\"tr\"> {\n\t\t/** Target URL that renders the next page of results. */\n\t\thref: string;\n\t\t/** Number of columns the surrounding table renders, so the link spans the full row width. */\n\t\tcolSpan: number;\n\t\t/** The link's visible label, e.g. \"Load more\" or \"Next page\". */\n\t\tchildren: RemixNode;\n\t\t/** Per-part styling for the row's internal cell and link. */\n\t\tparts?: LoadMorePartsProps;\n\t}\n}\n\n/**\n * Renders the table's `<table>` host: a full-width, border-collapsed grid\n * with a small base font size, ready to hold {@link Table.Header} and\n * {@link Table.Body}. Dev mode warns when it lacks an accessible name.\n *\n * @param handle Runtime handle carrying the host `<table>`'s props.\n * @returns The render function producing the table's markup.\n * @example\n * <Table aria-label={t(\"subjects.title\")}>\n * \t<Table.Header>\n * \t\t<Table.Row>\n * \t\t\t<Table.Column>{t(\"subjects.name\")}</Table.Column>\n * \t\t</Table.Row>\n * \t</Table.Header>\n * \t<Table.Body>\n * \t\t<Table.Row>\n * \t\t\t<Table.Cell>{subject.name}</Table.Cell>\n * \t\t</Table.Row>\n * \t</Table.Body>\n * </Table>\n */\nexport function Table(handle: Handle<Table.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t'Table: needs an \"aria-label\" or \"aria-labelledby\" describing its contents for assistive technology.',\n\t\t);\n\n\t\treturn (\n\t\t\t<table\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"table\"\n\t\t\t\tmix={[is(\"100%\"), raw({ borderCollapse: \"collapse\" }), fontSize(\"sm\"), mix]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders an optional wrapper around {@link Table}: a relatively positioned\n * `<div>` that scrolls its own inline axis when the table grows wider than\n * the available space, and declares the `ui-table` named container.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the wrapper's markup.\n * @example\n * <Table.Container>\n * \t<Table aria-label={t(\"subjects.title\")}>...</Table>\n * </Table.Container>\n */\nTable.Container = function TableContainer(handle: Handle<Table.ContainerProps>) {\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=\"container\"\n\t\t\t\tmix={[relative(), is(\"100%\"), overflow(\"auto\"), container(CONTAINER_NAME), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders the table's `<thead>` host: a plain wrapper for the header\n * {@link Table.Row}, separated from {@link Table.Body} by a block-end border.\n *\n * @param handle Runtime handle carrying the host `<thead>`'s props.\n * @returns The render function producing the header section's markup.\n * @example\n * <Table.Header>\n * \t<Table.Row>\n * \t\t<Table.Column>{t(\"subjects.name\")}</Table.Column>\n * \t</Table.Row>\n * </Table.Header>\n */\nTable.Header = function TableHeader(handle: Handle<Table.HeaderProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<thead\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"header\"\n\t\t\t\tmix={[borderEdge(\"block-end\", { color: \"neutral\", width: 1 }), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders the table's `<tbody>` host: a block-start border rules the space\n * between direct row children, and `content-visibility: auto` lets a long\n * body's off-screen rows skip layout and paint until they scroll into view.\n *\n * @param handle Runtime handle carrying the host `<tbody>`'s props.\n * @returns The render function producing the body section's markup.\n * @example\n * <Table.Body>\n * \t{subjects.map((subject) => (\n * \t\t<Table.Row key={subject.id}>\n * \t\t\t<Table.Cell>{subject.name}</Table.Cell>\n * \t\t</Table.Row>\n * \t))}\n * </Table.Body>\n */\nTable.Body = function TableBody(handle: Handle<Table.BodyProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<tbody\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"body\"\n\t\t\t\tmix={[\n\t\t\t\t\tvirtualize(\"auto var(--ui-table-body-intrinsic-size, 32rem)\"),\n\t\t\t\t\twhen(\n\t\t\t\t\t\t\"& > :not([hidden]) ~ :not([hidden])\",\n\t\t\t\t\t\tborderEdge(\"block-start\", { color: \"neutral\", width: 1 }),\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 column header inside a native `<th scope=\"col\">`, aligned by `data-align`.\n * Setting `href` makes the header a cell-filling sort link with `aria-sort` and a direction\n * indicator held square, so a header narrow enough to squeeze the link keeps both arrows legible.\n *\n * @param handle Runtime handle carrying the host `<th>`'s props.\n * @returns The render function producing the column header's markup.\n * @example\n * <Table.Column>{t(\"subjects.email\")}</Table.Column>\n * @example\n * <Table.Column numeric>{t(\"invoices.amount\")}</Table.Column>\n * @example\n * <Table.Column href={sortUrl(\"name\", nextDirection)} sortDirection={activeSort === \"name\" ? currentDirection : undefined}>\n * \t{t(\"subjects.name\")}\n * </Table.Column>\n */\nTable.Column = function TableColumn(handle: Handle<Table.ColumnProps>) {\n\treturn () => {\n\t\tlet { align, numeric, href, sortDirection, parts, children, mix, ...rest } = handle.props;\n\t\tlet resolvedAlign = align ?? (numeric ? DEFAULT_NUMERIC_ALIGN : DEFAULT_ALIGN);\n\n\t\treturn (\n\t\t\t<th\n\t\t\t\t{...rest}\n\t\t\t\tdata-align={resolvedAlign}\n\t\t\t\tdata-numeric={numeric ? \"\" : undefined}\n\t\t\t\taria-sort={href ? (sortDirection ?? \"none\") : undefined}\n\t\t\t\tdata-slot=\"column\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ scope: \"col\" }),\n\t\t\t\t\thref ? undefined : [pi(\"1rem\"), pb(\"0.75rem\")],\n\t\t\t\t\ttextAlign(\"start\"),\n\t\t\t\t\tweight(500),\n\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\twhen('&[data-align=\"center\"]', textAlign(\"center\")),\n\t\t\t\t\twhen('&[data-align=\"end\"]', textAlign(\"end\")),\n\t\t\t\t\twhen(\"&[aria-sort]\", when(\"&:hover\", bg(\"neutral.tint\"))),\n\t\t\t\t\twhen(\"&[aria-sort]\", [cursor(\"pointer\"), userSelect()]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{href ? (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={href}\n\t\t\t\t\t\tmix={[\n\t\t\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: -2 })),\n\t\t\t\t\t\t\tflex(),\n\t\t\t\t\t\t\tjustify(JUSTIFY_BY_ALIGN[resolvedAlign]),\n\t\t\t\t\t\t\tpi(\"1rem\"),\n\t\t\t\t\t\t\tpb(\"0.75rem\"),\n\t\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\t\tgap(\"0.25rem\"),\n\t\t\t\t\t\t\tfg(\"inherit\"),\n\t\t\t\t\t\t\ttextDecoration(\"none\"),\n\t\t\t\t\t\t\thover(textDecoration(\"underline\")),\n\t\t\t\t\t\t\tparts?.link,\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t\t{sortDirection === \"ascending\" && <ArrowUpIcon size={14} mix={[shrink()]} />}\n\t\t\t\t\t\t{sortDirection === \"descending\" && <ArrowDownIcon size={14} mix={[shrink()]} />}\n\t\t\t\t\t\t{!sortDirection && <ArrowUpDownIcon size={14} mix={[shrink(), opacity(40)]} />}\n\t\t\t\t\t</a>\n\t\t\t\t) : (\n\t\t\t\t\tchildren\n\t\t\t\t)}\n\t\t\t</th>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<tr>` host: transitions its background smoothly, tints\n * it on hover, and tints it more strongly when it carries\n * `aria-selected=\"true\"`, set directly since selection state is native.\n *\n * @param handle Runtime handle carrying the host `<tr>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <Table.Row>\n * \t<Table.Cell>{subject.name}</Table.Cell>\n * </Table.Row>\n * @example\n * <Table.Row aria-selected=\"true\">\n * \t<Table.Cell>{subject.name}</Table.Cell>\n * </Table.Row>\n */\nTable.Row = function TableRow(handle: Handle<Table.RowProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<tr\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"row\"\n\t\t\t\tmix={[\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\thover(bg(\"neutral.tint\")),\n\t\t\t\t\twhen('&[aria-selected=\"true\"]', bg(\"brand.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 native `<td>` host, padded on every side and colored as the\n * table's emphasized foreground text; a `numeric` cell end-aligns tabular figures.\n *\n * @param handle Runtime handle carrying the host `<td>`'s props.\n * @returns The render function producing the cell's markup.\n * @example\n * <Table.Cell>{subject.name}</Table.Cell>\n * @example\n * <Table.Cell numeric>{formatCurrency(invoice.amount)}</Table.Cell>\n */\nTable.Cell = function TableCell(handle: Handle<Table.CellProps>) {\n\treturn () => {\n\t\tlet { numeric, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<td\n\t\t\t\t{...rest}\n\t\t\t\tdata-numeric={numeric ? \"\" : undefined}\n\t\t\t\tdata-slot=\"cell\"\n\t\t\t\tmix={[\n\t\t\t\t\tpi(\"1rem\"),\n\t\t\t\t\tpb(\"0.75rem\"),\n\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\twhen(\"&[data-numeric]\", [tabularNums(), textAlign(\"end\")]),\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 trailing row carrying a single link that spans every column,\n * standing in for an auto-loading \"next page\" trigger since fetching more\n * rows without a full navigation requires script a consumer attaches.\n *\n * @param handle Runtime handle carrying the host `<tr>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <Table.LoadMore href={nextPageUrl} colSpan={4}>\n * \t{t(\"subjects.loadMore\")}\n * </Table.LoadMore>\n */\nTable.LoadMore = function TableLoadMore(handle: Handle<Table.LoadMoreProps>) {\n\treturn () => {\n\t\tlet { href, colSpan, parts, children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<tr {...rest} data-slot=\"load-more\" mix={[mix]}>\n\t\t\t\t<td colSpan={colSpan} mix={[p(\"0\"), parts?.cell]}>\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={href}\n\t\t\t\t\t\tmix={[\n\t\t\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t\t\tcenter(),\n\t\t\t\t\t\t\tpb(\"1rem\"),\n\t\t\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\t\t\thover(fg(\"neutral\")),\n\t\t\t\t\t\t\tfontSize(\"sm\"),\n\t\t\t\t\t\t\ttextDecoration(\"none\"),\n\t\t\t\t\t\t\tparts?.link,\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</a>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t);\n\t};\n};\n"
11
- },
12
- "test": {
13
- "path": "table.test.tsx",
14
- "content": "/**\n * Tests for {@link Table}'s numeric opt-in and sortable headers, asserted over\n * `renderToString` output: numeric cells line their digits up down a column, and\n * a sort link fills its header cell so the whole cell answers a click.\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 { Table } from \"@sdxc/ui/table\";\n\ndescribe(\"Table.Cell\", () => {\n\ttest(\"marks a numeric cell and sets it in end-aligned tabular figures\", async () => {\n\t\tlet html = String(await renderToString(<Table.Cell numeric>1,240</Table.Cell>));\n\n\t\texpect(html).toMatch(/<td[^>]*data-numeric=\"\"/);\n\t\texpect(html).toContain(\"font-variant-numeric: tabular-nums\");\n\t\texpect(html).toContain(\"text-align: end\");\n\t});\n\n\ttest(\"leaves a plain cell unmarked\", async () => {\n\t\tlet html = String(await renderToString(<Table.Cell>Ada</Table.Cell>));\n\n\t\texpect(html).not.toMatch(/<td[^>]*data-numeric/);\n\t});\n});\n\ndescribe(\"Table.Column\", () => {\n\ttest(\"end-aligns a numeric column unless align says otherwise\", async () => {\n\t\tlet numeric = String(await renderToString(<Table.Column numeric>Amount</Table.Column>));\n\t\tlet centered = String(\n\t\t\tawait renderToString(\n\t\t\t\t<Table.Column numeric align=\"center\">\n\t\t\t\t\tAmount\n\t\t\t\t</Table.Column>,\n\t\t\t),\n\t\t);\n\n\t\texpect(numeric).toMatch(/<th[^>]*data-align=\"end\"/);\n\t\texpect(numeric).toMatch(/<th[^>]*data-numeric=\"\"/);\n\t\texpect(centered).toMatch(/<th[^>]*data-align=\"center\"/);\n\t});\n\n\ttest(\"moves a sortable header's padding onto its link, so the whole cell is the target\", async () => {\n\t\tlet html = String(\n\t\t\tawait renderToString(\n\t\t\t\t<Table.Column href=\"?sort=name\" sortDirection=\"ascending\">\n\t\t\t\t\tName\n\t\t\t\t</Table.Column>,\n\t\t\t),\n\t\t);\n\n\t\tlet [, thClasses] = html.match(/<th[^>]*class=\"([^\"]*)\"/) ?? [];\n\t\tlet [, linkClasses] = html.match(/<a[^>]*class=\"([^\"]*)\"/) ?? [];\n\t\tlet paddingClass = html.match(/\\.(rmxc-[\\w-]+) \\{\\s*padding-inline: 1rem;/)?.[1];\n\n\t\texpect(paddingClass).toBeDefined();\n\t\texpect(linkClasses?.split(\" \")).toContain(paddingClass);\n\t\texpect(thClasses?.split(\" \")).not.toContain(paddingClass);\n\t});\n});\n"
15
- }
16
- }
@@ -1,16 +0,0 @@
1
- {
2
- "name": "toast",
3
- "changedIn": "2026.10.13",
4
- "dependencies": [],
5
- "exports": [
6
- "Toast"
7
- ],
8
- "source": {
9
- "path": "toast.tsx",
10
- "content": "/**\n * A transient notification panel that floats above page content to report\n * the outcome of an action, colored by one of five semantic tones and\n * structured like an inline status panel: an optional leading icon or\n * loading graphic, a title/description block, and trailing actions.\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 { XIcon } from \"@sdxc/icons\";\nimport { bg, border, colorMix, fg } from \"@sdxc/u/color\";\nimport { backdropBlur, backdropSaturate, rounded, shadow, transition } from \"@sdxc/u/effects\";\nimport { pointerEvents, raw } from \"@sdxc/u/general\";\nimport {\n\tabsolute,\n\tbasis,\n\tfixed,\n\tflex,\n\tflexCol,\n\tgap,\n\tgrow,\n\tinlineFlex,\n\tinsBe,\n\tinsBs,\n\tinsIe,\n\tinsIs,\n\titems,\n\tjustify,\n\trelative,\n\tshrink,\n} from \"@sdxc/u/layout\";\nimport { media, supports } from \"@sdxc/u/responsive\";\nimport { is, bs, maxIs, minIs, pb, pi, pie } from \"@sdxc/u/size\";\nimport { active, data, hover, when } from \"@sdxc/u/state\";\nimport { translateX } from \"@sdxc/u/transform\";\nimport { balance, fontSize, leading, pretty, weight } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { graphicHostStyle } from \"@sdxc/ui/styles\";\nimport { hitArea } from \"@sdxc/ui/styles\";\nimport { warnIfNoAccessibleLabel } from \"@sdxc/ui/utils\";\n\n/**\n * `role` applied to {@link Toast} through {@link attrs} unless a consumer\n * supplies its own, announcing the panel as a status update that assistive\n * technology reads after finishing whatever it is currently reading.\n */\nconst DEFAULT_ROLE = \"status\";\n\n/**\n * Default {@link Toast.Props.color}, rendering a toast with the neutral tone\n * when a consumer names no semantic color.\n */\nconst DEFAULT_COLOR: Toast.Color = \"neutral\";\n\n/**\n * Default {@link Toast.Props.live}, announcing a toast's content politely so\n * each toast waits its turn behind whatever assistive technology is\n * currently reading.\n */\nconst DEFAULT_LIVE: Toast.Live = \"polite\";\n\n/**\n * `aria-atomic=\"true\"` applied through {@link attrs} unless a consumer\n * overrides it, so assistive technology re-reads the whole toast whenever\n * any part of it updates.\n */\nconst DEFAULT_ARIA_ATOMIC = \"true\";\n\n/**\n * `aria-hidden=\"true\"` applied to {@link Toast.Icon} and {@link Toast.Loader}\n * through {@link attrs} unless a consumer overrides it, keeping a purely\n * decorative graphic out of the accessibility tree.\n */\nconst DEFAULT_GRAPHIC_ARIA_HIDDEN = \"true\";\n\n/**\n * `type=\"button\"` default applied to {@link Toast.Action} and\n * {@link Toast.Cancel}, matching the script-driven command most toast\n * actions run; pass `type=\"submit\"` for a form control.\n */\nconst DEFAULT_BUTTON_TYPE: NonNullable<Toast.ActionProps[\"type\"]> = \"button\";\n\n/**\n * Corner {@link Toast.Region} renders in when `placement` is left unset.\n */\nconst DEFAULT_PLACEMENT: Toast.Placement = \"bottom-end\";\n\n/**\n * `role` applied to {@link Toast.Region} through {@link attrs} unless a\n * consumer supplies its own, exposing the stack of toasts as a landmark\n * region.\n */\nconst DEFAULT_REGION_ROLE = \"region\";\n\n/**\n * Prop types for {@link Toast} and its compound parts, including\n * {@link Toast.Region}.\n */\nexport namespace Toast {\n\t/**\n\t * Semantic tone driving the host element's border, tint, and foreground\n\t * color through the `--ui-*` variables for that color.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * `aria-live` politeness applied to the host element. `\"off\"` omits the\n\t * `aria-live` attribute entirely, leaving the element's implicit\n\t * live-region behavior in place.\n\t */\n\texport type Live = \"polite\" | \"assertive\" | \"off\";\n\n\t/**\n\t * Corner of the viewport {@link Toast.Region} renders in. The block side\n\t * (`top`/`bottom`) names a physical edge, while the inline edge\n\t * (`start`/`end`) flips under `dir` to stay in the reading-trailing corner.\n\t */\n\texport type Placement =\n\t\t| \"top-start\"\n\t\t| \"top-center\"\n\t\t| \"top-end\"\n\t\t| \"bottom-start\"\n\t\t| \"bottom-center\"\n\t\t| \"bottom-end\";\n\n\t/**\n\t * Props accepted by {@link Toast}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Semantic tone of the toast. Default: `\"neutral\"`. */\n\t\tcolor?: Color;\n\t\t/** `aria-live` politeness for the toast's content. Default: `\"polite\"`. */\n\t\tlive?: Live;\n\t\t/** The toast's compound parts: {@link Toast.Icon}, {@link Toast.Content}, {@link Toast.Action}, or any other content. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Toast.Icon}.\n\t */\n\texport interface IconProps extends TagProps<\"div\"> {\n\t\t/** The icon graphic, typically a single SVG icon. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Toast.Loader}.\n\t */\n\texport interface LoaderProps extends TagProps<\"div\"> {\n\t\t/** The loading graphic shown in place of {@link Toast.Icon} while the toast represents pending work. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Toast.Content}.\n\t */\n\texport interface ContentProps extends TagProps<\"div\"> {\n\t\t/** The toast's title, description, or other body content. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Toast.Title}.\n\t */\n\texport interface TitleProps extends TagProps<\"h3\"> {\n\t\t/** The toast's heading text. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Toast.Description}.\n\t */\n\texport interface DescriptionProps extends TagProps<\"p\"> {\n\t\t/** The toast's supporting message text. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Toast.Action}.\n\t */\n\texport interface ActionProps extends TagProps<\"button\"> {\n\t\t/** The action's label. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Toast.Cancel}.\n\t */\n\texport interface CancelProps extends TagProps<\"button\"> {\n\t\t/** The cancel control's label. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Toast.Close}.\n\t */\n\texport interface CloseProps extends TagProps<\"button\"> {\n\t\t/**\n\t\t * Accessible label for the icon-only control — required, since the\n\t\t * button 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 * Props accepted by {@link Toast.Region}.\n\t */\n\texport interface RegionProps extends TagProps<\"div\"> {\n\t\t/** Corner of the viewport the stack renders in. Default: `\"bottom-end\"`. */\n\t\tplacement?: Placement;\n\t\t/** Every currently queued {@link Toast}. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders a single toast panel, tinted, bordered, and shadowed by\n * {@link Toast.Props.color}, with `role` and `aria-atomic` defaulted\n * (overridable); pair a `mix`-driven `enterExit()`, since it holds still.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the toast's markup.\n * @example\n * <Toast color=\"success\">\n * <Toast.Icon><CircleCheckIcon /></Toast.Icon>\n * <Toast.Content>\n * <Toast.Title>{t(\"toasts.saved.title\")}</Toast.Title>\n * <Toast.Description>{t(\"toasts.saved.description\")}</Toast.Description>\n * </Toast.Content>\n * <Toast.Close aria-label={t(\"actions.dismiss\")} />\n * </Toast>\n * @example\n * <Toast color=\"danger\" live=\"assertive\">\n * <Toast.Content>\n * <Toast.Title>{t(\"toasts.uploadFailed.title\")}</Toast.Title>\n * </Toast.Content>\n * <Toast.Action>{t(\"actions.retry\")}</Toast.Action>\n * <Toast.Cancel>{t(\"actions.dismiss\")}</Toast.Cancel>\n * </Toast>\n */\nexport function Toast(handle: Handle<Toast.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor = DEFAULT_COLOR,\n\t\t\tlive = DEFAULT_LIVE,\n\t\t\t\"aria-live\": ariaLiveProp,\n\t\t\tchildren,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet ariaLive = ariaLiveProp ?? (live === \"off\" ? undefined : live);\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\taria-live={ariaLive}\n\t\t\t\tdata-color={color}\n\t\t\t\tdata-slot=\"toast\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_ROLE, \"aria-atomic\": DEFAULT_ARIA_ATOMIC }),\n\t\t\t\t\trelative(),\n\t\t\t\t\tflex(),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\tgap(\"0.75rem\"),\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tborder(\"neutral\"),\n\t\t\t\t\tfg(\"neutral.fg-emphasis\"),\n\t\t\t\t\tpb(\"1rem\"),\n\t\t\t\t\tpi(\"1rem\"),\n\t\t\t\t\twhen('&:has(> [data-slot=\"close\"])', pie(\"2.5rem\")),\n\t\t\t\t\twhen('&[data-color=\"brand\"]', [border(\"brand\"), fg(\"brand.fg-emphasis\")]),\n\t\t\t\t\twhen('&[data-color=\"neutral\"]', [border(\"neutral\"), fg(\"neutral.fg-emphasis\")]),\n\t\t\t\t\twhen('&[data-color=\"success\"]', [border(\"success\"), fg(\"success.fg-emphasis\")]),\n\t\t\t\t\twhen('&[data-color=\"warning\"]', [border(\"warning\"), fg(\"warning.fg-emphasis\")]),\n\t\t\t\t\twhen('&[data-color=\"danger\"]', [border(\"danger\"), fg(\"danger.fg-emphasis\")]),\n\t\t\t\t\tborder({ width: 1 }),\n\t\t\t\t\tshadow(\"lg\"),\n\t\t\t\t\titems(\"start\"),\n\t\t\t\t\tpointerEvents(\"auto\"),\n\t\t\t\t\traw({\n\t\t\t\t\t\t\"--ui-toast-bg\": \"var(--ui-neutral-bg-tint)\",\n\t\t\t\t\t\tbackgroundColor: \"var(--ui-toast-bg)\",\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\traw({\n\t\t\t\t\t\t\t\"--ui-toast-bg\": \"var(--ui-brand-bg-tint)\",\n\t\t\t\t\t\t\tbackgroundColor: \"var(--ui-toast-bg)\",\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\"neutral\",\n\t\t\t\t\t\traw({\n\t\t\t\t\t\t\t\"--ui-toast-bg\": \"var(--ui-neutral-bg-tint)\",\n\t\t\t\t\t\t\tbackgroundColor: \"var(--ui-toast-bg)\",\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\traw({\n\t\t\t\t\t\t\t\"--ui-toast-bg\": \"var(--ui-success-bg-tint)\",\n\t\t\t\t\t\t\tbackgroundColor: \"var(--ui-toast-bg)\",\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\traw({\n\t\t\t\t\t\t\t\"--ui-toast-bg\": \"var(--ui-warning-bg-tint)\",\n\t\t\t\t\t\t\tbackgroundColor: \"var(--ui-toast-bg)\",\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\traw({\n\t\t\t\t\t\t\t\"--ui-toast-bg\": \"var(--ui-danger-bg-tint)\",\n\t\t\t\t\t\t\tbackgroundColor: \"var(--ui-toast-bg)\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\t\tsupports(\n\t\t\t\t\t\t\"(backdrop-filter: blur(0))\",\n\t\t\t\t\t\tmedia(\"(prefers-reduced-transparency: no-preference)\", [\n\t\t\t\t\t\t\tbg(colorMix(\"oklab\", { color: \"var(--ui-toast-bg)\", weight: 85 }, \"transparent\")),\n\t\t\t\t\t\t\tbackdropBlur(\"md\"),\n\t\t\t\t\t\t\tbackdropSaturate(1.4),\n\t\t\t\t\t\t]),\n\t\t\t\t\t),\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</div>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Toast.IconProps.children} as the toast's leading icon,\n * hidden from assistive technology since the toast's color and text already\n * carry its meaning; swap in {@link Toast.Loader} while pending.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the icon's markup.\n */\nToast.Icon = function ToastIcon(handle: Handle<Toast.IconProps>) {\n\treturn () => {\n\t\tlet { children, 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=\"icon\"\n\t\t\t\tmix={[attrs({ \"aria-hidden\": DEFAULT_GRAPHIC_ARIA_HIDDEN }), graphicHostStyle(), mix]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Toast.LoaderProps.children} as the toast's loading graphic,\n * laid out identically to {@link Toast.Icon} so swapping between them keeps\n * the layout stable; pair a `spin()` `mix` factory for its rotating loop.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the loading graphic's markup.\n */\nToast.Loader = function ToastLoader(handle: Handle<Toast.LoaderProps>) {\n\treturn () => {\n\t\tlet { children, 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=\"loader\"\n\t\t\t\tmix={[attrs({ \"aria-hidden\": DEFAULT_GRAPHIC_ARIA_HIDDEN }), graphicHostStyle(), mix]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Toast.ContentProps.children} as the toast's body block: a\n * column flex container that shrinks to fit alongside a leading icon or\n * trailing action, holding {@link Toast.Title} and {@link Toast.Description}.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the content block's markup.\n */\nToast.Content = function ToastContent(handle: Handle<Toast.ContentProps>) {\n\treturn () => {\n\t\tlet { children, 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=\"content\"\n\t\t\t\tmix={[flex(), flexCol(), gap(\"0.25rem\"), minIs(0), grow(), shrink(1), basis(\"0%\"), mix]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Toast.TitleProps.children} as the toast's heading, in a\n * native `<h3>` sized and weighted as a small, single-line label above the\n * toast's description.\n *\n * @param handle Runtime handle carrying the host `<h3>`'s props.\n * @returns The render function producing the title's markup.\n */\nToast.Title = function ToastTitle(handle: Handle<Toast.TitleProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<h3\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"title\"\n\t\t\t\tmix={[weight(500), leading(1), fontSize(\"sm\"), balance(), mix]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</h3>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Toast.DescriptionProps.children} as the toast's supporting\n * message, in a native `<p>` set slightly translucent against the toast's\n * foreground color so it reads as secondary to {@link Toast.Title}.\n *\n * @param handle Runtime handle carrying the host `<p>`'s props.\n * @returns The render function producing the description's markup.\n */\nToast.Description = function ToastDescription(handle: Handle<Toast.DescriptionProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<p\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"description\"\n\t\t\t\tmix={[\n\t\t\t\t\tfontSize(\"sm\"),\n\t\t\t\t\tpretty(),\n\t\t\t\t\tfg(colorMix(\"oklab\", { color: \"currentcolor\", weight: 70 }, \"transparent\")),\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</p>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Toast.ActionProps.children} as the toast's primary trailing\n * control; `type` defaults to `\"button\"`, ordered before the consumer's\n * attributes so `command`/`commandfor` still run; use `type=\"submit\"` for a form.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the action control's markup.\n * @example\n * <Toast.Action>{t(\"actions.undo\")}</Toast.Action>\n */\nToast.Action = function ToastAction(handle: Handle<Toast.ActionProps>) {\n\treturn () => {\n\t\tlet { type, children, mix, ...rest } = handle.props;\n\t\tlet resolvedType = type ?? DEFAULT_BUTTON_TYPE;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype={resolvedType}\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"action\"\n\t\t\t\tmix={[\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tborder({ width: 1 }),\n\t\t\t\t\tpi(\"0.75rem\"),\n\t\t\t\t\tpb(\"0.25rem\"),\n\t\t\t\t\tweight(500),\n\t\t\t\t\tshrink(),\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, opacity, box-shadow, transform, filter, backdrop-filter\",\n\t\t\t\t\t),\n\t\t\t\t\tfg(\"currentcolor\"),\n\t\t\t\t\tborder(colorMix(\"oklab\", { color: \"currentcolor\", weight: 30 }, \"transparent\")),\n\t\t\t\t\tfontSize(\"xs\"),\n\t\t\t\t\thover(bg(colorMix(\"oklab\", { color: \"currentcolor\", weight: 10 }, \"transparent\"))),\n\t\t\t\t\tactive(bg(colorMix(\"oklab\", { color: \"currentcolor\", weight: 20 }, \"transparent\"))),\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 Toast.CancelProps.children} as a neutral-tinted, secondary\n * trailing control; `type` defaults to `\"button\"`, ordered before the\n * consumer's attributes so `command`/`commandfor` still run.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the cancel control's markup.\n * @example\n * <Toast.Cancel>{t(\"actions.dismiss\")}</Toast.Cancel>\n */\nToast.Cancel = function ToastCancel(handle: Handle<Toast.CancelProps>) {\n\treturn () => {\n\t\tlet { type, children, mix, ...rest } = handle.props;\n\t\tlet resolvedType = type ?? DEFAULT_BUTTON_TYPE;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype={resolvedType}\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"cancel\"\n\t\t\t\tmix={[\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tborder({ color: \"neutral\", width: 1 }),\n\t\t\t\t\tpi(\"0.75rem\"),\n\t\t\t\t\tpb(\"0.25rem\"),\n\t\t\t\t\tweight(500),\n\t\t\t\t\tfg(\"neutral.fg\"),\n\t\t\t\t\thover([bg(\"neutral.bg-tint-hover\"), fg(\"neutral.fg-emphasis\")]),\n\t\t\t\t\tactive(bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\tshrink(),\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, opacity, box-shadow, transform, filter, backdrop-filter\",\n\t\t\t\t\t),\n\t\t\t\t\tfontSize(\"xs\"),\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 dismiss control for the ancestor {@link Toast}: an icon-only\n * `<button>` removable via a consumer's mixin or the `commandfor`/`command`\n * pair; `type=\"button\"` precedes those attributes so the pairing still runs.\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 * <Toast.Close aria-label={t(\"actions.dismiss\")} />\n */\nToast.Close = function ToastClose(handle: Handle<Toast.CloseProps>) {\n\treturn () => {\n\t\tlet { 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=\"close\"\n\t\t\t\tmix={[\n\t\t\t\t\tabsolute(),\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tis(\"1.5rem\"),\n\t\t\t\t\tbs(\"1.5rem\"),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tfg(\"neutral.fg-muted\"),\n\t\t\t\t\thover([bg(\"neutral.bg-tint-hover\"), fg(\"neutral.fg-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, opacity, box-shadow, transform, filter, backdrop-filter\",\n\t\t\t\t\t),\n\t\t\t\t\tinsBs(\"0.5rem\"),\n\t\t\t\t\tinsIe(\"0.5rem\"),\n\t\t\t\t\thitArea(),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<XIcon size={16} />\n\t\t\t</button>\n\t\t);\n\t};\n};\n\n/**\n * Renders the fixed viewport stacking every queued {@link Toast} at a corner\n * via {@link Toast.RegionProps.placement}; `pointer-events` stays `none` so\n * clicks pass through to content behind, restored per toast.\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 * <Toast.Region aria-label={t(\"toasts.region\")}>\n * {toasts.map((toast) => (\n * <Toast key={toast.id} color={toast.data.color}>\n * <Toast.Content>\n * <Toast.Title>{toast.data.title}</Toast.Title>\n * </Toast.Content>\n * </Toast>\n * ))}\n * </Toast.Region>\n * @example\n * <Toast.Region aria-label={t(\"toasts.region\")} placement=\"top-center\">\n * <Toast color=\"warning\">\n * <Toast.Content>\n * <Toast.Title>{t(\"toasts.offline.title\")}</Toast.Title>\n * </Toast.Content>\n * </Toast>\n * </Toast.Region>\n */\nToast.Region = function ToastRegion(handle: Handle<Toast.RegionProps>) {\n\treturn () => {\n\t\tlet { placement, children, mix, ...rest } = handle.props;\n\t\tlet resolvedPlacement = placement ?? DEFAULT_PLACEMENT;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t'Toast.Region: needs an \"aria-label\" or \"aria-labelledby\" identifying this landmark for assistive technology.',\n\t\t);\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-placement={resolvedPlacement}\n\t\t\t\tdata-slot=\"region\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_REGION_ROLE }),\n\t\t\t\t\tfixed(),\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tgap(\"0.75rem\"),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\tmaxIs(\"24rem\"),\n\t\t\t\t\tpb(\"1rem\"),\n\t\t\t\t\tpi(\"1rem\"),\n\t\t\t\t\tpointerEvents(),\n\t\t\t\t\traw({ zIndex: \"var(--ui-toast-z, 50)\" }),\n\t\t\t\t\twhen('&[data-placement^=\"top\"]', insBs(\"0\")),\n\t\t\t\t\twhen('&[data-placement^=\"bottom\"]', insBe(\"0\")),\n\t\t\t\t\twhen('&[data-placement$=\"start\"]', insIs(\"0\")),\n\t\t\t\t\twhen('&[data-placement$=\"end\"]', insIe(\"0\")),\n\t\t\t\t\twhen('&[data-placement$=\"center\"]', [insIs(\"50%\"), translateX(\"-50%\")]),\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</div>\n\t\t);\n\t};\n};\n"
11
- },
12
- "test": {
13
- "path": "toast.test.tsx",
14
- "content": "/**\n * Tests for the `type` {@link Toast}'s three controls write: an explicit\n * `type=\"button\"`, positioned before the consumer's own attributes, without\n * which the platform refuses to run an Invoker Command the control carries\n * inside a `<form>` — it decides whether the pairing is ambiguous while it\n * parses `command`/`commandfor` and never sees a `type` serialized after them.\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 { Toast } from \"@sdxc/ui/toast\";\n\ndescribe(\"Toast.Action\", () => {\n\ttest('types itself \"button\", so its command survives inside a form', async () => {\n\t\tlet html = await renderToString(<Toast.Action>Undo</Toast.Action>);\n\n\t\texpect(html).toContain('type=\"button\"');\n\t});\n\n\ttest(\"writes type before the command attributes, which is where the platform reads it\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Toast.Action commandfor=\"upload-toast\" command=\"hide\">\n\t\t\t\tUndo\n\t\t\t</Toast.Action>,\n\t\t);\n\n\t\texpect(html.indexOf('type=\"button\"')).toBeLessThan(html.indexOf(\"commandfor=\"));\n\t\texpect(html.indexOf('type=\"button\"')).toBeLessThan(html.indexOf(\"command=\"));\n\t});\n\n\ttest(\"leaves an explicitly typed submit action alone\", async () => {\n\t\tlet html = await renderToString(<Toast.Action type=\"submit\">Retry</Toast.Action>);\n\n\t\texpect(html).toContain('type=\"submit\"');\n\t});\n});\n\ndescribe(\"Toast.Cancel\", () => {\n\ttest('types itself \"button\", so its command survives inside a form', async () => {\n\t\tlet html = await renderToString(<Toast.Cancel>Dismiss</Toast.Cancel>);\n\n\t\texpect(html).toContain('type=\"button\"');\n\t});\n\n\ttest(\"writes type before the command attributes, which is where the platform reads it\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Toast.Cancel commandfor=\"upload-toast\" command=\"hide\">\n\t\t\t\tDismiss\n\t\t\t</Toast.Cancel>,\n\t\t);\n\n\t\texpect(html.indexOf('type=\"button\"')).toBeLessThan(html.indexOf(\"commandfor=\"));\n\t\texpect(html.indexOf('type=\"button\"')).toBeLessThan(html.indexOf(\"command=\"));\n\t});\n});\n\ndescribe(\"Toast.Close\", () => {\n\ttest('types itself \"button\", so its command survives inside a form', async () => {\n\t\tlet html = await renderToString(<Toast.Close aria-label=\"Dismiss\" />);\n\n\t\texpect(html).toContain('type=\"button\"');\n\t});\n\n\ttest(\"writes type before the command attributes, which is where the platform reads it\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Toast.Close aria-label=\"Dismiss\" commandfor=\"upload-toast\" command=\"hide\" />,\n\t\t);\n\n\t\texpect(html.indexOf('type=\"button\"')).toBeLessThan(html.indexOf(\"commandfor=\"));\n\t\texpect(html.indexOf('type=\"button\"')).toBeLessThan(html.indexOf(\"command=\"));\n\t});\n});\n"
15
- }
16
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "toolbar",
3
- "changedIn": "2026.10.2",
4
- "dependencies": [],
5
- "exports": [
6
- "Toolbar"
7
- ],
8
- "source": {
9
- "path": "toolbar.tsx",
10
- "content": "/**\n * A bordered, tinted panel that groups a set of interactive controls —\n * buttons, toggles, menus — along a single axis. The host renders as a\n * `toolbar` landmark and lays its children out as a row by default,\n * switching to a column when its orientation flips to vertical.\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 } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { flexCol, hstack, items } from \"@sdxc/u/layout\";\nimport { pb, pi } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\n/**\n * `role=\"toolbar\"` applied through {@link attrs} unless a consumer supplies\n * its own `role`, announcing the host as a toolbar landmark for the controls\n * grouped inside it.\n */\nconst DEFAULT_ROLE = \"toolbar\";\n\n/**\n * Default {@link Toolbar.Props} orientation, applied through {@link attrs}\n * unless a consumer sets `aria-orientation` directly, so one attribute flips\n * both the accessibility contract and the CSS layout variant.\n */\nconst DEFAULT_ORIENTATION: Toolbar.Orientation = \"horizontal\";\n\n/**\n * Prop types for {@link Toolbar}.\n */\nexport namespace Toolbar {\n\t/**\n\t * Axis the toolbar's controls lay out along: a single row, or a single\n\t * column.\n\t */\n\texport type Orientation = \"horizontal\" | \"vertical\";\n\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 rendered layout to a column; leaving it unset keeps the row.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n}\n\n/**\n * Renders a bordered, tinted panel grouping a set of interactive controls\n * along one axis. The host carries the `toolbar` role and lays its children\n * out as a row by default, flipping to a column when `aria-orientation=\"vertical\"`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the toolbar's markup.\n * @example\n * <Toolbar aria-label={t(\"editor.toolbar\")}>\n * \t<Button variant=\"ghost\"><ScissorsIcon /></Button>\n * \t<Button variant=\"ghost\"><CopyIcon /></Button>\n * \t<Button variant=\"ghost\"><ClipboardIcon /></Button>\n * </Toolbar>\n * @example\n * <Toolbar aria-label={t(\"editor.toolbar\")} aria-orientation=\"vertical\">\n * \t<Button variant=\"ghost\"><BoldIcon /></Button>\n * \t<Button variant=\"ghost\"><ItalicIcon /></Button>\n * </Toolbar>\n */\nexport function Toolbar(handle: Handle<Toolbar.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\thstack({ gap: 2, align: \"center\" }),\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tborder({ color: \"neutral.border\", width: 1 }),\n\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\tpb(2),\n\t\t\t\t\tpi(2),\n\t\t\t\t\twhen('&[aria-orientation=\"vertical\"]', [flexCol(), items(\"start\")]),\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
- }