@sdxc/kit 2026.10.30 → 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 +89 -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": "pagination",
3
- "changedIn": "2026.10.24",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Pagination"
7
7
  ],
8
8
  "source": {
9
9
  "path": "pagination.tsx",
10
- "content": "/**\n * A navigation landmark for moving between pages of results, composing a\n * `<nav>` root, an `<ul>` list, and `<li>` items around two interactive\n * parts: {@link Pagination.Link} for page-number destinations and\n * {@link Pagination.Button} for previous/next controls. The active page reads\n * straight from the native `aria-current` attribute a consumer sets while\n * rendering the current page's link server-side, with no client-tracked\n * route state anywhere in this module.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, fg, outline } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor, listStyle, pointerEvents } from \"@sdxc/u/general\";\nimport { flex, gap, inlineFlex, items, justify } from \"@sdxc/u/layout\";\nimport { bs, m, minIs, p, pi } from \"@sdxc/u/size\";\nimport { active, hover, when } from \"@sdxc/u/state\";\nimport { tabularNums, text, textDecoration, weight } from \"@sdxc/u/typography\";\n\nimport type { LinkPrefetch } from \"@sdxc/ui/utils\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { prefetchAttribute, rendersPrefetchHint } from \"@sdxc/ui/utils\";\nimport {\n\twarnIfNoAccessibleLabel,\n\twarnIfNoAccessibleName,\n} from \"@sdxc/ui/utils\";\n\n/**\n * `type` given to a {@link Pagination.Button} carrying an Invoker Command, for\n * which the platform accepts no other value.\n */\nconst INVOKER_TYPE = \"button\";\n\n/** Prefetch mode {@link Pagination.Link} falls back to when `prefetch` is omitted. */\nconst DEFAULT_PREFETCH: Pagination.Prefetch = \"none\";\n\n/**\n * Prop types for {@link Pagination} and its compound parts.\n */\nexport namespace Pagination {\n\t/**\n\t * Every native `<nav>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface Props extends TagProps<\"nav\"> {}\n\n\t/**\n\t * Every native `<ul>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface ListProps extends TagProps<\"ul\"> {}\n\n\t/**\n\t * Every native `<li>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface ItemProps extends TagProps<\"li\"> {}\n\n\t/**\n\t * When a {@link Pagination.Link}'s destination starts loading, the same\n\t * modes every link component in this library accepts.\n\t */\n\texport type Prefetch = LinkPrefetch;\n\n\t/**\n\t * Every native `<a>` attribute, plus `prefetch` and the `mix` passthrough. A\n\t * type alias rather than an interface, since native anchor props resolve\n\t * through a conditional type an `interface extends` clause can't extend.\n\t */\n\texport type LinkProps = TagProps<\"a\"> & {\n\t\t/**\n\t\t * `\"intent\"`/`\"viewport\"` write `data-rmx-prefetch`; `\"render\"` adds a `<link rel=\"prefetch\">`\n\t\t * that also serves full-document navigations. The next-page link suits `\"render\"` or\n\t\t * `\"intent\"`. Defaults to {@link DEFAULT_PREFETCH}.\n\t\t */\n\t\tprefetch?: Prefetch;\n\t};\n\n\t/**\n\t * Every native `<button>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface ButtonProps extends TagProps<\"button\"> {}\n}\n\n/**\n * Renders the pagination's `<nav>` root, laying its single {@link\n * Pagination.List} child out as a centered row. In dev mode, a root missing\n * `aria-label`/`aria-labelledby` logs a `console.warn` for assistive tech.\n *\n * @param handle Runtime handle carrying the host `<nav>`'s props.\n * @returns The render function producing the navigation landmark's markup.\n * @example\n * <Pagination aria-label={t(\"pagination.label\")}>\n * \t<Pagination.List>\n * \t\t<Pagination.Item>\n * \t\t\t<Pagination.Link href=\"?page=1\" aria-current=\"page\">1</Pagination.Link>\n * \t\t</Pagination.Item>\n * \t</Pagination.List>\n * </Pagination>\n */\nexport function Pagination(handle: Handle<Pagination.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t'Pagination: needs an \"aria-label\" or \"aria-labelledby\" identifying which set of results it paginates for assistive technology.',\n\t\t);\n\n\t\treturn <nav {...rest} data-slot=\"pagination\" mix={[flex(), items(\"center\"), mix]} />;\n\t};\n}\n\n/**\n * Renders the pagination's `<ul>` list, resetting native list markers and\n * spacing and laying {@link Pagination.Item} children out as a centered row\n * with a small 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 * <Pagination.List>\n * \t<Pagination.Item>\n * \t\t<Pagination.Link href=\"?page=1\" aria-current=\"page\">1</Pagination.Link>\n * \t</Pagination.Item>\n * \t<Pagination.Item>\n * \t\t<Pagination.Link href=\"?page=2\">2</Pagination.Link>\n * \t</Pagination.Item>\n * </Pagination.List>\n */\nPagination.List = function PaginationList(handle: Handle<Pagination.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(), items(\"center\"), gap(\"0.25rem\"), m(\"0\"), p(\"0\"), listStyle(), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a single `<li>` wrapping one {@link Pagination.Link} or\n * {@link Pagination.Button}, centering its content — this element carries no\n * visual styling of its own beyond the layout needed to hold its child.\n *\n * @param handle Runtime handle carrying the host `<li>`'s props.\n * @returns The render function producing the item's markup.\n * @example\n * <Pagination.Item>\n * \t<Pagination.Link href=\"?page=3\">3</Pagination.Link>\n * </Pagination.Item>\n */\nPagination.Item = function PaginationItem(handle: Handle<Pagination.ItemProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <li {...rest} data-slot=\"item\" mix={[flex(), items(\"center\"), mix]} />;\n\t};\n};\n\n/**\n * Renders a page-number destination as a native `<a>`, followed by its\n * `<link rel=\"prefetch\">` when `prefetch=\"render\"`. `aria-current=\"page\"` fills\n * it with the active-page treatment; `aria-disabled=\"true\"` mutes it.\n *\n * @param handle Runtime handle carrying the host `<a>`'s props.\n * @returns The render function producing the link's markup.\n * @example\n * <Pagination.Link href=\"?page=6\" prefetch=\"render\">6</Pagination.Link>\n * @example\n * <Pagination.Link href=\"?page=5\" aria-current=\"page\">5</Pagination.Link>\n * @example\n * <Pagination.Link aria-disabled=\"true\">…</Pagination.Link>\n */\nPagination.Link = function PaginationLink(handle: Handle<Pagination.LinkProps>) {\n\treturn () => {\n\t\tlet { prefetch, mix, ...rest } = handle.props;\n\t\tlet resolvedPrefetch = prefetch ?? DEFAULT_PREFETCH;\n\n\t\tlet anchor = (\n\t\t\t<a\n\t\t\t\tdata-rmx-prefetch={prefetchAttribute(resolvedPrefetch)}\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"link\"\n\t\t\t\tmix={[\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tbs(\"var(--ui-pagination-control-size, 2.25rem)\"),\n\t\t\t\t\tminIs(\"var(--ui-pagination-control-size, 2.25rem)\"),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tpi(\"0.75rem\"),\n\t\t\t\t\tweight(500),\n\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\thover([bg(\"neutral.bg-tint-hover\"), fg(\"neutral.emphasis\")]),\n\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', opacity(50)),\n\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\ttabularNums(),\n\t\t\t\t\ttextDecoration(\"none\"),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', [cursor(\"not-allowed\"), pointerEvents()]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\n\t\tif (!rendersPrefetchHint(resolvedPrefetch, rest.href)) return anchor;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{anchor}\n\t\t\t\t<link rel=\"prefetch\" href={rest.href} />\n\t\t\t</>\n\t\t);\n\t};\n};\n\n/**\n * Renders a previous/next control as a native `<button>`. A control with\n * `command`/`commandfor` renders `type=\"button\"` first, since the platform's\n * ambiguity check can't see a `type` written after those attributes.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <Pagination.Button aria-label={t(\"pagination.previous\")} disabled={!hasPreviousPage}>\n * \t<ChevronLeftIcon aria-hidden />\n * </Pagination.Button>\n * @example\n * <Pagination.Button aria-label={t(\"pagination.next\")} disabled={!hasNextPage}>\n * \t<ChevronRightIcon aria-hidden />\n * </Pagination.Button>\n */\nPagination.Button = function PaginationButton(handle: Handle<Pagination.ButtonProps>) {\n\treturn () => {\n\t\tlet { type, children, mix, ...rest } = handle.props;\n\t\tlet isInvoker = rest.command !== undefined || rest.commandfor !== undefined;\n\t\tlet resolvedType = type ?? (isInvoker ? INVOKER_TYPE : undefined);\n\n\t\twarnIfNoAccessibleName(\n\t\t\thandle.props,\n\t\t\tchildren,\n\t\t\t'Pagination.Button: an icon-only control needs an \"aria-label\" describing what it does — assistive technology has no accessible text to announce otherwise.',\n\t\t);\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype={resolvedType}\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"button\"\n\t\t\t\tmix={[\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tbs(\"var(--ui-pagination-control-size, 2.25rem)\"),\n\t\t\t\t\tminIs(\"var(--ui-pagination-control-size, 2.25rem)\"),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tpi(\"0.75rem\"),\n\t\t\t\t\tweight(500),\n\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\thover([bg(\"neutral.bg-tint-hover\"), fg(\"neutral.emphasis\")]),\n\t\t\t\t\tactive(bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\twhen(\"&:disabled\", opacity(50)),\n\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\ttabularNums(),\n\t\t\t\t\twhen(\"&:disabled\", cursor(\"not-allowed\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</button>\n\t\t);\n\t};\n};\n"
10
+ "content": "/**\n * A navigation landmark for moving between pages of results, composing a\n * `<nav>` root, an `<ul>` list, and `<li>` items around two interactive\n * parts: {@link Pagination.Link} for page-number destinations and\n * {@link Pagination.Button} for previous/next controls. The active page reads\n * straight from the native `aria-current` attribute a consumer sets while\n * rendering the current page's link server-side, with no client-tracked\n * route state anywhere in this module.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, fg, outline } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor, listStyle, pointerEvents, mergeMix } from \"@sdxc/u/general\";\nimport { flex, gap, inlineFlex, items, justify } from \"@sdxc/u/layout\";\nimport { bs, m, minIs, p, pi } from \"@sdxc/u/size\";\nimport { active, hover, when } from \"@sdxc/u/state\";\nimport { tabularNums, text, textDecoration, weight } from \"@sdxc/u/typography\";\n\nimport type { LinkPrefetch } from \"@sdxc/ui/utils\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { prefetchAttribute, rendersPrefetchHint } from \"@sdxc/ui/utils\";\nimport {\n\twarnIfNoAccessibleLabel,\n\twarnIfNoAccessibleName,\n} from \"@sdxc/ui/utils\";\n\n/**\n * `type` given to a {@link Pagination.Button} carrying an Invoker Command, for\n * which the platform accepts no other value.\n */\nconst INVOKER_TYPE = \"button\";\n\n/** Prefetch mode {@link Pagination.Link} falls back to when `prefetch` is omitted. */\nconst DEFAULT_PREFETCH: Pagination.Prefetch = \"none\";\n\n/**\n * Prop types for {@link Pagination} and its compound parts.\n */\nexport namespace Pagination {\n\t/**\n\t * Every native `<nav>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface Props extends TagProps<\"nav\"> {}\n\n\t/**\n\t * Every native `<ul>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface ListProps extends TagProps<\"ul\"> {}\n\n\t/**\n\t * Every native `<li>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface ItemProps extends TagProps<\"li\"> {}\n\n\t/**\n\t * When a {@link Pagination.Link}'s destination starts loading, the same\n\t * modes every link component in this library accepts.\n\t */\n\texport type Prefetch = LinkPrefetch;\n\n\t/**\n\t * Every native `<a>` attribute, plus `prefetch` and the `mix` passthrough. A\n\t * type alias rather than an interface, since native anchor props resolve\n\t * through a conditional type an `interface extends` clause can't extend.\n\t */\n\texport type LinkProps = TagProps<\"a\"> & {\n\t\t/**\n\t\t * `\"intent\"`/`\"viewport\"` write `data-rmx-prefetch`; `\"render\"` adds a `<link rel=\"prefetch\">`\n\t\t * that also serves full-document navigations. The next-page link suits `\"render\"` or\n\t\t * `\"intent\"`. Defaults to {@link DEFAULT_PREFETCH}.\n\t\t */\n\t\tprefetch?: Prefetch;\n\t};\n\n\t/**\n\t * Every native `<button>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface ButtonProps extends TagProps<\"button\"> {}\n}\n\n/**\n * Renders the pagination's `<nav>` root, laying its single {@link\n * Pagination.List} child out as a centered row. In dev mode, a root missing\n * `aria-label`/`aria-labelledby` logs a `console.warn` for assistive tech.\n *\n * @param handle Runtime handle carrying the host `<nav>`'s props.\n * @returns The render function producing the navigation landmark's markup.\n * @example\n * <Pagination aria-label={t(\"pagination.label\")}>\n * \t<Pagination.List>\n * \t\t<Pagination.Item>\n * \t\t\t<Pagination.Link href=\"?page=1\" aria-current=\"page\">1</Pagination.Link>\n * \t\t</Pagination.Item>\n * \t</Pagination.List>\n * </Pagination>\n */\nexport function Pagination(handle: Handle<Pagination.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t'Pagination: needs an \"aria-label\" or \"aria-labelledby\" identifying which set of results it paginates for assistive technology.',\n\t\t);\n\n\t\treturn <nav {...rest} data-slot=\"pagination\" mix={mergeMix([flex(), items(\"center\")], mix)} />;\n\t};\n}\n\n/**\n * Renders the pagination's `<ul>` list, resetting native list markers and\n * spacing and laying {@link Pagination.Item} children out as a centered row\n * with a small 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 * <Pagination.List>\n * \t<Pagination.Item>\n * \t\t<Pagination.Link href=\"?page=1\" aria-current=\"page\">1</Pagination.Link>\n * \t</Pagination.Item>\n * \t<Pagination.Item>\n * \t\t<Pagination.Link href=\"?page=2\">2</Pagination.Link>\n * \t</Pagination.Item>\n * </Pagination.List>\n */\nPagination.List = function PaginationList(handle: Handle<Pagination.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(), items(\"center\"), gap(\"0.25rem\"), m(\"0\"), p(\"0\"), listStyle()], mix)}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a single `<li>` wrapping one {@link Pagination.Link} or\n * {@link Pagination.Button}, centering its content — this element carries no\n * visual styling of its own beyond the layout needed to hold its child.\n *\n * @param handle Runtime handle carrying the host `<li>`'s props.\n * @returns The render function producing the item's markup.\n * @example\n * <Pagination.Item>\n * \t<Pagination.Link href=\"?page=3\">3</Pagination.Link>\n * </Pagination.Item>\n */\nPagination.Item = function PaginationItem(handle: Handle<Pagination.ItemProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <li {...rest} data-slot=\"item\" mix={mergeMix([flex(), items(\"center\")], mix)} />;\n\t};\n};\n\n/**\n * Renders a page-number destination as a native `<a>`, followed by its\n * `<link rel=\"prefetch\">` when `prefetch=\"render\"`. `aria-current=\"page\"` fills\n * it with the active-page treatment; `aria-disabled=\"true\"` mutes it.\n *\n * @param handle Runtime handle carrying the host `<a>`'s props.\n * @returns The render function producing the link's markup.\n * @example\n * <Pagination.Link href=\"?page=6\" prefetch=\"render\">6</Pagination.Link>\n * @example\n * <Pagination.Link href=\"?page=5\" aria-current=\"page\">5</Pagination.Link>\n * @example\n * <Pagination.Link aria-disabled=\"true\">…</Pagination.Link>\n */\nPagination.Link = function PaginationLink(handle: Handle<Pagination.LinkProps>) {\n\treturn () => {\n\t\tlet { prefetch, mix, ...rest } = handle.props;\n\t\tlet resolvedPrefetch = prefetch ?? DEFAULT_PREFETCH;\n\n\t\tlet anchor = (\n\t\t\t<a\n\t\t\t\tdata-rmx-prefetch={prefetchAttribute(resolvedPrefetch)}\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"link\"\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\tinlineFlex(),\n\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\t\tbs(\"var(--ui-pagination-control-size, 2.25rem)\"),\n\t\t\t\t\t\tminIs(\"var(--ui-pagination-control-size, 2.25rem)\"),\n\t\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\t\tpi(\"0.75rem\"),\n\t\t\t\t\t\tweight(500),\n\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\thover([bg(\"neutral.bg-tint-hover\"), fg(\"neutral.emphasis\")]),\n\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t\twhen('&[aria-disabled=\"true\"]', opacity(50)),\n\t\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\t\ttabularNums(),\n\t\t\t\t\t\ttextDecoration(\"none\"),\n\t\t\t\t\t\twhen('&[aria-disabled=\"true\"]', [cursor(\"not-allowed\"), pointerEvents()]),\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 (!rendersPrefetchHint(resolvedPrefetch, rest.href)) return anchor;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{anchor}\n\t\t\t\t<link rel=\"prefetch\" href={rest.href} />\n\t\t\t</>\n\t\t);\n\t};\n};\n\n/**\n * Renders a previous/next control as a native `<button>`. A control with\n * `command`/`commandfor` renders `type=\"button\"` first, since the platform's\n * ambiguity check can't see a `type` written after those attributes.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <Pagination.Button aria-label={t(\"pagination.previous\")} disabled={!hasPreviousPage}>\n * \t<ChevronLeftIcon aria-hidden />\n * </Pagination.Button>\n * @example\n * <Pagination.Button aria-label={t(\"pagination.next\")} disabled={!hasNextPage}>\n * \t<ChevronRightIcon aria-hidden />\n * </Pagination.Button>\n */\nPagination.Button = function PaginationButton(handle: Handle<Pagination.ButtonProps>) {\n\treturn () => {\n\t\tlet { type, children, mix, ...rest } = handle.props;\n\t\tlet isInvoker = rest.command !== undefined || rest.commandfor !== undefined;\n\t\tlet resolvedType = type ?? (isInvoker ? INVOKER_TYPE : undefined);\n\n\t\twarnIfNoAccessibleName(\n\t\t\thandle.props,\n\t\t\tchildren,\n\t\t\t'Pagination.Button: an icon-only control needs an \"aria-label\" describing what it does — assistive technology has no accessible text to announce otherwise.',\n\t\t);\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype={resolvedType}\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"button\"\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\tinlineFlex(),\n\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\t\tbs(\"var(--ui-pagination-control-size, 2.25rem)\"),\n\t\t\t\t\t\tminIs(\"var(--ui-pagination-control-size, 2.25rem)\"),\n\t\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\t\tpi(\"0.75rem\"),\n\t\t\t\t\t\tweight(500),\n\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\thover([bg(\"neutral.bg-tint-hover\"), fg(\"neutral.emphasis\")]),\n\t\t\t\t\t\tactive(bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t\twhen(\"&:disabled\", opacity(50)),\n\t\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\t\ttabularNums(),\n\t\t\t\t\t\twhen(\"&:disabled\", cursor(\"not-allowed\")),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</button>\n\t\t);\n\t};\n};\n"
11
11
  },
12
12
  "test": {
13
13
  "path": "pagination.test.tsx",
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "popover",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Popover"
7
7
  ],
8
8
  "source": {
9
9
  "path": "popover.tsx",
10
- "content": "/**\n * A floating surface anchored to whatever element opened it, built entirely\n * on the native Popover API: the host carries the `popover` attribute and\n * opens through `popovertarget` or a Command Invoker (`commandfor`/\n * `command=\"toggle-popover\"`) elsewhere on the page, with no positioning\n * logic running in script. Placement rides CSS anchor positioning, using\n * the invoker relationship as an implicit anchor and the `data-placement`\n * attribute to pick which `position-area` it resolves against.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { raw } from \"@sdxc/u/general\";\nimport { inset, positionArea, positionTryFallbacks } from \"@sdxc/u/layout\";\nimport { m, marginLeft, marginRight, mbe, mbs } from \"@sdxc/u/size\";\nimport { data, when } from \"@sdxc/u/state\";\n\nimport type { AnchorPlacement } from \"@sdxc/ui/utils\";\n\nimport { floatingSurface } from \"@sdxc/ui/styles\";\n\n/**\n * Side of the anchor {@link Popover} renders against when `placement` is\n * left unset.\n */\nconst DEFAULT_PLACEMENT: Popover.Placement = \"bottom\";\n\n/**\n * `popover` attribute mode applied when a consumer leaves it unset, giving\n * the host light-dismiss behavior: it closes on outside click or Escape, and\n * showing it closes any other `\"auto\"` popover already open.\n */\nconst DEFAULT_MODE: NonNullable<Popover.Props[\"popover\"]> = \"auto\";\n\n/**\n * Prop types for {@link Popover}.\n */\nexport namespace Popover {\n\t/**\n\t * Side of the anchor the host renders against, and, for the four corner\n\t * variants, which anchor edge it aligns to along the perpendicular axis.\n\t * Each name is a physical viewport side, fixed under any `dir` value.\n\t */\n\texport type Placement = AnchorPlacement;\n\n\t/**\n\t * Every native `<div>` attribute, plus the `mix` passthrough, with `id`\n\t * narrowed to required, since `popovertarget`, `commandfor`, and the host's\n\t * own implicit CSS anchor reference all target it by that id.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"id\" | \"popover\"> {\n\t\t/** Stable id an invoker elsewhere on the page targets to open this host. */\n\t\tid: string;\n\t\t/**\n\t\t * `popover` attribute mode: `\"auto\"` dismisses on outside click or Escape\n\t\t * and closes sibling `\"auto\"` popovers when shown; `\"hint\"` layers over an\n\t\t * open one without closing it; `\"manual\"` closes only when hidden explicitly.\n\t\t *\n\t\t * @default {@link DEFAULT_MODE}\n\t\t */\n\t\tpopover?: \"auto\" | \"hint\" | \"manual\";\n\t\t/** Side of the anchor to render against. Defaults to {@link DEFAULT_PLACEMENT}. */\n\t\tplacement?: Placement;\n\t\t/** The popover's content. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders the floating surface itself: a `popover`-attributed `<div>`\n * positioned via CSS anchor positioning. The invoker that opens it becomes\n * the implicit anchor its `position-area` resolves against.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the surface's markup.\n * @example\n * <button commandfor=\"account-menu\" command=\"toggle-popover\">{t(\"nav.account\")}</button>\n * <Popover id=\"account-menu\" placement=\"bottom-start\">\n * \t<p>{t(\"nav.accountMenu.body\")}</p>\n * </Popover>\n * @example\n * <Popover id=\"filters\" placement=\"top\" mix={[fade({ duration: durations.normal })]}>\n * \t<OverlayArrow placement=\"top\">\n * \t\t<svg width={12} height={12} viewBox=\"0 0 12 12\">\n * \t\t\t<path d=\"M0 0 L6 6 L12 0\" />\n * \t\t</svg>\n * \t</OverlayArrow>\n * \t{content}\n * </Popover>\n */\nexport function Popover(handle: Handle<Popover.Props>) {\n\treturn () => {\n\t\tlet { id, popover, placement, children, mix, ...rest } = handle.props;\n\t\tlet resolvedMode = popover ?? DEFAULT_MODE;\n\t\tlet resolvedPlacement = placement ?? DEFAULT_PLACEMENT;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={id}\n\t\t\t\tpopover={resolvedMode}\n\t\t\t\tdata-placement={resolvedPlacement}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tfloatingSurface(),\n\t\t\t\t\tm(\"0\"),\n\t\t\t\t\tinset(\"auto\"),\n\t\t\t\t\twhen('&[data-placement^=\"top\"]', mbe(\"var(--ui-popover-offset, 0.5rem)\")),\n\t\t\t\t\twhen('&[data-placement^=\"bottom\"]', mbs(\"var(--ui-popover-offset, 0.5rem)\")),\n\t\t\t\t\twhen('&[data-placement^=\"left\"]', marginRight(\"var(--ui-popover-offset, 0.5rem)\")),\n\t\t\t\t\twhen('&[data-placement^=\"right\"]', marginLeft(\"var(--ui-popover-offset, 0.5rem)\")),\n\t\t\t\t\tpositionTryFallbacks(\"flip-block\", \"flip-inline\", \"flip-block flip-inline\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * A corner placement aligns one pair of edges and grows away from it, so the surface\n\t\t\t\t\t * occupies the anchor's own track and spans the one beyond it, flush with the anchor's edge.\n\t\t\t\t\t */\n\t\t\t\t\tdata(\"placement\", \"top\", positionArea(\"top\")),\n\t\t\t\t\tdata(\"placement\", \"top-start\", positionArea(\"top span-right\")),\n\t\t\t\t\tdata(\"placement\", \"top-end\", positionArea(\"top span-left\")),\n\t\t\t\t\tdata(\"placement\", \"bottom\", positionArea(\"bottom\")),\n\t\t\t\t\tdata(\"placement\", \"bottom-start\", positionArea(\"bottom span-right\")),\n\t\t\t\t\tdata(\"placement\", \"bottom-end\", positionArea(\"bottom span-left\")),\n\t\t\t\t\tdata(\"placement\", \"left\", positionArea(\"left\")),\n\t\t\t\t\tdata(\"placement\", \"left-start\", positionArea(\"left span-bottom\")),\n\t\t\t\t\tdata(\"placement\", \"left-end\", positionArea(\"left span-top\")),\n\t\t\t\t\tdata(\"placement\", \"right\", positionArea(\"right\")),\n\t\t\t\t\tdata(\"placement\", \"right-start\", positionArea(\"right span-bottom\")),\n\t\t\t\t\tdata(\"placement\", \"right-end\", positionArea(\"right span-top\")),\n\t\t\t\t\t/**\n\t\t\t\t\t * Layout parts on this surface set `display` and beat the UA's closed `display: none`, so\n\t\t\t\t\t * the closed state is important to outrank a consumer's later sublayer. A `\"hint\"` surface\n\t\t\t\t\t * reveals itself from CSS state on its trigger, so it keeps its own hidden state.\n\t\t\t\t\t */\n\t\t\t\t\twhen('&:not(:popover-open):not([popover=\"hint\"])', raw({ display: \"none !important\" })),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n}\n"
10
+ "content": "/**\n * A floating surface anchored to whatever element opened it, built entirely\n * on the native Popover API: the host carries the `popover` attribute and\n * opens through `popovertarget` or a Command Invoker (`commandfor`/\n * `command=\"toggle-popover\"`) elsewhere on the page, with no positioning\n * logic running in script. Placement rides CSS anchor positioning, using\n * the invoker relationship as an implicit anchor and the `data-placement`\n * attribute to pick which `position-area` it resolves against.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { raw, mergeMix } from \"@sdxc/u/general\";\nimport { inset, positionArea, positionTryFallbacks } from \"@sdxc/u/layout\";\nimport { m, marginLeft, marginRight, mbe, mbs } from \"@sdxc/u/size\";\nimport { data, when } from \"@sdxc/u/state\";\n\nimport type { AnchorPlacement } from \"@sdxc/ui/utils\";\n\nimport { floatingSurface } from \"@sdxc/ui/styles\";\n\n/**\n * Side of the anchor {@link Popover} renders against when `placement` is\n * left unset.\n */\nconst DEFAULT_PLACEMENT: Popover.Placement = \"bottom\";\n\n/**\n * `popover` attribute mode applied when a consumer leaves it unset, giving\n * the host light-dismiss behavior: it closes on outside click or Escape, and\n * showing it closes any other `\"auto\"` popover already open.\n */\nconst DEFAULT_MODE: NonNullable<Popover.Props[\"popover\"]> = \"auto\";\n\n/**\n * Prop types for {@link Popover}.\n */\nexport namespace Popover {\n\t/**\n\t * Side of the anchor the host renders against, and, for the four corner\n\t * variants, which anchor edge it aligns to along the perpendicular axis.\n\t * Each name is a physical viewport side, fixed under any `dir` value.\n\t */\n\texport type Placement = AnchorPlacement;\n\n\t/**\n\t * Every native `<div>` attribute, plus the `mix` passthrough, with `id`\n\t * narrowed to required, since `popovertarget`, `commandfor`, and the host's\n\t * own implicit CSS anchor reference all target it by that id.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"id\" | \"popover\"> {\n\t\t/** Stable id an invoker elsewhere on the page targets to open this host. */\n\t\tid: string;\n\t\t/**\n\t\t * `popover` attribute mode: `\"auto\"` dismisses on outside click or Escape\n\t\t * and closes sibling `\"auto\"` popovers when shown; `\"hint\"` layers over an\n\t\t * open one without closing it; `\"manual\"` closes only when hidden explicitly.\n\t\t *\n\t\t * @default {@link DEFAULT_MODE}\n\t\t */\n\t\tpopover?: \"auto\" | \"hint\" | \"manual\";\n\t\t/** Side of the anchor to render against. Defaults to {@link DEFAULT_PLACEMENT}. */\n\t\tplacement?: Placement;\n\t\t/** The popover's content. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders the floating surface itself: a `popover`-attributed `<div>`\n * positioned via CSS anchor positioning. The invoker that opens it becomes\n * the implicit anchor its `position-area` resolves against.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the surface's markup.\n * @example\n * <button commandfor=\"account-menu\" command=\"toggle-popover\">{t(\"nav.account\")}</button>\n * <Popover id=\"account-menu\" placement=\"bottom-start\">\n * \t<p>{t(\"nav.accountMenu.body\")}</p>\n * </Popover>\n * @example\n * <Popover id=\"filters\" placement=\"top\" mix={[fade({ duration: durations.normal })]}>\n * \t<OverlayArrow placement=\"top\">\n * \t\t<svg width={12} height={12} viewBox=\"0 0 12 12\">\n * \t\t\t<path d=\"M0 0 L6 6 L12 0\" />\n * \t\t</svg>\n * \t</OverlayArrow>\n * \t{content}\n * </Popover>\n */\nexport function Popover(handle: Handle<Popover.Props>) {\n\treturn () => {\n\t\tlet { id, popover, placement, children, mix, ...rest } = handle.props;\n\t\tlet resolvedMode = popover ?? DEFAULT_MODE;\n\t\tlet resolvedPlacement = placement ?? DEFAULT_PLACEMENT;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={id}\n\t\t\t\tpopover={resolvedMode}\n\t\t\t\tdata-placement={resolvedPlacement}\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tfloatingSurface(),\n\t\t\t\t\t\tm(\"0\"),\n\t\t\t\t\t\tinset(\"auto\"),\n\t\t\t\t\t\twhen('&[data-placement^=\"top\"]', mbe(\"var(--ui-popover-offset, 0.5rem)\")),\n\t\t\t\t\t\twhen('&[data-placement^=\"bottom\"]', mbs(\"var(--ui-popover-offset, 0.5rem)\")),\n\t\t\t\t\t\twhen('&[data-placement^=\"left\"]', marginRight(\"var(--ui-popover-offset, 0.5rem)\")),\n\t\t\t\t\t\twhen('&[data-placement^=\"right\"]', marginLeft(\"var(--ui-popover-offset, 0.5rem)\")),\n\t\t\t\t\t\tpositionTryFallbacks(\"flip-block\", \"flip-inline\", \"flip-block flip-inline\"),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * A corner placement aligns one pair of edges and grows away from it, so the surface\n\t\t\t\t\t\t * occupies the anchor's own track and spans the one beyond it, flush with the anchor's edge.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tdata(\"placement\", \"top\", positionArea(\"top\")),\n\t\t\t\t\t\tdata(\"placement\", \"top-start\", positionArea(\"top span-right\")),\n\t\t\t\t\t\tdata(\"placement\", \"top-end\", positionArea(\"top span-left\")),\n\t\t\t\t\t\tdata(\"placement\", \"bottom\", positionArea(\"bottom\")),\n\t\t\t\t\t\tdata(\"placement\", \"bottom-start\", positionArea(\"bottom span-right\")),\n\t\t\t\t\t\tdata(\"placement\", \"bottom-end\", positionArea(\"bottom span-left\")),\n\t\t\t\t\t\tdata(\"placement\", \"left\", positionArea(\"left\")),\n\t\t\t\t\t\tdata(\"placement\", \"left-start\", positionArea(\"left span-bottom\")),\n\t\t\t\t\t\tdata(\"placement\", \"left-end\", positionArea(\"left span-top\")),\n\t\t\t\t\t\tdata(\"placement\", \"right\", positionArea(\"right\")),\n\t\t\t\t\t\tdata(\"placement\", \"right-start\", positionArea(\"right span-bottom\")),\n\t\t\t\t\t\tdata(\"placement\", \"right-end\", positionArea(\"right span-top\")),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Layout parts on this surface set `display` and beat the UA's closed `display: none`, so\n\t\t\t\t\t\t * the closed state is important to outrank a consumer's later sublayer. A `\"hint\"` surface\n\t\t\t\t\t\t * reveals itself from CSS state on its trigger, so it keeps its own hidden state.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen('&:not(:popover-open):not([popover=\"hint\"])', raw({ display: \"none !important\" })),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{children}\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": "progress-bar",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "ProgressBar"
7
7
  ],
8
8
  "source": {
9
9
  "path": "progress-bar.tsx",
10
- "content": "/**\n * A styled native `<progress>` control paired with an optional value label,\n * stacked in a single column so a caption can sit alongside the bar it\n * describes. The indicator's track and fill read entirely from the control's\n * own `value`/`max` attributes and its native `:indeterminate` state, so a\n * value-less indicator already renders as busy with zero library JavaScript.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, border, fg } from \"@sdxc/u/color\";\nimport { rounded, transition, transitionDuration } from \"@sdxc/u/effects\";\nimport { appearance, block, flex, flexCol, gap } from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { media } from \"@sdxc/u/responsive\";\nimport { bs, is, m, p } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { tabularNums, text } from \"@sdxc/u/typography\";\n\nimport { warnIfNoAccessibleLabel } from \"@sdxc/ui/utils\";\n\n/** Native `max` value {@link ProgressBar.Indicator} falls back to when `max` is omitted, so a bare `value` reads as a percentage without passing `max={100}` every time. */\nconst DEFAULT_MAX = 100;\n\n/**\n * Prop types for {@link ProgressBar} and its compound parts.\n */\nexport namespace ProgressBar {\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * The root only supplies the column layout stacking {@link\n\t * ProgressBar.Indicator} and {@link ProgressBar.ValueLabel}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<progress>` attribute, unchanged, plus the `mix`\n\t * passthrough. Leaving `value` unset renders the indeterminate state;\n\t * `max` defaults to {@link DEFAULT_MAX}.\n\t */\n\texport interface IndicatorProps extends TagProps<\"progress\"> {}\n\n\t/**\n\t * Every native `<span>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface ValueLabelProps extends TagProps<\"span\"> {}\n}\n\n/**\n * Renders the root column: a `<div>` stacking {@link ProgressBar.Indicator}\n * and an optional {@link ProgressBar.ValueLabel}, carrying no ARIA of its\n * own since the `<progress>` inside already exposes progressbar semantics.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the root column's markup.\n * @example\n * <ProgressBar>\n * \t<ProgressBar.Indicator value={70} max={100} aria-label={t(\"upload.progress\")} />\n * \t<ProgressBar.ValueLabel>{t(\"upload.percent\", { value: 70 })}</ProgressBar.ValueLabel>\n * </ProgressBar>\n */\nexport function ProgressBar(handle: Handle<ProgressBar.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <div {...rest} mix={[flex(), flexCol(), gap(\"0.25rem\"), mix]} />;\n\t};\n}\n\n/**\n * Renders the busy/progress indicator: a native `<progress>` restyled as a\n * pill track. Firefox paints from the host itself, so track and fill colors\n * mirror onto the `::-webkit-*`/`::-moz-*` pseudo-elements each engine paints.\n *\n * @param handle Runtime handle carrying the host `<progress>`'s props.\n * @returns The render function producing the indicator's markup.\n * @example\n * <ProgressBar.Indicator value={70} max={100} aria-label={t(\"upload.progress\")} />\n * @example\n * <ProgressBar.Indicator aria-label={t(\"upload.progress\")} mix={[shimmer()]} />\n */\nProgressBar.Indicator = function ProgressBarIndicator(handle: Handle<ProgressBar.IndicatorProps>) {\n\treturn () => {\n\t\tlet { mix, max, ...rest } = handle.props;\n\t\tlet resolvedMax = max ?? DEFAULT_MAX;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t\"ProgressBar.Indicator: a progress indicator with no `aria-label` or `aria-labelledby` needs one describing what it tracks — assistive technology has no accessible name to announce otherwise.\",\n\t\t);\n\n\t\treturn (\n\t\t\t<progress\n\t\t\t\tmax={resolvedMax}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tappearance(),\n\t\t\t\t\tblock(),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\tbs(\"var(--ui-progress-bar-block-size, 0.5rem)\"),\n\t\t\t\t\tm(\"0\"),\n\t\t\t\t\tp(\"0\"),\n\t\t\t\t\toverflow(\"hidden\"),\n\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\tbg(\"neutral.border\"),\n\t\t\t\t\twhen(\"&::-webkit-progress-bar\", [bg(\"neutral.border\"), rounded(\"full\")]),\n\t\t\t\t\twhen(\"&::-webkit-progress-value\", [\n\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\ttransition(\"all\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\"&::-moz-progress-bar\", [bg(\"brand.solid\"), rounded(\"full\"), transition(\"all\")]),\n\t\t\t\t\tborder(\"none\"),\n\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", [\n\t\t\t\t\t\twhen(\"&::-webkit-progress-value\", transitionDuration(\"0s\")),\n\t\t\t\t\t\twhen(\"&::-moz-progress-bar\", 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\t};\n};\n\n/**\n * Renders the indicator's caption: a `<span>` sized as a small run of body\n * copy in the neutral muted foreground color, for a percentage or status\n * string placed alongside {@link ProgressBar.Indicator}.\n *\n * @param handle Runtime handle carrying the host `<span>`'s props.\n * @returns The render function producing the value label's markup.\n * @example\n * <ProgressBar.ValueLabel>{t(\"upload.percent\", { value: 70 })}</ProgressBar.ValueLabel>\n */\nProgressBar.ValueLabel = function ProgressBarValueLabel(\n\thandle: Handle<ProgressBar.ValueLabelProps>,\n) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <span {...rest} mix={[fg(\"neutral\"), text(\"sm\"), tabularNums(), mix]} />;\n\t};\n};\n"
10
+ "content": "/**\n * A styled native `<progress>` control paired with an optional value label,\n * stacked in a single column so a caption can sit alongside the bar it\n * describes. The indicator's track and fill read entirely from the control's\n * own `value`/`max` attributes and its native `:indeterminate` state, so a\n * value-less indicator already renders as busy with zero library JavaScript.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, border, fg } from \"@sdxc/u/color\";\nimport { rounded, transition, transitionDuration } from \"@sdxc/u/effects\";\nimport { mergeMix } from \"@sdxc/u/general\";\nimport { appearance, block, flex, flexCol, gap } from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { media } from \"@sdxc/u/responsive\";\nimport { bs, is, m, p } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { tabularNums, text } from \"@sdxc/u/typography\";\n\nimport { warnIfNoAccessibleLabel } from \"@sdxc/ui/utils\";\n\n/** Native `max` value {@link ProgressBar.Indicator} falls back to when `max` is omitted, so a bare `value` reads as a percentage without passing `max={100}` every time. */\nconst DEFAULT_MAX = 100;\n\n/**\n * Prop types for {@link ProgressBar} and its compound parts.\n */\nexport namespace ProgressBar {\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * The root only supplies the column layout stacking {@link\n\t * ProgressBar.Indicator} and {@link ProgressBar.ValueLabel}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<progress>` attribute, unchanged, plus the `mix`\n\t * passthrough. Leaving `value` unset renders the indeterminate state;\n\t * `max` defaults to {@link DEFAULT_MAX}.\n\t */\n\texport interface IndicatorProps extends TagProps<\"progress\"> {}\n\n\t/**\n\t * Every native `<span>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface ValueLabelProps extends TagProps<\"span\"> {}\n}\n\n/**\n * Renders the root column: a `<div>` stacking {@link ProgressBar.Indicator}\n * and an optional {@link ProgressBar.ValueLabel}, carrying no ARIA of its\n * own since the `<progress>` inside already exposes progressbar semantics.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the root column's markup.\n * @example\n * <ProgressBar>\n * \t<ProgressBar.Indicator value={70} max={100} aria-label={t(\"upload.progress\")} />\n * \t<ProgressBar.ValueLabel>{t(\"upload.percent\", { value: 70 })}</ProgressBar.ValueLabel>\n * </ProgressBar>\n */\nexport function ProgressBar(handle: Handle<ProgressBar.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <div {...rest} mix={mergeMix([flex(), flexCol(), gap(\"0.25rem\")], mix)} />;\n\t};\n}\n\n/**\n * Renders the busy/progress indicator: a native `<progress>` restyled as a\n * pill track. Firefox paints from the host itself, so track and fill colors\n * mirror onto the `::-webkit-*`/`::-moz-*` pseudo-elements each engine paints.\n *\n * @param handle Runtime handle carrying the host `<progress>`'s props.\n * @returns The render function producing the indicator's markup.\n * @example\n * <ProgressBar.Indicator value={70} max={100} aria-label={t(\"upload.progress\")} />\n * @example\n * <ProgressBar.Indicator aria-label={t(\"upload.progress\")} mix={[shimmer()]} />\n */\nProgressBar.Indicator = function ProgressBarIndicator(handle: Handle<ProgressBar.IndicatorProps>) {\n\treturn () => {\n\t\tlet { mix, max, ...rest } = handle.props;\n\t\tlet resolvedMax = max ?? DEFAULT_MAX;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t\"ProgressBar.Indicator: a progress indicator with no `aria-label` or `aria-labelledby` needs one describing what it tracks — assistive technology has no accessible name to announce otherwise.\",\n\t\t);\n\n\t\treturn (\n\t\t\t<progress\n\t\t\t\tmax={resolvedMax}\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tappearance(),\n\t\t\t\t\t\tblock(),\n\t\t\t\t\t\tis(\"full\"),\n\t\t\t\t\t\tbs(\"var(--ui-progress-bar-block-size, 0.5rem)\"),\n\t\t\t\t\t\tm(\"0\"),\n\t\t\t\t\t\tp(\"0\"),\n\t\t\t\t\t\toverflow(\"hidden\"),\n\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\tbg(\"neutral.border\"),\n\t\t\t\t\t\twhen(\"&::-webkit-progress-bar\", [bg(\"neutral.border\"), rounded(\"full\")]),\n\t\t\t\t\t\twhen(\"&::-webkit-progress-value\", [\n\t\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\t\ttransition(\"all\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen(\"&::-moz-progress-bar\", [bg(\"brand.solid\"), rounded(\"full\"), transition(\"all\")]),\n\t\t\t\t\t\tborder(\"none\"),\n\t\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", [\n\t\t\t\t\t\t\twhen(\"&::-webkit-progress-value\", transitionDuration(\"0s\")),\n\t\t\t\t\t\t\twhen(\"&::-moz-progress-bar\", transitionDuration(\"0s\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders the indicator's caption: a `<span>` sized as a small run of body\n * copy in the neutral muted foreground color, for a percentage or status\n * string placed alongside {@link ProgressBar.Indicator}.\n *\n * @param handle Runtime handle carrying the host `<span>`'s props.\n * @returns The render function producing the value label's markup.\n * @example\n * <ProgressBar.ValueLabel>{t(\"upload.percent\", { value: 70 })}</ProgressBar.ValueLabel>\n */\nProgressBar.ValueLabel = function ProgressBarValueLabel(\n\thandle: Handle<ProgressBar.ValueLabelProps>,\n) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <span {...rest} mix={mergeMix([fg(\"neutral\"), text(\"sm\"), tabularNums()], mix)} />;\n\t};\n};\n"
11
11
  },
12
12
  "test": null
13
13
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "radio-group",
3
- "changedIn": "2026.10.2",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "RadioGroup"
7
7
  ],
8
8
  "source": {
9
9
  "path": "radio-group.tsx",
10
- "content": "/**\n * A set of mutually exclusive options built from native `<input\n * type=\"radio\">` controls sharing one grouping name, rendered as a\n * `role=\"radiogroup\"` host wrapping a run of {@link RadioGroup.Radio}\n * instances. Each option pairs a visually hidden native input — carrying\n * every focus, keyboard, and form-submission semantic the platform already\n * provides — with a styled visual indicator that reads the input's own\n * `:checked` and `:focus-visible` states through sibling selectors.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { visuallyHidden } from \"@sdxc/u/a11y\";\nimport { bg, border, fg, outline } from \"@sdxc/u/color\";\nimport { opacity, rounded, transition } from \"@sdxc/u/effects\";\nimport { cursor, pseudoContent } from \"@sdxc/u/general\";\nimport { flex, flexCol, flexRow, gap, items, justify, relative, shrink } from \"@sdxc/u/layout\";\nimport { bs, is } from \"@sdxc/u/size\";\nimport { after, precededBy, when } from \"@sdxc/u/state\";\nimport { scale } from \"@sdxc/u/transform\";\nimport { text } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\n/**\n * `role=\"radiogroup\"` applied through {@link attrs} unless a consumer\n * supplies its own `role`, announcing the host as a radio group landmark to\n * assistive technology.\n */\nconst DEFAULT_ROLE = \"radiogroup\";\n\n/**\n * Default {@link RadioGroup.Props} orientation, applied when `orientation`\n * is omitted, laying options out in a single column.\n */\nconst DEFAULT_ORIENTATION: RadioGroup.Orientation = \"vertical\";\n\n/**\n * Prop types for {@link RadioGroup} and its {@link RadioGroup.Radio}\n * compound part.\n */\nexport namespace RadioGroup {\n\t/**\n\t * Axis a group's options lay out along: a single column, or a single row.\n\t */\n\texport type Orientation = \"horizontal\" | \"vertical\";\n\n\t/**\n\t * Value {@link RadioGroup} stores in component context so every\n\t * {@link RadioGroup.Radio} nested inside shares the same native grouping\n\t * name without a consumer repeating it on each option.\n\t */\n\texport interface Context {\n\t\t/** Shared `name` every {@link RadioGroup.Radio} reads unless it sets its own. */\n\t\tname: string;\n\t}\n\n\t/**\n\t * Props accepted by {@link RadioGroup}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Native grouping name shared by every {@link RadioGroup.Radio} nested\n\t\t * inside. Defaults to the group's own {@link Handle.id | stable\n\t\t * instance id} so options group correctly without a consumer setting one.\n\t\t */\n\t\tname?: string;\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 RadioGroup.Radio}.\n\t */\n\texport interface RadioProps extends Omit<TagProps<\"label\">, \"children\"> {\n\t\t/** Value submitted with the enclosing form when this option is selected. */\n\t\tvalue: string;\n\t\t/**\n\t\t * Native grouping name for this option's underlying input. Defaults to\n\t\t * the name provided by the nearest ancestor {@link RadioGroup} — set\n\t\t * this only to opt a single option out of its group's shared name.\n\t\t */\n\t\tname?: string;\n\t\t/** Whether this option starts selected, for a form that leaves selection tracking to the browser. */\n\t\tdefaultChecked?: boolean;\n\t\t/** Whether this option is selected, for a form that tracks selection itself. */\n\t\tchecked?: boolean;\n\t\t/** Whether this option is inert and excluded from the group's tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks the enclosing native radio group as requiring one option selected. */\n\t\trequired?: boolean;\n\t\t/** The option's visible label text, associated with the input by native nesting. */\n\t\tchildren?: RemixNode;\n\t\t/**\n\t\t * Per-part styling for the option's hidden `input` and visible\n\t\t * `indicator` elements, layered after each part's own built-in styling.\n\t\t * Use the `mix` prop instead to style the option's outer `<label>` host.\n\t\t */\n\t\tparts?: {\n\t\t\t/** Additional mixin(s) applied to the hidden native `<input type=\"radio\">`. */\n\t\t\tinput?: TagProps<\"input\">[\"mix\"];\n\t\t\t/** Additional mixin(s) applied to the visible indicator `<span>`. */\n\t\t\tindicator?: TagProps<\"span\">[\"mix\"];\n\t\t};\n\t}\n}\n\n/**\n * Renders the group host: a `role=\"radiogroup\"` `<div>` laying its\n * {@link RadioGroup.Radio} options in a column, or a row when\n * `orientation` is `\"horizontal\"`, giving every option a shared, stable `name`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props and providing {@link RadioGroup.Context}.\n * @returns The render function producing the group's markup.\n * @example\n * <RadioGroup aria-label={t(\"shipping.method\")}>\n * \t<RadioGroup.Radio value=\"standard\">{t(\"shipping.standard\")}</RadioGroup.Radio>\n * \t<RadioGroup.Radio value=\"express\">{t(\"shipping.express\")}</RadioGroup.Radio>\n * </RadioGroup>\n * @example\n * <RadioGroup aria-label={t(\"size.label\")} orientation=\"horizontal\">\n * \t<RadioGroup.Radio value=\"sm\">{t(\"size.small\")}</RadioGroup.Radio>\n * \t<RadioGroup.Radio value=\"md\">{t(\"size.medium\")}</RadioGroup.Radio>\n * \t<RadioGroup.Radio value=\"lg\">{t(\"size.large\")}</RadioGroup.Radio>\n * </RadioGroup>\n */\nexport function RadioGroup(handle: Handle<RadioGroup.Props, RadioGroup.Context>) {\n\treturn () => {\n\t\tlet { name, orientation, mix, ...rest } = handle.props;\n\t\tlet resolvedName = name ?? handle.id;\n\t\tlet resolvedOrientation = orientation ?? DEFAULT_ORIENTATION;\n\n\t\thandle.context.set({ name: resolvedName });\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-orientation={resolvedOrientation}\n\t\t\t\taria-orientation={resolvedOrientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_ROLE }),\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\twhen('&[data-orientation=\"horizontal\"]', flexRow()),\n\t\t\t\t\tgap(\"0.5rem\"),\n\t\t\t\t\twhen('&[data-orientation=\"horizontal\"]', gap(\"1rem\")),\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 option: a `<label>` pairing a hidden native `<input\n * type=\"radio\">` with a styled indicator driven by its checked, focus, and\n * disabled state; add `ariaChecked()` via `parts.input` for `aria-checked`.\n *\n * @param handle Runtime handle carrying the host `<label>`'s props.\n * @returns The render function producing the option's markup.\n * @example\n * <RadioGroup.Radio value=\"dog\">{t(\"pet.dog\")}</RadioGroup.Radio>\n * @example\n * <RadioGroup.Radio value=\"cat\" defaultChecked>{t(\"pet.cat\")}</RadioGroup.Radio>\n * @example\n * <RadioGroup.Radio value=\"hamster\" disabled>{t(\"pet.hamster\")}</RadioGroup.Radio>\n */\nRadioGroup.Radio = function RadioGroupRadio(handle: Handle<RadioGroup.RadioProps>) {\n\treturn () => {\n\t\tlet {\n\t\t\tvalue,\n\t\t\tname,\n\t\t\tchecked,\n\t\t\tdefaultChecked,\n\t\t\tdisabled,\n\t\t\trequired,\n\t\t\tchildren,\n\t\t\tparts,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet context = handle.context.get(RadioGroup);\n\t\tlet resolvedName = name ?? context.name;\n\n\t\treturn (\n\t\t\t<label\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\twhen(\"&:has(input:disabled)\", [cursor(\"not-allowed\"), opacity(50)]),\n\t\t\t\t\tgap(\"0.5rem\"),\n\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\tid={handle.id}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tname={resolvedName}\n\t\t\t\t\tchecked={checked}\n\t\t\t\t\tdefaultChecked={defaultChecked}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tmix={[visuallyHidden(), parts?.input]}\n\t\t\t\t/>\n\t\t\t\t<span\n\t\t\t\t\tdata-slot=\"indicator\"\n\t\t\t\t\tmix={[\n\t\t\t\t\t\trelative(),\n\t\t\t\t\t\tflex(),\n\t\t\t\t\t\tshrink(),\n\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\t\tis(\"var(--ui-radio-size, 1.25rem)\"),\n\t\t\t\t\t\tbs(\"var(--ui-radio-size, 1.25rem)\"),\n\t\t\t\t\t\tafter([\n\t\t\t\t\t\t\tis(\"var(--ui-radio-mark-size, 0.625rem)\"),\n\t\t\t\t\t\t\tbs(\"var(--ui-radio-mark-size, 0.625rem)\"),\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(\"transform\"),\n\t\t\t\t\t\t\tpseudoContent('\"\"'),\n\t\t\t\t\t\t\tscale(0),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\tborder({ color: \"neutral.strong\", width: 2 }),\n\t\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\t\ttransition(\"background-color, border-color\"),\n\t\t\t\t\t\tprecededBy(\"input:checked\", after(scale(1))),\n\t\t\t\t\t\tprecededBy(\"input:checked\", [border(\"brand.solid\"), bg(\"brand.solid\")]),\n\t\t\t\t\t\tprecededBy(\"input:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t\tparts?.indicator,\n\t\t\t\t\t]}\n\t\t\t\t/>\n\t\t\t\t{children}\n\t\t\t</label>\n\t\t);\n\t};\n};\n"
10
+ "content": "/**\n * A set of mutually exclusive options built from native `<input\n * type=\"radio\">` controls sharing one grouping name, rendered as a\n * `role=\"radiogroup\"` host wrapping a run of {@link RadioGroup.Radio}\n * instances. Each option pairs a visually hidden native input — carrying\n * every focus, keyboard, and form-submission semantic the platform already\n * provides — with a styled visual indicator that reads the input's own\n * `:checked` and `:focus-visible` states through sibling selectors.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { visuallyHidden } from \"@sdxc/u/a11y\";\nimport { bg, border, fg, outline } from \"@sdxc/u/color\";\nimport { opacity, rounded, transition } from \"@sdxc/u/effects\";\nimport { cursor, pseudoContent, mergeMix } from \"@sdxc/u/general\";\nimport { flex, flexCol, flexRow, gap, items, justify, relative, shrink } from \"@sdxc/u/layout\";\nimport { bs, is } from \"@sdxc/u/size\";\nimport { after, precededBy, when } from \"@sdxc/u/state\";\nimport { scale } from \"@sdxc/u/transform\";\nimport { text } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\n/**\n * `role=\"radiogroup\"` applied through {@link attrs} unless a consumer\n * supplies its own `role`, announcing the host as a radio group landmark to\n * assistive technology.\n */\nconst DEFAULT_ROLE = \"radiogroup\";\n\n/**\n * Default {@link RadioGroup.Props} orientation, applied when `orientation`\n * is omitted, laying options out in a single column.\n */\nconst DEFAULT_ORIENTATION: RadioGroup.Orientation = \"vertical\";\n\n/**\n * Prop types for {@link RadioGroup} and its {@link RadioGroup.Radio}\n * compound part.\n */\nexport namespace RadioGroup {\n\t/**\n\t * Axis a group's options lay out along: a single column, or a single row.\n\t */\n\texport type Orientation = \"horizontal\" | \"vertical\";\n\n\t/**\n\t * Value {@link RadioGroup} stores in component context so every\n\t * {@link RadioGroup.Radio} nested inside shares the same native grouping\n\t * name without a consumer repeating it on each option.\n\t */\n\texport interface Context {\n\t\t/** Shared `name` every {@link RadioGroup.Radio} reads unless it sets its own. */\n\t\tname: string;\n\t}\n\n\t/**\n\t * Props accepted by {@link RadioGroup}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Native grouping name shared by every {@link RadioGroup.Radio} nested\n\t\t * inside. Defaults to the group's own {@link Handle.id | stable\n\t\t * instance id} so options group correctly without a consumer setting one.\n\t\t */\n\t\tname?: string;\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 RadioGroup.Radio}.\n\t */\n\texport interface RadioProps extends Omit<TagProps<\"label\">, \"children\"> {\n\t\t/** Value submitted with the enclosing form when this option is selected. */\n\t\tvalue: string;\n\t\t/**\n\t\t * Native grouping name for this option's underlying input. Defaults to\n\t\t * the name provided by the nearest ancestor {@link RadioGroup} — set\n\t\t * this only to opt a single option out of its group's shared name.\n\t\t */\n\t\tname?: string;\n\t\t/** Whether this option starts selected, for a form that leaves selection tracking to the browser. */\n\t\tdefaultChecked?: boolean;\n\t\t/** Whether this option is selected, for a form that tracks selection itself. */\n\t\tchecked?: boolean;\n\t\t/** Whether this option is inert and excluded from the group's tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks the enclosing native radio group as requiring one option selected. */\n\t\trequired?: boolean;\n\t\t/** The option's visible label text, associated with the input by native nesting. */\n\t\tchildren?: RemixNode;\n\t\t/**\n\t\t * Per-part styling for the option's hidden `input` and visible\n\t\t * `indicator` elements, layered after each part's own built-in styling.\n\t\t * Use the `mix` prop instead to style the option's outer `<label>` host.\n\t\t */\n\t\tparts?: {\n\t\t\t/** Additional mixin(s) applied to the hidden native `<input type=\"radio\">`. */\n\t\t\tinput?: TagProps<\"input\">[\"mix\"];\n\t\t\t/** Additional mixin(s) applied to the visible indicator `<span>`. */\n\t\t\tindicator?: TagProps<\"span\">[\"mix\"];\n\t\t};\n\t}\n}\n\n/**\n * Renders the group host: a `role=\"radiogroup\"` `<div>` laying its\n * {@link RadioGroup.Radio} options in a column, or a row when\n * `orientation` is `\"horizontal\"`, giving every option a shared, stable `name`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props and providing {@link RadioGroup.Context}.\n * @returns The render function producing the group's markup.\n * @example\n * <RadioGroup aria-label={t(\"shipping.method\")}>\n * \t<RadioGroup.Radio value=\"standard\">{t(\"shipping.standard\")}</RadioGroup.Radio>\n * \t<RadioGroup.Radio value=\"express\">{t(\"shipping.express\")}</RadioGroup.Radio>\n * </RadioGroup>\n * @example\n * <RadioGroup aria-label={t(\"size.label\")} orientation=\"horizontal\">\n * \t<RadioGroup.Radio value=\"sm\">{t(\"size.small\")}</RadioGroup.Radio>\n * \t<RadioGroup.Radio value=\"md\">{t(\"size.medium\")}</RadioGroup.Radio>\n * \t<RadioGroup.Radio value=\"lg\">{t(\"size.large\")}</RadioGroup.Radio>\n * </RadioGroup>\n */\nexport function RadioGroup(handle: Handle<RadioGroup.Props, RadioGroup.Context>) {\n\treturn () => {\n\t\tlet { name, orientation, mix, ...rest } = handle.props;\n\t\tlet resolvedName = name ?? handle.id;\n\t\tlet resolvedOrientation = orientation ?? DEFAULT_ORIENTATION;\n\n\t\thandle.context.set({ name: resolvedName });\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-orientation={resolvedOrientation}\n\t\t\t\taria-orientation={resolvedOrientation}\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tattrs({ role: DEFAULT_ROLE }),\n\t\t\t\t\t\tflex(),\n\t\t\t\t\t\tflexCol(),\n\t\t\t\t\t\twhen('&[data-orientation=\"horizontal\"]', flexRow()),\n\t\t\t\t\t\tgap(\"0.5rem\"),\n\t\t\t\t\t\twhen('&[data-orientation=\"horizontal\"]', gap(\"1rem\")),\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 option: a `<label>` pairing a hidden native `<input\n * type=\"radio\">` with a styled indicator driven by its checked, focus, and\n * disabled state; add `ariaChecked()` via `parts.input` for `aria-checked`.\n *\n * @param handle Runtime handle carrying the host `<label>`'s props.\n * @returns The render function producing the option's markup.\n * @example\n * <RadioGroup.Radio value=\"dog\">{t(\"pet.dog\")}</RadioGroup.Radio>\n * @example\n * <RadioGroup.Radio value=\"cat\" defaultChecked>{t(\"pet.cat\")}</RadioGroup.Radio>\n * @example\n * <RadioGroup.Radio value=\"hamster\" disabled>{t(\"pet.hamster\")}</RadioGroup.Radio>\n */\nRadioGroup.Radio = function RadioGroupRadio(handle: Handle<RadioGroup.RadioProps>) {\n\treturn () => {\n\t\tlet {\n\t\t\tvalue,\n\t\t\tname,\n\t\t\tchecked,\n\t\t\tdefaultChecked,\n\t\t\tdisabled,\n\t\t\trequired,\n\t\t\tchildren,\n\t\t\tparts,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet context = handle.context.get(RadioGroup);\n\t\tlet resolvedName = name ?? context.name;\n\n\t\treturn (\n\t\t\t<label\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tflex(),\n\t\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\t\twhen(\"&:has(input:disabled)\", [cursor(\"not-allowed\"), opacity(50)]),\n\t\t\t\t\t\tgap(\"0.5rem\"),\n\t\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\tid={handle.id}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tname={resolvedName}\n\t\t\t\t\tchecked={checked}\n\t\t\t\t\tdefaultChecked={defaultChecked}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tmix={[visuallyHidden(), parts?.input]}\n\t\t\t\t/>\n\t\t\t\t<span\n\t\t\t\t\tdata-slot=\"indicator\"\n\t\t\t\t\tmix={[\n\t\t\t\t\t\trelative(),\n\t\t\t\t\t\tflex(),\n\t\t\t\t\t\tshrink(),\n\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\t\tis(\"var(--ui-radio-size, 1.25rem)\"),\n\t\t\t\t\t\tbs(\"var(--ui-radio-size, 1.25rem)\"),\n\t\t\t\t\t\tafter([\n\t\t\t\t\t\t\tis(\"var(--ui-radio-mark-size, 0.625rem)\"),\n\t\t\t\t\t\t\tbs(\"var(--ui-radio-mark-size, 0.625rem)\"),\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(\"transform\"),\n\t\t\t\t\t\t\tpseudoContent('\"\"'),\n\t\t\t\t\t\t\tscale(0),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\tborder({ color: \"neutral.strong\", width: 2 }),\n\t\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\t\ttransition(\"background-color, border-color\"),\n\t\t\t\t\t\tprecededBy(\"input:checked\", after(scale(1))),\n\t\t\t\t\t\tprecededBy(\"input:checked\", [border(\"brand.solid\"), bg(\"brand.solid\")]),\n\t\t\t\t\t\tprecededBy(\"input:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t\tparts?.indicator,\n\t\t\t\t\t]}\n\t\t\t\t/>\n\t\t\t\t{children}\n\t\t\t</label>\n\t\t);\n\t};\n};\n"
11
11
  },
12
12
  "test": null
13
13
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "range-calendar",
3
- "changedIn": "2026.10.20",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [
5
5
  "calendar",
6
6
  "input"
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "source": {
12
12
  "path": "range-calendar.tsx",
13
- "content": "/**\n * A calendar surface for choosing a start and end date as one connected\n * range, sharing every header, grid, and row part with {@link Calendar} and\n * layering range position on top of its day cell. Used bare, with no\n * composed children, it renders a pair of native `<input type=\"date\">`\n * fields instead — start and end, each independently keyboard-operable —\n * ready for the `calendarKeys()`/`rangePreview()` mixins a consumer attaches\n * to turn the composed grid into a live, drag- or arrow-key-extended range.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, fg } from \"@sdxc/u/color\";\nimport { roundedCorner } from \"@sdxc/u/effects\";\nimport { flex, gap, items } from \"@sdxc/u/layout\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { Calendar } from \"@sdxc/ui/calendar\";\nimport { Input } from \"@sdxc/ui/input\";\n\n/** Semantic color role {@link RangeCalendar}'s bare fallback pair falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: RangeCalendar.Color = \"neutral\";\n\n/**\n * Prop types for {@link RangeCalendar} and its compound parts. Every part\n * but {@link RangeCalendar.Cell} aliases {@link Calendar}'s matching part,\n * sharing its header, grid, and row markup.\n */\nexport namespace RangeCalendar {\n\t/**\n\t * Semantic color role for the bare fallback pair's keyboard focus rings,\n\t * mapped to `--ui-*` variables like {@link Calendar.Color}. The composed\n\t * grid's day cells always use fixed semantic roles, regardless of this value.\n\t */\n\texport type Color = Calendar.Color;\n\n\t/**\n\t * Per-part styling for the bare fallback pair's two internally composed\n\t * inputs, layered after each input's own built-in styling. Style the\n\t * composed grid's parts through {@link Calendar}'s own compound parts.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the bare fallback's start-date input, rendered through {@link Input}. */\n\t\tstart?: TagProps<\"input\">[\"mix\"];\n\t\t/** Styling for the bare fallback's end-date input, rendered through {@link Input}. */\n\t\tend?: TagProps<\"input\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link RangeCalendar}. Composing\n\t * {@link RangeCalendar.Header} and {@link RangeCalendar.Grid} as `children`\n\t * renders the visual month surface; omitting `children` renders a bare native `<input type=\"date\">` pair from the fields below.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Semantic color role for the bare fallback pair's focus rings. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/** Native `name` submitted with an enclosing form, read only by the bare fallback's start-date input. */\n\t\tstartName?: string;\n\t\t/** Native `name` submitted with an enclosing form, read only by the bare fallback's end-date input. */\n\t\tendName?: string;\n\t\t/** Current start-of-range value, in `YYYY-MM-DD` form, for a bare fallback pair a consumer tracks itself. */\n\t\tstartValue?: string;\n\t\t/** Current end-of-range value, in `YYYY-MM-DD` form, for a bare fallback pair a consumer tracks itself. */\n\t\tendValue?: string;\n\t\t/** Initial start-of-range value, in `YYYY-MM-DD` form, for a bare fallback pair left to the platform's own uncontrolled state. */\n\t\tstartDefaultValue?: string;\n\t\t/** Initial end-of-range value, in `YYYY-MM-DD` form, for a bare fallback pair left to the platform's own uncontrolled state. */\n\t\tendDefaultValue?: string;\n\t\t/** Earliest accepted date, in `YYYY-MM-DD` form, read by both of the bare fallback pair's inputs. */\n\t\tmin?: string;\n\t\t/** Latest accepted date, in `YYYY-MM-DD` form, read by both of the bare fallback pair's inputs. */\n\t\tmax?: string;\n\t\t/** Granularity, in days, both of the bare fallback pair's values must fall on. */\n\t\tstep?: number;\n\t\t/** Marks both of the bare fallback pair's inputs required for their enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks both of the bare fallback pair's inputs inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks both of the bare fallback pair's inputs' values fixed, while keeping them focusable and included in form submission. */\n\t\treadOnly?: boolean;\n\t\t/** Native autofill hint for both of the bare fallback pair's inputs, e.g. `\"bday\"`. */\n\t\tautoComplete?: string;\n\t\t/** Accessible label for the bare fallback pair's start-date input. Read only when `children` is unset. */\n\t\tstartLabel?: string;\n\t\t/** Accessible label for the bare fallback pair's end-date input. Read only when `children` is unset. */\n\t\tendLabel?: string;\n\t\t/** Per-part styling for the bare fallback pair's internally composed inputs. */\n\t\tparts?: PartsProps;\n\t}\n\n\t/** Every prop {@link Calendar.HeaderProps} accepts, unchanged. */\n\texport interface HeaderProps extends Calendar.HeaderProps {}\n\n\t/** Every prop {@link Calendar.PreviousButtonProps} accepts, unchanged. */\n\texport interface PreviousButtonProps extends Calendar.PreviousButtonProps {}\n\n\t/** Every prop {@link Calendar.NextButtonProps} accepts, unchanged. */\n\texport interface NextButtonProps extends Calendar.NextButtonProps {}\n\n\t/** Every prop {@link Calendar.HeadingProps} accepts, unchanged. */\n\texport interface HeadingProps extends Calendar.HeadingProps {}\n\n\t/** Every prop {@link Calendar.GridProps} accepts, unchanged. */\n\texport interface GridProps extends Calendar.GridProps {}\n\n\t/** Every prop {@link Calendar.GridHeaderProps} accepts, unchanged. */\n\texport interface GridHeaderProps extends Calendar.GridHeaderProps {}\n\n\t/** Every prop {@link Calendar.RowProps} accepts, unchanged. */\n\texport interface RowProps extends Calendar.RowProps {}\n\n\t/** Every prop {@link Calendar.HeaderCellProps} accepts, unchanged. */\n\texport interface HeaderCellProps extends Calendar.HeaderCellProps {}\n\n\t/** Every prop {@link Calendar.GridBodyProps} accepts, unchanged. */\n\texport interface GridBodyProps extends Calendar.GridBodyProps {}\n\n\t/**\n\t * Every prop {@link Calendar.CellProps} accepts, unchanged. Set\n\t * `data-selection-start` on the range's first day, `data-selection-end`\n\t * on its last, and `aria-selected=\"true\"` alone on the days between — each read straight off what the consumer sets on this instance.\n\t */\n\texport interface CellProps extends Calendar.CellProps {}\n}\n\n/**\n * Renders {@link RangeCalendar}'s root through {@link Calendar}. Composing\n * {@link RangeCalendar.Header} and {@link RangeCalendar.Grid} as `children`\n * renders the visual month surface; omitting `children` renders a bare, script-free native `<input type=\"date\">` pair from this instance's own fields.\n *\n * @param handle Runtime handle carrying the root element's props.\n * @returns The render function producing the range calendar's markup.\n * @example\n * <RangeCalendar startLabel={t(\"form.stay.checkIn\")} endLabel={t(\"form.stay.checkOut\")} startName=\"checkIn\" endName=\"checkOut\" />\n * @example\n * <RangeCalendar aria-label={t(\"calendar.label\")}>\n * \t<RangeCalendar.Header>\n * \t\t<RangeCalendar.PreviousButton aria-label={t(\"calendar.previous\")} />\n * \t\t<RangeCalendar.Heading>{monthLabel}</RangeCalendar.Heading>\n * \t\t<RangeCalendar.NextButton aria-label={t(\"calendar.next\")} />\n * \t</RangeCalendar.Header>\n * \t<RangeCalendar.Grid aria-label={monthLabel}>\n * \t\t<RangeCalendar.GridHeader>\n * \t\t\t<RangeCalendar.Row>\n * \t\t\t\t{weekdayLabels.map((day) => (\n * \t\t\t\t\t<RangeCalendar.HeaderCell key={day}>{day}</RangeCalendar.HeaderCell>\n * \t\t\t\t))}\n * \t\t\t</RangeCalendar.Row>\n * \t\t</RangeCalendar.GridHeader>\n * \t\t<RangeCalendar.GridBody>\n * \t\t\t{weeks.map((week) => (\n * \t\t\t\t<RangeCalendar.Row key={week[0].iso}>\n * \t\t\t\t\t{week.map((day) => (\n * \t\t\t\t\t\t<RangeCalendar.Cell\n * \t\t\t\t\t\t\tkey={day.iso}\n * \t\t\t\t\t\t\taria-selected={day.inRange ? \"true\" : undefined}\n * \t\t\t\t\t\t\tdata-selection-start={day.iso === range.start ? \"\" : undefined}\n * \t\t\t\t\t\t\tdata-selection-end={day.iso === range.end ? \"\" : undefined}\n * \t\t\t\t\t\t>\n * \t\t\t\t\t\t\t{day.label}\n * \t\t\t\t\t\t</RangeCalendar.Cell>\n * \t\t\t\t\t))}\n * \t\t\t\t</RangeCalendar.Row>\n * \t\t\t))}\n * \t\t</RangeCalendar.GridBody>\n * \t</RangeCalendar.Grid>\n * </RangeCalendar>\n */\nexport function RangeCalendar(handle: Handle<RangeCalendar.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor,\n\t\t\tstartName,\n\t\t\tendName,\n\t\t\tstartValue,\n\t\t\tendValue,\n\t\t\tstartDefaultValue,\n\t\t\tendDefaultValue,\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tstep,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\treadOnly,\n\t\t\tautoComplete,\n\t\t\tstartLabel,\n\t\t\tendLabel,\n\t\t\tparts,\n\t\t\tchildren,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\tif (import.meta.env?.DEV && !children) {\n\t\t\tif (!startLabel) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'RangeCalendar: falling back to a plain \"input type=date\" pair needs a \"startLabel\" describing the range\\'s start for assistive technology.',\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!endLabel) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'RangeCalendar: falling back to a plain \"input type=date\" pair needs an \"endLabel\" describing the range\\'s end for assistive technology.',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t<Calendar {...rest} mix={mix}>\n\t\t\t\t{children ?? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tdata-slot=\"fields\"\n\t\t\t\t\t\tmix={[attrs({ role: \"group\" }), flex(), items(\"center\"), gap(\"0.5rem\")]}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\ttype=\"date\"\n\t\t\t\t\t\t\tdata-slot=\"start-input\"\n\t\t\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\t\t\tname={startName}\n\t\t\t\t\t\t\tvalue={startValue}\n\t\t\t\t\t\t\tdefaultValue={startDefaultValue}\n\t\t\t\t\t\t\tmin={min}\n\t\t\t\t\t\t\tmax={max}\n\t\t\t\t\t\t\tstep={step}\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t\t\taria-label={startLabel}\n\t\t\t\t\t\t\tmix={parts?.start}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\ttype=\"date\"\n\t\t\t\t\t\t\tdata-slot=\"end-input\"\n\t\t\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\t\t\tname={endName}\n\t\t\t\t\t\t\tvalue={endValue}\n\t\t\t\t\t\t\tdefaultValue={endDefaultValue}\n\t\t\t\t\t\t\tmin={min}\n\t\t\t\t\t\t\tmax={max}\n\t\t\t\t\t\t\tstep={step}\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t\t\taria-label={endLabel}\n\t\t\t\t\t\t\tmix={parts?.end}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Calendar>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link RangeCalendar.HeaderProps.children} as the nav row: identical\n * to {@link Calendar.Header}, since {@link RangeCalendar} reuses\n * {@link Calendar}'s grid markup for its own header.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the nav row's markup.\n * @example\n * <RangeCalendar.Header>\n * \t<RangeCalendar.PreviousButton aria-label={t(\"calendar.previous\")} />\n * \t<RangeCalendar.Heading>{monthLabel}</RangeCalendar.Heading>\n * \t<RangeCalendar.NextButton aria-label={t(\"calendar.next\")} />\n * </RangeCalendar.Header>\n */\nRangeCalendar.Header = Calendar.Header;\n\n/**\n * Renders a control standing for \"show the previous month\": identical to\n * {@link Calendar.PreviousButton}.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <RangeCalendar.PreviousButton aria-label={t(\"calendar.previous\")} />\n */\nRangeCalendar.PreviousButton = Calendar.PreviousButton;\n\n/**\n * Renders a control standing for \"show the following month\": identical to\n * {@link Calendar.NextButton}.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <RangeCalendar.NextButton aria-label={t(\"calendar.next\")} />\n */\nRangeCalendar.NextButton = Calendar.NextButton;\n\n/**\n * Renders the calendar's visible month/year caption: identical to\n * {@link Calendar.Heading}.\n *\n * @param handle Runtime handle carrying the host heading element's props.\n * @returns The render function producing the caption's markup.\n * @example\n * <RangeCalendar.Heading>{monthLabel}</RangeCalendar.Heading>\n */\nRangeCalendar.Heading = Calendar.Heading;\n\n/**\n * Renders the day grid's native `<table>` host: identical to\n * {@link Calendar.Grid}.\n *\n * @param handle Runtime handle carrying the host `<table>`'s props.\n * @returns The render function producing the grid's markup.\n * @example\n * <RangeCalendar.Grid aria-label={monthLabel}>\n * \t<RangeCalendar.GridHeader>...</RangeCalendar.GridHeader>\n * \t<RangeCalendar.GridBody>...</RangeCalendar.GridBody>\n * </RangeCalendar.Grid>\n */\nRangeCalendar.Grid = Calendar.Grid;\n\n/**\n * Renders the grid's `<thead>` host: identical to {@link Calendar.GridHeader}.\n *\n * @param handle Runtime handle carrying the host `<thead>`'s props.\n * @returns The render function producing the header section's markup.\n * @example\n * <RangeCalendar.GridHeader>\n * \t<RangeCalendar.Row>\n * \t\t<RangeCalendar.HeaderCell>{t(\"calendar.weekdays.sun\")}</RangeCalendar.HeaderCell>\n * \t</RangeCalendar.Row>\n * </RangeCalendar.GridHeader>\n */\nRangeCalendar.GridHeader = Calendar.GridHeader;\n\n/**\n * Renders a native `<tr>` host: identical to {@link Calendar.Row}. Composes\n * a row of {@link RangeCalendar.HeaderCell} inside\n * {@link RangeCalendar.GridHeader}, or a week's row of {@link RangeCalendar.Cell} inside {@link RangeCalendar.GridBody}.\n *\n * @param handle Runtime handle carrying the host `<tr>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <RangeCalendar.Row>\n * \t<RangeCalendar.Cell>{day.label}</RangeCalendar.Cell>\n * </RangeCalendar.Row>\n */\nRangeCalendar.Row = Calendar.Row;\n\n/**\n * Renders a weekday abbreviation: identical to {@link Calendar.HeaderCell}.\n *\n * @param handle Runtime handle carrying the host `<th>`'s props.\n * @returns The render function producing the weekday header's markup.\n * @example\n * <RangeCalendar.HeaderCell>{t(\"calendar.weekdays.sun\")}</RangeCalendar.HeaderCell>\n */\nRangeCalendar.HeaderCell = Calendar.HeaderCell;\n\n/**\n * Renders the grid's `<tbody>` host: identical to {@link Calendar.GridBody}.\n *\n * @param handle Runtime handle carrying the host `<tbody>`'s props.\n * @returns The render function producing the body section's markup.\n * @example\n * <RangeCalendar.GridBody>\n * \t{weeks.map((week) => (\n * \t\t<RangeCalendar.Row key={week[0].iso}>...</RangeCalendar.Row>\n * \t))}\n * </RangeCalendar.GridBody>\n */\nRangeCalendar.GridBody = Calendar.GridBody;\n\n/**\n * Renders one calendar day for {@link RangeCalendar}, building on\n * {@link Calendar.Cell}. `data-selection-start`/`data-selection-end`\n * square off each end's outer corners so the range reads as one unbroken bar, driven by whatever state the consumer sets for the `calendarKeys()`/`rangePreview()` mixins.\n *\n * @param handle Runtime handle carrying the host `<td>`'s props.\n * @returns The render function producing the day's markup.\n * @example\n * <RangeCalendar.Cell data-selection-start=\"\">{day.label}</RangeCalendar.Cell>\n * @example\n * <RangeCalendar.Cell aria-selected=\"true\">{day.label}</RangeCalendar.Cell>\n * @example\n * <RangeCalendar.Cell data-selection-end=\"\">{day.label}</RangeCalendar.Cell>\n */\nRangeCalendar.Cell = function RangeCalendarCell(handle: Handle<RangeCalendar.CellProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Calendar.Cell\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\t/**\n\t\t\t\t\t * A day is the range's opening, its closing, both at once, or one of the days\n\t\t\t\t\t * between. The four are written under selectors that match one apiece, so each\n\t\t\t\t\t * day keeps its own shape however the cascade orders the set.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"&[data-selection-start]:not([data-selection-end])\", [\n\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\troundedCorner(\"start-end\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"end-end\", \"none\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\"&[data-selection-end]:not([data-selection-start])\", [\n\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\troundedCorner(\"start-start\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"end-start\", \"none\"),\n\t\t\t\t\t]),\n\t\t\t\t\t/**\n\t\t\t\t\t * A range of one day opens and closes on itself, so it reads as a single day.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"&[data-selection-start][data-selection-end]\", [\n\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('&[aria-selected=\"true\"]:not([data-selection-start]):not([data-selection-end])', [\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The days between carry the range across the row, so the band reads as one\n\t\t\t\t\t\t * run at a glance while the two ends stay the strongest thing in the month.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tbg(\"brand.bg-tint-hover\"),\n\t\t\t\t\t\tfg(\"brand.emphasis\"),\n\t\t\t\t\t\troundedCorner(\"start-start\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"start-end\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"end-start\", \"none\"),\n\t\t\t\t\t\troundedCorner(\"end-end\", \"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"
13
+ "content": "/**\n * A calendar surface for choosing a start and end date as one connected\n * range, sharing every header, grid, and row part with {@link Calendar} and\n * layering range position on top of its day cell. Used bare, with no\n * composed children, it renders a pair of native `<input type=\"date\">`\n * fields instead — start and end, each independently keyboard-operable —\n * ready for the `calendarKeys()`/`rangePreview()` mixins a consumer attaches\n * to turn the composed grid into a live, drag- or arrow-key-extended range.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, fg } from \"@sdxc/u/color\";\nimport { roundedCorner } from \"@sdxc/u/effects\";\nimport { mergeMix } from \"@sdxc/u/general\";\nimport { flex, gap, items } from \"@sdxc/u/layout\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { Calendar } from \"@sdxc/ui/calendar\";\nimport { Input } from \"@sdxc/ui/input\";\n\n/** Semantic color role {@link RangeCalendar}'s bare fallback pair falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: RangeCalendar.Color = \"neutral\";\n\n/**\n * Prop types for {@link RangeCalendar} and its compound parts. Every part\n * but {@link RangeCalendar.Cell} aliases {@link Calendar}'s matching part,\n * sharing its header, grid, and row markup.\n */\nexport namespace RangeCalendar {\n\t/**\n\t * Semantic color role for the bare fallback pair's keyboard focus rings,\n\t * mapped to `--ui-*` variables like {@link Calendar.Color}. The composed\n\t * grid's day cells always use fixed semantic roles, regardless of this value.\n\t */\n\texport type Color = Calendar.Color;\n\n\t/**\n\t * Per-part styling for the bare fallback pair's two internally composed\n\t * inputs, layered after each input's own built-in styling. Style the\n\t * composed grid's parts through {@link Calendar}'s own compound parts.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the bare fallback's start-date input, rendered through {@link Input}. */\n\t\tstart?: TagProps<\"input\">[\"mix\"];\n\t\t/** Styling for the bare fallback's end-date input, rendered through {@link Input}. */\n\t\tend?: TagProps<\"input\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link RangeCalendar}. Composing\n\t * {@link RangeCalendar.Header} and {@link RangeCalendar.Grid} as `children`\n\t * renders the visual month surface; omitting `children` renders a bare native `<input type=\"date\">` pair from the fields below.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Semantic color role for the bare fallback pair's focus rings. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/** Native `name` submitted with an enclosing form, read only by the bare fallback's start-date input. */\n\t\tstartName?: string;\n\t\t/** Native `name` submitted with an enclosing form, read only by the bare fallback's end-date input. */\n\t\tendName?: string;\n\t\t/** Current start-of-range value, in `YYYY-MM-DD` form, for a bare fallback pair a consumer tracks itself. */\n\t\tstartValue?: string;\n\t\t/** Current end-of-range value, in `YYYY-MM-DD` form, for a bare fallback pair a consumer tracks itself. */\n\t\tendValue?: string;\n\t\t/** Initial start-of-range value, in `YYYY-MM-DD` form, for a bare fallback pair left to the platform's own uncontrolled state. */\n\t\tstartDefaultValue?: string;\n\t\t/** Initial end-of-range value, in `YYYY-MM-DD` form, for a bare fallback pair left to the platform's own uncontrolled state. */\n\t\tendDefaultValue?: string;\n\t\t/** Earliest accepted date, in `YYYY-MM-DD` form, read by both of the bare fallback pair's inputs. */\n\t\tmin?: string;\n\t\t/** Latest accepted date, in `YYYY-MM-DD` form, read by both of the bare fallback pair's inputs. */\n\t\tmax?: string;\n\t\t/** Granularity, in days, both of the bare fallback pair's values must fall on. */\n\t\tstep?: number;\n\t\t/** Marks both of the bare fallback pair's inputs required for their enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks both of the bare fallback pair's inputs inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks both of the bare fallback pair's inputs' values fixed, while keeping them focusable and included in form submission. */\n\t\treadOnly?: boolean;\n\t\t/** Native autofill hint for both of the bare fallback pair's inputs, e.g. `\"bday\"`. */\n\t\tautoComplete?: string;\n\t\t/** Accessible label for the bare fallback pair's start-date input. Read only when `children` is unset. */\n\t\tstartLabel?: string;\n\t\t/** Accessible label for the bare fallback pair's end-date input. Read only when `children` is unset. */\n\t\tendLabel?: string;\n\t\t/** Per-part styling for the bare fallback pair's internally composed inputs. */\n\t\tparts?: PartsProps;\n\t}\n\n\t/** Every prop {@link Calendar.HeaderProps} accepts, unchanged. */\n\texport interface HeaderProps extends Calendar.HeaderProps {}\n\n\t/** Every prop {@link Calendar.PreviousButtonProps} accepts, unchanged. */\n\texport interface PreviousButtonProps extends Calendar.PreviousButtonProps {}\n\n\t/** Every prop {@link Calendar.NextButtonProps} accepts, unchanged. */\n\texport interface NextButtonProps extends Calendar.NextButtonProps {}\n\n\t/** Every prop {@link Calendar.HeadingProps} accepts, unchanged. */\n\texport interface HeadingProps extends Calendar.HeadingProps {}\n\n\t/** Every prop {@link Calendar.GridProps} accepts, unchanged. */\n\texport interface GridProps extends Calendar.GridProps {}\n\n\t/** Every prop {@link Calendar.GridHeaderProps} accepts, unchanged. */\n\texport interface GridHeaderProps extends Calendar.GridHeaderProps {}\n\n\t/** Every prop {@link Calendar.RowProps} accepts, unchanged. */\n\texport interface RowProps extends Calendar.RowProps {}\n\n\t/** Every prop {@link Calendar.HeaderCellProps} accepts, unchanged. */\n\texport interface HeaderCellProps extends Calendar.HeaderCellProps {}\n\n\t/** Every prop {@link Calendar.GridBodyProps} accepts, unchanged. */\n\texport interface GridBodyProps extends Calendar.GridBodyProps {}\n\n\t/**\n\t * Every prop {@link Calendar.CellProps} accepts, unchanged. Set\n\t * `data-selection-start` on the range's first day, `data-selection-end`\n\t * on its last, and `aria-selected=\"true\"` alone on the days between — each read straight off what the consumer sets on this instance.\n\t */\n\texport interface CellProps extends Calendar.CellProps {}\n}\n\n/**\n * Renders {@link RangeCalendar}'s root through {@link Calendar}. Composing\n * {@link RangeCalendar.Header} and {@link RangeCalendar.Grid} as `children`\n * renders the visual month surface; omitting `children` renders a bare, script-free native `<input type=\"date\">` pair from this instance's own fields.\n *\n * @param handle Runtime handle carrying the root element's props.\n * @returns The render function producing the range calendar's markup.\n * @example\n * <RangeCalendar startLabel={t(\"form.stay.checkIn\")} endLabel={t(\"form.stay.checkOut\")} startName=\"checkIn\" endName=\"checkOut\" />\n * @example\n * <RangeCalendar aria-label={t(\"calendar.label\")}>\n * \t<RangeCalendar.Header>\n * \t\t<RangeCalendar.PreviousButton aria-label={t(\"calendar.previous\")} />\n * \t\t<RangeCalendar.Heading>{monthLabel}</RangeCalendar.Heading>\n * \t\t<RangeCalendar.NextButton aria-label={t(\"calendar.next\")} />\n * \t</RangeCalendar.Header>\n * \t<RangeCalendar.Grid aria-label={monthLabel}>\n * \t\t<RangeCalendar.GridHeader>\n * \t\t\t<RangeCalendar.Row>\n * \t\t\t\t{weekdayLabels.map((day) => (\n * \t\t\t\t\t<RangeCalendar.HeaderCell key={day}>{day}</RangeCalendar.HeaderCell>\n * \t\t\t\t))}\n * \t\t\t</RangeCalendar.Row>\n * \t\t</RangeCalendar.GridHeader>\n * \t\t<RangeCalendar.GridBody>\n * \t\t\t{weeks.map((week) => (\n * \t\t\t\t<RangeCalendar.Row key={week[0].iso}>\n * \t\t\t\t\t{week.map((day) => (\n * \t\t\t\t\t\t<RangeCalendar.Cell\n * \t\t\t\t\t\t\tkey={day.iso}\n * \t\t\t\t\t\t\taria-selected={day.inRange ? \"true\" : undefined}\n * \t\t\t\t\t\t\tdata-selection-start={day.iso === range.start ? \"\" : undefined}\n * \t\t\t\t\t\t\tdata-selection-end={day.iso === range.end ? \"\" : undefined}\n * \t\t\t\t\t\t>\n * \t\t\t\t\t\t\t{day.label}\n * \t\t\t\t\t\t</RangeCalendar.Cell>\n * \t\t\t\t\t))}\n * \t\t\t\t</RangeCalendar.Row>\n * \t\t\t))}\n * \t\t</RangeCalendar.GridBody>\n * \t</RangeCalendar.Grid>\n * </RangeCalendar>\n */\nexport function RangeCalendar(handle: Handle<RangeCalendar.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor,\n\t\t\tstartName,\n\t\t\tendName,\n\t\t\tstartValue,\n\t\t\tendValue,\n\t\t\tstartDefaultValue,\n\t\t\tendDefaultValue,\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tstep,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\treadOnly,\n\t\t\tautoComplete,\n\t\t\tstartLabel,\n\t\t\tendLabel,\n\t\t\tparts,\n\t\t\tchildren,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\tif (import.meta.env?.DEV && !children) {\n\t\t\tif (!startLabel) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'RangeCalendar: falling back to a plain \"input type=date\" pair needs a \"startLabel\" describing the range\\'s start for assistive technology.',\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!endLabel) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'RangeCalendar: falling back to a plain \"input type=date\" pair needs an \"endLabel\" describing the range\\'s end for assistive technology.',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t<Calendar {...rest} mix={mix}>\n\t\t\t\t{children ?? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tdata-slot=\"fields\"\n\t\t\t\t\t\tmix={[attrs({ role: \"group\" }), flex(), items(\"center\"), gap(\"0.5rem\")]}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\ttype=\"date\"\n\t\t\t\t\t\t\tdata-slot=\"start-input\"\n\t\t\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\t\t\tname={startName}\n\t\t\t\t\t\t\tvalue={startValue}\n\t\t\t\t\t\t\tdefaultValue={startDefaultValue}\n\t\t\t\t\t\t\tmin={min}\n\t\t\t\t\t\t\tmax={max}\n\t\t\t\t\t\t\tstep={step}\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t\t\taria-label={startLabel}\n\t\t\t\t\t\t\tmix={parts?.start}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\ttype=\"date\"\n\t\t\t\t\t\t\tdata-slot=\"end-input\"\n\t\t\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\t\t\tname={endName}\n\t\t\t\t\t\t\tvalue={endValue}\n\t\t\t\t\t\t\tdefaultValue={endDefaultValue}\n\t\t\t\t\t\t\tmin={min}\n\t\t\t\t\t\t\tmax={max}\n\t\t\t\t\t\t\tstep={step}\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t\t\taria-label={endLabel}\n\t\t\t\t\t\t\tmix={parts?.end}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Calendar>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link RangeCalendar.HeaderProps.children} as the nav row: identical\n * to {@link Calendar.Header}, since {@link RangeCalendar} reuses\n * {@link Calendar}'s grid markup for its own header.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the nav row's markup.\n * @example\n * <RangeCalendar.Header>\n * \t<RangeCalendar.PreviousButton aria-label={t(\"calendar.previous\")} />\n * \t<RangeCalendar.Heading>{monthLabel}</RangeCalendar.Heading>\n * \t<RangeCalendar.NextButton aria-label={t(\"calendar.next\")} />\n * </RangeCalendar.Header>\n */\nRangeCalendar.Header = Calendar.Header;\n\n/**\n * Renders a control standing for \"show the previous month\": identical to\n * {@link Calendar.PreviousButton}.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <RangeCalendar.PreviousButton aria-label={t(\"calendar.previous\")} />\n */\nRangeCalendar.PreviousButton = Calendar.PreviousButton;\n\n/**\n * Renders a control standing for \"show the following month\": identical to\n * {@link Calendar.NextButton}.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <RangeCalendar.NextButton aria-label={t(\"calendar.next\")} />\n */\nRangeCalendar.NextButton = Calendar.NextButton;\n\n/**\n * Renders the calendar's visible month/year caption: identical to\n * {@link Calendar.Heading}.\n *\n * @param handle Runtime handle carrying the host heading element's props.\n * @returns The render function producing the caption's markup.\n * @example\n * <RangeCalendar.Heading>{monthLabel}</RangeCalendar.Heading>\n */\nRangeCalendar.Heading = Calendar.Heading;\n\n/**\n * Renders the day grid's native `<table>` host: identical to\n * {@link Calendar.Grid}.\n *\n * @param handle Runtime handle carrying the host `<table>`'s props.\n * @returns The render function producing the grid's markup.\n * @example\n * <RangeCalendar.Grid aria-label={monthLabel}>\n * \t<RangeCalendar.GridHeader>...</RangeCalendar.GridHeader>\n * \t<RangeCalendar.GridBody>...</RangeCalendar.GridBody>\n * </RangeCalendar.Grid>\n */\nRangeCalendar.Grid = Calendar.Grid;\n\n/**\n * Renders the grid's `<thead>` host: identical to {@link Calendar.GridHeader}.\n *\n * @param handle Runtime handle carrying the host `<thead>`'s props.\n * @returns The render function producing the header section's markup.\n * @example\n * <RangeCalendar.GridHeader>\n * \t<RangeCalendar.Row>\n * \t\t<RangeCalendar.HeaderCell>{t(\"calendar.weekdays.sun\")}</RangeCalendar.HeaderCell>\n * \t</RangeCalendar.Row>\n * </RangeCalendar.GridHeader>\n */\nRangeCalendar.GridHeader = Calendar.GridHeader;\n\n/**\n * Renders a native `<tr>` host: identical to {@link Calendar.Row}. Composes\n * a row of {@link RangeCalendar.HeaderCell} inside\n * {@link RangeCalendar.GridHeader}, or a week's row of {@link RangeCalendar.Cell} inside {@link RangeCalendar.GridBody}.\n *\n * @param handle Runtime handle carrying the host `<tr>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <RangeCalendar.Row>\n * \t<RangeCalendar.Cell>{day.label}</RangeCalendar.Cell>\n * </RangeCalendar.Row>\n */\nRangeCalendar.Row = Calendar.Row;\n\n/**\n * Renders a weekday abbreviation: identical to {@link Calendar.HeaderCell}.\n *\n * @param handle Runtime handle carrying the host `<th>`'s props.\n * @returns The render function producing the weekday header's markup.\n * @example\n * <RangeCalendar.HeaderCell>{t(\"calendar.weekdays.sun\")}</RangeCalendar.HeaderCell>\n */\nRangeCalendar.HeaderCell = Calendar.HeaderCell;\n\n/**\n * Renders the grid's `<tbody>` host: identical to {@link Calendar.GridBody}.\n *\n * @param handle Runtime handle carrying the host `<tbody>`'s props.\n * @returns The render function producing the body section's markup.\n * @example\n * <RangeCalendar.GridBody>\n * \t{weeks.map((week) => (\n * \t\t<RangeCalendar.Row key={week[0].iso}>...</RangeCalendar.Row>\n * \t))}\n * </RangeCalendar.GridBody>\n */\nRangeCalendar.GridBody = Calendar.GridBody;\n\n/**\n * Renders one calendar day for {@link RangeCalendar}, building on\n * {@link Calendar.Cell}. `data-selection-start`/`data-selection-end`\n * square off each end's outer corners so the range reads as one unbroken bar, driven by whatever state the consumer sets for the `calendarKeys()`/`rangePreview()` mixins.\n *\n * @param handle Runtime handle carrying the host `<td>`'s props.\n * @returns The render function producing the day's markup.\n * @example\n * <RangeCalendar.Cell data-selection-start=\"\">{day.label}</RangeCalendar.Cell>\n * @example\n * <RangeCalendar.Cell aria-selected=\"true\">{day.label}</RangeCalendar.Cell>\n * @example\n * <RangeCalendar.Cell data-selection-end=\"\">{day.label}</RangeCalendar.Cell>\n */\nRangeCalendar.Cell = function RangeCalendarCell(handle: Handle<RangeCalendar.CellProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Calendar.Cell\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * A day is the range's opening, its closing, both at once, or one of the days\n\t\t\t\t\t\t * between. The four are written under selectors that match one apiece, so each\n\t\t\t\t\t\t * day keeps its own shape however the cascade orders the set.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen(\"&[data-selection-start]:not([data-selection-end])\", [\n\t\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\t\troundedCorner(\"start-end\", \"none\"),\n\t\t\t\t\t\t\troundedCorner(\"end-end\", \"none\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen(\"&[data-selection-end]:not([data-selection-start])\", [\n\t\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\t\troundedCorner(\"start-start\", \"none\"),\n\t\t\t\t\t\t\troundedCorner(\"end-start\", \"none\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * A range of one day opens and closes on itself, so it reads as a single day.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen(\"&[data-selection-start][data-selection-end]\", [\n\t\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[aria-selected=\"true\"]:not([data-selection-start]):not([data-selection-end])', [\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * The days between carry the range across the row, so the band reads as one\n\t\t\t\t\t\t\t * run at a glance while the two ends stay the strongest thing in the month.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tbg(\"brand.bg-tint-hover\"),\n\t\t\t\t\t\t\tfg(\"brand.emphasis\"),\n\t\t\t\t\t\t\troundedCorner(\"start-start\", \"none\"),\n\t\t\t\t\t\t\troundedCorner(\"start-end\", \"none\"),\n\t\t\t\t\t\t\troundedCorner(\"end-start\", \"none\"),\n\t\t\t\t\t\t\troundedCorner(\"end-end\", \"none\"),\n\t\t\t\t\t\t]),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
14
14
  },
15
15
  "test": null
16
16
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "scroll-area",
3
- "changedIn": "2026.10.2",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "ScrollArea"
7
7
  ],
8
8
  "source": {
9
9
  "path": "scroll-area.tsx",
10
- "content": "/**\n * A scrollable region wrapping long or overflowing content — a chat log, a\n * table, a tall list — so it scrolls its own axis inside a bordered panel\n * instead of pushing the surrounding page. {@link ScrollArea.Viewport} is the\n * element that actually scrolls; the root only supplies the panel's border\n * and rounding.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, border, outline } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { raw } from \"@sdxc/u/general\";\nimport { relative } from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { media } from \"@sdxc/u/responsive\";\nimport { bs, is } from \"@sdxc/u/size\";\nimport { data, hover, when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { panelChrome } from \"@sdxc/ui/styles\";\n\n/**\n * Native tab-stop order applied to {@link ScrollArea.Viewport} through\n * {@link attrs} unless a consumer supplies its own `tabIndex`, keeping it\n * reachable via keyboard even when none of its content is focusable.\n */\nconst DEFAULT_TAB_INDEX = 0;\n\n/**\n * Default {@link ScrollArea.Viewport} axis, applied whenever a consumer\n * omits `orientation`.\n */\nconst DEFAULT_ORIENTATION: ScrollArea.Orientation = \"vertical\";\n\n/**\n * Prop types for {@link ScrollArea} and its compound parts.\n */\nexport namespace ScrollArea {\n\t/**\n\t * Axis {@link ScrollArea.Viewport} scrolls along: only the block axis\n\t * (`\"vertical\"`), only the inline axis (`\"horizontal\"`), or both at once\n\t * (`\"both\"`).\n\t */\n\texport type Orientation = \"vertical\" | \"horizontal\" | \"both\";\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * `orientation` defaults to {@link DEFAULT_ORIENTATION}; `tabIndex` defaults\n\t * to {@link DEFAULT_TAB_INDEX}, overridable to `-1` when content is reachable.\n\t */\n\texport interface ViewportProps extends TagProps<\"div\"> {\n\t\t/** Axis the viewport scrolls along. Defaults to {@link DEFAULT_ORIENTATION}. */\n\t\torientation?: Orientation;\n\t}\n}\n\n/**\n * Renders the scroll area's outer panel: a relatively positioned, rounded,\n * bordered `<div>` that frames whatever {@link ScrollArea.Viewport} scrolls\n * inside it, staying a fixed border around the scrolling content.\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 * <ScrollArea>\n * \t<ScrollArea.Viewport>\n * \t\t<p>{t(\"changelog.body\")}</p>\n * \t</ScrollArea.Viewport>\n * </ScrollArea>\n */\nexport function ScrollArea(handle: Handle<ScrollArea.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <div {...rest} data-slot=\"scroll-area\" mix={[panelChrome(), relative(), mix]} />;\n\t};\n}\n\n/**\n * Renders the scroll area's scrolling surface: a `<div>` filling its parent\n * panel, clipping and scrolling along the axis named by `data-orientation`\n * with a thin native scrollbar that gains a focus ring when focus-visible.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the viewport's markup.\n * @example\n * <ScrollArea.Viewport>\n * \t<Table>...</Table>\n * </ScrollArea.Viewport>\n * @example\n * <ScrollArea.Viewport orientation=\"horizontal\">\n * \t<Toolbar aria-label={t(\"gallery.filmstrip\")}>...</Toolbar>\n * </ScrollArea.Viewport>\n */\nScrollArea.Viewport = function ScrollAreaViewport(handle: Handle<ScrollArea.ViewportProps>) {\n\treturn () => {\n\t\tlet { orientation, mix, ...rest } = handle.props;\n\t\tlet resolvedOrientation = orientation ?? DEFAULT_ORIENTATION;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-orientation={resolvedOrientation}\n\t\t\t\tdata-slot=\"viewport\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ tabIndex: DEFAULT_TAB_INDEX }),\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\tbs(\"full\"),\n\t\t\t\t\traw({\n\t\t\t\t\t\tscrollBehavior: \"smooth\",\n\t\t\t\t\t\tscrollbarWidth: \"thin\",\n\t\t\t\t\t\tscrollbarGutter: \"stable\",\n\t\t\t\t\t}),\n\t\t\t\t\tdata(\"orientation\", \"vertical\", raw({ overflowBlock: \"auto\", overflowInline: \"hidden\" })),\n\t\t\t\t\tdata(\n\t\t\t\t\t\t\"orientation\",\n\t\t\t\t\t\t\"horizontal\",\n\t\t\t\t\t\traw({ overflowInline: \"auto\", overflowBlock: \"hidden\" }),\n\t\t\t\t\t),\n\t\t\t\t\tdata(\"orientation\", \"both\", overflow(\"auto\")),\n\t\t\t\t\twhen(\"&::-webkit-scrollbar\", raw({ width: \"0.75rem\", height: \"0.75rem\" })),\n\t\t\t\t\twhen(\"&::-webkit-scrollbar-track\", bg(\"transparent\")),\n\t\t\t\t\twhen(\"&::-webkit-scrollbar-thumb\", [\n\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\tbg(\"neutral.border\"),\n\t\t\t\t\t\tborder({ color: \"transparent\", width: \"3px\" }),\n\t\t\t\t\t\traw({ backgroundClip: \"content-box\" }),\n\t\t\t\t\t\thover(bg(\"neutral.strong\")),\n\t\t\t\t\t]),\n\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", raw({ scrollBehavior: \"auto\" })),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
10
+ "content": "/**\n * A scrollable region wrapping long or overflowing content — a chat log, a\n * table, a tall list — so it scrolls its own axis inside a bordered panel\n * instead of pushing the surrounding page. {@link ScrollArea.Viewport} is the\n * element that actually scrolls; the root only supplies the panel's border\n * and rounding.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, border, outline } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { raw, mergeMix } from \"@sdxc/u/general\";\nimport { relative } from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { media } from \"@sdxc/u/responsive\";\nimport { bs, is } from \"@sdxc/u/size\";\nimport { data, hover, when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { panelChrome } from \"@sdxc/ui/styles\";\n\n/**\n * Native tab-stop order applied to {@link ScrollArea.Viewport} through\n * {@link attrs} unless a consumer supplies its own `tabIndex`, keeping it\n * reachable via keyboard even when none of its content is focusable.\n */\nconst DEFAULT_TAB_INDEX = 0;\n\n/**\n * Default {@link ScrollArea.Viewport} axis, applied whenever a consumer\n * omits `orientation`.\n */\nconst DEFAULT_ORIENTATION: ScrollArea.Orientation = \"vertical\";\n\n/**\n * Prop types for {@link ScrollArea} and its compound parts.\n */\nexport namespace ScrollArea {\n\t/**\n\t * Axis {@link ScrollArea.Viewport} scrolls along: only the block axis\n\t * (`\"vertical\"`), only the inline axis (`\"horizontal\"`), or both at once\n\t * (`\"both\"`).\n\t */\n\texport type Orientation = \"vertical\" | \"horizontal\" | \"both\";\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface Props extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * `orientation` defaults to {@link DEFAULT_ORIENTATION}; `tabIndex` defaults\n\t * to {@link DEFAULT_TAB_INDEX}, overridable to `-1` when content is reachable.\n\t */\n\texport interface ViewportProps extends TagProps<\"div\"> {\n\t\t/** Axis the viewport scrolls along. Defaults to {@link DEFAULT_ORIENTATION}. */\n\t\torientation?: Orientation;\n\t}\n}\n\n/**\n * Renders the scroll area's outer panel: a relatively positioned, rounded,\n * bordered `<div>` that frames whatever {@link ScrollArea.Viewport} scrolls\n * inside it, staying a fixed border around the scrolling content.\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 * <ScrollArea>\n * \t<ScrollArea.Viewport>\n * \t\t<p>{t(\"changelog.body\")}</p>\n * \t</ScrollArea.Viewport>\n * </ScrollArea>\n */\nexport function ScrollArea(handle: Handle<ScrollArea.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"scroll-area\" mix={mergeMix([panelChrome(), relative()], mix)} />\n\t\t);\n\t};\n}\n\n/**\n * Renders the scroll area's scrolling surface: a `<div>` filling its parent\n * panel, clipping and scrolling along the axis named by `data-orientation`\n * with a thin native scrollbar that gains a focus ring when focus-visible.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the viewport's markup.\n * @example\n * <ScrollArea.Viewport>\n * \t<Table>...</Table>\n * </ScrollArea.Viewport>\n * @example\n * <ScrollArea.Viewport orientation=\"horizontal\">\n * \t<Toolbar aria-label={t(\"gallery.filmstrip\")}>...</Toolbar>\n * </ScrollArea.Viewport>\n */\nScrollArea.Viewport = function ScrollAreaViewport(handle: Handle<ScrollArea.ViewportProps>) {\n\treturn () => {\n\t\tlet { orientation, mix, ...rest } = handle.props;\n\t\tlet resolvedOrientation = orientation ?? DEFAULT_ORIENTATION;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-orientation={resolvedOrientation}\n\t\t\t\tdata-slot=\"viewport\"\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tattrs({ tabIndex: DEFAULT_TAB_INDEX }),\n\t\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t\tis(\"full\"),\n\t\t\t\t\t\tbs(\"full\"),\n\t\t\t\t\t\traw({\n\t\t\t\t\t\t\tscrollBehavior: \"smooth\",\n\t\t\t\t\t\t\tscrollbarWidth: \"thin\",\n\t\t\t\t\t\t\tscrollbarGutter: \"stable\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tdata(\n\t\t\t\t\t\t\t\"orientation\",\n\t\t\t\t\t\t\t\"vertical\",\n\t\t\t\t\t\t\traw({ overflowBlock: \"auto\", overflowInline: \"hidden\" }),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tdata(\n\t\t\t\t\t\t\t\"orientation\",\n\t\t\t\t\t\t\t\"horizontal\",\n\t\t\t\t\t\t\traw({ overflowInline: \"auto\", overflowBlock: \"hidden\" }),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tdata(\"orientation\", \"both\", overflow(\"auto\")),\n\t\t\t\t\t\twhen(\"&::-webkit-scrollbar\", raw({ width: \"0.75rem\", height: \"0.75rem\" })),\n\t\t\t\t\t\twhen(\"&::-webkit-scrollbar-track\", bg(\"transparent\")),\n\t\t\t\t\t\twhen(\"&::-webkit-scrollbar-thumb\", [\n\t\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\t\tbg(\"neutral.border\"),\n\t\t\t\t\t\t\tborder({ color: \"transparent\", width: \"3px\" }),\n\t\t\t\t\t\t\traw({ backgroundClip: \"content-box\" }),\n\t\t\t\t\t\t\thover(bg(\"neutral.strong\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", raw({ scrollBehavior: \"auto\" })),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
11
11
  },
12
12
  "test": null
13
13
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "search-field",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [
5
5
  "button",
6
6
  "input"
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "source": {
12
12
  "path": "search-field.tsx",
13
- "content": "/**\n * A single-line search field: a `<search>` landmark stacking a caption, a\n * decorated control, and optional supporting or validation copy, composed\n * from whatever compound parts a given field needs. Its own\n * {@link SearchField.Input} part pairs a leading glyph with the native\n * `<input type=\"search\">` control it decorates, building on {@link Input} for\n * that control's box, color, and state styling, and\n * {@link SearchField.Control} rows that input with the\n * {@link SearchField.Clear} button that empties it.\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 { SearchIcon, XIcon } from \"@sdxc/icons\";\nimport { fg } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { pointerEvents } from \"@sdxc/u/general\";\nimport {\n\tabsolute,\n\tappearance,\n\tflex,\n\tgrow,\n\thidden,\n\tinsBs,\n\tinsIe,\n\tinsIs,\n\titems,\n\trelative,\n} from \"@sdxc/u/layout\";\nimport { bs, is, p, pis } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { translateY } from \"@sdxc/u/transform\";\n\nimport { clearField, SEARCH_FIELD_CLEAR_COMMAND } from \"@sdxc/ui/mixins\";\nimport { fieldStackLayout } from \"@sdxc/ui/styles\";\n\nimport { Button } from \"@sdxc/ui/button\";\nimport { Input } from \"@sdxc/ui/input\";\n\n/**\n * Prop types for {@link SearchField} and its compound parts.\n */\nexport namespace SearchField {\n\t/**\n\t * Every native `<search>` attribute, unchanged, plus the `mix` passthrough.\n\t * `children` composes this field's parts — typically a caption, the\n\t * {@link SearchField.Input} control, and validation copy — in a single column.\n\t */\n\texport interface Props extends TagProps<\"search\"> {\n\t\t/** The field's compound parts: a caption, the control, and any supporting or validation copy. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Every prop {@link Input} accepts except `type`, `list`, and `role`,\n\t * which this control fixes to `\"search\"` and the platform's own implicit\n\t * `searchbox` role on the consumer's behalf, plus the `mix` passthrough.\n\t */\n\texport interface InputProps extends Omit<Input.Props, \"type\" | \"list\" | \"role\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * `children` holds one control row: the {@link SearchField.Input} and the\n\t * {@link SearchField.Clear} button that empties it.\n\t */\n\texport interface ControlProps extends TagProps<\"div\"> {\n\t\t/** The row's contents: the search input, and the clear button reading it. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Every prop {@link Button} accepts except `type`, `variant`, `size`, and\n\t * `command`, which this control fixes on the consumer's behalf, plus the\n\t * `mix` passthrough.\n\t */\n\texport interface ClearProps extends Omit<\n\t\tButton.Props,\n\t\t\"type\" | \"variant\" | \"size\" | \"command\" | \"children\"\n\t> {\n\t\t/** The `id` of the input this button empties, naming the control it belongs to. */\n\t\tcommandfor: string;\n\t\t/** Glyph or label the button shows. Defaults to a decorative {@link XIcon}. */\n\t\tchildren?: RemixNode;\n\t}\n}\n\n/**\n * Renders a `<search>` landmark — the platform's own role for a search\n * region, needing no explicit `role` attribute — stacking a caption,\n * {@link SearchField.Input}, and validation copy in a single column.\n *\n * @param handle Runtime handle carrying the host `<search>`'s props.\n * @returns The render function producing the field's markup.\n * @example\n * <SearchField>\n * \t<Label htmlFor=\"site-search\">{t(\"search.label\")}</Label>\n * \t<SearchField.Input id=\"site-search\" name=\"q\" placeholder={t(\"search.placeholder\")} />\n * </SearchField>\n * @example\n * <SearchField aria-label={t(\"search.label\")}>\n * \t<SearchField.Input name=\"q\" />\n * </SearchField>\n */\nexport function SearchField(handle: Handle<SearchField.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <search {...rest} data-slot=\"search-field\" mix={[fieldStackLayout(), mix]} />;\n\t};\n}\n\n/**\n * Renders {@link SearchField}'s control: a positioning wrapper pairing a\n * muted, decorative {@link SearchIcon} with a native `<input type=\"search\">`\n * built on {@link Input}, inheriting its box, color, and state styling.\n *\n * The user agent's own cancel affordance is suppressed, so clearing the field is\n * {@link SearchField.Clear}'s job — one glyph the field styles and places, sitting\n * alone in the trailing corner.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <SearchField.Input aria-label={t(\"search.label\")} placeholder={t(\"search.placeholder\")} />\n * @example\n * <SearchField.Input name=\"q\" color=\"brand\" defaultValue=\"remix\" />\n */\nSearchField.Input = function SearchFieldInput(handle: Handle<SearchField.InputProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div data-slot=\"input-wrapper\" mix={[relative(), flex(), items(\"center\")]}>\n\t\t\t\t<SearchIcon\n\t\t\t\t\tsize={16}\n\t\t\t\t\tdata-slot=\"icon\"\n\t\t\t\t\tmix={[absolute(), insIs(\"0.75rem\"), pointerEvents(), fg(\"neutral.muted\")]}\n\t\t\t\t/>\n\t\t\t\t<Input\n\t\t\t\t\ttype=\"search\"\n\t\t\t\t\t{...rest}\n\t\t\t\t\tmix={[\n\t\t\t\t\t\tpis(\"2.25rem\"),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * {@link SearchField.Clear} draws the clear affordance, so the one the user agent draws\n\t\t\t\t\t\t * inside a search input holding a value is hidden to keep the two from stacking.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen(\"&::-webkit-search-cancel-button\", [appearance(\"none\"), hidden()]),\n\t\t\t\t\t\twhen(\"&::-webkit-search-decoration\", [appearance(\"none\"), hidden()]),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t]}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders the row holding {@link SearchField.Input} and the\n * {@link SearchField.Clear} button beside it, and the positioning context that\n * anchors the clear button to the input's trailing edge.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the control row's markup.\n * @example\n * <SearchField.Control>\n * \t<SearchField.Input id=\"site-search\" name=\"q\" />\n * \t<SearchField.Clear commandfor=\"site-search\" aria-label={t(\"search.clear\")} />\n * </SearchField.Control>\n */\nSearchField.Control = function SearchFieldControl(handle: Handle<SearchField.ControlProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"control\"\n\t\t\t\tmix={[\n\t\t\t\t\trelative(),\n\t\t\t\t\tflex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * The input spans the row, so the field keeps the width its container offers.\n\t\t\t\t\t */\n\t\t\t\t\twhen('& > [data-slot=\"input-wrapper\"]', grow()),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link SearchField}'s clear button: a round, icon-sized ghost\n * {@link Button} centred on the input's trailing edge, carrying `clearField()`\n * so it empties the `commandfor` input it names and shows while that input holds text.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the clear button's markup.\n * @example\n * <SearchField.Clear commandfor=\"site-search\" aria-label={t(\"search.clear\")} />\n * @example\n * <SearchField.Clear commandfor=\"site-search\">{t(\"search.clear\")}</SearchField.Clear>\n */\nSearchField.Clear = function SearchFieldClear(handle: Handle<SearchField.ClearProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\ttype=\"button\"\n\t\t\t\t{...rest}\n\t\t\t\thidden\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\tcommand={SEARCH_FIELD_CLEAR_COMMAND}\n\t\t\t\tdata-slot=\"clear\"\n\t\t\t\tmix={[\n\t\t\t\t\tclearField(),\n\t\t\t\t\t/**\n\t\t\t\t\t * A round, icon-sized target centred on the field, so its hover tint reads as a\n\t\t\t\t\t * disc beside the text, and its glyph sits as far from the trailing edge as the\n\t\t\t\t\t * search glyph sits from the leading one.\n\t\t\t\t\t */\n\t\t\t\t\tis(7),\n\t\t\t\t\tbs(7),\n\t\t\t\t\tp(0),\n\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\tabsolute(),\n\t\t\t\t\tinsIe(\"0.375rem\"),\n\t\t\t\t\tinsBs(\"50%\"),\n\t\t\t\t\ttranslateY(\"-50%\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children ?? <XIcon size={16} />}\n\t\t\t</Button>\n\t\t);\n\t};\n};\n"
13
+ "content": "/**\n * A single-line search field: a `<search>` landmark stacking a caption, a\n * decorated control, and optional supporting or validation copy, composed\n * from whatever compound parts a given field needs. Its own\n * {@link SearchField.Input} part pairs a leading glyph with the native\n * `<input type=\"search\">` control it decorates, building on {@link Input} for\n * that control's box, color, and state styling, and\n * {@link SearchField.Control} rows that input with the\n * {@link SearchField.Clear} button that empties it.\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 { SearchIcon, XIcon } from \"@sdxc/icons\";\nimport { fg } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { pointerEvents, mergeMix } from \"@sdxc/u/general\";\nimport {\n\tabsolute,\n\tappearance,\n\tflex,\n\tgrow,\n\thidden,\n\tinsBs,\n\tinsIe,\n\tinsIs,\n\titems,\n\trelative,\n} from \"@sdxc/u/layout\";\nimport { bs, is, p, pis } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { translateY } from \"@sdxc/u/transform\";\n\nimport { clearField, SEARCH_FIELD_CLEAR_COMMAND } from \"@sdxc/ui/mixins\";\nimport { fieldStackLayout } from \"@sdxc/ui/styles\";\n\nimport { Button } from \"@sdxc/ui/button\";\nimport { Input } from \"@sdxc/ui/input\";\n\n/**\n * Prop types for {@link SearchField} and its compound parts.\n */\nexport namespace SearchField {\n\t/**\n\t * Every native `<search>` attribute, unchanged, plus the `mix` passthrough.\n\t * `children` composes this field's parts — typically a caption, the\n\t * {@link SearchField.Input} control, and validation copy — in a single column.\n\t */\n\texport interface Props extends TagProps<\"search\"> {\n\t\t/** The field's compound parts: a caption, the control, and any supporting or validation copy. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Every prop {@link Input} accepts except `type`, `list`, and `role`,\n\t * which this control fixes to `\"search\"` and the platform's own implicit\n\t * `searchbox` role on the consumer's behalf, plus the `mix` passthrough.\n\t */\n\texport interface InputProps extends Omit<Input.Props, \"type\" | \"list\" | \"role\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * `children` holds one control row: the {@link SearchField.Input} and the\n\t * {@link SearchField.Clear} button that empties it.\n\t */\n\texport interface ControlProps extends TagProps<\"div\"> {\n\t\t/** The row's contents: the search input, and the clear button reading it. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Every prop {@link Button} accepts except `type`, `variant`, `size`, and\n\t * `command`, which this control fixes on the consumer's behalf, plus the\n\t * `mix` passthrough.\n\t */\n\texport interface ClearProps extends Omit<\n\t\tButton.Props,\n\t\t\"type\" | \"variant\" | \"size\" | \"command\" | \"children\"\n\t> {\n\t\t/** The `id` of the input this button empties, naming the control it belongs to. */\n\t\tcommandfor: string;\n\t\t/** Glyph or label the button shows. Defaults to a decorative {@link XIcon}. */\n\t\tchildren?: RemixNode;\n\t}\n}\n\n/**\n * Renders a `<search>` landmark — the platform's own role for a search\n * region, needing no explicit `role` attribute — stacking a caption,\n * {@link SearchField.Input}, and validation copy in a single column.\n *\n * @param handle Runtime handle carrying the host `<search>`'s props.\n * @returns The render function producing the field's markup.\n * @example\n * <SearchField>\n * \t<Label htmlFor=\"site-search\">{t(\"search.label\")}</Label>\n * \t<SearchField.Input id=\"site-search\" name=\"q\" placeholder={t(\"search.placeholder\")} />\n * </SearchField>\n * @example\n * <SearchField aria-label={t(\"search.label\")}>\n * \t<SearchField.Input name=\"q\" />\n * </SearchField>\n */\nexport function SearchField(handle: Handle<SearchField.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <search {...rest} data-slot=\"search-field\" mix={mergeMix(fieldStackLayout(), mix)} />;\n\t};\n}\n\n/**\n * Renders {@link SearchField}'s control: a positioning wrapper pairing a\n * muted, decorative {@link SearchIcon} with a native `<input type=\"search\">`\n * built on {@link Input}, inheriting its box, color, and state styling.\n *\n * The user agent's own cancel affordance is suppressed, so clearing the field is\n * {@link SearchField.Clear}'s job — one glyph the field styles and places, sitting\n * alone in the trailing corner.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the control's markup.\n * @example\n * <SearchField.Input aria-label={t(\"search.label\")} placeholder={t(\"search.placeholder\")} />\n * @example\n * <SearchField.Input name=\"q\" color=\"brand\" defaultValue=\"remix\" />\n */\nSearchField.Input = function SearchFieldInput(handle: Handle<SearchField.InputProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div data-slot=\"input-wrapper\" mix={[relative(), flex(), items(\"center\")]}>\n\t\t\t\t<SearchIcon\n\t\t\t\t\tsize={16}\n\t\t\t\t\tdata-slot=\"icon\"\n\t\t\t\t\tmix={[absolute(), insIs(\"0.75rem\"), pointerEvents(), fg(\"neutral.muted\")]}\n\t\t\t\t/>\n\t\t\t\t<Input\n\t\t\t\t\ttype=\"search\"\n\t\t\t\t\t{...rest}\n\t\t\t\t\tmix={mergeMix(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tpis(\"2.25rem\"),\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * {@link SearchField.Clear} draws the clear affordance, so the one the user agent draws\n\t\t\t\t\t\t\t * inside a search input holding a value is hidden to keep the two from stacking.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\twhen(\"&::-webkit-search-cancel-button\", [appearance(\"none\"), hidden()]),\n\t\t\t\t\t\t\twhen(\"&::-webkit-search-decoration\", [appearance(\"none\"), hidden()]),\n\t\t\t\t\t\t],\n\t\t\t\t\t\tmix,\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders the row holding {@link SearchField.Input} and the\n * {@link SearchField.Clear} button beside it, and the positioning context that\n * anchors the clear button to the input's trailing edge.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the control row's markup.\n * @example\n * <SearchField.Control>\n * \t<SearchField.Input id=\"site-search\" name=\"q\" />\n * \t<SearchField.Clear commandfor=\"site-search\" aria-label={t(\"search.clear\")} />\n * </SearchField.Control>\n */\nSearchField.Control = function SearchFieldControl(handle: Handle<SearchField.ControlProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"control\"\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\tflex(),\n\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The input spans the row, so the field keeps the width its container offers.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen('& > [data-slot=\"input-wrapper\"]', grow()),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link SearchField}'s clear button: a round, icon-sized ghost\n * {@link Button} centred on the input's trailing edge, carrying `clearField()`\n * so it empties the `commandfor` input it names and shows while that input holds text.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the clear button's markup.\n * @example\n * <SearchField.Clear commandfor=\"site-search\" aria-label={t(\"search.clear\")} />\n * @example\n * <SearchField.Clear commandfor=\"site-search\">{t(\"search.clear\")}</SearchField.Clear>\n */\nSearchField.Clear = function SearchFieldClear(handle: Handle<SearchField.ClearProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\ttype=\"button\"\n\t\t\t\t{...rest}\n\t\t\t\thidden\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\tcommand={SEARCH_FIELD_CLEAR_COMMAND}\n\t\t\t\tdata-slot=\"clear\"\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tclearField(),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * A round, icon-sized target centred on the field, so its hover tint reads as a\n\t\t\t\t\t\t * disc beside the text, and its glyph sits as far from the trailing edge as the\n\t\t\t\t\t\t * search glyph sits from the leading one.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tis(7),\n\t\t\t\t\t\tbs(7),\n\t\t\t\t\t\tp(0),\n\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\tabsolute(),\n\t\t\t\t\t\tinsIe(\"0.375rem\"),\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\tmix,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{children ?? <XIcon size={16} />}\n\t\t\t</Button>\n\t\t);\n\t};\n};\n"
14
14
  },
15
15
  "test": null
16
16
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "section",
3
- "changedIn": "2026.10.2",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Section"
7
7
  ],
8
8
  "source": {
9
9
  "path": "section.tsx",
10
- "content": "/**\n * A grouping wrapper for a set of related items inside a listbox, menu, or\n * combobox — a native `<section>` element carrying the small block-axis\n * padding that sets one group apart from the next. Pairing it with a\n * `Header` as its first child gives the group a visible label.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { pb } from \"@sdxc/u/size\";\n\n/**\n * Props accepted by {@link Section}.\n */\nexport namespace Section {\n\t/**\n\t * Every native `<section>` attribute, unchanged, plus the `mix`\n\t * passthrough. Content is whatever `children` the consumer supplies,\n\t * most often a `Header` label followed by the group's items.\n\t */\n\texport interface Props extends TagProps<\"section\"> {}\n}\n\n/**\n * Renders its children inside a `<section>` element with small block-axis\n * padding, separating one group of items from its siblings inside a\n * listbox, menu, or combobox; pair it with a `Header` to label the group.\n *\n * @param handle Runtime handle carrying the host `<section>`'s props.\n * @returns The render function producing the group's markup.\n * @example\n * <Section aria-labelledby=\"account-heading\">\n * \t<Header id=\"account-heading\">{t(\"settings.account\")}</Header>\n * \t<ListBox.Item id=\"profile\">{t(\"settings.profile\")}</ListBox.Item>\n * \t<ListBox.Item id=\"billing\">{t(\"settings.billing\")}</ListBox.Item>\n * </Section>\n */\nexport function Section(handle: Handle<Section.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <section {...rest} mix={[pb(\"0.25rem\"), mix]} />;\n\t};\n}\n"
10
+ "content": "/**\n * A grouping wrapper for a set of related items inside a listbox, menu, or\n * combobox — a native `<section>` element carrying the small block-axis\n * padding that sets one group apart from the next. Pairing it with a\n * `Header` as its first child gives the group a visible label.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { mergeMix } from \"@sdxc/u/general\";\nimport { pb } from \"@sdxc/u/size\";\n\n/**\n * Props accepted by {@link Section}.\n */\nexport namespace Section {\n\t/**\n\t * Every native `<section>` attribute, unchanged, plus the `mix`\n\t * passthrough. Content is whatever `children` the consumer supplies,\n\t * most often a `Header` label followed by the group's items.\n\t */\n\texport interface Props extends TagProps<\"section\"> {}\n}\n\n/**\n * Renders its children inside a `<section>` element with small block-axis\n * padding, separating one group of items from its siblings inside a\n * listbox, menu, or combobox; pair it with a `Header` to label the group.\n *\n * @param handle Runtime handle carrying the host `<section>`'s props.\n * @returns The render function producing the group's markup.\n * @example\n * <Section aria-labelledby=\"account-heading\">\n * \t<Header id=\"account-heading\">{t(\"settings.account\")}</Header>\n * \t<ListBox.Item id=\"profile\">{t(\"settings.profile\")}</ListBox.Item>\n * \t<ListBox.Item id=\"billing\">{t(\"settings.billing\")}</ListBox.Item>\n * </Section>\n */\nexport function Section(handle: Handle<Section.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <section {...rest} mix={mergeMix(pb(\"0.25rem\"), mix)} />;\n\t};\n}\n"
11
11
  },
12
12
  "test": null
13
13
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "select",
3
- "changedIn": "2026.10.20",
3
+ "changedIn": "2026.11.1",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Select"
7
7
  ],
8
8
  "source": {
9
9
  "path": "select.tsx",
10
- "content": "/**\n * A native `<select>` styled as a bordered, rounded field and progressively\n * upgraded with customizable-select rendering — a custom trigger button, a\n * value slot mirroring the current selection, and richly styled options and\n * groups — wherever the browser resolves `appearance: base-select`. The\n * trigger, value, and picker styling layer on top of ordinary\n * `<option>`/`<optgroup>` markup, so every browser renders a working\n * dropdown from that same markup.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { ChevronDownIcon } from \"@sdxc/icons\";\nimport { bg, border, borderEdge, fg, outline, outlineStyle, outlineWidth } from \"@sdxc/u/color\";\nimport {\n\topacity,\n\trounded,\n\ttransition,\n\ttransitionBehavior,\n\ttransitionDuration,\n} from \"@sdxc/u/effects\";\nimport { cursor, raw } from \"@sdxc/u/general\";\nimport {\n\tappearance,\n\tbasis,\n\tflex,\n\tgap,\n\tgrow,\n\tinlineFlex,\n\tinset,\n\titems,\n\tjustify,\n\tshrink,\n} from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { media, startingStyle } from \"@sdxc/u/responsive\";\nimport { bs, is, m, maxBs, p, pb, pi } from \"@sdxc/u/size\";\nimport { data, hover, when } from \"@sdxc/u/state\";\nimport { text, textAlign, truncate } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { durations } from \"@sdxc/ui/animations\";\nimport { mirrorSelectedOption } from \"@sdxc/ui/mixins\";\nimport { floatingSurface, surfaceInset } from \"@sdxc/ui/styles\";\n\n/**\n * The `<selectedcontent>` element mirrors the currently selected\n * `<option>`'s rendered content inside a customized `<select>`'s trigger\n * button, its attribute shape declared here to match a plain `<span>`'s.\n */\ndeclare global {\n\tnamespace JSX {\n\t\tinterface IntrinsicHTMLElements {\n\t\t\tselectedcontent: IntrinsicHTMLElements[\"span\"];\n\t\t}\n\t}\n}\n\n/** Semantic color role {@link Select} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: Select.Color = \"neutral\";\n\n/**\n * `type` {@link Select.Trigger} falls back to when a consumer doesn't supply\n * one, keeping a click on the trigger from submitting a surrounding `<form>`\n * the way a bare `<button>`'s default type otherwise would.\n */\nconst DEFAULT_TRIGGER_TYPE: NonNullable<Select.TriggerProps[\"type\"]> = \"button\";\n\n/**\n * `aria-hidden` applied through {@link attrs} to {@link Select.Trigger}'s\n * default chevron glyph unless a consumer overrides it, keeping the\n * decorative icon out of the accessibility tree.\n */\nconst DEFAULT_ICON_ARIA_HIDDEN = \"true\";\n\n/**\n * Prop types for {@link Select} and its compound parts.\n */\nexport namespace Select {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` variables.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Every native `<select>` attribute, unchanged, plus the `mix` passthrough.\n\t * `multiple` and a `size` greater than `1` remain functional but switch\n\t * rendering back to the plain list-box; `role` is already implicit.\n\t */\n\t/**\n\t * `value` and `defaultValue` are left out on purpose. A `<select>` takes its selection\n\t * from the option carrying `selected` and nothing else reads either attribute, so a\n\t * value passed here goes unread and the field quietly shows its first option. Mark the\n\t * option instead: `<Select.Option value=\"eu\" selected>`.\n\t */\n\texport interface Props extends Omit<TagProps<\"select\">, \"role\" | \"defaultValue\" | \"value\"> {\n\t\t/** Semantic color role for the focus-visible ring. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t}\n\n\t/**\n\t * Every native `<button>` attribute, unchanged, plus the `mix` passthrough.\n\t * `type` defaults to {@link DEFAULT_TRIGGER_TYPE}.\n\t */\n\texport interface TriggerProps extends TagProps<\"button\"> {}\n\n\t/**\n\t * Every attribute a plain `<span>` accepts, unchanged, plus the `mix`\n\t * passthrough. Any `children` supplied render as a fallback in browsers\n\t * treating `<selectedcontent>` as unknown — see {@link Select.Value}.\n\t */\n\texport interface ValueProps extends TagProps<\"selectedcontent\"> {}\n\n\t/**\n\t * Every native `<option>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface OptionProps extends TagProps<\"option\"> {}\n\n\t/**\n\t * Every native `<optgroup>` attribute, unchanged, plus the `mix`\n\t * passthrough.\n\t */\n\texport interface GroupProps extends TagProps<\"optgroup\"> {}\n}\n\n/**\n * Renders a native `<select>` styled as a bordered, rounded field that\n * progressively upgrades to customizable-select rendering via\n * `appearance: base-select`, falling back to the platform's own dropdown.\n *\n * @param handle Runtime handle carrying the host `<select>`'s props.\n * @returns The render function producing the field's markup.\n * @example\n * <Select aria-label={t(\"form.country.label\")} required>\n * \t<Select.Option value=\"\">{t(\"form.country.placeholder\")}</Select.Option>\n * \t<Select.Option value=\"us\">{t(\"countries.us\")}</Select.Option>\n * \t<Select.Option value=\"ca\">{t(\"countries.ca\")}</Select.Option>\n * </Select>\n * @example\n * <Select aria-label={t(\"form.plan.label\")} color=\"brand\">\n * \t<Select.Trigger />\n * \t<Select.Group label={t(\"form.plan.groups.personal\")}>\n * \t\t<Select.Option value=\"free\">{t(\"plans.free\")}</Select.Option>\n * \t\t<Select.Option value=\"pro\">{t(\"plans.pro\")}</Select.Option>\n * \t</Select.Group>\n * </Select>\n */\nexport function Select(handle: Handle<Select.Props>) {\n\treturn () => {\n\t\tlet { color, multiple, size, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\tif (import.meta.env?.DEV && (multiple || (typeof size === \"number\" && size > 1))) {\n\t\t\tconsole.warn(\n\t\t\t\t\"Select: `appearance: base-select` styling has no effect on a `multiple` select or one with a `size` greater than 1 — the browser keeps its plain list-box rendering there instead of the customized trigger, value, and option styling.\",\n\t\t\t);\n\t\t}\n\n\t\tlet fieldMix = [\n\t\t\tflex(),\n\t\t\titems(\"center\"),\n\t\t\tjustify(\"between\"),\n\t\t\tcursor(\"default\"),\n\t\t\ttext(\"sm\"),\n\t\t\t/**\n\t\t\t * Focus draws a ring standing off the field and the border steps only to its hover weight,\n\t\t\t * so the field keeps its shape. The pointer and keyboard selectors exclude each other because\n\t\t\t * `outline: none` is a shorthand that, from a later layer, resets the whole ring.\n\t\t\t */\n\t\t\twhen(\"&:focus:not(:focus-visible)\", outline(\"none\")),\n\t\t\twhen(\"&:focus-visible\", [\n\t\t\t\tborder(\"neutral.border-hover\"),\n\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\tdata(\"color\", \"success\", outline(\"success.ring\")),\n\t\t\t\tdata(\"color\", \"warning\", outline(\"warning.ring\")),\n\t\t\t\tdata(\"color\", \"danger\", outline(\"danger.ring\")),\n\t\t\t]),\n\t\t\twhen('&[aria-invalid=\"true\"], &:user-invalid', [\n\t\t\t\toutlineWidth(\"2px\"),\n\t\t\t\toutlineStyle(\"solid\"),\n\t\t\t\traw({ outlineOffset: \"2px\" }),\n\t\t\t]),\n\t\t\twhen(\"&:disabled\", [cursor(\"not-allowed\"), opacity(50)]),\n\n\t\t\twhen(\"&::picker(select)\", [\n\t\t\t\tfloatingSurface(),\n\t\t\t\tsurfaceInset(),\n\t\t\t\tm(0),\n\t\t\t\tinset(\"auto\"),\n\t\t\t\tmaxBs(\"15rem\"),\n\t\t\t\toverflow(\"auto\"),\n\t\t\t\toutline(\"none\"),\n\t\t\t\topacity(0),\n\t\t\t\ttransition(\"opacity, display, overlay\", { duration: durations.fast }),\n\t\t\t\ttransitionBehavior(\"allow-discrete\"),\n\t\t\t]),\n\t\t\twhen(\"&:open::picker(select)\", opacity(100)),\n\t\t\tstartingStyle(when(\"&:open::picker(select)\", opacity(0))),\n\t\t\tmedia(\n\t\t\t\t\"(prefers-reduced-motion: reduce)\",\n\t\t\t\twhen(\"&::picker(select)\", transitionDuration(\"0s\")),\n\t\t\t),\n\t\t\traw({\n\t\t\t\t\"&:open\": {\n\t\t\t\t\t'& [data-slot=\"icon\"]': {\n\t\t\t\t\t\ttransform: \"rotate(180deg)\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t\"&:has(option:checked:disabled)\": {\n\t\t\t\t\t\"& selectedcontent\": {\n\t\t\t\t\t\tcolor: \"var(--ui-neutral-fg-muted)\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t\tgap(\"0.5rem\"),\n\t\t\tis(\"full\"),\n\t\t\tbs(\"2.5rem\"),\n\t\t\trounded(\"md\"),\n\t\t\tborder({ color: \"neutral\", width: 1 }),\n\t\t\tbg(\"neutral.tint\"),\n\t\t\tfg(\"neutral.emphasis\"),\n\t\t\tpi(\"0.75rem\"),\n\t\t\tpb(\"0.5rem\"),\n\t\t\tappearance(\"base-select\"),\n\t\t\ttransition(\n\t\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter\",\n\t\t\t),\n\t\t\thover(border(\"neutral.border-hover\")),\n\t\t\twhen(\"&:focus\", border(\"neutral.border-hover\")),\n\t\t\twhen('&[aria-invalid=\"true\"], &:user-invalid', [\n\t\t\t\tborder(\"danger\"),\n\t\t\t\toutline({ color: \"danger.ring\", offset: 2 }),\n\t\t\t]),\n\t\t\twhen(\"&:disabled\", bg(\"neutral.bg-tint-hover\")),\n\t\t\traw({\n\t\t\t\t\"&::picker(select)\": {\n\t\t\t\t\tborderRadius: \"var(--ui-radius-lg, 0.5rem)\",\n\t\t\t\t\tborderWidth: \"1px\",\n\t\t\t\t\tborderStyle: \"solid\",\n\t\t\t\t\tborderColor: \"var(--ui-neutral-border)\",\n\t\t\t\t\tbackgroundColor: \"var(--ui-neutral-bg-tint)\",\n\t\t\t\t},\n\t\t\t\t\"&::picker-icon\": {\n\t\t\t\t\tcolor: \"var(--ui-neutral-fg-muted)\",\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmix,\n\t\t] as unknown as Select.Props[\"mix\"];\n\n\t\treturn (\n\t\t\t<select multiple={multiple} size={size} data-color={resolvedColor} {...rest} mix={fieldMix} />\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Select}'s customizable trigger: a native `<button>` placed\n * as {@link Select}'s first child, showing {@link Select.Value} and a\n * rotating chevron by default, filling the field's box edge to edge.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the trigger's markup.\n * @example\n * <Select.Trigger />\n * @example\n * <Select.Trigger>\n * \t<Select.Value>{t(\"form.plan.placeholder\")}</Select.Value>\n * </Select.Trigger>\n */\nSelect.Trigger = function SelectTrigger(handle: Handle<Select.TriggerProps>) {\n\treturn () => {\n\t\tlet { type, children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype={type ?? DEFAULT_TRIGGER_TYPE}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"between\"),\n\t\t\t\t\tgap(\"0.5rem\"),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\tbs(\"full\"),\n\t\t\t\t\tm(0),\n\t\t\t\t\tp(0),\n\t\t\t\t\tborder({ width: 0, style: \"none\" }),\n\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\tfg(\"inherit\"),\n\t\t\t\t\traw({ font: \"inherit\" }),\n\t\t\t\t\ttextAlign(\"start\"),\n\t\t\t\t\tcursor(\"inherit\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children ?? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Select.Value />\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tdata-slot=\"icon\"\n\t\t\t\t\t\t\tmix={[\n\t\t\t\t\t\t\t\tattrs({ \"aria-hidden\": DEFAULT_ICON_ARIA_HIDDEN }),\n\t\t\t\t\t\t\t\tinlineFlex(),\n\t\t\t\t\t\t\t\tshrink(),\n\t\t\t\t\t\t\t\ttransition(\"transform\"),\n\t\t\t\t\t\t\t\twhen(\"& svg\", [is(\"1rem\"), bs(\"1rem\")]),\n\t\t\t\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", transitionDuration(\"0s\")),\n\t\t\t\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ChevronDownIcon />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</button>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<selectedcontent>` element inside {@link Select.Trigger},\n * mirroring the currently selected {@link Select.Option}'s content via the\n * platform; `children` render as a fallback where it's treated as unknown.\n *\n * @param handle Runtime handle carrying the host element's props.\n * @returns The render function producing the value slot's markup.\n * @example\n * <Select.Value />\n * @example\n * <Select.Value>{t(\"form.plan.placeholder\")}</Select.Value>\n */\nSelect.Value = function SelectValue(handle: Handle<Select.ValueProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<selectedcontent\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tmirrorSelectedOption(),\n\t\t\t\t\tgrow(),\n\t\t\t\t\tshrink(1),\n\t\t\t\t\tbasis(\"0%\"),\n\t\t\t\t\ttruncate(),\n\t\t\t\t\ttextAlign(\"start\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<option>` styled for the rounded, padded row a\n * supporting browser shows inside {@link Select}'s `::picker(select)`\n * dropdown, reading its own hover, focus, checked, and disabled states.\n *\n * @param handle Runtime handle carrying the host `<option>`'s props.\n * @returns The render function producing the option's markup.\n * @example\n * <Select.Option value=\"us\">{t(\"countries.us\")}</Select.Option>\n * @example\n * <Select.Option value=\"\" disabled>{t(\"form.country.placeholder\")}</Select.Option>\n */\nSelect.Option = function SelectOption(handle: Handle<Select.OptionProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<option\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\tpi(\"0.75rem\"),\n\t\t\t\t\tpb(\"0.5rem\"),\n\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\toutline(\"none\"),\n\t\t\t\t\twhen(\"&:disabled\", opacity(50)),\n\t\t\t\t\twhen(\"&::checkmark\", fg(\"currentColor\")),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\ttransition(\n\t\t\t\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke\",\n\t\t\t\t\t),\n\t\t\t\t\twhen(\"&:hover\", bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\twhen(\"&:active\", bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\twhen(\"&:focus\", bg(\"brand.tint\")),\n\t\t\t\t\twhen(\"&:checked\", [bg(\"brand.solid\"), fg(\"brand.onSolid\")]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<optgroup>` styled as a padded run of\n * {@link Select.Option}s, set off from the group before it by a\n * block-start divider on every group after the first.\n *\n * @param handle Runtime handle carrying the host `<optgroup>`'s props.\n * @returns The render function producing the group's markup.\n * @example\n * <Select.Group label={t(\"form.plan.groups.personal\")}>\n * \t<Select.Option value=\"free\">{t(\"plans.free\")}</Select.Option>\n * \t<Select.Option value=\"pro\">{t(\"plans.pro\")}</Select.Option>\n * </Select.Group>\n */\nSelect.Group = function SelectGroup(handle: Handle<Select.GroupProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\tif (import.meta.env?.DEV && !rest.label) {\n\t\t\tconsole.warn(\n\t\t\t\t\"Select.Group: an `optgroup` with no `label` renders with no visible heading for its options — pass a `label` describing the group.\",\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<optgroup\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:not(:first-child)\", borderEdge(\"block-start\", { width: 1 })),\n\t\t\t\t\tpb(\"0.25rem\"),\n\t\t\t\t\twhen(\"&:not(:first-child)\", border(\"neutral\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
10
+ "content": "/**\n * A native `<select>` styled as a bordered, rounded field and progressively\n * upgraded with customizable-select rendering — a custom trigger button, a\n * value slot mirroring the current selection, and richly styled options and\n * groups — wherever the browser resolves `appearance: base-select`. The\n * trigger, value, and picker styling layer on top of ordinary\n * `<option>`/`<optgroup>` markup, so every browser renders a working\n * dropdown from that same markup.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { ChevronDownIcon } from \"@sdxc/icons\";\nimport { bg, border, borderEdge, fg, outline, outlineStyle, outlineWidth } from \"@sdxc/u/color\";\nimport {\n\topacity,\n\trounded,\n\ttransition,\n\ttransitionBehavior,\n\ttransitionDuration,\n} from \"@sdxc/u/effects\";\nimport { cursor, raw, mergeMix } from \"@sdxc/u/general\";\nimport {\n\tappearance,\n\tbasis,\n\tflex,\n\tgap,\n\tgrow,\n\tinlineFlex,\n\tinset,\n\titems,\n\tjustify,\n\tshrink,\n} from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { media, startingStyle } from \"@sdxc/u/responsive\";\nimport { bs, is, m, maxBs, p, pb, pi } from \"@sdxc/u/size\";\nimport { data, hover, when } from \"@sdxc/u/state\";\nimport { text, textAlign, truncate } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { durations } from \"@sdxc/ui/animations\";\nimport { mirrorSelectedOption } from \"@sdxc/ui/mixins\";\nimport { floatingSurface, surfaceInset } from \"@sdxc/ui/styles\";\n\n/**\n * The `<selectedcontent>` element mirrors the currently selected\n * `<option>`'s rendered content inside a customized `<select>`'s trigger\n * button, its attribute shape declared here to match a plain `<span>`'s.\n */\ndeclare global {\n\tnamespace JSX {\n\t\tinterface IntrinsicHTMLElements {\n\t\t\tselectedcontent: IntrinsicHTMLElements[\"span\"];\n\t\t}\n\t}\n}\n\n/** Semantic color role {@link Select} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: Select.Color = \"neutral\";\n\n/**\n * `type` {@link Select.Trigger} falls back to when a consumer doesn't supply\n * one, keeping a click on the trigger from submitting a surrounding `<form>`\n * the way a bare `<button>`'s default type otherwise would.\n */\nconst DEFAULT_TRIGGER_TYPE: NonNullable<Select.TriggerProps[\"type\"]> = \"button\";\n\n/**\n * `aria-hidden` applied through {@link attrs} to {@link Select.Trigger}'s\n * default chevron glyph unless a consumer overrides it, keeping the\n * decorative icon out of the accessibility tree.\n */\nconst DEFAULT_ICON_ARIA_HIDDEN = \"true\";\n\n/**\n * Prop types for {@link Select} and its compound parts.\n */\nexport namespace Select {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` variables.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Every native `<select>` attribute, unchanged, plus the `mix` passthrough.\n\t * `multiple` and a `size` greater than `1` remain functional but switch\n\t * rendering back to the plain list-box; `role` is already implicit.\n\t */\n\t/**\n\t * `value` and `defaultValue` are left out on purpose. A `<select>` takes its selection\n\t * from the option carrying `selected` and nothing else reads either attribute, so a\n\t * value passed here goes unread and the field quietly shows its first option. Mark the\n\t * option instead: `<Select.Option value=\"eu\" selected>`.\n\t */\n\texport interface Props extends Omit<TagProps<\"select\">, \"role\" | \"defaultValue\" | \"value\"> {\n\t\t/** Semantic color role for the focus-visible ring. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t}\n\n\t/**\n\t * Every native `<button>` attribute, unchanged, plus the `mix` passthrough.\n\t * `type` defaults to {@link DEFAULT_TRIGGER_TYPE}.\n\t */\n\texport interface TriggerProps extends TagProps<\"button\"> {}\n\n\t/**\n\t * Every attribute a plain `<span>` accepts, unchanged, plus the `mix`\n\t * passthrough. Any `children` supplied render as a fallback in browsers\n\t * treating `<selectedcontent>` as unknown — see {@link Select.Value}.\n\t */\n\texport interface ValueProps extends TagProps<\"selectedcontent\"> {}\n\n\t/**\n\t * Every native `<option>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface OptionProps extends TagProps<\"option\"> {}\n\n\t/**\n\t * Every native `<optgroup>` attribute, unchanged, plus the `mix`\n\t * passthrough.\n\t */\n\texport interface GroupProps extends TagProps<\"optgroup\"> {}\n}\n\n/**\n * Renders a native `<select>` styled as a bordered, rounded field that\n * progressively upgrades to customizable-select rendering via\n * `appearance: base-select`, falling back to the platform's own dropdown.\n *\n * @param handle Runtime handle carrying the host `<select>`'s props.\n * @returns The render function producing the field's markup.\n * @example\n * <Select aria-label={t(\"form.country.label\")} required>\n * \t<Select.Option value=\"\">{t(\"form.country.placeholder\")}</Select.Option>\n * \t<Select.Option value=\"us\">{t(\"countries.us\")}</Select.Option>\n * \t<Select.Option value=\"ca\">{t(\"countries.ca\")}</Select.Option>\n * </Select>\n * @example\n * <Select aria-label={t(\"form.plan.label\")} color=\"brand\">\n * \t<Select.Trigger />\n * \t<Select.Group label={t(\"form.plan.groups.personal\")}>\n * \t\t<Select.Option value=\"free\">{t(\"plans.free\")}</Select.Option>\n * \t\t<Select.Option value=\"pro\">{t(\"plans.pro\")}</Select.Option>\n * \t</Select.Group>\n * </Select>\n */\nexport function Select(handle: Handle<Select.Props>) {\n\treturn () => {\n\t\tlet { color, multiple, size, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\tif (import.meta.env?.DEV && (multiple || (typeof size === \"number\" && size > 1))) {\n\t\t\tconsole.warn(\n\t\t\t\t\"Select: `appearance: base-select` styling has no effect on a `multiple` select or one with a `size` greater than 1 — the browser keeps its plain list-box rendering there instead of the customized trigger, value, and option styling.\",\n\t\t\t);\n\t\t}\n\n\t\tlet fieldMix = mergeMix(\n\t\t\t[\n\t\t\t\tflex(),\n\t\t\t\titems(\"center\"),\n\t\t\t\tjustify(\"between\"),\n\t\t\t\tcursor(\"default\"),\n\t\t\t\ttext(\"sm\"),\n\t\t\t\t/**\n\t\t\t\t * Focus draws a ring standing off the field and the border steps only to its hover weight,\n\t\t\t\t * so the field keeps its shape. The pointer and keyboard selectors exclude each other because\n\t\t\t\t * `outline: none` is a shorthand that, from a later layer, resets the whole ring.\n\t\t\t\t */\n\t\t\t\twhen(\"&:focus:not(:focus-visible)\", outline(\"none\")),\n\t\t\t\twhen(\"&:focus-visible\", [\n\t\t\t\t\tborder(\"neutral.border-hover\"),\n\t\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\t\tdata(\"color\", \"success\", outline(\"success.ring\")),\n\t\t\t\t\tdata(\"color\", \"warning\", outline(\"warning.ring\")),\n\t\t\t\t\tdata(\"color\", \"danger\", outline(\"danger.ring\")),\n\t\t\t\t]),\n\t\t\t\twhen('&[aria-invalid=\"true\"], &:user-invalid', [\n\t\t\t\t\toutlineWidth(\"2px\"),\n\t\t\t\t\toutlineStyle(\"solid\"),\n\t\t\t\t\traw({ outlineOffset: \"2px\" }),\n\t\t\t\t]),\n\t\t\t\twhen(\"&:disabled\", [cursor(\"not-allowed\"), opacity(50)]),\n\n\t\t\t\twhen(\"&::picker(select)\", [\n\t\t\t\t\tfloatingSurface(),\n\t\t\t\t\tsurfaceInset(),\n\t\t\t\t\tm(0),\n\t\t\t\t\tinset(\"auto\"),\n\t\t\t\t\tmaxBs(\"15rem\"),\n\t\t\t\t\toverflow(\"auto\"),\n\t\t\t\t\toutline(\"none\"),\n\t\t\t\t\topacity(0),\n\t\t\t\t\ttransition(\"opacity, display, overlay\", { duration: durations.fast }),\n\t\t\t\t\ttransitionBehavior(\"allow-discrete\"),\n\t\t\t\t]),\n\t\t\t\twhen(\"&:open::picker(select)\", opacity(100)),\n\t\t\t\tstartingStyle(when(\"&:open::picker(select)\", opacity(0))),\n\t\t\t\tmedia(\n\t\t\t\t\t\"(prefers-reduced-motion: reduce)\",\n\t\t\t\t\twhen(\"&::picker(select)\", transitionDuration(\"0s\")),\n\t\t\t\t),\n\t\t\t\traw({\n\t\t\t\t\t\"&:open\": {\n\t\t\t\t\t\t'& [data-slot=\"icon\"]': {\n\t\t\t\t\t\t\ttransform: \"rotate(180deg)\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t\"&:has(option:checked:disabled)\": {\n\t\t\t\t\t\t\"& selectedcontent\": {\n\t\t\t\t\t\t\tcolor: \"var(--ui-neutral-fg-muted)\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tgap(\"0.5rem\"),\n\t\t\t\tis(\"full\"),\n\t\t\t\tbs(\"2.5rem\"),\n\t\t\t\trounded(\"md\"),\n\t\t\t\tborder({ color: \"neutral\", width: 1 }),\n\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\tpi(\"0.75rem\"),\n\t\t\t\tpb(\"0.5rem\"),\n\t\t\t\tappearance(\"base-select\"),\n\t\t\t\ttransition(\n\t\t\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter\",\n\t\t\t\t),\n\t\t\t\thover(border(\"neutral.border-hover\")),\n\t\t\t\twhen(\"&:focus\", border(\"neutral.border-hover\")),\n\t\t\t\twhen('&[aria-invalid=\"true\"], &:user-invalid', [\n\t\t\t\t\tborder(\"danger\"),\n\t\t\t\t\toutline({ color: \"danger.ring\", offset: 2 }),\n\t\t\t\t]),\n\t\t\t\twhen(\"&:disabled\", bg(\"neutral.bg-tint-hover\")),\n\t\t\t\traw({\n\t\t\t\t\t\"&::picker(select)\": {\n\t\t\t\t\t\tborderRadius: \"var(--ui-radius-lg, 0.5rem)\",\n\t\t\t\t\t\tborderWidth: \"1px\",\n\t\t\t\t\t\tborderStyle: \"solid\",\n\t\t\t\t\t\tborderColor: \"var(--ui-neutral-border)\",\n\t\t\t\t\t\tbackgroundColor: \"var(--ui-neutral-bg-tint)\",\n\t\t\t\t\t},\n\t\t\t\t\t\"&::picker-icon\": {\n\t\t\t\t\t\tcolor: \"var(--ui-neutral-fg-muted)\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t],\n\t\t\tmix,\n\t\t) as Select.Props[\"mix\"];\n\n\t\treturn (\n\t\t\t<select multiple={multiple} size={size} data-color={resolvedColor} {...rest} mix={fieldMix} />\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Select}'s customizable trigger: a native `<button>` placed\n * as {@link Select}'s first child, showing {@link Select.Value} and a\n * rotating chevron by default, filling the field's box edge to edge.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the trigger's markup.\n * @example\n * <Select.Trigger />\n * @example\n * <Select.Trigger>\n * \t<Select.Value>{t(\"form.plan.placeholder\")}</Select.Value>\n * </Select.Trigger>\n */\nSelect.Trigger = function SelectTrigger(handle: Handle<Select.TriggerProps>) {\n\treturn () => {\n\t\tlet { type, children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype={type ?? DEFAULT_TRIGGER_TYPE}\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tflex(),\n\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\tjustify(\"between\"),\n\t\t\t\t\t\tgap(\"0.5rem\"),\n\t\t\t\t\t\tis(\"full\"),\n\t\t\t\t\t\tbs(\"full\"),\n\t\t\t\t\t\tm(0),\n\t\t\t\t\t\tp(0),\n\t\t\t\t\t\tborder({ width: 0, style: \"none\" }),\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\tfg(\"inherit\"),\n\t\t\t\t\t\traw({ font: \"inherit\" }),\n\t\t\t\t\t\ttextAlign(\"start\"),\n\t\t\t\t\t\tcursor(\"inherit\"),\n\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{children ?? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Select.Value />\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tdata-slot=\"icon\"\n\t\t\t\t\t\t\tmix={[\n\t\t\t\t\t\t\t\tattrs({ \"aria-hidden\": DEFAULT_ICON_ARIA_HIDDEN }),\n\t\t\t\t\t\t\t\tinlineFlex(),\n\t\t\t\t\t\t\t\tshrink(),\n\t\t\t\t\t\t\t\ttransition(\"transform\"),\n\t\t\t\t\t\t\t\twhen(\"& svg\", [is(\"1rem\"), bs(\"1rem\")]),\n\t\t\t\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", transitionDuration(\"0s\")),\n\t\t\t\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ChevronDownIcon />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</button>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<selectedcontent>` element inside {@link Select.Trigger},\n * mirroring the currently selected {@link Select.Option}'s content via the\n * platform; `children` render as a fallback where it's treated as unknown.\n *\n * @param handle Runtime handle carrying the host element's props.\n * @returns The render function producing the value slot's markup.\n * @example\n * <Select.Value />\n * @example\n * <Select.Value>{t(\"form.plan.placeholder\")}</Select.Value>\n */\nSelect.Value = function SelectValue(handle: Handle<Select.ValueProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<selectedcontent\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[mirrorSelectedOption(), grow(), shrink(1), basis(\"0%\"), truncate(), textAlign(\"start\")],\n\t\t\t\t\tmix,\n\t\t\t\t)}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a native `<option>` styled for the rounded, padded row a\n * supporting browser shows inside {@link Select}'s `::picker(select)`\n * dropdown, reading its own hover, focus, checked, and disabled states.\n *\n * @param handle Runtime handle carrying the host `<option>`'s props.\n * @returns The render function producing the option's markup.\n * @example\n * <Select.Option value=\"us\">{t(\"countries.us\")}</Select.Option>\n * @example\n * <Select.Option value=\"\" disabled>{t(\"form.country.placeholder\")}</Select.Option>\n */\nSelect.Option = function SelectOption(handle: Handle<Select.OptionProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<option\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\t\tpi(\"0.75rem\"),\n\t\t\t\t\t\tpb(\"0.5rem\"),\n\t\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\t\toutline(\"none\"),\n\t\t\t\t\t\twhen(\"&:disabled\", opacity(50)),\n\t\t\t\t\t\twhen(\"&::checkmark\", fg(\"currentColor\")),\n\t\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t\ttransition(\n\t\t\t\t\t\t\t\"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\twhen(\"&:hover\", bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\t\twhen(\"&:active\", bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\t\twhen(\"&:focus\", bg(\"brand.tint\")),\n\t\t\t\t\t\twhen(\"&:checked\", [bg(\"brand.solid\"), fg(\"brand.onSolid\")]),\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 native `<optgroup>` styled as a padded run of\n * {@link Select.Option}s, set off from the group before it by a\n * block-start divider on every group after the first.\n *\n * @param handle Runtime handle carrying the host `<optgroup>`'s props.\n * @returns The render function producing the group's markup.\n * @example\n * <Select.Group label={t(\"form.plan.groups.personal\")}>\n * \t<Select.Option value=\"free\">{t(\"plans.free\")}</Select.Option>\n * \t<Select.Option value=\"pro\">{t(\"plans.pro\")}</Select.Option>\n * </Select.Group>\n */\nSelect.Group = function SelectGroup(handle: Handle<Select.GroupProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\tif (import.meta.env?.DEV && !rest.label) {\n\t\t\tconsole.warn(\n\t\t\t\t\"Select.Group: an `optgroup` with no `label` renders with no visible heading for its options — pass a `label` describing the group.\",\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<optgroup\n\t\t\t\t{...rest}\n\t\t\t\tmix={mergeMix(\n\t\t\t\t\t[\n\t\t\t\t\t\twhen(\"&:not(:first-child)\", borderEdge(\"block-start\", { width: 1 })),\n\t\t\t\t\t\tpb(\"0.25rem\"),\n\t\t\t\t\t\twhen(\"&:not(:first-child)\", border(\"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"
11
11
  },
12
12
  "test": null
13
13
  }