@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,6 +1,6 @@
1
1
  {
2
2
  "name": "card",
3
- "changedIn": "2026.10.29",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [
5
5
  "heading-scope"
6
6
  ],
@@ -9,7 +9,7 @@
9
9
  ],
10
10
  "source": {
11
11
  "path": "card.tsx",
12
- "content": "/**\n * A bounded container grouping a header, body content, and footer actions\n * into one ring-edged, softly lifted panel tinted by a semantic color role —\n * product chrome, plan tiles, settings panels. Landing claim cells stay on\n * the lighter {@link Feature} (use `variant=\"panel\"` only when the cell itself\n * is the interaction). The role colors border, background, and text together,\n * so {@link Card.Title} and {@link Card.Description} inherit their text color\n * from the root through ordinary CSS inheritance.\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 { border } from \"@sdxc/u/color\";\nimport { opacity, rounded, shadow } from \"@sdxc/u/effects\";\nimport { vars } from \"@sdxc/u/general\";\nimport { flex, flexCol, gap, items } from \"@sdxc/u/layout\";\nimport { p, pbe, pbs, pi } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { balance, fontSize, leading, pretty, tracking, weight } from \"@sdxc/u/typography\";\n\nimport type { SemanticColor } from \"@sdxc/ui/utils\";\n\nimport { SHADOW_RING } from \"@sdxc/ui/styles\";\nimport { semanticColorPanel } from \"@sdxc/ui/styles\";\n\nimport { resolveHeadingLevel, TAG_BY_LEVEL } from \"@sdxc/ui/heading-scope\";\n\n/** Semantic color role {@link Card} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: Card.Color = \"neutral\";\n\n/**\n * Prop types for {@link Card} and its compound parts.\n */\nexport namespace Card {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` border,\n\t * background, and foreground variables.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * Every native `<section>` attribute, unchanged, plus the `color` role that\n\t * tints the panel.\n\t */\n\texport interface Props extends TagProps<\"section\"> {\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t}\n\n\t/** Every native `<header>` attribute, unchanged, plus the `mix` passthrough. */\n\texport interface HeaderProps extends TagProps<\"header\"> {}\n\n\t/**\n\t * Every native heading-element attribute, unchanged: the rendered tag\n\t * follows the nearest ambient heading level, falling back to `<h1>` where\n\t * nothing supplies one.\n\t */\n\texport interface TitleProps extends TagProps<\"h1\"> {}\n\n\t/** Every native `<p>` attribute, unchanged, plus the `mix` passthrough. */\n\texport interface DescriptionProps extends TagProps<\"p\"> {}\n\n\t/** Every native `<div>` attribute, unchanged, plus the `mix` passthrough. */\n\texport interface ContentProps extends TagProps<\"div\"> {}\n\n\t/** Every native `<footer>` attribute, unchanged, plus the `mix` passthrough. */\n\texport interface FooterProps extends TagProps<\"footer\"> {}\n}\n\n/**\n * The card panel: a rounded, softly lifted `<section>` tinted through the\n * `data-color` attribute contract. A neutral card draws its edge as a ring\n * shadow that takes on the tone behind it; a colored one keeps its tinted\n * border inside that ring. Compose {@link Card.Header},\n * {@link Card.Content}, and {@link Card.Footer} inside it.\n *\n * @param handle Runtime handle carrying the host `<section>`'s props.\n * @returns The render function producing the panel's markup.\n * @example\n * <Card>\n * \t<Card.Header>\n * \t\t<Card.Title>{t(\"plan.title\")}</Card.Title>\n * \t\t<Card.Description>{t(\"plan.description\")}</Card.Description>\n * \t</Card.Header>\n * \t<Card.Content>{t(\"plan.body\")}</Card.Content>\n * \t<Card.Footer>\n * \t\t<Button>{t(\"plan.upgrade\")}</Button>\n * \t</Card.Footer>\n * </Card>\n * @example\n * <Card color=\"danger\">\n * \t<Card.Header>\n * \t\t<Card.Title>{t(\"errors.billing.title\")}</Card.Title>\n * \t</Card.Header>\n * </Card>\n */\nexport function Card(handle: Handle<Card.Props>) {\n\treturn () => {\n\t\tlet { color, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\treturn (\n\t\t\t<section\n\t\t\t\tdata-color={resolvedColor}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tsemanticColorPanel(),\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tborder({ width: 1 }),\n\t\t\t\t\twhen('&[data-color=\"neutral\"]', border(\"transparent\")),\n\t\t\t\t\tshadow(\"sm\"),\n\t\t\t\t\tvars({ \"ui-box-shadow-ring\": SHADOW_RING }),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders the card's header slot: a `<header>` stacking its children in a\n * column with a small gap, padded on every side. Nest {@link Card.Title} and\n * {@link Card.Description} inside it.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the header slot's markup.\n * @example\n * <Card.Header>\n * \t<Card.Title>{t(\"plan.title\")}</Card.Title>\n * </Card.Header>\n */\nCard.Header = function CardHeader(handle: Handle<Card.HeaderProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <header {...rest} mix={[flex(), flexCol(), p(6, 6), gap(\"0.375rem\"), mix]} />;\n\t};\n};\n\n/**\n * The card's heading, in the native heading element matching the nearest\n * ambient heading level — `<h1>` where nothing supplies one. Its text color\n * inherits from the card root's `color` value.\n *\n * @param handle Runtime handle carrying the host heading element's props.\n * @returns The render function producing the heading's markup.\n * @example\n * <Card.Title>{t(\"plan.title\")}</Card.Title>\n */\nCard.Title = function CardTitle(handle: Handle<Card.TitleProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\t\tlet resolved = resolveHeadingLevel(handle);\n\t\tlet Tag = TAG_BY_LEVEL[resolved];\n\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\t{...rest}\n\t\t\t\tdata-heading-level={resolved}\n\t\t\t\tmix={[fontSize(\"2xl\"), leading(1), weight(\"semibold\"), tracking(\"tight\"), balance(), mix]}\n\t\t\t>\n\t\t\t\t{rest.children}\n\t\t\t</Tag>\n\t\t);\n\t};\n};\n\n/**\n * Renders the card's supporting copy inside a native `<p>`, muted to\n * seventy percent opacity so it reads as secondary to {@link Card.Title}.\n *\n * @param handle Runtime handle carrying the host `<p>`'s props.\n * @returns The render function producing the description's markup.\n * @example\n * <Card.Description>{t(\"plan.description\")}</Card.Description>\n */\nCard.Description = function CardDescription(handle: Handle<Card.DescriptionProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <p {...rest} mix={[fontSize(\"sm\"), opacity(70), pretty(), mix]} />;\n\t};\n};\n\n/**\n * The card's main body slot: a `<div>` padded on its inline and block-end\n * edges, leaving its block-start edge flush against {@link Card.Header}. Its\n * prose wraps with `text-wrap: pretty`, which every paragraph inside inherits.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the body slot's markup.\n * @example\n * <Card.Content>{t(\"plan.body\")}</Card.Content>\n */\nCard.Content = function CardContent(handle: Handle<Card.ContentProps>) {\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\t/**\n\t\t\t\t\t * The body leaves the gap above it to a header, and takes it back when it opens the card,\n\t\t\t\t\t * so a card of content alone still clears its own top edge.\n\t\t\t\t\t */\n\t\t\t\t\tpbs(0),\n\t\t\t\t\twhen(\"&:first-child\", pbs(6)),\n\t\t\t\t\tpbe(6),\n\t\t\t\t\tpi(6),\n\t\t\t\t\tpretty(),\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 card's footer slot: a `<footer>` laying its children out in a\n * vertically centered row, padded on its inline and block-end edges so it\n * sits flush against the content above.\n *\n * @param handle Runtime handle carrying the host `<footer>`'s props.\n * @returns The render function producing the footer slot's markup.\n * @example\n * <Card.Footer>\n * \t<Button>{t(\"plan.upgrade\")}</Button>\n * </Card.Footer>\n */\nCard.Footer = function CardFooter(handle: Handle<Card.FooterProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <footer {...rest} mix={[flex(), items(\"center\"), pbs(0), pbe(6), pi(6), mix]} />;\n\t};\n};\n"
12
+ "content": "/**\n * A bounded container grouping a header, body content, and footer actions\n * into one ring-edged, softly lifted panel tinted by a semantic color role —\n * product chrome, plan tiles, settings panels. Landing claim cells stay on\n * the lighter {@link Feature} (use `variant=\"panel\"` only when the cell itself\n * is the interaction). The role colors border, background, and text together,\n * so {@link Card.Title} and {@link Card.Description} inherit their text color\n * from the root through ordinary CSS inheritance.\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 { border } from \"@sdxc/u/color\";\nimport { opacity, rounded, shadow } from \"@sdxc/u/effects\";\nimport { vars, mergeMix } from \"@sdxc/u/general\";\nimport { flex, flexCol, gap, items } from \"@sdxc/u/layout\";\nimport { p, pbe, pbs, pi } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { balance, fontSize, leading, pretty, tracking, weight } from \"@sdxc/u/typography\";\n\nimport type { SemanticColor } from \"@sdxc/ui/utils\";\n\nimport { SHADOW_RING } from \"@sdxc/ui/styles\";\nimport { semanticColorPanel } from \"@sdxc/ui/styles\";\n\nimport { resolveHeadingLevel, TAG_BY_LEVEL } from \"@sdxc/ui/heading-scope\";\n\n/** Semantic color role {@link Card} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: Card.Color = \"neutral\";\n\n/**\n * Prop types for {@link Card} and its compound parts.\n */\nexport namespace Card {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` border,\n\t * background, and foreground variables.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * Every native `<section>` attribute, unchanged, plus the `color` role that\n\t * tints the panel.\n\t */\n\texport interface Props extends TagProps<\"section\"> {\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t}\n\n\t/** Every native `<header>` attribute, unchanged, plus the `mix` passthrough. */\n\texport interface HeaderProps extends TagProps<\"header\"> {}\n\n\t/**\n\t * Every native heading-element attribute, unchanged: the rendered tag\n\t * follows the nearest ambient heading level, falling back to `<h1>` where\n\t * nothing supplies one.\n\t */\n\texport interface TitleProps extends TagProps<\"h1\"> {}\n\n\t/** Every native `<p>` attribute, unchanged, plus the `mix` passthrough. */\n\texport interface DescriptionProps extends TagProps<\"p\"> {}\n\n\t/** Every native `<div>` attribute, unchanged, plus the `mix` passthrough. */\n\texport interface ContentProps extends TagProps<\"div\"> {}\n\n\t/** Every native `<footer>` attribute, unchanged, plus the `mix` passthrough. */\n\texport interface FooterProps extends TagProps<\"footer\"> {}\n}\n\n/**\n * The card panel: a rounded, softly lifted `<section>` tinted through the\n * `data-color` attribute contract. A neutral card draws its edge as a ring\n * shadow that takes on the tone behind it; a colored one keeps its tinted\n * border inside that ring. Compose {@link Card.Header},\n * {@link Card.Content}, and {@link Card.Footer} inside it.\n *\n * @param handle Runtime handle carrying the host `<section>`'s props.\n * @returns The render function producing the panel's markup.\n * @example\n * <Card>\n * \t<Card.Header>\n * \t\t<Card.Title>{t(\"plan.title\")}</Card.Title>\n * \t\t<Card.Description>{t(\"plan.description\")}</Card.Description>\n * \t</Card.Header>\n * \t<Card.Content>{t(\"plan.body\")}</Card.Content>\n * \t<Card.Footer>\n * \t\t<Button>{t(\"plan.upgrade\")}</Button>\n * \t</Card.Footer>\n * </Card>\n * @example\n * <Card color=\"danger\">\n * \t<Card.Header>\n * \t\t<Card.Title>{t(\"errors.billing.title\")}</Card.Title>\n * \t</Card.Header>\n * </Card>\n */\nexport function Card(handle: Handle<Card.Props>) {\n\treturn () => {\n\t\tlet { color, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\treturn (\n\t\t\t<section\n\t\t\t\tdata-color={resolvedColor}\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tsemanticColorPanel(),\n\t\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\t\tborder({ width: 1 }),\n\t\t\t\t\t\twhen('&[data-color=\"neutral\"]', border(\"transparent\")),\n\t\t\t\t\t\tshadow(\"sm\"),\n\t\t\t\t\t\tvars({ \"ui-box-shadow-ring\": SHADOW_RING }),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders the card's header slot: a `<header>` stacking its children in a\n * column with a small gap, padded on every side. Nest {@link Card.Title} and\n * {@link Card.Description} inside it.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the header slot's markup.\n * @example\n * <Card.Header>\n * \t<Card.Title>{t(\"plan.title\")}</Card.Title>\n * </Card.Header>\n */\nCard.Header = function CardHeader(handle: Handle<Card.HeaderProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <header {...rest} mix={mergeMix([flex(), flexCol(), p(6, 6), gap(\"0.375rem\")], mix)} />;\n\t};\n};\n\n/**\n * The card's heading, in the native heading element matching the nearest\n * ambient heading level — `<h1>` where nothing supplies one. Its text color\n * inherits from the card root's `color` value.\n *\n * @param handle Runtime handle carrying the host heading element's props.\n * @returns The render function producing the heading's markup.\n * @example\n * <Card.Title>{t(\"plan.title\")}</Card.Title>\n */\nCard.Title = function CardTitle(handle: Handle<Card.TitleProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\t\tlet resolved = resolveHeadingLevel(handle);\n\t\tlet Tag = TAG_BY_LEVEL[resolved];\n\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\t{...rest}\n\t\t\t\tdata-heading-level={resolved}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[fontSize(\"2xl\"), leading(1), weight(\"semibold\"), tracking(\"tight\"), balance()],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{rest.children}\n\t\t\t</Tag>\n\t\t);\n\t};\n};\n\n/**\n * Renders the card's supporting copy inside a native `<p>`, muted to\n * seventy percent opacity so it reads as secondary to {@link Card.Title}.\n *\n * @param handle Runtime handle carrying the host `<p>`'s props.\n * @returns The render function producing the description's markup.\n * @example\n * <Card.Description>{t(\"plan.description\")}</Card.Description>\n */\nCard.Description = function CardDescription(handle: Handle<Card.DescriptionProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <p {...rest} mix={mergeMix([fontSize(\"sm\"), opacity(70), pretty()], mix)} />;\n\t};\n};\n\n/**\n * The card's main body slot: a `<div>` padded on its inline and block-end\n * edges, leaving its block-start edge flush against {@link Card.Header}. Its\n * prose wraps with `text-wrap: pretty`, which every paragraph inside inherits.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the body slot's markup.\n * @example\n * <Card.Content>{t(\"plan.body\")}</Card.Content>\n */\nCard.Content = function CardContent(handle: Handle<Card.ContentProps>) {\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={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The body leaves the gap above it to a header, and takes it back when it opens the card,\n\t\t\t\t\t\t * so a card of content alone still clears its own top edge.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tpbs(0),\n\t\t\t\t\t\twhen(\"&:first-child\", pbs(6)),\n\t\t\t\t\t\tpbe(6),\n\t\t\t\t\t\tpi(6),\n\t\t\t\t\t\tpretty(),\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 * The card's footer slot: a `<footer>` laying its children out in a\n * vertically centered row, padded on its inline and block-end edges so it\n * sits flush against the content above.\n *\n * @param handle Runtime handle carrying the host `<footer>`'s props.\n * @returns The render function producing the footer slot's markup.\n * @example\n * <Card.Footer>\n * \t<Button>{t(\"plan.upgrade\")}</Button>\n * </Card.Footer>\n */\nCard.Footer = function CardFooter(handle: Handle<Card.FooterProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<footer {...rest} mix={mergeMix([flex(), items(\"center\"), pbs(0), pbe(6), pi(6)], mix)} />\n\t\t);\n\t};\n};\n"
13
13
  },
14
14
  "test": {
15
15
  "path": "card.test.tsx",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carousel",
3
- "changedIn": "2026.10.29",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [
5
5
  "button"
6
6
  ],
@@ -9,7 +9,7 @@
9
9
  ],
10
10
  "source": {
11
11
  "path": "carousel.tsx",
12
- "content": "/**\n * A horizontally scrolling collection of slides riding native CSS scroll snap,\n * so swiping or scrolling advances between slides with no script in the\n * baseline. {@link Carousel.Viewport} is the scrolling surface,\n * {@link Carousel.Track} rows up its {@link Carousel.Slide} children, and\n * {@link Carousel.Previous}/{@link Carousel.Next} are invoker buttons a paired\n * mixin wires into working controls.\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 { ChevronLeftIcon, ChevronRightIcon } from \"@sdxc/icons\";\nimport { outline } from \"@sdxc/u/color\";\nimport { raw, vars } from \"@sdxc/u/general\";\nimport { flex, flexCol, gap, grow, items, justify, shrink } from \"@sdxc/u/layout\";\nimport { media } from \"@sdxc/u/responsive\";\nimport { bs, is, minIs, pi } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { Button } from \"@sdxc/ui/button\";\n\n/** Native ARIA role applied to {@link Carousel.Viewport} unless a consumer overrides it. */\nconst DEFAULT_VIEWPORT_ROLE = \"group\";\n\n/**\n * Native tab-stop index applied to {@link Carousel.Viewport} unless a consumer\n * overrides it, so the scrollable region is reachable by keyboard even before\n * any control is wired up.\n */\nconst DEFAULT_VIEWPORT_TAB_INDEX = 0;\n\n/** Native ARIA role applied to {@link Carousel.Slide} unless a consumer overrides it. */\nconst DEFAULT_SLIDE_ROLE = \"group\";\n\n/**\n * Visual weight {@link Carousel.Previous} and {@link Carousel.Next} fall back\n * to when `variant` is omitted.\n */\nconst DEFAULT_CONTROL_VARIANT: Button.Variant = \"ghost\";\n\n/**\n * Semantic color role {@link Carousel.Previous} and {@link Carousel.Next} fall\n * back to when `color` is omitted.\n */\nconst DEFAULT_CONTROL_COLOR: Button.Color = \"neutral\";\n\n/**\n * Size variant {@link Carousel.Previous} and {@link Carousel.Next} fall back to\n * when `size` is omitted.\n */\nconst DEFAULT_CONTROL_SIZE: Button.Size = \"sm\";\n\n/** Invoker Commands verb {@link Carousel.Previous} falls back to when `command` is omitted. */\nconst DEFAULT_PREVIOUS_COMMAND = \"--ui-prev\";\n\n/** Invoker Commands verb {@link Carousel.Next} falls back to when `command` is omitted. */\nconst DEFAULT_NEXT_COMMAND = \"--ui-next\";\n\n/**\n * Prop types for {@link Carousel} and its compound parts.\n */\nexport namespace Carousel {\n\t/**\n\t * Every native `<section>` attribute, unchanged, plus the `mix`\n\t * passthrough. Override `--ui-carousel-gap`, `--ui-carousel-slide-size`, or\n\t * `--ui-carousel-padding` per instance through the inherited `style` prop.\n\t */\n\texport interface Props extends TagProps<\"section\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * Give it an `id` for the controls' `commandfor` prop to target, and pair a\n\t * `carouselControls()` mixin on it to make those controls scroll it.\n\t */\n\texport interface ViewportProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface TrackProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface SlideProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface ControlsProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every {@link Button.Props} field, with `commandfor` required and `command`\n\t * narrowed to the verb the paired mixin listens for.\n\t */\n\texport interface PreviousProps extends Omit<Button.Props, \"commandfor\" | \"command\"> {\n\t\t/** `id` of the {@link Carousel.Viewport} this control scrolls back through. */\n\t\tcommandfor: string;\n\t\t/** Invoker Commands verb a `carouselControls()` mixin listens for. Defaults to `\"--ui-prev\"`. */\n\t\tcommand?: \"--ui-prev\";\n\t}\n\n\t/**\n\t * Every {@link Button.Props} field, with `commandfor` required and `command`\n\t * narrowed to the verb the paired mixin listens for.\n\t */\n\texport interface NextProps extends Omit<Button.Props, \"commandfor\" | \"command\"> {\n\t\t/** `id` of the {@link Carousel.Viewport} this control scrolls forward through. */\n\t\tcommandfor: string;\n\t\t/** Invoker Commands verb a `carouselControls()` mixin listens for. Defaults to `\"--ui-next\"`. */\n\t\tcommand?: \"--ui-next\";\n\t}\n}\n\n/**\n * The carousel root: a `<section>` stacking {@link Carousel.Viewport} and\n * {@link Carousel.Controls} in a column, declaring the `--ui-carousel-*`\n * custom properties its descendants read with per-instance defaults.\n *\n * @param handle Runtime handle carrying the host `<section>`'s props.\n * @returns The render function producing the carousel's markup.\n * @example\n * <Carousel aria-label={t(\"gallery.label\")}>\n * \t<Carousel.Viewport id=\"gallery-viewport\">\n * \t\t<Carousel.Track>\n * \t\t\t<Carousel.Slide><img src={photo.src} alt={photo.alt} /></Carousel.Slide>\n * \t\t</Carousel.Track>\n * \t</Carousel.Viewport>\n * \t<Carousel.Controls>\n * \t\t<Carousel.Previous commandfor=\"gallery-viewport\" aria-label={t(\"gallery.previous\")} />\n * \t\t<Carousel.Next commandfor=\"gallery-viewport\" aria-label={t(\"gallery.next\")} />\n * \t</Carousel.Controls>\n * </Carousel>\n * @example\n * // Marketing browser-flow strip: widen `--ui-carousel-slide-size` for product\n * // frames and keep Previous/Next on `size=\"sm\"` so controls stay quiet.\n * <Carousel\n * \taria-label={t(\"flows.label\")}\n * \tstyle={{ \"--ui-carousel-slide-size\": \"28rem\" }}\n * >\n * \t<Carousel.Viewport id=\"flows\" mix={[carouselControls()]}>\n * \t\t<Carousel.Track>{slides}</Carousel.Track>\n * \t</Carousel.Viewport>\n * \t<Carousel.Controls>\n * \t\t<Carousel.Previous commandfor=\"flows\" aria-label={t(\"flows.previous\")} />\n * \t\t<Carousel.Next commandfor=\"flows\" aria-label={t(\"flows.next\")} />\n * \t</Carousel.Controls>\n * </Carousel>\n */\nexport function Carousel(handle: Handle<Carousel.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<section\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"carousel\"\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tgap(3),\n\t\t\t\t\tvars({\n\t\t\t\t\t\t\"ui-carousel-gap\": \"1rem\",\n\t\t\t\t\t\t\"ui-carousel-slide-size\": \"18rem\",\n\t\t\t\t\t\t\"ui-carousel-padding\": \"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);\n\t};\n}\n\n/**\n * A `<div>` scrolling {@link Carousel.Track} along the inline axis via logical\n * properties for correct writing direction, with mandatory scroll-snap stops;\n * scroll padding reads `--ui-carousel-padding` to clear the track's own padding.\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 * <Carousel.Viewport id=\"gallery-viewport\">\n * \t<Carousel.Track>{slides}</Carousel.Track>\n * </Carousel.Viewport>\n */\nCarousel.Viewport = function CarouselViewport(handle: Handle<Carousel.ViewportProps>) {\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=\"viewport\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_VIEWPORT_ROLE, tabIndex: DEFAULT_VIEWPORT_TAB_INDEX }),\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\traw({\n\t\t\t\t\t\toverflowInline: \"auto\",\n\t\t\t\t\t\toverflowBlock: \"hidden\",\n\t\t\t\t\t\tscrollBehavior: \"smooth\",\n\t\t\t\t\t\tscrollSnapType: \"inline mandatory\",\n\t\t\t\t\t\tscrollPaddingInline: \"var(--ui-carousel-padding, 0px)\",\n\t\t\t\t\t\t\"-webkit-overflow-scrolling\": \"touch\",\n\t\t\t\t\t}),\n\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", raw({ scrollBehavior: \"auto\" })),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * The carousel's slide row: a `<div>` laying its {@link Carousel.Slide}\n * children out in one inline row, gapped by `--ui-carousel-gap` and padded by\n * `--ui-carousel-padding` so the first and last slide can still center.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the track's markup.\n * @example\n * <Carousel.Track>\n * \t<Carousel.Slide>{firstSlide}</Carousel.Slide>\n * \t<Carousel.Slide>{secondSlide}</Carousel.Slide>\n * </Carousel.Track>\n */\nCarousel.Track = function CarouselTrack(handle: Handle<Carousel.TrackProps>) {\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=\"track\"\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\tgap(\"var(--ui-carousel-gap, 1rem)\"),\n\t\t\t\t\tpi(\"var(--ui-carousel-padding, 0px)\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * A single slide: a `<div>` held at `--ui-carousel-slide-size` along the\n * inline axis, snapping to its inline-start edge so the viewport settles on a\n * slide boundary.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the slide's markup.\n * @example\n * <Carousel.Slide><img src={photo.src} alt={photo.alt} /></Carousel.Slide>\n */\nCarousel.Slide = function CarouselSlide(handle: Handle<Carousel.SlideProps>) {\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=\"slide\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_SLIDE_ROLE }),\n\t\t\t\t\tgrow(0),\n\t\t\t\t\tshrink(0),\n\t\t\t\t\t/**\n\t\t\t\t\t * The slide snaps to the viewport's start edge and leaves the scroll free to pass it:\n\t\t\t\t\t * `scroll-snap-stop: always` clamps programmatic scrolls too, so every dot would move\n\t\t\t\t\t * one slide and none would reach the slide it names.\n\t\t\t\t\t */\n\t\t\t\t\traw({\n\t\t\t\t\t\tflexBasis: \"var(--ui-carousel-slide-size, 18rem)\",\n\t\t\t\t\t\tscrollSnapAlign: \"start\",\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 * The carousel's control row: a `<div>` laying {@link Carousel.Previous} and\n * {@link Carousel.Next} out as an end-aligned, vertically centered row.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the control row's markup.\n * @example\n * <Carousel.Controls>\n * \t<Carousel.Previous commandfor=\"gallery-viewport\" aria-label={t(\"gallery.previous\")} />\n * \t<Carousel.Next commandfor=\"gallery-viewport\" aria-label={t(\"gallery.next\")} />\n * </Carousel.Controls>\n */\nCarousel.Controls = function CarouselControls(handle: Handle<Carousel.ControlsProps>) {\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=\"controls\"\n\t\t\t\tmix={[flex(), items(\"center\"), gap(2), justify(\"end\"), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * A static control scrolling {@link Carousel.Viewport} named by `commandfor` back\n * one slide when a hydrated `carouselControls()` mixin handles `\"--ui-prev\"`; custom\n * `children` replacing the chevron still need their own `aria-label`.\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 * <Carousel.Previous commandfor=\"gallery-viewport\" aria-label={t(\"gallery.previous\")} />\n */\nCarousel.Previous = function CarouselPrevious(handle: Handle<Carousel.PreviousProps>) {\n\treturn () => {\n\t\tlet { variant, color, size, command, children, mix, ...rest } = handle.props;\n\t\tlet resolvedVariant = variant ?? DEFAULT_CONTROL_VARIANT;\n\t\tlet resolvedColor = color ?? DEFAULT_CONTROL_COLOR;\n\t\tlet resolvedSize = size ?? DEFAULT_CONTROL_SIZE;\n\t\tlet resolvedCommand = command ?? DEFAULT_PREVIOUS_COMMAND;\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\tvariant={resolvedVariant}\n\t\t\t\tcolor={resolvedColor}\n\t\t\t\tsize={resolvedSize}\n\t\t\t\tcommand={resolvedCommand}\n\t\t\t\tdata-slot=\"previous\"\n\t\t\t\tmix={[minIs(0), when(\"& > svg\", [is(4), bs(4)]), mix]}\n\t\t\t>\n\t\t\t\t{children ?? <ChevronLeftIcon />}\n\t\t\t</Button>\n\t\t);\n\t};\n};\n\n/**\n * A static control scrolling {@link Carousel.Viewport} named by `commandfor` forward\n * one slide when a hydrated `carouselControls()` mixin handles `\"--ui-next\"`; custom\n * `children` replacing the chevron still need their own `aria-label`.\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 * <Carousel.Next commandfor=\"gallery-viewport\" aria-label={t(\"gallery.next\")} />\n */\nCarousel.Next = function CarouselNext(handle: Handle<Carousel.NextProps>) {\n\treturn () => {\n\t\tlet { variant, color, size, command, children, mix, ...rest } = handle.props;\n\t\tlet resolvedVariant = variant ?? DEFAULT_CONTROL_VARIANT;\n\t\tlet resolvedColor = color ?? DEFAULT_CONTROL_COLOR;\n\t\tlet resolvedSize = size ?? DEFAULT_CONTROL_SIZE;\n\t\tlet resolvedCommand = command ?? DEFAULT_NEXT_COMMAND;\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\tvariant={resolvedVariant}\n\t\t\t\tcolor={resolvedColor}\n\t\t\t\tsize={resolvedSize}\n\t\t\t\tcommand={resolvedCommand}\n\t\t\t\tdata-slot=\"next\"\n\t\t\t\tmix={[minIs(0), when(\"& > svg\", [is(4), bs(4)]), mix]}\n\t\t\t>\n\t\t\t\t{children ?? <ChevronRightIcon />}\n\t\t\t</Button>\n\t\t);\n\t};\n};\n"
12
+ "content": "/**\n * A horizontally scrolling collection of slides riding native CSS scroll snap,\n * so swiping or scrolling advances between slides with no script in the\n * baseline. {@link Carousel.Viewport} is the scrolling surface,\n * {@link Carousel.Track} rows up its {@link Carousel.Slide} children, and\n * {@link Carousel.Previous}/{@link Carousel.Next} are invoker buttons a paired\n * mixin wires into working controls.\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 { ChevronLeftIcon, ChevronRightIcon } from \"@sdxc/icons\";\nimport { outline } from \"@sdxc/u/color\";\nimport { raw, vars, mergeMix } from \"@sdxc/u/general\";\nimport { flex, flexCol, gap, grow, items, justify, shrink } from \"@sdxc/u/layout\";\nimport { media } from \"@sdxc/u/responsive\";\nimport { bs, is, minIs, pi } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { Button } from \"@sdxc/ui/button\";\n\n/** Native ARIA role applied to {@link Carousel.Viewport} unless a consumer overrides it. */\nconst DEFAULT_VIEWPORT_ROLE = \"group\";\n\n/**\n * Native tab-stop index applied to {@link Carousel.Viewport} unless a consumer\n * overrides it, so the scrollable region is reachable by keyboard even before\n * any control is wired up.\n */\nconst DEFAULT_VIEWPORT_TAB_INDEX = 0;\n\n/** Native ARIA role applied to {@link Carousel.Slide} unless a consumer overrides it. */\nconst DEFAULT_SLIDE_ROLE = \"group\";\n\n/**\n * Visual weight {@link Carousel.Previous} and {@link Carousel.Next} fall back\n * to when `variant` is omitted.\n */\nconst DEFAULT_CONTROL_VARIANT: Button.Variant = \"ghost\";\n\n/**\n * Semantic color role {@link Carousel.Previous} and {@link Carousel.Next} fall\n * back to when `color` is omitted.\n */\nconst DEFAULT_CONTROL_COLOR: Button.Color = \"neutral\";\n\n/**\n * Size variant {@link Carousel.Previous} and {@link Carousel.Next} fall back to\n * when `size` is omitted.\n */\nconst DEFAULT_CONTROL_SIZE: Button.Size = \"sm\";\n\n/** Invoker Commands verb {@link Carousel.Previous} falls back to when `command` is omitted. */\nconst DEFAULT_PREVIOUS_COMMAND = \"--ui-prev\";\n\n/** Invoker Commands verb {@link Carousel.Next} falls back to when `command` is omitted. */\nconst DEFAULT_NEXT_COMMAND = \"--ui-next\";\n\n/**\n * Prop types for {@link Carousel} and its compound parts.\n */\nexport namespace Carousel {\n\t/**\n\t * Every native `<section>` attribute, unchanged, plus the `mix`\n\t * passthrough. Override `--ui-carousel-gap`, `--ui-carousel-slide-size`, or\n\t * `--ui-carousel-padding` per instance through the inherited `style` prop.\n\t */\n\texport interface Props extends TagProps<\"section\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * Give it an `id` for the controls' `commandfor` prop to target, and pair a\n\t * `carouselControls()` mixin on it to make those controls scroll it.\n\t */\n\texport interface ViewportProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface TrackProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface SlideProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface ControlsProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every {@link Button.Props} field, with `commandfor` required and `command`\n\t * narrowed to the verb the paired mixin listens for.\n\t */\n\texport interface PreviousProps extends Omit<Button.Props, \"commandfor\" | \"command\"> {\n\t\t/** `id` of the {@link Carousel.Viewport} this control scrolls back through. */\n\t\tcommandfor: string;\n\t\t/** Invoker Commands verb a `carouselControls()` mixin listens for. Defaults to `\"--ui-prev\"`. */\n\t\tcommand?: \"--ui-prev\";\n\t}\n\n\t/**\n\t * Every {@link Button.Props} field, with `commandfor` required and `command`\n\t * narrowed to the verb the paired mixin listens for.\n\t */\n\texport interface NextProps extends Omit<Button.Props, \"commandfor\" | \"command\"> {\n\t\t/** `id` of the {@link Carousel.Viewport} this control scrolls forward through. */\n\t\tcommandfor: string;\n\t\t/** Invoker Commands verb a `carouselControls()` mixin listens for. Defaults to `\"--ui-next\"`. */\n\t\tcommand?: \"--ui-next\";\n\t}\n}\n\n/**\n * The carousel root: a `<section>` stacking {@link Carousel.Viewport} and\n * {@link Carousel.Controls} in a column, declaring the `--ui-carousel-*`\n * custom properties its descendants read with per-instance defaults.\n *\n * @param handle Runtime handle carrying the host `<section>`'s props.\n * @returns The render function producing the carousel's markup.\n * @example\n * <Carousel aria-label={t(\"gallery.label\")}>\n * \t<Carousel.Viewport id=\"gallery-viewport\">\n * \t\t<Carousel.Track>\n * \t\t\t<Carousel.Slide><img src={photo.src} alt={photo.alt} /></Carousel.Slide>\n * \t\t</Carousel.Track>\n * \t</Carousel.Viewport>\n * \t<Carousel.Controls>\n * \t\t<Carousel.Previous commandfor=\"gallery-viewport\" aria-label={t(\"gallery.previous\")} />\n * \t\t<Carousel.Next commandfor=\"gallery-viewport\" aria-label={t(\"gallery.next\")} />\n * \t</Carousel.Controls>\n * </Carousel>\n * @example\n * // Landing browser-flow strip: widen `--ui-carousel-slide-size` for product\n * // frames and keep Previous/Next on `size=\"sm\"` so controls stay quiet.\n * <Carousel\n * \taria-label={t(\"flows.label\")}\n * \tstyle={{ \"--ui-carousel-slide-size\": \"28rem\" }}\n * >\n * \t<Carousel.Viewport id=\"flows\" mix={[carouselControls()]}>\n * \t\t<Carousel.Track>{slides}</Carousel.Track>\n * \t</Carousel.Viewport>\n * \t<Carousel.Controls>\n * \t\t<Carousel.Previous commandfor=\"flows\" aria-label={t(\"flows.previous\")} />\n * \t\t<Carousel.Next commandfor=\"flows\" aria-label={t(\"flows.next\")} />\n * \t</Carousel.Controls>\n * </Carousel>\n */\nexport function Carousel(handle: Handle<Carousel.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<section\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"carousel\"\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tflex(),\n\t\t\t\t\t\tflexCol(),\n\t\t\t\t\t\tgap(3),\n\t\t\t\t\t\tvars({\n\t\t\t\t\t\t\t\"ui-carousel-gap\": \"1rem\",\n\t\t\t\t\t\t\t\"ui-carousel-slide-size\": \"18rem\",\n\t\t\t\t\t\t\t\"ui-carousel-padding\": \"0px\",\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);\n\t};\n}\n\n/**\n * A `<div>` scrolling {@link Carousel.Track} along the inline axis via logical\n * properties for correct writing direction, with mandatory scroll-snap stops;\n * scroll padding reads `--ui-carousel-padding` to clear the track's own padding.\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 * <Carousel.Viewport id=\"gallery-viewport\">\n * \t<Carousel.Track>{slides}</Carousel.Track>\n * </Carousel.Viewport>\n */\nCarousel.Viewport = function CarouselViewport(handle: Handle<Carousel.ViewportProps>) {\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=\"viewport\"\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tattrs({ role: DEFAULT_VIEWPORT_ROLE, tabIndex: DEFAULT_VIEWPORT_TAB_INDEX }),\n\t\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t\traw({\n\t\t\t\t\t\t\toverflowInline: \"auto\",\n\t\t\t\t\t\t\toverflowBlock: \"hidden\",\n\t\t\t\t\t\t\tscrollBehavior: \"smooth\",\n\t\t\t\t\t\t\tscrollSnapType: \"inline mandatory\",\n\t\t\t\t\t\t\tscrollPaddingInline: \"var(--ui-carousel-padding, 0px)\",\n\t\t\t\t\t\t\t\"-webkit-overflow-scrolling\": \"touch\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", raw({ scrollBehavior: \"auto\" })),\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 * The carousel's slide row: a `<div>` laying its {@link Carousel.Slide}\n * children out in one inline row, gapped by `--ui-carousel-gap` and padded by\n * `--ui-carousel-padding` so the first and last slide can still center.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the track's markup.\n * @example\n * <Carousel.Track>\n * \t<Carousel.Slide>{firstSlide}</Carousel.Slide>\n * \t<Carousel.Slide>{secondSlide}</Carousel.Slide>\n * </Carousel.Track>\n */\nCarousel.Track = function CarouselTrack(handle: Handle<Carousel.TrackProps>) {\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=\"track\"\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[flex(), gap(\"var(--ui-carousel-gap, 1rem)\"), pi(\"var(--ui-carousel-padding, 0px)\")],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * A single slide: a `<div>` held at `--ui-carousel-slide-size` along the\n * inline axis, snapping to its inline-start edge so the viewport settles on a\n * slide boundary.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the slide's markup.\n * @example\n * <Carousel.Slide><img src={photo.src} alt={photo.alt} /></Carousel.Slide>\n */\nCarousel.Slide = function CarouselSlide(handle: Handle<Carousel.SlideProps>) {\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=\"slide\"\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tattrs({ role: DEFAULT_SLIDE_ROLE }),\n\t\t\t\t\t\tgrow(0),\n\t\t\t\t\t\tshrink(0),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The slide snaps to the viewport's start edge and leaves the scroll free to pass it:\n\t\t\t\t\t\t * `scroll-snap-stop: always` clamps programmatic scrolls too, so every dot would move\n\t\t\t\t\t\t * one slide and none would reach the slide it names.\n\t\t\t\t\t\t */\n\t\t\t\t\t\traw({\n\t\t\t\t\t\t\tflexBasis: \"var(--ui-carousel-slide-size, 18rem)\",\n\t\t\t\t\t\t\tscrollSnapAlign: \"start\",\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);\n\t};\n};\n\n/**\n * The carousel's control row: a `<div>` laying {@link Carousel.Previous} and\n * {@link Carousel.Next} out as an end-aligned, vertically centered row.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the control row's markup.\n * @example\n * <Carousel.Controls>\n * \t<Carousel.Previous commandfor=\"gallery-viewport\" aria-label={t(\"gallery.previous\")} />\n * \t<Carousel.Next commandfor=\"gallery-viewport\" aria-label={t(\"gallery.next\")} />\n * </Carousel.Controls>\n */\nCarousel.Controls = function CarouselControls(handle: Handle<Carousel.ControlsProps>) {\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=\"controls\"\n\t\t\t\tmix={mergeMix([flex(), items(\"center\"), gap(2), justify(\"end\")], mix)}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * A static control scrolling {@link Carousel.Viewport} named by `commandfor` back\n * one slide when a hydrated `carouselControls()` mixin handles `\"--ui-prev\"`; custom\n * `children` replacing the chevron still need their own `aria-label`.\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 * <Carousel.Previous commandfor=\"gallery-viewport\" aria-label={t(\"gallery.previous\")} />\n */\nCarousel.Previous = function CarouselPrevious(handle: Handle<Carousel.PreviousProps>) {\n\treturn () => {\n\t\tlet { variant, color, size, command, children, mix, ...rest } = handle.props;\n\t\tlet resolvedVariant = variant ?? DEFAULT_CONTROL_VARIANT;\n\t\tlet resolvedColor = color ?? DEFAULT_CONTROL_COLOR;\n\t\tlet resolvedSize = size ?? DEFAULT_CONTROL_SIZE;\n\t\tlet resolvedCommand = command ?? DEFAULT_PREVIOUS_COMMAND;\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\tvariant={resolvedVariant}\n\t\t\t\tcolor={resolvedColor}\n\t\t\t\tsize={resolvedSize}\n\t\t\t\tcommand={resolvedCommand}\n\t\t\t\tdata-slot=\"previous\"\n\t\t\t\tmix={mergeMix([minIs(0), when(\"& > svg\", [is(4), bs(4)])], mix)}\n\t\t\t>\n\t\t\t\t{children ?? <ChevronLeftIcon />}\n\t\t\t</Button>\n\t\t);\n\t};\n};\n\n/**\n * A static control scrolling {@link Carousel.Viewport} named by `commandfor` forward\n * one slide when a hydrated `carouselControls()` mixin handles `\"--ui-next\"`; custom\n * `children` replacing the chevron still need their own `aria-label`.\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 * <Carousel.Next commandfor=\"gallery-viewport\" aria-label={t(\"gallery.next\")} />\n */\nCarousel.Next = function CarouselNext(handle: Handle<Carousel.NextProps>) {\n\treturn () => {\n\t\tlet { variant, color, size, command, children, mix, ...rest } = handle.props;\n\t\tlet resolvedVariant = variant ?? DEFAULT_CONTROL_VARIANT;\n\t\tlet resolvedColor = color ?? DEFAULT_CONTROL_COLOR;\n\t\tlet resolvedSize = size ?? DEFAULT_CONTROL_SIZE;\n\t\tlet resolvedCommand = command ?? DEFAULT_NEXT_COMMAND;\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\tvariant={resolvedVariant}\n\t\t\t\tcolor={resolvedColor}\n\t\t\t\tsize={resolvedSize}\n\t\t\t\tcommand={resolvedCommand}\n\t\t\t\tdata-slot=\"next\"\n\t\t\t\tmix={mergeMix([minIs(0), when(\"& > svg\", [is(4), bs(4)])], mix)}\n\t\t\t>\n\t\t\t\t{children ?? <ChevronRightIcon />}\n\t\t\t</Button>\n\t\t);\n\t};\n};\n"
13
13
  },
14
14
  "test": null
15
15
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "checkbox-group",
3
- "changedIn": "2026.10.2",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "CheckboxGroup"
7
7
  ],
8
8
  "source": {
9
9
  "path": "checkbox-group.tsx",
10
- "content": "/**\n * A landmark grouping independently toggled checkbox controls into one\n * related set: a `role=\"group\"` host laying children out in a column, or a\n * row when `orientation` is `\"horizontal\"`. Each nested checkbox keeps its\n * own checked state, `name`, and `value`; the host contributes the shared\n * grouping, the layout, and an invalid-state color for composed text.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { fg } from \"@sdxc/u/color\";\nimport { flexRow, gap, vstack } from \"@sdxc/u/layout\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { warnIfNoAccessibleLabel } from \"@sdxc/ui/utils\";\n\n/**\n * Announces the host as a related set of controls to assistive technology;\n * {@link attrs} lets a consumer's own `role` win.\n */\nconst DEFAULT_ROLE = \"group\";\n\nconst DEFAULT_ORIENTATION: CheckboxGroup.Orientation = \"vertical\";\n\n/**\n * Prop types for {@link CheckboxGroup}.\n */\nexport namespace CheckboxGroup {\n\t/**\n\t * Axis a group's checkboxes lay out along: a single column, or a single\n\t * row.\n\t */\n\texport type Orientation = \"horizontal\" | \"vertical\";\n\n\t/**\n\t * Props accepted by {@link CheckboxGroup}. Native `<div>` attributes and\n\t * `mix` pass through to the grouping host, so `aria-label`,\n\t * `aria-labelledby`, `aria-describedby`, and `aria-invalid` behave natively.\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\n/**\n * Lays checkbox children out in a column, or a row when `orientation` is\n * `\"horizontal\"`; each nested checkbox keeps its own checked state, `name`,\n * and `value`. `aria-invalid=\"true\"` recolors plain text composed alongside.\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 * <CheckboxGroup aria-labelledby=\"fruits-label\">\n * \t<Label id=\"fruits-label\">{t(\"fruits.label\")}</Label>\n * \t<Checkbox name=\"fruits\" value=\"apple\">{t(\"fruits.apple\")}</Checkbox>\n * \t<Checkbox name=\"fruits\" value=\"banana\">{t(\"fruits.banana\")}</Checkbox>\n * \t<Checkbox name=\"fruits\" value=\"orange\">{t(\"fruits.orange\")}</Checkbox>\n * </CheckboxGroup>\n * @example\n * <CheckboxGroup aria-label={t(\"notifications.label\")} orientation=\"horizontal\">\n * \t<Checkbox name=\"notify\" value=\"email\">{t(\"notifications.email\")}</Checkbox>\n * \t<Checkbox name=\"notify\" value=\"sms\">{t(\"notifications.sms\")}</Checkbox>\n * \t<Checkbox name=\"notify\" value=\"push\">{t(\"notifications.push\")}</Checkbox>\n * </CheckboxGroup>\n * @example\n * <CheckboxGroup aria-labelledby=\"terms-label\" aria-invalid=\"true\" aria-describedby=\"terms-error\">\n * \t<Label id=\"terms-label\">{t(\"terms.label\")}</Label>\n * \t<Checkbox name=\"terms\" value=\"accepted\" required>{t(\"terms.accept\")}</Checkbox>\n * \t<FieldError id=\"terms-error\">{t(\"terms.required\")}</FieldError>\n * </CheckboxGroup>\n */\nexport function CheckboxGroup(handle: Handle<CheckboxGroup.Props>) {\n\treturn () => {\n\t\tlet { orientation, mix, ...rest } = handle.props;\n\t\tlet resolvedOrientation = orientation ?? DEFAULT_ORIENTATION;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t\"CheckboxGroup: a group with no `aria-label` or `aria-labelledby` needs one describing the set — assistive technology has no accessible name to announce otherwise.\",\n\t\t);\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\tattrs({ role: DEFAULT_ROLE }),\n\t\t\t\t\tvstack({ gap: 2 }),\n\t\t\t\t\twhen('&[data-orientation=\"horizontal\"]', [flexRow(), gap(4)]),\n\t\t\t\t\twhen('&[aria-invalid=\"true\"]', fg(\"danger\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n"
10
+ "content": "/**\n * A landmark grouping independently toggled checkbox controls into one\n * related set: a `role=\"group\"` host laying children out in a column, or a\n * row when `orientation` is `\"horizontal\"`. Each nested checkbox keeps its\n * own checked state, `name`, and `value`; the host contributes the shared\n * grouping, the layout, and an invalid-state color for composed text.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { fg } from \"@sdxc/u/color\";\nimport { mergeMix } from \"@sdxc/u/general\";\nimport { flexRow, gap, vstack } from \"@sdxc/u/layout\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { warnIfNoAccessibleLabel } from \"@sdxc/ui/utils\";\n\n/**\n * Announces the host as a related set of controls to assistive technology;\n * {@link attrs} lets a consumer's own `role` win.\n */\nconst DEFAULT_ROLE = \"group\";\n\nconst DEFAULT_ORIENTATION: CheckboxGroup.Orientation = \"vertical\";\n\n/**\n * Prop types for {@link CheckboxGroup}.\n */\nexport namespace CheckboxGroup {\n\t/**\n\t * Axis a group's checkboxes lay out along: a single column, or a single\n\t * row.\n\t */\n\texport type Orientation = \"horizontal\" | \"vertical\";\n\n\t/**\n\t * Props accepted by {@link CheckboxGroup}. Native `<div>` attributes and\n\t * `mix` pass through to the grouping host, so `aria-label`,\n\t * `aria-labelledby`, `aria-describedby`, and `aria-invalid` behave natively.\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\n/**\n * Lays checkbox children out in a column, or a row when `orientation` is\n * `\"horizontal\"`; each nested checkbox keeps its own checked state, `name`,\n * and `value`. `aria-invalid=\"true\"` recolors plain text composed alongside.\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 * <CheckboxGroup aria-labelledby=\"fruits-label\">\n * \t<Label id=\"fruits-label\">{t(\"fruits.label\")}</Label>\n * \t<Checkbox name=\"fruits\" value=\"apple\">{t(\"fruits.apple\")}</Checkbox>\n * \t<Checkbox name=\"fruits\" value=\"banana\">{t(\"fruits.banana\")}</Checkbox>\n * \t<Checkbox name=\"fruits\" value=\"orange\">{t(\"fruits.orange\")}</Checkbox>\n * </CheckboxGroup>\n * @example\n * <CheckboxGroup aria-label={t(\"notifications.label\")} orientation=\"horizontal\">\n * \t<Checkbox name=\"notify\" value=\"email\">{t(\"notifications.email\")}</Checkbox>\n * \t<Checkbox name=\"notify\" value=\"sms\">{t(\"notifications.sms\")}</Checkbox>\n * \t<Checkbox name=\"notify\" value=\"push\">{t(\"notifications.push\")}</Checkbox>\n * </CheckboxGroup>\n * @example\n * <CheckboxGroup aria-labelledby=\"terms-label\" aria-invalid=\"true\" aria-describedby=\"terms-error\">\n * \t<Label id=\"terms-label\">{t(\"terms.label\")}</Label>\n * \t<Checkbox name=\"terms\" value=\"accepted\" required>{t(\"terms.accept\")}</Checkbox>\n * \t<FieldError id=\"terms-error\">{t(\"terms.required\")}</FieldError>\n * </CheckboxGroup>\n */\nexport function CheckboxGroup(handle: Handle<CheckboxGroup.Props>) {\n\treturn () => {\n\t\tlet { orientation, mix, ...rest } = handle.props;\n\t\tlet resolvedOrientation = orientation ?? DEFAULT_ORIENTATION;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t\"CheckboxGroup: a group with no `aria-label` or `aria-labelledby` needs one describing the set — assistive technology has no accessible name to announce otherwise.\",\n\t\t);\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={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tattrs({ role: DEFAULT_ROLE }),\n\t\t\t\t\t\tvstack({ gap: 2 }),\n\t\t\t\t\t\twhen('&[data-orientation=\"horizontal\"]', [flexRow(), gap(4)]),\n\t\t\t\t\t\twhen('&[aria-invalid=\"true\"]', fg(\"danger\")),\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"
11
11
  },
12
12
  "test": null
13
13
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "checkbox",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Checkbox"
7
7
  ],
8
8
  "source": {
9
9
  "path": "checkbox.tsx",
10
- "content": "/**\n * A styled native checkbox: an `<input type=\"checkbox\">` paired with a\n * decorative glyph box that renders its check or dash mark purely from the\n * input's own state, wrapped in a `<label>` so clicking or tapping anywhere\n * in the row — box, glyph, or label text alike — toggles the control.\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 { CheckIcon, MinusIcon } from \"@sdxc/icons\";\nimport { visuallyHidden } from \"@sdxc/u/a11y\";\nimport { bg, border, fg, outline } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor } from \"@sdxc/u/general\";\nimport { block, center, hidden, hstack, relative, shrink } from \"@sdxc/u/layout\";\nimport { bs, is } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { warnIfNoAccessibleName } from \"@sdxc/ui/utils\";\n\n/** Semantic color role {@link Checkbox} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: Checkbox.Color = \"neutral\";\n\n/**\n * Prop types for {@link Checkbox}.\n */\nexport namespace Checkbox {\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 * Per-part styling for the elements this convenience wrapper composes\n\t * internally alongside its own host `<input>`.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the decorative box rendering the checkmark or dash glyph. */\n\t\tbox?: TagProps<\"span\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link Checkbox}. Extends every native `<input>`\n\t * attribute except `type`, fixed to `\"checkbox\"`; `mix` styles that same\n\t * `<input>` host, and `role` is narrowed to what a checkbox input allows.\n\t */\n\texport interface Props extends Omit<TagProps<\"input\">, \"type\" | \"role\"> {\n\t\t/** ARIA role override, restricted to what a checkbox input may carry. */\n\t\trole?: \"checkbox\" | \"button\" | \"menuitemcheckbox\" | \"option\" | \"switch\";\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/**\n\t\t * Label content rendered after the box, inside the same native\n\t\t * `<label>` wrapping the row — clicking any of it toggles the checkbox\n\t\t * natively, with no separate `htmlFor`/`id` pair required.\n\t\t */\n\t\tchildren?: RemixNode;\n\t\t/** Per-part styling for this wrapper's internally composed elements. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * The box precedes the input in source order so its `:has(~ input:…)` rules\n * can read state directly off it, keeping the whole control CSS-driven;\n * `shrink(0)` also keeps the box square regardless of label length.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the checkbox's markup.\n * @example\n * <Checkbox name=\"terms\" required>{t(\"signup.acceptTerms\")}</Checkbox>\n * @example\n * <Checkbox color=\"danger\" checked={row.flagged} aria-label={t(\"table.flagRow\")} />\n * @example\n * <Checkbox disabled defaultChecked>{t(\"settings.legacyOptIn\")}</Checkbox>\n */\nexport function Checkbox(handle: Handle<Checkbox.Props>) {\n\treturn () => {\n\t\tlet { color, children, parts, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\twarnIfNoAccessibleName(\n\t\t\thandle.props,\n\t\t\tchildren,\n\t\t\t\"Checkbox: a checkbox with no visible label text needs an `aria-label` describing what it toggles — assistive technology has no accessible name to announce otherwise.\",\n\t\t);\n\n\t\treturn (\n\t\t\t<label mix={[relative(), hstack({ gap: 2, align: \"center\" })]}>\n\t\t\t\t<span\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tdata-slot=\"box\"\n\t\t\t\t\tdata-color={resolvedColor}\n\t\t\t\t\tmix={[\n\t\t\t\t\t\tcenter(),\n\t\t\t\t\t\tis(\"var(--ui-checkbox-size, 1.25rem)\"),\n\t\t\t\t\t\tbs(\"var(--ui-checkbox-size, 1.25rem)\"),\n\t\t\t\t\t\tshrink(0),\n\t\t\t\t\t\trounded(\"sm\"),\n\t\t\t\t\t\tborder({ width: 2, color: \"neutral.strong\" }),\n\t\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\t\tinteractiveTransition(),\n\n\t\t\t\t\t\twhen(\"& > svg\", [hidden(), is(\"0.75rem\"), bs(\"0.75rem\")]),\n\t\t\t\t\t\twhen(\"&:has(~ input:checked) > svg:first-child\", block()),\n\t\t\t\t\t\twhen(\"&:has(~ input:indeterminate) > svg:last-child\", block()),\n\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t'&[data-color=\"brand\"]',\n\t\t\t\t\t\t\twhen(\"&:has(~ input:checked), &:has(~ input:indeterminate)\", [\n\t\t\t\t\t\t\t\tborder(\"brand.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]),\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t'&[data-color=\"neutral\"]',\n\t\t\t\t\t\t\twhen(\"&:has(~ input:checked), &:has(~ input:indeterminate)\", [\n\t\t\t\t\t\t\t\tborder(\"neutral.solid\"),\n\t\t\t\t\t\t\t\tbg(\"neutral.solid\"),\n\t\t\t\t\t\t\t\tfg(\"neutral.onSolid\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t'&[data-color=\"success\"]',\n\t\t\t\t\t\t\twhen(\"&:has(~ input:checked), &:has(~ input:indeterminate)\", [\n\t\t\t\t\t\t\t\tborder(\"success.solid\"),\n\t\t\t\t\t\t\t\tbg(\"success.solid\"),\n\t\t\t\t\t\t\t\tfg(\"success.onSolid\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t'&[data-color=\"warning\"]',\n\t\t\t\t\t\t\twhen(\"&:has(~ input:checked), &:has(~ input:indeterminate)\", [\n\t\t\t\t\t\t\t\tborder(\"warning.solid\"),\n\t\t\t\t\t\t\t\tbg(\"warning.solid\"),\n\t\t\t\t\t\t\t\tfg(\"warning.onSolid\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t'&[data-color=\"danger\"]',\n\t\t\t\t\t\t\twhen(\"&:has(~ input:checked), &:has(~ input:indeterminate)\", [\n\t\t\t\t\t\t\t\tborder(\"danger.solid\"),\n\t\t\t\t\t\t\t\tbg(\"danger.solid\"),\n\t\t\t\t\t\t\t\tfg(\"danger.onSolid\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\twhen(\"&:has(~ input:focus-visible)\", [\n\t\t\t\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\t\t\t\twhen('&[data-color=\"neutral\"]', outline(\"neutral.ring\")),\n\t\t\t\t\t\t\twhen('&[data-color=\"success\"]', outline(\"success.ring\")),\n\t\t\t\t\t\t\twhen('&[data-color=\"warning\"]', outline(\"warning.ring\")),\n\t\t\t\t\t\t\twhen('&[data-color=\"danger\"]', outline(\"danger.ring\")),\n\t\t\t\t\t\t]),\n\n\t\t\t\t\t\twhen(\"&:has(~ input:disabled)\", [cursor(\"not-allowed\"), opacity(50)]),\n\n\t\t\t\t\t\tparts?.box,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t<CheckIcon />\n\t\t\t\t\t<MinusIcon />\n\t\t\t\t</span>\n\t\t\t\t<input type=\"checkbox\" {...rest} mix={[visuallyHidden(), mix]} />\n\t\t\t\t{children}\n\t\t\t</label>\n\t\t);\n\t};\n}\n"
10
+ "content": "/**\n * A styled native checkbox: an `<input type=\"checkbox\">` paired with a\n * decorative glyph box that renders its check or dash mark purely from the\n * input's own state, wrapped in a `<label>` so clicking or tapping anywhere\n * in the row — box, glyph, or label text alike — toggles the control.\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 { CheckIcon, MinusIcon } from \"@sdxc/icons\";\nimport { visuallyHidden } from \"@sdxc/u/a11y\";\nimport { bg, border, fg, outline } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor, mergeMix } from \"@sdxc/u/general\";\nimport { block, center, hidden, hstack, relative, shrink } from \"@sdxc/u/layout\";\nimport { bs, is } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { warnIfNoAccessibleName } from \"@sdxc/ui/utils\";\n\n/** Semantic color role {@link Checkbox} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: Checkbox.Color = \"neutral\";\n\n/**\n * Prop types for {@link Checkbox}.\n */\nexport namespace Checkbox {\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 * Per-part styling for the elements this convenience wrapper composes\n\t * internally alongside its own host `<input>`.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the decorative box rendering the checkmark or dash glyph. */\n\t\tbox?: TagProps<\"span\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link Checkbox}. Extends every native `<input>`\n\t * attribute except `type`, fixed to `\"checkbox\"`; `mix` styles that same\n\t * `<input>` host, and `role` is narrowed to what a checkbox input allows.\n\t */\n\texport interface Props extends Omit<TagProps<\"input\">, \"type\" | \"role\"> {\n\t\t/** ARIA role override, restricted to what a checkbox input may carry. */\n\t\trole?: \"checkbox\" | \"button\" | \"menuitemcheckbox\" | \"option\" | \"switch\";\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/**\n\t\t * Label content rendered after the box, inside the same native\n\t\t * `<label>` wrapping the row — clicking any of it toggles the checkbox\n\t\t * natively, with no separate `htmlFor`/`id` pair required.\n\t\t */\n\t\tchildren?: RemixNode;\n\t\t/** Per-part styling for this wrapper's internally composed elements. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * The box precedes the input in source order so its `:has(~ input:…)` rules\n * can read state directly off it, keeping the whole control CSS-driven;\n * `shrink(0)` also keeps the box square regardless of label length.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the checkbox's markup.\n * @example\n * <Checkbox name=\"terms\" required>{t(\"signup.acceptTerms\")}</Checkbox>\n * @example\n * <Checkbox color=\"danger\" checked={row.flagged} aria-label={t(\"table.flagRow\")} />\n * @example\n * <Checkbox disabled defaultChecked>{t(\"settings.legacyOptIn\")}</Checkbox>\n */\nexport function Checkbox(handle: Handle<Checkbox.Props>) {\n\treturn () => {\n\t\tlet { color, children, parts, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\twarnIfNoAccessibleName(\n\t\t\thandle.props,\n\t\t\tchildren,\n\t\t\t\"Checkbox: a checkbox with no visible label text needs an `aria-label` describing what it toggles — assistive technology has no accessible name to announce otherwise.\",\n\t\t);\n\n\t\treturn (\n\t\t\t<label mix={[relative(), hstack({ gap: 2, align: \"center\" })]}>\n\t\t\t\t<span\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tdata-slot=\"box\"\n\t\t\t\t\tdata-color={resolvedColor}\n\t\t\t\t\tmix={[\n\t\t\t\t\t\tcenter(),\n\t\t\t\t\t\tis(\"var(--ui-checkbox-size, 1.25rem)\"),\n\t\t\t\t\t\tbs(\"var(--ui-checkbox-size, 1.25rem)\"),\n\t\t\t\t\t\tshrink(0),\n\t\t\t\t\t\trounded(\"sm\"),\n\t\t\t\t\t\tborder({ width: 2, color: \"neutral.strong\" }),\n\t\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\t\tinteractiveTransition(),\n\n\t\t\t\t\t\twhen(\"& > svg\", [hidden(), is(\"0.75rem\"), bs(\"0.75rem\")]),\n\t\t\t\t\t\twhen(\"&:has(~ input:checked) > svg:first-child\", block()),\n\t\t\t\t\t\twhen(\"&:has(~ input:indeterminate) > svg:last-child\", block()),\n\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t'&[data-color=\"brand\"]',\n\t\t\t\t\t\t\twhen(\"&:has(~ input:checked), &:has(~ input:indeterminate)\", [\n\t\t\t\t\t\t\t\tborder(\"brand.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]),\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t'&[data-color=\"neutral\"]',\n\t\t\t\t\t\t\twhen(\"&:has(~ input:checked), &:has(~ input:indeterminate)\", [\n\t\t\t\t\t\t\t\tborder(\"neutral.solid\"),\n\t\t\t\t\t\t\t\tbg(\"neutral.solid\"),\n\t\t\t\t\t\t\t\tfg(\"neutral.onSolid\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t'&[data-color=\"success\"]',\n\t\t\t\t\t\t\twhen(\"&:has(~ input:checked), &:has(~ input:indeterminate)\", [\n\t\t\t\t\t\t\t\tborder(\"success.solid\"),\n\t\t\t\t\t\t\t\tbg(\"success.solid\"),\n\t\t\t\t\t\t\t\tfg(\"success.onSolid\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t'&[data-color=\"warning\"]',\n\t\t\t\t\t\t\twhen(\"&:has(~ input:checked), &:has(~ input:indeterminate)\", [\n\t\t\t\t\t\t\t\tborder(\"warning.solid\"),\n\t\t\t\t\t\t\t\tbg(\"warning.solid\"),\n\t\t\t\t\t\t\t\tfg(\"warning.onSolid\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t'&[data-color=\"danger\"]',\n\t\t\t\t\t\t\twhen(\"&:has(~ input:checked), &:has(~ input:indeterminate)\", [\n\t\t\t\t\t\t\t\tborder(\"danger.solid\"),\n\t\t\t\t\t\t\t\tbg(\"danger.solid\"),\n\t\t\t\t\t\t\t\tfg(\"danger.onSolid\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\twhen(\"&:has(~ input:focus-visible)\", [\n\t\t\t\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\t\t\t\twhen('&[data-color=\"neutral\"]', outline(\"neutral.ring\")),\n\t\t\t\t\t\t\twhen('&[data-color=\"success\"]', outline(\"success.ring\")),\n\t\t\t\t\t\t\twhen('&[data-color=\"warning\"]', outline(\"warning.ring\")),\n\t\t\t\t\t\t\twhen('&[data-color=\"danger\"]', outline(\"danger.ring\")),\n\t\t\t\t\t\t]),\n\n\t\t\t\t\t\twhen(\"&:has(~ input:disabled)\", [cursor(\"not-allowed\"), opacity(50)]),\n\n\t\t\t\t\t\tparts?.box,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t<CheckIcon />\n\t\t\t\t\t<MinusIcon />\n\t\t\t\t</span>\n\t\t\t\t<input type=\"checkbox\" {...rest} mix={mergeMix(visuallyHidden(), mix)} />\n\t\t\t\t{children}\n\t\t\t</label>\n\t\t);\n\t};\n}\n"
11
11
  },
12
12
  "test": {
13
13
  "path": "checkbox.test.tsx",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "combobox",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [
5
5
  "input"
6
6
  ],
@@ -9,7 +9,7 @@
9
9
  ],
10
10
  "source": {
11
11
  "path": "combobox.tsx",
12
- "content": "/**\n * A single-line text control paired with a native list of suggested values: a\n * {@link ComboBox.Group} row housing the {@link ComboBox.Input} control and a\n * trailing {@link ComboBox.Button} disclosure glyph, all stacked beneath a\n * caption or above supporting copy in a single column with a small gap. The\n * text control builds on {@link Input} for its box, color, and interaction\n * states, and pairs with a plain `<datalist>` of `<option>`s through its own\n * `list` attribute — the browser renders and filters that list entirely on\n * its own, with no styling opportunity across the suggestions themselves.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { ChevronDownIcon } from \"@sdxc/icons\";\nimport { bg, fg, outline } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { center, hstack, relative, spacer, vstack } from \"@sdxc/u/layout\";\nimport { bs, is, mis, pie } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\n\nimport { hitArea } from \"@sdxc/ui/styles\";\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { warnIfNoAccessibleLabel } from \"@sdxc/ui/utils\";\n\nimport { Input } from \"@sdxc/ui/input\";\n\n/**\n * Native `<button>` `type` {@link ComboBox.Button} falls back to when a\n * consumer omits one, keeping a click from submitting a surrounding\n * `<form>` the way a bare `<button>`'s own default type otherwise would.\n */\nconst DEFAULT_BUTTON_TYPE: NonNullable<ComboBox.ButtonProps[\"type\"]> = \"button\";\n\n/**\n * Prop types for {@link ComboBox} and its compound parts.\n */\nexport namespace ComboBox {\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * `children` composes this control's parts — typically a caption, the\n\t * {@link ComboBox.Group} row, a `<datalist>`, and supporting copy.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * `children` composes {@link ComboBox.Input} and {@link ComboBox.Button}\n\t * into one visual row.\n\t */\n\texport interface GroupProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every prop {@link Input.Props} accepts, unchanged — a type alias, since\n\t * {@link Input.Props} resolves through a conditional type only a type\n\t * alias can express. Pass `list` with a `<datalist>` id to wire suggestions.\n\t */\n\texport type InputProps = Input.Props;\n\n\t/**\n\t * Every native `<button>` attribute except `children`, which stays fixed to\n\t * this button's own disclosure glyph, plus the `mix` passthrough. `type`\n\t * defaults to {@link DEFAULT_BUTTON_TYPE}.\n\t */\n\texport interface ButtonProps extends Omit<TagProps<\"button\">, \"children\"> {}\n}\n\n/**\n * Renders a plain host stacking this control's compound parts — a caption,\n * the {@link ComboBox.Group} row, a `<datalist>` of suggested values, and\n * supporting copy — in a single column with a small gap between them.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <ComboBox>\n * \t<Label htmlFor=\"fruit\">{t(\"form.fruit.label\")}</Label>\n * \t<ComboBox.Group>\n * \t\t<ComboBox.Input id=\"fruit\" name=\"fruit\" list=\"fruit-options\" />\n * \t\t<ComboBox.Button aria-label={t(\"form.fruit.toggle\")} />\n * \t</ComboBox.Group>\n * \t<datalist id=\"fruit-options\">\n * \t\t<option value=\"Apple\" />\n * \t\t<option value=\"Banana\" />\n * \t</datalist>\n * </ComboBox>\n */\nexport function ComboBox(handle: Handle<ComboBox.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <div {...rest} data-slot=\"combobox\" mix={[vstack({ gap: 1 }), mix]} />;\n\t};\n}\n\n/**\n * Renders {@link ComboBox}'s control row: a plain flex host laying\n * {@link ComboBox.Input} and {@link ComboBox.Button} side by side, the\n * button pulled back over the input's padding so they read as one field.\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 * <ComboBox.Group>\n * \t<ComboBox.Input id=\"fruit\" list=\"fruit-options\" />\n * \t<ComboBox.Button aria-label={t(\"form.fruit.toggle\")} />\n * </ComboBox.Group>\n */\nComboBox.Group = function ComboBoxGroup(handle: Handle<ComboBox.GroupProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <div {...rest} data-slot=\"combobox-group\" mix={[hstack({ align: \"center\" }), mix]} />;\n\t};\n};\n\n/**\n * Renders {@link ComboBox}'s text control: an {@link Input} that grows to\n * fill its row, reserves inline-end padding for {@link ComboBox.Button}'s\n * glyph, and carries every {@link Input} interaction state unchanged.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <ComboBox.Input id=\"fruit\" name=\"fruit\" list=\"fruit-options\" />\n * @example\n * <ComboBox.Input aria-label={t(\"form.country.label\")} color=\"brand\" list=\"country-options\" />\n */\nComboBox.Input = function ComboBoxInput(handle: Handle<ComboBox.InputProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <Input {...rest} mix={[spacer(), pie(9), mix]} />;\n\t};\n};\n\n/**\n * Renders {@link ComboBox}'s trailing disclosure glyph: a native `<button>`\n * pulled back over {@link ComboBox.Input}'s padding so it reads as part of\n * the same field, its chevron marked `aria-hidden` since it carries no text.\n * Its pointer target grows to `--ui-target-size` past its drawn 28px box.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the button's markup.\n * @example\n * <ComboBox.Button aria-label={t(\"form.fruit.toggle\")} />\n */\nComboBox.Button = function ComboBoxButton(handle: Handle<ComboBox.ButtonProps>) {\n\treturn () => {\n\t\tlet { type, mix, ...rest } = handle.props;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t\"ComboBox.Button: this button needs an `aria-label` describing what it does — its content is a decorative glyph with no accessible name of its own.\",\n\t\t);\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype={type ?? DEFAULT_BUTTON_TYPE}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tcenter(),\n\t\t\t\t\trelative(),\n\t\t\t\t\thitArea(),\n\t\t\t\t\tis(\"1.75rem\"),\n\t\t\t\t\tbs(\"1.75rem\"),\n\t\t\t\t\trounded(\"sm\"),\n\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\twhen(\"& svg\", [is(\"1rem\"), bs(\"1rem\")]),\n\t\t\t\t\twhen(\"&:hover\", bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 0 })),\n\t\t\t\t\tmis(\"-2rem\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<ChevronDownIcon />\n\t\t\t</button>\n\t\t);\n\t};\n};\n"
12
+ "content": "/**\n * A single-line text control paired with a native list of suggested values: a\n * {@link ComboBox.Group} row housing the {@link ComboBox.Input} control and a\n * trailing {@link ComboBox.Button} disclosure glyph, all stacked beneath a\n * caption or above supporting copy in a single column with a small gap. The\n * text control builds on {@link Input} for its box, color, and interaction\n * states, and pairs with a plain `<datalist>` of `<option>`s through its own\n * `list` attribute — the browser renders and filters that list entirely on\n * its own, with no styling opportunity across the suggestions themselves.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { ChevronDownIcon } from \"@sdxc/icons\";\nimport { bg, fg, outline } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { mergeMix } from \"@sdxc/u/general\";\nimport { center, hstack, relative, spacer, vstack } from \"@sdxc/u/layout\";\nimport { bs, is, mis, pie } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\n\nimport { hitArea } from \"@sdxc/ui/styles\";\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { warnIfNoAccessibleLabel } from \"@sdxc/ui/utils\";\n\nimport { Input } from \"@sdxc/ui/input\";\n\n/**\n * Native `<button>` `type` {@link ComboBox.Button} falls back to when a\n * consumer omits one, keeping a click from submitting a surrounding\n * `<form>` the way a bare `<button>`'s own default type otherwise would.\n */\nconst DEFAULT_BUTTON_TYPE: NonNullable<ComboBox.ButtonProps[\"type\"]> = \"button\";\n\n/**\n * Prop types for {@link ComboBox} and its compound parts.\n */\nexport namespace ComboBox {\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * `children` composes this control's parts — typically a caption, the\n\t * {@link ComboBox.Group} row, a `<datalist>`, and supporting copy.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * `children` composes {@link ComboBox.Input} and {@link ComboBox.Button}\n\t * into one visual row.\n\t */\n\texport interface GroupProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every prop {@link Input.Props} accepts, unchanged — a type alias, since\n\t * {@link Input.Props} resolves through a conditional type only a type\n\t * alias can express. Pass `list` with a `<datalist>` id to wire suggestions.\n\t */\n\texport type InputProps = Input.Props;\n\n\t/**\n\t * Every native `<button>` attribute except `children`, which stays fixed to\n\t * this button's own disclosure glyph, plus the `mix` passthrough. `type`\n\t * defaults to {@link DEFAULT_BUTTON_TYPE}.\n\t */\n\texport interface ButtonProps extends Omit<TagProps<\"button\">, \"children\"> {}\n}\n\n/**\n * Renders a plain host stacking this control's compound parts — a caption,\n * the {@link ComboBox.Group} row, a `<datalist>` of suggested values, and\n * supporting copy — in a single column with a small gap between them.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <ComboBox>\n * \t<Label htmlFor=\"fruit\">{t(\"form.fruit.label\")}</Label>\n * \t<ComboBox.Group>\n * \t\t<ComboBox.Input id=\"fruit\" name=\"fruit\" list=\"fruit-options\" />\n * \t\t<ComboBox.Button aria-label={t(\"form.fruit.toggle\")} />\n * \t</ComboBox.Group>\n * \t<datalist id=\"fruit-options\">\n * \t\t<option value=\"Apple\" />\n * \t\t<option value=\"Banana\" />\n * \t</datalist>\n * </ComboBox>\n */\nexport function ComboBox(handle: Handle<ComboBox.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <div {...rest} data-slot=\"combobox\" mix={mergeMix(vstack({ gap: 1 }), mix)} />;\n\t};\n}\n\n/**\n * Renders {@link ComboBox}'s control row: a plain flex host laying\n * {@link ComboBox.Input} and {@link ComboBox.Button} side by side, the\n * button pulled back over the input's padding so they read as one field.\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 * <ComboBox.Group>\n * \t<ComboBox.Input id=\"fruit\" list=\"fruit-options\" />\n * \t<ComboBox.Button aria-label={t(\"form.fruit.toggle\")} />\n * </ComboBox.Group>\n */\nComboBox.Group = function ComboBoxGroup(handle: Handle<ComboBox.GroupProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"combobox-group\" mix={mergeMix(hstack({ align: \"center\" }), mix)} />\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link ComboBox}'s text control: an {@link Input} that grows to\n * fill its row, reserves inline-end padding for {@link ComboBox.Button}'s\n * glyph, and carries every {@link Input} interaction state unchanged.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <ComboBox.Input id=\"fruit\" name=\"fruit\" list=\"fruit-options\" />\n * @example\n * <ComboBox.Input aria-label={t(\"form.country.label\")} color=\"brand\" list=\"country-options\" />\n */\nComboBox.Input = function ComboBoxInput(handle: Handle<ComboBox.InputProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <Input {...rest} mix={mergeMix([spacer(), pie(9)], mix)} />;\n\t};\n};\n\n/**\n * Renders {@link ComboBox}'s trailing disclosure glyph: a native `<button>`\n * pulled back over {@link ComboBox.Input}'s padding so it reads as part of\n * the same field, its chevron marked `aria-hidden` since it carries no text.\n * Its pointer target grows to `--ui-target-size` past its drawn 28px box.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the button's markup.\n * @example\n * <ComboBox.Button aria-label={t(\"form.fruit.toggle\")} />\n */\nComboBox.Button = function ComboBoxButton(handle: Handle<ComboBox.ButtonProps>) {\n\treturn () => {\n\t\tlet { type, mix, ...rest } = handle.props;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t\"ComboBox.Button: this button needs an `aria-label` describing what it does — its content is a decorative glyph with no accessible name of its own.\",\n\t\t);\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype={type ?? DEFAULT_BUTTON_TYPE}\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\t\tcenter(),\n\t\t\t\t\t\trelative(),\n\t\t\t\t\t\thitArea(),\n\t\t\t\t\t\tis(\"1.75rem\"),\n\t\t\t\t\t\tbs(\"1.75rem\"),\n\t\t\t\t\t\trounded(\"sm\"),\n\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\twhen(\"& svg\", [is(\"1rem\"), bs(\"1rem\")]),\n\t\t\t\t\t\twhen(\"&:hover\", bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 0 })),\n\t\t\t\t\t\tmis(\"-2rem\"),\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<ChevronDownIcon />\n\t\t\t</button>\n\t\t);\n\t};\n};\n"
13
13
  },
14
14
  "test": null
15
15
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "command",
3
- "changedIn": "2026.10.20",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Command"
7
7
  ],
8
8
  "source": {
9
9
  "path": "command.tsx",
10
- "content": "/**\n * A bordered panel for searching and choosing among a list of actions:\n * {@link Command.Input} holds the query row, {@link Command.List} scrolls\n * through {@link Command.Item} rows, and {@link Command.Empty} holds a\n * message for when nothing matches. Its baseline rendering is a plain, fully\n * visible list of options, styled and ready to compose; the as-you-type\n * filtering and match highlighting a search experience needs arrive through\n * a separate opt-in behavior a consumer attaches.\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, borderEdge, fg, outline, outlineStyle } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor, raw } from \"@sdxc/u/general\";\nimport { hstack, shrink, vstack } from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { bs, is, maxBs, pb, pi } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { text, textAlign } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { concentricRadius, floatingSurface, surfacePadding } from \"@sdxc/ui/styles\";\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\n\n/** `role=\"listbox\"` applied to {@link Command.List} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_LIST_ROLE = \"listbox\";\n\n/** `role=\"option\"` applied to {@link Command.Item} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_ITEM_ROLE = \"option\";\n\n/**\n * Prop types for {@link Command} and its compound parts.\n */\nexport namespace Command {\n\t/**\n\t * Props accepted by {@link Command}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** The panel's compound parts: {@link Command.Input}, {@link Command.List}, {@link Command.Empty}. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Every native `<input>` attribute, unchanged, plus the `mix` passthrough,\n\t * styling the control itself — a type alias, since the native input prop\n\t * type resolves through a conditional type only a type alias can express.\n\t */\n\texport type InputProps = TagProps<\"input\">;\n\n\t/**\n\t * Props accepted by {@link Command.List}.\n\t */\n\texport interface ListProps extends TagProps<\"div\"> {\n\t\t/** The {@link Command.Item} rows (and, once nothing matches, {@link Command.Empty}) to scroll through. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Command.Item}.\n\t */\n\texport interface ItemProps extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Plain-text value identifying this row's content. A paired filter\n\t\t * behavior matches typed text against this value directly, so it stays\n\t\t * required even when the visible content is already plain text.\n\t\t */\n\t\tvalue: string;\n\t\t/** The row's visible content: a label, and optionally a leading icon or trailing hint. */\n\t\tchildren?: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Command.Empty}.\n\t */\n\texport interface EmptyProps extends TagProps<\"div\"> {}\n}\n\n/**\n * Renders the panel's root host: an elevated `<div>` rounded concentric\n * with {@link Command.Item}'s corners, stacking its compound parts in a\n * column and clipping {@link Command.List}'s scrolled content to that radius.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the panel's markup.\n * @example\n * <Command aria-label={t(\"command.label\")}>\n * \t<Command.Input aria-label={t(\"command.label\")} placeholder={t(\"command.placeholder\")} />\n * \t<Command.List>\n * \t\t<Command.Item value=\"new-file\">{t(\"command.newFile\")}</Command.Item>\n * \t\t<Command.Item value=\"new-folder\">{t(\"command.newFolder\")}</Command.Item>\n * \t</Command.List>\n * \t<Command.Empty>{t(\"command.empty\")}</Command.Empty>\n * </Command>\n */\nexport function Command(handle: Handle<Command.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=\"command\"\n\t\t\t\tmix={[\n\t\t\t\t\tfloatingSurface(),\n\t\t\t\t\traw({ borderRadius: concentricRadius(surfacePadding(1)) }),\n\t\t\t\t\tvstack(),\n\t\t\t\t\toverflow(\"hidden\"),\n\t\t\t\t\tfg(\"neutral.emphasis\"),\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 panel's query row: a `<div>` bordered along its block-end\n * edge wrapping a native `<input>` sized to the row's full padding and\n * height, marked `data-command-input` for a paired filter mixin to read.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the query row's markup.\n * @example\n * <Command.Input aria-label={t(\"command.label\")} placeholder={t(\"command.placeholder\")} />\n * @example\n * <Command.Input aria-label={t(\"command.label\")} value={query} disabled />\n */\nCommand.Input = function CommandInput(handle: Handle<Command.InputProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div data-slot=\"input-wrapper\" mix={borderEdge(\"block-end\", { color: \"neutral\", width: 1 })}>\n\t\t\t\t<input\n\t\t\t\t\t{...rest}\n\t\t\t\t\tdata-slot=\"input\"\n\t\t\t\t\tdata-command-input\n\t\t\t\t\tmix={[\n\t\t\t\t\t\tis(\"full\"),\n\t\t\t\t\t\tbs(\"3.5rem\"),\n\t\t\t\t\t\tpi(3),\n\t\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t\twhen(\"&::placeholder\", fg(\"neutral.muted\")),\n\t\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t\twhen(\"&:disabled\", [cursor(\"not-allowed\"), opacity(50)]),\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\t\toutlineStyle(\"none\"),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t]}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders the panel's scrollable option region: a `<div>` carrying the\n * `listbox` role, capped at a fixed block size, its small inline padding\n * leaving room for a selected {@link Command.Item}'s own rounded corners.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the option region's markup.\n * @example\n * <Command.List>\n * \t<Command.Item value=\"new-file\">{t(\"command.newFile\")}</Command.Item>\n * \t<Command.Item value=\"new-folder\">{t(\"command.newFolder\")}</Command.Item>\n * </Command.List>\n */\nCommand.List = function CommandList(handle: Handle<Command.ListProps>) {\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=\"list\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_LIST_ROLE }),\n\t\t\t\t\tmaxBs(\"18rem\"),\n\t\t\t\t\toverflow(\"auto\"),\n\t\t\t\t\tpi(surfacePadding(1)),\n\t\t\t\t\t/**\n\t\t\t\t\t * The list spends its block padding only while a row is visible, so a filter hiding every\n\t\t\t\t\t * row leaves the empty-state message centered.\n\t\t\t\t\t */\n\t\t\t\t\twhen('&:has([data-slot=\"item\"]:not([hidden]))', pb(2)),\n\t\t\t\t\toutlineStyle(\"none\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a single row: a `<div>` carrying the `option` role, its `value`\n * mirrored onto `data-value` for a paired filter behavior to read. Nest a\n * `<button>` or `<a>` in `children` for native activation.\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 * <Command.Item value=\"new-file\">{t(\"command.newFile\")}</Command.Item>\n * @example\n * <Command.Item value=\"archived-project\" aria-disabled=\"true\">\n * \t{t(\"command.archivedProject\")}\n * </Command.Item>\n */\nCommand.Item = function CommandItem(handle: Handle<Command.ItemProps>) {\n\treturn () => {\n\t\tlet { value, children, mix, ...rest } = handle.props;\n\n\t\tif (import.meta.env?.DEV && !value) {\n\t\t\tconsole.warn(\n\t\t\t\t'Command.Item: needs a \"value\" — a filter behavior matches typed text 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-value={value}\n\t\t\t\tmix={[\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tattrs({ role: DEFAULT_ITEM_ROLE }),\n\t\t\t\t\thstack({ gap: 2, align: \"center\" }),\n\t\t\t\t\t/**\n\t\t\t\t\t * A glyph anywhere in the row is sized against the row's text and holds that size when the\n\t\t\t\t\t * row runs short; the default `flex-shrink: 1` would squeeze each glyph by its own row's\n\t\t\t\t\t * overrun and leave the column of glyphs ragged.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"& svg\", [shrink(), is(4), bs(4)]),\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tpi(2),\n\t\t\t\t\tpb(2),\n\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * The active row is a cursor tinted far enough off the surface to find at a glance, while\n\t\t\t\t\t * its text keeps reading as text. Pointer and cursor states use mutually exclusive selectors,\n\t\t\t\t\t * so the row under the pointer stays marked active whichever order the layers land in.\n\t\t\t\t\t */\n\t\t\t\t\twhen('&:hover:not([aria-selected=\"true\"])', bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\twhen('&:active:not([aria-selected=\"true\"])', bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\twhen('&:focus:not([aria-selected=\"true\"])', bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\twhen('&[aria-selected=\"true\"]', [bg(\"brand.bg-tint-hover\"), fg(\"neutral.emphasis\")]),\n\t\t\t\t\twhen('&[aria-selected=\"true\"]:hover', bg(\"brand.bg-tint-pressed\")),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', opacity(50)),\n\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\toutlineStyle(\"none\"),\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 panel's no-match message: a centered, muted passage of small\n * text filling {@link Command.List}'s content area, carrying a\n * `data-command-empty` marker a paired filter behavior reads to toggle it.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the message's markup.\n * @example\n * <Command.Empty>{t(\"command.empty\")}</Command.Empty>\n */\nCommand.Empty = function CommandEmpty(handle: Handle<Command.EmptyProps>) {\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=\"empty\"\n\t\t\t\tdata-command-empty\n\t\t\t\tmix={[pi(3), pb(6), textAlign(\"center\"), fg(\"neutral.muted\"), text(\"sm\"), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
10
+ "content": "/**\n * A bordered panel for searching and choosing among a list of actions:\n * {@link Command.Input} holds the query row, {@link Command.List} scrolls\n * through {@link Command.Item} rows, and {@link Command.Empty} holds a\n * message for when nothing matches. Its baseline rendering is a plain, fully\n * visible list of options, styled and ready to compose; the as-you-type\n * filtering and match highlighting a search experience needs arrive through\n * a separate opt-in behavior a consumer attaches.\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, borderEdge, fg, outline, outlineStyle } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor, raw, mergeMix } from \"@sdxc/u/general\";\nimport { hstack, shrink, vstack } from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { bs, is, maxBs, pb, pi } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { text, textAlign } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { concentricRadius, floatingSurface, surfacePadding } from \"@sdxc/ui/styles\";\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\n\n/** `role=\"listbox\"` applied to {@link Command.List} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_LIST_ROLE = \"listbox\";\n\n/** `role=\"option\"` applied to {@link Command.Item} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_ITEM_ROLE = \"option\";\n\n/**\n * Prop types for {@link Command} and its compound parts.\n */\nexport namespace Command {\n\t/**\n\t * Props accepted by {@link Command}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** The panel's compound parts: {@link Command.Input}, {@link Command.List}, {@link Command.Empty}. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Every native `<input>` attribute, unchanged, plus the `mix` passthrough,\n\t * styling the control itself — a type alias, since the native input prop\n\t * type resolves through a conditional type only a type alias can express.\n\t */\n\texport type InputProps = TagProps<\"input\">;\n\n\t/**\n\t * Props accepted by {@link Command.List}.\n\t */\n\texport interface ListProps extends TagProps<\"div\"> {\n\t\t/** The {@link Command.Item} rows (and, once nothing matches, {@link Command.Empty}) to scroll through. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Command.Item}.\n\t */\n\texport interface ItemProps extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Plain-text value identifying this row's content. A paired filter\n\t\t * behavior matches typed text against this value directly, so it stays\n\t\t * required even when the visible content is already plain text.\n\t\t */\n\t\tvalue: string;\n\t\t/** The row's visible content: a label, and optionally a leading icon or trailing hint. */\n\t\tchildren?: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Command.Empty}.\n\t */\n\texport interface EmptyProps extends TagProps<\"div\"> {}\n}\n\n/**\n * Renders the panel's root host: an elevated `<div>` rounded concentric\n * with {@link Command.Item}'s corners, stacking its compound parts in a\n * column and clipping {@link Command.List}'s scrolled content to that radius.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the panel's markup.\n * @example\n * <Command aria-label={t(\"command.label\")}>\n * \t<Command.Input aria-label={t(\"command.label\")} placeholder={t(\"command.placeholder\")} />\n * \t<Command.List>\n * \t\t<Command.Item value=\"new-file\">{t(\"command.newFile\")}</Command.Item>\n * \t\t<Command.Item value=\"new-folder\">{t(\"command.newFolder\")}</Command.Item>\n * \t</Command.List>\n * \t<Command.Empty>{t(\"command.empty\")}</Command.Empty>\n * </Command>\n */\nexport function Command(handle: Handle<Command.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=\"command\"\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tfloatingSurface(),\n\t\t\t\t\t\traw({ borderRadius: concentricRadius(surfacePadding(1)) }),\n\t\t\t\t\t\tvstack(),\n\t\t\t\t\t\toverflow(\"hidden\"),\n\t\t\t\t\t\tfg(\"neutral.emphasis\"),\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 the panel's query row: a `<div>` bordered along its block-end\n * edge wrapping a native `<input>` sized to the row's full padding and\n * height, marked `data-command-input` for a paired filter mixin to read.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the query row's markup.\n * @example\n * <Command.Input aria-label={t(\"command.label\")} placeholder={t(\"command.placeholder\")} />\n * @example\n * <Command.Input aria-label={t(\"command.label\")} value={query} disabled />\n */\nCommand.Input = function CommandInput(handle: Handle<Command.InputProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div data-slot=\"input-wrapper\" mix={borderEdge(\"block-end\", { color: \"neutral\", width: 1 })}>\n\t\t\t\t<input\n\t\t\t\t\t{...rest}\n\t\t\t\t\tdata-slot=\"input\"\n\t\t\t\t\tdata-command-input\n\t\t\t\t\tmix={mergeMix(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tis(\"full\"),\n\t\t\t\t\t\t\tbs(\"3.5rem\"),\n\t\t\t\t\t\t\tpi(3),\n\t\t\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t\t\twhen(\"&::placeholder\", fg(\"neutral.muted\")),\n\t\t\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t\t\twhen(\"&:disabled\", [cursor(\"not-allowed\"), opacity(50)]),\n\t\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\t\t\toutlineStyle(\"none\"),\n\t\t\t\t\t\t],\n\t\t\t\t\t\tmix,\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders the panel's scrollable option region: a `<div>` carrying the\n * `listbox` role, capped at a fixed block size, its small inline padding\n * leaving room for a selected {@link Command.Item}'s own rounded corners.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the option region's markup.\n * @example\n * <Command.List>\n * \t<Command.Item value=\"new-file\">{t(\"command.newFile\")}</Command.Item>\n * \t<Command.Item value=\"new-folder\">{t(\"command.newFolder\")}</Command.Item>\n * </Command.List>\n */\nCommand.List = function CommandList(handle: Handle<Command.ListProps>) {\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=\"list\"\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tattrs({ role: DEFAULT_LIST_ROLE }),\n\t\t\t\t\t\tmaxBs(\"18rem\"),\n\t\t\t\t\t\toverflow(\"auto\"),\n\t\t\t\t\t\tpi(surfacePadding(1)),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The list spends its block padding only while a row is visible, so a filter hiding every\n\t\t\t\t\t\t * row leaves the empty-state message centered.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen('&:has([data-slot=\"item\"]:not([hidden]))', pb(2)),\n\t\t\t\t\t\toutlineStyle(\"none\"),\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 single row: a `<div>` carrying the `option` role, its `value`\n * mirrored onto `data-value` for a paired filter behavior to read. Nest a\n * `<button>` or `<a>` in `children` for native activation.\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 * <Command.Item value=\"new-file\">{t(\"command.newFile\")}</Command.Item>\n * @example\n * <Command.Item value=\"archived-project\" aria-disabled=\"true\">\n * \t{t(\"command.archivedProject\")}\n * </Command.Item>\n */\nCommand.Item = function CommandItem(handle: Handle<Command.ItemProps>) {\n\treturn () => {\n\t\tlet { value, children, mix, ...rest } = handle.props;\n\n\t\tif (import.meta.env?.DEV && !value) {\n\t\t\tconsole.warn(\n\t\t\t\t'Command.Item: needs a \"value\" — a filter behavior matches typed text 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-value={value}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\t\tattrs({ role: DEFAULT_ITEM_ROLE }),\n\t\t\t\t\t\thstack({ gap: 2, align: \"center\" }),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * A glyph anywhere in the row is sized against the row's text and holds that size when the\n\t\t\t\t\t\t * row runs short; the default `flex-shrink: 1` would squeeze each glyph by its own row's\n\t\t\t\t\t\t * overrun and leave the column of glyphs ragged.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen(\"& svg\", [shrink(), is(4), bs(4)]),\n\t\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\t\tpi(2),\n\t\t\t\t\t\tpb(2),\n\t\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The active row is a cursor tinted far enough off the surface to find at a glance, while\n\t\t\t\t\t\t * its text keeps reading as text. Pointer and cursor states use mutually exclusive selectors,\n\t\t\t\t\t\t * so the row under the pointer stays marked active whichever order the layers land in.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen('&:hover:not([aria-selected=\"true\"])', bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\t\twhen('&:active:not([aria-selected=\"true\"])', bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\t\twhen('&:focus:not([aria-selected=\"true\"])', bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\t\twhen('&[aria-selected=\"true\"]', [bg(\"brand.bg-tint-hover\"), fg(\"neutral.emphasis\")]),\n\t\t\t\t\t\twhen('&[aria-selected=\"true\"]:hover', bg(\"brand.bg-tint-pressed\")),\n\t\t\t\t\t\twhen('&[aria-disabled=\"true\"]', opacity(50)),\n\t\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\t\toutlineStyle(\"none\"),\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 the panel's no-match message: a centered, muted passage of small\n * text filling {@link Command.List}'s content area, carrying a\n * `data-command-empty` marker a paired filter behavior reads to toggle it.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the message's markup.\n * @example\n * <Command.Empty>{t(\"command.empty\")}</Command.Empty>\n */\nCommand.Empty = function CommandEmpty(handle: Handle<Command.EmptyProps>) {\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=\"empty\"\n\t\t\t\tdata-command-empty\n\t\t\t\tmix={mergeMix([pi(3), pb(6), textAlign(\"center\"), fg(\"neutral.muted\"), text(\"sm\")], mix)}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
11
11
  },
12
12
  "test": null
13
13
  }
@@ -1,16 +1,20 @@
1
1
  {
2
2
  "name": "confirm",
3
- "changedIn": "2026.10.2",
3
+ "changedIn": "2026.11.3",
4
4
  "dependencies": [
5
5
  "alert-dialog",
6
- "button"
6
+ "button",
7
+ "input",
8
+ "label"
7
9
  ],
8
10
  "exports": [
9
- "Confirm"
11
+ "Confirm",
12
+ "ConfirmPhraseProps",
13
+ "ConfirmPhrase"
10
14
  ],
11
15
  "source": {
12
16
  "path": "confirm.tsx",
13
- "content": "/**\n * A convenience wrapper composing a two-control confirmation prompt in one\n * call: an {@link AlertDialog} panel prefilled with a heading, an optional\n * supporting passage, and a cancel/confirm control pair, so a single\n * consequential decision needs no compound assembly of its own. The\n * confirming control defaults to the semantic danger tone, keeping an\n * irreversible action behind an explicit confirmation step in that tone.\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 { flex, flexCol, gap } from \"@sdxc/u/layout\";\n\nimport type { Button } from \"@sdxc/ui/button\";\n\nimport { AlertDialog } from \"@sdxc/ui/alert-dialog\";\n\n/** Semantic color role {@link Confirm} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: Button.Color = \"danger\";\n\n/** HTTP method a submitting {@link Confirm} falls back to when `form.method` is omitted. */\nconst DEFAULT_METHOD: NonNullable<Confirm.FormProps[\"method\"]> = \"post\";\n\n/**\n * Column gap the wrapping `<form>` re-declares in submit mode, matching the\n * panel's own child gap — the form becomes the panel's single child, so\n * without this the header and footer would lose their spacing.\n */\nconst PANEL_GAP = 6;\n\n/**\n * Prop types for {@link Confirm}.\n */\nexport namespace Confirm {\n\t/**\n\t * Per-part styling for the elements this convenience wrapper composes in\n\t * one call, layered after each part's own built-in styling.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the header slot wrapping the title and description, rendered through {@link AlertDialog.Header}. */\n\t\theader?: TagProps<\"div\">[\"mix\"];\n\t\t/** Styling for the heading, rendered through {@link AlertDialog.Title}, whichever heading tag its ambient level resolves to. */\n\t\ttitle?: TagProps<\"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\">[\"mix\"];\n\t\t/** Styling for the supporting description, rendered through {@link AlertDialog.Description} only when `description` is set. */\n\t\tdescription?: TagProps<\"p\">[\"mix\"];\n\t\t/** Styling for the action row wrapping the cancel and confirm controls, rendered through {@link AlertDialog.Footer}. */\n\t\tfooter?: TagProps<\"div\">[\"mix\"];\n\t\t/** Styling for the control that backs out without confirming, rendered through {@link AlertDialog.Cancel}. */\n\t\tcancel?: TagProps<\"button\">[\"mix\"];\n\t\t/** Styling for the confirming control, rendered through {@link AlertDialog.Action}. */\n\t\taction?: TagProps<\"button\">[\"mix\"];\n\t\t/** Styling for the `<form>` wrapping the panel's content, rendered only in submit mode. */\n\t\tform?: TagProps<\"form\">[\"mix\"];\n\t}\n\n\t/**\n\t * The submission a confirming control performs instead of merely closing\n\t * the panel. Passing this switches {@link Confirm} into submit mode, where\n\t * the form's response is what ends the interruption.\n\t */\n\texport interface FormProps {\n\t\t/** URL the confirmation submits to. Omit to submit to the current URL, as a native `<form>` with no `action` does. */\n\t\taction?: string;\n\t\t/** HTTP method the confirmation submits with. Defaults to {@link DEFAULT_METHOD}, since a confirmed action changes state. */\n\t\tmethod?: \"get\" | \"post\";\n\t\t/**\n\t\t * Hidden inputs submitted along with the confirmation — a CSRF token,\n\t\t * an intent discriminator, the id of the record being acted on. They\n\t\t * render first inside the form, before the panel's own content.\n\t\t */\n\t\tfields?: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Confirm}. `mix` styles the underlying\n\t * {@link AlertDialog} host directly; style the composed header, title,\n\t * description, footer, and controls individually through `parts` instead.\n\t */\n\texport interface Props extends Omit<AlertDialog.Props, \"id\" | \"children\" | \"title\"> {\n\t\t/**\n\t\t * Stable identifier the panel renders as its own `id`; a trigger\n\t\t * elsewhere on the page targets it via `commandfor`/`command=\"show-modal\"`,\n\t\t * and the cancel and confirm controls point back at it automatically.\n\t\t */\n\t\tid: string;\n\t\t/** The panel's heading, rendered through {@link AlertDialog.Title}. */\n\t\ttitle: RemixNode;\n\t\t/**\n\t\t * Supporting copy rendered through {@link AlertDialog.Description}\n\t\t * beneath the title. Omit to render no description.\n\t\t */\n\t\tdescription?: RemixNode;\n\t\t/** Label for the confirming control, rendered through {@link AlertDialog.Action}. */\n\t\tconfirmLabel: RemixNode;\n\t\t/** Label for the control that backs out without confirming, rendered through {@link AlertDialog.Cancel}. */\n\t\tcancelLabel: RemixNode;\n\t\t/** Semantic color for the confirming control. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Button.Color;\n\t\t/**\n\t\t * Submission the confirming control performs. Omitting it leaves\n\t\t * confirming as a close-only action for the page to react to; setting it\n\t\t * submits a real form instead.\n\t\t */\n\t\tform?: FormProps;\n\t\t/** Per-part styling for this wrapper's internally composed elements. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * Composes {@link AlertDialog} into a confirmation prompt, wiring title and\n * description ids to `aria-labelledby`/`aria-describedby`. Omit\n * {@link Confirm.Props.form} to close on confirm, or pass it to submit a real `<form>` instead.\n *\n * @param handle Runtime handle carrying the panel's props and this instance's stable identifier.\n * @returns The render function producing the confirmation prompt's markup.\n * @example\n * <Button commandfor=\"confirm-delete\" command=\"show-modal\" color=\"danger\">{t(\"project.delete\")}</Button>\n * <Confirm\n * \tid=\"confirm-delete\"\n * \ttitle={t(\"project.deleteTitle\")}\n * \tdescription={t(\"project.deleteDescription\")}\n * \tconfirmLabel={t(\"actions.delete\")}\n * \tcancelLabel={t(\"actions.cancel\")}\n * />\n * @example\n * <Confirm\n * \tid=\"publish-post\"\n * \ttitle={t(\"post.publishTitle\")}\n * \tconfirmLabel={t(\"actions.publish\")}\n * \tcancelLabel={t(\"actions.cancel\")}\n * \tcolor=\"brand\"\n * />\n * @example\n * <Confirm\n * \tid=\"revoke-session\"\n * \ttitle={t(\"session.revokeTitle\")}\n * \tconfirmLabel={t(\"actions.revoke\")}\n * \tcancelLabel={t(\"actions.cancel\")}\n * \tform={{ action: revokeUrl, fields: <input type=\"hidden\" name=\"csrf\" value={token} /> }}\n * />\n */\nexport function Confirm(handle: Handle<Confirm.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tid,\n\t\t\ttitle,\n\t\t\tdescription,\n\t\t\tconfirmLabel,\n\t\t\tcancelLabel,\n\t\t\tcolor,\n\t\t\tform,\n\t\t\t\"aria-labelledby\": ariaLabelledByProp,\n\t\t\t\"aria-describedby\": ariaDescribedByProp,\n\t\t\tparts,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\t\tlet titleId = `${handle.id}-title`;\n\t\tlet descriptionId = description ? `${handle.id}-description` : undefined;\n\t\tlet content = (\n\t\t\t<>\n\t\t\t\t<AlertDialog.Header mix={parts?.header}>\n\t\t\t\t\t<AlertDialog.Title id={titleId} mix={parts?.title}>\n\t\t\t\t\t\t{title}\n\t\t\t\t\t</AlertDialog.Title>\n\t\t\t\t\t{description ? (\n\t\t\t\t\t\t<AlertDialog.Description id={descriptionId} mix={parts?.description}>\n\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t</AlertDialog.Description>\n\t\t\t\t\t) : null}\n\t\t\t\t</AlertDialog.Header>\n\t\t\t\t<AlertDialog.Footer mix={parts?.footer}>\n\t\t\t\t\t<AlertDialog.Cancel commandfor={id} mix={parts?.cancel}>\n\t\t\t\t\t\t{cancelLabel}\n\t\t\t\t\t</AlertDialog.Cancel>\n\t\t\t\t\t<AlertDialog.Action\n\t\t\t\t\t\ttype={form ? \"submit\" : undefined}\n\t\t\t\t\t\tcommandfor={form ? undefined : id}\n\t\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\t\tmix={parts?.action}\n\t\t\t\t\t>\n\t\t\t\t\t\t{confirmLabel}\n\t\t\t\t\t</AlertDialog.Action>\n\t\t\t\t</AlertDialog.Footer>\n\t\t\t</>\n\t\t);\n\n\t\treturn (\n\t\t\t<AlertDialog\n\t\t\t\t{...rest}\n\t\t\t\tid={id}\n\t\t\t\taria-labelledby={ariaLabelledByProp ?? titleId}\n\t\t\t\taria-describedby={ariaDescribedByProp ?? descriptionId}\n\t\t\t\tmix={mix}\n\t\t\t>\n\t\t\t\t{form ? (\n\t\t\t\t\t<form\n\t\t\t\t\t\taction={form.action}\n\t\t\t\t\t\tmethod={form.method ?? DEFAULT_METHOD}\n\t\t\t\t\t\tmix={[flex(), flexCol(), gap(PANEL_GAP), parts?.form]}\n\t\t\t\t\t>\n\t\t\t\t\t\t{form.fields}\n\t\t\t\t\t\t{content}\n\t\t\t\t\t</form>\n\t\t\t\t) : (\n\t\t\t\t\tcontent\n\t\t\t\t)}\n\t\t\t</AlertDialog>\n\t\t);\n\t};\n}\n"
17
+ "content": "/**\n * A convenience wrapper composing a two-control confirmation prompt in one\n * call: an {@link AlertDialog} panel prefilled with a heading, an optional\n * supporting passage, and a cancel/confirm control pair, so a single\n * consequential decision needs no compound assembly of its own. The\n * confirming control defaults to the semantic danger tone, and a\n * type-to-confirm variant holds a big irreversible action until its name is typed.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { EntryComponent, Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { flex, flexCol, gap, vstack } from \"@sdxc/u/layout\";\nimport { clientEntry } from \"remix/component\";\n\nimport { confirmPhrase } from \"@sdxc/ui/mixins\";\n\nimport type { Button } from \"@sdxc/ui/button\";\n\nimport { AlertDialog } from \"@sdxc/ui/alert-dialog\";\nimport { Input } from \"@sdxc/ui/input\";\nimport { Label } from \"@sdxc/ui/label\";\n\n/** Semantic color role {@link Confirm} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: Button.Color = \"danger\";\n\n/** HTTP method a submitting {@link Confirm} falls back to when `form.method` is omitted. */\nconst DEFAULT_METHOD: NonNullable<Confirm.FormProps[\"method\"]> = \"post\";\n\n/**\n * Column gap the wrapping `<form>` re-declares in submit mode, matching the\n * panel's own child gap — the form becomes the panel's single child, so\n * without this the header and footer would lose their spacing.\n */\nconst PANEL_GAP = 6;\n\n/** Characters a `pattern` (compiled with the `v` flag) reads as syntax, escaped to match literally. */\nconst PATTERN_SYNTAX = /[\\\\^$.*+?()[\\]{}|/]/g;\n\n/**\n * Prop types for {@link Confirm}.\n */\nexport namespace Confirm {\n\t/**\n\t * Per-part styling for the elements this convenience wrapper composes in\n\t * one call, layered after each part's own built-in styling.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the header slot wrapping the title and description, rendered through {@link AlertDialog.Header}. */\n\t\theader?: TagProps<\"div\">[\"mix\"];\n\t\t/** Styling for the heading, rendered through {@link AlertDialog.Title}, whichever heading tag its ambient level resolves to. */\n\t\ttitle?: TagProps<\"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\">[\"mix\"];\n\t\t/** Styling for the supporting description, rendered through {@link AlertDialog.Description} only when `description` is set. */\n\t\tdescription?: TagProps<\"p\">[\"mix\"];\n\t\t/** Styling for the action row wrapping the cancel and confirm controls, rendered through {@link AlertDialog.Footer}. */\n\t\tfooter?: TagProps<\"div\">[\"mix\"];\n\t\t/** Styling for the control that backs out without confirming, rendered through {@link AlertDialog.Cancel}. */\n\t\tcancel?: TagProps<\"button\">[\"mix\"];\n\t\t/** Styling for the confirming control, rendered through {@link AlertDialog.Action}. */\n\t\taction?: TagProps<\"button\">[\"mix\"];\n\t\t/** Styling for the `<form>` wrapping the panel's content, rendered only in submit mode. */\n\t\tform?: TagProps<\"form\">[\"mix\"];\n\t}\n\n\t/**\n\t * The submission a confirming control performs instead of merely closing\n\t * the panel. Passing this switches {@link Confirm} into submit mode, where\n\t * the form's response is what ends the interruption.\n\t */\n\texport interface FormProps {\n\t\t/** URL the confirmation submits to. Omit to submit to the current URL, as a native `<form>` with no `action` does. */\n\t\taction?: string;\n\t\t/** HTTP method the confirmation submits with. Defaults to {@link DEFAULT_METHOD}, since a confirmed action changes state. */\n\t\tmethod?: \"get\" | \"post\";\n\t\t/**\n\t\t * Hidden inputs submitted along with the confirmation — a CSRF token,\n\t\t * an intent discriminator, the id of the record being acted on. They\n\t\t * render first inside the form, before the panel's own content.\n\t\t */\n\t\tfields?: RemixNode;\n\t}\n\n\t/**\n\t * The phrase a person types before a big irreversible action unlocks, such as\n\t * the team's name. Reserve it for deleting something large; on routine\n\t * confirms it reads as melodrama.\n\t */\n\texport interface TypeToConfirm {\n\t\t/** The exact text that unlocks the confirming control, compared case-sensitively. */\n\t\tvalue: string;\n\t\t/** The field's label, such as `Type \"acme\" to confirm`. */\n\t\tlabel: RemixNode;\n\t\t/** Name the typed text submits under in submit mode, so the server can check it again. */\n\t\tname?: string;\n\t}\n\n\t/**\n\t * Props accepted by {@link Confirm}. `mix` styles the underlying\n\t * {@link AlertDialog} host directly; style the composed header, title,\n\t * description, footer, and controls individually through `parts` instead.\n\t */\n\texport interface Props extends Omit<AlertDialog.Props, \"id\" | \"children\" | \"title\"> {\n\t\t/**\n\t\t * Stable identifier the panel renders as its own `id`; a trigger\n\t\t * elsewhere on the page targets it via `commandfor`/`command=\"show-modal\"`,\n\t\t * and the cancel and confirm controls point back at it automatically.\n\t\t */\n\t\tid: string;\n\t\t/** The panel's heading, rendered through {@link AlertDialog.Title}. */\n\t\ttitle: RemixNode;\n\t\t/**\n\t\t * Supporting copy rendered through {@link AlertDialog.Description}\n\t\t * beneath the title. Omit to render no description.\n\t\t */\n\t\tdescription?: RemixNode;\n\t\t/** Label for the confirming control, rendered through {@link AlertDialog.Action}. */\n\t\tconfirmLabel: RemixNode;\n\t\t/** Label for the control that backs out without confirming, rendered through {@link AlertDialog.Cancel}. */\n\t\tcancelLabel: RemixNode;\n\t\t/** Semantic color for the confirming control. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Button.Color;\n\t\t/**\n\t\t * Submission the confirming control performs. Omitting it leaves\n\t\t * confirming as a close-only action for the page to react to; setting it\n\t\t * submits a real form instead.\n\t\t */\n\t\tform?: FormProps;\n\t\t/**\n\t\t * Holds the confirming control disabled until this phrase is typed. Without\n\t\t * script the field's `pattern` blocks the submission instead.\n\t\t */\n\t\ttypeToConfirm?: TypeToConfirm;\n\t\t/** Per-part styling for this wrapper's internally composed elements. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * Composes {@link AlertDialog} into a confirmation prompt, wiring title and\n * description ids to `aria-labelledby`/`aria-describedby`. Focus opens on Cancel, or\n * on the phrase field with `typeToConfirm`; pass `form` to submit a real `<form>`.\n *\n * @param handle Runtime handle carrying the panel's props and this instance's stable identifier.\n * @returns The render function producing the confirmation prompt's markup.\n * @example\n * <Button commandfor=\"confirm-delete\" command=\"show-modal\" color=\"danger\">{t(\"project.delete\")}</Button>\n * <Confirm\n * \tid=\"confirm-delete\"\n * \ttitle={t(\"project.deleteTitle\")}\n * \tdescription={t(\"project.deleteDescription\")}\n * \tconfirmLabel={t(\"actions.delete\")}\n * \tcancelLabel={t(\"actions.cancel\")}\n * />\n * @example\n * <Confirm\n * \tid=\"publish-post\"\n * \ttitle={t(\"post.publishTitle\")}\n * \tconfirmLabel={t(\"actions.publish\")}\n * \tcancelLabel={t(\"actions.cancel\")}\n * \tcolor=\"brand\"\n * />\n * @example\n * <Confirm\n * \tid=\"revoke-session\"\n * \ttitle={t(\"session.revokeTitle\")}\n * \tconfirmLabel={t(\"actions.revoke\")}\n * \tcancelLabel={t(\"actions.cancel\")}\n * \tform={{ action: revokeUrl, fields: <input type=\"hidden\" name=\"csrf\" value={token} /> }}\n * />\n * @example\n * <Confirm\n * \tid=\"delete-team\"\n * \ttitle=\"Delete team?\"\n * \tdescription=\"Acme, its 12 monitors and their history are deleted.\"\n * \tconfirmLabel=\"Delete team\"\n * \tcancelLabel=\"Cancel\"\n * \ttypeToConfirm={{ value: \"acme\", label: 'Type \"acme\" to confirm', name: \"confirmation\" }}\n * \tform={{ action: \"/teams/acme/delete\" }}\n * />\n */\nexport function Confirm(handle: Handle<Confirm.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tid,\n\t\t\ttitle,\n\t\t\tdescription,\n\t\t\tconfirmLabel,\n\t\t\tcancelLabel,\n\t\t\tcolor,\n\t\t\tform,\n\t\t\ttypeToConfirm,\n\t\t\t\"aria-labelledby\": ariaLabelledByProp,\n\t\t\t\"aria-describedby\": ariaDescribedByProp,\n\t\t\tparts,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\t\tlet titleId = `${handle.id}-title`;\n\t\tlet descriptionId = description ? `${handle.id}-description` : undefined;\n\t\tlet content = (\n\t\t\t<>\n\t\t\t\t<AlertDialog.Header mix={parts?.header}>\n\t\t\t\t\t<AlertDialog.Title id={titleId} mix={parts?.title}>\n\t\t\t\t\t\t{title}\n\t\t\t\t\t</AlertDialog.Title>\n\t\t\t\t\t{description ? (\n\t\t\t\t\t\t<AlertDialog.Description id={descriptionId} mix={parts?.description}>\n\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t</AlertDialog.Description>\n\t\t\t\t\t) : null}\n\t\t\t\t</AlertDialog.Header>\n\t\t\t\t{typeToConfirm ? (\n\t\t\t\t\t<ConfirmPhrase\n\t\t\t\t\t\tid={`${handle.id}-phrase`}\n\t\t\t\t\t\tvalue={typeToConfirm.value}\n\t\t\t\t\t\tlabel={typeToConfirm.label}\n\t\t\t\t\t\tname={typeToConfirm.name}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t\t<AlertDialog.Footer mix={parts?.footer}>\n\t\t\t\t\t{/* oxlint-disable-next-line jsx-a11y/no-autofocus -- Focus inside an opened modal, where a destructive confirm starts on the safe choice. */}\n\t\t\t\t\t<AlertDialog.Cancel\n\t\t\t\t\t\tcommandfor={id}\n\t\t\t\t\t\tautofocus={typeToConfirm ? undefined : true}\n\t\t\t\t\t\tmix={parts?.cancel}\n\t\t\t\t\t>\n\t\t\t\t\t\t{cancelLabel}\n\t\t\t\t\t</AlertDialog.Cancel>\n\t\t\t\t\t<AlertDialog.Action\n\t\t\t\t\t\tdata-confirm-action=\"\"\n\t\t\t\t\t\ttype={form ? \"submit\" : undefined}\n\t\t\t\t\t\tcommandfor={form ? undefined : id}\n\t\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\t\tmix={parts?.action}\n\t\t\t\t\t>\n\t\t\t\t\t\t{confirmLabel}\n\t\t\t\t\t</AlertDialog.Action>\n\t\t\t\t</AlertDialog.Footer>\n\t\t\t</>\n\t\t);\n\n\t\treturn (\n\t\t\t<AlertDialog\n\t\t\t\t{...rest}\n\t\t\t\tid={id}\n\t\t\t\taria-labelledby={ariaLabelledByProp ?? titleId}\n\t\t\t\taria-describedby={ariaDescribedByProp ?? descriptionId}\n\t\t\t\tmix={mix}\n\t\t\t>\n\t\t\t\t{form ? (\n\t\t\t\t\t<form\n\t\t\t\t\t\taction={form.action}\n\t\t\t\t\t\tmethod={form.method ?? DEFAULT_METHOD}\n\t\t\t\t\t\tmix={[flex(), flexCol(), gap(PANEL_GAP), parts?.form]}\n\t\t\t\t\t>\n\t\t\t\t\t\t{form.fields}\n\t\t\t\t\t\t{content}\n\t\t\t\t\t</form>\n\t\t\t\t) : (\n\t\t\t\t\tcontent\n\t\t\t\t)}\n\t\t\t</AlertDialog>\n\t\t);\n\t};\n}\n\n/**\n * Props {@link ConfirmPhrase} serializes into the page for hydration, which is why they are\n * a `type`: `SerializableProps` rejects an interface.\n */\nexport type ConfirmPhraseProps = {\n\t/** The input's `id`, which its label points at. */\n\tid: string;\n\t/** The exact text that unlocks the confirming control. */\n\tvalue: string;\n\tlabel: RemixNode;\n\tname?: string;\n};\n\n/**\n * Turns a phrase into a `pattern` that matches only that phrase.\n *\n * @param value The phrase to match literally.\n * @returns The phrase with every pattern syntax character escaped.\n */\nfunction escapePattern(value: string): string {\n\treturn value.replace(PATTERN_SYNTAX, \"\\\\$&\");\n}\n\n/**\n * Client island: the field a type-to-confirm prompt holds. It disables the dialog's\n * confirming control until the typed text matches and clears itself when the dialog\n * closes, so every opening starts locked; without script, `pattern` blocks the submit.\n *\n * @example\n * <ConfirmPhrase id=\"delete-team-phrase\" value=\"acme\" label='Type \"acme\" to confirm' />\n */\nexport const ConfirmPhrase: EntryComponent<ConfirmPhraseProps> = clientEntry(\n\t\"@sdxc/ui/confirm#ConfirmPhrase\",\n\tfunction ConfirmPhrase(handle) {\n\t\treturn () => {\n\t\t\tlet { id, label, name, value } = handle.props;\n\n\t\t\treturn (\n\t\t\t\t<div data-slot=\"confirm-phrase\" mix={[vstack({ gap: 1.5, align: \"stretch\" })]}>\n\t\t\t\t\t<Label htmlFor={id}>{label}</Label>\n\t\t\t\t\t{/* oxlint-disable-next-line jsx-a11y/no-autofocus -- Focus inside an opened modal, landing on the one field the decision needs. */}\n\t\t\t\t\t<Input\n\t\t\t\t\t\tid={id}\n\t\t\t\t\t\tname={name}\n\t\t\t\t\t\trequired\n\t\t\t\t\t\tautofocus\n\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\tspellcheck={false}\n\t\t\t\t\t\tpattern={escapePattern(value)}\n\t\t\t\t\t\tmix={[confirmPhrase(value)]}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t};\n\t},\n);\n"
14
18
  },
15
19
  "test": {
16
20
  "path": "confirm.test.tsx",
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "cta-group",
3
- "changedIn": "2026.10.29",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "CtaGroup"
7
7
  ],
8
8
  "source": {
9
9
  "path": "cta-group.tsx",
10
- "content": "/**\n * A horizontal cluster of primary and secondary marketing actions that wraps\n * onto a second row when the container is narrow. Children are the page's own\n * {@link Button} / {@link LinkButton} instances — pair nav rows at `size=\"sm\"`\n * (~32px) with hero rows at `size=\"lg\"` (~48px).\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 { flexWrap, gap, inlineFlex, items } from \"@sdxc/u/layout\";\n\n/**\n * Prop types for {@link CtaGroup}.\n */\nexport namespace CtaGroup {\n\t/**\n\t * Props accepted by {@link CtaGroup}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Action controls — typically a solid primary {@link Button} or\n\t\t * {@link LinkButton} beside an outline secondary. The group does not\n\t\t * invent buttons of its own.\n\t\t */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Lays action children in a wrapping inline-flex row with a compact gap so a\n * primary and secondary CTA read as one cluster. Radius and size stay on the\n * buttons; override `--ui-marketing-cta-radius` per brand for pill vs soft-rect\n * corners when composing marketing CTAs.\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 * <CtaGroup>\n * \t<Button size=\"lg\" color=\"brand\">{t(\"hero.cta\")}</Button>\n * \t<LinkButton href={docs} size=\"lg\" variant=\"outline\">{t(\"hero.docs\")}</LinkButton>\n * </CtaGroup>\n * @example\n * <CtaGroup>\n * \t<LinkButton href={signin} size=\"sm\">{t(\"nav.signin\")}</LinkButton>\n * </CtaGroup>\n */\nexport function CtaGroup(handle: Handle<CtaGroup.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\tdata-slot=\"cta-group\"\n\t\t\t\tmix={[inlineFlex(), items(\"center\"), flexWrap(), gap(3), mix]}\n\t\t\t/>\n\t\t);\n\t};\n}\n"
10
+ "content": "/**\n * A horizontal cluster of primary and secondary landing actions that wraps\n * onto a second row when the container is narrow. Children are the page's own\n * {@link Button} / {@link LinkButton} instances, and an action that names no\n * size of its own takes the group's, so a hero row sizes every CTA at once.\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 { raw, mergeMix } from \"@sdxc/u/general\";\nimport { flexWrap, gap, inlineFlex, items } from \"@sdxc/u/layout\";\nimport { atMax } from \"@sdxc/u/responsive\";\nimport { when } from \"@sdxc/u/state\";\n\n/** Size the group hands its actions when `size` is omitted: the 40px landing CTA. */\nconst DEFAULT_SIZE: CtaGroup.Size = \"md\";\n\n/**\n * Prop types for {@link CtaGroup}.\n */\nexport namespace CtaGroup {\n\t/** Size every action without a `size` of its own renders at. */\n\texport type Size = \"sm\" | \"md\" | \"lg\";\n\n\t/**\n\t * When the actions stack into full-width rows: never, or on a phone-width\n\t * container (36rem and below), where two side-by-side CTAs would wrap unevenly.\n\t */\n\texport type Stack = \"never\" | \"phone\";\n\n\t/** What the group shares with the actions inside it. */\n\texport interface Context {\n\t\t/** Size an action without its own `size` renders at. */\n\t\tsize: Size;\n\t}\n\n\t/**\n\t * Props accepted by {@link CtaGroup}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Size handed to every action without its own. Defaults to {@link DEFAULT_SIZE}. */\n\t\tsize?: Size;\n\t\t/** When the actions stack full width. Defaults to `\"never\"`. */\n\t\tstack?: Stack;\n\t\t/**\n\t\t * Action controls — typically a solid primary {@link Button} or\n\t\t * {@link LinkButton} beside a `surface` or outline secondary. The group\n\t\t * does not invent buttons of its own.\n\t\t */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Lays action children in a wrapping inline-flex row with a compact gap so a\n * primary and secondary CTA read as one cluster, and publishes its size to them.\n * Radius stays on the buttons; override `--ui-landing-cta-radius` per brand for\n * pill vs soft-rect corners through `landingCtaChrome()`.\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 * <CtaGroup stack=\"phone\">\n * \t<Button color=\"brand\">{t(\"hero.cta\")}</Button>\n * \t<LinkButton href={docs} variant=\"surface\">{t(\"hero.docs\")}</LinkButton>\n * </CtaGroup>\n * @example\n * <CtaGroup size=\"sm\">\n * \t<LinkButton href={signin}>{t(\"nav.signin\")}</LinkButton>\n * </CtaGroup>\n */\nexport function CtaGroup(handle: Handle<CtaGroup.Props, CtaGroup.Context>) {\n\treturn () => {\n\t\tlet { mix, size, stack, ...rest } = handle.props;\n\t\tlet resolvedSize = size ?? DEFAULT_SIZE;\n\n\t\thandle.context.set({ size: resolvedSize });\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"cta-group\"\n\t\t\t\tdata-size={resolvedSize}\n\t\t\t\tdata-stack={stack === \"phone\" ? \"phone\" : undefined}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tinlineFlex(),\n\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\tflexWrap(),\n\t\t\t\t\t\tgap(3),\n\t\t\t\t\t\tstack === \"phone\"\n\t\t\t\t\t\t\t? atMax(\"md\", [\n\t\t\t\t\t\t\t\t\traw({ display: \"flex\", flexDirection: \"column\", alignItems: \"stretch\" }),\n\t\t\t\t\t\t\t\t\traw({ inlineSize: \"100%\" }),\n\t\t\t\t\t\t\t\t\twhen(\"& > *\", raw({ inlineSize: \"100%\" })),\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\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n}\n"
11
11
  },
12
12
  "test": {
13
13
  "path": "cta-group.test.tsx",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "date-field",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [
5
5
  "description",
6
6
  "field-error",
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "source": {
15
15
  "path": "date-field.tsx",
16
- "content": "/**\n * A convenience wrapper composing a labeled, described, and validated date\n * field in one call: a caption through {@link Label}, a native\n * `<input type=\"date\">` styled through {@link Input}, an optional supporting\n * passage through {@link Description}, and an optional validation message\n * through {@link FieldError}. Every id and `aria-describedby` relationship\n * between the parts is computed from this instance's own stable identifier,\n * leaving no id bookkeeping to the consumer.\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 { tabularNums } from \"@sdxc/u/typography\";\n\nimport type { FieldPartsProps } from \"@sdxc/ui/utils\";\n\nimport { fieldStackLayout } from \"@sdxc/ui/styles\";\nimport { resolveFieldWiring } from \"@sdxc/ui/utils\";\n\nimport { Description } from \"@sdxc/ui/description\";\nimport { FieldError } from \"@sdxc/ui/field-error\";\nimport { resolveFieldIssue } from \"@sdxc/ui/form\";\nimport { Input } from \"@sdxc/ui/input\";\nimport { Label } from \"@sdxc/ui/label\";\n\n/**\n * Prop types for {@link DateField}.\n */\nexport namespace DateField {\n\t/**\n\t * Semantic color role for the control's keyboard focus ring, each mapped\n\t * to its matching `--ui-*` variables.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Per-part styling for the elements this convenience wrapper composes in\n\t * one call, layered after each part's own built-in styling.\n\t */\n\texport type PartsProps = FieldPartsProps;\n\n\t/**\n\t * Props accepted by {@link DateField}. `mix` styles the root element\n\t * grouping the field's parts; style the composed label, control,\n\t * description, and error individually through `parts` instead.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"children\"> {\n\t\t/** Semantic color role for the control's focus ring. Defaults to `\"neutral\"` when omitted. */\n\t\tcolor?: Color;\n\t\t/**\n\t\t * The field's caption, rendered through {@link Label} and associated\n\t\t * with the control through a native `for`/`id` relationship computed\n\t\t * from this instance's own identifier.\n\t\t */\n\t\tlabel: RemixNode;\n\t\t/**\n\t\t * Supporting copy rendered through {@link Description} beneath the\n\t\t * control and referenced by the control's `aria-describedby`. Omit to\n\t\t * render no description.\n\t\t */\n\t\tdescription?: RemixNode;\n\t\t/**\n\t\t * Validation message rendered through {@link FieldError} beneath the\n\t\t * control; its presence alone marks `aria-invalid` unless set\n\t\t * explicitly. Inside a {@link Form} carrying `issues`, an explicit value still wins over the field's own by-`name` lookup.\n\t\t */\n\t\terrorMessage?: RemixNode;\n\t\t/**\n\t\t * Native `autofocus`. Defaults to `true` for the first invalid field of an\n\t\t * enclosing {@link Form}'s `issues`, landing keyboard focus on the problem\n\t\t * after a server round-trip; pass it explicitly to override for this field.\n\t\t */\n\t\tautoFocus?: boolean;\n\t\t/** Native `name` submitted with an enclosing form. */\n\t\tname?: string;\n\t\t/** Current value, in `YYYY-MM-DD` form, for a control a consumer tracks itself. */\n\t\tvalue?: string;\n\t\t/** Initial value, in `YYYY-MM-DD` form, for a control left to the platform's own uncontrolled state. */\n\t\tdefaultValue?: string;\n\t\t/** Earliest accepted date, in `YYYY-MM-DD` form. */\n\t\tmin?: string;\n\t\t/** Latest accepted date, in `YYYY-MM-DD` form. */\n\t\tmax?: string;\n\t\t/** Granularity, in days, the control's value must fall on. */\n\t\tstep?: number;\n\t\t/** Marks the control required for its enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks the control inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks the control's value fixed, while keeping it focusable and included in form submission. */\n\t\treadOnly?: boolean;\n\t\t/** Native autofill hint, e.g. `\"bday\"`. */\n\t\tautoComplete?: string;\n\t\t/** Per-part styling for this wrapper's internally composed elements. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * Renders a complete date field in one call, stacking {@link Label},\n * {@link Input}, and, when supplied, {@link Description} and {@link FieldError}.\n * An invalid state — from `errorMessage` or an explicit `aria-invalid` override — recolors the border and ring to the semantic danger tone regardless of `color`.\n *\n * @param handle Runtime handle carrying the root element's props and this instance's stable identifier.\n * @returns The render function producing the field's markup.\n * @example\n * <DateField label={t(\"form.birthday.label\")} name=\"birthday\" autoComplete=\"bday\" />\n * @example\n * <DateField\n * \tlabel={t(\"form.startDate.label\")}\n * \tname=\"startDate\"\n * \tmin=\"2026-01-01\"\n * \tmax=\"2026-12-31\"\n * \tdescription={t(\"form.startDate.hint\")}\n * />\n * @example\n * <DateField\n * \tlabel={t(\"form.dueDate.label\")}\n * \tname=\"dueDate\"\n * \tdefaultValue=\"2026-07-20\"\n * \terrorMessage={t(\"form.dueDate.pastDate\")}\n * />\n */\nexport function DateField(handle: Handle<DateField.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor,\n\t\t\tlabel,\n\t\t\tdescription,\n\t\t\terrorMessage: errorMessageProp,\n\t\t\tautoFocus,\n\t\t\tname,\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tstep,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\treadOnly,\n\t\t\tautoComplete,\n\t\t\t\"aria-invalid\": ariaInvalidProp,\n\t\t\tparts,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet { errorMessage, isFirstInvalid } = resolveFieldIssue(handle, name, errorMessageProp);\n\t\tlet resolvedAutoFocus = autoFocus ?? (isFirstInvalid || undefined);\n\t\tlet { resolvedColor, resolvedInvalid, descriptionId, errorId, describedBy } =\n\t\t\tresolveFieldWiring(handle.id, {\n\t\t\t\tcolor,\n\t\t\t\terrorMessage,\n\t\t\t\tdescription,\n\t\t\t\tariaInvalid: ariaInvalidProp,\n\t\t\t});\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"date-field\" mix={[fieldStackLayout(), mix]}>\n\t\t\t\t<Label htmlFor={handle.id} mix={parts?.label}>\n\t\t\t\t\t{label}\n\t\t\t\t</Label>\n\t\t\t\t<Input\n\t\t\t\t\tid={handle.id}\n\t\t\t\t\ttype=\"date\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\tmin={min}\n\t\t\t\t\tmax={max}\n\t\t\t\t\tstep={step}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t// oxlint-disable-next-line jsx-a11y/no-autofocus -- Not a focus grab on page load: this only ever resolves true for the first field an enclosing Form reports as invalid, so a failed submit lands the user on the problem instead of leaving them to hunt for it.\n\t\t\t\t\tautoFocus={resolvedAutoFocus}\n\t\t\t\t\taria-invalid={resolvedInvalid}\n\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\tmix={[tabularNums(), parts?.input]}\n\t\t\t\t/>\n\t\t\t\t{description ? (\n\t\t\t\t\t<Description id={descriptionId} mix={parts?.description}>\n\t\t\t\t\t\t{description}\n\t\t\t\t\t</Description>\n\t\t\t\t) : null}\n\t\t\t\t{errorMessage ? (\n\t\t\t\t\t<FieldError id={errorId} mix={parts?.error}>\n\t\t\t\t\t\t{errorMessage}\n\t\t\t\t\t</FieldError>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t);\n\t};\n}\n"
16
+ "content": "/**\n * A convenience wrapper composing a labeled, described, and validated date\n * field in one call: a caption through {@link Label}, a native\n * `<input type=\"date\">` styled through {@link Input}, an optional supporting\n * passage through {@link Description}, and an optional validation message\n * through {@link FieldError}. Every id and `aria-describedby` relationship\n * between the parts is computed from this instance's own stable identifier,\n * leaving no id bookkeeping to the consumer.\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 { mergeMix } from \"@sdxc/u/general\";\nimport { tabularNums } from \"@sdxc/u/typography\";\n\nimport type { FieldPartsProps } from \"@sdxc/ui/utils\";\n\nimport { fieldStackLayout } from \"@sdxc/ui/styles\";\nimport { resolveFieldWiring } from \"@sdxc/ui/utils\";\n\nimport { Description } from \"@sdxc/ui/description\";\nimport { FieldError } from \"@sdxc/ui/field-error\";\nimport { resolveFieldIssue } from \"@sdxc/ui/form\";\nimport { Input } from \"@sdxc/ui/input\";\nimport { Label } from \"@sdxc/ui/label\";\n\n/**\n * Prop types for {@link DateField}.\n */\nexport namespace DateField {\n\t/**\n\t * Semantic color role for the control's keyboard focus ring, each mapped\n\t * to its matching `--ui-*` variables.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Per-part styling for the elements this convenience wrapper composes in\n\t * one call, layered after each part's own built-in styling.\n\t */\n\texport type PartsProps = FieldPartsProps;\n\n\t/**\n\t * Props accepted by {@link DateField}. `mix` styles the root element\n\t * grouping the field's parts; style the composed label, control,\n\t * description, and error individually through `parts` instead.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"children\"> {\n\t\t/** Semantic color role for the control's focus ring. Defaults to `\"neutral\"` when omitted. */\n\t\tcolor?: Color;\n\t\t/**\n\t\t * The field's caption, rendered through {@link Label} and associated\n\t\t * with the control through a native `for`/`id` relationship computed\n\t\t * from this instance's own identifier.\n\t\t */\n\t\tlabel: RemixNode;\n\t\t/**\n\t\t * Supporting copy rendered through {@link Description} beneath the\n\t\t * control and referenced by the control's `aria-describedby`. Omit to\n\t\t * render no description.\n\t\t */\n\t\tdescription?: RemixNode;\n\t\t/**\n\t\t * Validation message rendered through {@link FieldError} beneath the\n\t\t * control; its presence alone marks `aria-invalid` unless set\n\t\t * explicitly. Inside a {@link Form} carrying `issues`, an explicit value still wins over the field's own by-`name` lookup.\n\t\t */\n\t\terrorMessage?: RemixNode;\n\t\t/**\n\t\t * Native `autofocus`. Defaults to `true` for the first invalid field of an\n\t\t * enclosing {@link Form}'s `issues`, landing keyboard focus on the problem\n\t\t * after a server round-trip; pass it explicitly to override for this field.\n\t\t */\n\t\tautoFocus?: boolean;\n\t\t/** Native `name` submitted with an enclosing form. */\n\t\tname?: string;\n\t\t/** Current value, in `YYYY-MM-DD` form, for a control a consumer tracks itself. */\n\t\tvalue?: string;\n\t\t/** Initial value, in `YYYY-MM-DD` form, for a control left to the platform's own uncontrolled state. */\n\t\tdefaultValue?: string;\n\t\t/** Earliest accepted date, in `YYYY-MM-DD` form. */\n\t\tmin?: string;\n\t\t/** Latest accepted date, in `YYYY-MM-DD` form. */\n\t\tmax?: string;\n\t\t/** Granularity, in days, the control's value must fall on. */\n\t\tstep?: number;\n\t\t/** Marks the control required for its enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks the control inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks the control's value fixed, while keeping it focusable and included in form submission. */\n\t\treadOnly?: boolean;\n\t\t/** Native autofill hint, e.g. `\"bday\"`. */\n\t\tautoComplete?: string;\n\t\t/** Per-part styling for this wrapper's internally composed elements. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * Renders a complete date field in one call, stacking {@link Label},\n * {@link Input}, and, when supplied, {@link Description} and {@link FieldError}.\n * An invalid state — from `errorMessage` or an explicit `aria-invalid` override — recolors the border and ring to the semantic danger tone regardless of `color`.\n *\n * @param handle Runtime handle carrying the root element's props and this instance's stable identifier.\n * @returns The render function producing the field's markup.\n * @example\n * <DateField label={t(\"form.birthday.label\")} name=\"birthday\" autoComplete=\"bday\" />\n * @example\n * <DateField\n * \tlabel={t(\"form.startDate.label\")}\n * \tname=\"startDate\"\n * \tmin=\"2026-01-01\"\n * \tmax=\"2026-12-31\"\n * \tdescription={t(\"form.startDate.hint\")}\n * />\n * @example\n * <DateField\n * \tlabel={t(\"form.dueDate.label\")}\n * \tname=\"dueDate\"\n * \tdefaultValue=\"2026-07-20\"\n * \terrorMessage={t(\"form.dueDate.pastDate\")}\n * />\n */\nexport function DateField(handle: Handle<DateField.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor,\n\t\t\tlabel,\n\t\t\tdescription,\n\t\t\terrorMessage: errorMessageProp,\n\t\t\tautoFocus,\n\t\t\tname,\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tstep,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\treadOnly,\n\t\t\tautoComplete,\n\t\t\t\"aria-invalid\": ariaInvalidProp,\n\t\t\tparts,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet { errorMessage, isFirstInvalid } = resolveFieldIssue(handle, name, errorMessageProp);\n\t\tlet resolvedAutoFocus = autoFocus ?? (isFirstInvalid || undefined);\n\t\tlet { resolvedColor, resolvedInvalid, descriptionId, errorId, describedBy } =\n\t\t\tresolveFieldWiring(handle.id, {\n\t\t\t\tcolor,\n\t\t\t\terrorMessage,\n\t\t\t\tdescription,\n\t\t\t\tariaInvalid: ariaInvalidProp,\n\t\t\t});\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"date-field\" mix={mergeMix(fieldStackLayout(), mix)}>\n\t\t\t\t<Label htmlFor={handle.id} mix={parts?.label}>\n\t\t\t\t\t{label}\n\t\t\t\t</Label>\n\t\t\t\t<Input\n\t\t\t\t\tid={handle.id}\n\t\t\t\t\ttype=\"date\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\tmin={min}\n\t\t\t\t\tmax={max}\n\t\t\t\t\tstep={step}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t// oxlint-disable-next-line jsx-a11y/no-autofocus -- Not a focus grab on page load: this only ever resolves true for the first field an enclosing Form reports as invalid, so a failed submit lands the user on the problem instead of leaving them to hunt for it.\n\t\t\t\t\tautoFocus={resolvedAutoFocus}\n\t\t\t\t\taria-invalid={resolvedInvalid}\n\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\tmix={[tabularNums(), parts?.input]}\n\t\t\t\t/>\n\t\t\t\t{description ? (\n\t\t\t\t\t<Description id={descriptionId} mix={parts?.description}>\n\t\t\t\t\t\t{description}\n\t\t\t\t\t</Description>\n\t\t\t\t) : null}\n\t\t\t\t{errorMessage ? (\n\t\t\t\t\t<FieldError id={errorId} mix={parts?.error}>\n\t\t\t\t\t\t{errorMessage}\n\t\t\t\t\t</FieldError>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t);\n\t};\n}\n"
17
17
  },
18
18
  "test": null
19
19
  }