@sdxc/kit 2026.10.30 → 2026.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/README.md +59 -0
  2. package/changelog.jsonl +346 -0
  3. package/config.schema.json +14 -0
  4. package/dist/ci/install.d.ts +15 -0
  5. package/dist/ci/install.js +27 -0
  6. package/dist/ci/locate.d.ts +23 -0
  7. package/dist/ci/locate.js +43 -0
  8. package/dist/cli.js +5 -0
  9. package/dist/commands/ci/list.d.ts +16 -0
  10. package/dist/commands/ci/list.js +24 -0
  11. package/dist/commands/ci/run.d.ts +65 -0
  12. package/dist/commands/ci/run.js +36 -0
  13. package/dist/commands/ci/signoff.d.ts +15 -0
  14. package/dist/commands/ci/signoff.js +15 -0
  15. package/dist/commands/ci/verify.d.ts +17 -0
  16. package/dist/commands/ci/verify.js +15 -0
  17. package/dist/commands/create.js +3 -0
  18. package/dist/commands/pkg.d.ts +16 -0
  19. package/dist/commands/pkg.js +71 -0
  20. package/dist/commands/routes.d.ts +1 -1
  21. package/dist/config.d.ts +10 -4
  22. package/dist/config.js +8 -0
  23. package/dist/contract.d.ts +60 -1
  24. package/dist/contract.js +46 -0
  25. package/dist/create/workspace.d.ts +15 -0
  26. package/dist/create/workspace.js +42 -0
  27. package/dist/doctor/checks.js +4 -0
  28. package/dist/doctor/ci.d.ts +15 -0
  29. package/dist/doctor/ci.js +63 -0
  30. package/dist/doctor/translations.d.ts +19 -0
  31. package/dist/doctor/translations.js +144 -0
  32. package/dist/make/declare.js +32 -11
  33. package/dist/package-manager.d.ts +2 -0
  34. package/dist/package-manager.js +16 -2
  35. package/dist/pkg/catalog.d.ts +12 -0
  36. package/dist/pkg/catalog.js +153 -0
  37. package/dist/pkg/resolve.d.ts +67 -0
  38. package/dist/pkg/resolve.js +147 -0
  39. package/dist/upgrade/changelog.d.ts +2 -2
  40. package/dist/upgrade/project.d.ts +2 -2
  41. package/package.json +10 -8
  42. package/registry/ui/accordion.json +2 -2
  43. package/registry/ui/alert-dialog.json +2 -2
  44. package/registry/ui/alert.json +2 -2
  45. package/registry/ui/aspect-ratio.json +2 -2
  46. package/registry/ui/avatar.json +6 -3
  47. package/registry/ui/badge.json +2 -2
  48. package/registry/ui/banner.json +16 -0
  49. package/registry/ui/breadcrumbs.json +2 -2
  50. package/registry/ui/button.json +5 -3
  51. package/registry/ui/calendar.json +2 -2
  52. package/registry/ui/card.json +2 -2
  53. package/registry/ui/carousel.json +2 -2
  54. package/registry/ui/checkbox-group.json +2 -2
  55. package/registry/ui/checkbox.json +2 -2
  56. package/registry/ui/combobox.json +2 -2
  57. package/registry/ui/command.json +2 -2
  58. package/registry/ui/confirm.json +8 -4
  59. package/registry/ui/cta-group.json +2 -2
  60. package/registry/ui/date-field.json +2 -2
  61. package/registry/ui/date-picker.json +2 -2
  62. package/registry/ui/date-range-picker.json +2 -2
  63. package/registry/ui/description.json +2 -2
  64. package/registry/ui/dialog-dismiss.json +13 -0
  65. package/registry/ui/dialog.json +2 -2
  66. package/registry/ui/disclosure.json +2 -2
  67. package/registry/ui/drawer.json +2 -2
  68. package/registry/ui/field-error.json +2 -2
  69. package/registry/ui/form.json +2 -2
  70. package/registry/ui/group.json +2 -2
  71. package/registry/ui/header.json +2 -2
  72. package/registry/ui/heading-scope.json +2 -2
  73. package/registry/ui/heading.json +3 -3
  74. package/registry/ui/highlight.json +3 -3
  75. package/registry/ui/hover-card.json +2 -2
  76. package/registry/ui/image-placeholder.json +2 -2
  77. package/registry/ui/input.json +2 -2
  78. package/registry/ui/item.json +2 -2
  79. package/registry/ui/keyboard.json +2 -2
  80. package/registry/ui/label.json +2 -2
  81. package/registry/ui/link-button.json +5 -3
  82. package/registry/ui/link.json +2 -2
  83. package/registry/ui/listbox.json +2 -2
  84. package/registry/ui/menu.json +2 -2
  85. package/registry/ui/meter.json +2 -2
  86. package/registry/ui/modal.json +2 -2
  87. package/registry/ui/nav-link.json +2 -2
  88. package/registry/ui/navigation-menu.json +2 -2
  89. package/registry/ui/number-field.json +2 -2
  90. package/registry/ui/otp-field.json +2 -2
  91. package/registry/ui/overlay-arrow.json +2 -2
  92. package/registry/ui/pagination.json +2 -2
  93. package/registry/ui/popover.json +2 -2
  94. package/registry/ui/progress-bar.json +2 -2
  95. package/registry/ui/property-list.json +18 -0
  96. package/registry/ui/radio-group.json +2 -2
  97. package/registry/ui/range-calendar.json +2 -2
  98. package/registry/ui/relative-time.json +17 -0
  99. package/registry/ui/scroll-area.json +2 -2
  100. package/registry/ui/search-field.json +2 -2
  101. package/registry/ui/section.json +2 -2
  102. package/registry/ui/select.json +2 -2
  103. package/registry/ui/selection-indicator.json +2 -2
  104. package/registry/ui/sentinel-row.json +2 -2
  105. package/registry/ui/separator.json +2 -2
  106. package/registry/ui/shared-element.json +2 -2
  107. package/registry/ui/sheet.json +2 -2
  108. package/registry/ui/sidebar.json +2 -2
  109. package/registry/ui/slider.json +2 -2
  110. package/registry/ui/spinner.json +2 -2
  111. package/registry/ui/status-dot.json +16 -0
  112. package/registry/ui/switch.json +2 -2
  113. package/registry/ui/tabs.json +2 -2
  114. package/registry/ui/tag-group.json +2 -2
  115. package/registry/ui/text-field.json +7 -3
  116. package/registry/ui/text.json +2 -2
  117. package/registry/ui/textarea.json +2 -2
  118. package/registry/ui/time-field.json +2 -2
  119. package/registry/ui/timeline.json +16 -0
  120. package/registry/ui/toggle-button.json +2 -2
  121. package/registry/ui/tooltip.json +2 -2
  122. package/registry/ui/typeset.json +2 -2
  123. package/registry/ui/youtube-embed.json +2 -2
  124. package/stubs/scaffold.controller.index.stub +1 -1
  125. package/templates/app/.config/sdxc/ci.ts +26 -0
  126. package/templates/app/.github/workflows/ci.yml +46 -0
  127. package/templates/app/README.md +4 -0
  128. package/templates/app/package.json +1 -0
  129. package/templates/app/public/_headers +4 -0
  130. package/registry/ui/attachment.json +0 -15
  131. package/registry/ui/bubble.json +0 -13
  132. package/registry/ui/chart.json +0 -13
  133. package/registry/ui/color-area.json +0 -13
  134. package/registry/ui/color-field.json +0 -20
  135. package/registry/ui/color-picker.json +0 -17
  136. package/registry/ui/color-slider.json +0 -13
  137. package/registry/ui/color-swatch-picker.json +0 -15
  138. package/registry/ui/color-swatch.json +0 -13
  139. package/registry/ui/color-wheel.json +0 -13
  140. package/registry/ui/context-menu.json +0 -16
  141. package/registry/ui/drop-indicator.json +0 -13
  142. package/registry/ui/drop-zone.json +0 -13
  143. package/registry/ui/empty.json +0 -15
  144. package/registry/ui/feature.json +0 -18
  145. package/registry/ui/file-trigger.json +0 -13
  146. package/registry/ui/grid-list.json +0 -18
  147. package/registry/ui/logo-cloud.json +0 -16
  148. package/registry/ui/marker.json +0 -13
  149. package/registry/ui/marketing-header.json +0 -18
  150. package/registry/ui/marketing-section.json +0 -16
  151. package/registry/ui/menubar.json +0 -13
  152. package/registry/ui/message-scroller.json +0 -16
  153. package/registry/ui/message.json +0 -13
  154. package/registry/ui/resizable.json +0 -13
  155. package/registry/ui/shortcut-list.json +0 -18
  156. package/registry/ui/skeleton.json +0 -13
  157. package/registry/ui/split.json +0 -16
  158. package/registry/ui/stat-strip.json +0 -16
  159. package/registry/ui/table.json +0 -16
  160. package/registry/ui/toast.json +0 -16
  161. package/registry/ui/toolbar.json +0 -13
  162. package/registry/ui/tree.json +0 -18
@@ -1,20 +0,0 @@
1
- {
2
- "name": "color-field",
3
- "changedIn": "2026.10.2",
4
- "dependencies": [
5
- "color-swatch",
6
- "description",
7
- "field-error",
8
- "form",
9
- "input",
10
- "label"
11
- ],
12
- "exports": [
13
- "ColorField"
14
- ],
15
- "source": {
16
- "path": "color-field.tsx",
17
- "content": "/**\n * A labeled, described, and validated color field in one call: every id and\n * `aria-describedby` relationship comes from this instance's own stable\n * identifier, so the composed parts stay associated on their own. The preview\n * paints the resolved value at render time, so it matches the control on\n * first paint and on every server round-trip.\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 { spacer, hstack } from \"@sdxc/u/layout\";\nimport { minIs } from \"@sdxc/u/size\";\n\nimport type { FieldPartsProps } from \"@sdxc/ui/utils\";\n\nimport { fieldStackLayout } from \"@sdxc/ui/styles\";\nimport { resolveFieldWiring } from \"@sdxc/ui/utils\";\n\nimport { ColorSwatch } from \"@sdxc/ui/color-swatch\";\nimport { Description } from \"@sdxc/ui/description\";\nimport { FieldError } from \"@sdxc/ui/field-error\";\nimport { resolveFieldIssue } from \"@sdxc/ui/form\";\nimport { Input } from \"@sdxc/ui/input\";\nimport { Label } from \"@sdxc/ui/label\";\n\n/** Notation {@link ColorField} falls back to when `format` is omitted. */\nconst DEFAULT_FORMAT: ColorField.Format = \"hex\";\n\n/**\n * Preview value {@link ColorField} falls back to when neither `value` nor\n * `defaultValue` is set, painting the preview's checkerboard fully so an\n * empty field reads as empty.\n */\nconst DEFAULT_SWATCH_VALUE = \"transparent\";\n\n/**\n * Native `pattern` constraint for each supported notation, keyed off\n * {@link ColorField.Format}. Every pattern accepts the notation's short and\n * long forms, its optional alpha channel, and either component separator.\n */\nconst FORMAT_PATTERNS: Record<ColorField.Format, string> = {\n\thex: \"#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})\",\n\trgb: \"rgba?\\\\(\\\\s*\\\\d{1,3}%?\\\\s*,?\\\\s*\\\\d{1,3}%?\\\\s*,?\\\\s*\\\\d{1,3}%?\\\\s*([,/]\\\\s*[0-9.]+%?\\\\s*)?\\\\)\",\n\thsl: \"hsla?\\\\(\\\\s*-?\\\\d{1,3}(\\\\.\\\\d+)?(deg)?\\\\s*,?\\\\s*\\\\d{1,3}(\\\\.\\\\d+)?%\\\\s*,?\\\\s*\\\\d{1,3}(\\\\.\\\\d+)?%\\\\s*([,/]\\\\s*[0-9.]+%?\\\\s*)?\\\\)\",\n};\n\n/**\n * Prop types for {@link ColorField}.\n */\nexport namespace ColorField {\n\t/**\n\t * Semantic color role for the control's keyboard focus ring, each mapped\n\t * to its matching `--ui-*` variables.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Notation the control's typed value is constrained to through its native\n\t * `pattern`: `\"hex\"` for `#rgb`/`#rrggbb` and their alpha forms, `\"rgb\"`\n\t * for `rgb()`/`rgba()`, and `\"hsl\"` for `hsl()`/`hsla()`.\n\t */\n\texport type Format = \"hex\" | \"rgb\" | \"hsl\";\n\n\t/**\n\t * Per-part styling for the elements this convenience wrapper composes in\n\t * one call, layered after each part's own built-in styling.\n\t */\n\texport interface PartsProps extends FieldPartsProps {\n\t\t/** Styling for the row grouping the control and its preview. */\n\t\tcontrol?: TagProps<\"div\">[\"mix\"];\n\t\t/** Styling for the live preview, rendered through {@link ColorSwatch}. */\n\t\tswatch?: TagProps<\"span\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link ColorField}. `mix` styles the root element\n\t * grouping the field's parts; style the composed label, control, preview,\n\t * description, and error individually through `parts` instead.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"children\"> {\n\t\t/** Semantic color role for the control's focus ring. Defaults to `\"neutral\"` when omitted. */\n\t\tcolor?: Color;\n\t\t/**\n\t\t * The field's caption, rendered through {@link Label} and associated\n\t\t * with the control through a native `for`/`id` relationship computed\n\t\t * from this instance's own identifier.\n\t\t */\n\t\tlabel: RemixNode;\n\t\t/**\n\t\t * Supporting copy rendered through {@link Description} beneath the\n\t\t * control and referenced by the control's `aria-describedby`.\n\t\t */\n\t\tdescription?: RemixNode;\n\t\t/**\n\t\t * Validation message rendered through {@link FieldError} beneath the\n\t\t * control, referenced by its `aria-describedby`; its presence alone\n\t\t * marks `aria-invalid`. Inside a {@link Form} carrying `issues`, this prop wins.\n\t\t */\n\t\terrorMessage?: RemixNode;\n\t\t/**\n\t\t * Native `autofocus`. Defaults to `true` for the first invalid field of\n\t\t * an enclosing {@link Form}'s `issues`, so a server round-trip lands\n\t\t * keyboard focus on the first problem while staying script-free.\n\t\t */\n\t\tautoFocus?: boolean;\n\t\t/**\n\t\t * Notation the control's `pattern` constrains typed entry to. Defaults\n\t\t * to {@link DEFAULT_FORMAT}.\n\t\t */\n\t\tformat?: Format;\n\t\t/** Native `name` submitted with an enclosing form. */\n\t\tname?: string;\n\t\t/**\n\t\t * Current value, as a literal color string in `format`'s notation, for a\n\t\t * control a consumer tracks itself. This same string paints the\n\t\t * preview directly.\n\t\t */\n\t\tvalue?: string;\n\t\t/**\n\t\t * Initial value, as a literal color string in `format`'s notation, for a\n\t\t * control left to the platform's own uncontrolled state. This same\n\t\t * string paints the preview directly whenever `value` is unset.\n\t\t */\n\t\tdefaultValue?: string;\n\t\t/** Placeholder copy shown while the control is empty. */\n\t\tplaceholder?: string;\n\t\t/** Marks the control required for its enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks the control inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks the control's value fixed, while keeping it focusable and included in form submission. */\n\t\treadOnly?: boolean;\n\t\t/** Native autofill hint. */\n\t\tautoComplete?: string;\n\t\t/** Per-part styling for this wrapper's internally composed elements. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * Composes {@link Label}, an {@link Input} constrained by `format`'s native\n * `pattern`, a live {@link ColorSwatch} preview of the resolved value, and\n * any {@link Description} or {@link FieldError}, wired to this instance's own id.\n *\n * @param handle Runtime handle carrying the root element's props and this instance's stable identifier.\n * @returns The render function producing the field's markup.\n * @example\n * <ColorField label={t(\"form.accentColor.label\")} name=\"accentColor\" defaultValue=\"#3b82f6\" />\n * @example\n * <ColorField\n * \tlabel={t(\"form.brandColor.label\")}\n * \tname=\"brandColor\"\n * \tformat=\"rgb\"\n * \tdefaultValue=\"rgb(16, 185, 129)\"\n * \tdescription={t(\"form.brandColor.hint\")}\n * />\n * @example\n * <ColorField\n * \tlabel={t(\"form.themeColor.label\")}\n * \tname=\"themeColor\"\n * \tformat=\"hsl\"\n * \tvalue=\"hsl(210, 90%, 55%)\"\n * \terrorMessage={t(\"form.themeColor.invalid\")}\n * />\n */\nexport function ColorField(handle: Handle<ColorField.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor,\n\t\t\tlabel,\n\t\t\tdescription,\n\t\t\terrorMessage: errorMessageProp,\n\t\t\tautoFocus,\n\t\t\tformat,\n\t\t\tname,\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tplaceholder,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\treadOnly,\n\t\t\tautoComplete,\n\t\t\t\"aria-invalid\": ariaInvalidProp,\n\t\t\tparts,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet { errorMessage, isFirstInvalid } = resolveFieldIssue(handle, name, errorMessageProp);\n\t\tlet resolvedAutoFocus = autoFocus ?? (isFirstInvalid || undefined);\n\t\tlet { resolvedColor, resolvedInvalid, descriptionId, errorId, describedBy } =\n\t\t\tresolveFieldWiring(handle.id, {\n\t\t\t\tcolor,\n\t\t\t\terrorMessage,\n\t\t\t\tdescription,\n\t\t\t\tariaInvalid: ariaInvalidProp,\n\t\t\t});\n\t\tlet resolvedFormat = format ?? DEFAULT_FORMAT;\n\t\tlet resolvedSwatchValue = value ?? defaultValue ?? DEFAULT_SWATCH_VALUE;\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"color-field\" mix={[fieldStackLayout(), mix]}>\n\t\t\t\t<Label htmlFor={handle.id} mix={parts?.label}>\n\t\t\t\t\t{label}\n\t\t\t\t</Label>\n\t\t\t\t<div data-slot=\"control\" mix={[hstack({ gap: 2, align: \"center\" }), parts?.control]}>\n\t\t\t\t\t<Input\n\t\t\t\t\t\tid={handle.id}\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tname={name}\n\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\tpattern={FORMAT_PATTERNS[resolvedFormat]}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\t\t// oxlint-disable-next-line jsx-a11y/no-autofocus -- Not a focus grab on page load: this only ever resolves true for the first field an enclosing Form reports as invalid, so a failed submit lands the user on the problem instead of leaving them to hunt for it.\n\t\t\t\t\t\tautoFocus={resolvedAutoFocus}\n\t\t\t\t\t\taria-invalid={resolvedInvalid}\n\t\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\t\tcolor={resolvedColor}\n\t\t\t\t\t\tmix={[spacer(), minIs(0), parts?.input]}\n\t\t\t\t\t/>\n\t\t\t\t\t<ColorSwatch value={resolvedSwatchValue} size=\"lg\" mix={parts?.swatch} />\n\t\t\t\t</div>\n\t\t\t\t{description ? (\n\t\t\t\t\t<Description id={descriptionId} mix={parts?.description}>\n\t\t\t\t\t\t{description}\n\t\t\t\t\t</Description>\n\t\t\t\t) : null}\n\t\t\t\t{errorMessage ? (\n\t\t\t\t\t<FieldError id={errorId} mix={parts?.error}>\n\t\t\t\t\t\t{errorMessage}\n\t\t\t\t\t</FieldError>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t);\n\t};\n}\n"
18
- },
19
- "test": null
20
- }
@@ -1,17 +0,0 @@
1
- {
2
- "name": "color-picker",
3
- "changedIn": "2026.10.20",
4
- "dependencies": [
5
- "color-field",
6
- "color-swatch",
7
- "popover"
8
- ],
9
- "exports": [
10
- "ColorPicker"
11
- ],
12
- "source": {
13
- "path": "color-picker.tsx",
14
- "content": "/**\n * A labeled color field composing {@link ColorField}'s plain fallback with\n * an optional {@link ColorPicker.Group} trigger row and\n * {@link ColorPicker.Dialog} picking surface swapped in via `children`.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { outline } from \"@sdxc/u/color\";\nimport { opacity, rounded, transition } from \"@sdxc/u/effects\";\nimport { cursor, raw } from \"@sdxc/u/general\";\nimport { hstack, inlineFlex, items, justify, relative, shrink, vstack } from \"@sdxc/u/layout\";\nimport { media } from \"@sdxc/u/responsive\";\nimport { bs, is, p } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { warnIfNoAccessibleLabel } from \"@sdxc/ui/utils\";\n\nimport { ColorField } from \"@sdxc/ui/color-field\";\nimport { ColorSwatch } from \"@sdxc/ui/color-swatch\";\nimport { Popover } from \"@sdxc/ui/popover\";\n\n/**\n * Native `<button>` `type` {@link ColorPicker.Trigger} falls back to,\n * keeping an omitted `type` from implicitly submitting an enclosing\n * `<form>` the way a bare `<button>` would.\n */\nconst DEFAULT_BUTTON_TYPE: NonNullable<ColorPicker.TriggerProps[\"type\"]> = \"button\";\n\n/**\n * Shape variant {@link ColorPicker.Trigger} falls back to when `shape` is\n * omitted, mirroring {@link ColorSwatch}'s own default so a trigger left\n * unstyled reads the same as a bare swatch.\n */\nconst DEFAULT_TRIGGER_SHAPE: ColorSwatch.Shape = \"rounded\";\n\n/**\n * `role` applied to {@link ColorPicker.Dialog}'s host through {@link attrs}\n * unless a consumer supplies its own `role`, identifying the surface as a\n * non-modal dialog layered above the page rather than a full-screen modal.\n */\nconst DEFAULT_DIALOG_ROLE = \"dialog\";\n\n/**\n * Side of the trigger {@link ColorPicker.Dialog} renders against when\n * `placement` is left unset, reading down and start-ward the way a dropdown\n * conventionally does.\n */\nconst DEFAULT_DIALOG_PLACEMENT: Popover.Placement = \"bottom-start\";\n\n/**\n * Prop types for {@link ColorPicker} and its compound parts.\n */\nexport namespace ColorPicker {\n\t/**\n\t * Semantic color role for the fallback field's keyboard focus ring,\n\t * mirroring {@link ColorField.Color}. The composed layout carries no\n\t * `color` prop of its own, since a consumer renders it directly.\n\t */\n\texport type Color = ColorField.Color;\n\n\t/**\n\t * Every prop {@link ColorField.PartsProps} accepts, unchanged, applied\n\t * only to the fallback field's internally composed parts — the composed\n\t * layout styles its own parts individually instead.\n\t */\n\texport interface PartsProps extends ColorField.PartsProps {}\n\n\t/**\n\t * Props accepted by {@link ColorPicker}. Leaving `children` unset renders\n\t * {@link ColorField}'s plain fallback using every field below; composing\n\t * {@link ColorPicker.Group} and {@link ColorPicker.Dialog} instead skips them.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"children\"> {\n\t\t/** Semantic color role for the fallback field's focus ring. Read only when `children` is unset. */\n\t\tcolor?: Color;\n\t\t/** The fallback field's caption, rendered through {@link ColorField}. Read only when `children` is unset. */\n\t\tlabel?: RemixNode;\n\t\t/** Supporting copy beneath the fallback field. Read only when `children` is unset. */\n\t\tdescription?: RemixNode;\n\t\t/** Validation message beneath the fallback field. Read only when `children` is unset. */\n\t\terrorMessage?: RemixNode;\n\t\t/** Notation the fallback field's typed entry is constrained to. Read only when `children` is unset. */\n\t\tformat?: ColorField.Format;\n\t\t/** Native `name` submitted with an enclosing form, read only by the fallback field. */\n\t\tname?: string;\n\t\t/** Current value, as a literal color string, for a fallback field a consumer tracks itself. */\n\t\tvalue?: string;\n\t\t/** Initial value, as a literal color string, for a fallback field left to the platform's own uncontrolled state. */\n\t\tdefaultValue?: string;\n\t\t/** Placeholder copy shown while the fallback field is empty. */\n\t\tplaceholder?: string;\n\t\t/** Marks the fallback field required for its enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks the fallback field inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Marks the fallback field's value fixed, while keeping it focusable and included in form submission. */\n\t\treadOnly?: boolean;\n\t\t/** Native autofill hint for the fallback field. */\n\t\tautoComplete?: string;\n\t\t/** Per-part styling for the fallback field's internally composed parts. Read only when `children` is unset. */\n\t\tparts?: PartsProps;\n\t\t/**\n\t\t * The trigger-and-panel layout — typically a `Label`,\n\t\t * {@link ColorPicker.Group}, and {@link ColorPicker.Dialog} — rendered in\n\t\t * place of {@link ColorField}'s plain fallback. Unset renders that fallback.\n\t\t */\n\t\tchildren?: RemixNode;\n\t}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * `children` composes the field's own control and\n\t * {@link ColorPicker.Trigger} into one visual row.\n\t */\n\texport interface GroupProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<button>` attribute except `children`, fixed to this\n\t * button's own {@link ColorSwatch}. Point `commandfor` at\n\t * {@link ColorPicker.Dialog}'s `id` with `command=\"toggle-popover\"` to wire it up.\n\t */\n\texport interface TriggerProps extends Omit<TagProps<\"button\">, \"children\"> {\n\t\t/**\n\t\t * The color this trigger previews, already resolved to a literal CSS\n\t\t * color value — the same value its inner {@link ColorSwatch} paints.\n\t\t * Required, since a trigger with nothing to preview has no reason to render.\n\t\t */\n\t\tvalue: string;\n\t\t/** Shape variant for the inner {@link ColorSwatch}, mirrored onto the button host so its own corners match. Defaults to {@link DEFAULT_TRIGGER_SHAPE}. */\n\t\tshape?: ColorSwatch.Shape;\n\t}\n\n\t/**\n\t * Every prop {@link Popover.Props} accepts, since {@link ColorPicker.Dialog}\n\t * renders one directly as its host. `placement` defaults to\n\t * {@link DEFAULT_DIALOG_PLACEMENT}.\n\t */\n\texport interface DialogProps extends Popover.Props {}\n}\n\n/**\n * Renders {@link ColorPicker}'s root: {@link ColorField}'s plain fallback\n * when `children` is unset, or the trigger-and-panel layout composed from\n * {@link ColorPicker.Group} and {@link ColorPicker.Dialog} otherwise.\n *\n * @param handle Runtime handle carrying the root element's props.\n * @returns The render function producing the color picker's markup.\n * @example\n * <ColorPicker label={t(\"form.accentColor.label\")} name=\"accentColor\" defaultValue=\"#3b82f6\" />\n * @example\n * <ColorPicker>\n * \t<Label htmlFor=\"brandColor\">{t(\"form.brandColor.label\")}</Label>\n * \t<ColorPicker.Group>\n * \t\t<Input id=\"brandColor\" type=\"text\" name=\"brandColor\" defaultValue=\"#3b82f6\" />\n * \t\t<ColorPicker.Trigger\n * \t\t\tcommandfor=\"brandColor-panel\"\n * \t\t\tcommand=\"toggle-popover\"\n * \t\t\taria-label={t(\"form.brandColor.toggle\")}\n * \t\t\tvalue=\"#3b82f6\"\n * \t\t/>\n * \t</ColorPicker.Group>\n * \t<ColorPicker.Dialog id=\"brandColor-panel\">\n * \t\t{...the picking surface — see ColorPicker.Dialog's own doc comment}\n * \t</ColorPicker.Dialog>\n * </ColorPicker>\n */\nexport function ColorPicker(handle: Handle<ColorPicker.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tcolor,\n\t\t\tlabel,\n\t\t\tdescription,\n\t\t\terrorMessage,\n\t\t\tformat,\n\t\t\tname,\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tplaceholder,\n\t\t\trequired,\n\t\t\tdisabled,\n\t\t\treadOnly,\n\t\t\tautoComplete,\n\t\t\tparts,\n\t\t\tchildren,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\n\t\tif (import.meta.env?.DEV && !children && !label) {\n\t\t\tconsole.warn(\n\t\t\t\t'ColorPicker: falling back to ColorField\\'s plain color-notation field needs a \"label\" describing what it collects for assistive technology.',\n\t\t\t);\n\t\t}\n\n\t\tif (!children) {\n\t\t\treturn (\n\t\t\t\t<ColorField\n\t\t\t\t\t{...rest}\n\t\t\t\t\tcolor={color}\n\t\t\t\t\tlabel={label}\n\t\t\t\t\tdescription={description}\n\t\t\t\t\terrorMessage={errorMessage}\n\t\t\t\t\tformat={format}\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tautoComplete={autoComplete}\n\t\t\t\t\tparts={parts}\n\t\t\t\t\tmix={mix}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"color-picker\" mix={[vstack({ gap: 1 }), mix]}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link ColorPicker}'s control row: a plain flex host laying the\n * field's own control and {@link ColorPicker.Trigger} side by side, with a\n * keyboard focus ring on the whole row the moment focus lands anywhere inside.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <ColorPicker.Group>\n * \t<Input id=\"brandColor\" type=\"text\" name=\"brandColor\" defaultValue=\"#3b82f6\" />\n * \t<ColorPicker.Trigger\n * \t\tcommandfor=\"brandColor-panel\"\n * \t\tcommand=\"toggle-popover\"\n * \t\taria-label={t(\"form.brandColor.toggle\")}\n * \t\tvalue=\"#3b82f6\"\n * \t/>\n * </ColorPicker.Group>\n */\nColorPicker.Group = function ColorPickerGroup(handle: Handle<ColorPicker.GroupProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"group\"\n\t\t\t\tmix={[\n\t\t\t\t\t/**\n\t\t\t\t\t * Focus is shown by the control that holds it, the way `Group` shows it: a ring\n\t\t\t\t\t * around the row says the group is focused without saying whether the field or\n\t\t\t\t\t * the preview has it, and it stacks with the ring that control draws for itself.\n\t\t\t\t\t */\n\t\t\t\t\thstack({ gap: 2, align: \"center\" }),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link ColorPicker}'s trailing trigger: a `<button>` housing a\n * {@link ColorSwatch} that fills it as a live preview, wired via\n * `commandfor`/`command=\"toggle-popover\"` to {@link ColorPicker.Dialog}'s `id`.\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 * <ColorPicker.Trigger\n * \tcommandfor=\"brandColor-panel\"\n * \tcommand=\"toggle-popover\"\n * \taria-label={t(\"form.brandColor.toggle\")}\n * \tvalue=\"#3b82f6\"\n * />\n */\nColorPicker.Trigger = function ColorPickerTrigger(handle: Handle<ColorPicker.TriggerProps>) {\n\treturn () => {\n\t\tlet { type, value, shape, mix, ...rest } = handle.props;\n\t\tlet resolvedType = type ?? DEFAULT_BUTTON_TYPE;\n\t\tlet resolvedShape = shape ?? DEFAULT_TRIGGER_SHAPE;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t\"ColorPicker.Trigger: this button needs an `aria-label` describing what it does — its content is a color preview with no accessible name of its own.\",\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=\"trigger\"\n\t\t\t\tdata-shape={resolvedShape}\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\trelative(),\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\tis(\"var(--ui-color-picker-trigger-size, 2.25rem)\"),\n\t\t\t\t\tbs(\"var(--ui-color-picker-trigger-size, 2.25rem)\"),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tcursor(\"pointer\"),\n\t\t\t\t\ttransition(\"box-shadow\"),\n\t\t\t\t\twhen('&[data-shape=\"circle\"]', rounded(\"full\")),\n\t\t\t\t\twhen(\"&:disabled\", [cursor(\"not-allowed\"), opacity(50)]),\n\t\t\t\t\tp(0),\n\t\t\t\t\tshrink(),\n\t\t\t\t\twhen('&[data-shape=\"square\"]', rounded(\"none\")),\n\t\t\t\t\t/**\n\t\t\t\t\t * The swatch grows through the size variable it reads itself: a size passed down as\n\t\t\t\t\t * `mix` compiles into its own cascade layer, which can land before the swatch's own\n\t\t\t\t\t * and leave the preview at its default size in a corner of the button.\n\t\t\t\t\t */\n\t\t\t\t\traw({ \"--ui-color-swatch-size-md\": \"100%\" }),\n\t\t\t\t\t/**\n\t\t\t\t\t * Hover steps the preview's edge one shade darker, so the edge the swatch already\n\t\t\t\t\t * draws stays the only one and the border reads once.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"&:hover\", raw({ boxShadow: \"0 0 0 1px var(--ui-neutral-border-hover)\" })),\n\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", raw({ transitionDuration: \"0s\" })),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<ColorSwatch value={value} shape={resolvedShape} />\n\t\t\t</button>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link ColorPicker}'s picking surface: a Popover, defaulting\n * `placement` to bottom-start and `role` to `\"dialog\"`, padding whatever\n * picking controls a consumer composes as `children` in a single column.\n *\n * @param handle Runtime handle carrying the host's `Popover` props.\n * @returns The render function producing the surface's markup.\n * @example\n * <ColorPicker.Dialog id=\"brandColor-panel\">\n * \t<ColorArea aria-label={t(\"colorPicker.area\")} hue={hue} defaultSaturation={saturation} defaultValue={brightness} mix={colorAreaDrag()}>\n * \t\t<ColorArea.SaturationThumb data-color-area-axis=\"x\" aria-label={t(\"colorPicker.saturation\")} />\n * \t\t<ColorArea.ValueThumb data-color-area-axis=\"y\" aria-label={t(\"colorPicker.brightness\")} />\n * \t</ColorArea>\n * \t<ColorWheel aria-label={t(\"colorPicker.hue\")} defaultValue={hue} mix={colorWheelDrag()} />\n * \t<ColorSlider channel=\"alpha\" defaultValue={alpha}>\n * \t\t<ColorSlider.Track hue={hue}>\n * \t\t\t<ColorSlider.Thumb aria-label={t(\"colorPicker.alpha\")} />\n * \t\t</ColorSlider.Track>\n * \t</ColorSlider>\n * \t<ColorField label={t(\"colorPicker.hex\")} format=\"hex\" defaultValue=\"#3b82f6\" mix={colorPreview()} />\n * \t<ColorSwatchPicker aria-label={t(\"colorPicker.presets\")}>\n * \t\t<ColorSwatchPicker.Swatch value=\"#ef4444\" aria-label={t(\"color.red\")} />\n * \t\t<ColorSwatchPicker.Swatch value=\"#3b82f6\" aria-label={t(\"color.blue\")} defaultChecked />\n * \t</ColorSwatchPicker>\n * </ColorPicker.Dialog>\n */\nColorPicker.Dialog = function ColorPickerDialog(handle: Handle<ColorPicker.DialogProps>) {\n\treturn () => {\n\t\tlet { placement, children, mix, ...rest } = handle.props;\n\t\tlet resolvedPlacement = placement ?? DEFAULT_DIALOG_PLACEMENT;\n\n\t\treturn (\n\t\t\t<Popover\n\t\t\t\t{...rest}\n\t\t\t\tplacement={resolvedPlacement}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_DIALOG_ROLE }),\n\t\t\t\t\tvstack({ gap: 4 }),\n\t\t\t\t\tp(4),\n\t\t\t\t\traw({ outline: \"none\" }),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Popover>\n\t\t);\n\t};\n};\n"
15
- },
16
- "test": null
17
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "color-slider",
3
- "changedIn": "2026.10.13",
4
- "dependencies": [],
5
- "exports": [
6
- "ColorSlider"
7
- ],
8
- "source": {
9
- "path": "color-slider.tsx",
10
- "content": "/**\n * A single-channel color control on a native `<input type=\"range\">`, pairing\n * a track painting the channel's gradient with a thumb reporting the current\n * value and an `<output>` for its formatted display. The root shares the\n * resolved channel, range, and value with every part through context.\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, outlineStyle } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { cursor, pseudoContent } from \"@sdxc/u/general\";\nimport { absolute, appearance, insBe, insBs, inset, relative, vstack } from \"@sdxc/u/layout\";\nimport { bs, is, m, minIs } from \"@sdxc/u/size\";\nimport { z } from \"@sdxc/u/stacking\";\nimport { when } from \"@sdxc/u/state\";\n\nimport { outputCaptionText } from \"@sdxc/ui/styles\";\nimport { rangeThumbAppearance } from \"@sdxc/ui/styles\";\nimport { rtlAwareGradientDirection } from \"@sdxc/ui/styles\";\nimport { HUE_GRADIENT_STOPS } from \"@sdxc/ui/utils\";\nimport { mergeStyle } from \"@sdxc/ui/utils\";\n\n/**\n * Custom property carrying a {@link ColorSlider.Track}'s gradient direction,\n * mirrored under `:dir(rtl)` so one gradient string paints correctly in both\n * writing directions.\n */\nconst TRACK_DIRECTION_PROPERTY = \"--ui-color-slider-track-direction\";\n\n/**\n * Custom property carrying the color's current hue, in degrees, that a\n * `\"saturation\"`, `\"lightness\"`, or `\"alpha\"` {@link ColorSlider.Track} reads\n * its gradient formula from.\n */\nconst TRACK_HUE_PROPERTY = \"--ui-color-slider-hue\";\n\n/** Hue {@link ColorSlider.Track} falls back to when its `hue` prop is omitted. */\nconst DEFAULT_HUE = 0;\n\n/** Lower bound every {@link ColorSlider.Channel} shares, applied when `min` is omitted. */\nconst DEFAULT_MIN = 0;\n\n/** Upper bound {@link ColorSlider.Props} falls back to, keyed by {@link ColorSlider.Channel}, when `max` is omitted. */\nconst DEFAULT_MAX_BY_CHANNEL: Record<ColorSlider.Channel, number> = {\n\thue: 360,\n\tsaturation: 100,\n\tlightness: 100,\n\talpha: 1,\n};\n\n/** Native `step` {@link ColorSlider.Thumb} falls back to, keyed by {@link ColorSlider.Channel}, when `step` is omitted. */\nconst DEFAULT_STEP_BY_CHANNEL: Record<ColorSlider.Channel, number> = {\n\thue: 1,\n\tsaturation: 1,\n\tlightness: 1,\n\talpha: 0.01,\n};\n\n/**\n * Negative inset growing {@link ColorSlider.Thumb}'s native input across the track's\n * block axis to the larger of the thumb and `--ui-target-size`, clamped at zero so a\n * track already that thick keeps its own box.\n */\nconst THUMB_HIT_INSET =\n\t\"min(0px, calc((100% - max(var(--ui-color-slider-thumb-size, 1.25rem), var(--ui-target-size, 1.5rem))) / 2))\";\n\n/**\n * Builds one {@link ColorSlider.Track} gradient string from its color stops,\n * reading {@link TRACK_DIRECTION_PROPERTY} for its direction so the same\n * stops mirror correctly under `:dir(rtl)` from one shared gradient string.\n */\nfunction trackGradient(stops: string): string {\n\treturn `linear-gradient(to var(${TRACK_DIRECTION_PROPERTY}, right), ${stops})`;\n}\n\n/** The full, fixed rainbow a `\"hue\"` {@link ColorSlider.Track} always paints. */\nconst HUE_GRADIENT = trackGradient(HUE_GRADIENT_STOPS);\n\n/** A `\"saturation\"` {@link ColorSlider.Track}'s gradient: fully desaturated through fully saturated, at {@link TRACK_HUE_PROPERTY}'s hue. */\nconst SATURATION_GRADIENT = trackGradient(\n\t`hsl(var(${TRACK_HUE_PROPERTY}, 0) 0% 50%), hsl(var(${TRACK_HUE_PROPERTY}, 0) 100% 50%)`,\n);\n\n/** A `\"lightness\"` {@link ColorSlider.Track}'s gradient: black through {@link TRACK_HUE_PROPERTY}'s hue through white. */\nconst LIGHTNESS_GRADIENT = trackGradient(\n\t`black, hsl(var(${TRACK_HUE_PROPERTY}, 0) 100% 50%), white`,\n);\n\n/** An `\"alpha\"` {@link ColorSlider.Track}'s gradient: fully transparent through {@link TRACK_HUE_PROPERTY}'s hue at full opacity, over the track's own checkerboard backdrop. */\nconst ALPHA_GRADIENT = trackGradient(`transparent, hsl(var(${TRACK_HUE_PROPERTY}, 0) 100% 50%)`);\n\n/**\n * Prop types for {@link ColorSlider} and its compound parts.\n */\nexport namespace ColorSlider {\n\t/**\n\t * The single color channel one {@link ColorSlider} instance edits. Every\n\t * channel but `\"hue\"` itself also shares its live color through the `hue`\n\t * prop its {@link Track} reads.\n\t */\n\texport type Channel = \"hue\" | \"saturation\" | \"lightness\" | \"alpha\";\n\n\t/**\n\t * Value {@link ColorSlider} stores in component context so every\n\t * {@link ColorSlider.Track} and {@link ColorSlider.Thumb} nested inside\n\t * shares the same resolved channel, range, and value.\n\t */\n\texport interface Context {\n\t\t/** The channel this instance edits. Mirrored onto the root's own `data-channel` attribute, which {@link ColorSlider.Track} reads to pick its gradient formula. */\n\t\tchannel: Channel;\n\t\t/** Resolved lower bound of the channel's range, shared with {@link ColorSlider.Thumb}. */\n\t\tmin: number;\n\t\t/** Resolved upper bound of the channel's range, shared with {@link ColorSlider.Thumb}. */\n\t\tmax: number;\n\t\t/** Resolved current value, used as {@link ColorSlider.Thumb}'s own default value. */\n\t\tvalue: number;\n\t}\n\n\t/**\n\t * Props accepted by {@link ColorSlider}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** The single channel this instance edits. */\n\t\tchannel: Channel;\n\t\t/** Lower bound of the channel's range. Defaults to {@link DEFAULT_MIN}. */\n\t\tmin?: number;\n\t\t/** Upper bound of the channel's range. Defaults to `channel`'s entry in {@link DEFAULT_MAX_BY_CHANNEL}. */\n\t\tmax?: number;\n\t\t/** Current value, for an instance whose value the consumer tracks itself. */\n\t\tvalue?: number;\n\t\t/** Starting value, for an instance that never tracks its own value. */\n\t\tdefaultValue?: number;\n\t}\n\n\t/**\n\t * Props accepted by {@link ColorSlider.Track}.\n\t */\n\texport interface TrackProps extends TagProps<\"div\"> {\n\t\t/**\n\t\t * The color's current hue, in degrees `0`–`360`, read into\n\t\t * {@link TRACK_HUE_PROPERTY} at render time so a `\"saturation\"`,\n\t\t * `\"lightness\"`, or `\"alpha\"` track's gradient matches it. Defaults to {@link DEFAULT_HUE}.\n\t\t */\n\t\thue?: number;\n\t}\n\n\t/**\n\t * Every native `<input>` attribute except `type` and `role`, fixed to\n\t * `\"range\"` and the platform's implicit `\"slider\"` role, plus the `mix`\n\t * passthrough. `min`/`max`/`step` override the range inherited from the nearest ancestor {@link ColorSlider}.\n\t */\n\texport interface ThumbProps extends Omit<TagProps<\"input\">, \"type\" | \"role\"> {}\n\n\t/**\n\t * Props accepted by {@link ColorSlider.Output}. Associate it with a thumb\n\t * by passing the paired {@link ColorSlider.Thumb}'s own `id` explicitly as\n\t * `htmlFor`.\n\t */\n\texport interface OutputProps extends TagProps<\"output\"> {}\n}\n\n/**\n * Renders the root host: a `<div>` stacking its children with a small gap,\n * resolving the channel, range, and value into component context and\n * mirroring the channel onto its own `data-channel` attribute.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props and providing {@link ColorSlider.Context}.\n * @returns The render function producing the root's markup.\n * @example\n * <ColorSlider channel=\"hue\" defaultValue={210}>\n * \t<ColorSlider.Output htmlFor=\"accent-hue-thumb\">210°</ColorSlider.Output>\n * \t<ColorSlider.Track>\n * \t\t<ColorSlider.Thumb id=\"accent-hue-thumb\" aria-label={t(\"colorPicker.hue\")} />\n * \t</ColorSlider.Track>\n * </ColorSlider>\n * @example\n * <ColorSlider channel=\"alpha\" min={0} max={1} defaultValue={1}>\n * \t<ColorSlider.Track hue={210}>\n * \t\t<ColorSlider.Thumb aria-label={t(\"colorPicker.alpha\")} />\n * \t</ColorSlider.Track>\n * </ColorSlider>\n */\nexport function ColorSlider(handle: Handle<ColorSlider.Props, ColorSlider.Context>) {\n\treturn () => {\n\t\tlet { channel, min, max, value, defaultValue, mix, ...rest } = handle.props;\n\t\tlet resolvedMin = min ?? DEFAULT_MIN;\n\t\tlet resolvedMax = max ?? DEFAULT_MAX_BY_CHANNEL[channel];\n\t\tlet resolvedValue = value ?? defaultValue ?? resolvedMin;\n\n\t\thandle.context.set({ channel, min: resolvedMin, max: resolvedMax, value: resolvedValue });\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tdata-channel={channel}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tvstack({ gap: 2 }),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * The slider takes the width it is given, so a narrow panel keeps the track inside it\n\t\t\t\t\t * instead of overflowing with the track running off the edge.\n\t\t\t\t\t */\n\t\t\t\t\tminIs(0),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders the visual track: a `position: relative` `<div>` painting its\n * whole length with the gradient the nearest ancestor {@link ColorSlider}'s\n * `data-channel` attribute selects, over a checkerboard backdrop.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the track's markup.\n * @example\n * <ColorSlider.Track>\n * \t<ColorSlider.Thumb aria-label={t(\"colorPicker.hue\")} />\n * </ColorSlider.Track>\n * @example\n * <ColorSlider.Track hue={210}>\n * \t<ColorSlider.Thumb aria-label={t(\"colorPicker.lightness\")} />\n * </ColorSlider.Track>\n */\nColorSlider.Track = function ColorSliderTrack(handle: Handle<ColorSlider.TrackProps>) {\n\treturn () => {\n\t\tlet { hue, mix, style, ...rest } = handle.props;\n\t\tlet resolvedHue = hue ?? DEFAULT_HUE;\n\t\tlet resolvedStyle = mergeStyle(style, { [TRACK_HUE_PROPERTY]: `${resolvedHue}` });\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tstyle={resolvedStyle}\n\t\t\t\tmix={[\n\t\t\t\t\trtlAwareGradientDirection(TRACK_DIRECTION_PROPERTY),\n\t\t\t\t\trelative(),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\tbs(\"var(--ui-color-slider-thumb-size, 1.25rem)\"),\n\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\twhen(\"&::before\", [\n\t\t\t\t\t\tabsolute(),\n\t\t\t\t\t\tinset(\"0\"),\n\t\t\t\t\t\trounded(\"inherit\"),\n\t\t\t\t\t\tbg({\n\t\t\t\t\t\t\timage:\n\t\t\t\t\t\t\t\t\"repeating-conic-gradient(var(--ui-neutral-border) 0% 25%, var(--ui-neutral-bg-tint) 0% 50%)\",\n\t\t\t\t\t\t\tsize: \"var(--ui-color-slider-checker-size, 0.625rem) var(--ui-color-slider-checker-size, 0.625rem)\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tpseudoContent('\"\"'),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\"&::after\", [absolute(), inset(\"0\"), rounded(\"inherit\"), pseudoContent('\"\"')]),\n\n\t\t\t\t\twhen('[data-channel=\"hue\"] &::after', bg({ image: HUE_GRADIENT })),\n\t\t\t\t\twhen('[data-channel=\"saturation\"] &::after', bg({ image: SATURATION_GRADIENT })),\n\t\t\t\t\twhen('[data-channel=\"lightness\"] &::after', bg({ image: LIGHTNESS_GRADIENT })),\n\t\t\t\t\twhen('[data-channel=\"alpha\"] &::after', bg({ image: ALPHA_GRADIENT })),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders the interactive thumb: a native `<input type=\"range\">` reset to\n * cover its enclosing {@link ColorSlider.Track}'s entire box, so drag,\n * arrow-key, and click-to-jump behavior spans the track's whole length.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the thumb's markup.\n * @example\n * <ColorSlider.Thumb aria-label={t(\"colorPicker.hue\")} />\n * @example\n * <ColorSlider.Thumb aria-label={t(\"colorPicker.alpha\")} disabled />\n */\nColorSlider.Thumb = function ColorSliderThumb(handle: Handle<ColorSlider.ThumbProps>) {\n\treturn () => {\n\t\tlet { id, min, max, step, value, defaultValue, mix, ...rest } = handle.props;\n\t\tlet context = handle.context.get(ColorSlider);\n\t\tlet resolvedStep = step ?? DEFAULT_STEP_BY_CHANNEL[context.channel];\n\t\tlet resolvedValue = value ?? defaultValue ?? context.value;\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"range\"\n\t\t\t\tid={id ?? handle.id}\n\t\t\t\tmin={min ?? context.min}\n\t\t\t\tmax={max ?? context.max}\n\t\t\t\tstep={resolvedStep}\n\t\t\t\tdefaultValue={resolvedValue}\n\t\t\t\tmix={[\n\t\t\t\t\trangeThumbAppearance(\n\t\t\t\t\t\t\"--ui-color-slider-thumb-size\",\n\t\t\t\t\t\t\"--ui-color-slider-thumb-border-width\",\n\t\t\t\t\t),\n\t\t\t\t\tabsolute(),\n\t\t\t\t\tz(10),\n\t\t\t\t\tappearance(),\n\t\t\t\t\tcursor(\"pointer\"),\n\t\t\t\t\twhen(\"&:disabled\", cursor(\"not-allowed\")),\n\t\t\t\t\tinset(\"0\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * The native input reaches past the track's block axis to a full pointer target,\n\t\t\t\t\t * centred so the thumb stays on the visible gradient.\n\t\t\t\t\t */\n\t\t\t\t\tinsBs(THUMB_HIT_INSET),\n\t\t\t\t\tinsBe(THUMB_HIT_INSET),\n\t\t\t\t\tm(\"0\"),\n\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\toutlineStyle(\"none\"),\n\n\t\t\t\t\twhen(\"&::-webkit-slider-runnable-track\", [\n\t\t\t\t\t\tbs(\"full\"),\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\tappearance(\"none\", { moz: false }),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\"&::-moz-range-track\", [\n\t\t\t\t\t\tbs(\"full\"),\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\tborder({ style: \"none\" }),\n\t\t\t\t\t\tappearance(\"none\", { webkit: false, moz: false }),\n\t\t\t\t\t]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a live readout: a native `<output>` reporting the formatted value\n * passed as `children`. Pass the paired {@link ColorSlider.Thumb}'s own `id`\n * explicitly as `htmlFor` to associate the two.\n *\n * @param handle Runtime handle carrying the host `<output>`'s props.\n * @returns The render function producing the readout's markup.\n * @example\n * <ColorSlider.Output htmlFor=\"accent-hue-thumb\">\n * \t{new Intl.NumberFormat(locale, { style: \"unit\", unit: \"degree\" }).format(210)}\n * </ColorSlider.Output>\n */\nColorSlider.Output = function ColorSliderOutput(handle: Handle<ColorSlider.OutputProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <output {...rest} mix={[outputCaptionText(), mix]} />;\n\t};\n};\n"
11
- },
12
- "test": null
13
- }
@@ -1,15 +0,0 @@
1
- {
2
- "name": "color-swatch-picker",
3
- "changedIn": "2026.10.13",
4
- "dependencies": [
5
- "color-swatch"
6
- ],
7
- "exports": [
8
- "ColorSwatchPicker"
9
- ],
10
- "source": {
11
- "path": "color-swatch-picker.tsx",
12
- "content": "/**\n * A set of mutually exclusive color options built from native `<input\n * type=\"radio\">` controls sharing one grouping name, rendered as a\n * `role=\"radiogroup\"` host wrapping {@link ColorSwatchPicker.Swatch}\n * instances styled from each input's own `:checked` state.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { visuallyHidden } from \"@sdxc/u/a11y\";\nimport { border, outline } from \"@sdxc/u/color\";\nimport { opacity, ringShadow, transition } from \"@sdxc/u/effects\";\nimport { cursor } from \"@sdxc/u/general\";\nimport { flexWrap, hstack, inlineFlex, relative } from \"@sdxc/u/layout\";\nimport { precededBy, when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { hitArea } from \"@sdxc/ui/styles\";\n\nimport { ColorSwatch } from \"@sdxc/ui/color-swatch\";\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 * Prop types for {@link ColorSwatchPicker} and its\n * {@link ColorSwatchPicker.Swatch} compound part.\n */\nexport namespace ColorSwatchPicker {\n\t/**\n\t * Value {@link ColorSwatchPicker} stores in component context so every\n\t * {@link ColorSwatchPicker.Swatch} nested inside shares the same native\n\t * grouping name without a consumer repeating it on each option.\n\t */\n\texport interface Context {\n\t\t/** Shared `name` every {@link ColorSwatchPicker.Swatch} reads unless it sets its own. */\n\t\tname: string;\n\t}\n\n\t/**\n\t * Props accepted by {@link ColorSwatchPicker}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Native grouping name shared by every {@link ColorSwatchPicker.Swatch}\n\t\t * nested inside. Defaults to the group's own\n\t\t * {@link Handle.id | stable instance id} when omitted.\n\t\t */\n\t\tname?: string;\n\t}\n\n\t/**\n\t * Props accepted by {@link ColorSwatchPicker.Swatch}.\n\t */\n\texport interface SwatchProps extends Omit<TagProps<\"label\">, \"children\" | \"aria-label\"> {\n\t\t/**\n\t\t * The color this option submits and previews, already resolved to a\n\t\t * literal CSS color value — the same value {@link ColorSwatch} paints\n\t\t * its indicator with and submits with the enclosing form.\n\t\t */\n\t\tvalue: string;\n\t\t/**\n\t\t * Accessible name announced for this option in place of visible text —\n\t\t * a color's name, for instance. Required, since the indicator identifies\n\t\t * the option to assistive technology through this text alone.\n\t\t */\n\t\t\"aria-label\": 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 ColorSwatchPicker} —\n\t\t * set this only to opt a single option out of its group's shared name.\n\t\t */\n\t\tname?: string;\n\t\t/** The indicator's shape variant, forwarded to {@link ColorSwatch}. */\n\t\tshape?: ColorSwatch.Shape;\n\t\t/** The indicator's size variant, forwarded to {@link ColorSwatch}. */\n\t\tsize?: ColorSwatch.Size;\n\t\t/** Whether this option starts selected, for a form that never tracks selection itself. */\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/**\n\t\t * Per-part styling for the option's hidden `input` and its\n\t\t * {@link ColorSwatch} indicator, layered after each part's own built-in\n\t\t * styling. The `mix` prop styles 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 {@link ColorSwatch} indicator. */\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 ColorSwatchPicker.Swatch} options out in a wrapping row, sharing its\n * `name` through context so each option defaults to the group's own identifier.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props and providing {@link ColorSwatchPicker.Context}.\n * @returns The render function producing the group's markup.\n * @example\n * <ColorSwatchPicker aria-label={t(\"form.accentColor.label\")} name=\"accentColor\">\n * \t<ColorSwatchPicker.Swatch value=\"#ef4444\" aria-label={t(\"color.red\")} />\n * \t<ColorSwatchPicker.Swatch value=\"#3b82f6\" aria-label={t(\"color.blue\")} defaultChecked />\n * \t<ColorSwatchPicker.Swatch value=\"#22c55e\" aria-label={t(\"color.green\")} />\n * </ColorSwatchPicker>\n * @example\n * <ColorSwatchPicker aria-label={t(\"form.brandColor.label\")}>\n * \t<ColorSwatchPicker.Swatch value=\"#f97316\" aria-label={t(\"color.orange\")} shape=\"circle\" size=\"lg\" />\n * \t<ColorSwatchPicker.Swatch value=\"#a855f7\" aria-label={t(\"color.purple\")} shape=\"circle\" size=\"lg\" />\n * </ColorSwatchPicker>\n */\nexport function ColorSwatchPicker(\n\thandle: Handle<ColorSwatchPicker.Props, ColorSwatchPicker.Context>,\n) {\n\treturn () => {\n\t\tlet { name, mix, ...rest } = handle.props;\n\t\tlet resolvedName = name ?? handle.id;\n\n\t\thandle.context.set({ name: resolvedName });\n\n\t\treturn (\n\t\t\t<div {...rest} mix={[attrs({ role: DEFAULT_ROLE }), hstack({ gap: 2 }), flexWrap(), mix]} />\n\t\t);\n\t};\n}\n\n/**\n * Renders a single option: a hidden `<input type=\"radio\">` paired with a {@link ColorSwatch}\n * styled through `precededBy()` (a bare element-first selector serializes as a declaration),\n * with the option's pointer target grown to `--ui-target-size` around smaller swatches.\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 * <ColorSwatchPicker.Swatch value=\"#ef4444\" aria-label={t(\"color.red\")} />\n * @example\n * <ColorSwatchPicker.Swatch value=\"#3b82f6\" aria-label={t(\"color.blue\")} defaultChecked shape=\"circle\" />\n * @example\n * <ColorSwatchPicker.Swatch value=\"#22c55e\" aria-label={t(\"color.green\")} disabled />\n */\nColorSwatchPicker.Swatch = function ColorSwatchPickerSwatch(\n\thandle: Handle<ColorSwatchPicker.SwatchProps>,\n) {\n\treturn () => {\n\t\tlet {\n\t\t\tvalue,\n\t\t\t\"aria-label\": ariaLabel,\n\t\t\tname,\n\t\t\tshape,\n\t\t\tsize,\n\t\t\tchecked,\n\t\t\tdefaultChecked,\n\t\t\tdisabled,\n\t\t\trequired,\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(ColorSwatchPicker);\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\trelative(),\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\thitArea(),\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\twhen(\"&:has(input:disabled)\", [cursor(\"not-allowed\"), opacity(50)]),\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\taria-label={ariaLabel}\n\t\t\t\t\tmix={[visuallyHidden(), parts?.input]}\n\t\t\t\t/>\n\t\t\t\t<ColorSwatch\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tshape={shape}\n\t\t\t\t\tsize={size}\n\t\t\t\t\tmix={[\n\t\t\t\t\t\ttransition(\"border-color, box-shadow\"),\n\t\t\t\t\t\tprecededBy(\"input:checked\", border(\"brand.solid\")),\n\t\t\t\t\t\tprecededBy(\"input:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t\tprecededBy(\"input:checked\", ringShadow(\"brand\")),\n\t\t\t\t\t\tparts?.indicator,\n\t\t\t\t\t]}\n\t\t\t\t/>\n\t\t\t</label>\n\t\t);\n\t};\n};\n"
13
- },
14
- "test": null
15
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "color-swatch",
3
- "changedIn": "2026.10.10",
4
- "dependencies": [],
5
- "exports": [
6
- "ColorSwatch"
7
- ],
8
- "source": {
9
- "path": "color-swatch.tsx",
10
- "content": "/**\n * A static preview box rendering one color value as a filled, shaped\n * swatch, backed by a fixed checkerboard so a translucent value always\n * reads correctly against whatever sits behind it on the page rather than\n * blending invisibly away. The value paints through two stacked layers: a\n * checkerboard base and a color fill on top, clipped together to a circular,\n * square, or softly rounded shape at one of three fixed sizes. Every other\n * color preview in this component family composes this box for its own\n * preview instead of redrawing the checkerboard-plus-fill technique itself.\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 } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { raw, userSelect } from \"@sdxc/u/general\";\nimport { absolute, inlineFlex, inset, items, justify, relative, shrink } from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { bs, is } from \"@sdxc/u/size\";\nimport { after, before, data } from \"@sdxc/u/state\";\nimport { verticalAlign } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { mergeStyle } from \"@sdxc/ui/utils\";\n\n/** Shape variant {@link ColorSwatch} falls back to when `shape` is omitted. */\nconst DEFAULT_SHAPE: ColorSwatch.Shape = \"rounded\";\n\n/** Size variant {@link ColorSwatch} falls back to when `size` is omitted. */\nconst DEFAULT_SIZE: ColorSwatch.Size = \"md\";\n\n/**\n * Applied through {@link attrs} so the host is hidden from assistive\n * technology by default, since composed uses supply their own accessible\n * name; pass `aria-hidden=\"false\"` and `aria-label` to render standalone.\n */\nconst DEFAULT_ARIA_HIDDEN = \"true\";\n\n/**\n * Prop types for {@link ColorSwatch}.\n */\nexport namespace ColorSwatch {\n\t/**\n\t * Shape variant controlling the swatch's corner rounding: `\"circle\"`\n\t * renders a fully rounded disc, `\"square\"` renders sharp corners, and\n\t * `\"rounded\"` renders a softly rounded square.\n\t */\n\texport type Shape = \"circle\" | \"square\" | \"rounded\";\n\n\t/**\n\t * Size variant controlling the swatch's rendered dimensions.\n\t */\n\texport type Size = \"sm\" | \"md\" | \"lg\";\n\n\t/**\n\t * Props accepted by {@link ColorSwatch}.\n\t */\n\texport interface Props extends TagProps<\"span\"> {\n\t\t/**\n\t\t * The color to preview, already resolved to a literal CSS value — a hex\n\t\t * string, `rgb()`/`hsl()`/`oklch()` function, or named color. Required,\n\t\t * since a swatch with nothing to preview has no reason to render.\n\t\t */\n\t\tvalue: string;\n\t\t/** Shape variant. Defaults to {@link DEFAULT_SHAPE}. */\n\t\tshape?: Shape;\n\t\t/** Size variant. Defaults to {@link DEFAULT_SIZE}. */\n\t\tsize?: Size;\n\t}\n}\n\n/**\n * Renders a fixed-size `<span>` that paints `value` through a local\n * `--ui-color-swatch-value` custom property, layered over a `::before`\n * checkerboard so any transparency in `value` reads correctly.\n *\n * @param handle Runtime handle carrying the host `<span>`'s props.\n * @returns The render function producing the swatch's markup.\n * @example\n * <ColorSwatch value=\"#3b82f6\" />\n * @example\n * <ColorSwatch value=\"rgb(16 185 129 / 0.4)\" shape=\"circle\" size=\"lg\" />\n */\nexport function ColorSwatch(handle: Handle<ColorSwatch.Props>) {\n\treturn () => {\n\t\tlet { value, shape, size, mix, style, ...rest } = handle.props;\n\t\tlet resolvedShape = shape ?? DEFAULT_SHAPE;\n\t\tlet resolvedSize = size ?? DEFAULT_SIZE;\n\t\tlet resolvedStyle = mergeStyle(style, { \"--ui-color-swatch-value\": value });\n\n\t\treturn (\n\t\t\t<span\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"swatch\"\n\t\t\t\tdata-shape={resolvedShape}\n\t\t\t\tdata-size={resolvedSize}\n\t\t\t\tstyle={resolvedStyle}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ \"aria-hidden\": DEFAULT_ARIA_HIDDEN }),\n\t\t\t\t\trelative(),\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\toverflow(\"hidden\"),\n\t\t\t\t\tborder({ width: 1, color: \"neutral\" }),\n\t\t\t\t\tis(\"var(--ui-color-swatch-size-md, 1.75rem)\"),\n\t\t\t\t\tbs(\"var(--ui-color-swatch-size-md, 1.75rem)\"),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tdata(\"size\", \"sm\", [\n\t\t\t\t\t\tis(\"var(--ui-color-swatch-size-sm, 1.25rem)\"),\n\t\t\t\t\t\tbs(\"var(--ui-color-swatch-size-sm, 1.25rem)\"),\n\t\t\t\t\t]),\n\t\t\t\t\tdata(\"size\", \"lg\", [\n\t\t\t\t\t\tis(\"var(--ui-color-swatch-size-lg, 2.5rem)\"),\n\t\t\t\t\t\tbs(\"var(--ui-color-swatch-size-lg, 2.5rem)\"),\n\t\t\t\t\t]),\n\t\t\t\t\tdata(\"shape\", \"circle\", rounded(\"full\")),\n\t\t\t\t\tshrink(),\n\t\t\t\t\tverticalAlign(\"middle\"),\n\t\t\t\t\tuserSelect(),\n\t\t\t\t\tdata(\"shape\", \"square\", rounded(\"none\")),\n\t\t\t\t\tbefore([\n\t\t\t\t\t\tabsolute(),\n\t\t\t\t\t\tinset(0),\n\t\t\t\t\t\tbg({\n\t\t\t\t\t\t\timage:\n\t\t\t\t\t\t\t\t\"repeating-conic-gradient(var(--ui-neutral-border) 0% 25%, var(--ui-neutral-bg-tint) 0% 50%)\",\n\t\t\t\t\t\t\tsize: \"var(--ui-color-swatch-checker-size, 0.625rem) var(--ui-color-swatch-checker-size, 0.625rem)\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t\traw({ content: '\"\"' }),\n\t\t\t\t\t]),\n\t\t\t\t\tafter([\n\t\t\t\t\t\tabsolute(),\n\t\t\t\t\t\tinset(0),\n\t\t\t\t\t\tbg(\"var(--ui-color-swatch-value, transparent)\"),\n\t\t\t\t\t\traw({ content: '\"\"' }),\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
- },
12
- "test": null
13
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "color-wheel",
3
- "changedIn": "2026.10.13",
4
- "dependencies": [],
5
- "exports": [
6
- "ColorWheel"
7
- ],
8
- "source": {
9
- "path": "color-wheel.tsx",
10
- "content": "/**\n * A circular hue picker. Hue's natural domain is an angle swept around a\n * circle, so the pointer math is polar: a center point and an angle in, a\n * hue out. A single native `<input type=\"range\">` carries every value this\n * control reports; `colorWheelDrag()` reshapes the root into a ring when a\n * consumer attaches it through the root's `mix` prop.\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, outlineStyle } from \"@sdxc/u/color\";\nimport { mask, opacity, rounded, shadow, transition, transitionDuration } from \"@sdxc/u/effects\";\nimport { cursor, pointerEvents, pseudoContent, raw } from \"@sdxc/u/general\";\nimport {\n\tabsolute,\n\tappearance,\n\tblock,\n\tinlineBlock,\n\tinsBs,\n\tinsIs,\n\tinset,\n\trelative,\n\tshrink,\n} from \"@sdxc/u/layout\";\nimport { media } from \"@sdxc/u/responsive\";\nimport { bs, is, m, mbs, minIs, mis } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\n\nimport { rangeThumbAppearance } from \"@sdxc/ui/styles\";\nimport { rtlAwareGradientDirection } from \"@sdxc/ui/styles\";\nimport { clampChannel, roundChannel } from \"@sdxc/ui/utils\";\nimport { HUE_GRADIENT_STOPS } from \"@sdxc/ui/utils\";\nimport { mergeStyle } from \"@sdxc/ui/utils\";\nimport { warnIfNoAccessibleLabel } from \"@sdxc/ui/utils\";\n\n/** Lower bound of {@link ColorWheel}'s fixed hue domain, in degrees — fixed, since the full domain is what makes this control a hue wheel. */\nconst DEFAULT_MIN = 0;\n\n/** Upper bound of {@link ColorWheel}'s fixed hue domain, in degrees; reaching it wraps back to the same red {@link DEFAULT_MIN} starts from, since hue is continuous around the circle. */\nconst DEFAULT_MAX = 360;\n\n/** Degrees a single keypress moves {@link ColorWheel}'s value by, applied when `step` is omitted. */\nconst DEFAULT_STEP = 1;\n\n/** Hue, in degrees, {@link ColorWheel} falls back to when both `value` and `defaultValue` are omitted. */\nconst DEFAULT_VALUE = 0;\n\n/**\n * Custom property naming the plain-bar track gradient's sweep direction,\n * flipped from `\"right\"` to `\"left\"` under `:dir(rtl)` so the gradient\n * always reads in the same direction as the surrounding text.\n */\nconst TRACK_DIRECTION_PROPERTY = \"--ui-color-wheel-track-direction\";\n\n/**\n * The plain-bar track background, sweeping {@link HUE_GRADIENT_STOPS}\n * toward {@link TRACK_DIRECTION_PROPERTY}'s current direction — shared\n * verbatim between the WebKit and Gecko track pseudo-elements.\n */\nconst HUE_TRACK_GRADIENT = `linear-gradient(to var(${TRACK_DIRECTION_PROPERTY}, right), ${HUE_GRADIENT_STOPS})`;\n\n/**\n * The ring rendering's background: {@link HUE_GRADIENT_STOPS} swept\n * clockwise from twelve o'clock, matching the convention the ring's own\n * drag math measures angles by, so painted position always matches value.\n */\nconst WHEEL_CONIC_GRADIENT = `conic-gradient(from 0deg, ${HUE_GRADIENT_STOPS})`;\n\n/**\n * An alpha mask cutting the ring's filled disc down to a\n * `--ui-color-wheel-thumb-size` band at the outer edge, the same width the\n * plain bar's track and thumb share, so only a ring remains visible.\n */\nconst RING_MASK =\n\t\"radial-gradient(circle, transparent calc(50% - var(--ui-color-wheel-thumb-size, 1.25rem)), black calc(50% - var(--ui-color-wheel-thumb-size, 1.25rem) + 1px))\";\n\n/**\n * Prop types for {@link ColorWheel}.\n */\nexport namespace ColorWheel {\n\t/**\n\t * Per-part styling for the underlying native hue control this convenience\n\t * wrapper composes alongside its own host `<div>`.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the native `<input type=\"range\">` reporting the current hue. */\n\t\tinput?: TagProps<\"input\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link ColorWheel}. `mix` styles the root element that\n\t * the plain-bar or ring rendering paints itself on; style the nested hue\n\t * input individually through `parts` instead.\n\t */\n\texport interface Props extends Omit<TagProps<\"div\">, \"children\"> {\n\t\t/** Current hue, in degrees `0`–`360`, for a wheel a consumer tracks itself. */\n\t\tvalue?: number;\n\t\t/** Starting hue, in degrees `0`–`360`, for a wheel left to the platform's own uncontrolled state. */\n\t\tdefaultValue?: number;\n\t\t/** Degrees a single keypress moves the value by. Defaults to {@link DEFAULT_STEP}. */\n\t\tstep?: number;\n\t\t/** Native `name` submitted with an enclosing form. */\n\t\tname?: string;\n\t\t/** Native `id` of the form the underlying hue input associates with, when it sits outside that form's own markup. */\n\t\tform?: string;\n\t\t/** Marks the underlying hue input inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/** Per-part styling for this wrapper's internally composed hue input. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * Renders a root `<div>` around a single `<input type=\"range\">` across\n * hue's `0`–`360` domain, carrying every accessibility and form semantic\n * this wheel exposes; `colorWheelDrag()` enables the ring rendering.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the wheel's markup.\n * @example\n * <ColorWheel aria-label={t(\"colorPicker.hue\")} defaultValue={210} />\n * @example\n * <ColorWheel aria-label={t(\"theme.accentHue\")} value={hue} name=\"hue\" disabled={isLocked} />\n */\nexport function ColorWheel(handle: Handle<ColorWheel.Props>) {\n\treturn () => {\n\t\tlet {\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tstep,\n\t\t\tname,\n\t\t\tdisabled,\n\t\t\tform,\n\t\t\t\"aria-label\": ariaLabel,\n\t\t\t\"aria-labelledby\": ariaLabelledby,\n\t\t\t\"aria-describedby\": ariaDescribedby,\n\t\t\tparts,\n\t\t\tstyle,\n\t\t\tmix,\n\t\t\t...rest\n\t\t} = handle.props;\n\t\tlet resolvedValue = value ?? defaultValue ?? DEFAULT_VALUE;\n\t\tlet resolvedStep = step ?? DEFAULT_STEP;\n\t\tlet resolvedHue = roundChannel(clampChannel(resolvedValue, DEFAULT_MIN, DEFAULT_MAX));\n\t\tlet resolvedStyle = mergeStyle(style, {\n\t\t\t\"--ui-color-wheel-value\": `hsl(${resolvedHue} 100% 50%)`,\n\t\t\t\"--ui-color-wheel-hue\": `${resolvedHue}`,\n\t\t});\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t\"ColorWheel: a wheel with no `aria-label` or `aria-labelledby` needs one describing the hue it picks — assistive technology has no accessible name to announce otherwise.\",\n\t\t);\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"color-wheel\"\n\t\t\t\tstyle={resolvedStyle}\n\t\t\t\tmix={[\n\t\t\t\t\trelative(),\n\t\t\t\t\t/**\n\t\t\t\t\t * Each shape sizes itself under a selector excluding the other: a bare `is(\"full\")`\n\t\t\t\t\t * compiles into its own cascade layer, which can land after the circular rule and\n\t\t\t\t\t * stretch the wheel into an ellipse.\n\t\t\t\t\t */\n\t\t\t\t\twhen('&:not([data-shape=\"circular\"])', [block(), is(\"full\"), minIs(\"10rem\")]),\n\t\t\t\t\twhen(\n\t\t\t\t\t\t'&[data-shape=\"circular\"]',\n\t\t\t\t\t\twhen(\"&:has(> input:focus-visible)\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t),\n\t\t\t\t\twhen('&[data-shape=\"circular\"]', [\n\t\t\t\t\t\tinlineBlock(),\n\t\t\t\t\t\tis(\"var(--ui-color-wheel-size, 12rem)\"),\n\t\t\t\t\t\tbs(\"var(--ui-color-wheel-size, 12rem)\"),\n\t\t\t\t\t\tminIs(\"0\"),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * A wheel holds its one measure on both axes; as a flex item it would shrink on the\n\t\t\t\t\t\t * inline axis alone when the row runs short, and a circle squeezed on one axis is an ellipse.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tshrink(),\n\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\tbg({ image: WHEEL_CONIC_GRADIENT }),\n\t\t\t\t\t\tmask(RING_MASK),\n\n\t\t\t\t\t\twhen(\"&::after\", [\n\t\t\t\t\t\t\tabsolute(),\n\t\t\t\t\t\t\tis(\"var(--ui-color-wheel-thumb-size, 1.25rem)\"),\n\t\t\t\t\t\t\tbs(\"var(--ui-color-wheel-thumb-size, 1.25rem)\"),\n\t\t\t\t\t\t\tmbs(\"calc(var(--ui-color-wheel-thumb-size, 1.25rem) / -2)\"),\n\t\t\t\t\t\t\tmis(\"calc(var(--ui-color-wheel-thumb-size, 1.25rem) / -2)\"),\n\t\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\t\tborder({\n\t\t\t\t\t\t\t\twidth: \"var(--ui-color-wheel-thumb-border-width, 2px)\",\n\t\t\t\t\t\t\t\tstyle: \"solid\",\n\t\t\t\t\t\t\t\tcolor: \"var(--ui-color-wheel-value, var(--ui-brand-bg-solid))\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\t\t\ttransition(\"transform\"),\n\t\t\t\t\t\t\tinsBs(\"50%\"),\n\t\t\t\t\t\t\tinsIs(\"50%\"),\n\t\t\t\t\t\t\tshadow(\"base\"),\n\t\t\t\t\t\t\tpointerEvents(),\n\t\t\t\t\t\t\tpseudoContent('\"\"'),\n\t\t\t\t\t\t\traw({\n\t\t\t\t\t\t\t\ttransform:\n\t\t\t\t\t\t\t\t\t\"rotate(calc(var(--ui-color-wheel-hue, 0) * 1deg)) translateY(calc(var(--ui-color-wheel-size, 12rem) / -2 + var(--ui-color-wheel-thumb-size, 1.25rem) / 2))\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t]),\n\n\t\t\t\t\t\twhen(\"&:has(> input:disabled)\", [\n\t\t\t\t\t\t\topacity(50),\n\t\t\t\t\t\t\twhen(\"&::after\", [border(\"neutral\"), raw({ boxShadow: \"none\" })]),\n\t\t\t\t\t\t]),\n\n\t\t\t\t\t\twhen(\"& > input\", [absolute(), inset(\"0\"), is(\"full\"), bs(\"full\"), opacity(0)]),\n\n\t\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", when(\"&::after\", transitionDuration(\"0s\"))),\n\t\t\t\t\t]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\ttype=\"range\"\n\t\t\t\t\tmin={DEFAULT_MIN}\n\t\t\t\t\tmax={DEFAULT_MAX}\n\t\t\t\t\tstep={resolvedStep}\n\t\t\t\t\tdefaultValue={resolvedValue}\n\t\t\t\t\tname={name}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tform={form}\n\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\taria-labelledby={ariaLabelledby}\n\t\t\t\t\taria-describedby={ariaDescribedby}\n\t\t\t\t\tdata-slot=\"input\"\n\t\t\t\t\tmix={[\n\t\t\t\t\t\trtlAwareGradientDirection(TRACK_DIRECTION_PROPERTY),\n\t\t\t\t\t\trangeThumbAppearance(\n\t\t\t\t\t\t\t\"--ui-color-wheel-thumb-size\",\n\t\t\t\t\t\t\t\"--ui-color-wheel-thumb-border-width\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tblock(),\n\t\t\t\t\t\tis(\"full\"),\n\t\t\t\t\t\tcursor(\"pointer\"),\n\t\t\t\t\t\twhen(\"&:disabled\", cursor(\"not-allowed\")),\n\t\t\t\t\t\tbs(\"var(--ui-color-wheel-thumb-size, 1.25rem)\"),\n\t\t\t\t\t\tm(\"0\"),\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\tappearance(\"none\", { moz: false }),\n\t\t\t\t\t\toutlineStyle(\"none\"),\n\n\t\t\t\t\t\twhen(\"&::-webkit-slider-runnable-track\", [\n\t\t\t\t\t\t\tbs(\"var(--ui-color-wheel-thumb-size, 1.25rem)\"),\n\t\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\t\tbg({ image: HUE_TRACK_GRADIENT }),\n\t\t\t\t\t\t\tappearance(\"none\", { moz: false }),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen(\"&::-moz-range-track\", [\n\t\t\t\t\t\t\tbs(\"var(--ui-color-wheel-thumb-size, 1.25rem)\"),\n\t\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\t\tbg({ image: HUE_TRACK_GRADIENT }),\n\t\t\t\t\t\t\tborder({ style: \"none\" }),\n\t\t\t\t\t\t\tappearance(\"none\", { webkit: false, moz: false }),\n\t\t\t\t\t\t]),\n\n\t\t\t\t\t\twhen('[data-shape=\"circular\"] &', [\n\t\t\t\t\t\t\tcursor(\"pointer\"),\n\t\t\t\t\t\t\tappearance(\"none\", { moz: false }),\n\n\t\t\t\t\t\t\twhen(\"&::-webkit-slider-runnable-track\", bg({ image: \"none\", color: \"transparent\" })),\n\t\t\t\t\t\t\twhen(\"&::-moz-range-track\", bg({ image: \"none\", color: \"transparent\" })),\n\t\t\t\t\t\t\twhen(\"&::-webkit-slider-thumb\", [\n\t\t\t\t\t\t\t\tborder({ style: \"none\" }),\n\t\t\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\t\t\traw({ boxShadow: \"none\" }),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\twhen(\"&::-moz-range-thumb\", [\n\t\t\t\t\t\t\t\tborder({ style: \"none\" }),\n\t\t\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\t\t\traw({ boxShadow: \"none\" }),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t\t\"&:focus-visible::-webkit-slider-thumb, &:focus-visible::-moz-range-thumb\",\n\t\t\t\t\t\t\t\toutlineStyle(\"none\"),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tparts?.input,\n\t\t\t\t\t]}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t};\n}\n"
11
- },
12
- "test": null
13
- }
@@ -1,16 +0,0 @@
1
- {
2
- "name": "context-menu",
3
- "changedIn": "2026.10.13",
4
- "dependencies": [
5
- "menu",
6
- "section"
7
- ],
8
- "exports": [
9
- "ContextMenu"
10
- ],
11
- "source": {
12
- "path": "context-menu.tsx",
13
- "content": "/**\n * A menu surface that opens at a right-click's pointer position, composing\n * {@link Menu}'s popover styling and `role=\"menu\"` wiring directly so its\n * rows read and behave exactly like a standard menu's. Adds the\n * {@link ContextMenu.Trigger} wrapper a pointer gesture opens the surface\n * against, plus the grouped-row parts — {@link ContextMenu.Group},\n * {@link ContextMenu.Label}, and {@link ContextMenu.Shortcut} — a context\n * menu's denser row layout tends to need.\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 { borderEdge, fg, outline } from \"@sdxc/u/color\";\nimport { mis, pb, pi, pie } from \"@sdxc/u/size\";\nimport { not } from \"@sdxc/u/state\";\nimport { tabularNums, text, weight } from \"@sdxc/u/typography\";\n\nimport { Menu } from \"@sdxc/ui/menu\";\nimport { Section } from \"@sdxc/ui/section\";\n\n/**\n * Side {@link ContextMenu.SubContent} renders against relative to its\n * {@link ContextMenu.SubTrigger} row when a consumer leaves `placement`\n * unset — the direction a nested row conventionally flies outward toward.\n */\nconst DEFAULT_SUB_PLACEMENT: NonNullable<Menu.Props[\"placement\"]> = \"right-start\";\n\n/**\n * Prop types for {@link ContextMenu} and its compound parts.\n */\nexport namespace ContextMenu {\n\t/**\n\t * Every prop {@link Menu.Props} accepts, unchanged, since {@link\n\t * ContextMenu} renders one directly as its host.\n\t */\n\texport interface Props extends Menu.Props {}\n\n\t/**\n\t * Every native `<div>` attribute, plus the `mix` passthrough. The area a\n\t * consumer wraps around content that should open {@link ContextMenu} at the\n\t * pointer's position — a table row, a card, a canvas region.\n\t */\n\texport interface TriggerProps extends TagProps<\"div\"> {\n\t\t/** The content the pointer gesture opens {@link ContextMenu} against. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Every prop {@link Menu.ItemProps} accepts, unchanged, since {@link\n\t * ContextMenu.Item} renders one directly.\n\t */\n\texport interface ItemProps extends Menu.ItemProps {}\n\n\t/**\n\t * Every prop {@link Section.Props} accepts, since {@link\n\t * ContextMenu.Group} renders one directly as its host.\n\t */\n\texport interface GroupProps extends Section.Props {\n\t\t/** The group's rows, typically a {@link ContextMenu.Label} followed by a run of {@link ContextMenu.Item}s. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Every native `<header>` attribute, plus the `mix` passthrough.\n\t */\n\texport interface LabelProps extends TagProps<\"header\"> {\n\t\t/** The group's visible label text. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Every prop {@link Menu.SeparatorProps} accepts, unchanged, since {@link\n\t * ContextMenu.Separator} renders one directly.\n\t */\n\texport interface SeparatorProps extends Menu.SeparatorProps {}\n\n\t/**\n\t * Every prop {@link ContextMenu.Props} accepts, unchanged, since {@link\n\t * ContextMenu.SubContent} renders {@link ContextMenu} directly with a\n\t * different default `placement`.\n\t */\n\texport interface SubContentProps extends Props {}\n\n\t/**\n\t * Every native `<span>` attribute, plus the `mix` passthrough.\n\t */\n\texport interface ShortcutProps extends TagProps<\"span\"> {\n\t\t/** The shortcut hint text, typically a key combination like \"⌘⇧D\". */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders {@link Menu} unchanged; positioning against the pointer is handled\n * entirely by the `contextMenu()` mixin a consuming island applies to\n * {@link ContextMenu.Trigger}, while every nested row stays a real, tab-reachable `<a>` or `<button>`.\n *\n * @param handle Runtime handle carrying the host's {@link Menu} props.\n * @returns The render function producing the surface's markup.\n * @example\n * <ContextMenu.Trigger mix={[contextMenu(\"row-menu\")]}>\n * \t<TableRow />\n * </ContextMenu.Trigger>\n * <ContextMenu id=\"row-menu\" aria-label={t(\"table.rowActions\")}>\n * \t<ContextMenu.Item href={viewUrl}>{t(\"actions.view\")}</ContextMenu.Item>\n * \t<ContextMenu.Item href={editUrl}>{t(\"actions.edit\")}</ContextMenu.Item>\n * \t<ContextMenu.Separator />\n * \t<ContextMenu.Item danger commandfor=\"confirm-delete\" command=\"show-modal\">{t(\"actions.delete\")}</ContextMenu.Item>\n * </ContextMenu>\n */\nexport function ContextMenu(handle: Handle<ContextMenu.Props>) {\n\treturn () => <Menu {...handle.props} />;\n}\n\n/**\n * Renders {@link ContextMenu.TriggerProps.children} inside a plain `<div>`,\n * the area a pointer gesture opens the paired {@link ContextMenu} against.\n * Pair it with the `contextMenu()` mixin via `mix`; outline is suppressed since that mixin's own focus handling takes over once the surface opens.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the trigger area's markup.\n * @example\n * <ContextMenu.Trigger mix={[contextMenu(\"row-menu\")]}>\n * \t<TableRow />\n * </ContextMenu.Trigger>\n */\nContextMenu.Trigger = function ContextMenuTrigger(handle: Handle<ContextMenu.TriggerProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div {...rest} mix={[outline(\"none\"), mix]}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders a single row: {@link Menu.Item} unchanged, since a context menu's\n * row shares every look and state — hover, pressed, focus-visible,\n * `aria-selected`, `danger` — with a standard menu's row.\n *\n * @example\n * <ContextMenu.Item href=\"/settings/profile\">{t(\"nav.profile\")}</ContextMenu.Item>\n * @example\n * <ContextMenu.Item danger>{t(\"actions.delete\")}</ContextMenu.Item>\n */\nContextMenu.Item = Menu.Item;\n\n/**\n * Renders {@link ContextMenu.GroupProps.children} as one labeled run of rows:\n * {@link Section} restyled with a divider above every group but the first.\n * Pair a {@link ContextMenu.Label} first child with `aria-labelledby` pointing at its `id` for assistive technology.\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 * <ContextMenu.Group aria-labelledby=\"row-menu-view-heading\">\n * \t<ContextMenu.Label id=\"row-menu-view-heading\">{t(\"menu.view\")}</ContextMenu.Label>\n * \t<ContextMenu.Item href={viewUrl}>{t(\"actions.view\")}</ContextMenu.Item>\n * \t<ContextMenu.Item href={editUrl}>{t(\"actions.edit\")}</ContextMenu.Item>\n * </ContextMenu.Group>\n */\nContextMenu.Group = function ContextMenuGroup(handle: Handle<ContextMenu.GroupProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Section\n\t\t\t\t{...rest}\n\t\t\t\tmix={[not(\":first-child\", borderEdge(\"block-start\", { color: \"neutral\", width: 1 })), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link ContextMenu.LabelProps.children} as a\n * {@link ContextMenu.Group}'s small, muted heading, sized and spaced to sit\n * directly above the group's first row for a dense row of actions.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the label's markup.\n * @example\n * <ContextMenu.Label id=\"row-menu-view-heading\">{t(\"menu.view\")}</ContextMenu.Label>\n */\nContextMenu.Label = function ContextMenuLabel(handle: Handle<ContextMenu.LabelProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<header\n\t\t\t\t{...rest}\n\t\t\t\tmix={[pi(2), pb(1), weight(\"semibold\"), fg(\"neutral.muted\"), text(\"xs\"), mix]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</header>\n\t\t);\n\t};\n};\n\n/**\n * Renders a hairline divider between two runs of {@link ContextMenu.Item}s:\n * {@link Menu.Separator} unchanged.\n *\n * @example\n * <ContextMenu.Item href=\"/settings/profile\">{t(\"nav.profile\")}</ContextMenu.Item>\n * <ContextMenu.Separator />\n * <ContextMenu.Item danger>{t(\"actions.signOut\")}</ContextMenu.Item>\n */\nContextMenu.Separator = Menu.Separator;\n\n/**\n * Renders a row that opens a nested {@link ContextMenu.SubContent} surface:\n * {@link Menu.Item} restyled with inline-end padding for a trailing chevron\n * icon; point `commandfor` at the nested surface's `id` with `command=\"toggle-popover\"`.\n *\n * @param handle Runtime handle carrying the host row's props.\n * @returns The render function producing the row's markup.\n * @example\n * <ContextMenu.SubTrigger commandfor=\"row-menu-share\" command=\"toggle-popover\">\n * \t{t(\"actions.share\")}\n * \t<ChevronRightIcon data-slot=\"icon\" aria-hidden />\n * </ContextMenu.SubTrigger>\n * <ContextMenu.SubContent id=\"row-menu-share\" aria-label={t(\"actions.share\")}>\n * \t<ContextMenu.Item>{t(\"share.email\")}</ContextMenu.Item>\n * \t<ContextMenu.Item>{t(\"share.link\")}</ContextMenu.Item>\n * </ContextMenu.SubContent>\n */\nContextMenu.SubTrigger = function ContextMenuSubTrigger(handle: Handle<ContextMenu.ItemProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <Menu.Item {...rest} mix={[pie(8), mix]} />;\n\t};\n};\n\n/**\n * Renders a nested surface opened by a {@link ContextMenu.SubTrigger} row:\n * {@link ContextMenu} itself, defaulting `placement` to\n * {@link DEFAULT_SUB_PLACEMENT} since a nested row conventionally opens beside itself.\n *\n * @param handle Runtime handle carrying the host's {@link Menu} props.\n * @returns The render function producing the nested surface's markup.\n * @example\n * <ContextMenu.SubContent id=\"row-menu-share\" aria-label={t(\"actions.share\")}>\n * \t<ContextMenu.Item>{t(\"share.email\")}</ContextMenu.Item>\n * \t<ContextMenu.Item>{t(\"share.link\")}</ContextMenu.Item>\n * </ContextMenu.SubContent>\n */\nContextMenu.SubContent = function ContextMenuSubContent(\n\thandle: Handle<ContextMenu.SubContentProps>,\n) {\n\treturn () => {\n\t\tlet { placement, ...rest } = handle.props;\n\n\t\treturn <ContextMenu {...rest} placement={placement ?? DEFAULT_SUB_PLACEMENT} />;\n\t};\n};\n\n/**\n * Renders a row that toggles a checked state: {@link ContextMenu.Item}\n * unchanged — set `aria-selected=\"true\"` directly to mark it checked, the\n * same contract {@link Menu.Item} documents.\n *\n * @example\n * <ContextMenu.CheckboxItem aria-selected={showHidden ? \"true\" : undefined}>{t(\"view.showHidden\")}</ContextMenu.CheckboxItem>\n */\nContextMenu.CheckboxItem = ContextMenu.Item;\n\n/**\n * Renders a row belonging to a mutually exclusive set: {@link\n * ContextMenu.Item} unchanged — set `aria-selected=\"true\"` directly on\n * whichever row is the current pick.\n *\n * @example\n * <ContextMenu.RadioItem aria-selected={sort === \"name\" ? \"true\" : undefined}>{t(\"sort.name\")}</ContextMenu.RadioItem>\n */\nContextMenu.RadioItem = ContextMenu.Item;\n\n/**\n * Renders a mutually exclusive set of {@link ContextMenu.RadioItem} rows:\n * {@link ContextMenu.Group} unchanged.\n *\n * @example\n * <ContextMenu.RadioGroup aria-labelledby=\"row-menu-sort-heading\">\n * \t<ContextMenu.Label id=\"row-menu-sort-heading\">{t(\"menu.sortBy\")}</ContextMenu.Label>\n * \t<ContextMenu.RadioItem aria-selected=\"true\">{t(\"sort.name\")}</ContextMenu.RadioItem>\n * \t<ContextMenu.RadioItem>{t(\"sort.date\")}</ContextMenu.RadioItem>\n * </ContextMenu.RadioGroup>\n */\nContextMenu.RadioGroup = ContextMenu.Group;\n\n/**\n * Renders {@link ContextMenu.ShortcutProps.children} as a row's trailing\n * keyboard-shortcut hint: pushed to the row's inline end, muted, and set in\n * tabular digits so the hints of a column of rows line up.\n *\n * @param handle Runtime handle carrying the host `<span>`'s props.\n * @returns The render function producing the shortcut hint's markup.\n * @example\n * <ContextMenu.Item>\n * \t{t(\"actions.duplicate\")}\n * \t<ContextMenu.Shortcut>⌘D</ContextMenu.Shortcut>\n * </ContextMenu.Item>\n */\nContextMenu.Shortcut = function ContextMenuShortcut(handle: Handle<ContextMenu.ShortcutProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<span {...rest} mix={[mis(\"auto\"), fg(\"neutral.muted\"), text(\"xs\"), tabularNums(), mix]}>\n\t\t\t\t{children}\n\t\t\t</span>\n\t\t);\n\t};\n};\n"
14
- },
15
- "test": null
16
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "drop-indicator",
3
- "changedIn": "2026.10.13",
4
- "dependencies": [],
5
- "exports": [
6
- "DropIndicator"
7
- ],
8
- "source": {
9
- "path": "drop-indicator.tsx",
10
- "content": "/**\n * A thin bar rendered in the gap between two items of a reorderable list,\n * marking where a dragged item will land. It holds its space and paints\n * nothing until it becomes the pointer's current drop target, so a list can\n * carry one bar per gap and let each one answer for itself: the gaps stay the\n * same size throughout the drag, and only the one being pointed at is drawn.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg } from \"@sdxc/u/color\";\nimport { rounded, transition } from \"@sdxc/u/effects\";\nimport { bs, is } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\n/**\n * Default {@link DropIndicator.Props.isDropTarget}, leaving the bar unpainted\n * until a consumer marks it as the active target.\n */\nconst DEFAULT_IS_DROP_TARGET = false;\n\n/**\n * Default `aria-hidden` value applied through {@link attrs} unless a\n * consumer overrides it. Assistive technology already hears the drop\n * position through the reorder interaction's own live region.\n */\nconst DEFAULT_ARIA_HIDDEN = \"true\";\n\n/**\n * Prop types for {@link DropIndicator}.\n */\nexport namespace DropIndicator {\n\t/**\n\t * Props accepted by {@link DropIndicator}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Whether this bar marks the pointer's current drop target. Renders\n\t\t * the host's `data-drop-target` attribute when `true`, which is what\n\t\t * draws the bar. Defaults to {@link DEFAULT_IS_DROP_TARGET}.\n\t\t */\n\t\tisDropTarget?: boolean;\n\t}\n}\n\n/**\n * Renders a full-width, hairline-thick, fully rounded bar shaped for the gap\n * between two items in a reorderable list. The host's `data-drop-target`\n * attribute is what paints it: transparent without it, the primary solid color\n * with it.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the bar's markup.\n * @example\n * <DropIndicator isDropTarget={dropTargetKey === item.id} />\n * @example\n * <DropIndicator\n * \tisDropTarget={isCurrentTarget}\n * \tmix={css({ position: \"absolute\", insetInline: \"0\", insetBlockStart: \"-1px\" })}\n * />\n */\nexport function DropIndicator(handle: Handle<DropIndicator.Props>) {\n\treturn () => {\n\t\tlet { isDropTarget, mix, ...rest } = handle.props;\n\t\tlet resolvedIsDropTarget = isDropTarget ?? DEFAULT_IS_DROP_TARGET;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-drop-target={resolvedIsDropTarget ? \"\" : undefined}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ \"aria-hidden\": DEFAULT_ARIA_HIDDEN }),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\tbs(\"0.125rem\"),\n\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\ttransition(\"background-color\", { duration: 150 }),\n\t\t\t\t\t/**\n\t\t\t\t\t * The resting bar paints nothing while keeping its place, so only the targeted gap reads\n\t\t\t\t\t * as marked and the list never reflows when one lights up. The states use exclusive\n\t\t\t\t\t * selectors because each entry compiles into its own cascade layer, landing in any order.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"&:not([data-drop-target])\", bg(\"transparent\")),\n\t\t\t\t\twhen(\"&[data-drop-target]\", bg(\"brand.solid\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n"
11
- },
12
- "test": null
13
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "drop-zone",
3
- "changedIn": "2026.10.2",
4
- "dependencies": [],
5
- "exports": [
6
- "DropZone"
7
- ],
8
- "source": {
9
- "path": "drop-zone.tsx",
10
- "content": "/**\n * A styled drop target for files: a dashed, centered surface wrapping a\n * native `<input type=\"file\">`, so picking a file through the platform's own\n * file picker works the moment the markup renders, with no script involved.\n * Its decorative content — an icon, an instructional caption, or both —\n * renders inside the same `<label>` that wraps the input, giving the input\n * its accessible name through the platform's own label association.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { bg, border, fg, outline } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { flex, flexCol, gap, items, justify } from \"@sdxc/u/layout\";\nimport { minBs, pb, pi } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { textAlign } from \"@sdxc/u/typography\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { warnIfNoAccessibleName } from \"@sdxc/ui/utils\";\n\n/**\n * Prop types for {@link DropZone}.\n */\nexport namespace DropZone {\n\t/**\n\t * Per-part styling for the elements this component composes besides its\n\t * own host `<label>`.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the native `<input type=\"file\">` nested inside the zone. */\n\t\tinput?: TagProps<\"input\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link DropZone}. `mix` styles the outer `<label>` —\n\t * the visible drop surface a hydrated drag-and-drop mixin attaches to —\n\t * while `parts.input` styles the nested file input.\n\t */\n\texport interface Props extends TagProps<\"label\"> {\n\t\t/** Native `name` submitted with an enclosing form. */\n\t\tname?: string;\n\t\t/** Comma-separated list of accepted MIME types or file extensions. */\n\t\taccept?: string;\n\t\t/** Whether more than one file may be chosen at once. */\n\t\tmultiple?: boolean;\n\t\t/** Requests a specific camera where a mobile browser's picker offers one. */\n\t\tcapture?: TagProps<\"input\">[\"capture\"];\n\t\t/** Marks the control required for its enclosing form. */\n\t\trequired?: boolean;\n\t\t/** Marks the control inert and excluded from the tab order. */\n\t\tdisabled?: boolean;\n\t\t/**\n\t\t * The zone's visible content — an icon, an instructional caption, or both —\n\t\t * rendered inside the `<label>` that wraps the file input, so clicking it\n\t\t * opens the picker and names the input via label association.\n\t\t */\n\t\tchildren?: RemixNode;\n\t\t/** Per-part styling for this component's internally composed input. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * Renders a native `<input type=\"file\">` wrapped in a `<label>` styled as a\n * dashed, centered drop surface; a paired drag-and-drop mixin toggles the\n * `data-drop-target` attribute this surface's styling reacts to.\n *\n * @param handle Runtime handle carrying the host `<label>`'s props.\n * @returns The render function producing the drop zone's markup.\n * @example\n * <DropZone name=\"attachments\" multiple>\n * \t{t(\"uploads.dropInstructions\")}\n * </DropZone>\n * @example\n * <DropZone name=\"avatar\" accept=\"image/png, image/jpeg\" aria-label={t(\"profile.chooseAvatar\")}>\n * \t<ImageIcon aria-hidden />\n * </DropZone>\n * @example\n * <DropZone name=\"documents\" multiple accept=\"application/pdf\" required>\n * \t<p>{t(\"uploads.dropHint\")}</p>\n * </DropZone>\n */\nexport function DropZone(handle: Handle<DropZone.Props>) {\n\treturn () => {\n\t\tlet { name, accept, multiple, capture, required, disabled, children, parts, mix, ...rest } =\n\t\t\thandle.props;\n\n\t\twarnIfNoAccessibleName(\n\t\t\thandle.props,\n\t\t\tchildren,\n\t\t\t\"DropZone: a zone with no visible instructional text needs an `aria-label` describing what it accepts — assistive technology has no accessible name to announce for its file input otherwise.\",\n\t\t);\n\n\t\treturn (\n\t\t\t<label\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"zone\"\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:has(input:focus-visible)\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tgap(2),\n\t\t\t\t\tminBs(\"6rem\"),\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tborder({ color: \"neutral\", width: \"2px\", style: \"dashed\" }),\n\t\t\t\t\tpi(6),\n\t\t\t\t\tpb(6),\n\t\t\t\t\ttextAlign(\"center\"),\n\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\twhen(\"&[data-drop-target]\", [border(\"brand.ring\"), bg(\"brand.tint\")]),\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t\t<input\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\tname={name}\n\t\t\t\t\taccept={accept}\n\t\t\t\t\tmultiple={multiple}\n\t\t\t\t\tcapture={capture}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tmix={parts?.input}\n\t\t\t\t/>\n\t\t\t</label>\n\t\t);\n\t};\n}\n"
11
- },
12
- "test": null
13
- }
@@ -1,15 +0,0 @@
1
- {
2
- "name": "empty",
3
- "changedIn": "2026.10.29",
4
- "dependencies": [
5
- "heading-scope"
6
- ],
7
- "exports": [
8
- "Empty"
9
- ],
10
- "source": {
11
- "path": "empty.tsx",
12
- "content": "/**\n * A placeholder for a product section that currently has nothing to show — a\n * dashed-bordered panel that composes an icon, a title, a description, and\n * an action into one empty-state layout. Marketing claim cells belong on\n * {@link Feature} instead; {@link Empty} stays for in-app zero-data states.\n * The compound parts let a consumer include only the pieces a given empty\n * state needs.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { bg, border, colorMix, fg } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { flex, flexCol, flexWrap, gap, items, justify } from \"@sdxc/u/layout\";\nimport { bs, is, mbs, p } from \"@sdxc/u/size\";\nimport {\n\tbalance,\n\tfontSize,\n\tleading,\n\tpretty,\n\ttextAlign,\n\ttracking,\n\tweight,\n} from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport type { SemanticColor } from \"@sdxc/ui/utils\";\n\nimport { semanticColorPanel } from \"@sdxc/ui/styles\";\nimport { DEFAULT_ICON_ARIA_HIDDEN } from \"@sdxc/ui/utils\";\n\nimport { resolveHeadingLevel, TAG_BY_LEVEL } from \"@sdxc/ui/heading-scope\";\n\n/**\n * Default {@link Empty.Props.color}, rendering the panel in the neutral\n * tone when a consumer names no semantic color.\n */\nconst DEFAULT_COLOR = \"neutral\";\n\n/**\n * Prop types for {@link Empty} and its compound parts.\n */\nexport namespace Empty {\n\t/**\n\t * Semantic tone driving the panel's border, tint, and foreground color\n\t * through the `--ui-*` variables for that color. Every part below the\n\t * root reads its own color from the inherited `currentcolor` this sets.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * Props accepted by {@link Empty}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Semantic tone of the panel. Default: `\"neutral\"`. */\n\t\tcolor?: Color;\n\t\t/** The panel's compound parts: {@link Empty.Icon}, {@link Empty.Title}, {@link Empty.Description}, {@link Empty.Action}, or any other content. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Empty.Icon}.\n\t */\n\texport interface IconProps extends TagProps<\"div\"> {\n\t\t/** Icon graphic rendered inside the icon well. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Empty.Title}. The rendered tag depends on the\n\t * nearest ambient heading level, falling back to `<h1>` where nothing\n\t * supplies one; every native heading-element attribute still applies.\n\t */\n\texport interface TitleProps extends TagProps<\"h1\"> {\n\t\t/** Heading copy for the empty state. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Empty.Description}.\n\t */\n\texport interface DescriptionProps extends TagProps<\"p\"> {\n\t\t/** Supporting copy elaborating on the empty state. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Empty.Action}.\n\t */\n\texport interface ActionProps extends TagProps<\"div\"> {\n\t\t/** Call-to-action content, typically a button or link. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders the empty-state panel: a dashed-bordered column tinted to the\n * color role in {@link Empty.Props.color}. Its compound parts inherit that\n * color through `currentcolor`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the panel's markup.\n * @example\n * <Empty>\n * \t<Empty.Icon><InboxIcon /></Empty.Icon>\n * \t<Empty.Title>{t(\"inbox.empty.title\")}</Empty.Title>\n * \t<Empty.Description>{t(\"inbox.empty.description\")}</Empty.Description>\n * \t<Empty.Action>\n * \t\t<Button>{t(\"inbox.empty.action\")}</Button>\n * \t</Empty.Action>\n * </Empty>\n * @example\n * <Empty color=\"danger\">\n * \t<Empty.Title>{t(\"errors.notFound.title\")}</Empty.Title>\n * </Empty>\n */\nexport function Empty(handle: Handle<Empty.Props>) {\n\treturn () => {\n\t\tlet { color = DEFAULT_COLOR, children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-color={color}\n\t\t\t\tdata-slot=\"empty\"\n\t\t\t\tmix={[\n\t\t\t\t\tsemanticColorPanel(),\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tgap(3),\n\t\t\t\t\trounded(\"xl\"),\n\t\t\t\t\tborder({ width: \"1px\", style: \"dashed\" }),\n\t\t\t\t\tp(8),\n\t\t\t\t\ttextAlign(\"center\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Empty.IconProps.children} as the icon well: a fully\n * rounded, tinted badge framing an icon graphic hidden from assistive\n * technology, since {@link Empty.Title}'s text already names the state.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the icon well's markup.\n */\nEmpty.Icon = function EmptyIcon(handle: Handle<Empty.IconProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"icon\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ \"aria-hidden\": DEFAULT_ICON_ARIA_HIDDEN }),\n\t\t\t\t\tflex(),\n\t\t\t\t\tbs(\"3rem\"),\n\t\t\t\t\tis(\"3rem\"),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\tborder({ width: \"1px\", style: \"solid\" }),\n\t\t\t\t\tfg(\"currentcolor\"),\n\t\t\t\t\tborder(colorMix(\"oklab\", { color: \"currentcolor\", weight: 20 }, \"transparent\")),\n\t\t\t\t\tbg(colorMix(\"oklab\", { color: \"currentcolor\", weight: 10 }, \"transparent\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Empty.TitleProps.children} as the empty state's heading,\n * in the native heading element matching its ambient `HeadingScope` depth\n * (or `<h1>` unscoped), sized as the panel's primary text regardless of level.\n *\n * @param handle Runtime handle carrying the host heading element's props.\n * @returns The render function producing the heading's markup.\n */\nEmpty.Title = function EmptyTitle(handle: Handle<Empty.TitleProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\t\tlet level = resolveHeadingLevel(handle);\n\t\tlet Tag = TAG_BY_LEVEL[level];\n\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"title\"\n\t\t\t\tmix={[\n\t\t\t\t\tweight(\"semibold\"),\n\t\t\t\t\ttracking(\"tight\"),\n\t\t\t\t\tfontSize(\"base\"),\n\t\t\t\t\tleading(\"snug\"),\n\t\t\t\t\tbalance(),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Tag>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Empty.DescriptionProps.children} as the empty state's\n * supporting copy, in a native `<p>` set to seventy percent of the panel's\n * current text color so it reads as secondary to {@link Empty.Title}.\n *\n * @param handle Runtime handle carrying the host `<p>`'s props.\n * @returns The render function producing the description's markup.\n */\nEmpty.Description = function EmptyDescription(handle: Handle<Empty.DescriptionProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<p\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"description\"\n\t\t\t\tmix={[\n\t\t\t\t\tfontSize(\"sm\"),\n\t\t\t\t\tleading(\"relaxed\"),\n\t\t\t\t\tpretty(),\n\t\t\t\t\tfg(colorMix(\"oklab\", { color: \"currentcolor\", weight: 70 }, \"transparent\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</p>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Empty.ActionProps.children} as the empty state's\n * call-to-action slot: a centered, wrapping row spaced a touch below the\n * text above it, so a state offering more than one action lays them out\n * rather than running them together.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the action slot's markup.\n */\nEmpty.Action = function EmptyAction(handle: Handle<Empty.ActionProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"action\"\n\t\t\t\tmix={[\n\t\t\t\t\t/**\n\t\t\t\t\t * The slot lays out however many actions the state offers as a centered row that\n\t\t\t\t\t * wraps, since two buttons side by side outgrow a narrow panel.\n\t\t\t\t\t */\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexWrap(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tgap(2),\n\t\t\t\t\tmbs(1),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n};\n"
13
- },
14
- "test": null
15
- }
@@ -1,18 +0,0 @@
1
- {
2
- "name": "feature",
3
- "changedIn": "2026.10.30",
4
- "dependencies": [
5
- "heading-scope"
6
- ],
7
- "exports": [
8
- "Feature"
9
- ],
10
- "source": {
11
- "path": "feature.tsx",
12
- "content": "/**\n * One marketing claim cell — icon, title, description, optional link chrome —\n * and an optional {@link Feature.Grid} that lays cells as a hairline-ruled\n * track via container queries. Default chrome stays light; pass\n * `variant=\"panel\"` only when a filled panel is the right container for the\n * interaction.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { bg, border, fg } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { raw } from \"@sdxc/u/general\";\nimport {\n\tcenter,\n\tcontainer,\n\tgap,\n\tgrid,\n\tgridTemplate,\n\thstack,\n\tinlineFlex,\n\trepeat,\n\tvstack,\n} from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { at } from \"@sdxc/u/responsive\";\nimport { bs, is, m, mbs, p } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { leading, pretty, text, tracking, weight } from \"@sdxc/u/typography\";\n\nimport { resolveHeadingLevel, TAG_BY_LEVEL } from \"@sdxc/ui/heading-scope\";\n\n/** Cell chrome {@link Feature} applies when `variant` is omitted. */\nconst DEFAULT_VARIANT: Feature.Variant = \"plain\";\n\n/** How many cells a wide {@link Feature.Grid} puts on one row. */\nconst DEFAULT_COLUMNS: Feature.Columns = 2;\n\n/**\n * Prop types for {@link Feature} and its compound parts.\n */\nexport namespace Feature {\n\t/**\n\t * Cell chrome: a light claim with no fill, or a panel when the cell itself\n\t * is the interaction surface.\n\t */\n\texport type Variant = \"plain\" | \"panel\";\n\n\t/**\n\t * How many cells a wide {@link Feature.Grid} puts on one row.\n\t */\n\texport type Columns = 2 | 3;\n\n\t/**\n\t * Props accepted by {@link Feature}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Cell chrome. Defaults to {@link DEFAULT_VARIANT}. */\n\t\tvariant?: Variant;\n\t\t/**\n\t\t * Optional destination for the claim. When set with a trailing action\n\t\t * child, the cell can surface link chrome; the href itself is left for\n\t\t * the consumer's {@link LinkButton} or anchor.\n\t\t */\n\t\thref?: string;\n\t\t/**\n\t\t * Compound parts: {@link Feature.Icon}, {@link Feature.Title},\n\t\t * {@link Feature.Description}, {@link Feature.Action}, or other content.\n\t\t */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Feature.Icon}.\n\t */\n\texport interface IconProps extends TagProps<\"span\"> {\n\t\t/** Glyph rendered inside the tinted icon well. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Feature.Title}. The rendered tag follows the\n\t * nearest ambient heading level.\n\t */\n\texport interface TitleProps extends TagProps<\"h1\"> {\n\t\t/** Title copy for the claim. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Feature.Description}.\n\t */\n\texport interface DescriptionProps extends TagProps<\"div\"> {\n\t\t/** Supporting copy for the claim. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Feature.Action}.\n\t */\n\texport interface ActionProps extends TagProps<\"div\"> {\n\t\t/** Trailing link or button chrome for the claim. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Feature.Grid}.\n\t */\n\texport interface GridProps extends TagProps<\"div\"> {\n\t\t/** Columns above the stack breakpoint. Defaults to {@link DEFAULT_COLUMNS}. */\n\t\tcolumns?: Columns;\n\t\t/** {@link Feature} cells to lay out. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders one claim cell. Compose {@link Feature.Icon}, {@link Feature.Title},\n * {@link Feature.Description}, and {@link Feature.Action} inside it.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the cell's markup.\n * @example\n * <Feature>\n * \t<Feature.Icon><ZapIcon size={18} aria-hidden=\"true\" /></Feature.Icon>\n * \t<Feature.Title>{t(\"feature.title\")}</Feature.Title>\n * \t<Feature.Description>{t(\"feature.body\")}</Feature.Description>\n * </Feature>\n */\nexport function Feature(handle: Handle<Feature.Props>) {\n\treturn () => {\n\t\tlet { href, mix, variant, ...rest } = handle.props;\n\t\tlet resolvedVariant = variant ?? DEFAULT_VARIANT;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-variant={resolvedVariant}\n\t\t\t\tdata-href={href || undefined}\n\t\t\t\tdata-slot=\"feature\"\n\t\t\t\tmix={[\n\t\t\t\t\tvstack({ gap: 4, align: \"stretch\" }),\n\t\t\t\t\tbg(),\n\t\t\t\t\tp(8, 6),\n\t\t\t\t\tat(\"lg\", p(10, 10)),\n\t\t\t\t\twhen('&[data-variant=\"panel\"]', [\n\t\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\t\tborder({ color: \"neutral\", width: 1, style: \"solid\" }),\n\t\t\t\t\t\trounded(\"xl\"),\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 * Tinted rounded well that holds the claim's glyph.\n *\n * @param handle Runtime handle carrying the host `<span>`'s props.\n * @returns The render function producing the icon well.\n */\nFeature.Icon = function FeatureIcon(handle: Handle<Feature.IconProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<span\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"feature-icon\"\n\t\t\t\tmix={[\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\tcenter(),\n\t\t\t\t\tis(10),\n\t\t\t\t\tbs(10),\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tbg(\"brand.tint\"),\n\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\tborder({ color: \"brand\", width: 1, style: \"solid\" }),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Claim title at the ambient heading depth, sized for a feature cell.\n *\n * @param handle Runtime handle carrying the host heading's props.\n * @returns The render function producing the title.\n */\nFeature.Title = function FeatureTitle(handle: Handle<Feature.TitleProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\t\tlet resolved = resolveHeadingLevel(handle);\n\t\tlet Tag = TAG_BY_LEVEL[resolved];\n\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"feature-title\"\n\t\t\t\tdata-heading-level={resolved}\n\t\t\t\tmix={[m(0), text(\"xl\"), weight(\"medium\"), tracking(\"tight\"), fg(\"neutral.emphasis\"), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Supporting copy under the claim title.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the description.\n */\nFeature.Description = function FeatureDescription(handle: Handle<Feature.DescriptionProps>) {\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=\"feature-description\"\n\t\t\t\tmix={[vstack({ gap: 2 }), text(\"base\"), leading(\"relaxed\"), pretty(), fg(\"neutral\"), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Trailing action slot for a link or button under the claim body.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the action slot.\n */\nFeature.Action = function FeatureAction(handle: Handle<Feature.ActionProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <div {...rest} data-slot=\"feature-action\" mix={[mbs(2), hstack({ gap: 2 }), mix]} />;\n\t};\n};\n\n/**\n * Hairline-ruled grid of {@link Feature} cells. The host is the named sizing\n * container; an inner wrapper holds the grid and `@container` column tracks so\n * the query can restyle a descendant. Collapses to one column below `lg`\n * (48rem), matching the landing's original viewport threshold.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the grid.\n * @example\n * <Feature.Grid columns={3}>\n * \t<Feature>...</Feature>\n * \t<Feature>...</Feature>\n * \t<Feature>...</Feature>\n * </Feature.Grid>\n */\nFeature.Grid = function FeatureGrid(handle: Handle<Feature.GridProps>) {\n\treturn () => {\n\t\tlet { children, columns, mix, ...rest } = handle.props;\n\t\tlet resolvedColumns = columns ?? DEFAULT_COLUMNS;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-columns={String(resolvedColumns)}\n\t\t\t\tdata-slot=\"feature-grid\"\n\t\t\t\tmix={[container(\"ui-marketing-feature-grid\"), mix]}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tmix={[\n\t\t\t\t\t\tgrid(),\n\t\t\t\t\t\tgap(\"1px\"),\n\t\t\t\t\t\trounded(\"xl\"),\n\t\t\t\t\t\toverflow(\"hidden\"),\n\t\t\t\t\t\tborder({ color: \"neutral\", width: 1, style: \"solid\" }),\n\t\t\t\t\t\traw({\n\t\t\t\t\t\t\tbackgroundColor: \"var(--ui-neutral-border)\",\n\t\t\t\t\t\t\ttextAlign: \"start\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tgridTemplate({ columns: \"minmax(0, 1fr)\" }),\n\t\t\t\t\t\tat(\"lg\", \"ui-marketing-feature-grid\", [\n\t\t\t\t\t\t\tgridTemplate({\n\t\t\t\t\t\t\t\tcolumns: repeat(resolvedColumns, \"minmax(0, 1fr)\"),\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tresolvedColumns === 2\n\t\t\t\t\t\t\t\t? when(\"& > :last-child:nth-child(odd)\", raw({ gridColumn: \"1 / -1\" }))\n\t\t\t\t\t\t\t\t: [\n\t\t\t\t\t\t\t\t\t\twhen(\"& > :last-child:nth-child(3n + 1)\", raw({ gridColumn: \"1 / -1\" })),\n\t\t\t\t\t\t\t\t\t\twhen(\"& > :last-child:nth-child(3n + 2)\", raw({ gridColumn: \"span 2\" })),\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t]),\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t};\n};\n"
13
- },
14
- "test": {
15
- "path": "feature.test.tsx",
16
- "content": "/**\n * Covers {@link Feature} compound parts and {@link Feature.Grid} column\n * tracks.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { Feature } from \"@sdxc/ui/feature\";\n\ndescribe(\"Feature\", () => {\n\ttest(\"composes icon, title, description, and action parts\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Feature>\n\t\t\t\t<Feature.Icon>★</Feature.Icon>\n\t\t\t\t<Feature.Title>Fast checks</Feature.Title>\n\t\t\t\t<Feature.Description>Probe from the edge.</Feature.Description>\n\t\t\t\t<Feature.Action>\n\t\t\t\t\t<a href=\"/docs\">Read more</a>\n\t\t\t\t</Feature.Action>\n\t\t\t</Feature>,\n\t\t);\n\n\t\texpect(html).toContain('data-slot=\"feature\"');\n\t\texpect(html).toContain('data-slot=\"feature-icon\"');\n\t\texpect(html).toContain(\"Fast checks\");\n\t\texpect(html).toContain(\"Probe from the edge.\");\n\t\texpect(html).toContain(\"Read more\");\n\t});\n\n\ttest(\"lays cells in a hairline grid with column spanning for a lone last cell\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Feature.Grid columns={3}>\n\t\t\t\t<Feature>\n\t\t\t\t\t<Feature.Title>One</Feature.Title>\n\t\t\t\t</Feature>\n\t\t\t\t<Feature>\n\t\t\t\t\t<Feature.Title>Two</Feature.Title>\n\t\t\t\t</Feature>\n\t\t\t\t<Feature>\n\t\t\t\t\t<Feature.Title>Three</Feature.Title>\n\t\t\t\t</Feature>\n\t\t\t</Feature.Grid>,\n\t\t);\n\n\t\texpect(html).toContain('data-columns=\"3\"');\n\t\texpect(html).toContain(\"container: ui-marketing-feature-grid / inline-size\");\n\t\texpect(html).toContain(\"repeat(3, minmax(0, 1fr))\");\n\t\texpect(html).toContain(\"var(--ui-neutral-border)\");\n\t});\n\n\ttest(\"keeps the named container on the host and the column tracks on an inner wrapper\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Feature.Grid columns={2}>\n\t\t\t\t<Feature>\n\t\t\t\t\t<Feature.Title>One</Feature.Title>\n\t\t\t\t</Feature>\n\t\t\t\t<Feature>\n\t\t\t\t\t<Feature.Title>Two</Feature.Title>\n\t\t\t\t</Feature>\n\t\t\t</Feature.Grid>,\n\t\t);\n\n\t\texpect(html).toMatch(/data-slot=\"feature-grid\"[^>]*>\\s*<div\\b/);\n\t\texpect(html).toContain(\"container: ui-marketing-feature-grid / inline-size\");\n\t\texpect(html).toContain(\"@container ui-marketing-feature-grid (min-width: 48rem)\");\n\n\t\tlet hostClasses = new Set(\n\t\t\t(html.match(/data-slot=\"feature-grid\"[^>]*class=\"([^\"]+)\"/)?.[1] ?? \"\")\n\t\t\t\t.split(/\\s+/)\n\t\t\t\t.filter(Boolean),\n\t\t);\n\t\tlet tracksMatch = html.match(\n\t\t\t/@container ui-marketing-feature-grid \\(min-width:[^)]+\\)\\s*\\{\\s*\\.([a-z0-9-]+)\\s*\\{/,\n\t\t);\n\t\texpect(tracksMatch?.[1]).toBeTruthy();\n\t\texpect(hostClasses.has(tracksMatch![1]!)).toBe(false);\n\t});\n\n\ttest(\"adds panel chrome when variant is panel\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Feature variant=\"panel\">\n\t\t\t\t<Feature.Title>Panel claim</Feature.Title>\n\t\t\t</Feature>,\n\t\t);\n\n\t\texpect(html).toContain('data-variant=\"panel\"');\n\t});\n});\n"
17
- }
18
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "file-trigger",
3
- "changedIn": "2026.10.20",
4
- "dependencies": [],
5
- "exports": [
6
- "FileTrigger"
7
- ],
8
- "source": {
9
- "path": "file-trigger.tsx",
10
- "content": "/**\n * A pressable surface that opens the platform's file picker, backed by a\n * native `<input type=\"file\">` wrapped in a `<label>` so the platform itself\n * handles the trigger-to-picker wiring. Its visible content renders inside\n * the same label as a button-like surface, colored, weighted, and sized\n * through the same semantic contract as this library's other pressable\n * controls.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { visuallyHidden } from \"@sdxc/u/a11y\";\nimport { bg, border, fg, outline } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor, userSelect } from \"@sdxc/u/general\";\nimport { gap, inlineFlex, items, justify, shrink } from \"@sdxc/u/layout\";\nimport { bs, is, minBs, pb, pi } from \"@sdxc/u/size\";\nimport { active, data, hover, when } from \"@sdxc/u/state\";\nimport { text, weight } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { hasAccessibleText } from \"@sdxc/ui/utils\";\n\n/** Semantic color role {@link FileTrigger} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: FileTrigger.Color = \"neutral\";\n\n/** Visual weight {@link FileTrigger} falls back to when `variant` is omitted. */\nconst DEFAULT_VARIANT: FileTrigger.Variant = \"solid\";\n\n/** Size variant {@link FileTrigger} falls back to when `size` is omitted. */\nconst DEFAULT_SIZE: FileTrigger.Size = \"md\";\n\n/**\n * Prop types for {@link FileTrigger}.\n */\nexport namespace FileTrigger {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` variables.\n\t */\n\texport type Color = \"brand\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\n\t/**\n\t * Visual weight the trigger renders with: a solid fill with an on-solid\n\t * foreground, a transparent fill with a strong colored border, or a fully\n\t * transparent fill with just a colored label.\n\t */\n\texport type Variant = \"solid\" | \"outline\" | \"ghost\";\n\n\t/**\n\t * Size variant controlling the trigger's padding and font size.\n\t */\n\texport type Size = \"sm\" | \"md\" | \"lg\";\n\n\t/**\n\t * Per-part styling for the elements this component composes besides its\n\t * own host `<input>`.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the `<label>` rendering as the trigger's visible, pressable surface. */\n\t\ttrigger?: TagProps<\"label\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link FileTrigger}. Every native `<input type=\"file\">`\n\t * attribute applies unchanged except `type` (fixed `\"file\"`), `role` (not\n\t * overridable on a file input), and `size` (repurposed for visual size).\n\t */\n\texport interface Props extends Omit<TagProps<\"input\">, \"type\" | \"role\" | \"size\"> {\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/** Visual weight. Defaults to {@link DEFAULT_VARIANT}. */\n\t\tvariant?: Variant;\n\t\t/** Size variant. Defaults to {@link DEFAULT_SIZE}. */\n\t\tsize?: Size;\n\t\t/**\n\t\t * Switches the picker from choosing individual files to choosing whole\n\t\t * directories, carrying every file nested inside the chosen directory.\n\t\t */\n\t\tacceptDirectory?: boolean;\n\t\t/**\n\t\t * The trigger's visible content, rendered inside the same `<label>` that\n\t\t * wraps the host `<input>` — an icon, text, or both, kept decorative so\n\t\t * the platform's label-to-control association reaches the input on click.\n\t\t */\n\t\tchildren?: RemixNode;\n\t\t/** Per-part styling for this component's internally composed elements. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * Renders a native `<input type=\"file\">` wrapped in a `<label>` styled\n * through this library's shared `data-color`/`data-variant`/`data-size`\n * contract; in dev mode, content lacking an accessible name logs a warning.\n *\n * @param handle Runtime handle carrying the host `<input>`'s props.\n * @returns The render function producing the trigger's markup.\n * @example\n * <FileTrigger name=\"avatar\" accept=\"image/png, image/jpeg\">\n * \t{t(\"profile.chooseFile\")}\n * </FileTrigger>\n * @example\n * <FileTrigger name=\"attachments\" multiple color=\"brand\" variant=\"outline\">\n * \t{t(\"thread.attachFiles\")}\n * </FileTrigger>\n * @example\n * <FileTrigger name=\"folder\" acceptDirectory aria-label={t(\"importer.chooseFolder\")} />\n */\nexport function FileTrigger(handle: Handle<FileTrigger.Props>) {\n\treturn () => {\n\t\tlet { color, variant, size, acceptDirectory, children, parts, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\t\tlet resolvedVariant = variant ?? DEFAULT_VARIANT;\n\t\tlet resolvedSize = size ?? DEFAULT_SIZE;\n\n\t\tif (\n\t\t\timport.meta.env?.DEV &&\n\t\t\t!handle.props[\"aria-label\"] &&\n\t\t\t!handle.props[\"aria-labelledby\"] &&\n\t\t\t!hasAccessibleText(children)\n\t\t) {\n\t\t\tconsole.warn(\n\t\t\t\t\"FileTrigger: a trigger with no visible label text needs an `aria-label` describing what it opens — assistive technology has no accessible name to announce otherwise.\",\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<label\n\t\t\t\tdata-slot=\"trigger\"\n\t\t\t\tdata-color={resolvedColor}\n\t\t\t\tdata-variant={resolvedVariant}\n\t\t\t\tdata-size={resolvedSize}\n\t\t\t\tmix={[\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tgap(2),\n\t\t\t\t\t/**\n\t\t\t\t\t * A glyph is sized against the label beside it and holds that size, so the row keeps the\n\t\t\t\t\t * height its text and padding ask for; the default `flex-shrink: 1` would squash the glyph\n\t\t\t\t\t * ahead of the words.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"& > svg\", [shrink(), is(4), bs(4)]),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tweight(\"medium\"),\n\t\t\t\t\twhen(\"&:has(input:focus-visible)\", [\n\t\t\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\t\t\tdata(\"color\", \"neutral\", outline(\"neutral.ring\")),\n\t\t\t\t\t\tdata(\"color\", \"success\", outline(\"success.ring\")),\n\t\t\t\t\t\tdata(\"color\", \"warning\", outline(\"warning.ring\")),\n\t\t\t\t\t\tdata(\"color\", \"danger\", outline(\"danger.ring\")),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\"&:has(input:disabled)\", [opacity(50), cursor(\"not-allowed\")]),\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\tuserSelect(),\n\t\t\t\t\tpi(\"1rem\"),\n\t\t\t\t\tpb(\"0.5rem\"),\n\t\t\t\t\ttext(\"sm\"),\n\n\t\t\t\t\t/**\n\t\t\t\t\t * The row measure is stated, so the control lines up with a field of the same size when\n\t\t\t\t\t * a Group fuses the two, and still grows when a long label wraps.\n\t\t\t\t\t */\n\t\t\t\t\tminBs(\"2.5rem\"),\n\n\t\t\t\t\tdata(\"size\", \"sm\", [\n\t\t\t\t\t\tpi(\"0.75rem\"),\n\t\t\t\t\t\tpb(\"0.375rem\"),\n\t\t\t\t\t\ttext(\"xs\"),\n\t\t\t\t\t\tminBs(\"2rem\"),\n\t\t\t\t\t\twhen(\"& > svg\", [is(3), bs(3)]),\n\t\t\t\t\t]),\n\t\t\t\t\tdata(\"size\", \"lg\", [pi(\"1.25rem\"), pb(\"0.625rem\"), text(\"base\"), minBs(\"3rem\")]),\n\n\t\t\t\t\tdata(\"variant\", \"solid\", [\n\t\t\t\t\t\tdata(\"color\", \"brand\", [\n\t\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\t\thover(bg(\"brand.bg-solid-hover\")),\n\t\t\t\t\t\t\tactive(bg(\"brand.bg-solid-pressed\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"neutral\", [\n\t\t\t\t\t\t\tbg(\"neutral.solid\"),\n\t\t\t\t\t\t\tfg(\"neutral.onSolid\"),\n\t\t\t\t\t\t\thover(bg(\"neutral.bg-solid-hover\")),\n\t\t\t\t\t\t\tactive(bg(\"neutral.bg-solid-pressed\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"success\", [\n\t\t\t\t\t\t\tbg(\"success.solid\"),\n\t\t\t\t\t\t\tfg(\"success.onSolid\"),\n\t\t\t\t\t\t\thover(bg(\"success.bg-solid-hover\")),\n\t\t\t\t\t\t\tactive(bg(\"success.bg-solid-pressed\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"warning\", [\n\t\t\t\t\t\t\tbg(\"warning.solid\"),\n\t\t\t\t\t\t\tfg(\"warning.onSolid\"),\n\t\t\t\t\t\t\thover(bg(\"warning.bg-solid-hover\")),\n\t\t\t\t\t\t\tactive(bg(\"warning.bg-solid-pressed\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"danger\", [\n\t\t\t\t\t\t\tbg(\"danger.solid\"),\n\t\t\t\t\t\t\tfg(\"danger.onSolid\"),\n\t\t\t\t\t\t\thover(bg(\"danger.bg-solid-hover\")),\n\t\t\t\t\t\t\tactive(bg(\"danger.bg-solid-pressed\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]),\n\n\t\t\t\t\tdata(\"variant\", \"outline\", [\n\t\t\t\t\t\tborder({ width: 1, noStyleDefault: true }),\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\tdata(\"color\", \"brand\", [\n\t\t\t\t\t\t\tborder(\"brand\"),\n\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\thover([bg(\"brand.tint\"), border(\"brand.border-hover\")]),\n\t\t\t\t\t\t\tactive(bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"neutral\", [\n\t\t\t\t\t\t\tborder(\"neutral\"),\n\t\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\t\thover([bg(\"neutral.tint\"), border(\"neutral.border-hover\")]),\n\t\t\t\t\t\t\tactive(bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"success\", [\n\t\t\t\t\t\t\tborder(\"success\"),\n\t\t\t\t\t\t\tfg(\"success\"),\n\t\t\t\t\t\t\thover([bg(\"success.tint\"), border(\"success.border-hover\")]),\n\t\t\t\t\t\t\tactive(bg(\"success.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"warning\", [\n\t\t\t\t\t\t\tborder(\"warning\"),\n\t\t\t\t\t\t\tfg(\"warning\"),\n\t\t\t\t\t\t\thover([bg(\"warning.tint\"), border(\"warning.border-hover\")]),\n\t\t\t\t\t\t\tactive(bg(\"warning.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"danger\", [\n\t\t\t\t\t\t\tborder(\"danger\"),\n\t\t\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\t\t\thover([bg(\"danger.tint\"), border(\"danger.border-hover\")]),\n\t\t\t\t\t\t\tactive(bg(\"danger.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]),\n\n\t\t\t\t\tdata(\"variant\", \"ghost\", [\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\tdata(\"color\", \"brand\", [\n\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\thover(bg(\"brand.tint\")),\n\t\t\t\t\t\t\tactive(bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"neutral\", [\n\t\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\t\thover(bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\t\t\tactive(bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"success\", [\n\t\t\t\t\t\t\tfg(\"success\"),\n\t\t\t\t\t\t\thover(bg(\"success.tint\")),\n\t\t\t\t\t\t\tactive(bg(\"success.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"warning\", [\n\t\t\t\t\t\t\tfg(\"warning\"),\n\t\t\t\t\t\t\thover(bg(\"warning.tint\")),\n\t\t\t\t\t\t\tactive(bg(\"warning.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"danger\", [\n\t\t\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\t\t\thover(bg(\"danger.tint\")),\n\t\t\t\t\t\t\tactive(bg(\"danger.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]),\n\n\t\t\t\t\tparts?.trigger,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t\t<input\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t{...rest}\n\t\t\t\t\tmix={[acceptDirectory && attrs({ webkitdirectory: true }), visuallyHidden(), mix]}\n\t\t\t\t/>\n\t\t\t</label>\n\t\t);\n\t};\n}\n"
11
- },
12
- "test": null
13
- }
@@ -1,18 +0,0 @@
1
- {
2
- "name": "grid-list",
3
- "changedIn": "2026.10.13",
4
- "dependencies": [
5
- "sentinel-row"
6
- ],
7
- "exports": [
8
- "GridList"
9
- ],
10
- "source": {
11
- "path": "grid-list.tsx",
12
- "content": "/**\n * An interactive row list built from plain, already-ordered markup: each\n * {@link GridList.Item} carries a stable key a paired selection,\n * keyboard-navigation, or reorder behavior can read, while the list itself\n * renders as a fully static document by default. {@link GridList.Section}\n * groups related rows under an optional {@link GridList.Header} label,\n * {@link GridList.LoadMoreItem} holds a trailing loading placeholder, and\n * {@link GridList.DragHandle} marks the one element inside a row a\n * pointer-driven reorder behavior may grab.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { GripVerticalIcon } from \"@sdxc/icons\";\nimport { bg, borderEdge, fg, outline } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor } from \"@sdxc/u/general\";\nimport {\n\tcontainer,\n\tflex,\n\tflexCol,\n\tgap,\n\tgrid,\n\tgridTemplate,\n\titems,\n\trelative,\n\tshrink,\n\tvirtualize,\n} from \"@sdxc/u/layout\";\nimport { at } from \"@sdxc/u/responsive\";\nimport { bs, is, mbs, pb, pbs, pi } from \"@sdxc/u/size\";\nimport { active, data, not, when } from \"@sdxc/u/state\";\nimport { text, textTransform, tracking, weight } from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport { hitArea } from \"@sdxc/ui/styles\";\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { panelChrome } from \"@sdxc/ui/styles\";\nimport { warnIfNoAccessibleLabel } from \"@sdxc/ui/utils\";\n\nimport { SentinelRow } from \"@sdxc/ui/sentinel-row\";\n\n/**\n * Named container {@link GridList} declares on its own host, so its inner\n * row-list wrapper can react to the list's own width — switching a `\"grid\"`\n * layout's column count, in particular.\n */\nconst CONTAINER_NAME = \"ui-grid-list\";\n\n/** Arrangement {@link GridList} falls back to when `layout` is omitted. */\nconst DEFAULT_LAYOUT: GridList.Layout = \"stack\";\n\n/** `role=\"grid\"` applied to {@link GridList} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_ROLE = \"grid\";\n\n/** `role=\"row\"` applied to {@link GridList.Item} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_ITEM_ROLE = \"row\";\n\n/**\n * Tab stop {@link GridList.Item} falls back to when no explicit `tabIndex` is\n * set, so every row stays individually reachable in ordinary Tab order\n * before a keyboard-navigation behavior collapses the list to one stop.\n */\nconst DEFAULT_ITEM_TAB_INDEX = 0;\n\n/** `role=\"rowgroup\"` applied to {@link GridList.Section} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_SECTION_ROLE = \"rowgroup\";\n\n/** `role=\"gridcell\"` applied to {@link GridList.DragHandle} through {@link attrs} unless a consumer supplies its own `role`. */\nconst DEFAULT_DRAG_HANDLE_ROLE = \"gridcell\";\n\n/**\n * Marker {@link GridList.DragHandle} always carries as `data-drag-handle`\n * via {@link attrs} unless overridden, so a reorder behavior can tell where\n * within the row a drag gesture should originate.\n */\nconst DEFAULT_DRAG_HANDLE_MARKER = true;\n\n/**\n * Prop types for {@link GridList} and its compound parts.\n */\nexport namespace GridList {\n\t/**\n\t * Arrangement of {@link GridList.Item} rows: `\"stack\"` renders them as a\n\t * single column, `\"grid\"` wraps them into a multi-column layout growing\n\t * from two columns up to four as the list's own container widens.\n\t */\n\texport type Layout = \"stack\" | \"grid\";\n\n\t/**\n\t * Per-part styling for the elements {@link GridList} renders besides its\n\t * own host.\n\t */\n\texport interface PartsProps {\n\t\t/**\n\t\t * Styling for the inner wrapper that switches between the `\"stack\"`\n\t\t * and `\"grid\"` layouts and virtualizes a long list through\n\t\t * `content-visibility: auto`.\n\t\t */\n\t\tlist?: TagProps<\"div\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link GridList}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Row arrangement. Defaults to {@link DEFAULT_LAYOUT}. */\n\t\tlayout?: Layout;\n\t\t/** {@link GridList.Item}, {@link GridList.Section}, and {@link GridList.LoadMoreItem} rows to render. */\n\t\tchildren: RemixNode;\n\t\t/** Per-part styling for the list's internal row-list wrapper. */\n\t\tparts?: PartsProps;\n\t}\n\n\t/**\n\t * Props accepted by {@link GridList.Item}.\n\t */\n\texport interface ItemProps extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Stable identifier for this row, mirrored onto both the rendered\n\t\t * element's own `id` and a `data-rmx-key` attribute, so the row is already\n\t\t * correlation-ready for a paired behavior once one is attached.\n\t\t */\n\t\tid: string;\n\t}\n\n\t/**\n\t * Props accepted by {@link GridList.Section}.\n\t */\n\texport interface SectionProps extends TagProps<\"div\"> {\n\t\t/** The section's optional {@link GridList.Header} label, followed by its {@link GridList.Item} rows. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link GridList.Header}.\n\t */\n\texport interface HeaderProps extends TagProps<\"header\"> {}\n\n\t/**\n\t * Props accepted by {@link GridList.LoadMoreItem}.\n\t */\n\texport interface LoadMoreItemProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Props accepted by {@link GridList.DragHandle}: every native `<button>`\n\t * attribute except `type`, fixed to `\"button\"` so it never submits an\n\t * enclosing form, and `children`, fixed to the handle's own grip glyph.\n\t */\n\texport interface DragHandleProps extends Omit<TagProps<\"button\">, \"type\" | \"children\"> {\n\t\t/** Accessible name for the icon-only control, e.g. \"Reorder\" or \"Drag to reorder\". */\n\t\t\"aria-label\": string;\n\t}\n}\n\n/**\n * Renders the list's root host as a bordered `<div>` with `role=\"grid\"`,\n * keeping its row-list layer in an inner wrapper since a `@container` query\n * can't resolve against the host that declares it; reach `parts.list` to adjust it.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the list's markup.\n * @example\n * <GridList aria-label={t(\"playlist.title\")}>\n * \t<GridList.Item id=\"track-1\">{t(\"playlist.track\", { title: \"Intro\" })}</GridList.Item>\n * \t<GridList.Item id=\"track-2\">{t(\"playlist.track\", { title: \"Chorus\" })}</GridList.Item>\n * </GridList>\n * @example\n * <GridList aria-label={t(\"gallery.title\")} layout=\"grid\">\n * \t<GridList.Item id=\"photo-1\">{t(\"gallery.photo\", { name: \"Sunset\" })}</GridList.Item>\n * \t<GridList.Item id=\"photo-2\">{t(\"gallery.photo\", { name: \"Harbor\" })}</GridList.Item>\n * </GridList>\n */\nexport function GridList(handle: Handle<GridList.Props>) {\n\treturn () => {\n\t\tlet { layout, children, parts, mix, ...rest } = handle.props;\n\t\tlet resolvedLayout = layout ?? DEFAULT_LAYOUT;\n\n\t\twarnIfNoAccessibleLabel(\n\t\t\thandle.props,\n\t\t\t'GridList: needs an \"aria-label\" or \"aria-labelledby\" describing its contents for assistive technology.',\n\t\t);\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_ROLE }),\n\t\t\t\t\tpanelChrome(),\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\tpb(2),\n\t\t\t\t\tpi(2),\n\t\t\t\t\toutline(\"none\"),\n\t\t\t\t\tcontainer(CONTAINER_NAME),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tdata-slot=\"list\"\n\t\t\t\t\tdata-layout={resolvedLayout}\n\t\t\t\t\tmix={[\n\t\t\t\t\t\tflex(),\n\t\t\t\t\t\tflexCol(),\n\t\t\t\t\t\tgap(1),\n\t\t\t\t\t\tvirtualize(\"auto var(--ui-grid-list-intrinsic-size, 32rem)\"),\n\t\t\t\t\t\tdata(\"layout\", \"grid\", [\n\t\t\t\t\t\t\tgrid(),\n\t\t\t\t\t\t\tgap(\"0.5rem\"),\n\t\t\t\t\t\t\tgridTemplate({ columns: \"repeat(2, minmax(0, 1fr))\" }),\n\t\t\t\t\t\t\tat(\"40rem\", CONTAINER_NAME, gridTemplate({ columns: \"repeat(3, minmax(0, 1fr))\" })),\n\t\t\t\t\t\t\tat(\"48rem\", CONTAINER_NAME, gridTemplate({ columns: \"repeat(4, minmax(0, 1fr))\" })),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tparts?.list,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t};\n}\n\n/**\n * Renders a single row: a `<div>` carrying `role=\"row\"`, its `id` mirrored\n * onto a `data-rmx-key` attribute so a paired selection, keyboard-navigation, or\n * reorder behavior can correlate the row with its own state.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the row's markup.\n * @example\n * <GridList.Item id=\"track-1\">{t(\"playlist.track\", { title: \"Intro\" })}</GridList.Item>\n * @example\n * <GridList.Item id=\"track-2\" aria-selected=\"true\">\n * \t{t(\"playlist.track\", { title: \"Chorus\" })}\n * </GridList.Item>\n */\nGridList.Item = function GridListItem(handle: Handle<GridList.ItemProps>) {\n\treturn () => {\n\t\tlet { id, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tid={id}\n\t\t\t\tdata-rmx-key={id}\n\t\t\t\tmix={[\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tattrs({ role: DEFAULT_ITEM_ROLE, tabIndex: DEFAULT_ITEM_TAB_INDEX }),\n\t\t\t\t\tflex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tgap(2),\n\t\t\t\t\t/**\n\t\t\t\t\t * A leading glyph is sized against the row's text and holds that size when the row runs\n\t\t\t\t\t * short; the default `flex-shrink: 1` would squeeze each glyph by its own row's overrun\n\t\t\t\t\t * and leave the column of glyphs ragged.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"& > svg\", [shrink(), is(4), bs(4)]),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tpb(2),\n\t\t\t\t\tpi(2),\n\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * A selected row is tinted far enough off the surface to read at a glance; the plain tint\n\t\t\t\t\t * matches the list's background. Pointer and selection states use mutually exclusive\n\t\t\t\t\t * selectors, so a hovered row stays visibly selected whichever order the layers land in.\n\t\t\t\t\t */\n\t\t\t\t\twhen('&:hover:not([aria-selected=\"true\"])', bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\twhen('&:active:not([aria-selected=\"true\"])', bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\twhen('&:focus:not([aria-selected=\"true\"])', bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\twhen('&[aria-selected=\"true\"]', bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\twhen('&[aria-selected=\"true\"]:hover', bg(\"brand.bg-tint-pressed\")),\n\t\t\t\t\twhen('&[aria-disabled=\"true\"]', opacity(50)),\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\toutline(\"none\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a titled group of rows: a `<div>` carrying `role=\"rowgroup\"`,\n * stacking an optional {@link GridList.Header} above its {@link GridList.Item}\n * rows, with a block-start rule before every section but the first.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the section's markup.\n * @example\n * <GridList.Section aria-labelledby=\"recents-heading\">\n * \t<GridList.Header id=\"recents-heading\">{t(\"playlist.recents\")}</GridList.Header>\n * \t<GridList.Item id=\"track-1\">{t(\"playlist.track\", { title: \"Intro\" })}</GridList.Item>\n * </GridList.Section>\n */\nGridList.Section = function GridListSection(handle: Handle<GridList.SectionProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_SECTION_ROLE }),\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tgap(1),\n\t\t\t\t\tnot(\":first-child\", [\n\t\t\t\t\t\tmbs(2),\n\t\t\t\t\t\tpbs(2),\n\t\t\t\t\t\tborderEdge(\"block-start\", { color: \"neutral\", width: 1 }),\n\t\t\t\t\t]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a section's label: a `<header>` styled as small, muted, uppercase\n * text for the {@link GridList.Item} rows nested beneath it in a\n * {@link GridList.Section}; point the section's `aria-labelledby` at its `id`.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the label's markup.\n * @example\n * <GridList.Header id=\"recents-heading\">{t(\"playlist.recents\")}</GridList.Header>\n */\nGridList.Header = function GridListHeader(handle: Handle<GridList.HeaderProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<header\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tpb(1),\n\t\t\t\t\tpi(2),\n\t\t\t\t\tweight(\"semibold\"),\n\t\t\t\t\ttracking(\"wider\"),\n\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\ttext(\"xs\"),\n\t\t\t\t\ttextTransform(\"uppercase\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders a decorative sentinel row: a `<div>` styled as centered, muted\n * small text sized to match {@link GridList.Item}'s vertical rhythm, ready to\n * hold whatever loading indicator a paired enhancement supplies as `children`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the sentinel row's markup.\n * @example\n * <GridList.LoadMoreItem>{t(\"playlist.loadingMore\")}</GridList.LoadMoreItem>\n */\nGridList.LoadMoreItem = SentinelRow;\n\n/**\n * Renders a row's drag grip as a native `<button type=\"button\">` written before the\n * consumer's attributes, so a `command`/`commandfor` pair still runs inside a `<form>`;\n * its pointer target grows to `--ui-target-size` around the 16px glyph.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the handle's markup.\n * @example\n * <GridList.Item id=\"track-1\">\n * \t{t(\"playlist.track\", { title: \"Intro\" })}\n * \t<GridList.DragHandle aria-label={t(\"playlist.reorder\")} />\n * </GridList.Item>\n */\nGridList.DragHandle = function GridListDragHandle(handle: Handle<GridList.DragHandleProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_DRAG_HANDLE_ROLE, \"data-drag-handle\": DEFAULT_DRAG_HANDLE_MARKER }),\n\t\t\t\t\trelative(),\n\t\t\t\t\thitArea(),\n\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\tcursor(\"grab\"),\n\t\t\t\t\tactive(cursor(\"grabbing\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<GripVerticalIcon size={16} />\n\t\t\t</button>\n\t\t);\n\t};\n};\n"
13
- },
14
- "test": {
15
- "path": "grid-list.test.tsx",
16
- "content": "/**\n * Tests for the `type` {@link GridList.DragHandle} writes: an explicit\n * `type=\"button\"`, positioned before the consumer's own attributes, without\n * which the platform refuses to run an Invoker Command the handle carries\n * inside a `<form>` — it decides whether the pairing is ambiguous while it\n * parses `command`/`commandfor` and never sees a `type` serialized after them.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { GridList } from \"@sdxc/ui/grid-list\";\n\ndescribe(\"GridList.DragHandle\", () => {\n\ttest('types itself \"button\", so its command survives inside a form', async () => {\n\t\tlet html = await renderToString(<GridList.DragHandle aria-label=\"Reorder\" />);\n\n\t\texpect(html).toContain('type=\"button\"');\n\t});\n\n\ttest(\"writes type before the command attributes, which is where the platform reads it\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<GridList.DragHandle aria-label=\"Reorder\" commandfor=\"playlist\" command=\"reorder\" />,\n\t\t);\n\n\t\texpect(html.indexOf('type=\"button\"')).toBeLessThan(html.indexOf(\"commandfor=\"));\n\t\texpect(html.indexOf('type=\"button\"')).toBeLessThan(html.indexOf(\"command=\"));\n\t});\n});\n\ndescribe(\"GridList.DragHandle target\", () => {\n\ttest(\"grows its pointer target around the grip to the minimum target size\", async () => {\n\t\tlet html = String(await renderToString(<GridList.DragHandle aria-label=\"Reorder\" />));\n\n\t\texpect(html).toContain(\"--ui-target-size\");\n\t\texpect(html).toMatch(/position:\\s*relative/);\n\t});\n});\n"
17
- }
18
- }
@@ -1,16 +0,0 @@
1
- {
2
- "name": "logo-cloud",
3
- "changedIn": "2026.10.29",
4
- "dependencies": [],
5
- "exports": [
6
- "LogoCloud"
7
- ],
8
- "source": {
9
- "path": "logo-cloud.tsx",
10
- "content": "/**\n * A wrapping row of adopter marks for marketing proof strips. Each child is\n * forced to the marketing logo height with muted currentColor treatment so\n * the row reads as one quiet band.\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 { fg } from \"@sdxc/u/color\";\nimport { opacity } from \"@sdxc/u/effects\";\nimport { raw, var as varUtility } from \"@sdxc/u/general\";\nimport { flexWrap, gap, inlineFlex, items, justify } from \"@sdxc/u/layout\";\nimport { bs, is } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\n\n/** Forced height each direct child mark settles at. */\nconst LOGO_HEIGHT = varUtility(\"ui-marketing-logo-height\", \"1rem\");\n\n/**\n * Prop types for {@link LogoCloud}.\n */\nexport namespace LogoCloud {\n\t/**\n\t * Props accepted by {@link LogoCloud}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Softens the whole row further through the muted foreground token.\n\t\t * Individual marks already carry `logoCloudMark()` opacity.\n\t\t */\n\t\tmuted?: boolean;\n\t\t/**\n\t\t * Consumer-supplied marks — {@link Logo}, `<img>`, or inline SVG\n\t\t * children. The cloud applies mark sizing to each direct child.\n\t\t */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Lays logo children in a wrapping, centered row and forces each direct child\n * to the marketing logo height with muted currentColor treatment.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the cloud's markup.\n * @example\n * <LogoCloud muted>\n * \t<img src={acme} alt=\"\" />\n * \t<img src={globex} alt=\"\" />\n * </LogoCloud>\n */\nexport function LogoCloud(handle: Handle<LogoCloud.Props>) {\n\treturn () => {\n\t\tlet { mix, muted, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-muted={muted ? \"true\" : undefined}\n\t\t\t\tdata-slot=\"logo-cloud\"\n\t\t\t\tmix={[\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\tflexWrap(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tgap(6),\n\t\t\t\t\tmuted ? fg(\"neutral.muted\") : fg(\"neutral\"),\n\t\t\t\t\twhen(\"& > *\", [\n\t\t\t\t\t\tbs(LOGO_HEIGHT),\n\t\t\t\t\t\tis(\"auto\"),\n\t\t\t\t\t\topacity(65),\n\t\t\t\t\t\traw({ objectFit: \"contain\", color: \"currentColor\" }),\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
- },
12
- "test": {
13
- "path": "logo-cloud.test.tsx",
14
- "content": "/**\n * Covers {@link LogoCloud} applying mark sizing to direct children.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { LogoCloud } from \"@sdxc/ui/logo-cloud\";\n\ndescribe(\"LogoCloud\", () => {\n\ttest(\"sizes direct children with the logo-cloud mark recipe\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<LogoCloud muted>\n\t\t\t\t<img src=\"/acme.svg\" alt=\"\" />\n\t\t\t\t<img src=\"/globex.svg\" alt=\"\" />\n\t\t\t</LogoCloud>,\n\t\t);\n\n\t\texpect(html).toContain('data-slot=\"logo-cloud\"');\n\t\texpect(html).toContain('data-muted=\"true\"');\n\t\texpect(html).toContain(\"var(--ui-marketing-logo-height\");\n\t\texpect(html).toContain('src=\"/acme.svg\"');\n\t});\n});\n"
15
- }
16
- }