@sdxc/kit 2026.10.29 → 2026.11.1

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 (113) hide show
  1. package/changelog.jsonl +93 -0
  2. package/dist/make/declare.js +32 -11
  3. package/package.json +2 -2
  4. package/registry/ui/accordion.json +2 -2
  5. package/registry/ui/alert-dialog.json +2 -2
  6. package/registry/ui/alert.json +2 -2
  7. package/registry/ui/aspect-ratio.json +2 -2
  8. package/registry/ui/avatar.json +6 -3
  9. package/registry/ui/badge.json +2 -2
  10. package/registry/ui/breadcrumbs.json +2 -2
  11. package/registry/ui/button.json +5 -3
  12. package/registry/ui/calendar.json +2 -2
  13. package/registry/ui/card.json +2 -2
  14. package/registry/ui/carousel.json +2 -2
  15. package/registry/ui/checkbox-group.json +2 -2
  16. package/registry/ui/checkbox.json +2 -2
  17. package/registry/ui/combobox.json +2 -2
  18. package/registry/ui/command.json +2 -2
  19. package/registry/ui/cta-group.json +2 -2
  20. package/registry/ui/date-field.json +2 -2
  21. package/registry/ui/date-picker.json +2 -2
  22. package/registry/ui/date-range-picker.json +2 -2
  23. package/registry/ui/description.json +2 -2
  24. package/registry/ui/dialog-dismiss.json +13 -0
  25. package/registry/ui/dialog.json +2 -2
  26. package/registry/ui/disclosure.json +2 -2
  27. package/registry/ui/drawer.json +2 -2
  28. package/registry/ui/field-error.json +2 -2
  29. package/registry/ui/form.json +2 -2
  30. package/registry/ui/group.json +2 -2
  31. package/registry/ui/header.json +2 -2
  32. package/registry/ui/heading-scope.json +2 -2
  33. package/registry/ui/heading.json +3 -3
  34. package/registry/ui/highlight.json +3 -3
  35. package/registry/ui/hover-card.json +2 -2
  36. package/registry/ui/image-placeholder.json +2 -2
  37. package/registry/ui/input.json +2 -2
  38. package/registry/ui/item.json +2 -2
  39. package/registry/ui/keyboard.json +2 -2
  40. package/registry/ui/label.json +2 -2
  41. package/registry/ui/link-button.json +5 -3
  42. package/registry/ui/link.json +2 -2
  43. package/registry/ui/listbox.json +2 -2
  44. package/registry/ui/menu.json +2 -2
  45. package/registry/ui/meter.json +2 -2
  46. package/registry/ui/modal.json +2 -2
  47. package/registry/ui/nav-link.json +2 -2
  48. package/registry/ui/navigation-menu.json +2 -2
  49. package/registry/ui/number-field.json +2 -2
  50. package/registry/ui/otp-field.json +2 -2
  51. package/registry/ui/overlay-arrow.json +2 -2
  52. package/registry/ui/pagination.json +2 -2
  53. package/registry/ui/popover.json +2 -2
  54. package/registry/ui/progress-bar.json +2 -2
  55. package/registry/ui/radio-group.json +2 -2
  56. package/registry/ui/range-calendar.json +2 -2
  57. package/registry/ui/scroll-area.json +2 -2
  58. package/registry/ui/search-field.json +2 -2
  59. package/registry/ui/section.json +2 -2
  60. package/registry/ui/select.json +2 -2
  61. package/registry/ui/selection-indicator.json +2 -2
  62. package/registry/ui/sentinel-row.json +2 -2
  63. package/registry/ui/separator.json +2 -2
  64. package/registry/ui/shared-element.json +2 -2
  65. package/registry/ui/sheet.json +2 -2
  66. package/registry/ui/sidebar.json +2 -2
  67. package/registry/ui/slider.json +2 -2
  68. package/registry/ui/spinner.json +2 -2
  69. package/registry/ui/switch.json +2 -2
  70. package/registry/ui/tabs.json +2 -2
  71. package/registry/ui/tag-group.json +2 -2
  72. package/registry/ui/text-field.json +2 -2
  73. package/registry/ui/text.json +2 -2
  74. package/registry/ui/textarea.json +2 -2
  75. package/registry/ui/time-field.json +2 -2
  76. package/registry/ui/toggle-button.json +2 -2
  77. package/registry/ui/tooltip.json +2 -2
  78. package/registry/ui/typeset.json +2 -2
  79. package/registry/ui/youtube-embed.json +2 -2
  80. package/stubs/scaffold.controller.index.stub +1 -1
  81. package/registry/ui/attachment.json +0 -15
  82. package/registry/ui/bubble.json +0 -13
  83. package/registry/ui/chart.json +0 -13
  84. package/registry/ui/color-area.json +0 -13
  85. package/registry/ui/color-field.json +0 -20
  86. package/registry/ui/color-picker.json +0 -17
  87. package/registry/ui/color-slider.json +0 -13
  88. package/registry/ui/color-swatch-picker.json +0 -15
  89. package/registry/ui/color-swatch.json +0 -13
  90. package/registry/ui/color-wheel.json +0 -13
  91. package/registry/ui/context-menu.json +0 -16
  92. package/registry/ui/drop-indicator.json +0 -13
  93. package/registry/ui/drop-zone.json +0 -13
  94. package/registry/ui/empty.json +0 -15
  95. package/registry/ui/feature.json +0 -18
  96. package/registry/ui/file-trigger.json +0 -13
  97. package/registry/ui/grid-list.json +0 -18
  98. package/registry/ui/logo-cloud.json +0 -16
  99. package/registry/ui/marker.json +0 -13
  100. package/registry/ui/marketing-header.json +0 -18
  101. package/registry/ui/marketing-section.json +0 -16
  102. package/registry/ui/menubar.json +0 -13
  103. package/registry/ui/message-scroller.json +0 -16
  104. package/registry/ui/message.json +0 -13
  105. package/registry/ui/resizable.json +0 -13
  106. package/registry/ui/shortcut-list.json +0 -18
  107. package/registry/ui/skeleton.json +0 -13
  108. package/registry/ui/split.json +0 -16
  109. package/registry/ui/stat-strip.json +0 -16
  110. package/registry/ui/table.json +0 -16
  111. package/registry/ui/toast.json +0 -16
  112. package/registry/ui/toolbar.json +0 -13
  113. package/registry/ui/tree.json +0 -18
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "slider",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Slider"
7
7
  ],
8
8
  "source": {
9
9
  "path": "slider.tsx",
10
- "content": "/**\n * A single-value range control built on a native `<input type=\"range\">`,\n * paired with a track that draws its own background rail and a live fill\n * bar, plus an `<output>` for reporting the current value. The root shares\n * the resolved range and value with every part through component context,\n * so a track's fill bar and a thumb's native attributes always agree\n * without a consumer repeating the same numbers twice.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport {\n\tabsolute,\n\tafter,\n\tappearance,\n\tbasis,\n\tbefore,\n\tbg,\n\tborder,\n\tbs,\n\tcursor,\n\tgrow,\n\tinsBe,\n\tinsBs,\n\tinsIe,\n\tinsIs,\n\tinset,\n\tis,\n\titems,\n\tm,\n\tminBs,\n\tminIs,\n\toutlineStyle,\n\tpseudoContent,\n\traw,\n\trelative,\n\trounded,\n\tshrink,\n\ttabularNums,\n\ttranslateX,\n\ttranslateY,\n\tvstack,\n\twhen,\n\tz,\n} from \"@sdxc/u\";\n\nimport { outputCaptionText } from \"@sdxc/ui/styles\";\nimport { rangeThumbAppearance } from \"@sdxc/ui/styles\";\nimport { mergeStyle } from \"@sdxc/ui/utils\";\nimport { resolveFillPercent } from \"@sdxc/ui/utils\";\n\n/** Default {@link Slider.Props} orientation, applied when `orientation` is omitted. */\nconst DEFAULT_ORIENTATION: Slider.Orientation = \"horizontal\";\n\n/** Default {@link Slider.Props} lower bound, applied when `min` is omitted. */\nconst DEFAULT_MIN = 0;\n\n/** Default {@link Slider.Props} upper bound, applied when `max` is omitted. */\nconst DEFAULT_MAX = 100;\n\n/** Default {@link Slider.ThumbProps} step, applied when `step` is omitted. */\nconst DEFAULT_STEP = 1;\n\n/**\n * Negative inset growing {@link Slider.Thumb}'s native input across the track's thin\n * axis to the larger of the thumb and `--ui-target-size`, clamped at zero so a track\n * already that thick keeps its own box.\n */\nconst THUMB_HIT_INSET =\n\t\"min(0px, calc((100% - max(var(--ui-slider-thumb-size, 1.25rem), var(--ui-target-size, 1.5rem))) / 2))\";\n\n/**\n * Prop types for {@link Slider} and its compound parts.\n */\nexport namespace Slider {\n\t/**\n\t * Axis the track's fill bar and thumb travel along: a full-width row, or\n\t * a full-height column.\n\t */\n\texport type Orientation = \"horizontal\" | \"vertical\";\n\n\t/**\n\t * Value {@link Slider} shares through component context so every nested\n\t * {@link Slider.Track}, {@link Slider.Thumb}, and {@link Slider.Output}\n\t * reads the same resolved range, value, orientation, and thumb id.\n\t */\n\texport interface Context {\n\t\t/** Resolved lower bound of the range, shared with {@link Slider.Thumb}. */\n\t\tmin: number;\n\t\t/** Resolved upper bound of the range, shared with {@link Slider.Thumb}. */\n\t\tmax: number;\n\t\t/** Resolved current value, used to compute {@link Slider.Track}'s fill bar and default {@link Slider.Thumb}'s own value. */\n\t\tvalue: number;\n\t\t/** Layout axis, read by {@link Slider.Thumb} to set its accessible orientation. */\n\t\torientation: Orientation;\n\t\t/**\n\t\t * Id shared by {@link Slider.Thumb} (as its own `id`) and\n\t\t * {@link Slider.Output} (as its `htmlFor`) so the two associate\n\t\t * natively without either needing an explicit id from the consumer.\n\t\t */\n\t\tthumbId: string;\n\t}\n\n\t/**\n\t * Props accepted by {@link Slider}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Layout axis. Defaults to {@link DEFAULT_ORIENTATION}. */\n\t\torientation?: Orientation;\n\t\t/** Lower bound of the range. Defaults to {@link DEFAULT_MIN}. */\n\t\tmin?: number;\n\t\t/** Upper bound of the range. Defaults to {@link DEFAULT_MAX}. */\n\t\tmax?: number;\n\t\t/** Current value, for a slider whose value the consumer tracks itself. */\n\t\tvalue?: number;\n\t\t/** Starting value, for a slider that never tracks its own value. */\n\t\tdefaultValue?: number;\n\t}\n\n\t/**\n\t * Props accepted by {@link Slider.Track}.\n\t */\n\texport interface TrackProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<input>` attribute except `type` and `role`, fixed to\n\t * `\"range\"` and the platform's implicit `\"slider\"` role. `min`/`max`/`step`\n\t * override the range inherited from the nearest ancestor {@link Slider}.\n\t */\n\texport interface ThumbProps extends Omit<TagProps<\"input\">, \"type\" | \"role\"> {}\n\n\t/**\n\t * Props accepted by {@link Slider.Output}.\n\t */\n\texport interface OutputProps extends TagProps<\"output\"> {}\n}\n\n/**\n * Renders the root `<div>`, stacking its children and resolving range, value, orientation\n * and thumb id into context. Nested parts scope orientation rules to its `data-slot`, so an\n * ancestor carrying `data-orientation` (a toolbar, a scroll viewport) leaves its layout alone.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props and providing {@link Slider.Context}.\n * @returns The render function producing the root's markup.\n * @example\n * <Slider aria-label={t(\"settings.volume\")} min={0} max={100} defaultValue={40}>\n * \t<Slider.Output />\n * \t<Slider.Track>\n * \t\t<Slider.Thumb />\n * \t</Slider.Track>\n * </Slider>\n * @example\n * <Slider orientation=\"vertical\" min={0} max={10} defaultValue={6}>\n * \t<Slider.Track>\n * \t\t<Slider.Thumb aria-label={t(\"equalizer.band\", { hz: 250 })} />\n * \t</Slider.Track>\n * </Slider>\n */\nexport function Slider(handle: Handle<Slider.Props, Slider.Context>) {\n\treturn () => {\n\t\tlet { orientation, min, max, value, defaultValue, mix, ...rest } = handle.props;\n\t\tlet resolvedOrientation = orientation ?? DEFAULT_ORIENTATION;\n\t\tlet resolvedMin = min ?? DEFAULT_MIN;\n\t\tlet resolvedMax = max ?? DEFAULT_MAX;\n\t\tlet resolvedValue = value ?? defaultValue ?? resolvedMin;\n\n\t\thandle.context.set({\n\t\t\tmin: resolvedMin,\n\t\t\tmax: resolvedMax,\n\t\t\tvalue: resolvedValue,\n\t\t\torientation: resolvedOrientation,\n\t\t\tthumbId: handle.id,\n\t\t});\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-slot=\"slider\"\n\t\t\t\tdata-orientation={resolvedOrientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tvstack({ gap: \"0.5rem\" }),\n\t\t\t\t\twhen('&[data-orientation=\"horizontal\"]', [is(\"100%\"), minIs(\"10rem\")]),\n\t\t\t\t\twhen('&[data-orientation=\"vertical\"]', [bs(\"10rem\"), items(\"center\")]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders the visual track: a `position: relative` `<div>` that draws a rail\n * and fill bar as pseudo-elements sized from context's resolved value, and\n * overlays a nested {@link Slider.Thumb} so native drag spans its full length.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the track's markup.\n * @example\n * <Slider.Track>\n * \t<Slider.Thumb />\n * </Slider.Track>\n */\nSlider.Track = function SliderTrack(handle: Handle<Slider.TrackProps>) {\n\treturn () => {\n\t\tlet { mix, style, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Slider);\n\t\tlet fillPercent = resolveFillPercent(context.min, context.max, context.value);\n\t\tlet resolvedStyle = mergeStyle(style, { \"--ui-slider-fill\": `${fillPercent}%` });\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tstyle={resolvedStyle}\n\t\t\t\tmix={[\n\t\t\t\t\trelative(),\n\t\t\t\t\twhen('[data-orientation=\"horizontal\"] &', [\n\t\t\t\t\t\tis(\"100%\"),\n\t\t\t\t\t\tbs(\"var(--ui-slider-thumb-size, 1.25rem)\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('[data-slot=\"slider\"][data-orientation=\"vertical\"] &', [\n\t\t\t\t\t\tis(\"var(--ui-slider-thumb-size, 1.25rem)\"),\n\t\t\t\t\t\tminBs(\"0\"),\n\t\t\t\t\t]),\n\t\t\t\t\tbefore([absolute(), rounded(\"full\"), bg(\"neutral.border\"), pseudoContent('\"\"')]),\n\t\t\t\t\tafter([absolute(), rounded(\"full\"), bg(\"brand.solid\"), pseudoContent('\"\"')]),\n\t\t\t\t\twhen('[data-slot=\"slider\"][data-orientation=\"vertical\"] &', [\n\t\t\t\t\t\tgrow(),\n\t\t\t\t\t\tshrink(1),\n\t\t\t\t\t\tbasis(\"0%\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('[data-orientation=\"horizontal\"] &::before', [\n\t\t\t\t\t\tbs(\"var(--ui-slider-track-thickness, 0.5rem)\"),\n\t\t\t\t\t\tinsIs(\"0\"),\n\t\t\t\t\t\tinsIe(\"0\"),\n\t\t\t\t\t\tinsBs(\"50%\"),\n\t\t\t\t\t\ttranslateY(\"-50%\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('[data-orientation=\"horizontal\"] &::after', [\n\t\t\t\t\t\tbs(\"var(--ui-slider-track-thickness, 0.5rem)\"),\n\t\t\t\t\t\tis(\"var(--ui-slider-fill, 0%)\"),\n\t\t\t\t\t\tinsIs(\"0\"),\n\t\t\t\t\t\tinsBs(\"50%\"),\n\t\t\t\t\t\ttranslateY(\"-50%\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('[data-slot=\"slider\"][data-orientation=\"vertical\"] &::before', [\n\t\t\t\t\t\tis(\"var(--ui-slider-track-thickness, 0.5rem)\"),\n\t\t\t\t\t\tbs(\"100%\"),\n\t\t\t\t\t\tinsBs(\"0\"),\n\t\t\t\t\t\tinsIs(\"50%\"),\n\t\t\t\t\t\ttranslateX(\"-50%\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('[data-slot=\"slider\"][data-orientation=\"vertical\"] &::after', [\n\t\t\t\t\t\tis(\"var(--ui-slider-track-thickness, 0.5rem)\"),\n\t\t\t\t\t\tbs(\"var(--ui-slider-fill, 0%)\"),\n\t\t\t\t\t\tinsBe(\"0\"),\n\t\t\t\t\t\tinsIs(\"50%\"),\n\t\t\t\t\t\ttranslateX(\"-50%\"),\n\t\t\t\t\t]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders the interactive thumb: a native `<input type=\"range\">` reset to\n * cover {@link Slider.Track}'s full box so native drag and keyboard control\n * span its whole length, rotating with `writing-mode` when vertical.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the thumb's markup.\n * @example\n * <Slider.Thumb aria-label={t(\"settings.volume\")} />\n * @example\n * <Slider.Thumb aria-label={t(\"settings.brightness\")} disabled />\n */\nSlider.Thumb = function SliderThumb(handle: Handle<Slider.ThumbProps>) {\n\treturn () => {\n\t\tlet { id, min, max, step, value, defaultValue, mix, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Slider);\n\t\tlet resolvedStep = step ?? DEFAULT_STEP;\n\t\tlet resolvedValue = value ?? defaultValue ?? context.value;\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"range\"\n\t\t\t\tid={id ?? context.thumbId}\n\t\t\t\tmin={min ?? context.min}\n\t\t\t\tmax={max ?? context.max}\n\t\t\t\tstep={resolvedStep}\n\t\t\t\tdefaultValue={resolvedValue}\n\t\t\t\taria-orientation={context.orientation === \"vertical\" ? \"vertical\" : undefined}\n\t\t\t\tmix={[\n\t\t\t\t\trangeThumbAppearance(\"--ui-slider-thumb-size\", \"--ui-slider-thumb-border-width\"),\n\t\t\t\t\tabsolute(),\n\t\t\t\t\tinset(\"0\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * The native input reaches past the track across its thin axis to a full pointer\n\t\t\t\t\t * target, centred so the thumb stays on the visible rail. Its block axis is that\n\t\t\t\t\t * thin axis in both orientations, since a vertical input runs `vertical-lr`.\n\t\t\t\t\t */\n\t\t\t\t\tinsBs(THUMB_HIT_INSET),\n\t\t\t\t\tinsBe(THUMB_HIT_INSET),\n\t\t\t\t\tz(10),\n\t\t\t\t\tm(\"0\"),\n\t\t\t\t\tappearance(),\n\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\tcursor(\"pointer\"),\n\t\t\t\t\twhen(\"&:disabled\", cursor(\"not-allowed\")),\n\t\t\t\t\toutlineStyle(\"none\"),\n\t\t\t\t\twhen(\"&::-webkit-slider-runnable-track\", [appearance(), bs(\"100%\"), bg(\"transparent\")]),\n\t\t\t\t\twhen(\"&::-moz-range-track\", [\n\t\t\t\t\t\tappearance(),\n\t\t\t\t\t\tbs(\"100%\"),\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\tborder({ style: \"none\" }),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\n\t\t\t\t\t\t'[data-slot=\"slider\"][data-orientation=\"vertical\"] &',\n\t\t\t\t\t\traw({ writingMode: \"vertical-lr\", direction: \"rtl\" }),\n\t\t\t\t\t),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a live readout: a native `<output>` associated by default with\n * the nearest ancestor {@link Slider}'s thumb via `htmlFor`, so assistive\n * technology knows which control it reports on. Pass the value as `children`.\n *\n * @param handle Runtime handle carrying the host `<output>`'s props.\n * @returns The render function producing the readout's markup.\n * @example\n * <Slider.Output>{new Intl.NumberFormat(locale, { style: \"percent\" }).format(0.4)}</Slider.Output>\n */\nSlider.Output = function SliderOutput(handle: Handle<Slider.OutputProps>) {\n\treturn () => {\n\t\tlet { htmlFor, mix, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Slider);\n\n\t\treturn (\n\t\t\t<output\n\t\t\t\t{...rest}\n\t\t\t\thtmlFor={htmlFor ?? context.thumbId}\n\t\t\t\tmix={[outputCaptionText(), tabularNums(), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
10
+ "content": "/**\n * A single-value range control built on a native `<input type=\"range\">`,\n * paired with a track that draws its own background rail and a live fill\n * bar, plus an `<output>` for reporting the current value. The root shares\n * the resolved range and value with every part through component context,\n * so a track's fill bar and a thumb's native attributes always agree\n * without a consumer repeating the same numbers twice.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport {\n\tabsolute,\n\tafter,\n\tappearance,\n\tbasis,\n\tbefore,\n\tbg,\n\tborder,\n\tbs,\n\tcursor,\n\tgrow,\n\tinsBe,\n\tinsBs,\n\tinsIe,\n\tinsIs,\n\tinset,\n\tis,\n\titems,\n\tm,\n\tminBs,\n\tminIs,\n\toutlineStyle,\n\tpseudoContent,\n\traw,\n\trelative,\n\trounded,\n\tshrink,\n\ttabularNums,\n\ttranslateX,\n\ttranslateY,\n\tvstack,\n\twhen,\n\tz,\n} from \"@sdxc/u\";\nimport { mergeMix } from \"@sdxc/u/general\";\n\nimport { outputCaptionText } from \"@sdxc/ui/styles\";\nimport { rangeThumbAppearance } from \"@sdxc/ui/styles\";\nimport { mergeStyle } from \"@sdxc/ui/utils\";\nimport { resolveFillPercent } from \"@sdxc/ui/utils\";\n\n/** Default {@link Slider.Props} orientation, applied when `orientation` is omitted. */\nconst DEFAULT_ORIENTATION: Slider.Orientation = \"horizontal\";\n\n/** Default {@link Slider.Props} lower bound, applied when `min` is omitted. */\nconst DEFAULT_MIN = 0;\n\n/** Default {@link Slider.Props} upper bound, applied when `max` is omitted. */\nconst DEFAULT_MAX = 100;\n\n/** Default {@link Slider.ThumbProps} step, applied when `step` is omitted. */\nconst DEFAULT_STEP = 1;\n\n/**\n * Negative inset growing {@link Slider.Thumb}'s native input across the track's thin\n * axis to the larger of the thumb and `--ui-target-size`, clamped at zero so a track\n * already that thick keeps its own box.\n */\nconst THUMB_HIT_INSET =\n\t\"min(0px, calc((100% - max(var(--ui-slider-thumb-size, 1.25rem), var(--ui-target-size, 1.5rem))) / 2))\";\n\n/**\n * Prop types for {@link Slider} and its compound parts.\n */\nexport namespace Slider {\n\t/**\n\t * Axis the track's fill bar and thumb travel along: a full-width row, or\n\t * a full-height column.\n\t */\n\texport type Orientation = \"horizontal\" | \"vertical\";\n\n\t/**\n\t * Value {@link Slider} shares through component context so every nested\n\t * {@link Slider.Track}, {@link Slider.Thumb}, and {@link Slider.Output}\n\t * reads the same resolved range, value, orientation, and thumb id.\n\t */\n\texport interface Context {\n\t\t/** Resolved lower bound of the range, shared with {@link Slider.Thumb}. */\n\t\tmin: number;\n\t\t/** Resolved upper bound of the range, shared with {@link Slider.Thumb}. */\n\t\tmax: number;\n\t\t/** Resolved current value, used to compute {@link Slider.Track}'s fill bar and default {@link Slider.Thumb}'s own value. */\n\t\tvalue: number;\n\t\t/** Layout axis, read by {@link Slider.Thumb} to set its accessible orientation. */\n\t\torientation: Orientation;\n\t\t/**\n\t\t * Id shared by {@link Slider.Thumb} (as its own `id`) and\n\t\t * {@link Slider.Output} (as its `htmlFor`) so the two associate\n\t\t * natively without either needing an explicit id from the consumer.\n\t\t */\n\t\tthumbId: string;\n\t}\n\n\t/**\n\t * Props accepted by {@link Slider}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Layout axis. Defaults to {@link DEFAULT_ORIENTATION}. */\n\t\torientation?: Orientation;\n\t\t/** Lower bound of the range. Defaults to {@link DEFAULT_MIN}. */\n\t\tmin?: number;\n\t\t/** Upper bound of the range. Defaults to {@link DEFAULT_MAX}. */\n\t\tmax?: number;\n\t\t/** Current value, for a slider whose value the consumer tracks itself. */\n\t\tvalue?: number;\n\t\t/** Starting value, for a slider that never tracks its own value. */\n\t\tdefaultValue?: number;\n\t}\n\n\t/**\n\t * Props accepted by {@link Slider.Track}.\n\t */\n\texport interface TrackProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<input>` attribute except `type` and `role`, fixed to\n\t * `\"range\"` and the platform's implicit `\"slider\"` role. `min`/`max`/`step`\n\t * override the range inherited from the nearest ancestor {@link Slider}.\n\t */\n\texport interface ThumbProps extends Omit<TagProps<\"input\">, \"type\" | \"role\"> {}\n\n\t/**\n\t * Props accepted by {@link Slider.Output}.\n\t */\n\texport interface OutputProps extends TagProps<\"output\"> {}\n}\n\n/**\n * Renders the root `<div>`, stacking its children and resolving range, value, orientation\n * and thumb id into context. Nested parts scope orientation rules to its `data-slot`, so an\n * ancestor carrying `data-orientation` (a toolbar, a scroll viewport) leaves its layout alone.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props and providing {@link Slider.Context}.\n * @returns The render function producing the root's markup.\n * @example\n * <Slider aria-label={t(\"settings.volume\")} min={0} max={100} defaultValue={40}>\n * \t<Slider.Output />\n * \t<Slider.Track>\n * \t\t<Slider.Thumb />\n * \t</Slider.Track>\n * </Slider>\n * @example\n * <Slider orientation=\"vertical\" min={0} max={10} defaultValue={6}>\n * \t<Slider.Track>\n * \t\t<Slider.Thumb aria-label={t(\"equalizer.band\", { hz: 250 })} />\n * \t</Slider.Track>\n * </Slider>\n */\nexport function Slider(handle: Handle<Slider.Props, Slider.Context>) {\n\treturn () => {\n\t\tlet { orientation, min, max, value, defaultValue, mix, ...rest } = handle.props;\n\t\tlet resolvedOrientation = orientation ?? DEFAULT_ORIENTATION;\n\t\tlet resolvedMin = min ?? DEFAULT_MIN;\n\t\tlet resolvedMax = max ?? DEFAULT_MAX;\n\t\tlet resolvedValue = value ?? defaultValue ?? resolvedMin;\n\n\t\thandle.context.set({\n\t\t\tmin: resolvedMin,\n\t\t\tmax: resolvedMax,\n\t\t\tvalue: resolvedValue,\n\t\t\torientation: resolvedOrientation,\n\t\t\tthumbId: handle.id,\n\t\t});\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-slot=\"slider\"\n\t\t\t\tdata-orientation={resolvedOrientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tvstack({ gap: \"0.5rem\" }),\n\t\t\t\t\t\twhen('&[data-orientation=\"horizontal\"]', [is(\"100%\"), minIs(\"10rem\")]),\n\t\t\t\t\t\twhen('&[data-orientation=\"vertical\"]', [bs(\"10rem\"), items(\"center\")]),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders the visual track: a `position: relative` `<div>` that draws a rail\n * and fill bar as pseudo-elements sized from context's resolved value, and\n * overlays a nested {@link Slider.Thumb} so native drag spans its full length.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the track's markup.\n * @example\n * <Slider.Track>\n * \t<Slider.Thumb />\n * </Slider.Track>\n */\nSlider.Track = function SliderTrack(handle: Handle<Slider.TrackProps>) {\n\treturn () => {\n\t\tlet { mix, style, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Slider);\n\t\tlet fillPercent = resolveFillPercent(context.min, context.max, context.value);\n\t\tlet resolvedStyle = mergeStyle(style, { \"--ui-slider-fill\": `${fillPercent}%` });\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tstyle={resolvedStyle}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\trelative(),\n\t\t\t\t\t\twhen('[data-orientation=\"horizontal\"] &', [\n\t\t\t\t\t\t\tis(\"100%\"),\n\t\t\t\t\t\t\tbs(\"var(--ui-slider-thumb-size, 1.25rem)\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('[data-slot=\"slider\"][data-orientation=\"vertical\"] &', [\n\t\t\t\t\t\t\tis(\"var(--ui-slider-thumb-size, 1.25rem)\"),\n\t\t\t\t\t\t\tminBs(\"0\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tbefore([absolute(), rounded(\"full\"), bg(\"neutral.border\"), pseudoContent('\"\"')]),\n\t\t\t\t\t\tafter([absolute(), rounded(\"full\"), bg(\"brand.solid\"), pseudoContent('\"\"')]),\n\t\t\t\t\t\twhen('[data-slot=\"slider\"][data-orientation=\"vertical\"] &', [\n\t\t\t\t\t\t\tgrow(),\n\t\t\t\t\t\t\tshrink(1),\n\t\t\t\t\t\t\tbasis(\"0%\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('[data-orientation=\"horizontal\"] &::before', [\n\t\t\t\t\t\t\tbs(\"var(--ui-slider-track-thickness, 0.5rem)\"),\n\t\t\t\t\t\t\tinsIs(\"0\"),\n\t\t\t\t\t\t\tinsIe(\"0\"),\n\t\t\t\t\t\t\tinsBs(\"50%\"),\n\t\t\t\t\t\t\ttranslateY(\"-50%\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('[data-orientation=\"horizontal\"] &::after', [\n\t\t\t\t\t\t\tbs(\"var(--ui-slider-track-thickness, 0.5rem)\"),\n\t\t\t\t\t\t\tis(\"var(--ui-slider-fill, 0%)\"),\n\t\t\t\t\t\t\tinsIs(\"0\"),\n\t\t\t\t\t\t\tinsBs(\"50%\"),\n\t\t\t\t\t\t\ttranslateY(\"-50%\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('[data-slot=\"slider\"][data-orientation=\"vertical\"] &::before', [\n\t\t\t\t\t\t\tis(\"var(--ui-slider-track-thickness, 0.5rem)\"),\n\t\t\t\t\t\t\tbs(\"100%\"),\n\t\t\t\t\t\t\tinsBs(\"0\"),\n\t\t\t\t\t\t\tinsIs(\"50%\"),\n\t\t\t\t\t\t\ttranslateX(\"-50%\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('[data-slot=\"slider\"][data-orientation=\"vertical\"] &::after', [\n\t\t\t\t\t\t\tis(\"var(--ui-slider-track-thickness, 0.5rem)\"),\n\t\t\t\t\t\t\tbs(\"var(--ui-slider-fill, 0%)\"),\n\t\t\t\t\t\t\tinsBe(\"0\"),\n\t\t\t\t\t\t\tinsIs(\"50%\"),\n\t\t\t\t\t\t\ttranslateX(\"-50%\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders the interactive thumb: a native `<input type=\"range\">` reset to\n * cover {@link Slider.Track}'s full box so native drag and keyboard control\n * span its whole length, rotating with `writing-mode` when vertical.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the thumb's markup.\n * @example\n * <Slider.Thumb aria-label={t(\"settings.volume\")} />\n * @example\n * <Slider.Thumb aria-label={t(\"settings.brightness\")} disabled />\n */\nSlider.Thumb = function SliderThumb(handle: Handle<Slider.ThumbProps>) {\n\treturn () => {\n\t\tlet { id, min, max, step, value, defaultValue, mix, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Slider);\n\t\tlet resolvedStep = step ?? DEFAULT_STEP;\n\t\tlet resolvedValue = value ?? defaultValue ?? context.value;\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"range\"\n\t\t\t\tid={id ?? context.thumbId}\n\t\t\t\tmin={min ?? context.min}\n\t\t\t\tmax={max ?? context.max}\n\t\t\t\tstep={resolvedStep}\n\t\t\t\tdefaultValue={resolvedValue}\n\t\t\t\taria-orientation={context.orientation === \"vertical\" ? \"vertical\" : undefined}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\trangeThumbAppearance(\"--ui-slider-thumb-size\", \"--ui-slider-thumb-border-width\"),\n\t\t\t\t\t\tabsolute(),\n\t\t\t\t\t\tinset(\"0\"),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The native input reaches past the track across its thin axis to a full pointer\n\t\t\t\t\t\t * target, centred so the thumb stays on the visible rail. Its block axis is that\n\t\t\t\t\t\t * thin axis in both orientations, since a vertical input runs `vertical-lr`.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tinsBs(THUMB_HIT_INSET),\n\t\t\t\t\t\tinsBe(THUMB_HIT_INSET),\n\t\t\t\t\t\tz(10),\n\t\t\t\t\t\tm(\"0\"),\n\t\t\t\t\t\tappearance(),\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\tcursor(\"pointer\"),\n\t\t\t\t\t\twhen(\"&:disabled\", cursor(\"not-allowed\")),\n\t\t\t\t\t\toutlineStyle(\"none\"),\n\t\t\t\t\t\twhen(\"&::-webkit-slider-runnable-track\", [appearance(), bs(\"100%\"), bg(\"transparent\")]),\n\t\t\t\t\t\twhen(\"&::-moz-range-track\", [\n\t\t\t\t\t\t\tappearance(),\n\t\t\t\t\t\t\tbs(\"100%\"),\n\t\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\t\tborder({ style: \"none\" }),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t'[data-slot=\"slider\"][data-orientation=\"vertical\"] &',\n\t\t\t\t\t\t\traw({ writingMode: \"vertical-lr\", direction: \"rtl\" }),\n\t\t\t\t\t\t),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a live readout: a native `<output>` associated by default with\n * the nearest ancestor {@link Slider}'s thumb via `htmlFor`, so assistive\n * technology knows which control it reports on. Pass the value as `children`.\n *\n * @param handle Runtime handle carrying the host `<output>`'s props.\n * @returns The render function producing the readout's markup.\n * @example\n * <Slider.Output>{new Intl.NumberFormat(locale, { style: \"percent\" }).format(0.4)}</Slider.Output>\n */\nSlider.Output = function SliderOutput(handle: Handle<Slider.OutputProps>) {\n\treturn () => {\n\t\tlet { htmlFor, mix, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Slider);\n\n\t\treturn (\n\t\t\t<output\n\t\t\t\t{...rest}\n\t\t\t\thtmlFor={htmlFor ?? context.thumbId}\n\t\t\t\tmix={mergeMix([outputCaptionText(), tabularNums()], mix)}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
11
11
  },
12
12
  "test": {
13
13
  "path": "slider.test.tsx",
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "spinner",
3
- "changedIn": "2026.10.2",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Spinner"
7
7
  ],
8
8
  "source": {
9
9
  "path": "spinner.tsx",
10
- "content": "/**\n * A busy indicator rendered as a rotating icon inside a `role=\"progressbar\"`\n * host, colored by a semantic color role and sized by a size variant. Its own\n * styling holds still — compose the `spin()` factory from the animation\n * layer through `mix` for the rotating loop, so a page can render the\n * indicator's shape before any motion-driving CSS lands.\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 { LoaderCircleIcon } from \"@sdxc/icons\";\nimport { bs, fg, inlineFlex, is, items, justify, when } from \"@sdxc/u\";\n\nimport type { SemanticColor } from \"@sdxc/ui/utils\";\n\n/** Semantic color role {@link Spinner} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: Spinner.Color = \"neutral\";\n\n/** Size variant {@link Spinner} falls back to when `size` is omitted. */\nconst DEFAULT_SIZE: Spinner.Size = \"md\";\n\n/**\n * Prop types for {@link Spinner}.\n */\nexport namespace Spinner {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*-fg` variable.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * Size variant controlling the rotating icon's rendered dimensions.\n\t */\n\texport type Size = \"sm\" | \"md\" | \"lg\";\n\n\t/**\n\t * Props accepted by {@link Spinner}.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"aria-label\"> {\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/** Size variant. Defaults to {@link DEFAULT_SIZE}. */\n\t\tsize?: Size;\n\t\t/**\n\t\t * Accessible label announced by assistive technology for as long as\n\t\t * the spinner is on screen. Required — the component ships no\n\t\t * built-in copy, so a consumer's own localized string drives it.\n\t\t */\n\t\t\"aria-label\": string;\n\t}\n}\n\n/**\n * Renders a busy indicator: a `role=\"progressbar\"` host with no\n * `aria-valuenow`, so assistive technology reads it as indeterminate. Pair\n * it with the `spin()` mixin from the animation layer for the rotating loop.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the indicator's markup.\n * @example\n * <Spinner aria-label={t(\"status.loading\")} />\n * @example\n * <Spinner color=\"danger\" size=\"lg\" aria-label={t(\"status.retrying\")} />\n * @example\n * <Spinner mix={[spin()]} aria-label={t(\"status.loading\")} />\n */\nexport function Spinner(handle: Handle<Spinner.Props>) {\n\treturn () => {\n\t\tlet { mix, color, size, \"aria-label\": ariaLabel, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\t\tlet resolvedSize = size ?? DEFAULT_SIZE;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\trole=\"progressbar\"\n\t\t\t\taria-label={ariaLabel}\n\t\t\t\tdata-color={resolvedColor}\n\t\t\t\tdata-size={resolvedSize}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\n\t\t\t\t\twhen('&[data-color=\"brand\"]', fg(\"brand\")),\n\t\t\t\t\twhen('&[data-color=\"neutral\"]', fg(\"neutral\")),\n\t\t\t\t\twhen('&[data-color=\"success\"]', fg(\"success\")),\n\t\t\t\t\twhen('&[data-color=\"warning\"]', fg(\"warning\")),\n\t\t\t\t\twhen('&[data-color=\"danger\"]', fg(\"danger\")),\n\n\t\t\t\t\twhen(\"& svg\", [\n\t\t\t\t\t\tis(\"var(--ui-spinner-icon-size-md, 1.25rem)\"),\n\t\t\t\t\t\tbs(\"var(--ui-spinner-icon-size-md, 1.25rem)\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('&[data-size=\"sm\"] svg', [\n\t\t\t\t\t\tis(\"var(--ui-spinner-icon-size-sm, 1rem)\"),\n\t\t\t\t\t\tbs(\"var(--ui-spinner-icon-size-sm, 1rem)\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('&[data-size=\"lg\"] svg', [\n\t\t\t\t\t\tis(\"var(--ui-spinner-icon-size-lg, 1.75rem)\"),\n\t\t\t\t\t\tbs(\"var(--ui-spinner-icon-size-lg, 1.75rem)\"),\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<LoaderCircleIcon />\n\t\t\t</div>\n\t\t);\n\t};\n}\n"
10
+ "content": "/**\n * A busy indicator rendered as a rotating icon inside a `role=\"progressbar\"`\n * host, colored by a semantic color role and sized by a size variant. Its own\n * styling holds still — compose the `spin()` factory from the animation\n * layer through `mix` for the rotating loop, so a page can render the\n * indicator's shape before any motion-driving CSS lands.\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 { LoaderCircleIcon } from \"@sdxc/icons\";\nimport { bs, fg, inlineFlex, is, items, justify, when } from \"@sdxc/u\";\nimport { mergeMix } from \"@sdxc/u/general\";\n\nimport type { SemanticColor } from \"@sdxc/ui/utils\";\n\n/** Semantic color role {@link Spinner} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: Spinner.Color = \"neutral\";\n\n/** Size variant {@link Spinner} falls back to when `size` is omitted. */\nconst DEFAULT_SIZE: Spinner.Size = \"md\";\n\n/**\n * Prop types for {@link Spinner}.\n */\nexport namespace Spinner {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*-fg` variable.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * Size variant controlling the rotating icon's rendered dimensions.\n\t */\n\texport type Size = \"sm\" | \"md\" | \"lg\";\n\n\t/**\n\t * Props accepted by {@link Spinner}.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"aria-label\"> {\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/** Size variant. Defaults to {@link DEFAULT_SIZE}. */\n\t\tsize?: Size;\n\t\t/**\n\t\t * Accessible label announced by assistive technology for as long as\n\t\t * the spinner is on screen. Required — the component ships no\n\t\t * built-in copy, so a consumer's own localized string drives it.\n\t\t */\n\t\t\"aria-label\": string;\n\t}\n}\n\n/**\n * Renders a busy indicator: a `role=\"progressbar\"` host with no\n * `aria-valuenow`, so assistive technology reads it as indeterminate. Pair\n * it with the `spin()` mixin from the animation layer for the rotating loop.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the indicator's markup.\n * @example\n * <Spinner aria-label={t(\"status.loading\")} />\n * @example\n * <Spinner color=\"danger\" size=\"lg\" aria-label={t(\"status.retrying\")} />\n * @example\n * <Spinner mix={[spin()]} aria-label={t(\"status.loading\")} />\n */\nexport function Spinner(handle: Handle<Spinner.Props>) {\n\treturn () => {\n\t\tlet { mix, color, size, \"aria-label\": ariaLabel, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\t\tlet resolvedSize = size ?? DEFAULT_SIZE;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\trole=\"progressbar\"\n\t\t\t\taria-label={ariaLabel}\n\t\t\t\tdata-color={resolvedColor}\n\t\t\t\tdata-size={resolvedSize}\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tinlineFlex(),\n\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\tjustify(\"center\"),\n\n\t\t\t\t\t\twhen('&[data-color=\"brand\"]', fg(\"brand\")),\n\t\t\t\t\t\twhen('&[data-color=\"neutral\"]', fg(\"neutral\")),\n\t\t\t\t\t\twhen('&[data-color=\"success\"]', fg(\"success\")),\n\t\t\t\t\t\twhen('&[data-color=\"warning\"]', fg(\"warning\")),\n\t\t\t\t\t\twhen('&[data-color=\"danger\"]', fg(\"danger\")),\n\n\t\t\t\t\t\twhen(\"& svg\", [\n\t\t\t\t\t\t\tis(\"var(--ui-spinner-icon-size-md, 1.25rem)\"),\n\t\t\t\t\t\t\tbs(\"var(--ui-spinner-icon-size-md, 1.25rem)\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-size=\"sm\"] svg', [\n\t\t\t\t\t\t\tis(\"var(--ui-spinner-icon-size-sm, 1rem)\"),\n\t\t\t\t\t\t\tbs(\"var(--ui-spinner-icon-size-sm, 1rem)\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-size=\"lg\"] svg', [\n\t\t\t\t\t\t\tis(\"var(--ui-spinner-icon-size-lg, 1.75rem)\"),\n\t\t\t\t\t\t\tbs(\"var(--ui-spinner-icon-size-lg, 1.75rem)\"),\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<LoaderCircleIcon />\n\t\t\t</div>\n\t\t);\n\t};\n}\n"
11
11
  },
12
12
  "test": null
13
13
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "switch",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Switch"
7
7
  ],
8
8
  "source": {
9
9
  "path": "switch.tsx",
10
- "content": "/**\n * A native checkbox styled and wired as an on/off switch: a pill-shaped\n * track whose thumb slides from the inline-start edge to the inline-end\n * edge when checked, tinting with the semantic primary color along the way.\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 {\n\tabsolute,\n\tappearance,\n\tbefore,\n\tbg,\n\tbs,\n\tcursor,\n\tfocusVisible,\n\thstack,\n\tinlineBlock,\n\tinsBs,\n\tinsIs,\n\tis,\n\tm,\n\tmedia,\n\topacity,\n\toutline,\n\tpseudoContent,\n\tverticalAlign,\n\trelative,\n\trounded,\n\tscaleProperty,\n\tshadow,\n\tshrink,\n\ttransition,\n\ttransitionDuration,\n\twhen,\n} from \"@sdxc/u\";\nimport { attrs } from \"remix/component\";\n\nimport { durations, easings } from \"@sdxc/ui/animations\";\n\n/**\n * Applied through {@link attrs} so the host always carries the platform's\n * boolean `switch` attribute, letting recognizing browsers render native\n * switch semantics while others fall back to the host's own CSS and `role=\"switch\"`.\n */\nconst DEFAULT_SWITCH_ATTRIBUTE = true;\n\n/**\n * Prop types for {@link Switch}.\n */\nexport namespace Switch {\n\t/**\n\t * Every native `<input>` attribute except `type`, `role`, and\n\t * `aria-checked` — the host fixes the first two and withholds the third\n\t * so the control's own live checkedness stays the switch's only state.\n\t */\n\texport interface Props extends Omit<TagProps<\"input\">, \"type\" | \"role\" | \"aria-checked\"> {\n\t\t/**\n\t\t * Visible label text rendered after the track, inside the same native\n\t\t * `<label>` wrapping both, so clicking either half toggles the switch\n\t\t * with no separate `htmlFor`/`id` pairing required.\n\t\t */\n\t\tchildren?: RemixNode;\n\t}\n}\n\n/**\n * Renders a single `<input type=\"checkbox\" role=\"switch\">`. It carries no\n * `aria-checked` because an authored value would go stale the instant the\n * switch is flipped; the live control's own checkedness is what persists.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the switch's markup.\n * @example\n * <Switch name=\"notifications\" defaultChecked>{t(\"settings.notifications.label\")}</Switch>\n * @example\n * <Label>\n * \t{t(\"settings.notifications.label\")}\n * \t<Switch name=\"notifications\" defaultChecked />\n * </Label>\n * @example\n * <Switch aria-label={t(\"settings.darkMode\")} checked={isDark} disabled={isLocked} />\n * @example\n * <Switch aria-label={t(\"settings.notifications\")} mix={[ariaChecked()]} />\n */\nexport function Switch(handle: Handle<Switch.Props>) {\n\treturn () => {\n\t\tlet { mix, children, ...rest } = handle.props;\n\n\t\tlet track = (\n\t\t\t<input\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\t// oxlint-disable-next-line jsx-a11y/role-has-required-aria-props -- The host is a native checkbox, so its own checkedness supplies the switch's checked state; see the note above for why authoring one would be worse than omitting it.\n\t\t\t\trole=\"switch\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ switch: DEFAULT_SWITCH_ATTRIBUTE }),\n\t\t\t\t\tappearance(),\n\t\t\t\t\trelative(),\n\t\t\t\t\tinlineBlock(),\n\t\t\t\t\tm(\"0\"),\n\t\t\t\t\tis(\"var(--ui-switch-track-inline-size, 2.75rem)\"),\n\t\t\t\t\tbs(\"var(--ui-switch-track-block-size, 1.5rem)\"),\n\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\tbg(\"neutral.border\"),\n\t\t\t\t\tbefore([\n\t\t\t\t\t\tabsolute(),\n\t\t\t\t\t\tis(\"var(--ui-switch-thumb-size, 1.25rem)\"),\n\t\t\t\t\t\tbs(\"var(--ui-switch-thumb-size, 1.25rem)\"),\n\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\tbg(\"brand.onSolid\"),\n\t\t\t\t\t\ttransition(\"inset-inline-start, scale\", { duration: 150 }),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\"&:checked\", bg(\"brand.solid\")),\n\t\t\t\t\twhen(\"&:active\", bg(\"neutral.strong\")),\n\t\t\t\t\twhen(\"&:checked:active\", bg(\"brand.bg-solid-hover\")),\n\t\t\t\t\tfocusVisible(outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\twhen(\"&:disabled\", opacity(50)),\n\t\t\t\t\tcursor(\"pointer\"),\n\t\t\t\t\tshrink(0),\n\t\t\t\t\ttransition(\"background-color\", { duration: durations.fast, easing: easings.standard }),\n\t\t\t\t\twhen(\"&:disabled\", cursor(\"not-allowed\")),\n\t\t\t\t\tverticalAlign(\"middle\"),\n\t\t\t\t\tbefore([\n\t\t\t\t\t\tpseudoContent('\"\"'),\n\t\t\t\t\t\tinsBs(\"var(--ui-switch-thumb-inset, 0.125rem)\"),\n\t\t\t\t\t\tinsIs(\"var(--ui-switch-thumb-inset, 0.125rem)\"),\n\t\t\t\t\t\tshadow(\"base\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\n\t\t\t\t\t\t\"&:checked\",\n\t\t\t\t\t\tbefore(\n\t\t\t\t\t\t\tinsIs(\n\t\t\t\t\t\t\t\t\"calc(var(--ui-switch-track-inline-size, 2.75rem) - var(--ui-switch-thumb-size, 1.25rem) - var(--ui-switch-thumb-inset, 0.125rem))\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\twhen(\"&:active\", before(scaleProperty(\"0.95\"))),\n\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", before(transitionDuration(\"0s\"))),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\n\t\tif (children === undefined) return track;\n\n\t\treturn (\n\t\t\t<label\n\t\t\t\tmix={[\n\t\t\t\t\thstack({ gap: 2, align: \"center\" }),\n\t\t\t\t\tcursor(\"pointer\"),\n\t\t\t\t\twhen(\"&:has(input:disabled)\", cursor(\"not-allowed\")),\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{track}\n\t\t\t\t{children}\n\t\t\t</label>\n\t\t);\n\t};\n}\n"
10
+ "content": "/**\n * A native checkbox styled and wired as an on/off switch: a pill-shaped\n * track whose thumb slides from the inline-start edge to the inline-end\n * edge when checked, tinting with the semantic primary color along the way.\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 {\n\tabsolute,\n\tappearance,\n\tbefore,\n\tbg,\n\tbs,\n\tcursor,\n\tfocusVisible,\n\thstack,\n\tinlineBlock,\n\tinsBs,\n\tinsIs,\n\tis,\n\tm,\n\tmedia,\n\topacity,\n\toutline,\n\tpseudoContent,\n\tverticalAlign,\n\trelative,\n\trounded,\n\tscaleProperty,\n\tshadow,\n\tshrink,\n\ttransition,\n\ttransitionDuration,\n\twhen,\n} from \"@sdxc/u\";\nimport { mergeMix } from \"@sdxc/u/general\";\nimport { attrs } from \"remix/component\";\n\nimport { durations, easings } from \"@sdxc/ui/animations\";\n\n/**\n * Applied through {@link attrs} so the host always carries the platform's\n * boolean `switch` attribute, letting recognizing browsers render native\n * switch semantics while others fall back to the host's own CSS and `role=\"switch\"`.\n */\nconst DEFAULT_SWITCH_ATTRIBUTE = true;\n\n/**\n * Prop types for {@link Switch}.\n */\nexport namespace Switch {\n\t/**\n\t * Every native `<input>` attribute except `type`, `role`, and\n\t * `aria-checked` — the host fixes the first two and withholds the third\n\t * so the control's own live checkedness stays the switch's only state.\n\t */\n\texport interface Props extends Omit<TagProps<\"input\">, \"type\" | \"role\" | \"aria-checked\"> {\n\t\t/**\n\t\t * Visible label text rendered after the track, inside the same native\n\t\t * `<label>` wrapping both, so clicking either half toggles the switch\n\t\t * with no separate `htmlFor`/`id` pairing required.\n\t\t */\n\t\tchildren?: RemixNode;\n\t}\n}\n\n/**\n * Renders a single `<input type=\"checkbox\" role=\"switch\">`. It carries no\n * `aria-checked` because an authored value would go stale the instant the\n * switch is flipped; the live control's own checkedness is what persists.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the switch's markup.\n * @example\n * <Switch name=\"notifications\" defaultChecked>{t(\"settings.notifications.label\")}</Switch>\n * @example\n * <Label>\n * \t{t(\"settings.notifications.label\")}\n * \t<Switch name=\"notifications\" defaultChecked />\n * </Label>\n * @example\n * <Switch aria-label={t(\"settings.darkMode\")} checked={isDark} disabled={isLocked} />\n * @example\n * <Switch aria-label={t(\"settings.notifications\")} mix={[ariaChecked()]} />\n */\nexport function Switch(handle: Handle<Switch.Props>) {\n\treturn () => {\n\t\tlet { mix, children, ...rest } = handle.props;\n\n\t\tlet track = (\n\t\t\t<input\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\t// oxlint-disable-next-line jsx-a11y/role-has-required-aria-props -- The host is a native checkbox, so its own checkedness supplies the switch's checked state; see the note above for why authoring one would be worse than omitting it.\n\t\t\t\trole=\"switch\"\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tattrs({ switch: DEFAULT_SWITCH_ATTRIBUTE }),\n\t\t\t\t\t\tappearance(),\n\t\t\t\t\t\trelative(),\n\t\t\t\t\t\tinlineBlock(),\n\t\t\t\t\t\tm(\"0\"),\n\t\t\t\t\t\tis(\"var(--ui-switch-track-inline-size, 2.75rem)\"),\n\t\t\t\t\t\tbs(\"var(--ui-switch-track-block-size, 1.5rem)\"),\n\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\tbg(\"neutral.border\"),\n\t\t\t\t\t\tbefore([\n\t\t\t\t\t\t\tabsolute(),\n\t\t\t\t\t\t\tis(\"var(--ui-switch-thumb-size, 1.25rem)\"),\n\t\t\t\t\t\t\tbs(\"var(--ui-switch-thumb-size, 1.25rem)\"),\n\t\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\t\tbg(\"brand.onSolid\"),\n\t\t\t\t\t\t\ttransition(\"inset-inline-start, scale\", { duration: 150 }),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen(\"&:checked\", bg(\"brand.solid\")),\n\t\t\t\t\t\twhen(\"&:active\", bg(\"neutral.strong\")),\n\t\t\t\t\t\twhen(\"&:checked:active\", bg(\"brand.bg-solid-hover\")),\n\t\t\t\t\t\tfocusVisible(outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t\twhen(\"&:disabled\", opacity(50)),\n\t\t\t\t\t\tcursor(\"pointer\"),\n\t\t\t\t\t\tshrink(0),\n\t\t\t\t\t\ttransition(\"background-color\", { duration: durations.fast, easing: easings.standard }),\n\t\t\t\t\t\twhen(\"&:disabled\", cursor(\"not-allowed\")),\n\t\t\t\t\t\tverticalAlign(\"middle\"),\n\t\t\t\t\t\tbefore([\n\t\t\t\t\t\t\tpseudoContent('\"\"'),\n\t\t\t\t\t\t\tinsBs(\"var(--ui-switch-thumb-inset, 0.125rem)\"),\n\t\t\t\t\t\t\tinsIs(\"var(--ui-switch-thumb-inset, 0.125rem)\"),\n\t\t\t\t\t\t\tshadow(\"base\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t\"&:checked\",\n\t\t\t\t\t\t\tbefore(\n\t\t\t\t\t\t\t\tinsIs(\n\t\t\t\t\t\t\t\t\t\"calc(var(--ui-switch-track-inline-size, 2.75rem) - var(--ui-switch-thumb-size, 1.25rem) - var(--ui-switch-thumb-inset, 0.125rem))\",\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen(\"&:active\", before(scaleProperty(\"0.95\"))),\n\t\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", before(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);\n\n\t\tif (children === undefined) return track;\n\n\t\treturn (\n\t\t\t<label\n\t\t\t\tmix={[\n\t\t\t\t\thstack({ gap: 2, align: \"center\" }),\n\t\t\t\t\tcursor(\"pointer\"),\n\t\t\t\t\twhen(\"&:has(input:disabled)\", cursor(\"not-allowed\")),\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{track}\n\t\t\t\t{children}\n\t\t\t</label>\n\t\t);\n\t};\n}\n"
11
11
  },
12
12
  "test": {
13
13
  "path": "switch.test.tsx",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabs",
3
- "changedIn": "2026.10.2",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Tabs",
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "source": {
10
10
  "path": "tabs.tsx",
11
- "content": "/**\n * A set of tabs whose active view comes from routing rather than tracked\n * selection state: each tab renders as a native link carrying the `tab`\n * role, and whichever one points at the page currently being viewed carries\n * `aria-selected=\"true\"` to read as the active tab. `Tabs.List` lays the\n * links out along `Tabs`' orientation axis, sharing that axis with every\n * `Tabs.Tab` through component context, and `Tabs.Panel` holds the content\n * the current tab's page renders inside `Tabs.Panels`.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { UtilityMixin } from \"@sdxc/u\";\nimport type { SizeValue, SpacingValue } from \"@sdxc/u/tokens\";\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, borderEdge, fg, outline, outlineStyle } from \"@sdxc/u/color\";\nimport { opacity, transition } from \"@sdxc/u/effects\";\nimport { cursor, raw } from \"@sdxc/u/general\";\nimport {\n\tabsolute,\n\tbasis,\n\tflexCol,\n\tflexRow,\n\tgrow,\n\thstack,\n\tinsBe,\n\tinsIs,\n\tinset,\n\trelative,\n\tshrink,\n\tvstack,\n} from \"@sdxc/u/layout\";\nimport { bs, is, mbe, mie, pb, pi } from \"@sdxc/u/size\";\nimport { after, data, when } from \"@sdxc/u/state\";\nimport { boxLength, spacing } from \"@sdxc/u/tokens\";\nimport { text, weight } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\n\n/** Default {@link Tabs.Props} orientation, applied when `orientation` is omitted. */\nconst DEFAULT_ORIENTATION: Tabs.Orientation = \"horizontal\";\n\n/** `role=\"tablist\"` applied to {@link Tabs.List} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_LIST_ROLE = \"tablist\";\n\n/** `role=\"tab\"` applied to {@link Tabs.Tab} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_TAB_ROLE = \"tab\";\n\n/** `role=\"tabpanel\"` applied to {@link Tabs.Panel} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_PANEL_ROLE = \"tabpanel\";\n\n/**\n * {@link Tabs.List}'s own inter-tab gap, applied through `hstack({ gap:\n * LIST_GAP })` and reused when computing a controlled `activeIndex`'s\n * indicator offset (see {@link tabIndicatorMix}), keeping the two in sync.\n */\nconst LIST_GAP: SpacingValue = 1;\n\n/**\n * Default {@link Tabs.PanelProps.tabIndex}, applied through {@link attrs}\n * unless a consumer supplies its own, so a keyboard user can move focus\n * straight into the panel's content after activating a tab.\n */\nconst DEFAULT_PANEL_TAB_INDEX = 0;\n\n/**\n * Prop types for {@link Tabs} and its compound parts.\n */\nexport namespace Tabs {\n\t/**\n\t * Axis {@link Tabs.List}'s links lay out along: a single row with the\n\t * active indicator running beneath it, or a single column with the\n\t * indicator running alongside it.\n\t */\n\texport type Orientation = \"horizontal\" | \"vertical\";\n\n\t/**\n\t * Value {@link Tabs} stores in component context so every\n\t * {@link Tabs.List} and {@link Tabs.Tab} nested inside mirrors the same\n\t * orientation automatically.\n\t */\n\texport interface Context {\n\t\t/** The root's resolved layout axis. */\n\t\torientation: Orientation;\n\t}\n\n\t/**\n\t * Props accepted by {@link Tabs}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Layout axis. Defaults to {@link DEFAULT_ORIENTATION}. */\n\t\torientation?: Orientation;\n\t}\n\n\t/**\n\t * Props accepted by {@link Tabs.List}.\n\t */\n\texport interface ListProps extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Index of the currently active tab, for a route-driven tab bar with\n\t\t * no client-side measurement of the active tab's bounds. Given with\n\t\t * `tabSize`, {@link Tabs.List} computes its own indicator position.\n\t\t */\n\t\tactiveIndex?: number;\n\n\t\t/**\n\t\t * Every {@link Tabs.Tab}'s fixed size along the enclosing\n\t\t * {@link Tabs}'s layout axis, required alongside `activeIndex` since\n\t\t * the indicator's offset depends on how far apart the tabs sit.\n\t\t */\n\t\ttabSize?: SizeValue;\n\t}\n\n\t/**\n\t * Props accepted by {@link Tabs.Tab}. A type alias, since the native\n\t * anchor props already encode `href`/`role` as a union; `href` is\n\t * narrowed to required, since every tab is link-mode and needs one.\n\t */\n\texport type TabProps = TagProps<\"a\"> & {\n\t\t/** The page this tab navigates to. */\n\t\thref: string;\n\t};\n\n\t/**\n\t * Props accepted by {@link Tabs.Panels}.\n\t */\n\texport interface PanelsProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Props accepted by {@link Tabs.Panel}.\n\t */\n\texport interface PanelProps extends TagProps<\"div\"> {}\n}\n\n/**\n * Renders the root host: a plain `<div>` stacking {@link Tabs.List} above\n * {@link Tabs.Panels}, switching to a side-by-side row when `orientation`\n * is `\"vertical\"` and sharing that axis through component context.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props and providing {@link Tabs.Context}.\n * @returns The render function producing the root's markup.\n * @example\n * <Tabs>\n * \t<Tabs.List aria-label={t(\"settings.sections\")}>\n * \t\t<Tabs.Tab href=\"/settings/profile\" aria-selected=\"true\">{t(\"settings.profile\")}</Tabs.Tab>\n * \t\t<Tabs.Tab href=\"/settings/billing\" aria-selected=\"false\">{t(\"settings.billing\")}</Tabs.Tab>\n * \t</Tabs.List>\n * \t<Tabs.Panels>\n * \t\t<Tabs.Panel>{t(\"settings.profile.body\")}</Tabs.Panel>\n * \t</Tabs.Panels>\n * </Tabs>\n * @example\n * <Tabs orientation=\"vertical\">\n * \t<Tabs.List aria-label={t(\"settings.sections\")}>\n * \t\t<Tabs.Tab href=\"/settings/profile\" aria-selected=\"true\">{t(\"settings.profile\")}</Tabs.Tab>\n * \t\t<Tabs.Tab href=\"/settings/billing\" aria-selected=\"false\">{t(\"settings.billing\")}</Tabs.Tab>\n * \t</Tabs.List>\n * \t<Tabs.Panels>\n * \t\t<Tabs.Panel>{t(\"settings.profile.body\")}</Tabs.Panel>\n * \t</Tabs.Panels>\n * </Tabs>\n */\nexport function Tabs(handle: Handle<Tabs.Props, Tabs.Context>) {\n\treturn () => {\n\t\tlet { orientation, mix, ...rest } = handle.props;\n\t\tlet resolvedOrientation = orientation ?? DEFAULT_ORIENTATION;\n\n\t\thandle.context.set({ orientation: resolvedOrientation });\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-orientation={resolvedOrientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[vstack(), data(\"orientation\", \"vertical\", flexRow()), mix]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Computes the `--ui-tab-indicator-*` custom properties {@link Tabs.List}'s\n * sliding indicator reads for a controlled `activeIndex`. Assumes every\n * {@link Tabs.Tab} shares one fixed `tabSize` and sits `LIST_GAP` apart.\n *\n * @param orientation The enclosing {@link Tabs}'s layout axis.\n * @param activeIndex Index of the active tab among its siblings.\n * @param tabSize Every tab's fixed size along `orientation`'s axis.\n * @returns A `raw()` mixin setting the indicator's offset, length, and opacity.\n */\nexport function tabIndicatorMix(\n\torientation: Tabs.Orientation,\n\tactiveIndex: number,\n\ttabSize: SizeValue,\n): UtilityMixin {\n\tlet size = boxLength(tabSize);\n\tlet offset = `calc((${size} + ${spacing(LIST_GAP)}) * ${activeIndex})`;\n\n\tif (orientation === \"vertical\") {\n\t\treturn raw({\n\t\t\t\"--ui-tab-indicator-block-start\": offset,\n\t\t\t\"--ui-tab-indicator-block-size\": size,\n\t\t\t\"--ui-tab-indicator-opacity\": \"1\",\n\t\t});\n\t}\n\n\treturn raw({\n\t\t\"--ui-tab-indicator-inline-start\": offset,\n\t\t\"--ui-tab-indicator-inline-size\": size,\n\t\t\"--ui-tab-indicator-opacity\": \"1\",\n\t});\n}\n\n/**\n * Renders the tab strip: a `role=\"tablist\"` host laying {@link Tabs.Tab}\n * links out in a row, or a column when `orientation` is `\"vertical\"`, with\n * a sliding accent bar reading `--ui-tab-indicator-*` custom properties.\n *\n * @param handle Runtime handle carrying the host's props.\n * @returns The render function producing the tab strip's markup.\n * @example\n * <Tabs.List aria-label={t(\"settings.sections\")}>\n * \t<Tabs.Tab href=\"/settings/profile\" aria-selected=\"true\">{t(\"settings.profile\")}</Tabs.Tab>\n * \t<Tabs.Tab href=\"/settings/billing\" aria-selected=\"false\">{t(\"settings.billing\")}</Tabs.Tab>\n * </Tabs.List>\n * @example\n * // A link-based, server-controlled tab bar: `activeIndex` comes from the\n * // current route, so `Tabs.List` computes its own sliding indicator\n * // directly from server-rendered state.\n * <Tabs.List aria-label={t(\"dashboard.tabs\")} activeIndex={activeIndex} tabSize=\"110px\">\n * \t<Tabs.Tab href=\"/dashboard/overview\" aria-selected={activeIndex === 0}>\n * \t\t{t(\"dashboard.overview\")}\n * \t</Tabs.Tab>\n * \t<Tabs.Tab href=\"/dashboard/incidents\" aria-selected={activeIndex === 1}>\n * \t\t{t(\"dashboard.incidents\")}\n * \t</Tabs.Tab>\n * </Tabs.List>\n */\nTabs.List = function TabsList(handle: Handle<Tabs.ListProps>) {\n\treturn () => {\n\t\tlet { mix, activeIndex, tabSize, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Tabs);\n\t\tlet indicatorMix =\n\t\t\tactiveIndex !== undefined && tabSize !== undefined\n\t\t\t\t? tabIndicatorMix(context.orientation, activeIndex, tabSize)\n\t\t\t\t: undefined;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-orientation={context.orientation}\n\t\t\t\taria-orientation={context.orientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_LIST_ROLE }),\n\t\t\t\t\trelative(),\n\t\t\t\t\thstack({ gap: LIST_GAP }),\n\t\t\t\t\tborderEdge(\"block-end\", { color: \"neutral\", width: 1 }),\n\t\t\t\t\tafter([\n\t\t\t\t\t\tabsolute(),\n\t\t\t\t\t\tis(\"var(--ui-tab-indicator-inline-size, 0px)\"),\n\t\t\t\t\t\tbs(\"0.125rem\"),\n\t\t\t\t\t\ttransition(\"inset-inline-start, inset-block-start, inline-size, block-size, opacity\", {\n\t\t\t\t\t\t\tduration: \"200ms\",\n\t\t\t\t\t\t\teasing: \"ease-out\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tinsIs(\"var(--ui-tab-indicator-inline-start, 0px)\"),\n\t\t\t\t\t\tinsBe(\"-0.0625rem\"),\n\t\t\t\t\t\tbg(\"var(--ui-brand-fg)\"),\n\t\t\t\t\t\traw({\n\t\t\t\t\t\t\tcontent: '\"\"',\n\t\t\t\t\t\t\topacity: \"var(--ui-tab-indicator-opacity, 0)\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t]),\n\t\t\t\t\tdata(\"orientation\", \"vertical\", [\n\t\t\t\t\t\tflexCol(),\n\t\t\t\t\t\tborderEdge(\"block-end\", { width: \"0\" }),\n\t\t\t\t\t\tborderEdge(\"inline-end\", { color: \"neutral\", width: 1 }),\n\t\t\t\t\t\tafter([\n\t\t\t\t\t\t\tinset(\"var(--ui-tab-indicator-block-start, 0px)\", \"0\", \"auto\", \"auto\"),\n\t\t\t\t\t\t\tis(\"0.125rem\"),\n\t\t\t\t\t\t\tbs(\"var(--ui-tab-indicator-block-size, 0px)\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]),\n\t\t\t\t\tindicatorMix,\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a single tab: a native `<a>` carrying the `tab` role, its own\n * border edge kept transparent to reserve space for the sliding indicator.\n * Omitting `href` disables navigation; pair it with `aria-disabled=\"true\"`.\n *\n * @param handle Runtime handle carrying the host `<a>`'s props.\n * @returns The render function producing the tab's markup.\n * @example\n * <Tabs.Tab href=\"/settings/profile\" aria-selected=\"true\">{t(\"settings.profile\")}</Tabs.Tab>\n * @example\n * <Tabs.Tab href=\"/settings/billing\" aria-selected=\"false\" aria-disabled=\"true\">\n * \t{t(\"settings.billing\")}\n * </Tabs.Tab>\n */\nTabs.Tab = function TabsTab(handle: Handle<Tabs.TabProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Tabs);\n\n\t\treturn (\n\t\t\t<a\n\t\t\t\tdata-orientation={context.orientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tattrs({ role: DEFAULT_TAB_ROLE }),\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\tpi(4),\n\t\t\t\t\tpb(2),\n\t\t\t\t\tweight(500),\n\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\twhen(\"&:hover\", fg(\"neutral.emphasis\")),\n\t\t\t\t\twhen('&[aria-selected=\"true\"]', fg(\"brand\")),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', opacity(50)),\n\t\t\t\t\tmbe(\"-0.0625rem\"),\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\tborderEdge(\"block-end\", { color: \"transparent\", width: 2 }),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', cursor(\"not-allowed\")),\n\t\t\t\t\tdata(\"orientation\", \"vertical\", [\n\t\t\t\t\t\tmbe(\"0\"),\n\t\t\t\t\t\tmie(\"-0.0625rem\"),\n\t\t\t\t\t\tborderEdge(\"block-end\", { width: \"0\" }),\n\t\t\t\t\t\tborderEdge(\"inline-end\", { color: \"transparent\", width: 2 }),\n\t\t\t\t\t]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders the panel region: a `<div>` growing to fill whatever space is left\n * beside or beneath {@link Tabs.List}. Nest the current tab's\n * {@link Tabs.Panel} inside it.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the panel region's markup.\n * @example\n * <Tabs.Panels>\n * \t<Tabs.Panel>{t(\"settings.profile.body\")}</Tabs.Panel>\n * </Tabs.Panels>\n */\nTabs.Panels = function TabsPanels(handle: Handle<Tabs.PanelsProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <div {...rest} mix={[grow(), shrink(1), basis(\"0%\"), mix]} />;\n\t};\n};\n\n/**\n * Renders the current tab's content: a padded `<div>` carrying the\n * `tabpanel` role, focusable by default so a keyboard user can jump\n * straight into it after activating a tab, with a focus-visible ring.\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 * <Tabs.Panel>{t(\"settings.profile.body\")}</Tabs.Panel>\n */\nTabs.Panel = function TabsPanel(handle: Handle<Tabs.PanelProps>) {\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_PANEL_ROLE, tabIndex: DEFAULT_PANEL_TAB_INDEX }),\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\tpb(4),\n\t\t\t\t\tpi(4),\n\t\t\t\t\toutlineStyle(\"none\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
11
+ "content": "/**\n * A set of tabs whose active view comes from routing rather than tracked\n * selection state: each tab renders as a native link carrying the `tab`\n * role, and whichever one points at the page currently being viewed carries\n * `aria-selected=\"true\"` to read as the active tab. `Tabs.List` lays the\n * links out along `Tabs`' orientation axis, sharing that axis with every\n * `Tabs.Tab` through component context, and `Tabs.Panel` holds the content\n * the current tab's page renders inside `Tabs.Panels`.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { UtilityMixin } from \"@sdxc/u\";\nimport type { SizeValue, SpacingValue } from \"@sdxc/u/tokens\";\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, borderEdge, fg, outline, outlineStyle } from \"@sdxc/u/color\";\nimport { opacity, transition } from \"@sdxc/u/effects\";\nimport { cursor, raw, mergeMix } from \"@sdxc/u/general\";\nimport {\n\tabsolute,\n\tbasis,\n\tflexCol,\n\tflexRow,\n\tgrow,\n\thstack,\n\tinsBe,\n\tinsIs,\n\tinset,\n\trelative,\n\tshrink,\n\tvstack,\n} from \"@sdxc/u/layout\";\nimport { bs, is, mbe, mie, pb, pi } from \"@sdxc/u/size\";\nimport { after, data, when } from \"@sdxc/u/state\";\nimport { boxLength, spacing } from \"@sdxc/u/tokens\";\nimport { text, weight } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\n\n/** Default {@link Tabs.Props} orientation, applied when `orientation` is omitted. */\nconst DEFAULT_ORIENTATION: Tabs.Orientation = \"horizontal\";\n\n/** `role=\"tablist\"` applied to {@link Tabs.List} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_LIST_ROLE = \"tablist\";\n\n/** `role=\"tab\"` applied to {@link Tabs.Tab} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_TAB_ROLE = \"tab\";\n\n/** `role=\"tabpanel\"` applied to {@link Tabs.Panel} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_PANEL_ROLE = \"tabpanel\";\n\n/**\n * {@link Tabs.List}'s own inter-tab gap, applied through `hstack({ gap:\n * LIST_GAP })` and reused when computing a controlled `activeIndex`'s\n * indicator offset (see {@link tabIndicatorMix}), keeping the two in sync.\n */\nconst LIST_GAP: SpacingValue = 1;\n\n/**\n * Default {@link Tabs.PanelProps.tabIndex}, applied through {@link attrs}\n * unless a consumer supplies its own, so a keyboard user can move focus\n * straight into the panel's content after activating a tab.\n */\nconst DEFAULT_PANEL_TAB_INDEX = 0;\n\n/**\n * Prop types for {@link Tabs} and its compound parts.\n */\nexport namespace Tabs {\n\t/**\n\t * Axis {@link Tabs.List}'s links lay out along: a single row with the\n\t * active indicator running beneath it, or a single column with the\n\t * indicator running alongside it.\n\t */\n\texport type Orientation = \"horizontal\" | \"vertical\";\n\n\t/**\n\t * Value {@link Tabs} stores in component context so every\n\t * {@link Tabs.List} and {@link Tabs.Tab} nested inside mirrors the same\n\t * orientation automatically.\n\t */\n\texport interface Context {\n\t\t/** The root's resolved layout axis. */\n\t\torientation: Orientation;\n\t}\n\n\t/**\n\t * Props accepted by {@link Tabs}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Layout axis. Defaults to {@link DEFAULT_ORIENTATION}. */\n\t\torientation?: Orientation;\n\t}\n\n\t/**\n\t * Props accepted by {@link Tabs.List}.\n\t */\n\texport interface ListProps extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Index of the currently active tab, for a route-driven tab bar with\n\t\t * no client-side measurement of the active tab's bounds. Given with\n\t\t * `tabSize`, {@link Tabs.List} computes its own indicator position.\n\t\t */\n\t\tactiveIndex?: number;\n\n\t\t/**\n\t\t * Every {@link Tabs.Tab}'s fixed size along the enclosing\n\t\t * {@link Tabs}'s layout axis, required alongside `activeIndex` since\n\t\t * the indicator's offset depends on how far apart the tabs sit.\n\t\t */\n\t\ttabSize?: SizeValue;\n\t}\n\n\t/**\n\t * Props accepted by {@link Tabs.Tab}. A type alias, since the native\n\t * anchor props already encode `href`/`role` as a union; `href` is\n\t * narrowed to required, since every tab is link-mode and needs one.\n\t */\n\texport type TabProps = TagProps<\"a\"> & {\n\t\t/** The page this tab navigates to. */\n\t\thref: string;\n\t};\n\n\t/**\n\t * Props accepted by {@link Tabs.Panels}.\n\t */\n\texport interface PanelsProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Props accepted by {@link Tabs.Panel}.\n\t */\n\texport interface PanelProps extends TagProps<\"div\"> {}\n}\n\n/**\n * Renders the root host: a plain `<div>` stacking {@link Tabs.List} above\n * {@link Tabs.Panels}, switching to a side-by-side row when `orientation`\n * is `\"vertical\"` and sharing that axis through component context.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props and providing {@link Tabs.Context}.\n * @returns The render function producing the root's markup.\n * @example\n * <Tabs>\n * \t<Tabs.List aria-label={t(\"settings.sections\")}>\n * \t\t<Tabs.Tab href=\"/settings/profile\" aria-selected=\"true\">{t(\"settings.profile\")}</Tabs.Tab>\n * \t\t<Tabs.Tab href=\"/settings/billing\" aria-selected=\"false\">{t(\"settings.billing\")}</Tabs.Tab>\n * \t</Tabs.List>\n * \t<Tabs.Panels>\n * \t\t<Tabs.Panel>{t(\"settings.profile.body\")}</Tabs.Panel>\n * \t</Tabs.Panels>\n * </Tabs>\n * @example\n * <Tabs orientation=\"vertical\">\n * \t<Tabs.List aria-label={t(\"settings.sections\")}>\n * \t\t<Tabs.Tab href=\"/settings/profile\" aria-selected=\"true\">{t(\"settings.profile\")}</Tabs.Tab>\n * \t\t<Tabs.Tab href=\"/settings/billing\" aria-selected=\"false\">{t(\"settings.billing\")}</Tabs.Tab>\n * \t</Tabs.List>\n * \t<Tabs.Panels>\n * \t\t<Tabs.Panel>{t(\"settings.profile.body\")}</Tabs.Panel>\n * \t</Tabs.Panels>\n * </Tabs>\n */\nexport function Tabs(handle: Handle<Tabs.Props, Tabs.Context>) {\n\treturn () => {\n\t\tlet { orientation, mix, ...rest } = handle.props;\n\t\tlet resolvedOrientation = orientation ?? DEFAULT_ORIENTATION;\n\n\t\thandle.context.set({ orientation: resolvedOrientation });\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-orientation={resolvedOrientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix([vstack(), data(\"orientation\", \"vertical\", flexRow())], mix)}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Computes the `--ui-tab-indicator-*` custom properties {@link Tabs.List}'s\n * sliding indicator reads for a controlled `activeIndex`. Assumes every\n * {@link Tabs.Tab} shares one fixed `tabSize` and sits `LIST_GAP` apart.\n *\n * @param orientation The enclosing {@link Tabs}'s layout axis.\n * @param activeIndex Index of the active tab among its siblings.\n * @param tabSize Every tab's fixed size along `orientation`'s axis.\n * @returns A `raw()` mixin setting the indicator's offset, length, and opacity.\n */\nexport function tabIndicatorMix(\n\torientation: Tabs.Orientation,\n\tactiveIndex: number,\n\ttabSize: SizeValue,\n): UtilityMixin {\n\tlet size = boxLength(tabSize);\n\tlet offset = `calc((${size} + ${spacing(LIST_GAP)}) * ${activeIndex})`;\n\n\tif (orientation === \"vertical\") {\n\t\treturn raw({\n\t\t\t\"--ui-tab-indicator-block-start\": offset,\n\t\t\t\"--ui-tab-indicator-block-size\": size,\n\t\t\t\"--ui-tab-indicator-opacity\": \"1\",\n\t\t});\n\t}\n\n\treturn raw({\n\t\t\"--ui-tab-indicator-inline-start\": offset,\n\t\t\"--ui-tab-indicator-inline-size\": size,\n\t\t\"--ui-tab-indicator-opacity\": \"1\",\n\t});\n}\n\n/**\n * Renders the tab strip: a `role=\"tablist\"` host laying {@link Tabs.Tab}\n * links out in a row, or a column when `orientation` is `\"vertical\"`, with\n * a sliding accent bar reading `--ui-tab-indicator-*` custom properties.\n *\n * @param handle Runtime handle carrying the host's props.\n * @returns The render function producing the tab strip's markup.\n * @example\n * <Tabs.List aria-label={t(\"settings.sections\")}>\n * \t<Tabs.Tab href=\"/settings/profile\" aria-selected=\"true\">{t(\"settings.profile\")}</Tabs.Tab>\n * \t<Tabs.Tab href=\"/settings/billing\" aria-selected=\"false\">{t(\"settings.billing\")}</Tabs.Tab>\n * </Tabs.List>\n * @example\n * // A link-based, server-controlled tab bar: `activeIndex` comes from the\n * // current route, so `Tabs.List` computes its own sliding indicator\n * // directly from server-rendered state.\n * <Tabs.List aria-label={t(\"dashboard.tabs\")} activeIndex={activeIndex} tabSize=\"110px\">\n * \t<Tabs.Tab href=\"/dashboard/overview\" aria-selected={activeIndex === 0}>\n * \t\t{t(\"dashboard.overview\")}\n * \t</Tabs.Tab>\n * \t<Tabs.Tab href=\"/dashboard/incidents\" aria-selected={activeIndex === 1}>\n * \t\t{t(\"dashboard.incidents\")}\n * \t</Tabs.Tab>\n * </Tabs.List>\n */\nTabs.List = function TabsList(handle: Handle<Tabs.ListProps>) {\n\treturn () => {\n\t\tlet { mix, activeIndex, tabSize, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Tabs);\n\t\tlet indicatorMix =\n\t\t\tactiveIndex !== undefined && tabSize !== undefined\n\t\t\t\t? tabIndicatorMix(context.orientation, activeIndex, tabSize)\n\t\t\t\t: undefined;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-orientation={context.orientation}\n\t\t\t\taria-orientation={context.orientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tattrs({ role: DEFAULT_LIST_ROLE }),\n\t\t\t\t\t\trelative(),\n\t\t\t\t\t\thstack({ gap: LIST_GAP }),\n\t\t\t\t\t\tborderEdge(\"block-end\", { color: \"neutral\", width: 1 }),\n\t\t\t\t\t\tafter([\n\t\t\t\t\t\t\tabsolute(),\n\t\t\t\t\t\t\tis(\"var(--ui-tab-indicator-inline-size, 0px)\"),\n\t\t\t\t\t\t\tbs(\"0.125rem\"),\n\t\t\t\t\t\t\ttransition(\n\t\t\t\t\t\t\t\t\"inset-inline-start, inset-block-start, inline-size, block-size, opacity\",\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tduration: \"200ms\",\n\t\t\t\t\t\t\t\t\teasing: \"ease-out\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tinsIs(\"var(--ui-tab-indicator-inline-start, 0px)\"),\n\t\t\t\t\t\t\tinsBe(\"-0.0625rem\"),\n\t\t\t\t\t\t\tbg(\"var(--ui-brand-fg)\"),\n\t\t\t\t\t\t\traw({\n\t\t\t\t\t\t\t\tcontent: '\"\"',\n\t\t\t\t\t\t\t\topacity: \"var(--ui-tab-indicator-opacity, 0)\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"orientation\", \"vertical\", [\n\t\t\t\t\t\t\tflexCol(),\n\t\t\t\t\t\t\tborderEdge(\"block-end\", { width: \"0\" }),\n\t\t\t\t\t\t\tborderEdge(\"inline-end\", { color: \"neutral\", width: 1 }),\n\t\t\t\t\t\t\tafter([\n\t\t\t\t\t\t\t\tinset(\"var(--ui-tab-indicator-block-start, 0px)\", \"0\", \"auto\", \"auto\"),\n\t\t\t\t\t\t\t\tis(\"0.125rem\"),\n\t\t\t\t\t\t\t\tbs(\"var(--ui-tab-indicator-block-size, 0px)\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tindicatorMix,\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a single tab: a native `<a>` carrying the `tab` role, its own\n * border edge kept transparent to reserve space for the sliding indicator.\n * Omitting `href` disables navigation; pair it with `aria-disabled=\"true\"`.\n *\n * @param handle Runtime handle carrying the host `<a>`'s props.\n * @returns The render function producing the tab's markup.\n * @example\n * <Tabs.Tab href=\"/settings/profile\" aria-selected=\"true\">{t(\"settings.profile\")}</Tabs.Tab>\n * @example\n * <Tabs.Tab href=\"/settings/billing\" aria-selected=\"false\" aria-disabled=\"true\">\n * \t{t(\"settings.billing\")}\n * </Tabs.Tab>\n */\nTabs.Tab = function TabsTab(handle: Handle<Tabs.TabProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\t\tlet context = handle.context.get(Tabs);\n\n\t\treturn (\n\t\t\t<a\n\t\t\t\tdata-orientation={context.orientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\t\tattrs({ role: DEFAULT_TAB_ROLE }),\n\t\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t\tpi(4),\n\t\t\t\t\t\tpb(2),\n\t\t\t\t\t\tweight(500),\n\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\twhen(\"&:hover\", fg(\"neutral.emphasis\")),\n\t\t\t\t\t\twhen('&[aria-selected=\"true\"]', fg(\"brand\")),\n\t\t\t\t\t\twhen('&[aria-disabled=\"true\"]', opacity(50)),\n\t\t\t\t\t\tmbe(\"-0.0625rem\"),\n\t\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\t\tborderEdge(\"block-end\", { color: \"transparent\", width: 2 }),\n\t\t\t\t\t\twhen('&[aria-disabled=\"true\"]', cursor(\"not-allowed\")),\n\t\t\t\t\t\tdata(\"orientation\", \"vertical\", [\n\t\t\t\t\t\t\tmbe(\"0\"),\n\t\t\t\t\t\t\tmie(\"-0.0625rem\"),\n\t\t\t\t\t\t\tborderEdge(\"block-end\", { width: \"0\" }),\n\t\t\t\t\t\t\tborderEdge(\"inline-end\", { color: \"transparent\", width: 2 }),\n\t\t\t\t\t\t]),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders the panel region: a `<div>` growing to fill whatever space is left\n * beside or beneath {@link Tabs.List}. Nest the current tab's\n * {@link Tabs.Panel} inside it.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the panel region's markup.\n * @example\n * <Tabs.Panels>\n * \t<Tabs.Panel>{t(\"settings.profile.body\")}</Tabs.Panel>\n * </Tabs.Panels>\n */\nTabs.Panels = function TabsPanels(handle: Handle<Tabs.PanelsProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <div {...rest} mix={mergeMix([grow(), shrink(1), basis(\"0%\")], mix)} />;\n\t};\n};\n\n/**\n * Renders the current tab's content: a padded `<div>` carrying the\n * `tabpanel` role, focusable by default so a keyboard user can jump\n * straight into it after activating a tab, with a focus-visible ring.\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 * <Tabs.Panel>{t(\"settings.profile.body\")}</Tabs.Panel>\n */\nTabs.Panel = function TabsPanel(handle: Handle<Tabs.PanelProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tattrs({ role: DEFAULT_PANEL_ROLE, tabIndex: DEFAULT_PANEL_TAB_INDEX }),\n\t\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t\tpb(4),\n\t\t\t\t\t\tpi(4),\n\t\t\t\t\t\toutlineStyle(\"none\"),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
12
12
  },
13
13
  "test": {
14
14
  "path": "tabs.test.tsx",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tag-group",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [
5
5
  "button"
6
6
  ],
@@ -9,7 +9,7 @@
9
9
  ],
10
10
  "source": {
11
11
  "path": "tag-group.tsx",
12
- "content": "/**\n * A labeled set of pill-shaped tags with an optional dismiss control per tag,\n * composing a grouping host, a wrapped list, and each tag's own pill and\n * remove button. A tag reads its color and size through the same `data-*`\n * contract as {@link Badge}, and its remove control renders through\n * {@link Button} as a native form submit, so removing a tag is an ordinary\n * server round-trip through whatever form the group sits inside, driven\n * entirely by the submitted control's `name`/`value` pair.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as ElementProps } from \"remix/component\";\n\nimport { XIcon } from \"@sdxc/icons\";\nimport { bg, fg, outline, outlineColor } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor, listStyle, vars } from \"@sdxc/u/general\";\nimport { flex, flexWrap, gap, inlineFlex, items, vstack } from \"@sdxc/u/layout\";\nimport { bs, is, m, mie, p, 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 type { SemanticColor } from \"@sdxc/ui/utils\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { warnIfNoAccessibleLabel } from \"@sdxc/ui/utils\";\n\nimport { Button } from \"@sdxc/ui/button\";\n\n/** `role=\"group\"` applied to {@link TagGroup} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_ROLE = \"group\";\n\n/** Semantic color role {@link TagGroup.Tag} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: TagGroup.Color = \"neutral\";\n\n/** Size variant {@link TagGroup.Tag} falls back to when `size` is omitted. */\nconst DEFAULT_SIZE: TagGroup.Size = \"md\";\n\n/** Visible edge of {@link TagGroup.Remove}'s round glyph, small enough to sit inside a pill's line. */\nconst REMOVE_SIZE = \"var(--ui-tag-remove-size, 1rem)\";\n\n/**\n * Prop types for {@link TagGroup} and its compound parts.\n */\nexport namespace TagGroup {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` variables —\n\t * the same set {@link Badge} and {@link Button} use.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * Size variant controlling a tag's padding and font size.\n\t */\n\texport type Size = \"sm\" | \"md\";\n\n\t/**\n\t * Props accepted by {@link TagGroup}.\n\t */\n\texport interface Props extends ElementProps<\"div\"> {}\n\n\t/**\n\t * Props accepted by {@link TagGroup.List}.\n\t */\n\texport interface ListProps extends ElementProps<\"ul\"> {}\n\n\t/**\n\t * Props accepted by {@link TagGroup.Tag}. Set `aria-selected=\"true\"` to\n\t * mark a tag as the active member of a selectable set, and\n\t * `aria-disabled=\"true\"` to mute one, both read from native ARIA state.\n\t */\n\texport interface TagProps extends ElementProps<\"li\"> {\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/** Size variant. Defaults to {@link DEFAULT_SIZE}. */\n\t\tsize?: Size;\n\t}\n\n\t/**\n\t * Props accepted by {@link TagGroup.Remove}: every {@link Button.Props}\n\t * field except the ones this component fixes, plus every native\n\t * `<button>` attribute — `name`/`value` tell the form which tag to remove.\n\t */\n\texport interface RemoveProps extends Omit<\n\t\tButton.Props,\n\t\t\"children\" | \"variant\" | \"color\" | \"size\" | \"type\" | \"aria-label\"\n\t> {\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 group's `<div>` host, laying its {@link TagGroup.List} child\n * (and any preceding `Label`) out in a column with a small gap. Dev mode\n * warns when it lacks an accessible name for assistive technology.\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 * <TagGroup aria-label={t(\"skills.label\")}>\n * \t<TagGroup.List>\n * \t\t<TagGroup.Tag color=\"brand\">{t(\"skills.design\")}</TagGroup.Tag>\n * \t\t<TagGroup.Tag color=\"success\">{t(\"skills.shipped\")}</TagGroup.Tag>\n * \t</TagGroup.List>\n * </TagGroup>\n */\nexport function TagGroup(handle: Handle<TagGroup.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t'TagGroup: a group with no \"aria-label\" or \"aria-labelledby\" needs one describing the set of tags — assistive technology has no accessible name to announce otherwise.',\n\t\t);\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"tag-group\"\n\t\t\t\tmix={[attrs({ role: DEFAULT_ROLE }), vstack({ gap: 1 }), mix]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders the group's `<ul>` list, resetting native list markers and spacing\n * and laying {@link TagGroup.Tag} children out as a wrapped row with a small\n * gap between them.\n *\n * @param handle Runtime handle carrying the host `<ul>`'s props.\n * @returns The render function producing the list's markup.\n * @example\n * <TagGroup.List>\n * \t<TagGroup.Tag color=\"neutral\">{t(\"filters.active\")}</TagGroup.Tag>\n * \t<TagGroup.Tag color=\"neutral\" size=\"sm\">{t(\"filters.archived\")}</TagGroup.Tag>\n * </TagGroup.List>\n */\nTagGroup.List = function TagGroupList(handle: Handle<TagGroup.ListProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<ul\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"list\"\n\t\t\t\tmix={[flex(), flexWrap(\"wrap\"), gap(2), m(0), p(0), listStyle(), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a single pill-shaped `<li>`, colored through the `data-color`\n * attribute contract shared with {@link Badge} and sized through\n * `data-size`. Compose {@link TagGroup.Remove} inside it for a dismissible tag.\n *\n * @param handle Runtime handle carrying the host `<li>`'s props.\n * @returns The render function producing the pill's markup.\n * @example\n * <TagGroup.Tag color=\"success\">{t(\"status.shipped\")}</TagGroup.Tag>\n * @example\n * <TagGroup.Tag color=\"danger\" size=\"sm\" aria-selected=\"true\">\n * \t{t(\"status.blocked\")}\n * </TagGroup.Tag>\n */\nTagGroup.Tag = function TagGroupTag(handle: Handle<TagGroup.TagProps>) {\n\treturn () => {\n\t\tlet { color, size, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\t\tlet resolvedSize = size ?? DEFAULT_SIZE;\n\n\t\treturn (\n\t\t\t<li\n\t\t\t\t{...rest}\n\t\t\t\tdata-color={resolvedColor}\n\t\t\t\tdata-size={resolvedSize}\n\t\t\t\tdata-slot=\"tag\"\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:focus-visible\", [\n\t\t\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\t\t\tdata(\"color\", \"neutral\", outline(\"neutral.ring\")),\n\t\t\t\t\t\tdata(\"color\", \"success\", outline(\"success.ring\")),\n\t\t\t\t\t\tdata(\"color\", \"warning\", outline(\"warning.ring\")),\n\t\t\t\t\t\tdata(\"color\", \"danger\", outline(\"danger.ring\")),\n\t\t\t\t\t]),\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tgap(1),\n\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\tpi(3),\n\t\t\t\t\tpb(1),\n\t\t\t\t\tdata(\"size\", \"sm\", [pi(2), pb(0.5)]),\n\t\t\t\t\tdata(\"color\", \"brand\", [bg(\"brand.tint\"), fg(\"brand\")]),\n\t\t\t\t\tdata(\"color\", \"success\", [bg(\"success.tint\"), fg(\"success\")]),\n\t\t\t\t\tdata(\"color\", \"warning\", [bg(\"warning.tint\"), fg(\"warning\")]),\n\t\t\t\t\tdata(\"color\", \"danger\", [bg(\"danger.tint\"), fg(\"danger\")]),\n\t\t\t\t\twhen('&[aria-selected=\"true\"]', [bg(\"brand.solid\"), fg(\"brand.onSolid\"), weight(600)]),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', opacity(50)),\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\tdata(\"size\", \"sm\", text(\"xs\")),\n\t\t\t\t\tdata(\"color\", \"neutral\", [bg(\"neutral.bg-tint-hover\"), fg(\"neutral\")]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a dismiss control for the tag it's composed inside: a small,\n * ghost-styled {@link Button} with an \"X\" glyph submitting as\n * `type=\"submit\"`, colored from the ambient {@link TagGroup.Tag}'s `data-color`.\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 * <form method=\"post\">\n * \t<TagGroup aria-label={t(\"filters.label\")}>\n * \t\t<TagGroup.List>\n * \t\t\t<TagGroup.Tag color=\"brand\">\n * \t\t\t\t{t(\"filters.remote\")}\n * \t\t\t\t<TagGroup.Remove name=\"remove\" value=\"remote\" aria-label={t(\"filters.removeRemote\")} />\n * \t\t\t</TagGroup.Tag>\n * \t\t</TagGroup.List>\n * \t</TagGroup>\n * </form>\n */\nTagGroup.Remove = function TagGroupRemove(handle: Handle<TagGroup.RemoveProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"submit\"\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tdata-slot=\"remove\"\n\t\t\t\tmix={[\n\t\t\t\t\t/**\n\t\t\t\t\t * The control shrinks through Button's own icon-only measure, so it sits inside\n\t\t\t\t\t * the pill's line instead of stretching the tag to a full button row, while\n\t\t\t\t\t * Button's own hit area keeps its pointer target at `--ui-target-size`.\n\t\t\t\t\t */\n\t\t\t\t\tvars({ \"ui-button-icon-size-md\": REMOVE_SIZE }),\n\t\t\t\t\tmie(-1),\n\t\t\t\t\twhen('&[data-slot=\"remove\"] > svg', [is(3), bs(3)]),\n\t\t\t\t\tfg(\"currentColor\"),\n\t\t\t\t\thover(bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\twhen('[data-color=\"neutral\"] &:hover', bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\twhen('[data-color=\"success\"] &:hover', bg(\"success.bg-tint-hover\")),\n\t\t\t\t\twhen('[data-color=\"danger\"] &:hover', bg(\"danger.bg-tint-hover\")),\n\t\t\t\t\twhen('[data-color=\"warning\"] &:hover', bg(\"warning.bg-tint-hover\")),\n\t\t\t\t\tactive(bg(\"brand.bg-tint-pressed\")),\n\t\t\t\t\twhen('[data-color=\"neutral\"] &:active', bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\twhen('[data-color=\"success\"] &:active', bg(\"success.bg-tint-pressed\")),\n\t\t\t\t\twhen('[data-color=\"danger\"] &:active', bg(\"danger.bg-tint-pressed\")),\n\t\t\t\t\twhen('[data-color=\"warning\"] &:active', bg(\"warning.bg-tint-pressed\")),\n\t\t\t\t\twhen(\"&:focus-visible\", outlineColor(\"brand\")),\n\t\t\t\t\twhen('[data-color=\"neutral\"] &:focus-visible', outlineColor(\"neutral\")),\n\t\t\t\t\twhen('[data-color=\"success\"] &:focus-visible', outlineColor(\"success\")),\n\t\t\t\t\twhen('[data-color=\"danger\"] &:focus-visible', outlineColor(\"danger\")),\n\t\t\t\t\twhen('[data-color=\"warning\"] &:focus-visible', outlineColor(\"warning\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<XIcon size={12} />\n\t\t\t</Button>\n\t\t);\n\t};\n};\n"
12
+ "content": "/**\n * A labeled set of pill-shaped tags with an optional dismiss control per tag,\n * composing a grouping host, a wrapped list, and each tag's own pill and\n * remove button. A tag reads its color and size through the same `data-*`\n * contract as {@link Badge}, and its remove control renders through\n * {@link Button} as a native form submit, so removing a tag is an ordinary\n * server round-trip through whatever form the group sits inside, driven\n * entirely by the submitted control's `name`/`value` pair.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as ElementProps } from \"remix/component\";\n\nimport { XIcon } from \"@sdxc/icons\";\nimport { bg, fg, outline, outlineColor } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor, listStyle, vars, mergeMix } from \"@sdxc/u/general\";\nimport { flex, flexWrap, gap, inlineFlex, items, vstack } from \"@sdxc/u/layout\";\nimport { bs, is, m, mie, p, 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 type { SemanticColor } from \"@sdxc/ui/utils\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { warnIfNoAccessibleLabel } from \"@sdxc/ui/utils\";\n\nimport { Button } from \"@sdxc/ui/button\";\n\n/** `role=\"group\"` applied to {@link TagGroup} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_ROLE = \"group\";\n\n/** Semantic color role {@link TagGroup.Tag} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: TagGroup.Color = \"neutral\";\n\n/** Size variant {@link TagGroup.Tag} falls back to when `size` is omitted. */\nconst DEFAULT_SIZE: TagGroup.Size = \"md\";\n\n/** Visible edge of {@link TagGroup.Remove}'s round glyph, small enough to sit inside a pill's line. */\nconst REMOVE_SIZE = \"var(--ui-tag-remove-size, 1rem)\";\n\n/**\n * Prop types for {@link TagGroup} and its compound parts.\n */\nexport namespace TagGroup {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` variables —\n\t * the same set {@link Badge} and {@link Button} use.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * Size variant controlling a tag's padding and font size.\n\t */\n\texport type Size = \"sm\" | \"md\";\n\n\t/**\n\t * Props accepted by {@link TagGroup}.\n\t */\n\texport interface Props extends ElementProps<\"div\"> {}\n\n\t/**\n\t * Props accepted by {@link TagGroup.List}.\n\t */\n\texport interface ListProps extends ElementProps<\"ul\"> {}\n\n\t/**\n\t * Props accepted by {@link TagGroup.Tag}. Set `aria-selected=\"true\"` to\n\t * mark a tag as the active member of a selectable set, and\n\t * `aria-disabled=\"true\"` to mute one, both read from native ARIA state.\n\t */\n\texport interface TagProps extends ElementProps<\"li\"> {\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/** Size variant. Defaults to {@link DEFAULT_SIZE}. */\n\t\tsize?: Size;\n\t}\n\n\t/**\n\t * Props accepted by {@link TagGroup.Remove}: every {@link Button.Props}\n\t * field except the ones this component fixes, plus every native\n\t * `<button>` attribute — `name`/`value` tell the form which tag to remove.\n\t */\n\texport interface RemoveProps extends Omit<\n\t\tButton.Props,\n\t\t\"children\" | \"variant\" | \"color\" | \"size\" | \"type\" | \"aria-label\"\n\t> {\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 group's `<div>` host, laying its {@link TagGroup.List} child\n * (and any preceding `Label`) out in a column with a small gap. Dev mode\n * warns when it lacks an accessible name for assistive technology.\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 * <TagGroup aria-label={t(\"skills.label\")}>\n * \t<TagGroup.List>\n * \t\t<TagGroup.Tag color=\"brand\">{t(\"skills.design\")}</TagGroup.Tag>\n * \t\t<TagGroup.Tag color=\"success\">{t(\"skills.shipped\")}</TagGroup.Tag>\n * \t</TagGroup.List>\n * </TagGroup>\n */\nexport function TagGroup(handle: Handle<TagGroup.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t'TagGroup: a group with no \"aria-label\" or \"aria-labelledby\" needs one describing the set of tags — assistive technology has no accessible name to announce otherwise.',\n\t\t);\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"tag-group\"\n\t\t\t\tmix={mergeMix([attrs({ role: DEFAULT_ROLE }), vstack({ gap: 1 })], mix)}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders the group's `<ul>` list, resetting native list markers and spacing\n * and laying {@link TagGroup.Tag} children out as a wrapped row with a small\n * gap between them.\n *\n * @param handle Runtime handle carrying the host `<ul>`'s props.\n * @returns The render function producing the list's markup.\n * @example\n * <TagGroup.List>\n * \t<TagGroup.Tag color=\"neutral\">{t(\"filters.active\")}</TagGroup.Tag>\n * \t<TagGroup.Tag color=\"neutral\" size=\"sm\">{t(\"filters.archived\")}</TagGroup.Tag>\n * </TagGroup.List>\n */\nTagGroup.List = function TagGroupList(handle: Handle<TagGroup.ListProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<ul\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"list\"\n\t\t\t\tmix={mergeMix([flex(), flexWrap(\"wrap\"), gap(2), m(0), p(0), listStyle()], mix)}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a single pill-shaped `<li>`, colored through the `data-color`\n * attribute contract shared with {@link Badge} and sized through\n * `data-size`. Compose {@link TagGroup.Remove} inside it for a dismissible tag.\n *\n * @param handle Runtime handle carrying the host `<li>`'s props.\n * @returns The render function producing the pill's markup.\n * @example\n * <TagGroup.Tag color=\"success\">{t(\"status.shipped\")}</TagGroup.Tag>\n * @example\n * <TagGroup.Tag color=\"danger\" size=\"sm\" aria-selected=\"true\">\n * \t{t(\"status.blocked\")}\n * </TagGroup.Tag>\n */\nTagGroup.Tag = function TagGroupTag(handle: Handle<TagGroup.TagProps>) {\n\treturn () => {\n\t\tlet { color, size, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\t\tlet resolvedSize = size ?? DEFAULT_SIZE;\n\n\t\treturn (\n\t\t\t<li\n\t\t\t\t{...rest}\n\t\t\t\tdata-color={resolvedColor}\n\t\t\t\tdata-size={resolvedSize}\n\t\t\t\tdata-slot=\"tag\"\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\twhen(\"&:focus-visible\", [\n\t\t\t\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\t\t\t\tdata(\"color\", \"neutral\", outline(\"neutral.ring\")),\n\t\t\t\t\t\t\tdata(\"color\", \"success\", outline(\"success.ring\")),\n\t\t\t\t\t\t\tdata(\"color\", \"warning\", outline(\"warning.ring\")),\n\t\t\t\t\t\t\tdata(\"color\", \"danger\", outline(\"danger.ring\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\t\tinlineFlex(),\n\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\tgap(1),\n\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\tpi(3),\n\t\t\t\t\t\tpb(1),\n\t\t\t\t\t\tdata(\"size\", \"sm\", [pi(2), pb(0.5)]),\n\t\t\t\t\t\tdata(\"color\", \"brand\", [bg(\"brand.tint\"), fg(\"brand\")]),\n\t\t\t\t\t\tdata(\"color\", \"success\", [bg(\"success.tint\"), fg(\"success\")]),\n\t\t\t\t\t\tdata(\"color\", \"warning\", [bg(\"warning.tint\"), fg(\"warning\")]),\n\t\t\t\t\t\tdata(\"color\", \"danger\", [bg(\"danger.tint\"), fg(\"danger\")]),\n\t\t\t\t\t\twhen('&[aria-selected=\"true\"]', [bg(\"brand.solid\"), fg(\"brand.onSolid\"), weight(600)]),\n\t\t\t\t\t\twhen('&[aria-disabled=\"true\"]', opacity(50)),\n\t\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\t\tdata(\"size\", \"sm\", text(\"xs\")),\n\t\t\t\t\t\tdata(\"color\", \"neutral\", [bg(\"neutral.bg-tint-hover\"), fg(\"neutral\")]),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a dismiss control for the tag it's composed inside: a small,\n * ghost-styled {@link Button} with an \"X\" glyph submitting as\n * `type=\"submit\"`, colored from the ambient {@link TagGroup.Tag}'s `data-color`.\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 * <form method=\"post\">\n * \t<TagGroup aria-label={t(\"filters.label\")}>\n * \t\t<TagGroup.List>\n * \t\t\t<TagGroup.Tag color=\"brand\">\n * \t\t\t\t{t(\"filters.remote\")}\n * \t\t\t\t<TagGroup.Remove name=\"remove\" value=\"remote\" aria-label={t(\"filters.removeRemote\")} />\n * \t\t\t</TagGroup.Tag>\n * \t\t</TagGroup.List>\n * \t</TagGroup>\n * </form>\n */\nTagGroup.Remove = function TagGroupRemove(handle: Handle<TagGroup.RemoveProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"submit\"\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tdata-slot=\"remove\"\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The control shrinks through Button's own icon-only measure, so it sits inside\n\t\t\t\t\t\t * the pill's line instead of stretching the tag to a full button row, while\n\t\t\t\t\t\t * Button's own hit area keeps its pointer target at `--ui-target-size`.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tvars({ \"ui-button-icon-size-md\": REMOVE_SIZE }),\n\t\t\t\t\t\tmie(-1),\n\t\t\t\t\t\twhen('&[data-slot=\"remove\"] > svg', [is(3), bs(3)]),\n\t\t\t\t\t\tfg(\"currentColor\"),\n\t\t\t\t\t\thover(bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\t\twhen('[data-color=\"neutral\"] &:hover', bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\t\twhen('[data-color=\"success\"] &:hover', bg(\"success.bg-tint-hover\")),\n\t\t\t\t\t\twhen('[data-color=\"danger\"] &:hover', bg(\"danger.bg-tint-hover\")),\n\t\t\t\t\t\twhen('[data-color=\"warning\"] &:hover', bg(\"warning.bg-tint-hover\")),\n\t\t\t\t\t\tactive(bg(\"brand.bg-tint-pressed\")),\n\t\t\t\t\t\twhen('[data-color=\"neutral\"] &:active', bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\t\twhen('[data-color=\"success\"] &:active', bg(\"success.bg-tint-pressed\")),\n\t\t\t\t\t\twhen('[data-color=\"danger\"] &:active', bg(\"danger.bg-tint-pressed\")),\n\t\t\t\t\t\twhen('[data-color=\"warning\"] &:active', bg(\"warning.bg-tint-pressed\")),\n\t\t\t\t\t\twhen(\"&:focus-visible\", outlineColor(\"brand\")),\n\t\t\t\t\t\twhen('[data-color=\"neutral\"] &:focus-visible', outlineColor(\"neutral\")),\n\t\t\t\t\t\twhen('[data-color=\"success\"] &:focus-visible', outlineColor(\"success\")),\n\t\t\t\t\t\twhen('[data-color=\"danger\"] &:focus-visible', outlineColor(\"danger\")),\n\t\t\t\t\t\twhen('[data-color=\"warning\"] &:focus-visible', outlineColor(\"warning\")),\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<XIcon size={12} />\n\t\t\t</Button>\n\t\t);\n\t};\n};\n"
13
13
  },
14
14
  "test": {
15
15
  "path": "tag-group.test.tsx",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "text-field",
3
- "changedIn": "2026.10.2",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [
5
5
  "description",
6
6
  "field-error",
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "source": {
15
15
  "path": "text-field.tsx",
16
- "content": "/**\n * A convenience wrapper composing a labeled, described, and validated field\n * in one call: a caption through {@link Label}, the control through\n * {@link Input}, an optional supporting passage through {@link Description},\n * and an optional validation message through {@link FieldError}. Every id\n * and `aria-describedby` relationship between the parts is computed from\n * this instance's own stable identifier, leaving no id bookkeeping to the\n * consumer.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport type { FieldPartsProps } from \"@sdxc/ui/utils\";\n\nimport { fieldStackLayout } from \"@sdxc/ui/styles\";\nimport { resolveFieldWiring } from \"@sdxc/ui/utils\";\n\nimport { Description } from \"@sdxc/ui/description\";\nimport { FieldError } from \"@sdxc/ui/field-error\";\nimport { resolveFieldIssue } from \"@sdxc/ui/form\";\nimport { Input } from \"@sdxc/ui/input\";\nimport { Label } from \"@sdxc/ui/label\";\n\n/** Native `<input>` `type` {@link TextField} falls back to when `type` is omitted. */\nconst DEFAULT_TYPE: TextField.Type = \"text\";\n\n/**\n * Prop types for {@link TextField}.\n */\nexport namespace TextField {\n\t/**\n\t * Semantic color role for the control's keyboard focus ring, each mapped\n\t * to its matching `--ui-*` variables.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Native `<input>` `type` this wrapper renders a single-line, text-like\n\t * control for. A checkbox, radio, or file control each has its own\n\t * dedicated component instead of a `type` value here.\n\t */\n\texport type Type = \"text\" | \"email\" | \"password\" | \"tel\" | \"url\" | \"search\" | \"number\";\n\n\t/**\n\t * Per-part styling for the elements this convenience wrapper composes in\n\t * one call, layered after each part's own built-in styling.\n\t */\n\texport type PartsProps = FieldPartsProps;\n\n\t/**\n\t * Props accepted by {@link TextField}. `mix` styles the root element\n\t * grouping the field's parts; style the composed label, control,\n\t * description, and error individually through `parts` instead.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"children\"> {\n\t\t/** Semantic color role for the control's focus ring. Defaults to `\"neutral\"` when omitted. */\n\t\tcolor?: Color;\n\t\t/**\n\t\t * The field's caption, rendered through {@link Label} and associated\n\t\t * with the control through a native `for`/`id` relationship computed\n\t\t * from this instance's own identifier.\n\t\t */\n\t\tlabel: RemixNode;\n\t\t/**\n\t\t * Supporting copy rendered through {@link Description} beneath the\n\t\t * control and referenced by the control's `aria-describedby`. Omit to\n\t\t * render no description.\n\t\t */\n\t\tdescription?: RemixNode;\n\t\t/**\n\t\t * Validation message rendered through {@link FieldError} beneath the\n\t\t * control, marking `aria-invalid` unless set explicitly. Falls back to\n\t\t * a {@link Form}'s own `issues` message by `name`; an explicit value wins.\n\t\t */\n\t\terrorMessage?: RemixNode;\n\t\t/**\n\t\t * Native `autofocus`. Defaults to `true` for the first invalid field of\n\t\t * an enclosing {@link Form}'s `issues`, landing keyboard focus on the\n\t\t * problem with no client JavaScript; pass explicitly to override.\n\t\t */\n\t\tautoFocus?: boolean;\n\t\t/** Native `<input>` `type`. Defaults to {@link DEFAULT_TYPE}. */\n\t\ttype?: Type;\n\t\t/** Native `name` submitted with an enclosing form. */\n\t\tname?: string;\n\t\t/** Current value, for a control a consumer tracks itself. */\n\t\tvalue?: string;\n\t\t/** Initial value, for a control left to the platform's own uncontrolled state. */\n\t\tdefaultValue?: string;\n\t\t/** Placeholder copy shown while the control is empty. */\n\t\tplaceholder?: string;\n\t\t/** Marks the control required for its enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks the control inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks the control's value fixed, while keeping it focusable and included in form submission. */\n\t\treadOnly?: boolean;\n\t\t/** Native autofill hint, e.g. `\"email\"` or `\"current-password\"`. */\n\t\tautoComplete?: string;\n\t\t/** Native validation pattern the control's value must match. */\n\t\tpattern?: string;\n\t\t/** Minimum accepted value length. */\n\t\tminLength?: number;\n\t\t/** Maximum accepted value length. */\n\t\tmaxLength?: number;\n\t\t/** Per-part styling for this wrapper's internally composed elements. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * Composes {@link Label}, {@link Input}, {@link Description}, and\n * {@link FieldError} into one field, computing every id and\n * `aria-describedby` link from this instance's own stable identifier.\n *\n * @param handle Runtime handle carrying the root element's props and this instance's stable identifier.\n * @returns The render function producing the field's markup.\n * @example\n * <TextField label={t(\"form.email.label\")} type=\"email\" name=\"email\" required />\n * @example\n * <TextField\n * \tlabel={t(\"form.password.label\")}\n * \ttype=\"password\"\n * \tname=\"password\"\n * \tdescription={t(\"form.password.hint\")}\n * />\n * @example\n * <TextField\n * \tlabel={t(\"form.username.label\")}\n * \tname=\"username\"\n * \tdefaultValue=\"ab\"\n * \terrorMessage={t(\"form.username.tooShort\")}\n * />\n */\nexport function TextField(handle: Handle<TextField.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor,\n\t\t\tlabel,\n\t\t\tdescription,\n\t\t\terrorMessage: errorMessageProp,\n\t\t\tautoFocus,\n\t\t\ttype,\n\t\t\tname,\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tplaceholder,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\treadOnly,\n\t\t\tautoComplete,\n\t\t\tpattern,\n\t\t\tminLength,\n\t\t\tmaxLength,\n\t\t\t\"aria-invalid\": ariaInvalidProp,\n\t\t\tparts,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet resolvedType = type ?? DEFAULT_TYPE;\n\t\tlet { errorMessage, isFirstInvalid } = resolveFieldIssue(handle, name, errorMessageProp);\n\t\tlet resolvedAutoFocus = autoFocus ?? (isFirstInvalid || undefined);\n\t\tlet { resolvedColor, resolvedInvalid, descriptionId, errorId, describedBy } =\n\t\t\tresolveFieldWiring(handle.id, {\n\t\t\t\tcolor,\n\t\t\t\terrorMessage,\n\t\t\t\tdescription,\n\t\t\t\tariaInvalid: ariaInvalidProp,\n\t\t\t});\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"text-field\" mix={[fieldStackLayout(), mix]}>\n\t\t\t\t<Label htmlFor={handle.id} mix={parts?.label}>\n\t\t\t\t\t{label}\n\t\t\t\t</Label>\n\t\t\t\t<Input\n\t\t\t\t\tid={handle.id}\n\t\t\t\t\ttype={resolvedType as never}\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\tplaceholder={placeholder}\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\tpattern={pattern}\n\t\t\t\t\tminLength={minLength}\n\t\t\t\t\tmaxLength={maxLength}\n\t\t\t\t\t// oxlint-disable-next-line jsx-a11y/no-autofocus -- Not a focus grab on page load: this only ever resolves true for the first field an enclosing Form reports as invalid, so a failed submit lands the user on the problem instead of leaving them to hunt for it.\n\t\t\t\t\tautoFocus={resolvedAutoFocus}\n\t\t\t\t\taria-invalid={resolvedInvalid}\n\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\tmix={parts?.input}\n\t\t\t\t/>\n\t\t\t\t{description ? (\n\t\t\t\t\t<Description id={descriptionId} mix={parts?.description}>\n\t\t\t\t\t\t{description}\n\t\t\t\t\t</Description>\n\t\t\t\t) : null}\n\t\t\t\t{errorMessage ? (\n\t\t\t\t\t<FieldError id={errorId} mix={parts?.error}>\n\t\t\t\t\t\t{errorMessage}\n\t\t\t\t\t</FieldError>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t);\n\t};\n}\n"
16
+ "content": "/**\n * A convenience wrapper composing a labeled, described, and validated field\n * in one call: a caption through {@link Label}, the control through\n * {@link Input}, an optional supporting passage through {@link Description},\n * and an optional validation message through {@link FieldError}. Every id\n * and `aria-describedby` relationship between the parts is computed from\n * this instance's own stable identifier, leaving no id bookkeeping to the\n * consumer.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { mergeMix } from \"@sdxc/u/general\";\n\nimport type { FieldPartsProps } from \"@sdxc/ui/utils\";\n\nimport { fieldStackLayout } from \"@sdxc/ui/styles\";\nimport { resolveFieldWiring } from \"@sdxc/ui/utils\";\n\nimport { Description } from \"@sdxc/ui/description\";\nimport { FieldError } from \"@sdxc/ui/field-error\";\nimport { resolveFieldIssue } from \"@sdxc/ui/form\";\nimport { Input } from \"@sdxc/ui/input\";\nimport { Label } from \"@sdxc/ui/label\";\n\n/** Native `<input>` `type` {@link TextField} falls back to when `type` is omitted. */\nconst DEFAULT_TYPE: TextField.Type = \"text\";\n\n/**\n * Prop types for {@link TextField}.\n */\nexport namespace TextField {\n\t/**\n\t * Semantic color role for the control's keyboard focus ring, each mapped\n\t * to its matching `--ui-*` variables.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Native `<input>` `type` this wrapper renders a single-line, text-like\n\t * control for. A checkbox, radio, or file control each has its own\n\t * dedicated component instead of a `type` value here.\n\t */\n\texport type Type = \"text\" | \"email\" | \"password\" | \"tel\" | \"url\" | \"search\" | \"number\";\n\n\t/**\n\t * Per-part styling for the elements this convenience wrapper composes in\n\t * one call, layered after each part's own built-in styling.\n\t */\n\texport type PartsProps = FieldPartsProps;\n\n\t/**\n\t * Props accepted by {@link TextField}. `mix` styles the root element\n\t * grouping the field's parts; style the composed label, control,\n\t * description, and error individually through `parts` instead.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"children\"> {\n\t\t/** Semantic color role for the control's focus ring. Defaults to `\"neutral\"` when omitted. */\n\t\tcolor?: Color;\n\t\t/**\n\t\t * The field's caption, rendered through {@link Label} and associated\n\t\t * with the control through a native `for`/`id` relationship computed\n\t\t * from this instance's own identifier.\n\t\t */\n\t\tlabel: RemixNode;\n\t\t/**\n\t\t * Supporting copy rendered through {@link Description} beneath the\n\t\t * control and referenced by the control's `aria-describedby`. Omit to\n\t\t * render no description.\n\t\t */\n\t\tdescription?: RemixNode;\n\t\t/**\n\t\t * Validation message rendered through {@link FieldError} beneath the\n\t\t * control, marking `aria-invalid` unless set explicitly. Falls back to\n\t\t * a {@link Form}'s own `issues` message by `name`; an explicit value wins.\n\t\t */\n\t\terrorMessage?: RemixNode;\n\t\t/**\n\t\t * Native `autofocus`. Defaults to `true` for the first invalid field of\n\t\t * an enclosing {@link Form}'s `issues`, landing keyboard focus on the\n\t\t * problem with no client JavaScript; pass explicitly to override.\n\t\t */\n\t\tautoFocus?: boolean;\n\t\t/** Native `<input>` `type`. Defaults to {@link DEFAULT_TYPE}. */\n\t\ttype?: Type;\n\t\t/** Native `name` submitted with an enclosing form. */\n\t\tname?: string;\n\t\t/** Current value, for a control a consumer tracks itself. */\n\t\tvalue?: string;\n\t\t/** Initial value, for a control left to the platform's own uncontrolled state. */\n\t\tdefaultValue?: string;\n\t\t/** Placeholder copy shown while the control is empty. */\n\t\tplaceholder?: string;\n\t\t/** Marks the control required for its enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks the control inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks the control's value fixed, while keeping it focusable and included in form submission. */\n\t\treadOnly?: boolean;\n\t\t/** Native autofill hint, e.g. `\"email\"` or `\"current-password\"`. */\n\t\tautoComplete?: string;\n\t\t/** Native validation pattern the control's value must match. */\n\t\tpattern?: string;\n\t\t/** Minimum accepted value length. */\n\t\tminLength?: number;\n\t\t/** Maximum accepted value length. */\n\t\tmaxLength?: number;\n\t\t/** Per-part styling for this wrapper's internally composed elements. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * Composes {@link Label}, {@link Input}, {@link Description}, and\n * {@link FieldError} into one field, computing every id and\n * `aria-describedby` link from this instance's own stable identifier.\n *\n * @param handle Runtime handle carrying the root element's props and this instance's stable identifier.\n * @returns The render function producing the field's markup.\n * @example\n * <TextField label={t(\"form.email.label\")} type=\"email\" name=\"email\" required />\n * @example\n * <TextField\n * \tlabel={t(\"form.password.label\")}\n * \ttype=\"password\"\n * \tname=\"password\"\n * \tdescription={t(\"form.password.hint\")}\n * />\n * @example\n * <TextField\n * \tlabel={t(\"form.username.label\")}\n * \tname=\"username\"\n * \tdefaultValue=\"ab\"\n * \terrorMessage={t(\"form.username.tooShort\")}\n * />\n */\nexport function TextField(handle: Handle<TextField.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor,\n\t\t\tlabel,\n\t\t\tdescription,\n\t\t\terrorMessage: errorMessageProp,\n\t\t\tautoFocus,\n\t\t\ttype,\n\t\t\tname,\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tplaceholder,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\treadOnly,\n\t\t\tautoComplete,\n\t\t\tpattern,\n\t\t\tminLength,\n\t\t\tmaxLength,\n\t\t\t\"aria-invalid\": ariaInvalidProp,\n\t\t\tparts,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet resolvedType = type ?? DEFAULT_TYPE;\n\t\tlet { errorMessage, isFirstInvalid } = resolveFieldIssue(handle, name, errorMessageProp);\n\t\tlet resolvedAutoFocus = autoFocus ?? (isFirstInvalid || undefined);\n\t\tlet { resolvedColor, resolvedInvalid, descriptionId, errorId, describedBy } =\n\t\t\tresolveFieldWiring(handle.id, {\n\t\t\t\tcolor,\n\t\t\t\terrorMessage,\n\t\t\t\tdescription,\n\t\t\t\tariaInvalid: ariaInvalidProp,\n\t\t\t});\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"text-field\" mix={mergeMix(fieldStackLayout(), mix)}>\n\t\t\t\t<Label htmlFor={handle.id} mix={parts?.label}>\n\t\t\t\t\t{label}\n\t\t\t\t</Label>\n\t\t\t\t<Input\n\t\t\t\t\tid={handle.id}\n\t\t\t\t\ttype={resolvedType as never}\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\tplaceholder={placeholder}\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\tpattern={pattern}\n\t\t\t\t\tminLength={minLength}\n\t\t\t\t\tmaxLength={maxLength}\n\t\t\t\t\t// oxlint-disable-next-line jsx-a11y/no-autofocus -- Not a focus grab on page load: this only ever resolves true for the first field an enclosing Form reports as invalid, so a failed submit lands the user on the problem instead of leaving them to hunt for it.\n\t\t\t\t\tautoFocus={resolvedAutoFocus}\n\t\t\t\t\taria-invalid={resolvedInvalid}\n\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\tmix={parts?.input}\n\t\t\t\t/>\n\t\t\t\t{description ? (\n\t\t\t\t\t<Description id={descriptionId} mix={parts?.description}>\n\t\t\t\t\t\t{description}\n\t\t\t\t\t</Description>\n\t\t\t\t) : null}\n\t\t\t\t{errorMessage ? (\n\t\t\t\t\t<FieldError id={errorId} mix={parts?.error}>\n\t\t\t\t\t\t{errorMessage}\n\t\t\t\t\t</FieldError>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t);\n\t};\n}\n"
17
17
  },
18
18
  "test": null
19
19
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "text",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Text"
7
7
  ],
8
8
  "source": {
9
9
  "path": "text.tsx",
10
- "content": "/**\n * A run of small body copy, styled at the library's default text size and\n * the neutral muted foreground color. It carries no color, variant, or size\n * contract of its own — a description beneath a heading, a caption beside a\n * control, or any other passage of supporting copy renders through it at a\n * single, consistent intensity.\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 Text}.\n */\nexport namespace Text {\n\t/**\n\t * Every native `<span>` attribute, unchanged, plus the `mix` passthrough.\n\t * Carries no color, variant, or size prop of its own — always rendering\n\t * at the library's default body-copy size and muted foreground color.\n\t */\n\texport interface Props extends TagProps<\"span\"> {}\n}\n\n/**\n * Renders its children inside a `<span>` sized and colored as a small run of\n * body copy: the library's default text size paired with the neutral muted\n * foreground color.\n *\n * @param handle Runtime handle carrying the host `<span>`'s props.\n * @returns The render function producing the text run's markup.\n * @example\n * <Text>{t(\"client.description\")}</Text>\n */\nexport function Text(handle: Handle<Text.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <span {...rest} mix={[fg(\"neutral\"), text(\"sm\"), pretty(), mix]} />;\n\t};\n}\n"
10
+ "content": "/**\n * A run of small body copy, styled at the library's default text size and\n * the neutral muted foreground color. It carries no color, variant, or size\n * contract of its own — a description beneath a heading, a caption beside a\n * control, or any other passage of supporting copy renders through it at a\n * single, consistent intensity.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { fg } from \"@sdxc/u/color\";\nimport { mergeMix } from \"@sdxc/u/general\";\nimport { pretty, text } from \"@sdxc/u/typography\";\n\n/**\n * Prop types for {@link Text}.\n */\nexport namespace Text {\n\t/**\n\t * Every native `<span>` attribute, unchanged, plus the `mix` passthrough.\n\t * Carries no color, variant, or size prop of its own — always rendering\n\t * at the library's default body-copy size and muted foreground color.\n\t */\n\texport interface Props extends TagProps<\"span\"> {}\n}\n\n/**\n * Renders its children inside a `<span>` sized and colored as a small run of\n * body copy: the library's default text size paired with the neutral muted\n * foreground color.\n *\n * @param handle Runtime handle carrying the host `<span>`'s props.\n * @returns The render function producing the text run's markup.\n * @example\n * <Text>{t(\"client.description\")}</Text>\n */\nexport function Text(handle: Handle<Text.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <span {...rest} mix={mergeMix([fg(\"neutral\"), text(\"sm\"), pretty()], mix)} />;\n\t};\n}\n"
11
11
  },
12
12
  "test": null
13
13
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "textarea",
3
- "changedIn": "2026.10.2",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "TextArea"
7
7
  ],
8
8
  "source": {
9
9
  "path": "textarea.tsx",
10
- "content": "/**\n * A multi-line native form field for free text entry, rendered as a bordered,\n * rounded `<textarea>` that shares {@link Input}'s border, background, and\n * focus-ring contract. It starts at a comfortable minimum block size and\n * grows with its content through `field-sizing: content`, so a reply box or\n * a comment field never clips what's already been typed.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { border, bg, fg, outline } from \"@sdxc/u/color\";\nimport { rounded, opacity } from \"@sdxc/u/effects\";\nimport { cursor, raw } from \"@sdxc/u/general\";\nimport { block } from \"@sdxc/u/layout\";\nimport { is, bs, minBs, pi, pb } from \"@sdxc/u/size\";\nimport { when, hover, invalid } from \"@sdxc/u/state\";\nimport { text } from \"@sdxc/u/typography\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\n\n/** Semantic color role {@link TextArea} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: TextArea.Color = \"neutral\";\n\n/**\n * Prop types for {@link TextArea}.\n */\nexport namespace TextArea {\n\t/**\n\t * Semantic color role for the focus-visible ring, each mapped to its\n\t * matching `--ui-*` variables. A field marked invalid always reads the\n\t * danger tone for its ring instead, regardless of `color`.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Every native `<textarea>` attribute, unchanged, plus the `mix`\n\t * passthrough. `aria-invalid` together with the platform's own\n\t * post-interaction validity state drives the invalid styling.\n\t */\n\texport type Props = TagProps<\"textarea\"> & {\n\t\t/** Semantic color role for the focus-visible ring. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t};\n}\n\n/**\n * Renders a native `<textarea>` host styled as a bordered, rounded field,\n * colored through the `data-color` attribute contract — the same visual\n * language as {@link Input}, rendering only the field itself.\n *\n * @param handle Runtime handle carrying the host `<textarea>`'s props.\n * @returns The render function producing the field's markup.\n * @example\n * <Label htmlFor=\"bio\">{t(\"form.bio.label\")}</Label>\n * <TextArea id=\"bio\" name=\"bio\" />\n * @example\n * <TextArea\n * \taria-label={t(\"form.comment.label\")}\n * \tcolor=\"brand\"\n * \tplaceholder={t(\"form.comment.placeholder\")}\n * />\n * @example\n * <TextArea id=\"notes\" aria-describedby=\"notes-error\" aria-invalid=\"true\" />\n * <FieldError id=\"notes-error\">{t(\"form.notes.tooLong\")}</FieldError>\n */\nexport function TextArea(handle: Handle<TextArea.Props>) {\n\treturn () => {\n\t\tlet { color, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\treturn (\n\t\t\t<textarea\n\t\t\t\t{...rest}\n\t\t\t\tdata-color={resolvedColor}\n\t\t\t\tmix={[\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tblock(),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\tbs(\"auto\"),\n\t\t\t\t\tminBs(\"6rem\"),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tborder({ color: \"neutral\", width: 1 }),\n\t\t\t\t\tbg(\"neutral.bg-tint\"),\n\t\t\t\t\tfg(\"neutral.fg-emphasis\"),\n\t\t\t\t\tpi(\"0.75rem\"),\n\t\t\t\t\tpb(\"0.5rem\"),\n\t\t\t\t\twhen(\"&::placeholder\", fg(\"neutral.fg-muted\")),\n\t\t\t\t\thover(border(\"neutral.border-strong\")),\n\t\t\t\t\twhen(\"&:focus\", border(\"neutral.border-strong\")),\n\t\t\t\t\twhen(\"&:focus-visible\", [\n\t\t\t\t\t\toutline({ color: \"neutral.ring\", offset: 0 }),\n\t\t\t\t\t\tborder(\"neutral.border-strong\"),\n\t\t\t\t\t\twhen('&[data-color=\"brand\"]', [\n\t\t\t\t\t\t\tborder(\"brand.border-strong\"),\n\t\t\t\t\t\t\toutline({ color: \"brand.ring\", offset: 0 }),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"success\"]', [\n\t\t\t\t\t\t\tborder(\"success.border-strong\"),\n\t\t\t\t\t\t\toutline({ color: \"success.ring\", offset: 0 }),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"warning\"]', [\n\t\t\t\t\t\t\tborder(\"warning.border-strong\"),\n\t\t\t\t\t\t\toutline({ color: \"warning.ring\", offset: 0 }),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"danger\"]', [\n\t\t\t\t\t\t\tborder(\"danger.border-strong\"),\n\t\t\t\t\t\t\toutline({ color: \"danger.ring\", offset: 0 }),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]),\n\t\t\t\t\tinvalid([outline({ color: \"danger.ring\", offset: 0 }), border(\"danger.border-strong\")]),\n\t\t\t\t\twhen(\"&:disabled\", [opacity(50), bg(\"neutral.bg-tint-hover\"), cursor(\"not-allowed\")]),\n\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\traw({\n\t\t\t\t\t\tresize: \"block\",\n\t\t\t\t\t\tfieldSizing: \"content\",\n\t\t\t\t\t}),\n\t\t\t\t\twhen(\"&:focus\", outline(\"none\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n"
10
+ "content": "/**\n * A multi-line native form field for free text entry, rendered as a bordered,\n * rounded `<textarea>` that shares {@link Input}'s border, background, and\n * focus-ring contract. It starts at a comfortable minimum block size and\n * grows with its content through `field-sizing: content`, so a reply box or\n * a comment field never clips what's already been typed.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { border, bg, fg, outline } from \"@sdxc/u/color\";\nimport { rounded, opacity } from \"@sdxc/u/effects\";\nimport { cursor, raw, mergeMix } from \"@sdxc/u/general\";\nimport { block } from \"@sdxc/u/layout\";\nimport { is, bs, minBs, pi, pb } from \"@sdxc/u/size\";\nimport { when, hover, invalid } from \"@sdxc/u/state\";\nimport { text } from \"@sdxc/u/typography\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\n\n/** Semantic color role {@link TextArea} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: TextArea.Color = \"neutral\";\n\n/**\n * Prop types for {@link TextArea}.\n */\nexport namespace TextArea {\n\t/**\n\t * Semantic color role for the focus-visible ring, each mapped to its\n\t * matching `--ui-*` variables. A field marked invalid always reads the\n\t * danger tone for its ring instead, regardless of `color`.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Every native `<textarea>` attribute, unchanged, plus the `mix`\n\t * passthrough. `aria-invalid` together with the platform's own\n\t * post-interaction validity state drives the invalid styling.\n\t */\n\texport type Props = TagProps<\"textarea\"> & {\n\t\t/** Semantic color role for the focus-visible ring. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t};\n}\n\n/**\n * Renders a native `<textarea>` host styled as a bordered, rounded field,\n * colored through the `data-color` attribute contract — the same visual\n * language as {@link Input}, rendering only the field itself.\n *\n * @param handle Runtime handle carrying the host `<textarea>`'s props.\n * @returns The render function producing the field's markup.\n * @example\n * <Label htmlFor=\"bio\">{t(\"form.bio.label\")}</Label>\n * <TextArea id=\"bio\" name=\"bio\" />\n * @example\n * <TextArea\n * \taria-label={t(\"form.comment.label\")}\n * \tcolor=\"brand\"\n * \tplaceholder={t(\"form.comment.placeholder\")}\n * />\n * @example\n * <TextArea id=\"notes\" aria-describedby=\"notes-error\" aria-invalid=\"true\" />\n * <FieldError id=\"notes-error\">{t(\"form.notes.tooLong\")}</FieldError>\n */\nexport function TextArea(handle: Handle<TextArea.Props>) {\n\treturn () => {\n\t\tlet { color, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\treturn (\n\t\t\t<textarea\n\t\t\t\t{...rest}\n\t\t\t\tdata-color={resolvedColor}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\t\tblock(),\n\t\t\t\t\t\tis(\"full\"),\n\t\t\t\t\t\tbs(\"auto\"),\n\t\t\t\t\t\tminBs(\"6rem\"),\n\t\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\t\tborder({ color: \"neutral\", width: 1 }),\n\t\t\t\t\t\tbg(\"neutral.bg-tint\"),\n\t\t\t\t\t\tfg(\"neutral.fg-emphasis\"),\n\t\t\t\t\t\tpi(\"0.75rem\"),\n\t\t\t\t\t\tpb(\"0.5rem\"),\n\t\t\t\t\t\twhen(\"&::placeholder\", fg(\"neutral.fg-muted\")),\n\t\t\t\t\t\thover(border(\"neutral.border-strong\")),\n\t\t\t\t\t\twhen(\"&:focus\", border(\"neutral.border-strong\")),\n\t\t\t\t\t\twhen(\"&:focus-visible\", [\n\t\t\t\t\t\t\toutline({ color: \"neutral.ring\", offset: 0 }),\n\t\t\t\t\t\t\tborder(\"neutral.border-strong\"),\n\t\t\t\t\t\t\twhen('&[data-color=\"brand\"]', [\n\t\t\t\t\t\t\t\tborder(\"brand.border-strong\"),\n\t\t\t\t\t\t\t\toutline({ color: \"brand.ring\", offset: 0 }),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\twhen('&[data-color=\"success\"]', [\n\t\t\t\t\t\t\t\tborder(\"success.border-strong\"),\n\t\t\t\t\t\t\t\toutline({ color: \"success.ring\", offset: 0 }),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\twhen('&[data-color=\"warning\"]', [\n\t\t\t\t\t\t\t\tborder(\"warning.border-strong\"),\n\t\t\t\t\t\t\t\toutline({ color: \"warning.ring\", offset: 0 }),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\twhen('&[data-color=\"danger\"]', [\n\t\t\t\t\t\t\t\tborder(\"danger.border-strong\"),\n\t\t\t\t\t\t\t\toutline({ color: \"danger.ring\", offset: 0 }),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tinvalid([outline({ color: \"danger.ring\", offset: 0 }), border(\"danger.border-strong\")]),\n\t\t\t\t\t\twhen(\"&:disabled\", [opacity(50), bg(\"neutral.bg-tint-hover\"), cursor(\"not-allowed\")]),\n\t\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\t\traw({\n\t\t\t\t\t\t\tresize: \"block\",\n\t\t\t\t\t\t\tfieldSizing: \"content\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t\twhen(\"&:focus\", outline(\"none\")),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n}\n"
11
11
  },
12
12
  "test": null
13
13
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "time-field",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [
5
5
  "description",
6
6
  "field-error",
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "source": {
15
15
  "path": "time-field.tsx",
16
- "content": "/**\n * A convenience wrapper composing a labeled, described, and validated time\n * field in one call: a caption through {@link Label}, a native\n * `<input type=\"time\">` control through {@link Input}, an optional\n * supporting passage through {@link Description}, and an optional\n * validation message through {@link FieldError}. Every id and\n * `aria-describedby` relationship between the parts is computed from this\n * instance's own stable identifier, leaving no id bookkeeping to the\n * consumer.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { tabularNums } from \"@sdxc/u/typography\";\n\nimport type { FieldPartsProps } from \"@sdxc/ui/utils\";\n\nimport { fieldStackLayout } from \"@sdxc/ui/styles\";\nimport { resolveFieldWiring } from \"@sdxc/ui/utils\";\n\nimport { Description } from \"@sdxc/ui/description\";\nimport { FieldError } from \"@sdxc/ui/field-error\";\nimport { resolveFieldIssue } from \"@sdxc/ui/form\";\nimport { Input } from \"@sdxc/ui/input\";\nimport { Label } from \"@sdxc/ui/label\";\n\n/**\n * Prop types for {@link TimeField}.\n */\nexport namespace TimeField {\n\t/**\n\t * Semantic color role for the control's keyboard focus ring, each mapped\n\t * to its matching `--ui-*` variables.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Per-part styling for the elements this convenience wrapper composes in\n\t * one call, layered after each part's own built-in styling.\n\t */\n\texport type PartsProps = FieldPartsProps;\n\n\t/**\n\t * Props accepted by {@link TimeField}. `mix` styles the root element\n\t * grouping the field's parts; style the composed label, control,\n\t * description, and error individually through `parts` instead.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"children\"> {\n\t\t/** Semantic color role for the control's focus ring. Defaults to `\"neutral\"` when omitted. */\n\t\tcolor?: Color;\n\t\t/**\n\t\t * The field's caption, rendered through {@link Label} and associated\n\t\t * with the control through a native `for`/`id` relationship computed\n\t\t * from this instance's own identifier.\n\t\t */\n\t\tlabel: RemixNode;\n\t\t/**\n\t\t * Supporting copy rendered through {@link Description} beneath the\n\t\t * control and referenced by the control's `aria-describedby`. Omit to\n\t\t * render no description.\n\t\t */\n\t\tdescription?: RemixNode;\n\t\t/**\n\t\t * Validation message rendered through {@link FieldError} beneath the\n\t\t * control, marking `aria-invalid` unless set explicitly. Falls back to\n\t\t * a {@link Form}'s own `issues` message by `name`; an explicit value wins.\n\t\t */\n\t\terrorMessage?: RemixNode;\n\t\t/**\n\t\t * Native `autofocus`. Defaults to `true` for the first invalid field of\n\t\t * an enclosing {@link Form}'s `issues`, landing keyboard focus on the\n\t\t * problem with no client JavaScript; pass explicitly to override.\n\t\t */\n\t\tautoFocus?: boolean;\n\t\t/** Native `name` submitted with an enclosing form. */\n\t\tname?: string;\n\t\t/** Current value, in the platform's `\"HH:mm\"` (or `\"HH:mm:ss\"`) format, for a control a consumer tracks itself. */\n\t\tvalue?: string;\n\t\t/** Initial value, in that same format, for a control left to the platform's own uncontrolled state. */\n\t\tdefaultValue?: string;\n\t\t/** Earliest accepted time, in the same `\"HH:mm\"`/`\"HH:mm:ss\"` format. */\n\t\tmin?: string;\n\t\t/** Latest accepted time, in the same `\"HH:mm\"`/`\"HH:mm:ss\"` format. */\n\t\tmax?: string;\n\t\t/** Granularity of the accepted value, in seconds — set to `1` to surface a seconds digit alongside hours and minutes. */\n\t\tstep?: number;\n\t\t/** Marks the control required for its enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks the control inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks the control's value fixed, while keeping it focusable and included in form submission. */\n\t\treadOnly?: boolean;\n\t\t/** Native autofill hint, e.g. `\"bday\"`. */\n\t\tautoComplete?: string;\n\t\t/** Per-part styling for this wrapper's internally composed elements. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * Composes {@link Label}, a native `<input type=\"time\">` control through\n * {@link Input}, {@link Description}, and {@link FieldError} into one field,\n * computing every id and `aria-describedby` link from this identifier.\n *\n * @param handle Runtime handle carrying the root element's props and this instance's stable identifier.\n * @returns The render function producing the field's markup.\n * @example\n * <TimeField label={t(\"event.startTime.label\")} name=\"startTime\" required />\n * @example\n * <TimeField\n * \tlabel={t(\"event.reminderTime.label\")}\n * \tmin=\"09:00\"\n * \tmax=\"18:00\"\n * \tdescription={t(\"event.reminderTime.hint\")}\n * />\n * @example\n * <TimeField\n * \tlabel={t(\"event.endTime.label\")}\n * \tname=\"endTime\"\n * \tdefaultValue=\"09:00\"\n * \terrorMessage={t(\"event.endTime.beforeStart\")}\n * />\n */\nexport function TimeField(handle: Handle<TimeField.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor,\n\t\t\tlabel,\n\t\t\tdescription,\n\t\t\terrorMessage: errorMessageProp,\n\t\t\tautoFocus,\n\t\t\tname,\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tstep,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\treadOnly,\n\t\t\tautoComplete,\n\t\t\t\"aria-invalid\": ariaInvalidProp,\n\t\t\tparts,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet { errorMessage, isFirstInvalid } = resolveFieldIssue(handle, name, errorMessageProp);\n\t\tlet resolvedAutoFocus = autoFocus ?? (isFirstInvalid || undefined);\n\t\tlet { resolvedColor, resolvedInvalid, descriptionId, errorId, describedBy } =\n\t\t\tresolveFieldWiring(handle.id, {\n\t\t\t\tcolor,\n\t\t\t\terrorMessage,\n\t\t\t\tdescription,\n\t\t\t\tariaInvalid: ariaInvalidProp,\n\t\t\t});\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"time-field\" mix={[fieldStackLayout(), mix]}>\n\t\t\t\t<Label htmlFor={handle.id} mix={parts?.label}>\n\t\t\t\t\t{label}\n\t\t\t\t</Label>\n\t\t\t\t<Input\n\t\t\t\t\tid={handle.id}\n\t\t\t\t\ttype=\"time\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\tmin={min}\n\t\t\t\t\tmax={max}\n\t\t\t\t\tstep={step}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t// oxlint-disable-next-line jsx-a11y/no-autofocus -- Not a focus grab on page load: this only ever resolves true for the first field an enclosing Form reports as invalid, so a failed submit lands the user on the problem instead of leaving them to hunt for it.\n\t\t\t\t\tautoFocus={resolvedAutoFocus}\n\t\t\t\t\taria-invalid={resolvedInvalid}\n\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\tmix={[tabularNums(), parts?.input]}\n\t\t\t\t/>\n\t\t\t\t{description ? (\n\t\t\t\t\t<Description id={descriptionId} mix={parts?.description}>\n\t\t\t\t\t\t{description}\n\t\t\t\t\t</Description>\n\t\t\t\t) : null}\n\t\t\t\t{errorMessage ? (\n\t\t\t\t\t<FieldError id={errorId} mix={parts?.error}>\n\t\t\t\t\t\t{errorMessage}\n\t\t\t\t\t</FieldError>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t);\n\t};\n}\n"
16
+ "content": "/**\n * A convenience wrapper composing a labeled, described, and validated time\n * field in one call: a caption through {@link Label}, a native\n * `<input type=\"time\">` control through {@link Input}, an optional\n * supporting passage through {@link Description}, and an optional\n * validation message through {@link FieldError}. Every id and\n * `aria-describedby` relationship between the parts is computed from this\n * instance's own stable identifier, leaving no id bookkeeping to the\n * consumer.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { mergeMix } from \"@sdxc/u/general\";\nimport { tabularNums } from \"@sdxc/u/typography\";\n\nimport type { FieldPartsProps } from \"@sdxc/ui/utils\";\n\nimport { fieldStackLayout } from \"@sdxc/ui/styles\";\nimport { resolveFieldWiring } from \"@sdxc/ui/utils\";\n\nimport { Description } from \"@sdxc/ui/description\";\nimport { FieldError } from \"@sdxc/ui/field-error\";\nimport { resolveFieldIssue } from \"@sdxc/ui/form\";\nimport { Input } from \"@sdxc/ui/input\";\nimport { Label } from \"@sdxc/ui/label\";\n\n/**\n * Prop types for {@link TimeField}.\n */\nexport namespace TimeField {\n\t/**\n\t * Semantic color role for the control's keyboard focus ring, each mapped\n\t * to its matching `--ui-*` variables.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Per-part styling for the elements this convenience wrapper composes in\n\t * one call, layered after each part's own built-in styling.\n\t */\n\texport type PartsProps = FieldPartsProps;\n\n\t/**\n\t * Props accepted by {@link TimeField}. `mix` styles the root element\n\t * grouping the field's parts; style the composed label, control,\n\t * description, and error individually through `parts` instead.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"children\"> {\n\t\t/** Semantic color role for the control's focus ring. Defaults to `\"neutral\"` when omitted. */\n\t\tcolor?: Color;\n\t\t/**\n\t\t * The field's caption, rendered through {@link Label} and associated\n\t\t * with the control through a native `for`/`id` relationship computed\n\t\t * from this instance's own identifier.\n\t\t */\n\t\tlabel: RemixNode;\n\t\t/**\n\t\t * Supporting copy rendered through {@link Description} beneath the\n\t\t * control and referenced by the control's `aria-describedby`. Omit to\n\t\t * render no description.\n\t\t */\n\t\tdescription?: RemixNode;\n\t\t/**\n\t\t * Validation message rendered through {@link FieldError} beneath the\n\t\t * control, marking `aria-invalid` unless set explicitly. Falls back to\n\t\t * a {@link Form}'s own `issues` message by `name`; an explicit value wins.\n\t\t */\n\t\terrorMessage?: RemixNode;\n\t\t/**\n\t\t * Native `autofocus`. Defaults to `true` for the first invalid field of\n\t\t * an enclosing {@link Form}'s `issues`, landing keyboard focus on the\n\t\t * problem with no client JavaScript; pass explicitly to override.\n\t\t */\n\t\tautoFocus?: boolean;\n\t\t/** Native `name` submitted with an enclosing form. */\n\t\tname?: string;\n\t\t/** Current value, in the platform's `\"HH:mm\"` (or `\"HH:mm:ss\"`) format, for a control a consumer tracks itself. */\n\t\tvalue?: string;\n\t\t/** Initial value, in that same format, for a control left to the platform's own uncontrolled state. */\n\t\tdefaultValue?: string;\n\t\t/** Earliest accepted time, in the same `\"HH:mm\"`/`\"HH:mm:ss\"` format. */\n\t\tmin?: string;\n\t\t/** Latest accepted time, in the same `\"HH:mm\"`/`\"HH:mm:ss\"` format. */\n\t\tmax?: string;\n\t\t/** Granularity of the accepted value, in seconds — set to `1` to surface a seconds digit alongside hours and minutes. */\n\t\tstep?: number;\n\t\t/** Marks the control required for its enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks the control inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks the control's value fixed, while keeping it focusable and included in form submission. */\n\t\treadOnly?: boolean;\n\t\t/** Native autofill hint, e.g. `\"bday\"`. */\n\t\tautoComplete?: string;\n\t\t/** Per-part styling for this wrapper's internally composed elements. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * Composes {@link Label}, a native `<input type=\"time\">` control through\n * {@link Input}, {@link Description}, and {@link FieldError} into one field,\n * computing every id and `aria-describedby` link from this identifier.\n *\n * @param handle Runtime handle carrying the root element's props and this instance's stable identifier.\n * @returns The render function producing the field's markup.\n * @example\n * <TimeField label={t(\"event.startTime.label\")} name=\"startTime\" required />\n * @example\n * <TimeField\n * \tlabel={t(\"event.reminderTime.label\")}\n * \tmin=\"09:00\"\n * \tmax=\"18:00\"\n * \tdescription={t(\"event.reminderTime.hint\")}\n * />\n * @example\n * <TimeField\n * \tlabel={t(\"event.endTime.label\")}\n * \tname=\"endTime\"\n * \tdefaultValue=\"09:00\"\n * \terrorMessage={t(\"event.endTime.beforeStart\")}\n * />\n */\nexport function TimeField(handle: Handle<TimeField.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor,\n\t\t\tlabel,\n\t\t\tdescription,\n\t\t\terrorMessage: errorMessageProp,\n\t\t\tautoFocus,\n\t\t\tname,\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tstep,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\treadOnly,\n\t\t\tautoComplete,\n\t\t\t\"aria-invalid\": ariaInvalidProp,\n\t\t\tparts,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet { errorMessage, isFirstInvalid } = resolveFieldIssue(handle, name, errorMessageProp);\n\t\tlet resolvedAutoFocus = autoFocus ?? (isFirstInvalid || undefined);\n\t\tlet { resolvedColor, resolvedInvalid, descriptionId, errorId, describedBy } =\n\t\t\tresolveFieldWiring(handle.id, {\n\t\t\t\tcolor,\n\t\t\t\terrorMessage,\n\t\t\t\tdescription,\n\t\t\t\tariaInvalid: ariaInvalidProp,\n\t\t\t});\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"time-field\" mix={mergeMix(fieldStackLayout(), mix)}>\n\t\t\t\t<Label htmlFor={handle.id} mix={parts?.label}>\n\t\t\t\t\t{label}\n\t\t\t\t</Label>\n\t\t\t\t<Input\n\t\t\t\t\tid={handle.id}\n\t\t\t\t\ttype=\"time\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\tmin={min}\n\t\t\t\t\tmax={max}\n\t\t\t\t\tstep={step}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t// oxlint-disable-next-line jsx-a11y/no-autofocus -- Not a focus grab on page load: this only ever resolves true for the first field an enclosing Form reports as invalid, so a failed submit lands the user on the problem instead of leaving them to hunt for it.\n\t\t\t\t\tautoFocus={resolvedAutoFocus}\n\t\t\t\t\taria-invalid={resolvedInvalid}\n\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\tmix={[tabularNums(), parts?.input]}\n\t\t\t\t/>\n\t\t\t\t{description ? (\n\t\t\t\t\t<Description id={descriptionId} mix={parts?.description}>\n\t\t\t\t\t\t{description}\n\t\t\t\t\t</Description>\n\t\t\t\t) : null}\n\t\t\t\t{errorMessage ? (\n\t\t\t\t\t<FieldError id={errorId} mix={parts?.error}>\n\t\t\t\t\t\t{errorMessage}\n\t\t\t\t\t</FieldError>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t);\n\t};\n}\n"
17
17
  },
18
18
  "test": null
19
19
  }