@sdxc/ui 0.0.0-pre.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (399) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +812 -0
  3. package/dist/animations/index.d.ts +12 -0
  4. package/dist/animations/index.js +12 -0
  5. package/dist/animations/keyframes.d.ts +162 -0
  6. package/dist/animations/keyframes.js +297 -0
  7. package/dist/animations/scroll.d.ts +154 -0
  8. package/dist/animations/scroll.js +228 -0
  9. package/dist/animations/tokens.d.ts +47 -0
  10. package/dist/animations/tokens.js +47 -0
  11. package/dist/animations/transitions.d.ts +143 -0
  12. package/dist/animations/transitions.js +147 -0
  13. package/dist/behaviors/announcer.d.ts +90 -0
  14. package/dist/behaviors/announcer.js +93 -0
  15. package/dist/behaviors/calendar-model.d.ts +218 -0
  16. package/dist/behaviors/calendar-model.js +376 -0
  17. package/dist/behaviors/drag-session.d.ts +119 -0
  18. package/dist/behaviors/drag-session.js +110 -0
  19. package/dist/behaviors/filter-model.d.ts +117 -0
  20. package/dist/behaviors/filter-model.js +185 -0
  21. package/dist/behaviors/index.d.ts +16 -0
  22. package/dist/behaviors/index.js +16 -0
  23. package/dist/behaviors/resize-session.d.ts +115 -0
  24. package/dist/behaviors/resize-session.js +157 -0
  25. package/dist/behaviors/scroll-follow-model.d.ts +180 -0
  26. package/dist/behaviors/scroll-follow-model.js +197 -0
  27. package/dist/behaviors/selection-model.d.ts +129 -0
  28. package/dist/behaviors/selection-model.js +259 -0
  29. package/dist/behaviors/toaster.d.ts +144 -0
  30. package/dist/behaviors/toaster.js +228 -0
  31. package/dist/components/accordion.d.ts +93 -0
  32. package/dist/components/accordion.js +165 -0
  33. package/dist/components/alert-dialog.d.ts +110 -0
  34. package/dist/components/alert-dialog.js +169 -0
  35. package/dist/components/alert.d.ts +109 -0
  36. package/dist/components/alert.js +160 -0
  37. package/dist/components/aspect-ratio.d.ts +44 -0
  38. package/dist/components/aspect-ratio.js +35 -0
  39. package/dist/components/attachment.d.ts +146 -0
  40. package/dist/components/attachment.js +320 -0
  41. package/dist/components/avatar.d.ts +118 -0
  42. package/dist/components/avatar.js +89 -0
  43. package/dist/components/badge.d.ts +66 -0
  44. package/dist/components/badge.js +129 -0
  45. package/dist/components/breadcrumbs.d.ts +67 -0
  46. package/dist/components/breadcrumbs.js +121 -0
  47. package/dist/components/bubble.d.ts +91 -0
  48. package/dist/components/bubble.js +216 -0
  49. package/dist/components/button.d.ts +78 -0
  50. package/dist/components/button.js +207 -0
  51. package/dist/components/calendar.d.ts +166 -0
  52. package/dist/components/calendar.js +320 -0
  53. package/dist/components/card.d.ts +82 -0
  54. package/dist/components/card.js +126 -0
  55. package/dist/components/carousel.d.ts +96 -0
  56. package/dist/components/carousel.js +214 -0
  57. package/dist/components/chart.d.ts +485 -0
  58. package/dist/components/chart.js +563 -0
  59. package/dist/components/checkbox-group.d.ts +58 -0
  60. package/dist/components/checkbox-group.js +53 -0
  61. package/dist/components/checkbox.d.ts +61 -0
  62. package/dist/components/checkbox.js +81 -0
  63. package/dist/components/color-area.d.ts +83 -0
  64. package/dist/components/color-area.js +251 -0
  65. package/dist/components/color-field.d.ts +128 -0
  66. package/dist/components/color-field.js +73 -0
  67. package/dist/components/color-picker.d.ts +132 -0
  68. package/dist/components/color-picker.js +183 -0
  69. package/dist/components/color-slider.d.ts +103 -0
  70. package/dist/components/color-slider.js +198 -0
  71. package/dist/components/color-swatch-picker.d.ts +106 -0
  72. package/dist/components/color-swatch-picker.js +75 -0
  73. package/dist/components/color-swatch.d.ts +57 -0
  74. package/dist/components/color-swatch.js +82 -0
  75. package/dist/components/color-wheel.d.ts +58 -0
  76. package/dist/components/color-wheel.js +160 -0
  77. package/dist/components/combobox.d.ts +73 -0
  78. package/dist/components/combobox.js +108 -0
  79. package/dist/components/command.d.ts +80 -0
  80. package/dist/components/command.js +151 -0
  81. package/dist/components/confirm.d.ts +124 -0
  82. package/dist/components/confirm.js +56 -0
  83. package/dist/components/context-menu.d.ts +108 -0
  84. package/dist/components/context-menu.js +200 -0
  85. package/dist/components/date-field.d.ts +110 -0
  86. package/dist/components/date-field.js +49 -0
  87. package/dist/components/date-picker.d.ts +136 -0
  88. package/dist/components/date-picker.js +155 -0
  89. package/dist/components/date-range-picker.d.ts +152 -0
  90. package/dist/components/date-range-picker.js +106 -0
  91. package/dist/components/description.d.ts +36 -0
  92. package/dist/components/description.js +21 -0
  93. package/dist/components/dialog.d.ts +97 -0
  94. package/dist/components/dialog.js +203 -0
  95. package/dist/components/disclosure.d.ts +85 -0
  96. package/dist/components/disclosure.js +180 -0
  97. package/dist/components/drawer.d.ts +82 -0
  98. package/dist/components/drawer.js +162 -0
  99. package/dist/components/drop-indicator.d.ts +43 -0
  100. package/dist/components/drop-indicator.js +47 -0
  101. package/dist/components/drop-zone.d.ts +73 -0
  102. package/dist/components/drop-zone.js +54 -0
  103. package/dist/components/empty.d.ts +89 -0
  104. package/dist/components/empty.js +129 -0
  105. package/dist/components/field-error.d.ts +41 -0
  106. package/dist/components/field-error.js +36 -0
  107. package/dist/components/file-trigger.d.ts +84 -0
  108. package/dist/components/file-trigger.js +169 -0
  109. package/dist/components/form.d.ts +118 -0
  110. package/dist/components/form.js +113 -0
  111. package/dist/components/grid-list.d.ts +112 -0
  112. package/dist/components/grid-list.js +220 -0
  113. package/dist/components/group.d.ts +45 -0
  114. package/dist/components/group.js +44 -0
  115. package/dist/components/header.d.ts +33 -0
  116. package/dist/components/header.js +29 -0
  117. package/dist/components/heading-scope.d.ts +83 -0
  118. package/dist/components/heading-scope.js +82 -0
  119. package/dist/components/heading.d.ts +50 -0
  120. package/dist/components/heading.js +31 -0
  121. package/dist/components/hover-card.d.ts +77 -0
  122. package/dist/components/hover-card.js +151 -0
  123. package/dist/components/image-placeholder.d.ts +105 -0
  124. package/dist/components/image-placeholder.js +212 -0
  125. package/dist/components/index.d.ts +109 -0
  126. package/dist/components/index.js +109 -0
  127. package/dist/components/input.d.ts +53 -0
  128. package/dist/components/input.js +76 -0
  129. package/dist/components/item.d.ts +97 -0
  130. package/dist/components/item.js +185 -0
  131. package/dist/components/keyboard.d.ts +33 -0
  132. package/dist/components/keyboard.js +20 -0
  133. package/dist/components/label.d.ts +38 -0
  134. package/dist/components/label.js +24 -0
  135. package/dist/components/link-button.d.ts +59 -0
  136. package/dist/components/link-button.js +174 -0
  137. package/dist/components/link.d.ts +43 -0
  138. package/dist/components/link.js +85 -0
  139. package/dist/components/listbox.d.ts +119 -0
  140. package/dist/components/listbox.js +114 -0
  141. package/dist/components/logo.d.ts +117 -0
  142. package/dist/components/logo.js +89 -0
  143. package/dist/components/marker.d.ts +82 -0
  144. package/dist/components/marker.js +163 -0
  145. package/dist/components/menu.d.ts +90 -0
  146. package/dist/components/menu.js +146 -0
  147. package/dist/components/menubar.d.ts +54 -0
  148. package/dist/components/menubar.js +118 -0
  149. package/dist/components/message-scroller.d.ts +109 -0
  150. package/dist/components/message-scroller.js +180 -0
  151. package/dist/components/message.d.ts +104 -0
  152. package/dist/components/message.js +200 -0
  153. package/dist/components/meter.d.ts +60 -0
  154. package/dist/components/meter.js +110 -0
  155. package/dist/components/modal.d.ts +71 -0
  156. package/dist/components/modal.js +120 -0
  157. package/dist/components/nav-link.d.ts +53 -0
  158. package/dist/components/nav-link.js +83 -0
  159. package/dist/components/navigation-menu.d.ts +150 -0
  160. package/dist/components/navigation-menu.js +381 -0
  161. package/dist/components/number-field.d.ts +76 -0
  162. package/dist/components/number-field.js +190 -0
  163. package/dist/components/otp-field.d.ts +68 -0
  164. package/dist/components/otp-field.js +46 -0
  165. package/dist/components/overlay-arrow.d.ts +51 -0
  166. package/dist/components/overlay-arrow.js +77 -0
  167. package/dist/components/pagination.d.ts +67 -0
  168. package/dist/components/pagination.js +164 -0
  169. package/dist/components/popover.d.ts +69 -0
  170. package/dist/components/popover.js +68 -0
  171. package/dist/components/progress-bar.d.ts +53 -0
  172. package/dist/components/progress-bar.js +90 -0
  173. package/dist/components/radio-group.d.ts +102 -0
  174. package/dist/components/radio-group.js +114 -0
  175. package/dist/components/range-calendar.d.ts +169 -0
  176. package/dist/components/range-calendar.js +216 -0
  177. package/dist/components/resizable.d.ts +98 -0
  178. package/dist/components/resizable.js +151 -0
  179. package/dist/components/scroll-area.d.ts +54 -0
  180. package/dist/components/scroll-area.js +89 -0
  181. package/dist/components/search-field.d.ts +55 -0
  182. package/dist/components/search-field.js +49 -0
  183. package/dist/components/section.d.ts +37 -0
  184. package/dist/components/section.js +22 -0
  185. package/dist/components/select.d.ts +96 -0
  186. package/dist/components/select.js +285 -0
  187. package/dist/components/selection-indicator.d.ts +47 -0
  188. package/dist/components/selection-indicator.js +50 -0
  189. package/dist/components/sentinel-row.d.ts +22 -0
  190. package/dist/components/sentinel-row.js +29 -0
  191. package/dist/components/separator.d.ts +35 -0
  192. package/dist/components/separator.js +48 -0
  193. package/dist/components/shared-element.d.ts +45 -0
  194. package/dist/components/shared-element.js +48 -0
  195. package/dist/components/sheet.d.ts +78 -0
  196. package/dist/components/sheet.js +167 -0
  197. package/dist/components/sidebar.d.ts +288 -0
  198. package/dist/components/sidebar.js +1068 -0
  199. package/dist/components/skeleton.d.ts +36 -0
  200. package/dist/components/skeleton.js +38 -0
  201. package/dist/components/slider.d.ts +102 -0
  202. package/dist/components/slider.js +179 -0
  203. package/dist/components/spinner.d.ts +55 -0
  204. package/dist/components/spinner.js +51 -0
  205. package/dist/components/switch.d.ts +47 -0
  206. package/dist/components/switch.js +82 -0
  207. package/dist/components/table.d.ts +139 -0
  208. package/dist/components/table.js +216 -0
  209. package/dist/components/tabs.d.ts +124 -0
  210. package/dist/components/tabs.js +246 -0
  211. package/dist/components/tag-group.d.ts +83 -0
  212. package/dist/components/tag-group.js +157 -0
  213. package/dist/components/text-field.d.ts +119 -0
  214. package/dist/components/text-field.js +51 -0
  215. package/dist/components/text.d.ts +34 -0
  216. package/dist/components/text.js +19 -0
  217. package/dist/components/textarea.d.ts +52 -0
  218. package/dist/components/textarea.js +82 -0
  219. package/dist/components/time-field.d.ts +110 -0
  220. package/dist/components/time-field.js +48 -0
  221. package/dist/components/toast.d.ts +149 -0
  222. package/dist/components/toast.js +365 -0
  223. package/dist/components/toggle-button.d.ts +115 -0
  224. package/dist/components/toggle-button.js +237 -0
  225. package/dist/components/toolbar.d.ts +47 -0
  226. package/dist/components/toolbar.js +54 -0
  227. package/dist/components/tooltip.d.ts +52 -0
  228. package/dist/components/tooltip.js +92 -0
  229. package/dist/components/tree.d.ts +123 -0
  230. package/dist/components/tree.js +239 -0
  231. package/dist/components/typeset.d.ts +53 -0
  232. package/dist/components/typeset.js +271 -0
  233. package/dist/index.d.ts +8 -0
  234. package/dist/index.js +8 -0
  235. package/dist/mixins/aria-checked.d.ts +42 -0
  236. package/dist/mixins/aria-checked.js +127 -0
  237. package/dist/mixins/attachment-trigger.d.ts +64 -0
  238. package/dist/mixins/attachment-trigger.js +190 -0
  239. package/dist/mixins/calendar-keys.d.ts +27 -0
  240. package/dist/mixins/calendar-keys.js +113 -0
  241. package/dist/mixins/carousel-controls.d.ts +30 -0
  242. package/dist/mixins/carousel-controls.js +222 -0
  243. package/dist/mixins/chart-tooltip.d.ts +118 -0
  244. package/dist/mixins/chart-tooltip.js +323 -0
  245. package/dist/mixins/clear-field.d.ts +60 -0
  246. package/dist/mixins/clear-field.js +100 -0
  247. package/dist/mixins/color-area-drag.d.ts +58 -0
  248. package/dist/mixins/color-area-drag.js +162 -0
  249. package/dist/mixins/color-channel-sync.d.ts +73 -0
  250. package/dist/mixins/color-channel-sync.js +169 -0
  251. package/dist/mixins/color-preview.d.ts +28 -0
  252. package/dist/mixins/color-preview.js +77 -0
  253. package/dist/mixins/color-wheel-drag.d.ts +58 -0
  254. package/dist/mixins/color-wheel-drag.js +139 -0
  255. package/dist/mixins/combobox-filter.d.ts +59 -0
  256. package/dist/mixins/combobox-filter.js +81 -0
  257. package/dist/mixins/command-filter.d.ts +55 -0
  258. package/dist/mixins/command-filter.js +121 -0
  259. package/dist/mixins/command-keys.d.ts +31 -0
  260. package/dist/mixins/command-keys.js +116 -0
  261. package/dist/mixins/context-menu.d.ts +24 -0
  262. package/dist/mixins/context-menu.js +64 -0
  263. package/dist/mixins/copy-to-clipboard.d.ts +64 -0
  264. package/dist/mixins/copy-to-clipboard.js +109 -0
  265. package/dist/mixins/dismiss.d.ts +77 -0
  266. package/dist/mixins/dismiss.js +151 -0
  267. package/dist/mixins/drag-reorder.d.ts +88 -0
  268. package/dist/mixins/drag-reorder.js +214 -0
  269. package/dist/mixins/drop-zone.d.ts +52 -0
  270. package/dist/mixins/drop-zone.js +132 -0
  271. package/dist/mixins/dual-range.d.ts +60 -0
  272. package/dist/mixins/dual-range.js +100 -0
  273. package/dist/mixins/grid-list-keys.d.ts +34 -0
  274. package/dist/mixins/grid-list-keys.js +260 -0
  275. package/dist/mixins/heading-level-fallback.d.ts +81 -0
  276. package/dist/mixins/heading-level-fallback.js +112 -0
  277. package/dist/mixins/hotkey.d.ts +26 -0
  278. package/dist/mixins/hotkey.js +132 -0
  279. package/dist/mixins/image-fallback.d.ts +57 -0
  280. package/dist/mixins/image-fallback.js +86 -0
  281. package/dist/mixins/index.d.ts +48 -0
  282. package/dist/mixins/index.js +48 -0
  283. package/dist/mixins/listbox-keys.d.ts +52 -0
  284. package/dist/mixins/listbox-keys.js +63 -0
  285. package/dist/mixins/long-press.d.ts +76 -0
  286. package/dist/mixins/long-press.js +130 -0
  287. package/dist/mixins/menu-keys.d.ts +40 -0
  288. package/dist/mixins/menu-keys.js +117 -0
  289. package/dist/mixins/menubar-keys.d.ts +59 -0
  290. package/dist/mixins/menubar-keys.js +230 -0
  291. package/dist/mixins/message-follow.d.ts +56 -0
  292. package/dist/mixins/message-follow.js +368 -0
  293. package/dist/mixins/otp-slots.d.ts +53 -0
  294. package/dist/mixins/otp-slots.js +175 -0
  295. package/dist/mixins/persist.d.ts +36 -0
  296. package/dist/mixins/persist.js +78 -0
  297. package/dist/mixins/press-toggle.d.ts +43 -0
  298. package/dist/mixins/press-toggle.js +61 -0
  299. package/dist/mixins/range-preview.d.ts +26 -0
  300. package/dist/mixins/range-preview.js +120 -0
  301. package/dist/mixins/resize-handle.d.ts +101 -0
  302. package/dist/mixins/resize-handle.js +288 -0
  303. package/dist/mixins/stepper.d.ts +81 -0
  304. package/dist/mixins/stepper.js +194 -0
  305. package/dist/mixins/tab-keys.d.ts +30 -0
  306. package/dist/mixins/tab-keys.js +63 -0
  307. package/dist/mixins/theme-toggle.d.ts +82 -0
  308. package/dist/mixins/theme-toggle.js +158 -0
  309. package/dist/mixins/track-host-node.d.ts +34 -0
  310. package/dist/mixins/track-host-node.js +42 -0
  311. package/dist/mixins/treeKeys.d.ts +57 -0
  312. package/dist/mixins/treeKeys.js +266 -0
  313. package/dist/mixins/validate.d.ts +65 -0
  314. package/dist/mixins/validate.js +139 -0
  315. package/dist/mixins/view-transition.d.ts +56 -0
  316. package/dist/mixins/view-transition.js +111 -0
  317. package/dist/styles/chart-palette.d.ts +34 -0
  318. package/dist/styles/chart-palette.js +27 -0
  319. package/dist/styles/field-stack-layout.d.ts +27 -0
  320. package/dist/styles/field-stack-layout.js +16 -0
  321. package/dist/styles/floating-surface.d.ts +32 -0
  322. package/dist/styles/floating-surface.js +30 -0
  323. package/dist/styles/graphic-host.d.ts +25 -0
  324. package/dist/styles/graphic-host.js +18 -0
  325. package/dist/styles/index.d.ts +20 -0
  326. package/dist/styles/index.js +20 -0
  327. package/dist/styles/interactive-transition.d.ts +32 -0
  328. package/dist/styles/interactive-transition.js +32 -0
  329. package/dist/styles/legend-toggle.d.ts +29 -0
  330. package/dist/styles/legend-toggle.js +24 -0
  331. package/dist/styles/output-caption-text.d.ts +22 -0
  332. package/dist/styles/output-caption-text.js +15 -0
  333. package/dist/styles/panel-chrome.d.ts +34 -0
  334. package/dist/styles/panel-chrome.js +26 -0
  335. package/dist/styles/range-thumb-appearance.d.ts +36 -0
  336. package/dist/styles/range-thumb-appearance.js +76 -0
  337. package/dist/styles/rtl-aware-gradient-direction.d.ts +28 -0
  338. package/dist/styles/rtl-aware-gradient-direction.js +28 -0
  339. package/dist/styles/semantic-color-panel.d.ts +35 -0
  340. package/dist/styles/semantic-color-panel.js +41 -0
  341. package/dist/utils/chart-marker-indices.d.ts +22 -0
  342. package/dist/utils/chart-marker-indices.js +45 -0
  343. package/dist/utils/chart-path.d.ts +86 -0
  344. package/dist/utils/chart-path.js +122 -0
  345. package/dist/utils/chart-scale.d.ts +182 -0
  346. package/dist/utils/chart-scale.js +221 -0
  347. package/dist/utils/color-math.d.ts +252 -0
  348. package/dist/utils/color-math.js +480 -0
  349. package/dist/utils/command-event.d.ts +24 -0
  350. package/dist/utils/command-event.js +26 -0
  351. package/dist/utils/css-styles.d.ts +21 -0
  352. package/dist/utils/css-styles.js +11 -0
  353. package/dist/utils/decorative-icon.d.ts +15 -0
  354. package/dist/utils/decorative-icon.js +15 -0
  355. package/dist/utils/disabled-selector.d.ts +22 -0
  356. package/dist/utils/disabled-selector.js +22 -0
  357. package/dist/utils/dispatch-change.d.ts +17 -0
  358. package/dist/utils/dispatch-change.js +19 -0
  359. package/dist/utils/field-parts.d.ts +26 -0
  360. package/dist/utils/field-parts.js +12 -0
  361. package/dist/utils/full-turn-radians.d.ts +16 -0
  362. package/dist/utils/full-turn-radians.js +16 -0
  363. package/dist/utils/geometry.d.ts +14 -0
  364. package/dist/utils/geometry.js +9 -0
  365. package/dist/utils/has-accessible-text.d.ts +19 -0
  366. package/dist/utils/has-accessible-text.js +30 -0
  367. package/dist/utils/hue-spectrum.d.ts +19 -0
  368. package/dist/utils/hue-spectrum.js +19 -0
  369. package/dist/utils/index.d.ts +35 -0
  370. package/dist/utils/index.js +35 -0
  371. package/dist/utils/is-new-primary-press.d.ts +29 -0
  372. package/dist/utils/is-new-primary-press.js +31 -0
  373. package/dist/utils/keyboard-nav.d.ts +64 -0
  374. package/dist/utils/keyboard-nav.js +79 -0
  375. package/dist/utils/merge-style.d.ts +33 -0
  376. package/dist/utils/merge-style.js +30 -0
  377. package/dist/utils/paired-range-inputs.d.ts +26 -0
  378. package/dist/utils/paired-range-inputs.js +29 -0
  379. package/dist/utils/placement.d.ts +18 -0
  380. package/dist/utils/placement.js +12 -0
  381. package/dist/utils/prefers-reduced-motion.d.ts +17 -0
  382. package/dist/utils/prefers-reduced-motion.js +19 -0
  383. package/dist/utils/resolve-field-wiring.d.ts +83 -0
  384. package/dist/utils/resolve-field-wiring.js +53 -0
  385. package/dist/utils/resolve-fill-percent.d.ts +28 -0
  386. package/dist/utils/resolve-fill-percent.js +34 -0
  387. package/dist/utils/round-precision.d.ts +22 -0
  388. package/dist/utils/round-precision.js +25 -0
  389. package/dist/utils/semantic-color-panel.d.ts +35 -0
  390. package/dist/utils/semantic-color-panel.js +28 -0
  391. package/dist/utils/semantic-color.d.ts +17 -0
  392. package/dist/utils/semantic-color.js +11 -0
  393. package/dist/utils/warn-if-no-accessible-name.d.ts +52 -0
  394. package/dist/utils/warn-if-no-accessible-name.js +55 -0
  395. package/dist/utils/write-cookie.d.ts +35 -0
  396. package/dist/utils/write-cookie.js +37 -0
  397. package/package.json +32 -0
  398. package/src/reset.css +223 -0
  399. package/src/theme.css +146 -0
package/README.md ADDED
@@ -0,0 +1,812 @@
1
+ # @sdxc/ui
2
+
3
+ Styled, accessible `remix/ui` components rendered as server HTML.
4
+
5
+ Every component is a plain function taking a `Handle<Props>` and rendered through JSX, with
6
+ variants, states and colors driven by a `data-*` attribute contract and a set of `--ui-*`
7
+ semantic color variables applied through `css()` mixins.
8
+
9
+ Baseline behavior comes from the platform itself — `<dialog>`, the Popover API, Invoker
10
+ Commands, `<details>` and native form controls — so a page built from these components works
11
+ before, and without, any client JavaScript.
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm add @sdxc/ui
17
+ ```
18
+
19
+ Components render through `remix`, draw their built-in glyphs from
20
+ [`@sdxc/icons`](https://www.npmjs.com/package/@sdxc/icons), and read their theme variables
21
+ from [`@sdxc/u`](https://www.npmjs.com/package/@sdxc/u). All three install alongside this
22
+ package.
23
+
24
+ ## Usage
25
+
26
+ ### Render A Component
27
+
28
+ Every component takes a `Handle<Props>` and returns a render closure, and is used as JSX:
29
+
30
+ ```tsx
31
+ import type { Handle } from "remix/ui";
32
+
33
+ import { Badge } from "@sdxc/ui";
34
+
35
+ export function OrderStatus(handle: Handle<{ paid: boolean }>) {
36
+ return () => (
37
+ <Badge color={handle.props.paid ? "success" : "warning"}>
38
+ {handle.props.paid ? "Paid" : "Pending"}
39
+ </Badge>
40
+ );
41
+ }
42
+ ```
43
+
44
+ That is static server HTML: `color` becomes `data-color`, and a CSS attribute selector
45
+ paints the rest — no hydration, no client JavaScript.
46
+
47
+ ### Set Up The Stylesheets
48
+
49
+ Import the reset and the theme ahead of your own styles, then define the five palette
50
+ scales the theme derives every semantic variable from:
51
+
52
+ ```css
53
+ @import "@sdxc/ui/reset.css";
54
+ @import "@sdxc/ui/theme.css";
55
+
56
+ :root {
57
+ --ui-color-brand-50: oklch(0.97 0.02 250);
58
+ --ui-color-brand-500: oklch(0.6 0.18 250);
59
+ --ui-color-brand-950: oklch(0.22 0.08 250);
60
+
61
+ /* the same 50-950 shape for neutral, danger, warning and success */
62
+ }
63
+ ```
64
+
65
+ `reset.css` zeroes margins, sets `box-sizing: border-box`, and lets form controls inherit
66
+ font and color. Every selector sits inside `:where()` for zero specificity, and the file
67
+ opens with `@layer base, rmx;` so component styles always win. It leaves `<dialog>`'s
68
+ `::backdrop` and the `dialog`/`[popover]` margins alone, since overlays rely on that native
69
+ centering — an app shipping an equivalent reset can import `theme.css` on its own.
70
+
71
+ `theme.css` is the `--ui-*` semantic layer: a light `:root` block, a `.dark` class on
72
+ `<html>` for forced dark mode, a `.system` class that follows `prefers-color-scheme`, and
73
+ the `--ui-chart-1` through `--ui-chart-8` categorical sequence for multi-series charts. Two
74
+ apps supplying the same scales render the same design, because components read the derived
75
+ contract rather than any raw scale value.
76
+
77
+ ### Open A Dialog Without JavaScript
78
+
79
+ Overlays ride native platform mechanisms, so a trigger is an ordinary button:
80
+
81
+ ```tsx
82
+ import { Button, Dialog } from "@sdxc/ui";
83
+
84
+ <Button commandfor="invite-teammate" command="show-modal">
85
+ {t("team.invite")}
86
+ </Button>
87
+ <Dialog id="invite-teammate">
88
+ <Dialog.Header>
89
+ <Dialog.Title>{t("team.inviteTitle")}</Dialog.Title>
90
+ </Dialog.Header>
91
+ <Dialog.Footer>
92
+ <Dialog.Close>{t("actions.close")}</Dialog.Close>
93
+ </Dialog.Footer>
94
+ </Dialog>;
95
+ ```
96
+
97
+ The pairing is
98
+ [Invoker Commands](https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API)
99
+ against the native
100
+ [`<dialog>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dialog)
101
+ element, so the page needs no open-state bookkeeping.
102
+
103
+ ### Add Behavior With A Mixin
104
+
105
+ A widget that wants interactivity gets it from a mixin applied through `mix` inside a
106
+ hydrated island. The components themselves stay pure UI:
107
+
108
+ ```tsx
109
+ import type { Handle } from "remix/ui";
110
+
111
+ import { clientEntry } from "remix/ui";
112
+
113
+ import { Command } from "@sdxc/ui";
114
+ import { FilterModel } from "@sdxc/ui/behaviors";
115
+ import { commandFilter } from "@sdxc/ui/mixins";
116
+
117
+ type Props = { pages: Array<{ id: string; title: string }> };
118
+
119
+ export default clientEntry(
120
+ "/app/components/search-palette.tsx#default",
121
+ function SearchPalette(handle: Handle<Props>) {
122
+ let model = new FilterModel();
123
+
124
+ return () => (
125
+ <Command mix={commandFilter(model)}>
126
+ <Command.Input placeholder={t("search.placeholder")} />
127
+ <Command.List>
128
+ {handle.props.pages.map((page) => (
129
+ <Command.Item key={page.id} value={page.title}>
130
+ {page.title}
131
+ </Command.Item>
132
+ ))}
133
+ </Command.List>
134
+ <Command.Empty>{t("search.empty")}</Command.Empty>
135
+ </Command>
136
+ );
137
+ },
138
+ );
139
+ ```
140
+
141
+ Only the island that applies a mixin needs a `clientEntry`; a page that sticks to baseline
142
+ behavior ships no library JavaScript at all. Every example here writes user-facing copy as
143
+ `t(key)`, standing in for whatever localization function your app has — the library ships no
144
+ copy of its own, so each visible or accessible string is a prop you supply.
145
+
146
+ ## API
147
+
148
+ Every export carries its own JSDoc, so hover and autocomplete give the full signature. What
149
+ follows is the index.
150
+
151
+ | Import | Contains |
152
+ | --------------------- | ------------------------------------------------------------------------------------- |
153
+ | `@sdxc/ui` | Every component and its compound parts. |
154
+ | `@sdxc/ui/animations` | CSS-only motion factories plus the shared `durations`/`easings` tokens. |
155
+ | `@sdxc/ui/behaviors` | Headless, DOM-free state classes built on `TypedEventTarget`. |
156
+ | `@sdxc/ui/mixins` | Opt-in DOM behaviors applied through a component's `mix` prop. |
157
+ | `@sdxc/ui/styles` | Shared style recipes composed inside a `mix` array. |
158
+ | `@sdxc/ui/utils` | Framework-free color, scale, path, geometry and field helpers, plus the shared types. |
159
+ | `@sdxc/ui/reset.css` | The base reset. |
160
+ | `@sdxc/ui/theme.css` | The `--ui-*` semantic variable layer. |
161
+
162
+ ### The Shared Contract
163
+
164
+ One contract covers the whole catalog, which is what keeps the component index below to a
165
+ line each.
166
+
167
+ **Props become `data-*` attributes.** `color`, `variant`, `size` and their neighbours are
168
+ written onto the host element, and every style rule keys off them. Wherever a `color` prop
169
+ appears it takes one of `"brand"`, `"neutral"`, `"success"`, `"warning"` or `"danger"` — the
170
+ `SemanticColor` union — and the theme resolves the actual values.
171
+
172
+ **Compound parts hang off the root.** `Dialog.Header`, `Card.Title`, `Chart.Legend.Item`:
173
+ each is its own component with its own props, and `data-slot` marks its role in the layout.
174
+
175
+ **`mix` styles the host.** It takes a `css()` call, a style recipe, an animation factory, or
176
+ an array of them. A wrapper rendering several elements takes a `parts` prop instead, one
177
+ `mix` per named part.
178
+
179
+ **Every measurement is an overridable variable**, emitted as
180
+ `var(--ui-<component>-<property>, <default>)`, so retuning a component is one declaration.
181
+ One radius scale is shared across every rounded surface — `--ui-radius-none` (`0px`), `-sm`
182
+ (`0.25rem`), `-md` (`0.375rem`), `-lg` (`0.5rem`), `-xl` (`0.75rem`), `-full` (`9999px`) —
183
+ and well over a hundred more are scoped to a single component each, among them
184
+ `--ui-sidebar-width` (`16rem`), `--ui-sheet-size` (`24rem`), `--ui-slider-thumb-size`
185
+ (`1.25rem`), `--ui-popover-offset` (`0.5rem`) and `--ui-chart-line-width` (`2px`). Each is
186
+ named in the JSDoc of the component that reads it.
187
+
188
+ **Accessibility media features are handled centrally.** `prefers-reduced-motion: reduce`
189
+ collapses every animation factory to an opacity-only fade, `prefers-contrast: more` promotes
190
+ each color role's border to its stronger value, and `prefers-reduced-transparency: reduce`
191
+ keeps `backdrop-filter` blur additive over an already-opaque background.
192
+
193
+ ### Components: Forms
194
+
195
+ - `Form` — the wrapper a multi-field layout starts from; set `issues` from a `parseSafe`
196
+ result and each field beneath reads its own errors by name.
197
+ - `Label`, `Description`, `FieldError` — a control's caption, its supporting copy as a `<p>`
198
+ for `aria-describedby`, and its validation message with a stable id.
199
+ - `Input`, `TextArea` — a single-line native text field (the foundation the other text
200
+ controls build on) and a multi-line one that grows through `field-sizing: content`.
201
+ - `TextField`, `DateField`, `TimeField` — labeled, described, validated wrappers around a
202
+ text, date, or time input.
203
+ - `NumberField`, `OtpField` — a number input framed with decrement and increment buttons,
204
+ and a one-time-code field with a numeric keyboard and the platform's autofill hint.
205
+ - `Checkbox`, `CheckboxGroup`, `RadioGroup`, `Switch`, `ToggleButton` — native checked-state
206
+ controls: a styled checkbox, the landmark grouping a run of them, mutually exclusive
207
+ radios sharing one name, an on/off pill, and a button carrying `aria-pressed`.
208
+ - `Slider`, `Meter`, `ProgressBar` — a range input with a fill track and an `<output>`, and
209
+ styled native `<meter>` and `<progress>`; an unset `value` on the last drops into the
210
+ indeterminate state.
211
+ - `Select`, `ComboBox`, `SearchField` — a native `<select>` upgraded to customizable-select
212
+ rendering wherever the browser resolves `appearance: base-select`, a text control paired
213
+ with a `<datalist>`, and a `<search>` landmark around a `type="search"` control.
214
+ - `FileTrigger`, `DropZone` — a pressable surface opening the file picker, and a dashed drop
215
+ target, both backed by a native file input.
216
+
217
+ ### Components: Overlays And Menus
218
+
219
+ Each surface rides one of three native mechanisms: `<dialog>` with Invoker Commands, the
220
+ [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API) with CSS anchor
221
+ positioning, or a custom `--ui-*` command answered by a mixin.
222
+
223
+ - `Dialog` — a modal built on native `<dialog>`, opened and closed through
224
+ `commandfor`/`command`.
225
+ - `AlertDialog` — an interruptive modal sealed against light dismiss
226
+ (`closedby="closerequest"`).
227
+ - `Modal`, `Drawer`, `Sheet` — `Dialog` presets: pop-in motion, an edge-docked panel, and a
228
+ fixed inline-side column.
229
+ - `Confirm` — a two-control confirmation prompt in one call; pass `form` and the confirming
230
+ control submits a real form.
231
+ - `Popover`, `Tooltip`, `HoverCard` — a surface anchored to whatever invoker opened it, a
232
+ small label revealed by `:hover`/`:focus-visible` on the preceding sibling, and a detail
233
+ panel revealed by `:hover`/`:focus-within` on a shared root.
234
+ - `Menu`, `Menubar`, `ContextMenu` — a popover-based menu surface, a horizontal row of
235
+ triggers each opening one, and a menu meant to open at a right-click's pointer position.
236
+ - `NavigationMenu` — a row of navigation triggers, each a link or a button opening a panel
237
+ of related links.
238
+ - `Command` — a bordered panel listing selectable rows for searching among a set of actions.
239
+ - `OverlayArrow` — a pointer glyph anchoring a floating surface back to its trigger.
240
+
241
+ ### Components: Navigation And Data
242
+
243
+ - `Button` — a single immediate action; `isPending` swaps content for a spinner while
244
+ keeping the footprint.
245
+ - `Link`, `NavLink`, `LinkButton` — an inline anchor kept underlined, a navigation link
246
+ colored by a semantic role, and a link styled as a button.
247
+ - `Tabs` — tabs whose active view comes from routing: whichever `.Tab` points at the current
248
+ page carries `aria-selected="true"`.
249
+ - `Breadcrumbs`, `Pagination` — a trail of parent sections, and a landmark for moving
250
+ between pages of results.
251
+ - `Sidebar` — an application shell's navigation rail; collapse rides one checkbox's native
252
+ `:checked` state.
253
+ - `Disclosure`, `Accordion` — a single expand/collapse section built on `<details>`, and a
254
+ divider-separated stack of them.
255
+ - `Table` — tabular data whose column headers become sort links and whose trailing row
256
+ becomes a load-more link, both from URLs you compute.
257
+ - `GridList`, `Tree`, `ListBox` — an interactive row list, a hierarchical list of nested
258
+ `<details>`, and a run of selectable rows built from visually-hidden inputs.
259
+ - `SelectionIndicator`, `DropIndicator` — a marker reserving its own layout slot for the
260
+ current selection, and a bar marking a drop position.
261
+
262
+ ### Components: Feedback
263
+
264
+ - `Alert`, `Toast` — an inline status panel with `role="alert"` and a configurable
265
+ politeness, and a transient notification whose `.Region` stacks the queue.
266
+ - `Badge`, `TagGroup` — a compact status pill, and a labeled set of pills each optionally
267
+ paired with a remove control.
268
+ - `Skeleton`, `Spinner`, `Empty` — a loading placeholder block, a busy indicator inside a
269
+ `role="progressbar"` host, and a dashed placeholder for a section with nothing to show.
270
+
271
+ ### Components: Color
272
+
273
+ - `ColorSwatch` — a preview box for one CSS color, backed by a checkerboard so translucent
274
+ values read correctly.
275
+ - `ColorArea`, `ColorWheel`, `ColorSlider` — a 2D saturation/brightness picker from two
276
+ overlaid range inputs, a circular hue picker from one, and a single-channel (`hue`,
277
+ `saturation`, `lightness`, `alpha`) control.
278
+ - `ColorSwatchPicker` — mutually exclusive preset colors built from native radios.
279
+ - `ColorField`, `ColorPicker` — a labeled, described, validated color text field with a live
280
+ swatch, and that field extended with a trigger and a popover-hosted picking surface.
281
+
282
+ ### Components: Charts And Conversation
283
+
284
+ - `Chart` — the coordinate space every Cartesian series renders into, with `.Line`, `.Area`,
285
+ `.Pie`, `.Bar`, `.Legend` and `.Tooltip` parts.
286
+ - `Message`, `MessageScroller` — a conversational turn laid out with grid areas keyed off
287
+ each part's `data-slot`, and a scrollable log frame whose content is a `role="log"`.
288
+ - `Bubble`, `Marker`, `Attachment` — the framed surface inside a turn's content slot, an
289
+ inline row calling out a small event between turns, and a card for one attached file.
290
+
291
+ ### Components: Layout And Content
292
+
293
+ - `Card` — a bordered, tinted panel grouping a header, content, and footer actions.
294
+ - `ImagePlaceholder` — a fixed-size image-with-fallback box; `Avatar` and `Logo` are its
295
+ circular and rounded-square presets.
296
+ - `AspectRatio`, `Resizable`, `ScrollArea`, `Carousel` — a ratio lock, a split-pane layout
297
+ of panels and handles, a bordered scrollable region, and a slide collection riding CSS
298
+ scroll snap.
299
+ - `Group`, `Section`, `Separator`, `Toolbar` — a cluster of related controls, a grouping
300
+ inside a listbox or menu, a divider, and a strip of controls along one axis.
301
+ - `Item` — a single-line row with leading media, title and description, and trailing
302
+ actions.
303
+ - `Text`, `Header`, `Keyboard`, `Typeset` — muted body copy, an uppercase section label in a
304
+ `<header>`, a shortcut hint in a `<kbd>`, and a typography layer for already-rendered
305
+ markup with `docs`, `chat` and `reading` presets.
306
+ - `HeadingScope`, `Heading` — an ambient heading-depth scope and the heading that reads it.
307
+ - `SharedElement` — a host carrying a stable view-transition identity across page loads.
308
+ - `Calendar`, `RangeCalendar`, `DatePicker`, `DateRangePicker` — a month grid for one day or
309
+ a connected range, and either extended with a trigger and a popover-hosted calendar.
310
+ Rendered with no children, `Calendar` falls back to a native `<input type="date">`.
311
+
312
+ ### Mixins
313
+
314
+ A mixin is a `createMixin` adapter attached through `mix`. Each module opens with a doc
315
+ comment naming what the platform cannot express on its own and what still works when the
316
+ script never runs, so the cost of every behavior stays visible before you apply it.
317
+
318
+ | Mixin | Host | What it adds |
319
+ | ------------------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------- |
320
+ | `ariaChecked()` | a native checked control | Keeps `aria-checked` following live checkedness, including across a radio group. |
321
+ | `attachmentTrigger()` | `Attachment.Trigger` | Makes the whole card one activation target while nested buttons keep their own clicks. |
322
+ | `calendarKeys(model)` | `Calendar.Grid` | Arrow/Page/Home/End navigation over a `CalendarModel`, mirrored as roving `tabindex`. |
323
+ | `carouselControls()` | `Carousel.Viewport` | Answers `--ui-prev`/`--ui-next`/`--ui-goto` commands as `scrollBy()` calls. |
324
+ | `channelSync()` | a `ColorSlider` group | Keeps sibling channel gradients current with each other's live values. |
325
+ | `chartTooltip()` | a `Chart` root | Tracks the nearest plotted point to the pointer or focus and fills the sibling `Chart.Tooltip`. |
326
+ | `clearField()` | a `SearchField` clear | Empties its own `commandfor` input and reveals itself on mount. |
327
+ | `colorAreaDrag()` | `ColorArea` | Drags the root as one 2D gesture across its paired axis inputs. |
328
+ | `colorPreview()` | `ColorField` | Updates the paired `ColorSwatch` as a typed value parses. |
329
+ | `colorWheelDrag()` | `ColorWheel` | Reshapes the hue input into a ring and drags it as an angular gesture. |
330
+ | `comboboxFilter()` | `ComboBox.Input` | As-you-type narrowing through `remix/ui/combobox`. |
331
+ | `commandFilter(model)` | `Command` | Filtering against a `FilterModel`, mirrored onto items as `hidden`. |
332
+ | `commandKeys(model)` | `Command` | Arrow keys move the active match; Enter activates its nested link or button. |
333
+ | `contextMenu(id)` | `ContextMenu.Trigger` | Opens the named popover at the pointer on right-click or the Context Menu key. |
334
+ | `copyToClipboard()` | a footer button | Copies the text content of its `commandfor` target. |
335
+ | `dismiss(options?)` | an alert or toast host | An auto-dismiss countdown, pausable on hover, plus a `--ui-dismiss` command. |
336
+ | `dragReorder(session)` | `GridList` / `Tree` | Pointer reorder against a `DragSession`, computing before/after/on drop position. |
337
+ | `dropZone(session)` | `DropZone` | File drag-and-drop acceptance backed by a `DragSession`. |
338
+ | `dualRange()` | a two-thumb `Slider` | Keeps paired range inputs ordered, clamping the moved thumb at its partner. |
339
+ | `gridListKeys(model)` | `GridList` | The ARIA grid keyboard pattern against a `SelectionModel`. |
340
+ | `headingLevelFallback(options)` | an island's heading root | Recovers the ambient heading depth from `data-heading-level` at a hydration boundary. |
341
+ | `hotkey(combo)` | any `<dialog>`/`[popover]` | A document-level shortcut opening or closing its host regardless of focus. |
342
+ | `imageFallback()` | `Avatar` / `Logo` images | Flags a failed image load, including retroactively for cached images. |
343
+ | `listboxKeys()` | `ListBox` | Arrow/Home/End/typeahead through `remix/ui/listbox`. |
344
+ | `longPress(options?)` | any element | Fires once a pointer holds still past a duration and movement tolerance. |
345
+ | `menuKeys(options?)` | `Menu` | The WAI-ARIA menu pattern: roving tabindex, arrows, Home/End, typeahead. |
346
+ | `menubarKeys(options?)` | `Menubar` | The WAI-ARIA menubar pattern, handing off into whichever `Menu` opens. |
347
+ | `messageFollow(model)` | `MessageScroller.Viewport` | Bridges the viewport to a `ScrollFollowModel`: measurement, scroll intents, pinned state. |
348
+ | `otpSlots()` | an `OtpField` group | Moves focus across slots and splits a pasted code. |
349
+ | `persist(key)` | a `Sidebar` root | Mirrors the collapsed checkbox into a cookie and answers a `--ui-toggle` command. |
350
+ | `pressToggle()` | `ToggleButton` | Flips `aria-pressed` on each click. |
351
+ | `rangePreview(model)` | `RangeCalendar.Grid` | Hover and focus range preview against a `CalendarModel`'s pending anchor. |
352
+ | `resizeHandle(axis, session)` | `Resizable.Handle` | Pointer resize against a `ResizeSession`, mirrored as a custom property. |
353
+ | `stepper(options?)` | `NumberField.Group` | Press-and-hold repeat for the increment and decrement buttons. |
354
+ | `tabKeys(options?)` | `Tabs.List` | Delegated arrow/Home/End activation through the shared `remix/ui/tabs` context. |
355
+ | `themeToggle(options?)` | any host | Switches `<html>` between light, dark and system through commands, persisted to a cookie. |
356
+ | `treeKeys(model)` | `Tree` | The WAI-ARIA tree pattern against a `SelectionModel`, typeahead included. |
357
+ | `validate(schema)` | a native form control | Applies a `remix/data-schema` schema through `setCustomValidity()`, mirrored into a `FieldError`. |
358
+ | `viewTransition()` | a `SharedElement` island | Bridges a same-document reload to the View Transition API. |
359
+ | `trackHostNode(handle)` | inside a mixin | Caches a mixin's live host node across insert and remove, for the mixins above that read the DOM outside render. |
360
+
361
+ ### Behavior Classes
362
+
363
+ Headless, DOM-free state models. Each is unit-testable on its own, and an island subscribes
364
+ to it and re-renders.
365
+
366
+ - `Announcer` — a priority-ordered queue of `aria-live` announcements.
367
+ - `CalendarModel` — the keyboard-focused day, the visible month, and an in-progress range.
368
+ - `DragSession` — the dragged item, the drop candidate under the pointer, and the computed
369
+ drop position.
370
+ - `FilterModel` — query, matched subset, and active match for search-as-you-type.
371
+ - `ResizeSession` — resize constraint solving across a panel group, cascading once a
372
+ neighbor bottoms out.
373
+ - `ScrollFollowModel` — auto-follow pinning, anchor turn, visible messages, and pending
374
+ scroll intents.
375
+ - `SelectionModel` — a selected-key set with toggle, contiguous-range, and select-all
376
+ semantics.
377
+ - `Toaster` — a toast queue owning each toast's auto-dismiss timer and pause/resume.
378
+
379
+ ### Animations
380
+
381
+ CSS-only `css()` factories keyed off native open states, all sharing `easings` (`standard`,
382
+ `decelerate`, `accelerate`, `linear`) and `durations` (`fast` 150ms, `normal` 200ms, `slow`
383
+ 300ms, `slower` 400ms).
384
+
385
+ - `enterExit(options?)` — the composer: exit declarations on the host, entered state under
386
+ `[open]`/`:popover-open` or a selector you name, a `@starting-style` block, and a
387
+ reduced-motion override.
388
+ - `fade(options?)`, `zoom(options?)`, `slide(options)` — sugar over `enterExit` for a plain
389
+ fade, a fade with a scale, and a fade with a directional offset.
390
+ - `spin(options?)`, `pulse(options?)` — continuous rotation for a busy glyph, and a gentle
391
+ opacity breathe for a placeholder.
392
+ - `shimmer(options?)`, `textShimmer(options?)` — a sweeping highlight across a progress
393
+ fill, and the same sweep through text via `background-clip: text`.
394
+ - `scrollShadow(options?)`, `scrollProgress(options?)`, `scrollFade(options?)` — a sticky
395
+ header's shadow, a fill that grows with scroll distance, and faded scroll-container edges,
396
+ all on `animation-timeline: scroll()`.
397
+ - `viewReveal(options?)` — an entry motion played as an element scrolls into view, on a
398
+ `view()` timeline.
399
+
400
+ ### Style Mixins
401
+
402
+ Recipes composed directly in a `mix` array.
403
+
404
+ - `floatingSurface()`, `panelChrome()`, `semanticColorPanel()` — the border, rounding, tint
405
+ and elevation a floating surface carries; the border and rounding a framed panel applies;
406
+ and the `&[data-color="…"]` branches a tinted panel keys its colors on.
407
+ - `interactiveTransition()` — the shared transition property, timing and duration for a
408
+ control's hover, focus, press and validity changes.
409
+ - `fieldStackLayout()`, `outputCaptionText()` — the single-column stacking every field
410
+ wrapper's host uses, and the muted caption typography every `<output>` shares.
411
+ - `graphicHostStyle()` — the flex-item layout and `currentColor` declarations a leading icon
412
+ or loading graphic shares, so the two swap without shifting layout.
413
+ - `rangeThumbAppearance(sizeVar, borderWidthVar)` — the circular range thumb: appearance
414
+ reset, fill and border, elevation, pressed scale, focus ring, disabled dimming.
415
+ - `rtlAwareGradientDirection(propertyName)` — a custom-property pairing behind a gradient
416
+ direction, flipped under `&:dir(rtl)`.
417
+ - `chartPalette(property, combinator?)`, `legendToggle()` — paints one property from
418
+ whichever of the `CHART_COLOR_SLOT_COUNT` `--ui-chart-*` slots an element's `data-color`
419
+ names, and the position-keyed rules pairing a chart root with a later-sibling legend.
420
+
421
+ ### Utilities
422
+
423
+ Plain TypeScript with no rendering dependency, importable on its own.
424
+
425
+ - **Color** — `parseColor`, `formatHex`/`formatRgb`/`formatHsl`, `rgbToHsl`/`hslToRgb`,
426
+ `rgbToHsv`/`hsvToRgb`, `clampChannel`, `roundChannel`, and the `HSLColor`, `HSVColor`,
427
+ `RGBColor`, `RGBAColor` interfaces.
428
+ - **Charts** — `linearScale`, `bandScale`, `ticks`, `linePath`, `areaPath`, `arcPath`,
429
+ `pieAngles`, `computeMarkerIndices`, `HUE_GRADIENT_STOPS`.
430
+ - **Geometry** — `normalizedPointerPosition`, `angleFromCenter`, `angleToHue`/`hueToAngle`,
431
+ `resolveFillPercent`, `FULL_TURN_RADIANS`, and the `Point`/`Rect` interfaces.
432
+ - **Fields** — `resolveFieldWiring` and `findPairedRangeInputs`, plus the `FieldWiring`,
433
+ `FieldWiringOptions` and `FieldPartsProps` shapes behind every wrapper's `parts` prop.
434
+ - **DOM** — `asCommandEvent`, `dispatchChange`, `isNewPrimaryPress`, `isPrintableKey`,
435
+ `focusItem`, `queryItems`, `setRovingTabindex`, `labelFor`, `hasAccessibleText`,
436
+ `mergeStyle`, `prefersReducedMotion`, `writeCookie`, `DISABLED_SELECTOR`.
437
+ - **Types** — `SemanticColor` (the five-tone union every `color` prop resolves to),
438
+ `AnchorPlacement`, `AriaInvalid`, `CSSStyles`, `StyleProp`, `FieldColor`.
439
+
440
+ ## Pattern: A Behavior Class Behind A Hydrated Widget
441
+
442
+ State with real shape — a toast queue, a selection set — lives in a behavior class, not in
443
+ the component and not in the mixin. The island owns the instance and re-renders on its
444
+ events:
445
+
446
+ ```tsx
447
+ import type { Handle } from "remix/ui";
448
+
449
+ import { clientEntry } from "remix/ui";
450
+
451
+ import { Toast } from "@sdxc/ui";
452
+ import { Toaster } from "@sdxc/ui/behaviors";
453
+
454
+ export const AppToaster = clientEntry(
455
+ "/app/components/app-toaster.tsx#AppToaster",
456
+ function AppToaster(handle: Handle) {
457
+ let toaster = new Toaster<{ title: string; color?: Toast.Color }>();
458
+
459
+ toaster.addEventListener("change", () => handle.update(), { signal: handle.signal });
460
+ handle.context.set({ toaster });
461
+
462
+ return () => (
463
+ <Toast.Region aria-label={t("toasts.region")}>
464
+ {toaster.toasts.map((toast) => (
465
+ <Toast key={toast.id} color={toast.data.color}>
466
+ <Toast.Content>
467
+ <Toast.Title>{toast.data.title}</Toast.Title>
468
+ </Toast.Content>
469
+ </Toast>
470
+ ))}
471
+ </Toast.Region>
472
+ );
473
+ },
474
+ );
475
+ ```
476
+
477
+ Any descendant reaches the queue through context:
478
+ `handle.context.get(AppToaster).toaster.add({ title: t("toasts.saved") })`.
479
+
480
+ ## Pattern: The Custom Command Trigger Contract
481
+
482
+ [Invoker Commands](https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API)
483
+ go beyond the built-in `show-modal`, `close` and `toggle-popover` values: any `command`
484
+ prefixed with `--` dispatches a `CommandEvent` on its `commandfor` target with no built-in
485
+ behavior. That is the trigger contract between static server buttons and hydrated widgets.
486
+
487
+ A widget-root mixin listens for `command` on its host and switches on `event.command`.
488
+ Library commands carry the `--ui-` prefix (`--ui-next`, `--ui-dismiss`, `--ui-toggle`), and
489
+ unknown commands pass through, so an app's own `--` commands can target the same elements.
490
+ Trigger buttons stay static markup anywhere on the page, including outside the island that
491
+ owns the widget. Parameters ride the invoker — `event.source` is the triggering button, so
492
+ this carries its payload in `event.source.dataset`:
493
+
494
+ ```tsx
495
+ <button commandfor="cart-carousel" command="--ui-goto" data-slide="3">
496
+ {t("carousel.goto", { slide: 3 })}
497
+ </button>
498
+ ```
499
+
500
+ `Button` renders `type="button"` on its own whenever it carries `command` or `commandfor`,
501
+ as do `Dialog.Close`, `AlertDialog.Cancel` and the other invoker parts. A button inside a
502
+ `<form>` otherwise defaults to `"submit"`, and the platform then treats the pairing as
503
+ ambiguous and runs nothing. A hand-rolled `<button commandfor=…>` inside a form spells
504
+ `type="button"` out, written ahead of `command`/`commandfor`, since the platform judges the
505
+ pairing as it parses those attributes.
506
+
507
+ ## Pattern: The Ambient Heading Scope
508
+
509
+ `HeadingScope` publishes a heading depth through `handle.context`, one level deeper than the
510
+ `HeadingScope` it is nested inside, or `1` where nothing wraps it. `Heading` — and every
511
+ title slot, such as `Dialog.Title`, `Alert.Title` and `Empty.Title` — reads that depth:
512
+
513
+ ```tsx
514
+ <HeadingScope>
515
+ <Heading>{t("doc.title")}</Heading> {/* <h1>, no ancestor scope */}
516
+ <HeadingScope>
517
+ <Heading>{t("doc.section")}</Heading> {/* <h2>, one level deeper */}
518
+ </HeadingScope>
519
+ </HeadingScope>
520
+ ```
521
+
522
+ An independently hydrated island has no ancestor context to read, even where the
523
+ server-rendered page nests it under a real scope. Threading the level down as an explicit
524
+ `level` prop is the first choice. Where that is impractical, apply
525
+ `headingLevelFallback({ onLevel })` to the island's own `HeadingScope`: it reads the
526
+ `data-heading-level` attribute `HeadingScope` and `Heading` already stamp on the DOM, hands
527
+ the detected `HeadingLevel` to the callback once on attach, and the island stores it and
528
+ re-renders with `level` set.
529
+
530
+ ## Pattern: Composing Recipes In One `mix` Array
531
+
532
+ A style recipe, an animation factory, and a local `css()` call compose as disjoint siblings
533
+ in one array:
534
+
535
+ ```tsx
536
+ import { css } from "remix/ui";
537
+
538
+ import { zoom } from "@sdxc/ui/animations";
539
+ import { floatingSurface, interactiveTransition } from "@sdxc/ui/styles";
540
+
541
+ <div
542
+ id="account-menu"
543
+ popover="auto"
544
+ mix={[
545
+ floatingSurface(),
546
+ interactiveTransition(),
547
+ zoom({ scale: 0.95, duration: 150 }),
548
+ css({ margin: "0", inset: "auto", paddingBlock: "0.5rem" }),
549
+ ]}
550
+ >
551
+ {menuItems}
552
+ </div>;
553
+ ```
554
+
555
+ `floatingSurface()` supplies the chrome, `interactiveTransition()` the shared transition
556
+ triplet for descendants, and `zoom()` the open and close motion off the popover's own
557
+ `:popover-open` state.
558
+
559
+ Each entry compiles to one hashed class in its own cascade sublayer, and a class's layer
560
+ position is fixed the first time that exact declaration set appears on the page — so `mix`
561
+ is where declarations the component does not already set belong. To settle a declaration the
562
+ component already makes, four routes win outright: the `style` prop, an inline override of
563
+ the component's own token (`style={{ "--ui-text-2xl": "0.875rem" }}`), a `raw()` declaration
564
+ marked `!important`, or a rule in an app cascade layer declared after `rmx`.
565
+
566
+ ## Pattern: Styling One Part Of A Wrapper
567
+
568
+ A wrapper rendering more than one host element takes a `parts` prop, one `mix` per named
569
+ part. `TextField`'s four — `label`, `input`, `description`, `error` — are the base shape
570
+ every field wrapper extends:
571
+
572
+ ```tsx
573
+ import { css } from "remix/ui";
574
+
575
+ import { TextField } from "@sdxc/ui";
576
+
577
+ <TextField
578
+ label={t("form.username.label")}
579
+ name="username"
580
+ parts={{ input: css({ fontFamily: "var(--ui-font-mono)" }) }}
581
+ />;
582
+ ```
583
+
584
+ `ColorField` adds `control` (the row wrapping input and swatch) and `swatch` to that base.
585
+ `Confirm` exposes parts matching each of its composed pieces — `header`, `title`,
586
+ `description`, `footer`, `cancel`, `action`, and `form` in submit mode. Where `parts` runs
587
+ out, composing the underlying components directly — `Label` plus `Input` plus `Description`
588
+ plus `FieldError`, or `AlertDialog` and its own parts — covers the rest.
589
+
590
+ ## Pattern: A Confirmed Destructive Action
591
+
592
+ Given a `form` prop, `Confirm` wraps its content in a real `<form>` and the confirming
593
+ control becomes that form's submit button, so a destructive action runs as an ordinary form
594
+ post with no client JavaScript. `fields` renders the hidden inputs the submission needs:
595
+
596
+ ```tsx
597
+ import { Button, Confirm } from "@sdxc/ui";
598
+
599
+ <Button commandfor="revoke-session" command="show-modal" color="danger">
600
+ {t("session.revoke")}
601
+ </Button>
602
+ <Confirm
603
+ id="revoke-session"
604
+ title={t("session.revokeTitle")}
605
+ confirmLabel={t("actions.revoke")}
606
+ cancelLabel={t("actions.cancel")}
607
+ form={{
608
+ action: revokeUrl,
609
+ fields: <input type="hidden" name="intent" value="revoke" />,
610
+ }}
611
+ />;
612
+ ```
613
+
614
+ Without `form`, the confirming control closes the panel and the page decides what a
615
+ confirmed decision means. The cancel control stays a close-command button in both modes, so
616
+ cancelling never submits. Submit mode renders a `<form>`, so the panel belongs outside any
617
+ other form's markup, per the platform's own nesting rule. For a shape this does not cover,
618
+ compose `AlertDialog` directly and give `AlertDialog.Action` a `type="submit"`: it then
619
+ submits the enclosing form instead of running a command.
620
+
621
+ ## Pattern: A Validated Form
622
+
623
+ `Form` takes a parsed validation result and hands each field its own errors by name through
624
+ context. The canonical shape is an action that parses the submission and re-renders the same
625
+ page with `issues` set:
626
+
627
+ ```tsx
628
+ import type { Handle } from "remix/ui";
629
+
630
+ import * as s from "remix/data-schema";
631
+ import { parseSafe } from "remix/data-schema";
632
+ import * as checks from "remix/data-schema/checks";
633
+ import * as f from "remix/data-schema/form-data";
634
+
635
+ import { Button, Form, TextField } from "@sdxc/ui";
636
+
637
+ let ContactSchema = f.object({
638
+ email: f.field(s.string().pipe(checks.minLength(1), checks.email())),
639
+ });
640
+
641
+ function ContactPage(handle: Handle<{ issues?: ReadonlyArray<Form.Issue> }>) {
642
+ return () => (
643
+ <Form method="post" issues={handle.props.issues}>
644
+ <TextField label={t("contact.email.label")} name="email" type="email" required />
645
+ <Button type="submit">{t("contact.submit")}</Button>
646
+ </Form>
647
+ );
648
+ }
649
+
650
+ // In the handler for the POST:
651
+ let result = parseSafe(ContactSchema, formData);
652
+ if (!result.success) return render(<ContactPage issues={result.issues} />, { status: 400 });
653
+ ```
654
+
655
+ The native constraint attributes (`required`, `type="email"`) block submission with no
656
+ JavaScript at all, and a failed parse re-renders the same page with its issues carried
657
+ through a plain prop.
658
+
659
+ `issues` is the only thing the page passes: `TextField`, `DateField`, `TimeField` and
660
+ `ColorField` each look their own message up by `name` through form context. A field found in
661
+ `issues` renders its `FieldError`, marks `aria-invalid`, wires `aria-describedby` at the
662
+ message, and — for the first invalid field of the render — picks up `autofocus`. An explicit
663
+ `errorMessage` or `autoFocus` decides that field instead, for a message the schema does not
664
+ produce.
665
+
666
+ ## Pattern: A Chart With A Legend
667
+
668
+ `Chart.Legend` renders as a later sibling of the chart root, and each `Chart.Legend.Item`
669
+ appears in the same order as its matching series: the toggle wiring keys off sibling
670
+ position rather than a series id.
671
+
672
+ ```tsx
673
+ import { css } from "remix/ui";
674
+
675
+ import { Chart } from "@sdxc/ui";
676
+
677
+ <>
678
+ <Chart
679
+ width={480}
680
+ height={240}
681
+ xDomain={[0, 11]}
682
+ yDomain={[0, 5000]}
683
+ aria-label={t("chart.label")}
684
+ >
685
+ <Chart.Line color={1} points={revenuePoints} />
686
+ <Chart.Line color={3} points={refundPoints} parts={{ path: css({ strokeDasharray: "4 4" }) }} />
687
+ </Chart>
688
+ <Chart.Legend aria-label={t("chart.legend")}>
689
+ <Chart.Legend.Item color={1}>{t("chart.series.revenue")}</Chart.Legend.Item>
690
+ <Chart.Legend.Item color={3}>{t("chart.series.refunds")}</Chart.Legend.Item>
691
+ </Chart.Legend>
692
+ </>;
693
+ ```
694
+
695
+ Each point carries `x`, `y` and a `label` that becomes its native `<title>`, and every wedge,
696
+ bar and marker stays keyboard-reachable on its own — this chart needs no `clientEntry` at
697
+ all. `chartTooltip()` is the separate, opt-in mixin for a floating tooltip synced to the
698
+ nearest point under the pointer or focus.
699
+
700
+ ## Pattern: A Message Thread
701
+
702
+ `MessageScroller`, `Message`, `Bubble` and `Marker` compose into a conversational thread, and
703
+ `messageFollow()` bridges the viewport to a `ScrollFollowModel` so the log follows new turns
704
+ until a person scrolls away from the live edge:
705
+
706
+ ```tsx
707
+ import { css } from "remix/ui";
708
+
709
+ import { Bubble, Message, MessageScroller } from "@sdxc/ui";
710
+ import { ScrollFollowModel } from "@sdxc/ui/behaviors";
711
+ import { messageFollow } from "@sdxc/ui/mixins";
712
+
713
+ let model = new ScrollFollowModel({ pinned: true });
714
+
715
+ <MessageScroller mix={css({ blockSize: "32rem" })}>
716
+ <MessageScroller.Viewport mix={messageFollow(model)}>
717
+ <MessageScroller.Content>
718
+ {turns.map((turn, index) => (
719
+ <MessageScroller.Item key={turn.id} messageId={turn.id} scrollAnchor={index === 0}>
720
+ <Message>
721
+ <Message.Content>
722
+ <Bubble align={turn.isSelf ? "end" : "start"} variant="muted">
723
+ <Bubble.Content>{turn.text}</Bubble.Content>
724
+ </Bubble>
725
+ </Message.Content>
726
+ </Message>
727
+ </MessageScroller.Item>
728
+ ))}
729
+ </MessageScroller.Content>
730
+ </MessageScroller.Viewport>
731
+ <MessageScroller.Button aria-label={t("chat.jumpToLatest")}>
732
+ {t("chat.jumpToLatest")}
733
+ </MessageScroller.Button>
734
+ </MessageScroller>;
735
+ ```
736
+
737
+ `MessageScroller.Item`'s `messageId` is required and unique per turn.
738
+ `MessageScroller.Button` starts `hidden` and is revealed by the
739
+ `messageFollow()`/`ScrollFollowModel` pairing.
740
+
741
+ ## Pattern: A ColorPicker Composition
742
+
743
+ `ColorPicker.Dialog` hosts whichever picking surfaces a page wants. Each part operates on its
744
+ own through its native range or text input, and sharing one live color across the composition
745
+ is the island's job — it listens for each part's change event and re-renders the others:
746
+
747
+ ```tsx
748
+ import { ColorArea, ColorField, ColorPicker, ColorWheel } from "@sdxc/ui";
749
+ import { colorAreaDrag, colorPreview, colorWheelDrag } from "@sdxc/ui/mixins";
750
+
751
+ <ColorPicker.Dialog id="brandColor-panel">
752
+ <ColorArea
753
+ aria-label={t("colorPicker.area")}
754
+ hue={hue}
755
+ defaultSaturation={saturation}
756
+ defaultValue={brightness}
757
+ mix={colorAreaDrag()}
758
+ >
759
+ <ColorArea.SaturationThumb data-color-area-axis="x" aria-label={t("colorPicker.saturation")} />
760
+ <ColorArea.ValueThumb data-color-area-axis="y" aria-label={t("colorPicker.brightness")} />
761
+ </ColorArea>
762
+
763
+ <ColorWheel aria-label={t("colorPicker.hue")} defaultValue={hue} mix={colorWheelDrag()} />
764
+ <ColorField label={t("colorPicker.hex")} format="hex" mix={colorPreview()} />
765
+ </ColorPicker.Dialog>;
766
+ ```
767
+
768
+ `ColorSlider` and `ColorSwatchPicker` drop into the same panel for a per-channel track and a
769
+ preset row. `ColorArea.SaturationThumb` and `.ValueThumb` carry an explicit
770
+ `data-color-area-axis` so `colorAreaDrag()` can pair them. Server-rendered alone, each part
771
+ still works through keyboard and native range operation; the island is what keeps the
772
+ siblings in sync.
773
+
774
+ ## Pattern: Development-Mode Contract Warnings
775
+
776
+ Where the type system cannot enforce a required accessibility wiring, a component logs a
777
+ `console.warn` gated behind `import.meta.env.DEV`, stripped entirely from production
778
+ bundles — an icon-only `Button` or `Menu.Item` with no visible text and no `aria-label`, a
779
+ `Command.Item` rendered without the `value` a filter matches against, a `Menubar`,
780
+ `Toast.Region` or `Table` rendered without the `aria-label`/`aria-labelledby` identifying the
781
+ landmark, a `Dialog` rendered without the `id` a trigger's `commandfor` targets. These are a
782
+ development-time nudge rather than runtime validation, so rendering continues either way.
783
+
784
+ ## Versioning
785
+
786
+ Releases are dated rather than semantic. A version is the UTC date it was published,
787
+ written `YYYY.M.D`, so `2026.9.4` is the release from 4 September 2026. At most one
788
+ release goes out per day.
789
+
790
+ Those numbers say when, not what: a later date means a later release and carries no
791
+ compatibility promise. Any release may change or remove an export.
792
+
793
+ Depend on one exact date, and move it when you are ready to take the change:
794
+
795
+ ```json
796
+ {
797
+ "dependencies": {
798
+ "@sdxc/ui": "2026.9.4"
799
+ }
800
+ }
801
+ ```
802
+
803
+ A caret or tilde range reads the date as major, minor and patch, so it accepts every
804
+ later release in the same year. An exact version keeps the upgrade yours to schedule.
805
+
806
+ ## License
807
+
808
+ MIT
809
+
810
+ ## Author
811
+
812
+ [Sergio Xalambrí](https://sergiodxa.com)