@sdxc/kit 0.0.0-pre.1 → 2026.10.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/changelog.jsonl +1040 -0
  2. package/dist/make/declare.js +13 -13
  3. package/dist/make/generate.d.ts +6 -0
  4. package/dist/make/generate.js +22 -7
  5. package/dist/make/imports.js +2 -1
  6. package/dist/make/migrations.d.ts +26 -6
  7. package/dist/make/migrations.js +84 -16
  8. package/dist/releases.js +1 -1
  9. package/dist/testing.d.ts +4 -1
  10. package/dist/testing.js +5 -2
  11. package/dist/upgrade/prompt.js +1 -1
  12. package/package.json +8 -8
  13. package/registry/ui/accordion.json +15 -0
  14. package/registry/ui/alert-dialog.json +20 -0
  15. package/registry/ui/alert.json +15 -0
  16. package/registry/ui/aspect-ratio.json +13 -0
  17. package/registry/ui/attachment.json +15 -0
  18. package/registry/ui/avatar.json +15 -0
  19. package/registry/ui/badge.json +13 -0
  20. package/registry/ui/breadcrumbs.json +15 -0
  21. package/registry/ui/bubble.json +13 -0
  22. package/registry/ui/button.json +16 -0
  23. package/registry/ui/calendar.json +16 -0
  24. package/registry/ui/card.json +18 -0
  25. package/registry/ui/carousel.json +15 -0
  26. package/registry/ui/chart.json +13 -0
  27. package/registry/ui/checkbox-group.json +13 -0
  28. package/registry/ui/checkbox.json +16 -0
  29. package/registry/ui/color-area.json +13 -0
  30. package/registry/ui/color-field.json +20 -0
  31. package/registry/ui/color-picker.json +17 -0
  32. package/registry/ui/color-slider.json +13 -0
  33. package/registry/ui/color-swatch-picker.json +15 -0
  34. package/registry/ui/color-swatch.json +13 -0
  35. package/registry/ui/color-wheel.json +13 -0
  36. package/registry/ui/combobox.json +15 -0
  37. package/registry/ui/command.json +13 -0
  38. package/registry/ui/confirm.json +19 -0
  39. package/registry/ui/context-menu.json +16 -0
  40. package/registry/ui/date-field.json +19 -0
  41. package/registry/ui/date-picker.json +15 -0
  42. package/registry/ui/date-range-picker.json +16 -0
  43. package/registry/ui/description.json +13 -0
  44. package/registry/ui/dialog.json +19 -0
  45. package/registry/ui/disclosure.json +18 -0
  46. package/registry/ui/drawer.json +18 -0
  47. package/registry/ui/drop-indicator.json +13 -0
  48. package/registry/ui/drop-zone.json +13 -0
  49. package/registry/ui/empty.json +15 -0
  50. package/registry/ui/field-error.json +13 -0
  51. package/registry/ui/file-trigger.json +13 -0
  52. package/registry/ui/form.json +21 -0
  53. package/registry/ui/grid-list.json +18 -0
  54. package/registry/ui/group.json +13 -0
  55. package/registry/ui/header.json +13 -0
  56. package/registry/ui/heading-scope.json +20 -0
  57. package/registry/ui/heading.json +15 -0
  58. package/registry/ui/highlight.json +16 -0
  59. package/registry/ui/hover-card.json +13 -0
  60. package/registry/ui/image-placeholder.json +16 -0
  61. package/registry/ui/input.json +13 -0
  62. package/registry/ui/item.json +13 -0
  63. package/registry/ui/keyboard.json +13 -0
  64. package/registry/ui/label.json +13 -0
  65. package/registry/ui/link-button.json +16 -0
  66. package/registry/ui/link.json +13 -0
  67. package/registry/ui/listbox.json +15 -0
  68. package/registry/ui/logo.json +15 -0
  69. package/registry/ui/marker.json +13 -0
  70. package/registry/ui/menu.json +19 -0
  71. package/registry/ui/menubar.json +13 -0
  72. package/registry/ui/message-scroller.json +16 -0
  73. package/registry/ui/message.json +13 -0
  74. package/registry/ui/meter.json +13 -0
  75. package/registry/ui/modal.json +15 -0
  76. package/registry/ui/nav-link.json +13 -0
  77. package/registry/ui/navigation-menu.json +15 -0
  78. package/registry/ui/number-field.json +15 -0
  79. package/registry/ui/otp-field.json +15 -0
  80. package/registry/ui/overlay-arrow.json +13 -0
  81. package/registry/ui/pagination.json +16 -0
  82. package/registry/ui/popover.json +13 -0
  83. package/registry/ui/progress-bar.json +13 -0
  84. package/registry/ui/radio-group.json +13 -0
  85. package/registry/ui/range-calendar.json +16 -0
  86. package/registry/ui/resizable.json +13 -0
  87. package/registry/ui/scroll-area.json +13 -0
  88. package/registry/ui/search-field.json +16 -0
  89. package/registry/ui/section.json +13 -0
  90. package/registry/ui/select.json +13 -0
  91. package/registry/ui/selection-indicator.json +13 -0
  92. package/registry/ui/sentinel-row.json +16 -0
  93. package/registry/ui/separator.json +13 -0
  94. package/registry/ui/shared-element.json +13 -0
  95. package/registry/ui/sheet.json +15 -0
  96. package/registry/ui/shortcut-list.json +18 -0
  97. package/registry/ui/sidebar.json +20 -0
  98. package/registry/ui/skeleton.json +13 -0
  99. package/registry/ui/slider.json +16 -0
  100. package/registry/ui/spinner.json +13 -0
  101. package/registry/ui/switch.json +16 -0
  102. package/registry/ui/table.json +16 -0
  103. package/registry/ui/tabs.json +17 -0
  104. package/registry/ui/tag-group.json +18 -0
  105. package/registry/ui/text-field.json +19 -0
  106. package/registry/ui/text.json +13 -0
  107. package/registry/ui/textarea.json +13 -0
  108. package/registry/ui/time-field.json +19 -0
  109. package/registry/ui/toast.json +16 -0
  110. package/registry/ui/toggle-button.json +17 -0
  111. package/registry/ui/toolbar.json +13 -0
  112. package/registry/ui/tooltip.json +16 -0
  113. package/registry/ui/tree.json +18 -0
  114. package/registry/ui/typeset.json +16 -0
  115. package/registry/ui/youtube-embed.json +16 -0
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "date-picker",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [
5
+ "date-field"
6
+ ],
7
+ "exports": [
8
+ "DatePicker"
9
+ ],
10
+ "source": {
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"
13
+ },
14
+ "test": null
15
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "date-range-picker",
3
+ "changedIn": "2026.10.2",
4
+ "dependencies": [
5
+ "date-field",
6
+ "date-picker"
7
+ ],
8
+ "exports": [
9
+ "DateRangePicker"
10
+ ],
11
+ "source": {
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"
14
+ },
15
+ "test": null
16
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "description",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "Description"
7
+ ],
8
+ "source": {
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"
11
+ },
12
+ "test": null
13
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "dialog",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [
5
+ "button",
6
+ "heading-scope"
7
+ ],
8
+ "exports": [
9
+ "Dialog"
10
+ ],
11
+ "source": {
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"
14
+ },
15
+ "test": {
16
+ "path": "dialog.test.tsx",
17
+ "content": "/**\n * Tests for the panel's positioning scheme, ring-shadow edge and text wrapping:\n * a modal dialog is measured against the viewport, while the page's flow keeps\n * the containing block its dismiss control pins itself to. These assertions\n * read the CSS the component renders.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { Dialog } from \"@sdxc/ui/dialog\";\n\n/**\n * Renders a panel and returns the CSS text of every `<style>` tag it emitted,\n * joined in emission order — which is also the order the generated cascade\n * layers resolve in, so a later rule wins over an earlier one.\n */\nasync function panelStyles(): Promise<string> {\n\tlet html = await renderToString(\n\t\t<Dialog id=\"confirm-delete\">\n\t\t\t<Dialog.Header>\n\t\t\t\t<Dialog.Title>Delete project?</Dialog.Title>\n\t\t\t</Dialog.Header>\n\t\t</Dialog>,\n\t);\n\n\treturn [...html.matchAll(/<style[^>]*>([\\s\\S]*?)<\\/style>/g)].map((match) => match[1]).join(\"\\n\");\n}\n\n/**\n * Collapses whitespace so a declaration can be matched without depending on\n * how the serializer indents a nested block.\n */\nfunction flatten(css: string): string {\n\treturn css.replace(/\\s+/g, \" \");\n}\n\ndescribe(\"Dialog\", () => {\n\ttest(\"measures the modal panel against the viewport\", async () => {\n\t\texpect(flatten(await panelStyles())).toContain(\"&:modal { position: fixed; }\");\n\t});\n\n\ttest(\"positions the modal panel after the flow scheme, which the layer order resolves in favor of\", async () => {\n\t\tlet css = await panelStyles();\n\n\t\texpect(css.indexOf(\"position: relative\")).toBeGreaterThanOrEqual(0);\n\t\texpect(css.indexOf(\"position: fixed\")).toBeGreaterThan(css.indexOf(\"position: relative\"));\n\t});\n\n\ttest(\"keeps the panel positioned while it sits in the page's flow, so its dismiss control has a containing block\", async () => {\n\t\texpect(await panelStyles()).toContain(\"position: relative\");\n\t});\n\n\ttest(\"caps the panel's height so long content scrolls inside it\", async () => {\n\t\tlet css = await panelStyles();\n\n\t\texpect(css).toContain(\"max-block-size: 90vh\");\n\t\texpect(css).toContain(\"overflow: auto\");\n\t});\n\n\ttest(\"draws its edge as the theme's ring shadow over a transparent border\", async () => {\n\t\tlet css = await panelStyles();\n\n\t\texpect(css).toContain(\"--ui-box-shadow-ring: var(--ui-shadow-ring,\");\n\t\texpect(css).toContain(\"border-color: transparent\");\n\t});\n\n\ttest(\"balances the title and wraps the description prettily\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Dialog id=\"d\">\n\t\t\t\t<Dialog.Title>Delete project?</Dialog.Title>\n\t\t\t\t<Dialog.Description>This removes every file.</Dialog.Description>\n\t\t\t</Dialog>,\n\t\t);\n\n\t\texpect(html).toContain(\"text-wrap: balance\");\n\t\texpect(html).toContain(\"text-wrap: pretty\");\n\t});\n});\n"
18
+ }
19
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "disclosure",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [
5
+ "heading-scope"
6
+ ],
7
+ "exports": [
8
+ "Disclosure"
9
+ ],
10
+ "source": {
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"
13
+ },
14
+ "test": {
15
+ "path": "disclosure.test.tsx",
16
+ "content": "/**\n * Tests for the tab stop {@link Disclosure.Trigger} withholds from a row marked\n * `aria-disabled`. A `<summary>` has no `disabled` of its own, so a row left in the tab\n * order still toggles on Enter and Space however muted it looks.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { Disclosure } from \"@sdxc/ui/disclosure\";\n\ndescribe(\"Disclosure.Trigger\", () => {\n\ttest(\"drops a disabled row out of the tab order, so Enter cannot reach it\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Disclosure.Trigger aria-disabled=\"true\">Legacy pricing</Disclosure.Trigger>,\n\t\t);\n\n\t\texpect(html).toContain('tabindex=\"-1\"');\n\t});\n\n\ttest(\"leaves an ordinary row focusable\", async () => {\n\t\tlet html = await renderToString(<Disclosure.Trigger>Refunds</Disclosure.Trigger>);\n\n\t\texpect(html).not.toContain(\"tabindex\");\n\t});\n\n\ttest(\"keeps a consumer's own tab stop on an ordinary row\", async () => {\n\t\tlet html = await renderToString(<Disclosure.Trigger tabIndex={0}>Refunds</Disclosure.Trigger>);\n\n\t\texpect(html).toContain('tabindex=\"0\"');\n\t});\n});\n"
17
+ }
18
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "drawer",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [
5
+ "dialog"
6
+ ],
7
+ "exports": [
8
+ "Drawer"
9
+ ],
10
+ "source": {
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"
13
+ },
14
+ "test": {
15
+ "path": "drawer.test.tsx",
16
+ "content": "/**\n * Covers the drawer's motion, read from the stylesheet it emits: it enters\n * with the full slide from its edge and leaves on a shorter, gentler exit — a\n * fade with a small drift and blur rather than the whole slide back out.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { durations } from \"@sdxc/ui/animations\";\n\nimport { Drawer } from \"@sdxc/ui/drawer\";\n\n/** Renders a drawer docked to `placement` and returns its markup with whitespace collapsed. */\nasync function render(placement: Drawer.Placement): Promise<string> {\n\tlet html = await renderToString(\n\t\t<Drawer id=\"cart\" placement={placement}>\n\t\t\tCart\n\t\t</Drawer>,\n\t);\n\treturn html.replace(/\\s+/g, \" \");\n}\n\ndescribe(\"Drawer\", () => {\n\ttest(\"enters from fully off its edge and exits only a short drift toward it\", async () => {\n\t\tlet html = await render(\"right\");\n\n\t\texpect(html).toContain(\"--ui-drawer-enter-offset: 100% 0\");\n\t\texpect(html).toContain(\"--ui-drawer-exit-offset: 1rem 0\");\n\t\texpect(html).toContain(\"translate: var(--ui-drawer-exit-offset)\");\n\t});\n\n\ttest(\"fades and blurs out on a clock shorter than its entry\", async () => {\n\t\tlet html = await render(\"bottom\");\n\n\t\texpect(html).toContain(\"opacity: 0\");\n\t\texpect(html).toContain(\"filter: blur(4px)\");\n\t\texpect(html).toContain(`transition-duration: ${durations.fast}ms`);\n\t\texpect(html).toContain(`transition-duration: ${durations.slow}ms`);\n\t});\n});\n"
17
+ }
18
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "drop-indicator",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "DropIndicator"
7
+ ],
8
+ "source": {
9
+ "path": "drop-indicator.tsx",
10
+ "content": "/**\n * A thin bar rendered in the gap between two items of a reorderable list,\n * marking where a dragged item will land. It holds its space and paints\n * nothing until it becomes the pointer's current drop target, so a list can\n * carry one bar per gap and let each one answer for itself: the gaps stay the\n * same size throughout the drag, and only the one being pointed at is drawn.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg } from \"@sdxc/u/color\";\nimport { rounded, transition } from \"@sdxc/u/effects\";\nimport { bs, is } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\n/**\n * Default {@link DropIndicator.Props.isDropTarget}, leaving the bar unpainted\n * until a consumer marks it as the active target.\n */\nconst DEFAULT_IS_DROP_TARGET = false;\n\n/**\n * Default `aria-hidden` value applied through {@link attrs} unless a\n * consumer overrides it. Assistive technology already hears the drop\n * position through the reorder interaction's own live region.\n */\nconst DEFAULT_ARIA_HIDDEN = \"true\";\n\n/**\n * Prop types for {@link DropIndicator}.\n */\nexport namespace DropIndicator {\n\t/**\n\t * Props accepted by {@link DropIndicator}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Whether this bar marks the pointer's current drop target. Renders\n\t\t * the host's `data-drop-target` attribute when `true`, which is what\n\t\t * draws the bar. Defaults to {@link DEFAULT_IS_DROP_TARGET}.\n\t\t */\n\t\tisDropTarget?: boolean;\n\t}\n}\n\n/**\n * Renders a full-width, hairline-thick, fully rounded bar shaped for the gap\n * between two items in a reorderable list. The host's `data-drop-target`\n * attribute is what paints it: transparent without it, the primary solid color\n * with it.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the bar's markup.\n * @example\n * <DropIndicator isDropTarget={dropTargetKey === item.id} />\n * @example\n * <DropIndicator\n * \tisDropTarget={isCurrentTarget}\n * \tmix={css({ position: \"absolute\", insetInline: \"0\", insetBlockStart: \"-1px\" })}\n * />\n */\nexport function DropIndicator(handle: Handle<DropIndicator.Props>) {\n\treturn () => {\n\t\tlet { isDropTarget, mix, ...rest } = handle.props;\n\t\tlet resolvedIsDropTarget = isDropTarget ?? DEFAULT_IS_DROP_TARGET;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-drop-target={resolvedIsDropTarget ? \"\" : undefined}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ \"aria-hidden\": DEFAULT_ARIA_HIDDEN }),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\tbs(\"0.125rem\"),\n\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\ttransition(\"background-color\", { duration: 150 }),\n\t\t\t\t\t/**\n\t\t\t\t\t * The resting bar paints nothing while keeping its place, so only the targeted gap reads\n\t\t\t\t\t * as marked and the list never reflows when one lights up. The states use exclusive\n\t\t\t\t\t * selectors because each entry compiles into its own cascade layer, landing in any order.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"&:not([data-drop-target])\", bg(\"transparent\")),\n\t\t\t\t\twhen(\"&[data-drop-target]\", bg(\"brand.solid\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n"
11
+ },
12
+ "test": null
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "drop-zone",
3
+ "changedIn": "2026.10.2",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "DropZone"
7
+ ],
8
+ "source": {
9
+ "path": "drop-zone.tsx",
10
+ "content": "/**\n * A styled drop target for files: a dashed, centered surface wrapping a\n * native `<input type=\"file\">`, so picking a file through the platform's own\n * file picker works the moment the markup renders, with no script involved.\n * Its decorative content — an icon, an instructional caption, or both —\n * renders inside the same `<label>` that wraps the input, giving the input\n * its accessible name through the platform's own label association.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { bg, border, fg, outline } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { flex, flexCol, gap, items, justify } from \"@sdxc/u/layout\";\nimport { minBs, pb, pi } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { textAlign } from \"@sdxc/u/typography\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { warnIfNoAccessibleName } from \"@sdxc/ui/utils\";\n\n/**\n * Prop types for {@link DropZone}.\n */\nexport namespace DropZone {\n\t/**\n\t * Per-part styling for the elements this component composes besides its\n\t * own host `<label>`.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the native `<input type=\"file\">` nested inside the zone. */\n\t\tinput?: TagProps<\"input\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link DropZone}. `mix` styles the outer `<label>` —\n\t * the visible drop surface a hydrated drag-and-drop mixin attaches to —\n\t * while `parts.input` styles the nested file input.\n\t */\n\texport interface Props extends TagProps<\"label\"> {\n\t\t/** Native `name` submitted with an enclosing form. */\n\t\tname?: string;\n\t\t/** Comma-separated list of accepted MIME types or file extensions. */\n\t\taccept?: string;\n\t\t/** Whether more than one file may be chosen at once. */\n\t\tmultiple?: boolean;\n\t\t/** Requests a specific camera where a mobile browser's picker offers one. */\n\t\tcapture?: TagProps<\"input\">[\"capture\"];\n\t\t/** Marks the control required for its enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks the control inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/**\n\t\t * The zone's visible content — an icon, an instructional caption, or both —\n\t\t * rendered inside the `<label>` that wraps the file input, so clicking it\n\t\t * opens the picker and names the input via label association.\n\t\t */\n\t\tchildren?: RemixNode;\n\t\t/** Per-part styling for this component's internally composed input. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * Renders a native `<input type=\"file\">` wrapped in a `<label>` styled as a\n * dashed, centered drop surface; a paired drag-and-drop mixin toggles the\n * `data-drop-target` attribute this surface's styling reacts to.\n *\n * @param handle Runtime handle carrying the host `<label>`'s props.\n * @returns The render function producing the drop zone's markup.\n * @example\n * <DropZone name=\"attachments\" multiple>\n * \t{t(\"uploads.dropInstructions\")}\n * </DropZone>\n * @example\n * <DropZone name=\"avatar\" accept=\"image/png, image/jpeg\" aria-label={t(\"profile.chooseAvatar\")}>\n * \t<ImageIcon aria-hidden />\n * </DropZone>\n * @example\n * <DropZone name=\"documents\" multiple accept=\"application/pdf\" required>\n * \t<p>{t(\"uploads.dropHint\")}</p>\n * </DropZone>\n */\nexport function DropZone(handle: Handle<DropZone.Props>) {\n\treturn () => {\n\t\tlet { name, accept, multiple, capture, required, disabled, children, parts, mix, ...rest } =\n\t\t\thandle.props;\n\n\t\twarnIfNoAccessibleName(\n\t\t\thandle.props,\n\t\t\tchildren,\n\t\t\t\"DropZone: a zone with no visible instructional text needs an `aria-label` describing what it accepts — assistive technology has no accessible name to announce for its file input otherwise.\",\n\t\t);\n\n\t\treturn (\n\t\t\t<label\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"zone\"\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:has(input:focus-visible)\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tgap(2),\n\t\t\t\t\tminBs(\"6rem\"),\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tborder({ color: \"neutral\", width: \"2px\", style: \"dashed\" }),\n\t\t\t\t\tpi(6),\n\t\t\t\t\tpb(6),\n\t\t\t\t\ttextAlign(\"center\"),\n\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\twhen(\"&[data-drop-target]\", [border(\"brand.ring\"), bg(\"brand.tint\")]),\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t\t<input\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\tname={name}\n\t\t\t\t\taccept={accept}\n\t\t\t\t\tmultiple={multiple}\n\t\t\t\t\tcapture={capture}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tmix={parts?.input}\n\t\t\t\t/>\n\t\t\t</label>\n\t\t);\n\t};\n}\n"
11
+ },
12
+ "test": null
13
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "empty",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [
5
+ "heading-scope"
6
+ ],
7
+ "exports": [
8
+ "Empty"
9
+ ],
10
+ "source": {
11
+ "path": "empty.tsx",
12
+ "content": "/**\n * A placeholder for a section that currently has nothing to show — a\n * dashed-bordered panel that composes an icon, a title, a description, and\n * an action into one empty-state layout. The compound parts let a consumer\n * include only the pieces a given empty state 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 { bg, border, colorMix, fg } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { flex, flexCol, flexWrap, gap, items, justify } from \"@sdxc/u/layout\";\nimport { bs, is, mbs, p } from \"@sdxc/u/size\";\nimport {\n\tbalance,\n\tfontSize,\n\tleading,\n\tpretty,\n\ttextAlign,\n\ttracking,\n\tweight,\n} from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport type { SemanticColor } from \"@sdxc/ui/utils\";\n\nimport { semanticColorPanel } from \"@sdxc/ui/styles\";\nimport { DEFAULT_ICON_ARIA_HIDDEN } from \"@sdxc/ui/utils\";\n\nimport { resolveHeadingLevel, TAG_BY_LEVEL } from \"@sdxc/ui/heading-scope\";\n\n/**\n * Default {@link Empty.Props.color}, rendering the panel in the neutral\n * tone when a consumer names no semantic color.\n */\nconst DEFAULT_COLOR = \"neutral\";\n\n/**\n * Prop types for {@link Empty} and its compound parts.\n */\nexport namespace Empty {\n\t/**\n\t * Semantic tone driving the panel's border, tint, and foreground color\n\t * through the `--ui-*` variables for that color. Every part below the\n\t * root reads its own color from the inherited `currentcolor` this sets.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * Props accepted by {@link Empty}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Semantic tone of the panel. Default: `\"neutral\"`. */\n\t\tcolor?: Color;\n\t\t/** The panel's compound parts: {@link Empty.Icon}, {@link Empty.Title}, {@link Empty.Description}, {@link Empty.Action}, or any other content. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Empty.Icon}.\n\t */\n\texport interface IconProps extends TagProps<\"div\"> {\n\t\t/** Icon graphic rendered inside the icon well. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Empty.Title}. The rendered tag depends on the\n\t * nearest ambient heading level, falling back to `<h1>` where nothing\n\t * supplies one; every native heading-element attribute still applies.\n\t */\n\texport interface TitleProps extends TagProps<\"h1\"> {\n\t\t/** Heading copy for the empty state. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Empty.Description}.\n\t */\n\texport interface DescriptionProps extends TagProps<\"p\"> {\n\t\t/** Supporting copy elaborating on the empty state. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Empty.Action}.\n\t */\n\texport interface ActionProps extends TagProps<\"div\"> {\n\t\t/** Call-to-action content, typically a button or link. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders the empty-state panel: a dashed-bordered column tinted to the\n * color role in {@link Empty.Props.color}. Its compound parts inherit that\n * color through `currentcolor`.\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 * <Empty>\n * \t<Empty.Icon><InboxIcon /></Empty.Icon>\n * \t<Empty.Title>{t(\"inbox.empty.title\")}</Empty.Title>\n * \t<Empty.Description>{t(\"inbox.empty.description\")}</Empty.Description>\n * \t<Empty.Action>\n * \t\t<Button>{t(\"inbox.empty.action\")}</Button>\n * \t</Empty.Action>\n * </Empty>\n * @example\n * <Empty color=\"danger\">\n * \t<Empty.Title>{t(\"errors.notFound.title\")}</Empty.Title>\n * </Empty>\n */\nexport function Empty(handle: Handle<Empty.Props>) {\n\treturn () => {\n\t\tlet { color = DEFAULT_COLOR, children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-color={color}\n\t\t\t\tdata-slot=\"empty\"\n\t\t\t\tmix={[\n\t\t\t\t\tsemanticColorPanel(),\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tgap(3),\n\t\t\t\t\trounded(\"xl\"),\n\t\t\t\t\tborder({ width: \"1px\", style: \"dashed\" }),\n\t\t\t\t\tp(8),\n\t\t\t\t\ttextAlign(\"center\"),\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 Empty.IconProps.children} as the icon well: a fully\n * rounded, tinted badge framing an icon graphic hidden from assistive\n * technology, since {@link Empty.Title}'s text already names the state.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the icon well's markup.\n */\nEmpty.Icon = function EmptyIcon(handle: Handle<Empty.IconProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"icon\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ \"aria-hidden\": DEFAULT_ICON_ARIA_HIDDEN }),\n\t\t\t\t\tflex(),\n\t\t\t\t\tbs(\"3rem\"),\n\t\t\t\t\tis(\"3rem\"),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\tborder({ width: \"1px\", style: \"solid\" }),\n\t\t\t\t\tfg(\"currentcolor\"),\n\t\t\t\t\tborder(colorMix(\"oklab\", { color: \"currentcolor\", weight: 20 }, \"transparent\")),\n\t\t\t\t\tbg(colorMix(\"oklab\", { color: \"currentcolor\", weight: 10 }, \"transparent\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Empty.TitleProps.children} as the empty state's heading,\n * in the native heading element matching its ambient `HeadingScope` depth\n * (or `<h1>` unscoped), sized as the panel's primary text regardless of 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 */\nEmpty.Title = function EmptyTitle(handle: Handle<Empty.TitleProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\t\tlet level = resolveHeadingLevel(handle);\n\t\tlet Tag = TAG_BY_LEVEL[level];\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\tweight(\"semibold\"),\n\t\t\t\t\ttracking(\"tight\"),\n\t\t\t\t\tfontSize(\"base\"),\n\t\t\t\t\tleading(\"snug\"),\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{children}\n\t\t\t</Tag>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Empty.DescriptionProps.children} as the empty state's\n * supporting copy, in a native `<p>` set to seventy percent of the panel's\n * current text color so it reads as secondary to {@link Empty.Title}.\n *\n * @param handle Runtime handle carrying the host `<p>`'s props.\n * @returns The render function producing the description's markup.\n */\nEmpty.Description = function EmptyDescription(handle: Handle<Empty.DescriptionProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<p\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"description\"\n\t\t\t\tmix={[\n\t\t\t\t\tfontSize(\"sm\"),\n\t\t\t\t\tleading(\"relaxed\"),\n\t\t\t\t\tpretty(),\n\t\t\t\t\tfg(colorMix(\"oklab\", { color: \"currentcolor\", weight: 70 }, \"transparent\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</p>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Empty.ActionProps.children} as the empty state's\n * call-to-action slot: a centered, wrapping row spaced a touch below the\n * text above it, so a state offering more than one action lays them out\n * rather than running them together.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the action slot's markup.\n */\nEmpty.Action = function EmptyAction(handle: Handle<Empty.ActionProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"action\"\n\t\t\t\tmix={[\n\t\t\t\t\t/**\n\t\t\t\t\t * The slot lays out however many actions the state offers as a centered row that\n\t\t\t\t\t * wraps, since two buttons side by side outgrow a narrow panel.\n\t\t\t\t\t */\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexWrap(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tgap(2),\n\t\t\t\t\tmbs(1),\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
+ },
14
+ "test": null
15
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "field-error",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "FieldError"
7
+ ],
8
+ "source": {
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"
11
+ },
12
+ "test": null
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "file-trigger",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "FileTrigger"
7
+ ],
8
+ "source": {
9
+ "path": "file-trigger.tsx",
10
+ "content": "/**\n * A pressable surface that opens the platform's file picker, backed by a\n * native `<input type=\"file\">` wrapped in a `<label>` so the platform itself\n * handles the trigger-to-picker wiring. Its visible content renders inside\n * the same label as a button-like surface, colored, weighted, and sized\n * through the same semantic contract as this library's other pressable\n * controls.\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 { visuallyHidden } from \"@sdxc/u/a11y\";\nimport { bg, border, fg, outline } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor, userSelect } from \"@sdxc/u/general\";\nimport { gap, inlineFlex, items, justify, shrink } from \"@sdxc/u/layout\";\nimport { bs, is, minBs, pb, pi } from \"@sdxc/u/size\";\nimport { active, data, hover, when } from \"@sdxc/u/state\";\nimport { text, weight } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { hasAccessibleText } from \"@sdxc/ui/utils\";\n\n/** Semantic color role {@link FileTrigger} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: FileTrigger.Color = \"neutral\";\n\n/** Visual weight {@link FileTrigger} falls back to when `variant` is omitted. */\nconst DEFAULT_VARIANT: FileTrigger.Variant = \"solid\";\n\n/** Size variant {@link FileTrigger} falls back to when `size` is omitted. */\nconst DEFAULT_SIZE: FileTrigger.Size = \"md\";\n\n/**\n * Prop types for {@link FileTrigger}.\n */\nexport namespace FileTrigger {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` variables.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Visual weight the trigger renders with: a solid fill with an on-solid\n\t * foreground, a transparent fill with a strong colored border, or a fully\n\t * transparent fill with just a colored label.\n\t */\n\texport type Variant = \"solid\" | \"outline\" | \"ghost\";\n\n\t/**\n\t * Size variant controlling the trigger's padding and font size.\n\t */\n\texport type Size = \"sm\" | \"md\" | \"lg\";\n\n\t/**\n\t * Per-part styling for the elements this component composes besides its\n\t * own host `<input>`.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the `<label>` rendering as the trigger's visible, pressable surface. */\n\t\ttrigger?: TagProps<\"label\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link FileTrigger}. Every native `<input type=\"file\">`\n\t * attribute applies unchanged except `type` (fixed `\"file\"`), `role` (not\n\t * overridable on a file input), and `size` (repurposed for visual size).\n\t */\n\texport interface Props extends Omit<TagProps<\"input\">, \"type\" | \"role\" | \"size\"> {\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/** Visual weight. Defaults to {@link DEFAULT_VARIANT}. */\n\t\tvariant?: Variant;\n\t\t/** Size variant. Defaults to {@link DEFAULT_SIZE}. */\n\t\tsize?: Size;\n\t\t/**\n\t\t * Switches the picker from choosing individual files to choosing whole\n\t\t * directories, carrying every file nested inside the chosen directory.\n\t\t */\n\t\tacceptDirectory?: boolean;\n\t\t/**\n\t\t * The trigger's visible content, rendered inside the same `<label>` that\n\t\t * wraps the host `<input>` — an icon, text, or both, kept decorative so\n\t\t * the platform's label-to-control association reaches the input on click.\n\t\t */\n\t\tchildren?: RemixNode;\n\t\t/** Per-part styling for this component's internally composed elements. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * Renders a native `<input type=\"file\">` wrapped in a `<label>` styled\n * through this library's shared `data-color`/`data-variant`/`data-size`\n * contract; in dev mode, content lacking an accessible name logs a warning.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the trigger's markup.\n * @example\n * <FileTrigger name=\"avatar\" accept=\"image/png, image/jpeg\">\n * \t{t(\"profile.chooseFile\")}\n * </FileTrigger>\n * @example\n * <FileTrigger name=\"attachments\" multiple color=\"brand\" variant=\"outline\">\n * \t{t(\"thread.attachFiles\")}\n * </FileTrigger>\n * @example\n * <FileTrigger name=\"folder\" acceptDirectory aria-label={t(\"importer.chooseFolder\")} />\n */\nexport function FileTrigger(handle: Handle<FileTrigger.Props>) {\n\treturn () => {\n\t\tlet { color, variant, size, acceptDirectory, children, parts, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\t\tlet resolvedVariant = variant ?? DEFAULT_VARIANT;\n\t\tlet resolvedSize = size ?? DEFAULT_SIZE;\n\n\t\tif (\n\t\t\timport.meta.env.DEV &&\n\t\t\t!handle.props[\"aria-label\"] &&\n\t\t\t!handle.props[\"aria-labelledby\"] &&\n\t\t\t!hasAccessibleText(children)\n\t\t) {\n\t\t\tconsole.warn(\n\t\t\t\t\"FileTrigger: a trigger with no visible label text needs an `aria-label` describing what it opens — assistive technology has no accessible name to announce otherwise.\",\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<label\n\t\t\t\tdata-slot=\"trigger\"\n\t\t\t\tdata-color={resolvedColor}\n\t\t\t\tdata-variant={resolvedVariant}\n\t\t\t\tdata-size={resolvedSize}\n\t\t\t\tmix={[\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tgap(2),\n\t\t\t\t\t/**\n\t\t\t\t\t * A glyph is sized against the label beside it and holds that size, so the row keeps the\n\t\t\t\t\t * height its text and padding ask for; the default `flex-shrink: 1` would squash the glyph\n\t\t\t\t\t * ahead of the words.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"& > svg\", [shrink(), is(4), bs(4)]),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tweight(\"medium\"),\n\t\t\t\t\twhen(\"&:has(input:focus-visible)\", [\n\t\t\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\t\t\tdata(\"color\", \"neutral\", outline(\"neutral.ring\")),\n\t\t\t\t\t\tdata(\"color\", \"success\", outline(\"success.ring\")),\n\t\t\t\t\t\tdata(\"color\", \"warning\", outline(\"warning.ring\")),\n\t\t\t\t\t\tdata(\"color\", \"danger\", outline(\"danger.ring\")),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\"&:has(input:disabled)\", [opacity(50), cursor(\"not-allowed\")]),\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\tuserSelect(),\n\t\t\t\t\tpi(\"1rem\"),\n\t\t\t\t\tpb(\"0.5rem\"),\n\t\t\t\t\ttext(\"sm\"),\n\n\t\t\t\t\t/**\n\t\t\t\t\t * The row measure is stated, so the control lines up with a field of the same size when\n\t\t\t\t\t * a Group fuses the two, and still grows when a long label wraps.\n\t\t\t\t\t */\n\t\t\t\t\tminBs(\"2.5rem\"),\n\n\t\t\t\t\tdata(\"size\", \"sm\", [\n\t\t\t\t\t\tpi(\"0.75rem\"),\n\t\t\t\t\t\tpb(\"0.375rem\"),\n\t\t\t\t\t\ttext(\"xs\"),\n\t\t\t\t\t\tminBs(\"2rem\"),\n\t\t\t\t\t\twhen(\"& > svg\", [is(3), bs(3)]),\n\t\t\t\t\t]),\n\t\t\t\t\tdata(\"size\", \"lg\", [pi(\"1.25rem\"), pb(\"0.625rem\"), text(\"base\"), minBs(\"3rem\")]),\n\n\t\t\t\t\tdata(\"variant\", \"solid\", [\n\t\t\t\t\t\tdata(\"color\", \"brand\", [\n\t\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\t\thover(bg(\"brand.bg-solid-hover\")),\n\t\t\t\t\t\t\tactive(bg(\"brand.bg-solid-pressed\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"neutral\", [\n\t\t\t\t\t\t\tbg(\"neutral.solid\"),\n\t\t\t\t\t\t\tfg(\"neutral.onSolid\"),\n\t\t\t\t\t\t\thover(bg(\"neutral.bg-solid-hover\")),\n\t\t\t\t\t\t\tactive(bg(\"neutral.bg-solid-pressed\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"success\", [\n\t\t\t\t\t\t\tbg(\"success.solid\"),\n\t\t\t\t\t\t\tfg(\"success.onSolid\"),\n\t\t\t\t\t\t\thover(bg(\"success.bg-solid-hover\")),\n\t\t\t\t\t\t\tactive(bg(\"success.bg-solid-pressed\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"warning\", [\n\t\t\t\t\t\t\tbg(\"warning.solid\"),\n\t\t\t\t\t\t\tfg(\"warning.onSolid\"),\n\t\t\t\t\t\t\thover(bg(\"warning.bg-solid-hover\")),\n\t\t\t\t\t\t\tactive(bg(\"warning.bg-solid-pressed\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"danger\", [\n\t\t\t\t\t\t\tbg(\"danger.solid\"),\n\t\t\t\t\t\t\tfg(\"danger.onSolid\"),\n\t\t\t\t\t\t\thover(bg(\"danger.bg-solid-hover\")),\n\t\t\t\t\t\t\tactive(bg(\"danger.bg-solid-pressed\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]),\n\n\t\t\t\t\tdata(\"variant\", \"outline\", [\n\t\t\t\t\t\tborder({ width: 1, noStyleDefault: true }),\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\tdata(\"color\", \"brand\", [\n\t\t\t\t\t\t\tborder(\"brand\"),\n\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\thover([bg(\"brand.tint\"), border(\"brand.border-hover\")]),\n\t\t\t\t\t\t\tactive(bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"neutral\", [\n\t\t\t\t\t\t\tborder(\"neutral\"),\n\t\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\t\thover([bg(\"neutral.tint\"), border(\"neutral.border-hover\")]),\n\t\t\t\t\t\t\tactive(bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"success\", [\n\t\t\t\t\t\t\tborder(\"success\"),\n\t\t\t\t\t\t\tfg(\"success\"),\n\t\t\t\t\t\t\thover([bg(\"success.tint\"), border(\"success.border-hover\")]),\n\t\t\t\t\t\t\tactive(bg(\"success.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"warning\", [\n\t\t\t\t\t\t\tborder(\"warning\"),\n\t\t\t\t\t\t\tfg(\"warning\"),\n\t\t\t\t\t\t\thover([bg(\"warning.tint\"), border(\"warning.border-hover\")]),\n\t\t\t\t\t\t\tactive(bg(\"warning.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"danger\", [\n\t\t\t\t\t\t\tborder(\"danger\"),\n\t\t\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\t\t\thover([bg(\"danger.tint\"), border(\"danger.border-hover\")]),\n\t\t\t\t\t\t\tactive(bg(\"danger.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]),\n\n\t\t\t\t\tdata(\"variant\", \"ghost\", [\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\tdata(\"color\", \"brand\", [\n\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\thover(bg(\"brand.tint\")),\n\t\t\t\t\t\t\tactive(bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"neutral\", [\n\t\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\t\thover(bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\t\t\tactive(bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"success\", [\n\t\t\t\t\t\t\tfg(\"success\"),\n\t\t\t\t\t\t\thover(bg(\"success.tint\")),\n\t\t\t\t\t\t\tactive(bg(\"success.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"warning\", [\n\t\t\t\t\t\t\tfg(\"warning\"),\n\t\t\t\t\t\t\thover(bg(\"warning.tint\")),\n\t\t\t\t\t\t\tactive(bg(\"warning.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"danger\", [\n\t\t\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\t\t\thover(bg(\"danger.tint\")),\n\t\t\t\t\t\t\tactive(bg(\"danger.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]),\n\n\t\t\t\t\tparts?.trigger,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t\t<input\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t{...rest}\n\t\t\t\t\tmix={[acceptDirectory && attrs({ webkitdirectory: true }), visuallyHidden(), mix]}\n\t\t\t\t/>\n\t\t\t</label>\n\t\t);\n\t};\n}\n"
11
+ },
12
+ "test": null
13
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "form",
3
+ "changedIn": "2026.10.2",
4
+ "dependencies": [
5
+ "alert"
6
+ ],
7
+ "exports": [
8
+ "Form",
9
+ "FieldIssueState",
10
+ "readFormContext",
11
+ "resolveFieldIssue"
12
+ ],
13
+ "source": {
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"
16
+ },
17
+ "test": {
18
+ "path": "form.test.tsx",
19
+ "content": "/**\n * Tests for the path {@link Form}'s `issues` takes to reach a field: the\n * parse-then-re-render pattern passes `issues` alone, so a field must find\n * its own message through form context or show no error. Covers lookup by\n * `name`, an explicit `errorMessage` override, the aria wiring, and the\n * `autofocus` on the first invalid field.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport type { Form as FormNamespace } from \"@sdxc/ui/form\";\n\nimport { Form } from \"@sdxc/ui/form\";\nimport { TextField } from \"@sdxc/ui/text-field\";\n\n/**\n * Strips the `<style>` block `renderToString` emits ahead of the markup: the\n * field's own stylesheet mentions `[aria-invalid=\"true\"]` as a selector, so a\n * negative assertion has to look at the rendered elements alone.\n *\n * @param html A full `renderToString` result.\n * @returns Just the markup that follows the emitted styles.\n */\nfunction markup(html: string): string {\n\treturn html.slice(html.indexOf(\"</head>\") + 1);\n}\n\n/** Issues standing in for a failed `parseSafe` over an email/password form. */\nconst ISSUES: ReadonlyArray<FormNamespace.Issue> = [\n\t{ message: \"Enter a valid email\", path: [\"email\"] },\n\t{ message: \"Password is too short\", path: [\"password\"] },\n];\n\ndescribe(Form.name, () => {\n\ttest(\"hands each field its own message from issues alone, with no per-field prop\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Form method=\"post\" issues={ISSUES}>\n\t\t\t\t<TextField name=\"email\" type=\"email\" label=\"Email\" />\n\t\t\t\t<TextField name=\"password\" type=\"password\" label=\"Password\" />\n\t\t\t</Form>,\n\t\t);\n\n\t\texpect(html).toContain(\"Enter a valid email\");\n\t\texpect(html).toContain(\"Password is too short\");\n\t});\n\n\ttest(\"marks a field found in issues invalid and points its aria-describedby at the message\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Form method=\"post\" issues={ISSUES}>\n\t\t\t\t<TextField name=\"email\" type=\"email\" label=\"Email\" />\n\t\t\t</Form>,\n\t\t);\n\n\t\texpect(markup(html)).toContain('aria-invalid=\"true\"');\n\t\texpect(html).toContain(\"-error\");\n\t\texpect(html).toContain(\"aria-describedby\");\n\t});\n\n\ttest(\"gives autofocus to the first invalid field only\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Form method=\"post\" issues={ISSUES}>\n\t\t\t\t<TextField name=\"email\" type=\"email\" label=\"Email\" />\n\t\t\t\t<TextField name=\"password\" type=\"password\" label=\"Password\" />\n\t\t\t</Form>,\n\t\t);\n\n\t\texpect(markup(html).match(/autofocus/gi)).toHaveLength(1);\n\t\texpect(html.indexOf(\"autofocus\")).toBeLessThan(html.indexOf('type=\"password\"'));\n\t});\n\n\ttest(\"leaves a field with no matching issue untouched\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Form method=\"post\" issues={ISSUES}>\n\t\t\t\t<TextField name=\"nickname\" label=\"Nickname\" />\n\t\t\t</Form>,\n\t\t);\n\n\t\texpect(html).not.toContain(\"Enter a valid email\");\n\t\texpect(markup(html)).not.toContain('aria-invalid=\"true\"');\n\t\texpect(markup(html)).not.toContain(\"autofocus\");\n\t});\n\n\ttest(\"renders no error and no autofocus for a form with no issues at all\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Form method=\"post\">\n\t\t\t\t<TextField name=\"email\" type=\"email\" label=\"Email\" />\n\t\t\t</Form>,\n\t\t);\n\n\t\texpect(markup(html)).not.toContain('aria-invalid=\"true\"');\n\t\texpect(markup(html)).not.toContain(\"autofocus\");\n\t});\n\n\ttest(\"lets an explicit errorMessage win over the one issues holds for that field\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Form method=\"post\" issues={ISSUES}>\n\t\t\t\t<TextField name=\"email\" type=\"email\" label=\"Email\" errorMessage=\"That address is taken\" />\n\t\t\t</Form>,\n\t\t);\n\n\t\texpect(html).toContain(\"That address is taken\");\n\t\texpect(html).not.toContain(\"Enter a valid email\");\n\t});\n\n\ttest(\"lets an explicit autoFocus win over the first-invalid default\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Form method=\"post\" issues={ISSUES}>\n\t\t\t\t<TextField name=\"email\" type=\"email\" label=\"Email\" autoFocus={false} />\n\t\t\t</Form>,\n\t\t);\n\n\t\texpect(markup(html)).not.toContain(\"autofocus\");\n\t});\n\n\ttest(\"renders a path-less issue's own message, since no field can claim it\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Form method=\"post\" issues={[{ message: \"Something went wrong. Try again.\" }]}>\n\t\t\t\t<TextField name=\"email\" type=\"email\" label=\"Email\" />\n\t\t\t</Form>,\n\t\t);\n\n\t\texpect(html).toContain(\"Something went wrong. Try again.\");\n\t\texpect(markup(html)).toContain('role=\"alert\"');\n\t});\n\n\ttest(\"joins several path-less issues into one alert, in issues order\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Form method=\"post\" issues={[{ message: \"First problem.\" }, { message: \"Second problem.\" }]}>\n\t\t\t\t<TextField name=\"email\" type=\"email\" label=\"Email\" />\n\t\t\t</Form>,\n\t\t);\n\n\t\texpect(html.indexOf(\"First problem.\")).toBeLessThan(html.indexOf(\"Second problem.\"));\n\t});\n\n\ttest(\"renders no alert at all when every issue names a field\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Form method=\"post\" issues={ISSUES}>\n\t\t\t\t<TextField name=\"email\" type=\"email\" label=\"Email\" />\n\t\t\t\t<TextField name=\"password\" type=\"password\" label=\"Password\" />\n\t\t\t</Form>,\n\t\t);\n\n\t\texpect(markup(html)).not.toContain('data-slot=\"form-issues\"');\n\t});\n\n\ttest(\"a path-less issue does not affect which field gets autofocus\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Form method=\"post\" issues={[{ message: \"Something went wrong.\" }, ...ISSUES]}>\n\t\t\t\t<TextField name=\"email\" type=\"email\" label=\"Email\" />\n\t\t\t\t<TextField name=\"password\" type=\"password\" label=\"Password\" />\n\t\t\t</Form>,\n\t\t);\n\n\t\texpect(markup(html).match(/autofocus/gi)).toHaveLength(1);\n\t\texpect(html.indexOf(\"autofocus\")).toBeLessThan(html.indexOf('type=\"password\"'));\n\t});\n});\n\ndescribe(\"a field outside any Form\", () => {\n\ttest(\"still renders its own errorMessage, and does not fail the lookup it can't satisfy\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<TextField name=\"email\" type=\"email\" label=\"Email\" errorMessage=\"Enter a valid email\" />,\n\t\t);\n\n\t\texpect(html).toContain(\"Enter a valid email\");\n\t\texpect(markup(html)).toContain('aria-invalid=\"true\"');\n\t});\n\n\ttest(\"renders nothing extra when it has no message of its own\", async () => {\n\t\tlet html = await renderToString(<TextField name=\"email\" type=\"email\" label=\"Email\" />);\n\n\t\texpect(markup(html)).not.toContain('aria-invalid=\"true\"');\n\t\texpect(markup(html)).not.toContain(\"autofocus\");\n\t});\n});\n"
20
+ }
21
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "grid-list",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [
5
+ "sentinel-row"
6
+ ],
7
+ "exports": [
8
+ "GridList"
9
+ ],
10
+ "source": {
11
+ "path": "grid-list.tsx",
12
+ "content": "/**\n * An interactive row list built from plain, already-ordered markup: each\n * {@link GridList.Item} carries a stable key a paired selection,\n * keyboard-navigation, or reorder behavior can read, while the list itself\n * renders as a fully static document by default. {@link GridList.Section}\n * groups related rows under an optional {@link GridList.Header} label,\n * {@link GridList.LoadMoreItem} holds a trailing loading placeholder, and\n * {@link GridList.DragHandle} marks the one element inside a row a\n * pointer-driven reorder behavior may grab.\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 { GripVerticalIcon } from \"@sdxc/icons\";\nimport { bg, borderEdge, fg, outline } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor } from \"@sdxc/u/general\";\nimport {\n\tcontainer,\n\tflex,\n\tflexCol,\n\tgap,\n\tgrid,\n\tgridTemplate,\n\titems,\n\trelative,\n\tshrink,\n\tvirtualize,\n} from \"@sdxc/u/layout\";\nimport { at } from \"@sdxc/u/responsive\";\nimport { bs, is, mbs, pb, pbs, pi } from \"@sdxc/u/size\";\nimport { active, data, not, when } from \"@sdxc/u/state\";\nimport { text, textTransform, tracking, weight } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { hitArea } from \"@sdxc/ui/styles\";\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { panelChrome } from \"@sdxc/ui/styles\";\nimport { warnIfNoAccessibleLabel } from \"@sdxc/ui/utils\";\n\nimport { SentinelRow } from \"@sdxc/ui/sentinel-row\";\n\n/**\n * Named container {@link GridList} declares on its own host, so its inner\n * row-list wrapper can react to the list's own width — switching a `\"grid\"`\n * layout's column count, in particular.\n */\nconst CONTAINER_NAME = \"ui-grid-list\";\n\n/** Arrangement {@link GridList} falls back to when `layout` is omitted. */\nconst DEFAULT_LAYOUT: GridList.Layout = \"stack\";\n\n/** `role=\"grid\"` applied to {@link GridList} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_ROLE = \"grid\";\n\n/** `role=\"row\"` applied to {@link GridList.Item} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_ITEM_ROLE = \"row\";\n\n/**\n * Tab stop {@link GridList.Item} falls back to when no explicit `tabIndex` is\n * set, so every row stays individually reachable in ordinary Tab order\n * before a keyboard-navigation behavior collapses the list to one stop.\n */\nconst DEFAULT_ITEM_TAB_INDEX = 0;\n\n/** `role=\"rowgroup\"` applied to {@link GridList.Section} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_SECTION_ROLE = \"rowgroup\";\n\n/** `role=\"gridcell\"` applied to {@link GridList.DragHandle} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_DRAG_HANDLE_ROLE = \"gridcell\";\n\n/**\n * Marker {@link GridList.DragHandle} always carries as `data-drag-handle`\n * via {@link attrs} unless overridden, so a reorder behavior can tell where\n * within the row a drag gesture should originate.\n */\nconst DEFAULT_DRAG_HANDLE_MARKER = true;\n\n/**\n * Prop types for {@link GridList} and its compound parts.\n */\nexport namespace GridList {\n\t/**\n\t * Arrangement of {@link GridList.Item} rows: `\"stack\"` renders them as a\n\t * single column, `\"grid\"` wraps them into a multi-column layout growing\n\t * from two columns up to four as the list's own container widens.\n\t */\n\texport type Layout = \"stack\" | \"grid\";\n\n\t/**\n\t * Per-part styling for the elements {@link GridList} renders besides its\n\t * own host.\n\t */\n\texport interface PartsProps {\n\t\t/**\n\t\t * Styling for the inner wrapper that switches between the `\"stack\"`\n\t\t * and `\"grid\"` layouts and virtualizes a long list through\n\t\t * `content-visibility: auto`.\n\t\t */\n\t\tlist?: TagProps<\"div\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link GridList}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Row arrangement. Defaults to {@link DEFAULT_LAYOUT}. */\n\t\tlayout?: Layout;\n\t\t/** {@link GridList.Item}, {@link GridList.Section}, and {@link GridList.LoadMoreItem} rows to render. */\n\t\tchildren: RemixNode;\n\t\t/** Per-part styling for the list's internal row-list wrapper. */\n\t\tparts?: PartsProps;\n\t}\n\n\t/**\n\t * Props accepted by {@link GridList.Item}.\n\t */\n\texport interface ItemProps extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Stable identifier for this row, mirrored onto both the rendered\n\t\t * element's own `id` and a `data-rmx-key` attribute, so the row is already\n\t\t * correlation-ready for a paired behavior once one is attached.\n\t\t */\n\t\tid: string;\n\t}\n\n\t/**\n\t * Props accepted by {@link GridList.Section}.\n\t */\n\texport interface SectionProps extends TagProps<\"div\"> {\n\t\t/** The section's optional {@link GridList.Header} label, followed by its {@link GridList.Item} rows. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link GridList.Header}.\n\t */\n\texport interface HeaderProps extends TagProps<\"header\"> {}\n\n\t/**\n\t * Props accepted by {@link GridList.LoadMoreItem}.\n\t */\n\texport interface LoadMoreItemProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Props accepted by {@link GridList.DragHandle}: every native `<button>`\n\t * attribute except `type`, fixed to `\"button\"` so it never submits an\n\t * enclosing form, and `children`, fixed to the handle's own grip glyph.\n\t */\n\texport interface DragHandleProps extends Omit<TagProps<\"button\">, \"type\" | \"children\"> {\n\t\t/** Accessible name for the icon-only control, e.g. \"Reorder\" or \"Drag to reorder\". */\n\t\t\"aria-label\": string;\n\t}\n}\n\n/**\n * Renders the list's root host as a bordered `<div>` with `role=\"grid\"`,\n * keeping its row-list layer in an inner wrapper since a `@container` query\n * can't resolve against the host that declares it; reach `parts.list` to adjust it.\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 * <GridList aria-label={t(\"playlist.title\")}>\n * \t<GridList.Item id=\"track-1\">{t(\"playlist.track\", { title: \"Intro\" })}</GridList.Item>\n * \t<GridList.Item id=\"track-2\">{t(\"playlist.track\", { title: \"Chorus\" })}</GridList.Item>\n * </GridList>\n * @example\n * <GridList aria-label={t(\"gallery.title\")} layout=\"grid\">\n * \t<GridList.Item id=\"photo-1\">{t(\"gallery.photo\", { name: \"Sunset\" })}</GridList.Item>\n * \t<GridList.Item id=\"photo-2\">{t(\"gallery.photo\", { name: \"Harbor\" })}</GridList.Item>\n * </GridList>\n */\nexport function GridList(handle: Handle<GridList.Props>) {\n\treturn () => {\n\t\tlet { layout, children, parts, mix, ...rest } = handle.props;\n\t\tlet resolvedLayout = layout ?? DEFAULT_LAYOUT;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t'GridList: needs an \"aria-label\" or \"aria-labelledby\" describing its contents for assistive technology.',\n\t\t);\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_ROLE }),\n\t\t\t\t\tpanelChrome(),\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\tpb(2),\n\t\t\t\t\tpi(2),\n\t\t\t\t\toutline(\"none\"),\n\t\t\t\t\tcontainer(CONTAINER_NAME),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tdata-slot=\"list\"\n\t\t\t\t\tdata-layout={resolvedLayout}\n\t\t\t\t\tmix={[\n\t\t\t\t\t\tflex(),\n\t\t\t\t\t\tflexCol(),\n\t\t\t\t\t\tgap(1),\n\t\t\t\t\t\tvirtualize(\"auto var(--ui-grid-list-intrinsic-size, 32rem)\"),\n\t\t\t\t\t\tdata(\"layout\", \"grid\", [\n\t\t\t\t\t\t\tgrid(),\n\t\t\t\t\t\t\tgap(\"0.5rem\"),\n\t\t\t\t\t\t\tgridTemplate({ columns: \"repeat(2, minmax(0, 1fr))\" }),\n\t\t\t\t\t\t\tat(\"40rem\", CONTAINER_NAME, gridTemplate({ columns: \"repeat(3, minmax(0, 1fr))\" })),\n\t\t\t\t\t\t\tat(\"48rem\", CONTAINER_NAME, gridTemplate({ columns: \"repeat(4, minmax(0, 1fr))\" })),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tparts?.list,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t};\n}\n\n/**\n * Renders a single row: a `<div>` carrying `role=\"row\"`, its `id` mirrored\n * onto a `data-rmx-key` attribute so a paired selection, keyboard-navigation, or\n * reorder behavior can correlate the row with its own state.\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 * <GridList.Item id=\"track-1\">{t(\"playlist.track\", { title: \"Intro\" })}</GridList.Item>\n * @example\n * <GridList.Item id=\"track-2\" aria-selected=\"true\">\n * \t{t(\"playlist.track\", { title: \"Chorus\" })}\n * </GridList.Item>\n */\nGridList.Item = function GridListItem(handle: Handle<GridList.ItemProps>) {\n\treturn () => {\n\t\tlet { id, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tid={id}\n\t\t\t\tdata-rmx-key={id}\n\t\t\t\tmix={[\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tattrs({ role: DEFAULT_ITEM_ROLE, tabIndex: DEFAULT_ITEM_TAB_INDEX }),\n\t\t\t\t\tflex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tgap(2),\n\t\t\t\t\t/**\n\t\t\t\t\t * A leading glyph is sized against the row's text and holds that size when the row runs\n\t\t\t\t\t * short; the default `flex-shrink: 1` would squeeze each glyph by its own row's overrun\n\t\t\t\t\t * and leave the column of glyphs ragged.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"& > svg\", [shrink(), is(4), bs(4)]),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tpb(2),\n\t\t\t\t\tpi(2),\n\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * A selected row is tinted far enough off the surface to read at a glance; the plain tint\n\t\t\t\t\t * matches the list's background. Pointer and selection states use mutually exclusive\n\t\t\t\t\t * selectors, so a hovered row stays visibly selected whichever order the layers land in.\n\t\t\t\t\t */\n\t\t\t\t\twhen('&:hover:not([aria-selected=\"true\"])', bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\twhen('&:active:not([aria-selected=\"true\"])', bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\twhen('&:focus:not([aria-selected=\"true\"])', bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\twhen('&[aria-selected=\"true\"]', bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\twhen('&[aria-selected=\"true\"]:hover', bg(\"brand.bg-tint-pressed\")),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', opacity(50)),\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\toutline(\"none\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a titled group of rows: a `<div>` carrying `role=\"rowgroup\"`,\n * stacking an optional {@link GridList.Header} above its {@link GridList.Item}\n * rows, with a block-start rule before every section but the first.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the section's markup.\n * @example\n * <GridList.Section aria-labelledby=\"recents-heading\">\n * \t<GridList.Header id=\"recents-heading\">{t(\"playlist.recents\")}</GridList.Header>\n * \t<GridList.Item id=\"track-1\">{t(\"playlist.track\", { title: \"Intro\" })}</GridList.Item>\n * </GridList.Section>\n */\nGridList.Section = function GridListSection(handle: Handle<GridList.SectionProps>) {\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_SECTION_ROLE }),\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tgap(1),\n\t\t\t\t\tnot(\":first-child\", [\n\t\t\t\t\t\tmbs(2),\n\t\t\t\t\t\tpbs(2),\n\t\t\t\t\t\tborderEdge(\"block-start\", { color: \"neutral\", width: 1 }),\n\t\t\t\t\t]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a section's label: a `<header>` styled as small, muted, uppercase\n * text for the {@link GridList.Item} rows nested beneath it in a\n * {@link GridList.Section}; point the section's `aria-labelledby` at its `id`.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the label's markup.\n * @example\n * <GridList.Header id=\"recents-heading\">{t(\"playlist.recents\")}</GridList.Header>\n */\nGridList.Header = function GridListHeader(handle: Handle<GridList.HeaderProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<header\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tpb(1),\n\t\t\t\t\tpi(2),\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\n/**\n * Renders a decorative sentinel row: a `<div>` styled as centered, muted\n * small text sized to match {@link GridList.Item}'s vertical rhythm, ready to\n * hold whatever loading indicator a paired enhancement supplies as `children`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the sentinel row's markup.\n * @example\n * <GridList.LoadMoreItem>{t(\"playlist.loadingMore\")}</GridList.LoadMoreItem>\n */\nGridList.LoadMoreItem = SentinelRow;\n\n/**\n * Renders a row's drag grip as a native `<button type=\"button\">` written before the\n * consumer's attributes, so a `command`/`commandfor` pair still runs inside a `<form>`;\n * its pointer target grows to `--ui-target-size` around the 16px glyph.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the handle's markup.\n * @example\n * <GridList.Item id=\"track-1\">\n * \t{t(\"playlist.track\", { title: \"Intro\" })}\n * \t<GridList.DragHandle aria-label={t(\"playlist.reorder\")} />\n * </GridList.Item>\n */\nGridList.DragHandle = function GridListDragHandle(handle: Handle<GridList.DragHandleProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_DRAG_HANDLE_ROLE, \"data-drag-handle\": DEFAULT_DRAG_HANDLE_MARKER }),\n\t\t\t\t\trelative(),\n\t\t\t\t\thitArea(),\n\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\tcursor(\"grab\"),\n\t\t\t\t\tactive(cursor(\"grabbing\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<GripVerticalIcon size={16} />\n\t\t\t</button>\n\t\t);\n\t};\n};\n"
13
+ },
14
+ "test": {
15
+ "path": "grid-list.test.tsx",
16
+ "content": "/**\n * Tests for the `type` {@link GridList.DragHandle} writes: an explicit\n * `type=\"button\"`, positioned before the consumer's own attributes, without\n * which the platform refuses to run an Invoker Command the handle carries\n * inside a `<form>` — it decides whether the pairing is ambiguous while it\n * parses `command`/`commandfor` and never sees a `type` serialized after them.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { GridList } from \"@sdxc/ui/grid-list\";\n\ndescribe(\"GridList.DragHandle\", () => {\n\ttest('types itself \"button\", so its command survives inside a form', async () => {\n\t\tlet html = await renderToString(<GridList.DragHandle aria-label=\"Reorder\" />);\n\n\t\texpect(html).toContain('type=\"button\"');\n\t});\n\n\ttest(\"writes type before the command attributes, which is where the platform reads it\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<GridList.DragHandle aria-label=\"Reorder\" commandfor=\"playlist\" command=\"reorder\" />,\n\t\t);\n\n\t\texpect(html.indexOf('type=\"button\"')).toBeLessThan(html.indexOf(\"commandfor=\"));\n\t\texpect(html.indexOf('type=\"button\"')).toBeLessThan(html.indexOf(\"command=\"));\n\t});\n});\n\ndescribe(\"GridList.DragHandle target\", () => {\n\ttest(\"grows its pointer target around the grip to the minimum target size\", async () => {\n\t\tlet html = String(await renderToString(<GridList.DragHandle aria-label=\"Reorder\" />));\n\n\t\texpect(html).toContain(\"--ui-target-size\");\n\t\texpect(html).toMatch(/position:\\s*relative/);\n\t});\n});\n"
17
+ }
18
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "group",
3
+ "changedIn": "2026.10.13",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "Group"
7
+ ],
8
+ "source": {
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.\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 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"
11
+ },
12
+ "test": null
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "header",
3
+ "changedIn": "2026.10.2",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "Header"
7
+ ],
8
+ "source": {
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"
11
+ },
12
+ "test": null
13
+ }