@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": "date-picker",
3
- "changedIn": "2026.10.20",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [
5
5
  "date-field"
6
6
  ],
@@ -9,7 +9,7 @@
9
9
  ],
10
10
  "source": {
11
11
  "path": "date-picker.tsx",
12
- "content": "/**\n * A labeled date field built on {@link DateField}, with a\n * {@link DatePicker.Group} row for composing more than one field into a single\n * control. The calendar is the platform's: the field is a native date input, so\n * the picker, its keyboard handling and its locale all come from the browser and\n * all of it works before any script loads. Leaving `children` unset renders the\n * field on its own.\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 { outline } from \"@sdxc/u/color\";\nimport { roundedCorner } from \"@sdxc/u/effects\";\nimport { raw } from \"@sdxc/u/general\";\nimport { flex, flexCol, gap, items } from \"@sdxc/u/layout\";\nimport { mis } from \"@sdxc/u/size\";\nimport { z } from \"@sdxc/u/stacking\";\nimport { when } from \"@sdxc/u/state\";\n\nimport { DateField } from \"@sdxc/ui/date-field\";\n\n/**\n * Prop types for {@link DatePicker} and its compound parts.\n */\nexport namespace DatePicker {\n\t/**\n\t * Semantic color role for the fallback field's keyboard focus ring. Read\n\t * only by the fallback field — {@link DatePicker.Group}'s composed\n\t * control carries no `color` prop of its own.\n\t */\n\texport type Color = DateField.Color;\n\n\t/**\n\t * Every prop {@link DateField.PartsProps} accepts, applied only to the\n\t * field's internally composed parts; a composed layout styles the controls\n\t * inside {@link DatePicker.Group} individually.\n\t */\n\texport interface PartsProps extends DateField.PartsProps {}\n\n\t/**\n\t * Props accepted by {@link DatePicker}. Leaving `children` unset renders the\n\t * field using every prop below; composing {@link DatePicker.Group} instead\n\t * renders the joined row and leaves every prop below unread.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"children\"> {\n\t\t/** Semantic color role for the fallback field's focus ring. Read only when `children` is unset. */\n\t\tcolor?: Color;\n\t\t/** The fallback field's caption, rendered through {@link DateField}. Read only when `children` is unset. */\n\t\tlabel?: RemixNode;\n\t\t/** Supporting copy beneath the fallback field. Read only when `children` is unset. */\n\t\tdescription?: RemixNode;\n\t\t/** Validation message beneath the fallback field. Read only when `children` is unset. */\n\t\terrorMessage?: RemixNode;\n\t\t/** Native `name` submitted with an enclosing form, read only by the fallback field. */\n\t\tname?: string;\n\t\t/** Current value, in `YYYY-MM-DD` form, for a fallback field a consumer tracks itself. */\n\t\tvalue?: string;\n\t\t/** Initial value, in `YYYY-MM-DD` form, for a fallback field left to the platform's own uncontrolled state. */\n\t\tdefaultValue?: string;\n\t\t/** Earliest accepted date, in `YYYY-MM-DD` form, read only by the fallback field. */\n\t\tmin?: string;\n\t\t/** Latest accepted date, in `YYYY-MM-DD` form, read only by the fallback field. */\n\t\tmax?: string;\n\t\t/** Granularity, in days, the fallback field's value must fall on. */\n\t\tstep?: number;\n\t\t/** Marks the fallback field required for its enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks the fallback field inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks the fallback field's value fixed, while keeping it focusable and included in form submission. */\n\t\treadOnly?: boolean;\n\t\t/** Native autofill hint for the fallback field, e.g. `\"bday\"`. */\n\t\tautoComplete?: string;\n\t\t/** Per-part styling for the fallback field's internally composed parts. Read only when `children` is unset. */\n\t\tparts?: PartsProps;\n\t\t/**\n\t\t * The composed layout — typically a `Label` and a\n\t\t * {@link DatePicker.Group} — rendered in place of the field, leaving every\n\t\t * field above unread.\n\t\t */\n\t\tchildren?: RemixNode;\n\t}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * `children` composes the field's own control, and a second one for a\n\t * range, into one visual row.\n\t */\n\texport interface GroupProps extends TagProps<\"div\"> {}\n}\n\n/**\n * Renders {@link DatePicker}'s root. Leaving `children` unset renders the field,\n * passing every prop above through unchanged; composing\n * {@link DatePicker.Group} as `children` instead renders the joined row and\n * leaves those props unread.\n *\n * @param handle Runtime handle carrying the root element's props.\n * @returns The render function producing the date picker's markup.\n * @example\n * <DatePicker label={t(\"form.birthday.label\")} name=\"birthday\" autoComplete=\"bday\" />\n * @example\n * <DatePicker>\n * \t<Label htmlFor=\"startDate\">{t(\"form.startDate.label\")}</Label>\n * \t<DatePicker.Group>\n * \t\t<Input id=\"startDate\" type=\"date\" name=\"startDate\" />\n * \t</DatePicker.Group>\n * </DatePicker>\n */\nexport function DatePicker(handle: Handle<DatePicker.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor,\n\t\t\tlabel,\n\t\t\tdescription,\n\t\t\terrorMessage,\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\tparts,\n\t\t\tchildren,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\n\t\tif (import.meta.env?.DEV && !children && !label) {\n\t\t\tconsole.warn(\n\t\t\t\t'DatePicker: falling back to DateField\\'s plain \"input type=date\" needs a \"label\" describing what it collects for assistive technology.',\n\t\t\t);\n\t\t}\n\n\t\tif (!children) {\n\t\t\treturn (\n\t\t\t\t<DateField\n\t\t\t\t\t{...rest}\n\t\t\t\t\tcolor={color}\n\t\t\t\t\tlabel={label}\n\t\t\t\t\tdescription={description}\n\t\t\t\t\terrorMessage={errorMessage}\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\tparts={parts}\n\t\t\t\t\tmix={mix}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"date-picker\" mix={[flex(), flexCol(), gap(1), mix]}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link DatePicker}'s control row: a flex host laying one or more date\n * controls side by side and joining their edges, so a pair reads as one field.\n * Focus and validity are drawn the way `Group` draws them — focus by the control\n * that holds it, validity once around the row.\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 * <DatePicker.Group>\n * \t<Input id=\"startDate\" type=\"date\" name=\"startDate\" />\n * </DatePicker.Group>\n */\nDatePicker.Group = function DatePickerGroup(handle: Handle<DatePicker.GroupProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"group\"\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * The fields compose into one control, so the pair keeps the rounding on its own\n\t\t\t\t\t * outer corners and the seam the two share is drawn once.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"& > *:not(:first-child)\", [\n\t\t\t\t\t\troundedCorner(\"start-start\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"end-start\", \"none\"),\n\t\t\t\t\t\tmis(\"-1px\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\"& > *:not(:last-child)\", [\n\t\t\t\t\t\troundedCorner(\"start-end\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"end-end\", \"none\"),\n\t\t\t\t\t]),\n\t\t\t\t\t/**\n\t\t\t\t\t * Focus shows on the field holding it, naming which date has it where a ring around\n\t\t\t\t\t * the pair names only the group. That field is raised so its ring crosses the seam.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"& > *:focus-visible\", z(1)),\n\t\t\t\t\t/**\n\t\t\t\t\t * Validity belongs to the pair, since a range is one value and half of one makes it\n\t\t\t\t\t * invalid: one ring is drawn around the group and each field's own ring is released,\n\t\t\t\t\t * so the seam shows one field needing attention.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\n\t\t\t\t\t\t'&:has(> :user-invalid), &:has(> [aria-invalid=\"true\"])',\n\t\t\t\t\t\toutline({ color: \"danger.ring\", offset: 2 }),\n\t\t\t\t\t),\n\t\t\t\t\twhen(\n\t\t\t\t\t\t'& > :user-invalid:not(:focus-visible), & > [aria-invalid=\"true\"]:not(:focus-visible)',\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Important so it reaches across to the cascade layer where `Input` states the field's\n\t\t\t\t\t\t * invalid ring. The selector excludes `:focus-visible`, so a field being filled in still\n\t\t\t\t\t\t * shows its own focus ring.\n\t\t\t\t\t\t */\n\t\t\t\t\t\traw({ outline: \"none !important\" }),\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"
12
+ "content": "/**\n * A labeled date field built on {@link DateField}, with a\n * {@link DatePicker.Group} row for composing more than one field into a single\n * control. The calendar is the platform's: the field is a native date input, so\n * the picker, its keyboard handling and its locale all come from the browser and\n * all of it works before any script loads. Leaving `children` unset renders the\n * field on its own.\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 { outline } from \"@sdxc/u/color\";\nimport { roundedCorner } from \"@sdxc/u/effects\";\nimport { raw, mergeMix } from \"@sdxc/u/general\";\nimport { flex, flexCol, gap, items } from \"@sdxc/u/layout\";\nimport { mis } from \"@sdxc/u/size\";\nimport { z } from \"@sdxc/u/stacking\";\nimport { when } from \"@sdxc/u/state\";\n\nimport { DateField } from \"@sdxc/ui/date-field\";\n\n/**\n * Prop types for {@link DatePicker} and its compound parts.\n */\nexport namespace DatePicker {\n\t/**\n\t * Semantic color role for the fallback field's keyboard focus ring. Read\n\t * only by the fallback field — {@link DatePicker.Group}'s composed\n\t * control carries no `color` prop of its own.\n\t */\n\texport type Color = DateField.Color;\n\n\t/**\n\t * Every prop {@link DateField.PartsProps} accepts, applied only to the\n\t * field's internally composed parts; a composed layout styles the controls\n\t * inside {@link DatePicker.Group} individually.\n\t */\n\texport interface PartsProps extends DateField.PartsProps {}\n\n\t/**\n\t * Props accepted by {@link DatePicker}. Leaving `children` unset renders the\n\t * field using every prop below; composing {@link DatePicker.Group} instead\n\t * renders the joined row and leaves every prop below unread.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"children\"> {\n\t\t/** Semantic color role for the fallback field's focus ring. Read only when `children` is unset. */\n\t\tcolor?: Color;\n\t\t/** The fallback field's caption, rendered through {@link DateField}. Read only when `children` is unset. */\n\t\tlabel?: RemixNode;\n\t\t/** Supporting copy beneath the fallback field. Read only when `children` is unset. */\n\t\tdescription?: RemixNode;\n\t\t/** Validation message beneath the fallback field. Read only when `children` is unset. */\n\t\terrorMessage?: RemixNode;\n\t\t/** Native `name` submitted with an enclosing form, read only by the fallback field. */\n\t\tname?: string;\n\t\t/** Current value, in `YYYY-MM-DD` form, for a fallback field a consumer tracks itself. */\n\t\tvalue?: string;\n\t\t/** Initial value, in `YYYY-MM-DD` form, for a fallback field left to the platform's own uncontrolled state. */\n\t\tdefaultValue?: string;\n\t\t/** Earliest accepted date, in `YYYY-MM-DD` form, read only by the fallback field. */\n\t\tmin?: string;\n\t\t/** Latest accepted date, in `YYYY-MM-DD` form, read only by the fallback field. */\n\t\tmax?: string;\n\t\t/** Granularity, in days, the fallback field's value must fall on. */\n\t\tstep?: number;\n\t\t/** Marks the fallback field required for its enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks the fallback field inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks the fallback field's value fixed, while keeping it focusable and included in form submission. */\n\t\treadOnly?: boolean;\n\t\t/** Native autofill hint for the fallback field, e.g. `\"bday\"`. */\n\t\tautoComplete?: string;\n\t\t/** Per-part styling for the fallback field's internally composed parts. Read only when `children` is unset. */\n\t\tparts?: PartsProps;\n\t\t/**\n\t\t * The composed layout — typically a `Label` and a\n\t\t * {@link DatePicker.Group} — rendered in place of the field, leaving every\n\t\t * field above unread.\n\t\t */\n\t\tchildren?: RemixNode;\n\t}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * `children` composes the field's own control, and a second one for a\n\t * range, into one visual row.\n\t */\n\texport interface GroupProps extends TagProps<\"div\"> {}\n}\n\n/**\n * Renders {@link DatePicker}'s root. Leaving `children` unset renders the field,\n * passing every prop above through unchanged; composing\n * {@link DatePicker.Group} as `children` instead renders the joined row and\n * leaves those props unread.\n *\n * @param handle Runtime handle carrying the root element's props.\n * @returns The render function producing the date picker's markup.\n * @example\n * <DatePicker label={t(\"form.birthday.label\")} name=\"birthday\" autoComplete=\"bday\" />\n * @example\n * <DatePicker>\n * \t<Label htmlFor=\"startDate\">{t(\"form.startDate.label\")}</Label>\n * \t<DatePicker.Group>\n * \t\t<Input id=\"startDate\" type=\"date\" name=\"startDate\" />\n * \t</DatePicker.Group>\n * </DatePicker>\n */\nexport function DatePicker(handle: Handle<DatePicker.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor,\n\t\t\tlabel,\n\t\t\tdescription,\n\t\t\terrorMessage,\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\tparts,\n\t\t\tchildren,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\n\t\tif (import.meta.env?.DEV && !children && !label) {\n\t\t\tconsole.warn(\n\t\t\t\t'DatePicker: falling back to DateField\\'s plain \"input type=date\" needs a \"label\" describing what it collects for assistive technology.',\n\t\t\t);\n\t\t}\n\n\t\tif (!children) {\n\t\t\treturn (\n\t\t\t\t<DateField\n\t\t\t\t\t{...rest}\n\t\t\t\t\tcolor={color}\n\t\t\t\t\tlabel={label}\n\t\t\t\t\tdescription={description}\n\t\t\t\t\terrorMessage={errorMessage}\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\tparts={parts}\n\t\t\t\t\tmix={mix}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"date-picker\" mix={mergeMix([flex(), flexCol(), gap(1)], mix)}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link DatePicker}'s control row: a flex host laying one or more date\n * controls side by side and joining their edges, so a pair reads as one field.\n * Focus and validity are drawn the way `Group` draws them — focus by the control\n * that holds it, validity once around the row.\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 * <DatePicker.Group>\n * \t<Input id=\"startDate\" type=\"date\" name=\"startDate\" />\n * </DatePicker.Group>\n */\nDatePicker.Group = function DatePickerGroup(handle: Handle<DatePicker.GroupProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"group\"\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\titems(\"center\"),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The fields compose into one control, so the pair keeps the rounding on its own\n\t\t\t\t\t\t * outer corners and the seam the two share is drawn once.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen(\"& > *:not(:first-child)\", [\n\t\t\t\t\t\t\troundedCorner(\"start-start\", \"none\"),\n\t\t\t\t\t\t\troundedCorner(\"end-start\", \"none\"),\n\t\t\t\t\t\t\tmis(\"-1px\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen(\"& > *:not(:last-child)\", [\n\t\t\t\t\t\t\troundedCorner(\"start-end\", \"none\"),\n\t\t\t\t\t\t\troundedCorner(\"end-end\", \"none\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Focus shows on the field holding it, naming which date has it where a ring around\n\t\t\t\t\t\t * the pair names only the group. That field is raised so its ring crosses the seam.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen(\"& > *:focus-visible\", z(1)),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Validity belongs to the pair, since a range is one value and half of one makes it\n\t\t\t\t\t\t * invalid: one ring is drawn around the group and each field's own ring is released,\n\t\t\t\t\t\t * so the seam shows one field needing attention.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t'&:has(> :user-invalid), &:has(> [aria-invalid=\"true\"])',\n\t\t\t\t\t\t\toutline({ color: \"danger.ring\", offset: 2 }),\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t'& > :user-invalid:not(:focus-visible), & > [aria-invalid=\"true\"]:not(:focus-visible)',\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Important so it reaches across to the cascade layer where `Input` states the field's\n\t\t\t\t\t\t\t * invalid ring. The selector excludes `:focus-visible`, so a field being filled in still\n\t\t\t\t\t\t\t * shows its own focus ring.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\traw({ outline: \"none !important\" }),\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"
13
13
  },
14
14
  "test": null
15
15
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "date-range-picker",
3
- "changedIn": "2026.10.20",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [
5
5
  "date-field",
6
6
  "date-picker"
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "source": {
12
12
  "path": "date-range-picker.tsx",
13
- "content": "/**\n * A paired-field date range control built on {@link DateField} — independent\n * start-date and end-date fields, each fully labeled, described, and validated\n * on its own — with a {@link DateRangePicker.Group} row for joining the two\n * into one control. The calendar is the platform's, since each field is a\n * native date input, so the whole range is pickable before any script loads.\n * Leaving `children` unset renders the pair on its own.\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, items } from \"@sdxc/u/layout\";\nimport { attrs } from \"remix/component\";\n\nimport { DateField } from \"@sdxc/ui/date-field\";\nimport { DatePicker } from \"@sdxc/ui/date-picker\";\n\n/**\n * Prop types for {@link DateRangePicker} and its compound parts.\n * {@link DateRangePicker.Group} aliases {@link DatePicker.Group} directly,\n * since a row of fields reads the same for a range as for a single date.\n */\nexport namespace DateRangePicker {\n\t/**\n\t * Semantic color role for the fallback pair's keyboard focus rings. Read\n\t * only by the fallback fields — {@link DateRangePicker.Group}'s composed\n\t * control carries no `color` prop of its own.\n\t */\n\texport type Color = DateField.Color;\n\n\t/**\n\t * Per-part styling for the two {@link DateField} instances the fallback\n\t * pair composes, each forwarded to that field's own `parts`. Read only\n\t * when `children` is unset; the composed layout styles its own parts individually instead.\n\t */\n\texport interface PartsProps {\n\t\t/** Per-part styling for the fallback pair's start-date field. */\n\t\tstart?: DateField.PartsProps;\n\t\t/** Per-part styling for the fallback pair's end-date field. */\n\t\tend?: DateField.PartsProps;\n\t}\n\n\t/**\n\t * Props accepted by {@link DateRangePicker}. Leaving `children` unset\n\t * renders two independent {@link DateField} instances — one per end of\n\t * the range — using every field below; composing\n\t * {@link DateRangePicker.Group} instead renders the joined row and leaves\n\t * every field below unread.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"children\"> {\n\t\t/** Semantic color role for the fallback pair's focus rings. Read only when `children` is unset. */\n\t\tcolor?: Color;\n\t\t/** The start-date field's caption, rendered through {@link DateField}. Read only when `children` is unset. */\n\t\tstartLabel?: RemixNode;\n\t\t/** The end-date field's caption, rendered through {@link DateField}. Read only when `children` is unset. */\n\t\tendLabel?: RemixNode;\n\t\t/** Supporting copy beneath the start-date field. Read only when `children` is unset. */\n\t\tstartDescription?: RemixNode;\n\t\t/** Supporting copy beneath the end-date field. Read only when `children` is unset. */\n\t\tendDescription?: RemixNode;\n\t\t/** Validation message beneath the start-date field. Read only when `children` is unset. */\n\t\tstartErrorMessage?: RemixNode;\n\t\t/** Validation message beneath the end-date field. Read only when `children` is unset. */\n\t\tendErrorMessage?: RemixNode;\n\t\t/** Native `name` submitted with an enclosing form for the start-date field. */\n\t\tstartName?: string;\n\t\t/** Native `name` submitted with an enclosing form for the end-date field. */\n\t\tendName?: string;\n\t\t/** Current start-of-range value, in `YYYY-MM-DD` form, for a fallback pair a consumer tracks itself. */\n\t\tstartValue?: string;\n\t\t/** Current end-of-range value, in `YYYY-MM-DD` form, for a fallback pair a consumer tracks itself. */\n\t\tendValue?: string;\n\t\t/** Initial start-of-range value, in `YYYY-MM-DD` form, for a fallback pair left to the platform's own uncontrolled state. */\n\t\tstartDefaultValue?: string;\n\t\t/** Initial end-of-range value, in `YYYY-MM-DD` form, for a fallback pair left to the platform's own uncontrolled state. */\n\t\tendDefaultValue?: string;\n\t\t/** Earliest accepted date, in `YYYY-MM-DD` form, read by both of the fallback pair's fields. */\n\t\tmin?: string;\n\t\t/** Latest accepted date, in `YYYY-MM-DD` form, read by both of the fallback pair's fields. */\n\t\tmax?: string;\n\t\t/** Granularity, in days, both of the fallback pair's values must fall on. */\n\t\tstep?: number;\n\t\t/** Marks both of the fallback pair's fields required for their enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks both of the fallback pair's fields inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks both of the fallback pair's fields' values fixed, while keeping them focusable and included in form submission. */\n\t\treadOnly?: boolean;\n\t\t/** Native autofill hint for both of the fallback pair's fields. */\n\t\tautoComplete?: string;\n\t\t/** Per-part styling for the fallback pair's internally composed {@link DateField} instances. Read only when `children` is unset. */\n\t\tparts?: PartsProps;\n\t\t/**\n\t\t * The joined layout — typically a `Label` and a\n\t\t * {@link DateRangePicker.Group} — rendered in place of the paired fields,\n\t\t * leaving every field above unread when set.\n\t\t */\n\t\tchildren?: RemixNode;\n\t}\n\n\t/**\n\t * Every prop {@link DatePicker.GroupProps} accepts, unchanged. `children`\n\t * composes the range's own start and end controls into one visual row.\n\t */\n\texport interface GroupProps extends DatePicker.GroupProps {}\n}\n\n/**\n * Renders {@link DateRangePicker}'s root. Leaving `children` unset renders\n * two independent {@link DateField} instances side by side under a native\n * `role=\"group\"`, each aligned to its own start edge so a validation message\n * under one never shifts the other's label; composing\n * {@link DateRangePicker.Group} as `children` instead joins the two fields into\n * one row and leaves every field prop above unread.\n *\n * @param handle Runtime handle carrying the root element's props.\n * @returns The render function producing the date range picker's markup.\n * @example\n * <DateRangePicker\n * \tstartLabel={t(\"form.stay.checkIn\")}\n * \tendLabel={t(\"form.stay.checkOut\")}\n * \tstartName=\"checkIn\"\n * \tendName=\"checkOut\"\n * />\n * @example\n * <DateRangePicker>\n * \t<Label htmlFor=\"tripStart\">{t(\"form.trip.label\")}</Label>\n * \t<DateRangePicker.Group>\n * \t\t<Input id=\"tripStart\" type=\"date\" name=\"tripStart\" aria-label={t(\"form.trip.start\")} />\n * \t\t<Input id=\"tripEnd\" type=\"date\" name=\"tripEnd\" aria-label={t(\"form.trip.end\")} />\n * \t</DateRangePicker.Group>\n * </DateRangePicker>\n */\nexport function DateRangePicker(handle: Handle<DateRangePicker.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor,\n\t\t\tstartLabel,\n\t\t\tendLabel,\n\t\t\tstartDescription,\n\t\t\tendDescription,\n\t\t\tstartErrorMessage,\n\t\t\tendErrorMessage,\n\t\t\tstartName,\n\t\t\tendName,\n\t\t\tstartValue,\n\t\t\tendValue,\n\t\t\tstartDefaultValue,\n\t\t\tendDefaultValue,\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\tparts,\n\t\t\tchildren,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\n\t\tif (import.meta.env?.DEV && !children) {\n\t\t\tif (!startLabel) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'DateRangePicker: falling back to paired \"input type=date\" fields needs a \"startLabel\" describing the range\\'s start for assistive technology.',\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!endLabel) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'DateRangePicker: falling back to paired \"input type=date\" fields needs an \"endLabel\" describing the range\\'s end for assistive technology.',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (!children) {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\t{...rest}\n\t\t\t\t\tdata-slot=\"fields\"\n\t\t\t\t\tmix={[attrs({ role: \"group\" }), flex(), gap(2), items(\"start\"), mix]}\n\t\t\t\t>\n\t\t\t\t\t<DateField\n\t\t\t\t\t\tcolor={color}\n\t\t\t\t\t\tlabel={startLabel}\n\t\t\t\t\t\tdescription={startDescription}\n\t\t\t\t\t\terrorMessage={startErrorMessage}\n\t\t\t\t\t\tname={startName}\n\t\t\t\t\t\tvalue={startValue}\n\t\t\t\t\t\tdefaultValue={startDefaultValue}\n\t\t\t\t\t\tmin={min}\n\t\t\t\t\t\tmax={max}\n\t\t\t\t\t\tstep={step}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t\tparts={parts?.start}\n\t\t\t\t\t/>\n\t\t\t\t\t<DateField\n\t\t\t\t\t\tcolor={color}\n\t\t\t\t\t\tlabel={endLabel}\n\t\t\t\t\t\tdescription={endDescription}\n\t\t\t\t\t\terrorMessage={endErrorMessage}\n\t\t\t\t\t\tname={endName}\n\t\t\t\t\t\tvalue={endValue}\n\t\t\t\t\t\tdefaultValue={endDefaultValue}\n\t\t\t\t\t\tmin={min}\n\t\t\t\t\t\tmax={max}\n\t\t\t\t\t\tstep={step}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t\tparts={parts?.end}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"date-range-picker\" mix={[flex(), flexCol(), gap(1), mix]}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link DateRangePicker}'s control row: identical to\n * {@link DatePicker.Group}'s markup and focus-within outline. `children`\n * composes the range's start and end controls with {@link DateRangePicker.Button}, and the row gains a keyboard focus ring whenever focus lands anywhere inside it.\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 * <DateRangePicker.Group>\n * \t<Input id=\"tripStart\" type=\"date\" name=\"tripStart\" aria-label={t(\"form.trip.start\")} />\n * \t<Input id=\"tripEnd\" type=\"date\" name=\"tripEnd\" aria-label={t(\"form.trip.end\")} />\n * </DateRangePicker.Group>\n */\nDateRangePicker.Group = DatePicker.Group;\n"
13
+ "content": "/**\n * A paired-field date range control built on {@link DateField} — independent\n * start-date and end-date fields, each fully labeled, described, and validated\n * on its own — with a {@link DateRangePicker.Group} row for joining the two\n * into one control. The calendar is the platform's, since each field is a\n * native date input, so the whole range is pickable before any script loads.\n * Leaving `children` unset renders the pair on its own.\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 { flex, flexCol, gap, items } from \"@sdxc/u/layout\";\nimport { attrs } from \"remix/component\";\n\nimport { DateField } from \"@sdxc/ui/date-field\";\nimport { DatePicker } from \"@sdxc/ui/date-picker\";\n\n/**\n * Prop types for {@link DateRangePicker} and its compound parts.\n * {@link DateRangePicker.Group} aliases {@link DatePicker.Group} directly,\n * since a row of fields reads the same for a range as for a single date.\n */\nexport namespace DateRangePicker {\n\t/**\n\t * Semantic color role for the fallback pair's keyboard focus rings. Read\n\t * only by the fallback fields — {@link DateRangePicker.Group}'s composed\n\t * control carries no `color` prop of its own.\n\t */\n\texport type Color = DateField.Color;\n\n\t/**\n\t * Per-part styling for the two {@link DateField} instances the fallback\n\t * pair composes, each forwarded to that field's own `parts`. Read only\n\t * when `children` is unset; the composed layout styles its own parts individually instead.\n\t */\n\texport interface PartsProps {\n\t\t/** Per-part styling for the fallback pair's start-date field. */\n\t\tstart?: DateField.PartsProps;\n\t\t/** Per-part styling for the fallback pair's end-date field. */\n\t\tend?: DateField.PartsProps;\n\t}\n\n\t/**\n\t * Props accepted by {@link DateRangePicker}. Leaving `children` unset\n\t * renders two independent {@link DateField} instances — one per end of\n\t * the range — using every field below; composing\n\t * {@link DateRangePicker.Group} instead renders the joined row and leaves\n\t * every field below unread.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"children\"> {\n\t\t/** Semantic color role for the fallback pair's focus rings. Read only when `children` is unset. */\n\t\tcolor?: Color;\n\t\t/** The start-date field's caption, rendered through {@link DateField}. Read only when `children` is unset. */\n\t\tstartLabel?: RemixNode;\n\t\t/** The end-date field's caption, rendered through {@link DateField}. Read only when `children` is unset. */\n\t\tendLabel?: RemixNode;\n\t\t/** Supporting copy beneath the start-date field. Read only when `children` is unset. */\n\t\tstartDescription?: RemixNode;\n\t\t/** Supporting copy beneath the end-date field. Read only when `children` is unset. */\n\t\tendDescription?: RemixNode;\n\t\t/** Validation message beneath the start-date field. Read only when `children` is unset. */\n\t\tstartErrorMessage?: RemixNode;\n\t\t/** Validation message beneath the end-date field. Read only when `children` is unset. */\n\t\tendErrorMessage?: RemixNode;\n\t\t/** Native `name` submitted with an enclosing form for the start-date field. */\n\t\tstartName?: string;\n\t\t/** Native `name` submitted with an enclosing form for the end-date field. */\n\t\tendName?: string;\n\t\t/** Current start-of-range value, in `YYYY-MM-DD` form, for a fallback pair a consumer tracks itself. */\n\t\tstartValue?: string;\n\t\t/** Current end-of-range value, in `YYYY-MM-DD` form, for a fallback pair a consumer tracks itself. */\n\t\tendValue?: string;\n\t\t/** Initial start-of-range value, in `YYYY-MM-DD` form, for a fallback pair left to the platform's own uncontrolled state. */\n\t\tstartDefaultValue?: string;\n\t\t/** Initial end-of-range value, in `YYYY-MM-DD` form, for a fallback pair left to the platform's own uncontrolled state. */\n\t\tendDefaultValue?: string;\n\t\t/** Earliest accepted date, in `YYYY-MM-DD` form, read by both of the fallback pair's fields. */\n\t\tmin?: string;\n\t\t/** Latest accepted date, in `YYYY-MM-DD` form, read by both of the fallback pair's fields. */\n\t\tmax?: string;\n\t\t/** Granularity, in days, both of the fallback pair's values must fall on. */\n\t\tstep?: number;\n\t\t/** Marks both of the fallback pair's fields required for their enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks both of the fallback pair's fields inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks both of the fallback pair's fields' values fixed, while keeping them focusable and included in form submission. */\n\t\treadOnly?: boolean;\n\t\t/** Native autofill hint for both of the fallback pair's fields. */\n\t\tautoComplete?: string;\n\t\t/** Per-part styling for the fallback pair's internally composed {@link DateField} instances. Read only when `children` is unset. */\n\t\tparts?: PartsProps;\n\t\t/**\n\t\t * The joined layout — typically a `Label` and a\n\t\t * {@link DateRangePicker.Group} — rendered in place of the paired fields,\n\t\t * leaving every field above unread when set.\n\t\t */\n\t\tchildren?: RemixNode;\n\t}\n\n\t/**\n\t * Every prop {@link DatePicker.GroupProps} accepts, unchanged. `children`\n\t * composes the range's own start and end controls into one visual row.\n\t */\n\texport interface GroupProps extends DatePicker.GroupProps {}\n}\n\n/**\n * Renders {@link DateRangePicker}'s root. Leaving `children` unset renders\n * two independent {@link DateField} instances side by side under a native\n * `role=\"group\"`, each aligned to its own start edge so a validation message\n * under one never shifts the other's label; composing\n * {@link DateRangePicker.Group} as `children` instead joins the two fields into\n * one row and leaves every field prop above unread.\n *\n * @param handle Runtime handle carrying the root element's props.\n * @returns The render function producing the date range picker's markup.\n * @example\n * <DateRangePicker\n * \tstartLabel={t(\"form.stay.checkIn\")}\n * \tendLabel={t(\"form.stay.checkOut\")}\n * \tstartName=\"checkIn\"\n * \tendName=\"checkOut\"\n * />\n * @example\n * <DateRangePicker>\n * \t<Label htmlFor=\"tripStart\">{t(\"form.trip.label\")}</Label>\n * \t<DateRangePicker.Group>\n * \t\t<Input id=\"tripStart\" type=\"date\" name=\"tripStart\" aria-label={t(\"form.trip.start\")} />\n * \t\t<Input id=\"tripEnd\" type=\"date\" name=\"tripEnd\" aria-label={t(\"form.trip.end\")} />\n * \t</DateRangePicker.Group>\n * </DateRangePicker>\n */\nexport function DateRangePicker(handle: Handle<DateRangePicker.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor,\n\t\t\tstartLabel,\n\t\t\tendLabel,\n\t\t\tstartDescription,\n\t\t\tendDescription,\n\t\t\tstartErrorMessage,\n\t\t\tendErrorMessage,\n\t\t\tstartName,\n\t\t\tendName,\n\t\t\tstartValue,\n\t\t\tendValue,\n\t\t\tstartDefaultValue,\n\t\t\tendDefaultValue,\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\tparts,\n\t\t\tchildren,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\n\t\tif (import.meta.env?.DEV && !children) {\n\t\t\tif (!startLabel) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'DateRangePicker: falling back to paired \"input type=date\" fields needs a \"startLabel\" describing the range\\'s start for assistive technology.',\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!endLabel) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'DateRangePicker: falling back to paired \"input type=date\" fields needs an \"endLabel\" describing the range\\'s end for assistive technology.',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (!children) {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\t{...rest}\n\t\t\t\t\tdata-slot=\"fields\"\n\t\t\t\t\tmix={mergeMix([attrs({ role: \"group\" }), flex(), gap(2), items(\"start\")], mix)}\n\t\t\t\t>\n\t\t\t\t\t<DateField\n\t\t\t\t\t\tcolor={color}\n\t\t\t\t\t\tlabel={startLabel}\n\t\t\t\t\t\tdescription={startDescription}\n\t\t\t\t\t\terrorMessage={startErrorMessage}\n\t\t\t\t\t\tname={startName}\n\t\t\t\t\t\tvalue={startValue}\n\t\t\t\t\t\tdefaultValue={startDefaultValue}\n\t\t\t\t\t\tmin={min}\n\t\t\t\t\t\tmax={max}\n\t\t\t\t\t\tstep={step}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t\tparts={parts?.start}\n\t\t\t\t\t/>\n\t\t\t\t\t<DateField\n\t\t\t\t\t\tcolor={color}\n\t\t\t\t\t\tlabel={endLabel}\n\t\t\t\t\t\tdescription={endDescription}\n\t\t\t\t\t\terrorMessage={endErrorMessage}\n\t\t\t\t\t\tname={endName}\n\t\t\t\t\t\tvalue={endValue}\n\t\t\t\t\t\tdefaultValue={endDefaultValue}\n\t\t\t\t\t\tmin={min}\n\t\t\t\t\t\tmax={max}\n\t\t\t\t\t\tstep={step}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t\tparts={parts?.end}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"date-range-picker\" mix={mergeMix([flex(), flexCol(), gap(1)], mix)}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link DateRangePicker}'s control row: identical to\n * {@link DatePicker.Group}'s markup and focus-within outline. `children`\n * composes the range's start and end controls with {@link DateRangePicker.Button}, and the row gains a keyboard focus ring whenever focus lands anywhere inside it.\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 * <DateRangePicker.Group>\n * \t<Input id=\"tripStart\" type=\"date\" name=\"tripStart\" aria-label={t(\"form.trip.start\")} />\n * \t<Input id=\"tripEnd\" type=\"date\" name=\"tripEnd\" aria-label={t(\"form.trip.end\")} />\n * </DateRangePicker.Group>\n */\nDateRangePicker.Group = DatePicker.Group;\n"
14
14
  },
15
15
  "test": null
16
16
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "description",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Description"
7
7
  ],
8
8
  "source": {
9
9
  "path": "description.tsx",
10
- "content": "/**\n * A short passage of supporting copy beneath a form control, styled at the\n * library's default text size and the neutral muted foreground color. It\n * renders as a native `<p>` so a consumer can wire its `id` into the\n * control's `aria-describedby`, giving assistive technology a spoken hint,\n * format requirement, or constraint alongside the control's label.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { fg } from \"@sdxc/u/color\";\nimport { pretty, text } from \"@sdxc/u/typography\";\n\n/**\n * Prop types for {@link Description}.\n */\nexport namespace Description {\n\t/**\n\t * Every native `<p>` attribute, unchanged, plus the `mix` passthrough,\n\t * always rendering at the library's default body-copy size and muted\n\t * foreground color. Give it an `id` referenced by the paired control's `aria-describedby` to associate the two.\n\t */\n\texport interface Props extends TagProps<\"p\"> {}\n}\n\n/**\n * Renders its children inside a `<p>` sized and colored as a small run of\n * supporting copy: the library's default text size paired with the neutral\n * muted foreground color, placed after a control inside a field wrapper as a format hint or constraint note.\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 * <Description id=\"password-hint\">\n * {t(\"field.password.hint\")}\n * </Description>\n */\nexport function Description(handle: Handle<Description.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <p {...rest} mix={[fg(\"neutral.muted\"), text(\"sm\"), pretty(), mix]} />;\n\t};\n}\n"
10
+ "content": "/**\n * A short passage of supporting copy beneath a form control, styled at the\n * library's default text size and the neutral muted foreground color. It\n * renders as a native `<p>` so a consumer can wire its `id` into the\n * control's `aria-describedby`, giving assistive technology a spoken hint,\n * format requirement, or constraint alongside the control's label.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { fg } from \"@sdxc/u/color\";\nimport { mergeMix } from \"@sdxc/u/general\";\nimport { pretty, text } from \"@sdxc/u/typography\";\n\n/**\n * Prop types for {@link Description}.\n */\nexport namespace Description {\n\t/**\n\t * Every native `<p>` attribute, unchanged, plus the `mix` passthrough,\n\t * always rendering at the library's default body-copy size and muted\n\t * foreground color. Give it an `id` referenced by the paired control's `aria-describedby` to associate the two.\n\t */\n\texport interface Props extends TagProps<\"p\"> {}\n}\n\n/**\n * Renders its children inside a `<p>` sized and colored as a small run of\n * supporting copy: the library's default text size paired with the neutral\n * muted foreground color, placed after a control inside a field wrapper as a format hint or constraint note.\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 * <Description id=\"password-hint\">\n * {t(\"field.password.hint\")}\n * </Description>\n */\nexport function Description(handle: Handle<Description.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <p {...rest} mix={mergeMix([fg(\"neutral.muted\"), text(\"sm\"), pretty()], mix)} />;\n\t};\n}\n"
11
11
  },
12
12
  "test": null
13
13
  }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "dialog-dismiss",
3
+ "changedIn": "2026.11.1",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "DialogDismiss"
7
+ ],
8
+ "source": {
9
+ "path": "dialog-dismiss.tsx",
10
+ "content": "/**\n * Client island that closes the modal `<dialog>` it renders inside on a backdrop press or a\n * followed link, for a navigation sheet or drawer whose links include same-page anchors.\n * It owns no visible markup, so it drops into any dialog's content.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { EntryComponent } from \"remix/component\";\n\nimport { hidden } from \"@sdxc/u/layout\";\nimport { clientEntry } from \"remix/component\";\n\nimport { dialogDismiss } from \"@sdxc/ui/mixins\";\n\n/**\n * Renders a hidden marker carrying {@link dialogDismiss}. The island loads from the bare\n * `@sdxc/ui/dialog-dismiss` specifier, which the app's browser entry maps to a dynamic\n * import. A page restored from the back-forward cache returns with the dialog closed.\n *\n * @example\n * <SiteHeader brand={<Logo />} items={items} sheet={<DialogDismiss />} />\n */\nexport const DialogDismiss: EntryComponent<Record<never, never>> = clientEntry(\n\t\"@sdxc/ui/dialog-dismiss#DialogDismiss\",\n\tfunction DialogDismiss() {\n\t\treturn () => <span mix={[hidden(), dialogDismiss()]} />;\n\t},\n);\n"
11
+ },
12
+ "test": null
13
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dialog",
3
- "changedIn": "2026.10.20",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [
5
5
  "button",
6
6
  "heading-scope"
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "source": {
12
12
  "path": "dialog.tsx",
13
- "content": "/**\n * A modal surface built on the native `<dialog>` element, opened and closed\n * declaratively through Invoker Commands (`commandfor`/`command`) instead of\n * a JavaScript-tracked open state. Compound parts cover a header, title,\n * description, footer, and a dismiss control, so a page composes only the\n * pieces a given dialog needs.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { XIcon } from \"@sdxc/icons\";\nimport { bg, border, fg, outline } from \"@sdxc/u/color\";\nimport {\n\tbackdropBlur,\n\tbackdropSaturate,\n\topacity,\n\trounded,\n\tshadow,\n\ttransition,\n\ttransitionBehavior,\n} from \"@sdxc/u/effects\";\nimport { raw, vars } from \"@sdxc/u/general\";\nimport {\n\tabsolute,\n\tcontainer,\n\tfixed,\n\tflex,\n\tflexCol,\n\tflexColReverse,\n\tflexRow,\n\tgap,\n\tinset,\n\tjustify,\n\trelative,\n} from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { at, media, startingStyle, supports } from \"@sdxc/u/responsive\";\nimport { is, maxBs, maxIs, p } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport {\n\tbalance,\n\tfontSize,\n\tleading,\n\tpretty,\n\ttextAlign,\n\ttracking,\n\tweight,\n} from \"@sdxc/u/typography\";\n\nimport { durations, easings } from \"@sdxc/ui/animations\";\nimport { SHADOW_RING } from \"@sdxc/ui/styles\";\n\nimport { Button } from \"@sdxc/ui/button\";\nimport { resolveHeadingLevel, TAG_BY_LEVEL } from \"@sdxc/ui/heading-scope\";\n\n/**\n * Named container {@link Dialog} declares on its own host, so\n * {@link Dialog.Header} and {@link Dialog.Footer} can query the panel's own\n * width instead of the page's.\n */\nconst CONTAINER_NAME = \"ui-dialog\";\n\n/**\n * Panel width from which {@link Dialog.Header} and {@link Dialog.Footer} lay out for a\n * comfortable dialog: a leading title and a trailing row of actions. It is measured\n * against the panel's own inline size, which a dialog keeps well under a viewport's.\n */\nconst COMFORTABLE_WIDTH = \"24rem\";\n\n/**\n * Invoker Commands verb {@link Dialog.CloseProps.command} falls back to when\n * omitted, dismissing the ancestor Dialog named by `commandfor`.\n */\nconst DEFAULT_CLOSE_COMMAND = \"close\";\n\n/**\n * Prop types for {@link Dialog} and its compound parts.\n */\nexport namespace Dialog {\n\t/**\n\t * Every native `<dialog>` attribute, plus the `mix` passthrough. `role`\n\t * stays the platform's implicit `\"dialog\"` unless set to `\"alertdialog\"`,\n\t * and `open`/`closedby` stay the platform's own native state and light-dismiss controls.\n\t */\n\texport interface Props extends TagProps<\"dialog\"> {\n\t\t/** The panel's compound parts: {@link Dialog.Header}, {@link Dialog.Footer}, {@link Dialog.Close}, or any other content. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Dialog.Header}.\n\t */\n\texport interface HeaderProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Props accepted by {@link Dialog.Title}. Every native heading-element\n\t * attribute still applies, since the rendered tag depends on the nearest\n\t * ambient heading level, falling back to `<h1>` where none is set.\n\t */\n\texport interface TitleProps extends TagProps<\"h1\"> {}\n\n\t/**\n\t * Props accepted by {@link Dialog.Description}.\n\t */\n\texport interface DescriptionProps extends TagProps<\"p\"> {}\n\n\t/**\n\t * Props accepted by {@link Dialog.Footer}.\n\t */\n\texport interface FooterProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Props accepted by {@link Dialog.Close}: every {@link Button.Props} field\n\t * except the ones this component fixes on the consumer's behalf.\n\t */\n\texport interface CloseProps extends Omit<\n\t\tButton.Props,\n\t\t\"children\" | \"variant\" | \"color\" | \"size\" | \"aria-label\" | \"commandfor\" | \"command\"\n\t> {\n\t\t/** `id` of the ancestor {@link Dialog} this button dismisses. */\n\t\tcommandfor: string;\n\t\t/** Invoker Commands verb dispatched to the target Dialog. Defaults to `\"close\"`. */\n\t\tcommand?: \"close\";\n\t\t/**\n\t\t * Accessible label for the icon-only control — required, since the\n\t\t * button carries no visible text for assistive technology to read.\n\t\t */\n\t\t\"aria-label\": string;\n\t}\n}\n\n/**\n * Renders the dialog panel as a native `<dialog>` host, its `::backdrop`\n * tinted and, where supported, blurred to dim the page behind it. The panel\n * declares the `ui-dialog` named container so {@link Dialog.Header} and {@link Dialog.Footer} can size against the panel's own width; Invoker Commands open and close it declaratively — a trigger elsewhere points `commandfor` at this element's `id` with `command=\"show-modal\"`, and any control inside, including {@link Dialog.Close}, points `commandfor` at that same `id` with `command=\"close\"`.\n *\n * @param handle Runtime handle carrying the host `<dialog>`'s props.\n * @returns The render function producing the panel's markup.\n * @example\n * <Button commandfor=\"confirm-delete\" command=\"show-modal\">{t(\"project.delete\")}</Button>\n * <Dialog id=\"confirm-delete\" aria-labelledby=\"confirm-delete-title\">\n * \t<Dialog.Header>\n * \t\t<Dialog.Title id=\"confirm-delete-title\">{t(\"project.deleteTitle\")}</Dialog.Title>\n * \t\t<Dialog.Description>{t(\"project.deleteDescription\")}</Dialog.Description>\n * \t</Dialog.Header>\n * \t<Dialog.Footer>\n * \t\t<Button commandfor=\"confirm-delete\" command=\"close\" color=\"danger\">{t(\"actions.delete\")}</Button>\n * \t</Dialog.Footer>\n * \t<Dialog.Close commandfor=\"confirm-delete\" aria-label={t(\"actions.close\")} />\n * </Dialog>\n * @example\n * <Dialog id=\"welcome\" mix={zoom({ duration: durations.normal })}>\n * \t<Dialog.Header>\n * \t\t<Dialog.Title>{t(\"welcome.title\")}</Dialog.Title>\n * \t</Dialog.Header>\n * </Dialog>\n */\nexport function Dialog(handle: Handle<Dialog.Props>) {\n\treturn () => {\n\t\tlet { id, children, mix, ...rest } = handle.props;\n\n\t\tif (import.meta.env?.DEV && !id) {\n\t\t\tconsole.warn(\n\t\t\t\t'Dialog rendered without an \"id\" — \"commandfor\" on a trigger or close control has nothing to target.',\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<dialog\n\t\t\t\t{...rest}\n\t\t\t\tid={id}\n\t\t\t\tdata-slot=\"dialog\"\n\t\t\t\tmix={[\n\t\t\t\t\t/**\n\t\t\t\t\t * Establishes the containing block {@link Dialog.Close} pins itself to while\n\t\t\t\t\t * the panel sits in the page's flow, which a dialog opened through its `open`\n\t\t\t\t\t * attribute alone does.\n\t\t\t\t\t */\n\t\t\t\t\trelative(),\n\t\t\t\t\t/**\n\t\t\t\t\t * Measures a modal panel against the viewport, so it stays centered on screen\n\t\t\t\t\t * however far the page behind it is scrolled: the top layer resolves any other\n\t\t\t\t\t * positioning scheme against the document's own coordinates.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"&:modal\", fixed()),\n\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * Wide enough for the form a dialog usually carries, so a field, its help text and a row\n\t\t\t\t\t * of actions read as one column. A consumer with less to say narrows it through `mix`.\n\t\t\t\t\t */\n\t\t\t\t\tmaxIs(\"32rem\"),\n\t\t\t\t\tmaxBs(\"90vh\"),\n\t\t\t\t\tgap(6),\n\t\t\t\t\tp(6),\n\t\t\t\t\toverflow(\"auto\"),\n\t\t\t\t\t/** Gated on `[open]` so the UA's own `dialog:not([open])` hiding still applies. */\n\t\t\t\t\twhen(\"&[open]\", flex()),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tcontainer(CONTAINER_NAME, \"inline-size\"),\n\t\t\t\t\twhen(\"&::backdrop\", [\n\t\t\t\t\t\tbg(\"rgb(0 0 0 / 0.5)\"),\n\t\t\t\t\t\ttransitionBehavior(\"allow-discrete\"),\n\t\t\t\t\t\topacity(0),\n\t\t\t\t\t\ttransition(\"opacity, display, overlay\", {\n\t\t\t\t\t\t\tduration: durations.normal,\n\t\t\t\t\t\t\teasing: easings.standard,\n\t\t\t\t\t\t}),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\"&[open]::backdrop\", opacity(100)),\n\t\t\t\t\tsupports(\n\t\t\t\t\t\t\"(backdrop-filter: blur(0))\",\n\t\t\t\t\t\tmedia(\n\t\t\t\t\t\t\t\"(prefers-reduced-transparency: no-preference)\",\n\t\t\t\t\t\t\twhen(\"&::backdrop\", [backdropBlur(\"md\"), backdropSaturate(1.4)]),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tstartingStyle(when(\"&[open]::backdrop\", opacity(0))),\n\t\t\t\t\toutline(\"none\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * The panel's edge is a ring shadow that takes on the tone behind it, over a\n\t\t\t\t\t * transparent border that forced-colors mode still paints as a line.\n\t\t\t\t\t */\n\t\t\t\t\tborder({ color: \"transparent\", width: 1 }),\n\t\t\t\t\tshadow(\"xl\"),\n\t\t\t\t\tvars({ \"ui-box-shadow-ring\": SHADOW_RING }),\n\t\t\t\t\t/** `overscrollBehavior` has no matching utility. */\n\t\t\t\t\traw({ overscrollBehavior: \"contain\" }),\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</dialog>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Dialog.HeaderProps.children} as the panel's header slot: a\n * column stacking {@link Dialog.Title} and {@link Dialog.Description},\n * centered while narrow and start-aligned (flipping under `dir=\"rtl\"`) once the panel's own `ui-dialog` container grows past `40rem`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the header slot's markup.\n * @example\n * <Dialog.Header>\n * \t<Dialog.Title>{t(\"project.deleteTitle\")}</Dialog.Title>\n * \t<Dialog.Description>{t(\"project.deleteDescription\")}</Dialog.Description>\n * </Dialog.Header>\n */\nDialog.Header = function DialogHeader(handle: Handle<Dialog.HeaderProps>) {\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=\"header\"\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tgap(1.5),\n\t\t\t\t\ttextAlign(\"center\"),\n\t\t\t\t\tat(COMFORTABLE_WIDTH, CONTAINER_NAME, textAlign(\"start\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Dialog.TitleProps.children} as the panel's heading, inside\n * the native heading element matching the nearest ambient heading level —\n * `<h1>` by default — sized and weighted as the panel's most prominent line of text at every level.\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 * <Dialog.Title>{t(\"project.deleteTitle\")}</Dialog.Title>\n */\nDialog.Title = function DialogTitle(handle: Handle<Dialog.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-slot=\"title\"\n\t\t\t\tmix={[\n\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\tweight(\"semibold\"),\n\t\t\t\t\ttracking(\"tight\"),\n\t\t\t\t\tfontSize(\"lg\"),\n\t\t\t\t\tleading(1),\n\t\t\t\t\tbalance(),\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 {@link Dialog.DescriptionProps.children} as the panel's supporting\n * copy, in a native `<p>` set to the panel's muted foreground color so it\n * reads as secondary to {@link Dialog.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 * <Dialog.Description>{t(\"project.deleteDescription\")}</Dialog.Description>\n */\nDialog.Description = function DialogDescription(handle: Handle<Dialog.DescriptionProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<p\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"description\"\n\t\t\t\tmix={[fg(\"neutral.muted\"), fontSize(\"sm\"), pretty(), mix]}\n\t\t\t>\n\t\t\t\t{rest.children}\n\t\t\t</p>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Dialog.FooterProps.children} as the panel's action row: a\n * column of stacked, full-width controls while the panel is narrow,\n * switching to a single end-aligned row past the panel's own `40rem` container mark.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the action row's markup.\n * @example\n * <Dialog.Footer>\n * \t<Button commandfor=\"confirm-delete\" command=\"close\" variant=\"outline\">{t(\"actions.cancel\")}</Button>\n * \t<Button commandfor=\"confirm-delete\" command=\"close\" color=\"danger\">{t(\"actions.delete\")}</Button>\n * </Dialog.Footer>\n */\nDialog.Footer = function DialogFooter(handle: Handle<Dialog.FooterProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"footer\"\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\tgap(2),\n\t\t\t\t\tflexColReverse(),\n\t\t\t\t\tat(COMFORTABLE_WIDTH, CONTAINER_NAME, [flexRow(), justify(\"end\")]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a dismiss control for the ancestor {@link Dialog} named by\n * `commandfor`: a small, ghost-styled {@link Button} with a fixed \"X\" glyph,\n * pinned to the panel's corner. `command` defaults to `\"close\"`, so passing only `commandfor` and `aria-label` wires it up.\n *\n * @param handle Runtime handle carrying the host button's props.\n * @returns The render function producing the dismiss control's markup.\n * @example\n * <Dialog.Close commandfor=\"confirm-delete\" aria-label={t(\"actions.close\")} />\n */\nDialog.Close = function DialogClose(handle: Handle<Dialog.CloseProps>) {\n\treturn () => {\n\t\tlet { commandfor, command, mix, ...rest } = handle.props;\n\t\tlet resolvedCommand = command ?? DEFAULT_CLOSE_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=\"ghost\"\n\t\t\t\tcolor=\"neutral\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\tcommandfor={commandfor}\n\t\t\t\tcommand={resolvedCommand}\n\t\t\t\tdata-slot=\"close\"\n\t\t\t\tmix={[absolute(), inset(4, 4, \"auto\", \"auto\"), mix]}\n\t\t\t>\n\t\t\t\t<XIcon size={16} />\n\t\t\t</Button>\n\t\t);\n\t};\n};\n"
13
+ "content": "/**\n * A modal surface built on the native `<dialog>` element, opened and closed\n * declaratively through Invoker Commands (`commandfor`/`command`) instead of\n * a JavaScript-tracked open state. Compound parts cover a header, title,\n * description, footer, and a dismiss control, so a page composes only the\n * pieces a given dialog needs.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { XIcon } from \"@sdxc/icons\";\nimport { bg, border, fg, outline } from \"@sdxc/u/color\";\nimport {\n\tbackdropBlur,\n\tbackdropSaturate,\n\topacity,\n\trounded,\n\tshadow,\n\ttransition,\n\ttransitionBehavior,\n} from \"@sdxc/u/effects\";\nimport { raw, vars, mergeMix } from \"@sdxc/u/general\";\nimport {\n\tabsolute,\n\tcontainer,\n\tfixed,\n\tflex,\n\tflexCol,\n\tflexColReverse,\n\tflexRow,\n\tgap,\n\tinset,\n\tjustify,\n\trelative,\n} from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { at, media, startingStyle, supports } from \"@sdxc/u/responsive\";\nimport { is, maxBs, maxIs, p } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport {\n\tbalance,\n\tfontSize,\n\tleading,\n\tpretty,\n\ttextAlign,\n\ttracking,\n\tweight,\n} from \"@sdxc/u/typography\";\n\nimport { durations, easings } from \"@sdxc/ui/animations\";\nimport { SHADOW_RING } from \"@sdxc/ui/styles\";\n\nimport { Button } from \"@sdxc/ui/button\";\nimport { resolveHeadingLevel, TAG_BY_LEVEL } from \"@sdxc/ui/heading-scope\";\n\n/**\n * Named container {@link Dialog} declares on its own host, so\n * {@link Dialog.Header} and {@link Dialog.Footer} can query the panel's own\n * width instead of the page's.\n */\nconst CONTAINER_NAME = \"ui-dialog\";\n\n/**\n * Panel width from which {@link Dialog.Header} and {@link Dialog.Footer} lay out for a\n * comfortable dialog: a leading title and a trailing row of actions. It is measured\n * against the panel's own inline size, which a dialog keeps well under a viewport's.\n */\nconst COMFORTABLE_WIDTH = \"24rem\";\n\n/**\n * Invoker Commands verb {@link Dialog.CloseProps.command} falls back to when\n * omitted, dismissing the ancestor Dialog named by `commandfor`.\n */\nconst DEFAULT_CLOSE_COMMAND = \"close\";\n\n/**\n * Prop types for {@link Dialog} and its compound parts.\n */\nexport namespace Dialog {\n\t/**\n\t * Every native `<dialog>` attribute, plus the `mix` passthrough. `role`\n\t * stays the platform's implicit `\"dialog\"` unless set to `\"alertdialog\"`,\n\t * and `open`/`closedby` stay the platform's own native state and light-dismiss controls.\n\t */\n\texport interface Props extends TagProps<\"dialog\"> {\n\t\t/** The panel's compound parts: {@link Dialog.Header}, {@link Dialog.Footer}, {@link Dialog.Close}, or any other content. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Dialog.Header}.\n\t */\n\texport interface HeaderProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Props accepted by {@link Dialog.Title}. Every native heading-element\n\t * attribute still applies, since the rendered tag depends on the nearest\n\t * ambient heading level, falling back to `<h1>` where none is set.\n\t */\n\texport interface TitleProps extends TagProps<\"h1\"> {}\n\n\t/**\n\t * Props accepted by {@link Dialog.Description}.\n\t */\n\texport interface DescriptionProps extends TagProps<\"p\"> {}\n\n\t/**\n\t * Props accepted by {@link Dialog.Footer}.\n\t */\n\texport interface FooterProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Props accepted by {@link Dialog.Close}: every {@link Button.Props} field\n\t * except the ones this component fixes on the consumer's behalf.\n\t */\n\texport interface CloseProps extends Omit<\n\t\tButton.Props,\n\t\t\"children\" | \"variant\" | \"color\" | \"size\" | \"aria-label\" | \"commandfor\" | \"command\"\n\t> {\n\t\t/** `id` of the ancestor {@link Dialog} this button dismisses. */\n\t\tcommandfor: string;\n\t\t/** Invoker Commands verb dispatched to the target Dialog. Defaults to `\"close\"`. */\n\t\tcommand?: \"close\";\n\t\t/**\n\t\t * Accessible label for the icon-only control — required, since the\n\t\t * button carries no visible text for assistive technology to read.\n\t\t */\n\t\t\"aria-label\": string;\n\t}\n}\n\n/**\n * Renders the dialog panel as a native `<dialog>` host, its `::backdrop`\n * tinted and, where supported, blurred to dim the page behind it. The panel\n * declares the `ui-dialog` named container so {@link Dialog.Header} and {@link Dialog.Footer} can size against the panel's own width; Invoker Commands open and close it declaratively — a trigger elsewhere points `commandfor` at this element's `id` with `command=\"show-modal\"`, and any control inside, including {@link Dialog.Close}, points `commandfor` at that same `id` with `command=\"close\"`.\n *\n * @param handle Runtime handle carrying the host `<dialog>`'s props.\n * @returns The render function producing the panel's markup.\n * @example\n * <Button commandfor=\"confirm-delete\" command=\"show-modal\">{t(\"project.delete\")}</Button>\n * <Dialog id=\"confirm-delete\" aria-labelledby=\"confirm-delete-title\">\n * \t<Dialog.Header>\n * \t\t<Dialog.Title id=\"confirm-delete-title\">{t(\"project.deleteTitle\")}</Dialog.Title>\n * \t\t<Dialog.Description>{t(\"project.deleteDescription\")}</Dialog.Description>\n * \t</Dialog.Header>\n * \t<Dialog.Footer>\n * \t\t<Button commandfor=\"confirm-delete\" command=\"close\" color=\"danger\">{t(\"actions.delete\")}</Button>\n * \t</Dialog.Footer>\n * \t<Dialog.Close commandfor=\"confirm-delete\" aria-label={t(\"actions.close\")} />\n * </Dialog>\n * @example\n * <Dialog id=\"welcome\" mix={zoom({ duration: durations.normal })}>\n * \t<Dialog.Header>\n * \t\t<Dialog.Title>{t(\"welcome.title\")}</Dialog.Title>\n * \t</Dialog.Header>\n * </Dialog>\n */\nexport function Dialog(handle: Handle<Dialog.Props>) {\n\treturn () => {\n\t\tlet { id, children, mix, ...rest } = handle.props;\n\n\t\tif (import.meta.env?.DEV && !id) {\n\t\t\tconsole.warn(\n\t\t\t\t'Dialog rendered without an \"id\" — \"commandfor\" on a trigger or close control has nothing to target.',\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<dialog\n\t\t\t\t{...rest}\n\t\t\t\tid={id}\n\t\t\t\tdata-slot=\"dialog\"\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 * Establishes the containing block {@link Dialog.Close} pins itself to while\n\t\t\t\t\t\t * the panel sits in the page's flow, which a dialog opened through its `open`\n\t\t\t\t\t\t * attribute alone does.\n\t\t\t\t\t\t */\n\t\t\t\t\t\trelative(),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Measures a modal panel against the viewport, so it stays centered on screen\n\t\t\t\t\t\t * however far the page behind it is scrolled: the top layer resolves any other\n\t\t\t\t\t\t * positioning scheme against the document's own coordinates.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen(\"&:modal\", fixed()),\n\t\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\t\tis(\"full\"),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Wide enough for the form a dialog usually carries, so a field, its help text and a row\n\t\t\t\t\t\t * of actions read as one column. A consumer with less to say narrows it through `mix`.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tmaxIs(\"32rem\"),\n\t\t\t\t\t\tmaxBs(\"90vh\"),\n\t\t\t\t\t\tgap(6),\n\t\t\t\t\t\tp(6),\n\t\t\t\t\t\toverflow(\"auto\"),\n\t\t\t\t\t\t/** Gated on `[open]` so the UA's own `dialog:not([open])` hiding still applies. */\n\t\t\t\t\t\twhen(\"&[open]\", flex()),\n\t\t\t\t\t\tflexCol(),\n\t\t\t\t\t\tcontainer(CONTAINER_NAME, \"inline-size\"),\n\t\t\t\t\t\twhen(\"&::backdrop\", [\n\t\t\t\t\t\t\tbg(\"rgb(0 0 0 / 0.5)\"),\n\t\t\t\t\t\t\ttransitionBehavior(\"allow-discrete\"),\n\t\t\t\t\t\t\topacity(0),\n\t\t\t\t\t\t\ttransition(\"opacity, display, overlay\", {\n\t\t\t\t\t\t\t\tduration: durations.normal,\n\t\t\t\t\t\t\t\teasing: easings.standard,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen(\"&[open]::backdrop\", opacity(100)),\n\t\t\t\t\t\tsupports(\n\t\t\t\t\t\t\t\"(backdrop-filter: blur(0))\",\n\t\t\t\t\t\t\tmedia(\n\t\t\t\t\t\t\t\t\"(prefers-reduced-transparency: no-preference)\",\n\t\t\t\t\t\t\t\twhen(\"&::backdrop\", [backdropBlur(\"md\"), backdropSaturate(1.4)]),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tstartingStyle(when(\"&[open]::backdrop\", opacity(0))),\n\t\t\t\t\t\toutline(\"none\"),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The panel's edge is a ring shadow that takes on the tone behind it, over a\n\t\t\t\t\t\t * transparent border that forced-colors mode still paints as a line.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tborder({ color: \"transparent\", width: 1 }),\n\t\t\t\t\t\tshadow(\"xl\"),\n\t\t\t\t\t\tvars({ \"ui-box-shadow-ring\": SHADOW_RING }),\n\t\t\t\t\t\t/** `overscrollBehavior` has no matching utility. */\n\t\t\t\t\t\traw({ overscrollBehavior: \"contain\" }),\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</dialog>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Dialog.HeaderProps.children} as the panel's header slot: a\n * column stacking {@link Dialog.Title} and {@link Dialog.Description},\n * centered while narrow and start-aligned (flipping under `dir=\"rtl\"`) once the panel's own `ui-dialog` container grows past `40rem`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the header slot's markup.\n * @example\n * <Dialog.Header>\n * \t<Dialog.Title>{t(\"project.deleteTitle\")}</Dialog.Title>\n * \t<Dialog.Description>{t(\"project.deleteDescription\")}</Dialog.Description>\n * </Dialog.Header>\n */\nDialog.Header = function DialogHeader(handle: Handle<Dialog.HeaderProps>) {\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=\"header\"\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(1.5),\n\t\t\t\t\t\ttextAlign(\"center\"),\n\t\t\t\t\t\tat(COMFORTABLE_WIDTH, CONTAINER_NAME, textAlign(\"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 * Renders {@link Dialog.TitleProps.children} as the panel's heading, inside\n * the native heading element matching the nearest ambient heading level —\n * `<h1>` by default — sized and weighted as the panel's most prominent line of text at every level.\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 * <Dialog.Title>{t(\"project.deleteTitle\")}</Dialog.Title>\n */\nDialog.Title = function DialogTitle(handle: Handle<Dialog.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-slot=\"title\"\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t\tweight(\"semibold\"),\n\t\t\t\t\t\ttracking(\"tight\"),\n\t\t\t\t\t\tfontSize(\"lg\"),\n\t\t\t\t\t\tleading(1),\n\t\t\t\t\t\tbalance(),\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{rest.children}\n\t\t\t</Tag>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Dialog.DescriptionProps.children} as the panel's supporting\n * copy, in a native `<p>` set to the panel's muted foreground color so it\n * reads as secondary to {@link Dialog.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 * <Dialog.Description>{t(\"project.deleteDescription\")}</Dialog.Description>\n */\nDialog.Description = function DialogDescription(handle: Handle<Dialog.DescriptionProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<p\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"description\"\n\t\t\t\tmix={mergeMix([fg(\"neutral.muted\"), fontSize(\"sm\"), pretty()], mix)}\n\t\t\t>\n\t\t\t\t{rest.children}\n\t\t\t</p>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Dialog.FooterProps.children} as the panel's action row: a\n * column of stacked, full-width controls while the panel is narrow,\n * switching to a single end-aligned row past the panel's own `40rem` container mark.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the action row's markup.\n * @example\n * <Dialog.Footer>\n * \t<Button commandfor=\"confirm-delete\" command=\"close\" variant=\"outline\">{t(\"actions.cancel\")}</Button>\n * \t<Button commandfor=\"confirm-delete\" command=\"close\" color=\"danger\">{t(\"actions.delete\")}</Button>\n * </Dialog.Footer>\n */\nDialog.Footer = function DialogFooter(handle: Handle<Dialog.FooterProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"footer\"\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tflex(),\n\t\t\t\t\t\tgap(2),\n\t\t\t\t\t\tflexColReverse(),\n\t\t\t\t\t\tat(COMFORTABLE_WIDTH, CONTAINER_NAME, [flexRow(), justify(\"end\")]),\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 dismiss control for the ancestor {@link Dialog} named by\n * `commandfor`: a small, ghost-styled {@link Button} with a fixed \"X\" glyph,\n * pinned to the panel's corner. `command` defaults to `\"close\"`, so passing only `commandfor` and `aria-label` wires it up.\n *\n * @param handle Runtime handle carrying the host button's props.\n * @returns The render function producing the dismiss control's markup.\n * @example\n * <Dialog.Close commandfor=\"confirm-delete\" aria-label={t(\"actions.close\")} />\n */\nDialog.Close = function DialogClose(handle: Handle<Dialog.CloseProps>) {\n\treturn () => {\n\t\tlet { commandfor, command, mix, ...rest } = handle.props;\n\t\tlet resolvedCommand = command ?? DEFAULT_CLOSE_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=\"ghost\"\n\t\t\t\tcolor=\"neutral\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\tcommandfor={commandfor}\n\t\t\t\tcommand={resolvedCommand}\n\t\t\t\tdata-slot=\"close\"\n\t\t\t\tmix={mergeMix([absolute(), inset(4, 4, \"auto\", \"auto\")], mix)}\n\t\t\t>\n\t\t\t\t<XIcon size={16} />\n\t\t\t</Button>\n\t\t);\n\t};\n};\n"
14
14
  },
15
15
  "test": {
16
16
  "path": "dialog.test.tsx",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disclosure",
3
- "changedIn": "2026.10.13",
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": "disclosure.tsx",
12
- "content": "/**\n * A single expand/collapse section built on the native `<details>` and\n * `<summary>` elements, so the show/hide state, keyboard handling, and\n * find-in-page behavior all come from the platform itself.\n * `Disclosure.Trigger` is the always-visible `<summary>` label and\n * `Disclosure.Panel` is the content it reveals; `Disclosure.Group` stacks\n * several disclosures into one bordered list.\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 } from \"@sdxc/u/color\";\nimport { opacity, roundedCorner, rounded, transition, transitionDuration } from \"@sdxc/u/effects\";\nimport { cursor, listStyle, pointerEvents, raw } from \"@sdxc/u/general\";\nimport { flex, flexCol, gap, hidden, interpolateSize, items, shrink } from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { media } from \"@sdxc/u/responsive\";\nimport { bs, is, m, pb, pbe, pi } from \"@sdxc/u/size\";\nimport { detailsContent, hover, open, when } from \"@sdxc/u/state\";\nimport { rotate } from \"@sdxc/u/transform\";\nimport { balance, textAlign, weight } from \"@sdxc/u/typography\";\n\nimport { panelChrome } from \"@sdxc/ui/styles\";\n\nimport { resolveHeadingLevel, TAG_BY_LEVEL } from \"@sdxc/ui/heading-scope\";\n\n/**\n * Prop types for {@link Disclosure} and its compound parts.\n */\nexport namespace Disclosure {\n\t/**\n\t * Every native `<details>` attribute, plus the `mix` passthrough. The\n\t * `open` attribute alone drives expanded state, and sibling disclosures\n\t * sharing a `name` let the browser keep only one open at a time.\n\t */\n\texport interface Props extends TagProps<\"details\"> {\n\t\t/** The section's compound parts: {@link Disclosure.Trigger} followed by {@link Disclosure.Panel}. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Disclosure.Header}. The rendered tag matches\n\t * the nearest ambient heading level, falling back to `<h1>` where nothing\n\t * supplies one.\n\t */\n\texport interface HeaderProps extends TagProps<\"h1\"> {\n\t\t/** The trigger's label text, exposed as a heading for assistive technology. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Disclosure.Trigger}.\n\t */\n\texport interface TriggerProps extends TagProps<\"summary\"> {\n\t\t/** The always-visible label, typically plain text or {@link Disclosure.Header}. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Disclosure.Panel}.\n\t */\n\texport interface PanelProps extends TagProps<\"div\"> {\n\t\t/** The content revealed while the section is open. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Disclosure.Group}.\n\t */\n\texport interface GroupProps extends TagProps<\"div\"> {\n\t\t/** One or more {@link Disclosure} sections to stack into a single bordered list. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders the section's `<details>` host, revealing\n * {@link Disclosure.Panel}'s content while `open`. The `::details-content`\n * block-size transition is a progressive enhancement over the native toggle.\n *\n * @param handle Runtime handle carrying the host `<details>`'s props.\n * @returns The render function producing the section's markup.\n * @example\n * <Disclosure>\n * \t<Disclosure.Trigger>\n * \t\t{t(\"faq.refunds.question\")}\n * \t\t<ChevronDownIcon data-slot=\"icon\" aria-hidden=\"true\" />\n * \t</Disclosure.Trigger>\n * \t<Disclosure.Panel>\n * \t\t<p>{t(\"faq.refunds.answer\")}</p>\n * \t</Disclosure.Panel>\n * </Disclosure>\n * @example\n * <Disclosure open>\n * \t<Disclosure.Trigger>{t(\"faq.shipping.question\")}</Disclosure.Trigger>\n * \t<Disclosure.Panel>\n * \t\t<p>{t(\"faq.shipping.answer\")}</p>\n * \t</Disclosure.Panel>\n * </Disclosure>\n */\nexport function Disclosure(handle: Handle<Disclosure.Props>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<details\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tpanelChrome(),\n\t\t\t\t\tinterpolateSize(),\n\t\t\t\t\tdetailsContent([\n\t\t\t\t\t\toverflow(\"clip\"),\n\t\t\t\t\t\tbs(0),\n\t\t\t\t\t\traw({\n\t\t\t\t\t\t\ttransitionProperty: \"block-size, content-visibility\",\n\t\t\t\t\t\t\ttransitionBehavior: \"allow-discrete\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t\ttransitionDuration(\"200ms\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\"&[open]::details-content\", bs(\"auto\")),\n\t\t\t\t\t/**\n\t\t\t\t\t * The glyph a trigger carries as `data-slot=\"icon\"` turns over while the section\n\t\t\t\t\t * is open, the same rule `Accordion` states: the section owns the turn because\n\t\t\t\t\t * only it knows it is open, and the trigger owns which glyph turns.\n\t\t\t\t\t */\n\t\t\t\t\topen(when('& summary [data-slot=\"icon\"]', rotate(180))),\n\t\t\t\t\twhen('& summary [data-slot=\"icon\"]', transition(\"transform\", { duration: 200 })),\n\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", [\n\t\t\t\t\t\tdetailsContent(transitionDuration(\"0s\")),\n\t\t\t\t\t\twhen('& summary [data-slot=\"icon\"]', transitionDuration(\"0s\")),\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</details>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Disclosure.HeaderProps.children} as an accessible heading\n * at the ambient level, nested directly inside\n * {@link Disclosure.Trigger}, since `<summary>` must stay `<details>`'s direct child.\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 * <Disclosure.Trigger>\n * \t<Disclosure.Header>{t(\"faq.refunds.question\")}</Disclosure.Header>\n * </Disclosure.Trigger>\n */\nDisclosure.Header = function DisclosureHeader(handle: Handle<Disclosure.HeaderProps>) {\n\treturn () => {\n\t\tlet { children, 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 {...rest} data-heading-level={resolved} mix={[m(0), balance(), mix]}>\n\t\t\t\t{children}\n\t\t\t</Tag>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Disclosure.TriggerProps.children} inside a native `<summary>`\n * with its marker suppressed, so the indicator is a glyph the consumer passes as a\n * child carrying `data-slot=\"icon\"` — which the section turns over while it is open.\n * `aria-disabled=\"true\"` also stops the section toggling: the row leaves the tab order and\n * stops taking pointer events, which is what a `<summary>` has in place of the `disabled`\n * a button would carry.\n *\n * @param handle Runtime handle carrying the host `<summary>`'s props.\n * @returns The render function producing the trigger's markup.\n * @example\n * <Disclosure.Trigger>{t(\"faq.refunds.question\")}</Disclosure.Trigger>\n * @example\n * <Disclosure.Trigger aria-disabled=\"true\">{t(\"faq.archived.question\")}</Disclosure.Trigger>\n */\nDisclosure.Trigger = function DisclosureTrigger(handle: Handle<Disclosure.TriggerProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\t\t/**\n\t\t * A `<summary>` has no `disabled`, so a disabled row leaves the tab order to keep Enter\n\t\t * and Space off it. With the pointer-events rule below, that covers all `disabled` does,\n\t\t * and it holds before any script runs.\n\t\t */\n\t\tlet disabled = rest[\"aria-disabled\"] === \"true\";\n\n\t\treturn (\n\t\t\t<summary\n\t\t\t\t{...rest}\n\t\t\t\ttabIndex={disabled ? -1 : rest.tabIndex}\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\tflex(),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tgap(2),\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tpb(3),\n\t\t\t\t\tpi(3),\n\t\t\t\t\ttextAlign(\"start\"),\n\t\t\t\t\tbalance(),\n\t\t\t\t\tweight(\"medium\"),\n\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\thover(bg(\"neutral.tint\")),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', [opacity(50), pointerEvents(\"none\")]),\n\t\t\t\t\tcursor(\"pointer\"),\n\t\t\t\t\tlistStyle(),\n\t\t\t\t\twhen(\"&::-webkit-details-marker\", hidden()),\n\t\t\t\t\twhen(\"&::marker\", raw({ content: '\"\"' })),\n\t\t\t\t\t/**\n\t\t\t\t\t * The indicator is sized against the label beside it, whatever an icon set draws at,\n\t\t\t\t\t * and holds that size when a long label squeezes the row.\n\t\t\t\t\t */\n\t\t\t\t\twhen('& [data-slot=\"icon\"]', [is(4), bs(4), shrink()]),\n\t\t\t\t\ttransition(\n\t\t\t\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke\",\n\t\t\t\t\t),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', cursor(\"not-allowed\")),\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</summary>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Disclosure.PanelProps.children} in a `<div>` positioned\n * after {@link Disclosure.Trigger}, all `<details>` needs to treat it as\n * the collapsible body. Its padding is left for the consumer to size.\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 * <Disclosure.Panel>\n * \t<p>{t(\"faq.refunds.answer\")}</p>\n * </Disclosure.Panel>\n */\nDisclosure.Panel = function DisclosurePanel(handle: Handle<Disclosure.PanelProps>) {\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\tmix={[\n\t\t\t\t\toverflow(),\n\t\t\t\t\t/**\n\t\t\t\t\t * The panel is inset to the line the trigger's label sits on, so the section reads as\n\t\t\t\t\t * one block; the block-start stays open because the trigger's own padding already\n\t\t\t\t\t * separates the two.\n\t\t\t\t\t */\n\t\t\t\t\tpi(3),\n\t\t\t\t\tpbe(3),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Disclosure.GroupProps.children} as a bordered, rounded list\n * of {@link Disclosure} sections sharing one divider between them. Sections\n * keep toggling independently unless they share a `name`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the list's markup.\n * @example\n * <Disclosure.Group>\n * \t<Disclosure>\n * \t\t<Disclosure.Trigger>{t(\"faq.refunds.question\")}</Disclosure.Trigger>\n * \t\t<Disclosure.Panel>\n * \t\t\t<p>{t(\"faq.refunds.answer\")}</p>\n * \t\t</Disclosure.Panel>\n * \t</Disclosure>\n * \t<Disclosure>\n * \t\t<Disclosure.Trigger>{t(\"faq.shipping.question\")}</Disclosure.Trigger>\n * \t\t<Disclosure.Panel>\n * \t\t\t<p>{t(\"faq.shipping.answer\")}</p>\n * \t\t</Disclosure.Panel>\n * \t</Disclosure>\n * </Disclosure.Group>\n */\nDisclosure.Group = function DisclosureGroup(handle: Handle<Disclosure.GroupProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\twhen(\"& > details\", [\n\t\t\t\t\t\trounded(\"none\"),\n\t\t\t\t\t\tborderEdge(\"inline-start\", { width: \"0\", noStyleDefault: true }),\n\t\t\t\t\t\tborderEdge(\"inline-end\", { width: \"0\", noStyleDefault: true }),\n\t\t\t\t\t\tborderEdge(\"block-start\", { width: \"0\", noStyleDefault: true }),\n\t\t\t\t\t\twhen(\"&:first-child\", [\n\t\t\t\t\t\t\troundedCorner(\"start-start\", \"lg\"),\n\t\t\t\t\t\t\troundedCorner(\"start-end\", \"lg\"),\n\t\t\t\t\t\t\tborderEdge(\"block-start\", { width: 1, noStyleDefault: true }),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen(\"&:last-child\", [\n\t\t\t\t\t\t\troundedCorner(\"end-start\", \"lg\"),\n\t\t\t\t\t\t\troundedCorner(\"end-end\", \"lg\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n};\n"
12
+ "content": "/**\n * A single expand/collapse section built on the native `<details>` and\n * `<summary>` elements, so the show/hide state, keyboard handling, and\n * find-in-page behavior all come from the platform itself.\n * `Disclosure.Trigger` is the always-visible `<summary>` label and\n * `Disclosure.Panel` is the content it reveals; `Disclosure.Group` stacks\n * several disclosures into one bordered list.\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 } from \"@sdxc/u/color\";\nimport { opacity, roundedCorner, rounded, transition, transitionDuration } from \"@sdxc/u/effects\";\nimport { cursor, listStyle, pointerEvents, raw, mergeMix } from \"@sdxc/u/general\";\nimport { flex, flexCol, gap, hidden, interpolateSize, items, shrink } from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { media } from \"@sdxc/u/responsive\";\nimport { bs, is, m, pb, pbe, pi } from \"@sdxc/u/size\";\nimport { detailsContent, hover, open, when } from \"@sdxc/u/state\";\nimport { rotate } from \"@sdxc/u/transform\";\nimport { balance, textAlign, weight } from \"@sdxc/u/typography\";\n\nimport { panelChrome } from \"@sdxc/ui/styles\";\n\nimport { resolveHeadingLevel, TAG_BY_LEVEL } from \"@sdxc/ui/heading-scope\";\n\n/**\n * Prop types for {@link Disclosure} and its compound parts.\n */\nexport namespace Disclosure {\n\t/**\n\t * Every native `<details>` attribute, plus the `mix` passthrough. The\n\t * `open` attribute alone drives expanded state, and sibling disclosures\n\t * sharing a `name` let the browser keep only one open at a time.\n\t */\n\texport interface Props extends TagProps<\"details\"> {\n\t\t/** The section's compound parts: {@link Disclosure.Trigger} followed by {@link Disclosure.Panel}. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Disclosure.Header}. The rendered tag matches\n\t * the nearest ambient heading level, falling back to `<h1>` where nothing\n\t * supplies one.\n\t */\n\texport interface HeaderProps extends TagProps<\"h1\"> {\n\t\t/** The trigger's label text, exposed as a heading for assistive technology. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Disclosure.Trigger}.\n\t */\n\texport interface TriggerProps extends TagProps<\"summary\"> {\n\t\t/** The always-visible label, typically plain text or {@link Disclosure.Header}. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Disclosure.Panel}.\n\t */\n\texport interface PanelProps extends TagProps<\"div\"> {\n\t\t/** The content revealed while the section is open. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Disclosure.Group}.\n\t */\n\texport interface GroupProps extends TagProps<\"div\"> {\n\t\t/** One or more {@link Disclosure} sections to stack into a single bordered list. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders the section's `<details>` host, revealing\n * {@link Disclosure.Panel}'s content while `open`. The `::details-content`\n * block-size transition is a progressive enhancement over the native toggle.\n *\n * @param handle Runtime handle carrying the host `<details>`'s props.\n * @returns The render function producing the section's markup.\n * @example\n * <Disclosure>\n * \t<Disclosure.Trigger>\n * \t\t{t(\"faq.refunds.question\")}\n * \t\t<ChevronDownIcon data-slot=\"icon\" aria-hidden=\"true\" />\n * \t</Disclosure.Trigger>\n * \t<Disclosure.Panel>\n * \t\t<p>{t(\"faq.refunds.answer\")}</p>\n * \t</Disclosure.Panel>\n * </Disclosure>\n * @example\n * <Disclosure open>\n * \t<Disclosure.Trigger>{t(\"faq.shipping.question\")}</Disclosure.Trigger>\n * \t<Disclosure.Panel>\n * \t\t<p>{t(\"faq.shipping.answer\")}</p>\n * \t</Disclosure.Panel>\n * </Disclosure>\n */\nexport function Disclosure(handle: Handle<Disclosure.Props>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<details\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tpanelChrome(),\n\t\t\t\t\t\tinterpolateSize(),\n\t\t\t\t\t\tdetailsContent([\n\t\t\t\t\t\t\toverflow(\"clip\"),\n\t\t\t\t\t\t\tbs(0),\n\t\t\t\t\t\t\traw({\n\t\t\t\t\t\t\t\ttransitionProperty: \"block-size, content-visibility\",\n\t\t\t\t\t\t\t\ttransitionBehavior: \"allow-discrete\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\ttransitionDuration(\"200ms\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen(\"&[open]::details-content\", bs(\"auto\")),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The glyph a trigger carries as `data-slot=\"icon\"` turns over while the section\n\t\t\t\t\t\t * is open, the same rule `Accordion` states: the section owns the turn because\n\t\t\t\t\t\t * only it knows it is open, and the trigger owns which glyph turns.\n\t\t\t\t\t\t */\n\t\t\t\t\t\topen(when('& summary [data-slot=\"icon\"]', rotate(180))),\n\t\t\t\t\t\twhen('& summary [data-slot=\"icon\"]', transition(\"transform\", { duration: 200 })),\n\t\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", [\n\t\t\t\t\t\t\tdetailsContent(transitionDuration(\"0s\")),\n\t\t\t\t\t\t\twhen('& summary [data-slot=\"icon\"]', transitionDuration(\"0s\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</details>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Disclosure.HeaderProps.children} as an accessible heading\n * at the ambient level, nested directly inside\n * {@link Disclosure.Trigger}, since `<summary>` must stay `<details>`'s direct child.\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 * <Disclosure.Trigger>\n * \t<Disclosure.Header>{t(\"faq.refunds.question\")}</Disclosure.Header>\n * </Disclosure.Trigger>\n */\nDisclosure.Header = function DisclosureHeader(handle: Handle<Disclosure.HeaderProps>) {\n\treturn () => {\n\t\tlet { children, 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 {...rest} data-heading-level={resolved} mix={mergeMix([m(0), balance()], mix)}>\n\t\t\t\t{children}\n\t\t\t</Tag>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Disclosure.TriggerProps.children} inside a native `<summary>`\n * with its marker suppressed, so the indicator is a glyph the consumer passes as a\n * child carrying `data-slot=\"icon\"` — which the section turns over while it is open.\n * `aria-disabled=\"true\"` also stops the section toggling: the row leaves the tab order and\n * stops taking pointer events, which is what a `<summary>` has in place of the `disabled`\n * a button would carry.\n *\n * @param handle Runtime handle carrying the host `<summary>`'s props.\n * @returns The render function producing the trigger's markup.\n * @example\n * <Disclosure.Trigger>{t(\"faq.refunds.question\")}</Disclosure.Trigger>\n * @example\n * <Disclosure.Trigger aria-disabled=\"true\">{t(\"faq.archived.question\")}</Disclosure.Trigger>\n */\nDisclosure.Trigger = function DisclosureTrigger(handle: Handle<Disclosure.TriggerProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\t\t/**\n\t\t * A `<summary>` has no `disabled`, so a disabled row leaves the tab order to keep Enter\n\t\t * and Space off it. With the pointer-events rule below, that covers all `disabled` does,\n\t\t * and it holds before any script runs.\n\t\t */\n\t\tlet disabled = rest[\"aria-disabled\"] === \"true\";\n\n\t\treturn (\n\t\t\t<summary\n\t\t\t\t{...rest}\n\t\t\t\ttabIndex={disabled ? -1 : rest.tabIndex}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t\tflex(),\n\t\t\t\t\t\tis(\"full\"),\n\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\tgap(2),\n\t\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\t\tpb(3),\n\t\t\t\t\t\tpi(3),\n\t\t\t\t\t\ttextAlign(\"start\"),\n\t\t\t\t\t\tbalance(),\n\t\t\t\t\t\tweight(\"medium\"),\n\t\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t\thover(bg(\"neutral.tint\")),\n\t\t\t\t\t\twhen('&[aria-disabled=\"true\"]', [opacity(50), pointerEvents(\"none\")]),\n\t\t\t\t\t\tcursor(\"pointer\"),\n\t\t\t\t\t\tlistStyle(),\n\t\t\t\t\t\twhen(\"&::-webkit-details-marker\", hidden()),\n\t\t\t\t\t\twhen(\"&::marker\", raw({ content: '\"\"' })),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The indicator is sized against the label beside it, whatever an icon set draws at,\n\t\t\t\t\t\t * and holds that size when a long label squeezes the row.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen('& [data-slot=\"icon\"]', [is(4), bs(4), shrink()]),\n\t\t\t\t\t\ttransition(\n\t\t\t\t\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen('&[aria-disabled=\"true\"]', cursor(\"not-allowed\")),\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</summary>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Disclosure.PanelProps.children} in a `<div>` positioned\n * after {@link Disclosure.Trigger}, all `<details>` needs to treat it as\n * the collapsible body. Its padding is left for the consumer to size.\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 * <Disclosure.Panel>\n * \t<p>{t(\"faq.refunds.answer\")}</p>\n * </Disclosure.Panel>\n */\nDisclosure.Panel = function DisclosurePanel(handle: Handle<Disclosure.PanelProps>) {\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\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\toverflow(),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The panel is inset to the line the trigger's label sits on, so the section reads as\n\t\t\t\t\t\t * one block; the block-start stays open because the trigger's own padding already\n\t\t\t\t\t\t * separates the two.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tpi(3),\n\t\t\t\t\t\tpbe(3),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Disclosure.GroupProps.children} as a bordered, rounded list\n * of {@link Disclosure} sections sharing one divider between them. Sections\n * keep toggling independently unless they share a `name`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the list's markup.\n * @example\n * <Disclosure.Group>\n * \t<Disclosure>\n * \t\t<Disclosure.Trigger>{t(\"faq.refunds.question\")}</Disclosure.Trigger>\n * \t\t<Disclosure.Panel>\n * \t\t\t<p>{t(\"faq.refunds.answer\")}</p>\n * \t\t</Disclosure.Panel>\n * \t</Disclosure>\n * \t<Disclosure>\n * \t\t<Disclosure.Trigger>{t(\"faq.shipping.question\")}</Disclosure.Trigger>\n * \t\t<Disclosure.Panel>\n * \t\t\t<p>{t(\"faq.shipping.answer\")}</p>\n * \t\t</Disclosure.Panel>\n * \t</Disclosure>\n * </Disclosure.Group>\n */\nDisclosure.Group = function DisclosureGroup(handle: Handle<Disclosure.GroupProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\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\twhen(\"& > details\", [\n\t\t\t\t\t\t\trounded(\"none\"),\n\t\t\t\t\t\t\tborderEdge(\"inline-start\", { width: \"0\", noStyleDefault: true }),\n\t\t\t\t\t\t\tborderEdge(\"inline-end\", { width: \"0\", noStyleDefault: true }),\n\t\t\t\t\t\t\tborderEdge(\"block-start\", { width: \"0\", noStyleDefault: true }),\n\t\t\t\t\t\t\twhen(\"&:first-child\", [\n\t\t\t\t\t\t\t\troundedCorner(\"start-start\", \"lg\"),\n\t\t\t\t\t\t\t\troundedCorner(\"start-end\", \"lg\"),\n\t\t\t\t\t\t\t\tborderEdge(\"block-start\", { width: 1, noStyleDefault: true }),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\twhen(\"&:last-child\", [\n\t\t\t\t\t\t\t\troundedCorner(\"end-start\", \"lg\"),\n\t\t\t\t\t\t\t\troundedCorner(\"end-end\", \"lg\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t],\n\t\t\t\t\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"
13
13
  },
14
14
  "test": {
15
15
  "path": "disclosure.test.tsx",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drawer",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [
5
5
  "dialog"
6
6
  ],
@@ -9,7 +9,7 @@
9
9
  ],
10
10
  "source": {
11
11
  "path": "drawer.tsx",
12
- "content": "/**\n * A preset of {@link Dialog} docked flush against one physical edge of the\n * viewport, sized to fill that edge, sliding into place from it on open and\n * fading out with a short drift toward it on close. Every other detail — the\n * dimming, blurrable `::backdrop`, the `ui-dialog` named container its\n * compound parts query, and the missing-`id` dev-mode contract check — carries\n * over from {@link Dialog}, since this component composes it directly.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle } from \"remix/component\";\n\nimport { rounded } from \"@sdxc/u/effects\";\nimport { vars, willChange } from \"@sdxc/u/general\";\nimport { fixed, insBe, insBs, insIe, insIs, insLeft, insRight } from \"@sdxc/u/layout\";\nimport { bs, is, m, maxBs, maxIs } from \"@sdxc/u/size\";\nimport { data } from \"@sdxc/u/state\";\n\nimport { durations, easings } from \"@sdxc/ui/animations\";\nimport { enterExit } from \"@sdxc/ui/animations\";\n\nimport { Dialog } from \"@sdxc/ui/dialog\";\n\n/**\n * Physical edge of the viewport {@link Drawer} docks against when\n * `placement` is left unset.\n */\nconst DEFAULT_PLACEMENT: Drawer.Placement = \"bottom\";\n\n/**\n * How far toward its edge the panel drifts while it fades out on close: a\n * hint of the direction it came from, short of the full slide it entered with.\n */\nconst EXIT_DISTANCE = \"1rem\";\n\n/** Blur radius in pixels the panel softens to as it fades out. */\nconst EXIT_BLUR_PX = 4;\n\n/**\n * Prop types for {@link Drawer} and its compound parts. Each compound part\n * aliases {@link Dialog}'s matching part, since {@link Drawer} renders\n * straight through to {@link Dialog}'s markup.\n */\nexport namespace Drawer {\n\t/**\n\t * Physical edge of the viewport the panel docks against and slides in from.\n\t * `\"left\"`/`\"right\"` name that fixed edge regardless of `dir`;\n\t * `\"top\"`/`\"bottom\"` name the block axis, which already tracks `dir` on its own.\n\t */\n\texport type Placement = \"top\" | \"right\" | \"bottom\" | \"left\";\n\n\t/** Every prop {@link Dialog.Props} accepts, plus `placement`. */\n\texport interface Props extends Dialog.Props {\n\t\t/**\n\t\t * Physical edge of the viewport to dock against and slide in from.\n\t\t * Defaults to {@link DEFAULT_PLACEMENT}.\n\t\t */\n\t\tplacement?: Placement;\n\t}\n\n\t/** Every prop {@link Dialog.HeaderProps} accepts, unchanged. */\n\texport interface HeaderProps extends Dialog.HeaderProps {}\n\n\t/** Every prop {@link Dialog.TitleProps} accepts, unchanged. */\n\texport interface TitleProps extends Dialog.TitleProps {}\n\n\t/** Every prop {@link Dialog.DescriptionProps} accepts, unchanged. */\n\texport interface DescriptionProps extends Dialog.DescriptionProps {}\n\n\t/** Every prop {@link Dialog.FooterProps} accepts, unchanged. */\n\texport interface FooterProps extends Dialog.FooterProps {}\n\n\t/** Every prop {@link Dialog.CloseProps} accepts, unchanged. */\n\texport interface CloseProps extends Dialog.CloseProps {}\n}\n\n/**\n * Renders {@link Dialog} pinned to one edge of the viewport, animating a\n * `transform` off the native `open` attribute so `@starting-style` can\n * animate the close; a `mix` prop composes alongside this placement styling.\n *\n * @param handle Runtime handle carrying the host `<dialog>`'s props, plus `placement`.\n * @returns The render function producing the docked panel's markup.\n * @example\n * <Button commandfor=\"cart\" command=\"show-modal\">{t(\"cart.open\")}</Button>\n * <Drawer id=\"cart\" placement=\"right\" aria-labelledby=\"cart-title\">\n * \t<Drawer.Header>\n * \t\t<Drawer.Title id=\"cart-title\">{t(\"cart.title\")}</Drawer.Title>\n * \t</Drawer.Header>\n * \t<Drawer.Close commandfor=\"cart\" aria-label={t(\"actions.close\")} />\n * </Drawer>\n * @example\n * <Drawer id=\"filters\" placement=\"bottom\" aria-labelledby=\"filters-title\">\n * \t<Drawer.Header>\n * \t\t<Drawer.Title id=\"filters-title\">{t(\"filters.title\")}</Drawer.Title>\n * \t</Drawer.Header>\n * \t<Drawer.Footer>\n * \t\t<Button commandfor=\"filters\" command=\"close\">{t(\"actions.apply\")}</Button>\n * \t</Drawer.Footer>\n * </Drawer>\n */\nexport function Drawer(handle: Handle<Drawer.Props>) {\n\treturn () => {\n\t\tlet { placement, mix, ...rest } = handle.props;\n\t\tlet resolvedPlacement = placement ?? DEFAULT_PLACEMENT;\n\n\t\treturn (\n\t\t\t<Dialog\n\t\t\t\t{...rest}\n\t\t\t\tdata-placement={resolvedPlacement}\n\t\t\t\tmix={[\n\t\t\t\t\tfixed(),\n\t\t\t\t\tm(0),\n\t\t\t\t\trounded(\"none\"),\n\t\t\t\t\tenterExit({\n\t\t\t\t\t\ttranslate: \"var(--ui-drawer-enter-offset)\",\n\t\t\t\t\t\tduration: durations.slow,\n\t\t\t\t\t\teasing: easings.decelerate,\n\t\t\t\t\t\texit: { translate: \"var(--ui-drawer-exit-offset)\", opacity: 0, blur: EXIT_BLUR_PX },\n\t\t\t\t\t\texitDuration: durations.fast,\n\t\t\t\t\t\texitEasing: easings.accelerate,\n\t\t\t\t\t}),\n\t\t\t\t\twillChange(\"translate\"),\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Each placement frees the far edge so the dialog's centring lets go, gives its docked\n\t\t\t\t\t * edge a depth, and fills the other axis, since a `<dialog>` sizes to its content on both\n\t\t\t\t\t * axes even with opposite insets pinned.\n\t\t\t\t\t */\n\t\t\t\t\tdata(\"placement\", \"top\", [\n\t\t\t\t\t\tinsBs(\"0\"),\n\t\t\t\t\t\tinsBe(\"auto\"),\n\t\t\t\t\t\tinsIs(\"0\"),\n\t\t\t\t\t\tinsIe(\"0\"),\n\t\t\t\t\t\tbs(\"24rem\"),\n\t\t\t\t\t\tmaxBs(\"90vh\"),\n\t\t\t\t\t\tis(\"full\"),\n\t\t\t\t\t\tmaxIs(\"none\"),\n\t\t\t\t\t\tvars({\n\t\t\t\t\t\t\t\"ui-drawer-enter-offset\": \"0 -100%\",\n\t\t\t\t\t\t\t\"ui-drawer-exit-offset\": `0 -${EXIT_DISTANCE}`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t]),\n\n\t\t\t\t\tdata(\"placement\", \"bottom\", [\n\t\t\t\t\t\tinsBe(\"0\"),\n\t\t\t\t\t\tinsBs(\"auto\"),\n\t\t\t\t\t\tinsIs(\"0\"),\n\t\t\t\t\t\tinsIe(\"0\"),\n\t\t\t\t\t\tbs(\"24rem\"),\n\t\t\t\t\t\tmaxBs(\"90vh\"),\n\t\t\t\t\t\tis(\"full\"),\n\t\t\t\t\t\tmaxIs(\"none\"),\n\t\t\t\t\t\tvars({\n\t\t\t\t\t\t\t\"ui-drawer-enter-offset\": \"0 100%\",\n\t\t\t\t\t\t\t\"ui-drawer-exit-offset\": `0 ${EXIT_DISTANCE}`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t]),\n\n\t\t\t\t\tdata(\"placement\", \"left\", [\n\t\t\t\t\t\tinsBs(\"0\"),\n\t\t\t\t\t\tinsBe(\"0\"),\n\t\t\t\t\t\tinsLeft(\"0\"),\n\t\t\t\t\t\tinsRight(\"auto\"),\n\t\t\t\t\t\tis(\"22rem\"),\n\t\t\t\t\t\tmaxIs(\"90vw\"),\n\t\t\t\t\t\tbs(\"full\"),\n\t\t\t\t\t\tmaxBs(\"none\"),\n\t\t\t\t\t\tvars({\n\t\t\t\t\t\t\t\"ui-drawer-enter-offset\": \"-100% 0\",\n\t\t\t\t\t\t\t\"ui-drawer-exit-offset\": `-${EXIT_DISTANCE} 0`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t]),\n\n\t\t\t\t\tdata(\"placement\", \"right\", [\n\t\t\t\t\t\tinsBs(\"0\"),\n\t\t\t\t\t\tinsBe(\"0\"),\n\t\t\t\t\t\tinsRight(\"0\"),\n\t\t\t\t\t\tinsLeft(\"auto\"),\n\t\t\t\t\t\tis(\"22rem\"),\n\t\t\t\t\t\tmaxIs(\"90vw\"),\n\t\t\t\t\t\tbs(\"full\"),\n\t\t\t\t\t\tmaxBs(\"none\"),\n\t\t\t\t\t\tvars({\n\t\t\t\t\t\t\t\"ui-drawer-enter-offset\": \"100% 0\",\n\t\t\t\t\t\t\t\"ui-drawer-exit-offset\": `${EXIT_DISTANCE} 0`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t]),\n\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Drawer.HeaderProps.children} as the panel's header slot,\n * routed straight through to {@link Dialog.Header}'s markup.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the header slot's markup.\n * @example\n * <Drawer.Header>\n * \t<Drawer.Title>{t(\"cart.title\")}</Drawer.Title>\n * </Drawer.Header>\n */\nDrawer.Header = Dialog.Header;\n\n/**\n * Renders {@link Drawer.TitleProps.children} as the panel's heading:\n * identical to {@link Dialog.Title}.\n *\n * @param handle Runtime handle carrying the host `<h2>`'s props.\n * @returns The render function producing the heading's markup.\n * @example\n * <Drawer.Title>{t(\"cart.title\")}</Drawer.Title>\n */\nDrawer.Title = Dialog.Title;\n\n/**\n * Renders {@link Drawer.DescriptionProps.children} as the panel's supporting\n * copy: identical to {@link Dialog.Description}.\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 * <Drawer.Description>{t(\"cart.description\")}</Drawer.Description>\n */\nDrawer.Description = Dialog.Description;\n\n/**\n * Renders {@link Drawer.FooterProps.children} as the panel's action row:\n * identical to {@link Dialog.Footer}.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the action row's markup.\n * @example\n * <Drawer.Footer>\n * \t<Button commandfor=\"cart\" command=\"close\" variant=\"outline\">{t(\"actions.cancel\")}</Button>\n * \t<Button commandfor=\"cart\" command=\"close\">{t(\"actions.checkout\")}</Button>\n * </Drawer.Footer>\n */\nDrawer.Footer = Dialog.Footer;\n\n/**\n * Renders a dismiss control for the ancestor {@link Drawer} named by\n * `commandfor`: identical to {@link Dialog.Close}.\n *\n * @param handle Runtime handle carrying the host button's props.\n * @returns The render function producing the dismiss control's markup.\n * @example\n * <Drawer.Close commandfor=\"cart\" aria-label={t(\"actions.close\")} />\n */\nDrawer.Close = Dialog.Close;\n"
12
+ "content": "/**\n * A preset of {@link Dialog} docked flush against one physical edge of the\n * viewport, sized to fill that edge, sliding into place from it on open and\n * fading out with a short drift toward it on close. Every other detail — the\n * dimming, blurrable `::backdrop`, the `ui-dialog` named container its\n * compound parts query, and the missing-`id` dev-mode contract check — carries\n * over from {@link Dialog}, since this component composes it directly.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle } from \"remix/component\";\n\nimport { rounded } from \"@sdxc/u/effects\";\nimport { vars, willChange, mergeMix } from \"@sdxc/u/general\";\nimport { fixed, insBe, insBs, insIe, insIs, insLeft, insRight } from \"@sdxc/u/layout\";\nimport { bs, is, m, maxBs, maxIs } from \"@sdxc/u/size\";\nimport { data } from \"@sdxc/u/state\";\n\nimport { durations, easings } from \"@sdxc/ui/animations\";\nimport { enterExit } from \"@sdxc/ui/animations\";\n\nimport { Dialog } from \"@sdxc/ui/dialog\";\n\n/**\n * Physical edge of the viewport {@link Drawer} docks against when\n * `placement` is left unset.\n */\nconst DEFAULT_PLACEMENT: Drawer.Placement = \"bottom\";\n\n/**\n * How far toward its edge the panel drifts while it fades out on close: a\n * hint of the direction it came from, short of the full slide it entered with.\n */\nconst EXIT_DISTANCE = \"1rem\";\n\n/** Blur radius in pixels the panel softens to as it fades out. */\nconst EXIT_BLUR_PX = 4;\n\n/**\n * Prop types for {@link Drawer} and its compound parts. Each compound part\n * aliases {@link Dialog}'s matching part, since {@link Drawer} renders\n * straight through to {@link Dialog}'s markup.\n */\nexport namespace Drawer {\n\t/**\n\t * Physical edge of the viewport the panel docks against and slides in from.\n\t * `\"left\"`/`\"right\"` name that fixed edge regardless of `dir`;\n\t * `\"top\"`/`\"bottom\"` name the block axis, which already tracks `dir` on its own.\n\t */\n\texport type Placement = \"top\" | \"right\" | \"bottom\" | \"left\";\n\n\t/** Every prop {@link Dialog.Props} accepts, plus `placement`. */\n\texport interface Props extends Dialog.Props {\n\t\t/**\n\t\t * Physical edge of the viewport to dock against and slide in from.\n\t\t * Defaults to {@link DEFAULT_PLACEMENT}.\n\t\t */\n\t\tplacement?: Placement;\n\t}\n\n\t/** Every prop {@link Dialog.HeaderProps} accepts, unchanged. */\n\texport interface HeaderProps extends Dialog.HeaderProps {}\n\n\t/** Every prop {@link Dialog.TitleProps} accepts, unchanged. */\n\texport interface TitleProps extends Dialog.TitleProps {}\n\n\t/** Every prop {@link Dialog.DescriptionProps} accepts, unchanged. */\n\texport interface DescriptionProps extends Dialog.DescriptionProps {}\n\n\t/** Every prop {@link Dialog.FooterProps} accepts, unchanged. */\n\texport interface FooterProps extends Dialog.FooterProps {}\n\n\t/** Every prop {@link Dialog.CloseProps} accepts, unchanged. */\n\texport interface CloseProps extends Dialog.CloseProps {}\n}\n\n/**\n * Renders {@link Dialog} pinned to one edge of the viewport, animating a\n * `transform` off the native `open` attribute so `@starting-style` can\n * animate the close; a `mix` prop composes alongside this placement styling.\n *\n * @param handle Runtime handle carrying the host `<dialog>`'s props, plus `placement`.\n * @returns The render function producing the docked panel's markup.\n * @example\n * <Button commandfor=\"cart\" command=\"show-modal\">{t(\"cart.open\")}</Button>\n * <Drawer id=\"cart\" placement=\"right\" aria-labelledby=\"cart-title\">\n * \t<Drawer.Header>\n * \t\t<Drawer.Title id=\"cart-title\">{t(\"cart.title\")}</Drawer.Title>\n * \t</Drawer.Header>\n * \t<Drawer.Close commandfor=\"cart\" aria-label={t(\"actions.close\")} />\n * </Drawer>\n * @example\n * <Drawer id=\"filters\" placement=\"bottom\" aria-labelledby=\"filters-title\">\n * \t<Drawer.Header>\n * \t\t<Drawer.Title id=\"filters-title\">{t(\"filters.title\")}</Drawer.Title>\n * \t</Drawer.Header>\n * \t<Drawer.Footer>\n * \t\t<Button commandfor=\"filters\" command=\"close\">{t(\"actions.apply\")}</Button>\n * \t</Drawer.Footer>\n * </Drawer>\n */\nexport function Drawer(handle: Handle<Drawer.Props>) {\n\treturn () => {\n\t\tlet { placement, mix, ...rest } = handle.props;\n\t\tlet resolvedPlacement = placement ?? DEFAULT_PLACEMENT;\n\n\t\treturn (\n\t\t\t<Dialog\n\t\t\t\t{...rest}\n\t\t\t\tdata-placement={resolvedPlacement}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tfixed(),\n\t\t\t\t\t\tm(0),\n\t\t\t\t\t\trounded(\"none\"),\n\t\t\t\t\t\tenterExit({\n\t\t\t\t\t\t\ttranslate: \"var(--ui-drawer-enter-offset)\",\n\t\t\t\t\t\t\tduration: durations.slow,\n\t\t\t\t\t\t\teasing: easings.decelerate,\n\t\t\t\t\t\t\texit: { translate: \"var(--ui-drawer-exit-offset)\", opacity: 0, blur: EXIT_BLUR_PX },\n\t\t\t\t\t\t\texitDuration: durations.fast,\n\t\t\t\t\t\t\texitEasing: easings.accelerate,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\twillChange(\"translate\"),\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Each placement frees the far edge so the dialog's centring lets go, gives its docked\n\t\t\t\t\t\t * edge a depth, and fills the other axis, since a `<dialog>` sizes to its content on both\n\t\t\t\t\t\t * axes even with opposite insets pinned.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tdata(\"placement\", \"top\", [\n\t\t\t\t\t\t\tinsBs(\"0\"),\n\t\t\t\t\t\t\tinsBe(\"auto\"),\n\t\t\t\t\t\t\tinsIs(\"0\"),\n\t\t\t\t\t\t\tinsIe(\"0\"),\n\t\t\t\t\t\t\tbs(\"24rem\"),\n\t\t\t\t\t\t\tmaxBs(\"90vh\"),\n\t\t\t\t\t\t\tis(\"full\"),\n\t\t\t\t\t\t\tmaxIs(\"none\"),\n\t\t\t\t\t\t\tvars({\n\t\t\t\t\t\t\t\t\"ui-drawer-enter-offset\": \"0 -100%\",\n\t\t\t\t\t\t\t\t\"ui-drawer-exit-offset\": `0 -${EXIT_DISTANCE}`,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t]),\n\n\t\t\t\t\t\tdata(\"placement\", \"bottom\", [\n\t\t\t\t\t\t\tinsBe(\"0\"),\n\t\t\t\t\t\t\tinsBs(\"auto\"),\n\t\t\t\t\t\t\tinsIs(\"0\"),\n\t\t\t\t\t\t\tinsIe(\"0\"),\n\t\t\t\t\t\t\tbs(\"24rem\"),\n\t\t\t\t\t\t\tmaxBs(\"90vh\"),\n\t\t\t\t\t\t\tis(\"full\"),\n\t\t\t\t\t\t\tmaxIs(\"none\"),\n\t\t\t\t\t\t\tvars({\n\t\t\t\t\t\t\t\t\"ui-drawer-enter-offset\": \"0 100%\",\n\t\t\t\t\t\t\t\t\"ui-drawer-exit-offset\": `0 ${EXIT_DISTANCE}`,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t]),\n\n\t\t\t\t\t\tdata(\"placement\", \"left\", [\n\t\t\t\t\t\t\tinsBs(\"0\"),\n\t\t\t\t\t\t\tinsBe(\"0\"),\n\t\t\t\t\t\t\tinsLeft(\"0\"),\n\t\t\t\t\t\t\tinsRight(\"auto\"),\n\t\t\t\t\t\t\tis(\"22rem\"),\n\t\t\t\t\t\t\tmaxIs(\"90vw\"),\n\t\t\t\t\t\t\tbs(\"full\"),\n\t\t\t\t\t\t\tmaxBs(\"none\"),\n\t\t\t\t\t\t\tvars({\n\t\t\t\t\t\t\t\t\"ui-drawer-enter-offset\": \"-100% 0\",\n\t\t\t\t\t\t\t\t\"ui-drawer-exit-offset\": `-${EXIT_DISTANCE} 0`,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t]),\n\n\t\t\t\t\t\tdata(\"placement\", \"right\", [\n\t\t\t\t\t\t\tinsBs(\"0\"),\n\t\t\t\t\t\t\tinsBe(\"0\"),\n\t\t\t\t\t\t\tinsRight(\"0\"),\n\t\t\t\t\t\t\tinsLeft(\"auto\"),\n\t\t\t\t\t\t\tis(\"22rem\"),\n\t\t\t\t\t\t\tmaxIs(\"90vw\"),\n\t\t\t\t\t\t\tbs(\"full\"),\n\t\t\t\t\t\t\tmaxBs(\"none\"),\n\t\t\t\t\t\t\tvars({\n\t\t\t\t\t\t\t\t\"ui-drawer-enter-offset\": \"100% 0\",\n\t\t\t\t\t\t\t\t\"ui-drawer-exit-offset\": `${EXIT_DISTANCE} 0`,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t]),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Drawer.HeaderProps.children} as the panel's header slot,\n * routed straight through to {@link Dialog.Header}'s markup.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the header slot's markup.\n * @example\n * <Drawer.Header>\n * \t<Drawer.Title>{t(\"cart.title\")}</Drawer.Title>\n * </Drawer.Header>\n */\nDrawer.Header = Dialog.Header;\n\n/**\n * Renders {@link Drawer.TitleProps.children} as the panel's heading:\n * identical to {@link Dialog.Title}.\n *\n * @param handle Runtime handle carrying the host `<h2>`'s props.\n * @returns The render function producing the heading's markup.\n * @example\n * <Drawer.Title>{t(\"cart.title\")}</Drawer.Title>\n */\nDrawer.Title = Dialog.Title;\n\n/**\n * Renders {@link Drawer.DescriptionProps.children} as the panel's supporting\n * copy: identical to {@link Dialog.Description}.\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 * <Drawer.Description>{t(\"cart.description\")}</Drawer.Description>\n */\nDrawer.Description = Dialog.Description;\n\n/**\n * Renders {@link Drawer.FooterProps.children} as the panel's action row:\n * identical to {@link Dialog.Footer}.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the action row's markup.\n * @example\n * <Drawer.Footer>\n * \t<Button commandfor=\"cart\" command=\"close\" variant=\"outline\">{t(\"actions.cancel\")}</Button>\n * \t<Button commandfor=\"cart\" command=\"close\">{t(\"actions.checkout\")}</Button>\n * </Drawer.Footer>\n */\nDrawer.Footer = Dialog.Footer;\n\n/**\n * Renders a dismiss control for the ancestor {@link Drawer} named by\n * `commandfor`: identical to {@link Dialog.Close}.\n *\n * @param handle Runtime handle carrying the host button's props.\n * @returns The render function producing the dismiss control's markup.\n * @example\n * <Drawer.Close commandfor=\"cart\" aria-label={t(\"actions.close\")} />\n */\nDrawer.Close = Dialog.Close;\n"
13
13
  },
14
14
  "test": {
15
15
  "path": "drawer.test.tsx",
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "field-error",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "FieldError"
7
7
  ],
8
8
  "source": {
9
9
  "path": "field-error.tsx",
10
- "content": "/**\n * A native form field's validation message, styled at a small size in the\n * danger foreground color. Its host carries a stable id — its own\n * `handle.id` unless a consumer supplies one — ready for a field's control\n * to reference through `aria-describedby`, and a `data-field-error` marker\n * that lets a validation script locate this slot through that same\n * `aria-describedby` list regardless of where it sits in the DOM. It\n * is the foundational error slot every field wrapper composes alongside a\n * label and a control.\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 { pretty, text, weight } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\n/**\n * `data-field-error` applied through {@link attrs} unless a consumer\n * overrides it, marking the host as a field's error slot so a validation\n * script can locate it via the field's `aria-describedby` list.\n */\nconst DEFAULT_FIELD_ERROR_ATTRIBUTE = true;\n\n/**\n * Prop types for {@link FieldError}.\n */\nexport namespace FieldError {\n\t/**\n\t * Every native `<span>` attribute plus the `mix` passthrough. `children`\n\t * holds the validation message the consumer supplies, and `id` defaults\n\t * to this component's own `handle.id` when omitted.\n\t */\n\texport interface Props extends TagProps<\"span\"> {}\n}\n\n/**\n * Renders a field's validation message. `id` falls back to `handle.id` so\n * a sibling `aria-describedby` can target it via `data-field-error`; pass\n * `hidden` to keep it out of layout until the field is invalid.\n *\n * @param handle Runtime handle carrying the host `<span>`'s props.\n * @returns The render function producing the error message's markup.\n * @example\n * <input id=\"email\" type=\"email\" required aria-describedby=\"email-error\" />\n * <FieldError id=\"email-error\">{t(\"fields.email.required\")}</FieldError>\n * @example\n * <input type=\"email\" required aria-describedby={handle.id} />\n * <FieldError hidden={!errors.email}>{errors.email}</FieldError>\n */\nexport function FieldError(handle: Handle<FieldError.Props>) {\n\treturn () => {\n\t\tlet { id, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<span\n\t\t\t\tid={id ?? handle.id}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ \"data-field-error\": DEFAULT_FIELD_ERROR_ATTRIBUTE }),\n\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\tweight(\"medium\"),\n\t\t\t\t\ttext(\"sm\"),\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"
10
+ "content": "/**\n * A native form field's validation message, styled at a small size in the\n * danger foreground color. Its host carries a stable id — its own\n * `handle.id` unless a consumer supplies one — ready for a field's control\n * to reference through `aria-describedby`, and a `data-field-error` marker\n * that lets a validation script locate this slot through that same\n * `aria-describedby` list regardless of where it sits in the DOM. It\n * is the foundational error slot every field wrapper composes alongside a\n * label and a control.\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 { pretty, text, weight } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\n/**\n * `data-field-error` applied through {@link attrs} unless a consumer\n * overrides it, marking the host as a field's error slot so a validation\n * script can locate it via the field's `aria-describedby` list.\n */\nconst DEFAULT_FIELD_ERROR_ATTRIBUTE = true;\n\n/**\n * Prop types for {@link FieldError}.\n */\nexport namespace FieldError {\n\t/**\n\t * Every native `<span>` attribute plus the `mix` passthrough. `children`\n\t * holds the validation message the consumer supplies, and `id` defaults\n\t * to this component's own `handle.id` when omitted.\n\t */\n\texport interface Props extends TagProps<\"span\"> {}\n}\n\n/**\n * Renders a field's validation message. `id` falls back to `handle.id` so\n * a sibling `aria-describedby` can target it via `data-field-error`; pass\n * `hidden` to keep it out of layout until the field is invalid.\n *\n * @param handle Runtime handle carrying the host `<span>`'s props.\n * @returns The render function producing the error message's markup.\n * @example\n * <input id=\"email\" type=\"email\" required aria-describedby=\"email-error\" />\n * <FieldError id=\"email-error\">{t(\"fields.email.required\")}</FieldError>\n * @example\n * <input type=\"email\" required aria-describedby={handle.id} />\n * <FieldError hidden={!errors.email}>{errors.email}</FieldError>\n */\nexport function FieldError(handle: Handle<FieldError.Props>) {\n\treturn () => {\n\t\tlet { id, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<span\n\t\t\t\tid={id ?? handle.id}\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({ \"data-field-error\": DEFAULT_FIELD_ERROR_ATTRIBUTE }),\n\t\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\t\tweight(\"medium\"),\n\t\t\t\t\t\ttext(\"sm\"),\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"
11
11
  },
12
12
  "test": null
13
13
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "form",
3
- "changedIn": "2026.10.2",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [
5
5
  "alert"
6
6
  ],
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "source": {
14
14
  "path": "form.tsx",
15
- "content": "/**\n * The wrapper every multi-field layout starts from: a native `<form>` laying\n * its children out in a single spaced column, and the point where a parsed\n * validation result enters the tree. Set `issues` from a `parseSafe` (or any\n * other Standard Schema compliant) result and every field beneath it can\n * pick out its own errors by name through component context, with no\n * `issues` prop threaded down by hand.\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 { Alert } from \"@sdxc/ui/alert\";\n\n/** {@link Form.Props.issues} fallback for a first, not-yet-submitted render. */\nconst DEFAULT_ISSUES: ReadonlyArray<Form.Issue> = [];\n\n/** Shared empty result {@link Form.Context.getIssues} returns for a field with no matching issue. */\nconst NO_ISSUES: ReadonlyArray<Form.Issue> = [];\n\n/**\n * Prop types for {@link Form} and the context value it provides to\n * descendant fields.\n */\nexport namespace Form {\n\t/**\n\t * A single validation failure as reported by a Standard Schema compliant\n\t * validator. `path` locates the field the issue belongs to — a plain key,\n\t * an index, or a `{ key }` segment — or is omitted for a form-level issue.\n\t */\n\texport interface Issue {\n\t\t/** Human-readable failure message, rendered verbatim by a field's `FieldError`. */\n\t\treadonly message: string;\n\t\t/** Field location of the issue, e.g. `[\"email\"]` or `[\"address\", \"zip\"]`. Omitted for a form-level issue. */\n\t\treadonly path?: ReadonlyArray<PropertyKey | { readonly key: PropertyKey }>;\n\t}\n\n\t/**\n\t * Value {@link Form} stores in component context. A field reads it with\n\t * `handle.context.get(Form)` to find its own issues by name and learn\n\t * whether it's the field that should carry `autofocus` on this render.\n\t */\n\texport interface Context {\n\t\t/**\n\t\t * Every issue whose `path` resolves to `name` (segments joined with\n\t\t * `\".\"`, e.g. `\"address.zip\"`), or an empty array when the field has\n\t\t * none.\n\t\t *\n\t\t * @param name Field name to look up, matching its `name` attribute.\n\t\t * @returns The issues addressed to that field, in {@link Form.Props.issues} order.\n\t\t */\n\t\tgetIssues(name: string): ReadonlyArray<Issue>;\n\t\t/**\n\t\t * `true` for the single field name that comes first among\n\t\t * {@link Form.Props.issues}, so exactly one invalid field renders\n\t\t * `autofocus`, landing keyboard focus on it after a server re-render.\n\t\t *\n\t\t * @param name Field name to check, matching its `name` attribute.\n\t\t * @returns Whether `name` is the first invalid field this render.\n\t\t */\n\t\tisFirstInvalid(name: string): boolean;\n\t\t/**\n\t\t * Every issue with no `path` at all — a failure that names no single\n\t\t * field, such as a server-side refusal decided before any field was\n\t\t * reached. {@link Form} already renders these through its own leading\n\t\t * `Alert`; a caller reaches for this only to render them somewhere\n\t\t * else instead.\n\t\t *\n\t\t * @returns The form-level issues, in {@link Form.Props.issues} order.\n\t\t */\n\t\tgetFormIssues(): ReadonlyArray<Issue>;\n\t}\n\n\t/**\n\t * Props accepted by {@link Form}.\n\t */\n\texport interface Props extends TagProps<\"form\"> {\n\t\t/**\n\t\t * Validation issues from a `parseSafe` (or equivalent Standard Schema)\n\t\t * result, provided to every descendant field through component\n\t\t * context. Defaults to no issues, matching a first render.\n\t\t *\n\t\t * @example\n\t\t * let result = parseSafe(ContactSchema, await request.formData());\n\t\t * if (!result.success) return ctx.render(<ContactPage issues={result.issues} />, { status: 400 });\n\t\t */\n\t\tissues?: ReadonlyArray<Issue>;\n\t}\n}\n\n/**\n * Resolves the flat field name an issue's `path` addresses, joining every\n * segment with `\".\"` (`[\"address\", \"zip\"]` becomes `\"address.zip\"`).\n *\n * @param path Issue path to resolve, or `undefined` for a form-level issue.\n * @returns The joined field name, or `undefined` when `path` is missing or empty.\n */\nfunction resolveFieldName(path: Form.Issue[\"path\"]): string | undefined {\n\tif (!path || path.length === 0) return undefined;\n\n\treturn path\n\t\t.map((segment) => (typeof segment === \"object\" ? String(segment.key) : String(segment)))\n\t\t.join(\".\");\n}\n\n/**\n * Groups `issues` by the field name each one's `path` resolves to. An issue\n * with no path names no field to group under, so {@link Form} reads those\n * separately, through {@link Form.Context.getFormIssues}.\n *\n * @param issues Issues to group, typically {@link Form.Props.issues} as-is.\n * @returns A map from field name to every issue addressed to it, in `issues` order.\n */\nfunction groupIssuesByField(issues: ReadonlyArray<Form.Issue>): Map<string, Form.Issue[]> {\n\tlet byField = new Map<string, Form.Issue[]>();\n\n\tfor (let issue of issues) {\n\t\tlet name = resolveFieldName(issue.path);\n\t\tif (name === undefined) continue;\n\n\t\tlet bucket = byField.get(name);\n\t\tif (bucket) bucket.push(issue);\n\t\telse byField.set(name, [issue]);\n\t}\n\n\treturn byField;\n}\n\n/**\n * Renders a native `<form>` laying children out in a single column, and\n * provides {@link Form.Context} so descendant fields resolve their own\n * issues by name and focus the first invalid field with no client JS. An\n * issue with no `path` names no field to attach to, so it renders as its\n * own leading `Alert` instead of being silently unreachable — a refusal\n * decided before any field was reached still reaches the person filling\n * the form in.\n *\n * @param handle Runtime handle carrying the host `<form>`'s props and providing {@link Form.Context}.\n * @returns The render function producing the form's markup.\n * @example\n * let result = parseSafe(ContactSchema, formData);\n * <Form method=\"post\" issues={result.success ? undefined : result.issues}>\n * <TextField name=\"email\" label={t(\"contact.email\")} />\n * <Button type=\"submit\">{t(\"contact.submit\")}</Button>\n * </Form>\n */\nexport function Form(handle: Handle<Form.Props, Form.Context>) {\n\treturn () => {\n\t\tlet { issues = DEFAULT_ISSUES, mix, children, ...rest } = handle.props;\n\t\tlet byField = groupIssuesByField(issues);\n\t\tlet formIssues = issues.filter((issue) => resolveFieldName(issue.path) === undefined);\n\t\tlet firstInvalidField = issues\n\t\t\t.map((issue) => resolveFieldName(issue.path))\n\t\t\t.find((name) => name !== undefined);\n\n\t\thandle.context.set({\n\t\t\tgetIssues(name) {\n\t\t\t\treturn byField.get(name) ?? NO_ISSUES;\n\t\t\t},\n\t\t\tisFirstInvalid(name) {\n\t\t\t\treturn name === firstInvalidField;\n\t\t\t},\n\t\t\tgetFormIssues() {\n\t\t\t\treturn formIssues;\n\t\t\t},\n\t\t});\n\n\t\treturn (\n\t\t\t<form {...rest} mix={[flex(), flexCol(), gap(4), mix]}>\n\t\t\t\t{formIssues.length > 0 && (\n\t\t\t\t\t<Alert color=\"danger\" data-slot=\"form-issues\">\n\t\t\t\t\t\t<Alert.Description>\n\t\t\t\t\t\t\t{formIssues.map((issue) => issue.message).join(\" \")}\n\t\t\t\t\t\t</Alert.Description>\n\t\t\t\t\t</Alert>\n\t\t\t\t)}\n\t\t\t\t{children}\n\t\t\t</form>\n\t\t);\n\t};\n}\n\n/**\n * What a field resolved for its own validation state this render, from its\n * own props and from whatever the enclosing {@link Form} knows about it.\n */\nexport interface FieldIssueState {\n\t/** Message the field renders through its `FieldError`, or `undefined` for a field with nothing to report. */\n\terrorMessage: RemixNode | undefined;\n\t/** Whether this is the field that should carry `autofocus`, so focus lands on the first problem after a server round-trip. */\n\tisFirstInvalid: boolean;\n}\n\n/**\n * Reads the {@link Form.Context} provided by the nearest ancestor\n * {@link Form}, resolving to `undefined` when no Form wraps the caller so\n * every field renders safely inside or outside a Form.\n *\n * @param handle Runtime handle of the field performing the lookup.\n * @returns The enclosing form's context, or `undefined` where no Form wraps the caller.\n */\nexport function readFormContext(handle: Handle<unknown, any>): Form.Context | undefined {\n\ttry {\n\t\treturn handle.context.get(Form) as Form.Context | undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Resolves the validation state a field renders: an explicit `errorMessage`\n * always wins over a matching {@link Form} issue for `name`, which is how\n * `Form`'s `issues` reach a field with no per-field prop threaded by hand.\n *\n * @param handle Runtime handle of the field resolving its state.\n * @param name The field's `name` attribute, used to look its issues up.\n * @param errorMessage An `errorMessage` passed directly to the field, if any.\n * @returns The message to render and whether this field carries `autofocus`.\n * @example\n * let { errorMessage, isFirstInvalid } = resolveFieldIssue(handle, \"email\", handle.props.errorMessage);\n */\nexport function resolveFieldIssue(\n\thandle: Handle<unknown, any>,\n\tname: string | undefined,\n\terrorMessage?: RemixNode,\n): FieldIssueState {\n\tif (name === undefined) return { errorMessage, isFirstInvalid: false };\n\n\tlet context = readFormContext(handle);\n\tif (!context) return { errorMessage, isFirstInvalid: false };\n\n\tlet resolved = errorMessage ?? context.getIssues(name)[0]?.message;\n\n\treturn {\n\t\terrorMessage: resolved,\n\t\tisFirstInvalid: Boolean(resolved) && context.isFirstInvalid(name),\n\t};\n}\n"
15
+ "content": "/**\n * The wrapper every multi-field layout starts from: a native `<form>` laying\n * its children out in a single spaced column, and the point where a parsed\n * validation result enters the tree. Set `issues` from a `parseSafe` (or any\n * other Standard Schema compliant) result and every field beneath it can\n * pick out its own errors by name through component context, with no\n * `issues` prop threaded down by hand.\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 { flex, flexCol, gap } from \"@sdxc/u/layout\";\n\nimport { Alert } from \"@sdxc/ui/alert\";\n\n/** {@link Form.Props.issues} fallback for a first, not-yet-submitted render. */\nconst DEFAULT_ISSUES: ReadonlyArray<Form.Issue> = [];\n\n/** Shared empty result {@link Form.Context.getIssues} returns for a field with no matching issue. */\nconst NO_ISSUES: ReadonlyArray<Form.Issue> = [];\n\n/**\n * Prop types for {@link Form} and the context value it provides to\n * descendant fields.\n */\nexport namespace Form {\n\t/**\n\t * A single validation failure as reported by a Standard Schema compliant\n\t * validator. `path` locates the field the issue belongs to — a plain key,\n\t * an index, or a `{ key }` segment — or is omitted for a form-level issue.\n\t */\n\texport interface Issue {\n\t\t/** Human-readable failure message, rendered verbatim by a field's `FieldError`. */\n\t\treadonly message: string;\n\t\t/** Field location of the issue, e.g. `[\"email\"]` or `[\"address\", \"zip\"]`. Omitted for a form-level issue. */\n\t\treadonly path?: ReadonlyArray<PropertyKey | { readonly key: PropertyKey }>;\n\t}\n\n\t/**\n\t * Value {@link Form} stores in component context. A field reads it with\n\t * `handle.context.get(Form)` to find its own issues by name and learn\n\t * whether it's the field that should carry `autofocus` on this render.\n\t */\n\texport interface Context {\n\t\t/**\n\t\t * Every issue whose `path` resolves to `name` (segments joined with\n\t\t * `\".\"`, e.g. `\"address.zip\"`), or an empty array when the field has\n\t\t * none.\n\t\t *\n\t\t * @param name Field name to look up, matching its `name` attribute.\n\t\t * @returns The issues addressed to that field, in {@link Form.Props.issues} order.\n\t\t */\n\t\tgetIssues(name: string): ReadonlyArray<Issue>;\n\t\t/**\n\t\t * `true` for the single field name that comes first among\n\t\t * {@link Form.Props.issues}, so exactly one invalid field renders\n\t\t * `autofocus`, landing keyboard focus on it after a server re-render.\n\t\t *\n\t\t * @param name Field name to check, matching its `name` attribute.\n\t\t * @returns Whether `name` is the first invalid field this render.\n\t\t */\n\t\tisFirstInvalid(name: string): boolean;\n\t\t/**\n\t\t * Every issue with no `path` at all — a failure that names no single\n\t\t * field, such as a server-side refusal decided before any field was\n\t\t * reached. {@link Form} already renders these through its own leading\n\t\t * `Alert`; a caller reaches for this only to render them somewhere\n\t\t * else instead.\n\t\t *\n\t\t * @returns The form-level issues, in {@link Form.Props.issues} order.\n\t\t */\n\t\tgetFormIssues(): ReadonlyArray<Issue>;\n\t}\n\n\t/**\n\t * Props accepted by {@link Form}.\n\t */\n\texport interface Props extends TagProps<\"form\"> {\n\t\t/**\n\t\t * Validation issues from a `parseSafe` (or equivalent Standard Schema)\n\t\t * result, provided to every descendant field through component\n\t\t * context. Defaults to no issues, matching a first render.\n\t\t *\n\t\t * @example\n\t\t * let result = parseSafe(ContactSchema, await request.formData());\n\t\t * if (!result.success) return ctx.render(<ContactPage issues={result.issues} />, { status: 400 });\n\t\t */\n\t\tissues?: ReadonlyArray<Issue>;\n\t}\n}\n\n/**\n * Resolves the flat field name an issue's `path` addresses, joining every\n * segment with `\".\"` (`[\"address\", \"zip\"]` becomes `\"address.zip\"`).\n *\n * @param path Issue path to resolve, or `undefined` for a form-level issue.\n * @returns The joined field name, or `undefined` when `path` is missing or empty.\n */\nfunction resolveFieldName(path: Form.Issue[\"path\"]): string | undefined {\n\tif (!path || path.length === 0) return undefined;\n\n\treturn path\n\t\t.map((segment) => (typeof segment === \"object\" ? String(segment.key) : String(segment)))\n\t\t.join(\".\");\n}\n\n/**\n * Groups `issues` by the field name each one's `path` resolves to. An issue\n * with no path names no field to group under, so {@link Form} reads those\n * separately, through {@link Form.Context.getFormIssues}.\n *\n * @param issues Issues to group, typically {@link Form.Props.issues} as-is.\n * @returns A map from field name to every issue addressed to it, in `issues` order.\n */\nfunction groupIssuesByField(issues: ReadonlyArray<Form.Issue>): Map<string, Form.Issue[]> {\n\tlet byField = new Map<string, Form.Issue[]>();\n\n\tfor (let issue of issues) {\n\t\tlet name = resolveFieldName(issue.path);\n\t\tif (name === undefined) continue;\n\n\t\tlet bucket = byField.get(name);\n\t\tif (bucket) bucket.push(issue);\n\t\telse byField.set(name, [issue]);\n\t}\n\n\treturn byField;\n}\n\n/**\n * Renders a native `<form>` laying children out in a single column, and\n * provides {@link Form.Context} so descendant fields resolve their own\n * issues by name and focus the first invalid field with no client JS. An\n * issue with no `path` names no field to attach to, so it renders as its\n * own leading `Alert` instead of being silently unreachable — a refusal\n * decided before any field was reached still reaches the person filling\n * the form in.\n *\n * @param handle Runtime handle carrying the host `<form>`'s props and providing {@link Form.Context}.\n * @returns The render function producing the form's markup.\n * @example\n * let result = parseSafe(ContactSchema, formData);\n * <Form method=\"post\" issues={result.success ? undefined : result.issues}>\n * <TextField name=\"email\" label={t(\"contact.email\")} />\n * <Button type=\"submit\">{t(\"contact.submit\")}</Button>\n * </Form>\n */\nexport function Form(handle: Handle<Form.Props, Form.Context>) {\n\treturn () => {\n\t\tlet { issues = DEFAULT_ISSUES, mix, children, ...rest } = handle.props;\n\t\tlet byField = groupIssuesByField(issues);\n\t\tlet formIssues = issues.filter((issue) => resolveFieldName(issue.path) === undefined);\n\t\tlet firstInvalidField = issues\n\t\t\t.map((issue) => resolveFieldName(issue.path))\n\t\t\t.find((name) => name !== undefined);\n\n\t\thandle.context.set({\n\t\t\tgetIssues(name) {\n\t\t\t\treturn byField.get(name) ?? NO_ISSUES;\n\t\t\t},\n\t\t\tisFirstInvalid(name) {\n\t\t\t\treturn name === firstInvalidField;\n\t\t\t},\n\t\t\tgetFormIssues() {\n\t\t\t\treturn formIssues;\n\t\t\t},\n\t\t});\n\n\t\treturn (\n\t\t\t<form {...rest} mix={mergeMix([flex(), flexCol(), gap(4)], mix)}>\n\t\t\t\t{formIssues.length > 0 && (\n\t\t\t\t\t<Alert color=\"danger\" data-slot=\"form-issues\">\n\t\t\t\t\t\t<Alert.Description>\n\t\t\t\t\t\t\t{formIssues.map((issue) => issue.message).join(\" \")}\n\t\t\t\t\t\t</Alert.Description>\n\t\t\t\t\t</Alert>\n\t\t\t\t)}\n\t\t\t\t{children}\n\t\t\t</form>\n\t\t);\n\t};\n}\n\n/**\n * What a field resolved for its own validation state this render, from its\n * own props and from whatever the enclosing {@link Form} knows about it.\n */\nexport interface FieldIssueState {\n\t/** Message the field renders through its `FieldError`, or `undefined` for a field with nothing to report. */\n\terrorMessage: RemixNode | undefined;\n\t/** Whether this is the field that should carry `autofocus`, so focus lands on the first problem after a server round-trip. */\n\tisFirstInvalid: boolean;\n}\n\n/**\n * Reads the {@link Form.Context} provided by the nearest ancestor\n * {@link Form}, resolving to `undefined` when no Form wraps the caller so\n * every field renders safely inside or outside a Form.\n *\n * @param handle Runtime handle of the field performing the lookup.\n * @returns The enclosing form's context, or `undefined` where no Form wraps the caller.\n */\nexport function readFormContext(handle: Handle<unknown, any>): Form.Context | undefined {\n\ttry {\n\t\treturn handle.context.get(Form) as Form.Context | undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Resolves the validation state a field renders: an explicit `errorMessage`\n * always wins over a matching {@link Form} issue for `name`, which is how\n * `Form`'s `issues` reach a field with no per-field prop threaded by hand.\n *\n * @param handle Runtime handle of the field resolving its state.\n * @param name The field's `name` attribute, used to look its issues up.\n * @param errorMessage An `errorMessage` passed directly to the field, if any.\n * @returns The message to render and whether this field carries `autofocus`.\n * @example\n * let { errorMessage, isFirstInvalid } = resolveFieldIssue(handle, \"email\", handle.props.errorMessage);\n */\nexport function resolveFieldIssue(\n\thandle: Handle<unknown, any>,\n\tname: string | undefined,\n\terrorMessage?: RemixNode,\n): FieldIssueState {\n\tif (name === undefined) return { errorMessage, isFirstInvalid: false };\n\n\tlet context = readFormContext(handle);\n\tif (!context) return { errorMessage, isFirstInvalid: false };\n\n\tlet resolved = errorMessage ?? context.getIssues(name)[0]?.message;\n\n\treturn {\n\t\terrorMessage: resolved,\n\t\tisFirstInvalid: Boolean(resolved) && context.isFirstInvalid(name),\n\t};\n}\n"
16
16
  },
17
17
  "test": {
18
18
  "path": "form.test.tsx",
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "group",
3
- "changedIn": "2026.10.24",
3
+ "changedIn": "2026.11.3",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Group"
7
7
  ],
8
8
  "source": {
9
9
  "path": "group.tsx",
10
- "content": "/**\n * A visual and semantic wrapper binding a cluster of related controls into\n * one unit — a text input paired with its clear button, a row of segmented\n * buttons, a search field with a trailing submit action. The host lays its\n * children out in a single row, joining their edges so the cluster reads as one\n * control, with the seam between two of them drawn structurally rather than\n * through any tracked state.\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 { outlineColor } from \"@sdxc/u/color\";\nimport { roundedCorner } from \"@sdxc/u/effects\";\nimport { flex, items } from \"@sdxc/u/layout\";\nimport { mis } from \"@sdxc/u/size\";\nimport { z } from \"@sdxc/u/stacking\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\n/**\n * Default ARIA role applied through {@link attrs} unless a consumer\n * overrides `role`; pass `\"region\"` for landmark-worthy content or\n * `\"presentation\"` for purely visual grouping.\n */\nconst DEFAULT_ROLE = \"group\";\n\n/**\n * Prop types for {@link Group}.\n */\nexport namespace Group {\n\t/**\n\t * Native `<div>` attributes plus `mix`. `role` defaults to\n\t * {@link DEFAULT_ROLE} (or `\"region\"`/`\"presentation\"`); `aria-invalid`\n\t * gives the focus ring the danger tone, `aria-disabled` marks it disabled.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n}\n\n/**\n * Lays children out in a centered flex row with no border, background, or gap, joining\n * their edges into one shape: only the cluster's outer corners stay round, and the seam\n * two controls share is drawn once. Focus is shown by whichever control holds it.\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 * <Group>\n * \t<Button>{t(\"stepper.decrement\")}</Button>\n * \t<Button>{t(\"stepper.increment\")}</Button>\n * </Group>\n * @example\n * <Group aria-invalid=\"true\">\n * \t<input aria-label={t(\"form.email\")} />\n * \t<Button aria-label={t(\"form.clear\")}>\n * \t\t<XIcon />\n * \t</Button>\n * </Group>\n */\nexport function Group(handle: Handle<Group.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_ROLE }),\n\t\t\t\t\tflex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * The controls compose into one shape, so the cluster keeps the rounding on\n\t\t\t\t\t * its own outer corners and the seam where two of them meet is drawn once; the\n\t\t\t\t\t * last control before a trailing `<link rel=\"prefetch\">` hint keeps its corners.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"& > *:not(:first-child)\", [\n\t\t\t\t\t\troundedCorner(\"start-start\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"end-start\", \"none\"),\n\t\t\t\t\t\tmis(\"-1px\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\"& > *:has(~ :not(link))\", [\n\t\t\t\t\t\troundedCorner(\"start-end\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"end-end\", \"none\"),\n\t\t\t\t\t]),\n\t\t\t\t\t/**\n\t\t\t\t\t * Focus shows on the control holding it, naming which control has it where a ring\n\t\t\t\t\t * around the cluster names only the group. That control is raised so its ring\n\t\t\t\t\t * crosses the seam it shares with a neighbour.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"& > *:focus-visible\", z(1)),\n\t\t\t\t\twhen('&[aria-invalid=\"true\"] > *:focus-visible', outlineColor(\"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 visual and semantic wrapper binding a cluster of related controls into\n * one unit — a text input paired with its clear button, a row of segmented\n * buttons, a search field with a trailing submit action. The host lays its\n * children out in a single row, joining their edges so the cluster reads as one\n * control, with the seam between two of them drawn structurally rather than\n * through any tracked state.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\nimport type { RemixNode } from \"remix/component\";\n\nimport { bg, border, fg, outline, outlineColor } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor, mergeMix, raw } from \"@sdxc/u/general\";\nimport { flex, grow, items, shrink } from \"@sdxc/u/layout\";\nimport { bs, minIs, mis, pi } from \"@sdxc/u/size\";\nimport { z } from \"@sdxc/u/stacking\";\nimport { when } from \"@sdxc/u/state\";\nimport { nowrap, text } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\n/**\n * Default ARIA role applied through {@link attrs} unless a consumer\n * overrides `role`; pass `\"region\"` for landmark-worthy content or\n * `\"presentation\"` for purely visual grouping.\n */\nconst DEFAULT_ROLE = \"group\";\n\n/** A group holding a {@link Group.Text} addon, which makes it one field drawing its own rings. */\nconst WITH_ADDON = '&:has(> [data-slot=\"group-text\"])';\n\n/** A control whose value fails validation, by the platform's own check or the field's `aria-invalid`. */\nconst INVALID_CONTROL = ':is(:user-invalid, [aria-invalid=\"true\"])';\n\n/**\n * Prop types for {@link Group}.\n */\nexport namespace Group {\n\t/**\n\t * Native `<div>` attributes plus `mix`. `role` defaults to\n\t * {@link DEFAULT_ROLE} (or `\"region\"`/`\"presentation\"`); `aria-invalid`\n\t * gives the focus ring the danger tone, `aria-disabled` marks it disabled.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n\n\t/**\n\t * Native `<label>` attributes plus `mix`. Set `htmlFor` to the control's `id` so a\n\t * click on the addon focuses it, and `id` to list the addon in the control's\n\t * `aria-describedby`; give the control its name through `aria-label` or\n\t * `aria-labelledby`, which keeps the addon's text out of that name.\n\t */\n\texport interface TextProps extends TagProps<\"label\"> {\n\t\t/** The addon's static text: a currency, a unit, a domain. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Lays children out in a centered flex row with no border, background, or gap, joining\n * their edges into one shape: only the cluster's outer corners stay round, and the seam\n * two controls share is drawn once. Focus is shown by whichever control holds it.\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 * <Group>\n * \t<Button>{t(\"stepper.decrement\")}</Button>\n * \t<Button>{t(\"stepper.increment\")}</Button>\n * </Group>\n * @example\n * <Group aria-invalid=\"true\">\n * \t<input aria-label={t(\"form.email\")} />\n * \t<Button aria-label={t(\"form.clear\")}>\n * \t\t<XIcon />\n * \t</Button>\n * </Group>\n */\nexport function Group(handle: Handle<Group.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tattrs({ role: DEFAULT_ROLE }),\n\t\t\t\t\t\tflex(),\n\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The controls compose into one shape, so the cluster keeps the rounding on\n\t\t\t\t\t\t * its own outer corners and the seam where two of them meet is drawn once; the\n\t\t\t\t\t\t * last control before a trailing `<link rel=\"prefetch\">` hint keeps its corners.\n\t\t\t\t\t\t * The square corners are `!important` so they hold over every child's own\n\t\t\t\t\t\t * rounding, whichever reached the page first.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen(\"& > *:not(:first-child)\", [\n\t\t\t\t\t\t\traw({\n\t\t\t\t\t\t\t\tborderStartStartRadius: \"0 !important\",\n\t\t\t\t\t\t\t\tborderEndStartRadius: \"0 !important\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tmis(\"-1px\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t\"& > *:has(~ :not(link))\",\n\t\t\t\t\t\t\traw({\n\t\t\t\t\t\t\t\tborderStartEndRadius: \"0 !important\",\n\t\t\t\t\t\t\t\tborderEndEndRadius: \"0 !important\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Focus shows on the control holding it, naming which control has it where a ring\n\t\t\t\t\t\t * around the cluster names only the group. That control is raised so its ring\n\t\t\t\t\t\t * crosses the seam it shares with a neighbour.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen(\"& > *:focus-visible\", z(1)),\n\t\t\t\t\t\twhen('&[aria-invalid=\"true\"] > *:focus-visible', outlineColor(\"danger\")),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * With an addon the cluster is one field, so it carries the field's rounding and\n\t\t\t\t\t\t * rings, and the control takes the width the addons leave, down to nothing.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen(WITH_ADDON, rounded(\"md\")),\n\t\t\t\t\t\twhen(`${WITH_ADDON} > :not([data-slot=\"group-text\"])`, [grow(), minIs(0)]),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t`${WITH_ADDON}:has(> :focus-visible)`,\n\t\t\t\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t`${WITH_ADDON}:has(> [data-color=\"success\"]:focus-visible)`,\n\t\t\t\t\t\t\toutlineColor(\"success.ring\"),\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t`${WITH_ADDON}:has(> [data-color=\"warning\"]:focus-visible)`,\n\t\t\t\t\t\t\toutlineColor(\"warning.ring\"),\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t`${WITH_ADDON}:has(> [data-color=\"danger\"]:focus-visible)`,\n\t\t\t\t\t\t\toutlineColor(\"danger.ring\"),\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t`${WITH_ADDON}:has(> ${INVALID_CONTROL})`,\n\t\t\t\t\t\t\toutline({ color: \"danger.ring\", offset: 2 }),\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 * Renders a static addon joined to the control beside it — a currency, a unit, a domain —\n * as a muted, bordered `<label>` that keeps its text on one line. The `<label>` makes a\n * click on the addon focus the control; it dims with a disabled control and takes the\n * danger border with an invalid one, and its group draws the field's focus and invalid rings.\n *\n * @param handle Runtime handle carrying the host `<label>`'s props.\n * @returns The render function producing the addon's markup.\n * @example\n * <Group>\n * \t<Group.Text id=\"slug-prefix\" htmlFor=\"slug\">pulse.dev/</Group.Text>\n * \t<Input id=\"slug\" aria-labelledby=\"slug-label\" aria-describedby=\"slug-prefix\" />\n * </Group>\n */\nGroup.Text = function GroupText(handle: Handle<Group.TextProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<label\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"group-text\"\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\titems(\"center\"),\n\t\t\t\t\t\tshrink(0),\n\t\t\t\t\t\tnowrap(),\n\t\t\t\t\t\tbs(10),\n\t\t\t\t\t\tpi(3),\n\t\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\t\tborder({ color: \"neutral\", width: 1 }),\n\t\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\t\tcursor(\"text\"),\n\t\t\t\t\t\twhen(`${INVALID_CONTROL} ~ &, &:has(~ ${INVALID_CONTROL})`, border(\"danger\")),\n\t\t\t\t\t\twhen(\":disabled ~ &, &:has(~ :disabled)\", [opacity(50), cursor(\"not-allowed\")]),\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": "group.test.tsx",
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "header",
3
- "changedIn": "2026.10.2",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Header"
7
7
  ],
8
8
  "source": {
9
9
  "path": "header.tsx",
10
- "content": "/**\n * A small, muted section label rendered inside a native `<header>` element —\n * the heading that introduces a group of related items inside a listbox,\n * menu, or combobox section. It carries no interactive behavior of its own,\n * only the compact uppercase typography that sets it apart from the items\n * beneath it.\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 { pb, pi } from \"@sdxc/u/size\";\nimport { text, textTransform, tracking, weight } from \"@sdxc/u/typography\";\n\n/**\n * Props accepted by {@link Header}.\n */\nexport namespace Header {\n\t/**\n\t * Native `<header>` attributes plus `mix`. Renders whatever `children`\n\t * the consumer supplies — a section's name, most often plain text.\n\t */\n\texport interface Props extends TagProps<\"header\"> {}\n}\n\n/**\n * Renders its children inside a `<header>` element styled as a small,\n * muted, uppercase section label — the heading introducing a group of\n * related items inside a listbox, menu, or combobox section.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the section label's markup.\n * @example\n * <Header>Fruits</Header>\n */\nexport function Header(handle: Handle<Header.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<header\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tpi(3),\n\t\t\t\t\tpb(1.5),\n\t\t\t\t\tweight(\"semibold\"),\n\t\t\t\t\ttracking(\"wider\"),\n\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\ttext(\"xs\"),\n\t\t\t\t\ttextTransform(\"uppercase\"),\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 small, muted section label rendered inside a native `<header>` element —\n * the heading that introduces a group of related items inside a listbox,\n * menu, or combobox section. It carries no interactive behavior of its own,\n * only the compact uppercase typography that sets it apart from the items\n * beneath it.\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 { pb, pi } from \"@sdxc/u/size\";\nimport { text, textTransform, tracking, weight } from \"@sdxc/u/typography\";\n\n/**\n * Props accepted by {@link Header}.\n */\nexport namespace Header {\n\t/**\n\t * Native `<header>` attributes plus `mix`. Renders whatever `children`\n\t * the consumer supplies — a section's name, most often plain text.\n\t */\n\texport interface Props extends TagProps<\"header\"> {}\n}\n\n/**\n * Renders its children inside a `<header>` element styled as a small,\n * muted, uppercase section label — the heading introducing a group of\n * related items inside a listbox, menu, or combobox section.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the section label's markup.\n * @example\n * <Header>Fruits</Header>\n */\nexport function Header(handle: Handle<Header.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<header\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tpi(3),\n\t\t\t\t\t\tpb(1.5),\n\t\t\t\t\t\tweight(\"semibold\"),\n\t\t\t\t\t\ttracking(\"wider\"),\n\t\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\t\ttext(\"xs\"),\n\t\t\t\t\t\ttextTransform(\"uppercase\"),\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
  }