@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
@@ -0,0 +1,73 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "remix/ui/jsx-runtime";
2
+ import { spacer, hstack } from "@sdxc/u/layout";
3
+ import { minIs } from "@sdxc/u/size";
4
+ import { fieldStackLayout } from "../styles/field-stack-layout.js";
5
+ import { resolveFieldWiring } from "../utils/resolve-field-wiring.js";
6
+ import { ColorSwatch } from "./color-swatch.js";
7
+ import { Description } from "./description.js";
8
+ import { FieldError } from "./field-error.js";
9
+ import { resolveFieldIssue } from "./form.js";
10
+ import { Input } from "./input.js";
11
+ import { Label } from "./label.js";
12
+ /** Notation {@link ColorField} falls back to when `format` is omitted. */
13
+ const DEFAULT_FORMAT = "hex";
14
+ /**
15
+ * Preview value {@link ColorField} falls back to when neither `value` nor
16
+ * `defaultValue` is set, painting the preview's checkerboard fully so an
17
+ * empty field reads as empty.
18
+ */
19
+ const DEFAULT_SWATCH_VALUE = "transparent";
20
+ /**
21
+ * Native `pattern` constraint for each supported notation, keyed off
22
+ * {@link ColorField.Format}. Every pattern accepts the notation's short and
23
+ * long forms, its optional alpha channel, and either component separator.
24
+ */
25
+ const FORMAT_PATTERNS = {
26
+ hex: "#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})",
27
+ rgb: "rgba?\\(\\s*\\d{1,3}%?\\s*,?\\s*\\d{1,3}%?\\s*,?\\s*\\d{1,3}%?\\s*([,/]\\s*[0-9.]+%?\\s*)?\\)",
28
+ hsl: "hsla?\\(\\s*-?\\d{1,3}(\\.\\d+)?(deg)?\\s*,?\\s*\\d{1,3}(\\.\\d+)?%\\s*,?\\s*\\d{1,3}(\\.\\d+)?%\\s*([,/]\\s*[0-9.]+%?\\s*)?\\)",
29
+ };
30
+ /**
31
+ * Composes {@link Label}, an {@link Input} constrained by `format`'s native
32
+ * `pattern`, a live {@link ColorSwatch} preview of the resolved value, and
33
+ * any {@link Description} or {@link FieldError}, wired to this instance's own id.
34
+ *
35
+ * @param handle Runtime handle carrying the root element's props and this instance's stable identifier.
36
+ * @returns The render function producing the field's markup.
37
+ * @example
38
+ * <ColorField label={t("form.accentColor.label")} name="accentColor" defaultValue="#3b82f6" />
39
+ * @example
40
+ * <ColorField
41
+ * label={t("form.brandColor.label")}
42
+ * name="brandColor"
43
+ * format="rgb"
44
+ * defaultValue="rgb(16, 185, 129)"
45
+ * description={t("form.brandColor.hint")}
46
+ * />
47
+ * @example
48
+ * <ColorField
49
+ * label={t("form.themeColor.label")}
50
+ * name="themeColor"
51
+ * format="hsl"
52
+ * value="hsl(210, 90%, 55%)"
53
+ * errorMessage={t("form.themeColor.invalid")}
54
+ * />
55
+ */
56
+ export function ColorField(handle) {
57
+ return () => {
58
+ let { color, label, description, errorMessage: errorMessageProp, autoFocus, format, name, value, defaultValue, placeholder, required, disabled, readOnly, autoComplete, "aria-invalid": ariaInvalidProp, parts, mix, ...rest } = handle.props;
59
+ let { errorMessage, isFirstInvalid } = resolveFieldIssue(handle, name, errorMessageProp);
60
+ let resolvedAutoFocus = autoFocus ?? (isFirstInvalid || undefined);
61
+ let { resolvedColor, resolvedInvalid, descriptionId, errorId, describedBy } = resolveFieldWiring(handle.id, {
62
+ color,
63
+ errorMessage,
64
+ description,
65
+ ariaInvalid: ariaInvalidProp,
66
+ });
67
+ let resolvedFormat = format ?? DEFAULT_FORMAT;
68
+ let resolvedSwatchValue = value ?? defaultValue ?? DEFAULT_SWATCH_VALUE;
69
+ return (_jsxs("div", { ...rest, "data-slot": "color-field", mix: [fieldStackLayout(), mix], children: [_jsx(Label, { htmlFor: handle.id, mix: parts?.label, children: label }), _jsxs("div", { "data-slot": "control", mix: [hstack({ gap: 2, align: "center" }), parts?.control], children: [_jsx(Input, { id: handle.id, type: "text", name: name, value: value, defaultValue: defaultValue, placeholder: placeholder, pattern: FORMAT_PATTERNS[resolvedFormat], required: required, disabled: disabled, readOnly: readOnly, autoComplete: autoComplete,
70
+ // 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.
71
+ autoFocus: resolvedAutoFocus, "aria-invalid": resolvedInvalid, "aria-describedby": describedBy, color: resolvedColor, mix: [spacer(), minIs(0), parts?.input] }), _jsx(ColorSwatch, { value: resolvedSwatchValue, size: "lg", mix: parts?.swatch })] }), description ? (_jsx(Description, { id: descriptionId, mix: parts?.description, children: description })) : null, errorMessage ? (_jsx(FieldError, { id: errorId, mix: parts?.error, children: errorMessage })) : null] }));
72
+ };
73
+ }
@@ -0,0 +1,132 @@
1
+ /**
2
+ * A labeled color field composing {@link ColorField}'s plain fallback with
3
+ * an optional {@link ColorPicker.Group} trigger row and
4
+ * {@link ColorPicker.Dialog} picking surface swapped in via `children`.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import type { Handle, Props as TagProps, RemixNode } from "remix/ui";
10
+ import { ColorField } from "./color-field.js";
11
+ import { ColorSwatch } from "./color-swatch.js";
12
+ import { Popover } from "./popover.js";
13
+ /**
14
+ * Prop types for {@link ColorPicker} and its compound parts.
15
+ */
16
+ export declare namespace ColorPicker {
17
+ /**
18
+ * Semantic color role for the fallback field's keyboard focus ring,
19
+ * mirroring {@link ColorField.Color}. The composed layout carries no
20
+ * `color` prop of its own, since a consumer renders it directly.
21
+ */
22
+ type Color = ColorField.Color;
23
+ /**
24
+ * Every prop {@link ColorField.PartsProps} accepts, unchanged, applied
25
+ * only to the fallback field's internally composed parts — the composed
26
+ * layout styles its own parts individually instead.
27
+ */
28
+ interface PartsProps extends ColorField.PartsProps {
29
+ }
30
+ /**
31
+ * Props accepted by {@link ColorPicker}. Leaving `children` unset renders
32
+ * {@link ColorField}'s plain fallback using every field below; composing
33
+ * {@link ColorPicker.Group} and {@link ColorPicker.Dialog} instead skips them.
34
+ */
35
+ interface Props extends Omit<TagProps<"div">, "children"> {
36
+ /** Semantic color role for the fallback field's focus ring. Read only when `children` is unset. */
37
+ color?: Color;
38
+ /** The fallback field's caption, rendered through {@link ColorField}. Read only when `children` is unset. */
39
+ label?: RemixNode;
40
+ /** Supporting copy beneath the fallback field. Read only when `children` is unset. */
41
+ description?: RemixNode;
42
+ /** Validation message beneath the fallback field. Read only when `children` is unset. */
43
+ errorMessage?: RemixNode;
44
+ /** Notation the fallback field's typed entry is constrained to. Read only when `children` is unset. */
45
+ format?: ColorField.Format;
46
+ /** Native `name` submitted with an enclosing form, read only by the fallback field. */
47
+ name?: string;
48
+ /** Current value, as a literal color string, for a fallback field a consumer tracks itself. */
49
+ value?: string;
50
+ /** Initial value, as a literal color string, for a fallback field left to the platform's own uncontrolled state. */
51
+ defaultValue?: string;
52
+ /** Placeholder copy shown while the fallback field is empty. */
53
+ placeholder?: string;
54
+ /** Marks the fallback field required for its enclosing form. */
55
+ required?: boolean;
56
+ /** Marks the fallback field inert and excluded from the tab order. */
57
+ disabled?: boolean;
58
+ /** Marks the fallback field's value fixed, while keeping it focusable and included in form submission. */
59
+ readOnly?: boolean;
60
+ /** Native autofill hint for the fallback field. */
61
+ autoComplete?: string;
62
+ /** Per-part styling for the fallback field's internally composed parts. Read only when `children` is unset. */
63
+ parts?: PartsProps;
64
+ /**
65
+ * The trigger-and-panel layout — typically a `Label`,
66
+ * {@link ColorPicker.Group}, and {@link ColorPicker.Dialog} — rendered in
67
+ * place of {@link ColorField}'s plain fallback. Unset renders that fallback.
68
+ */
69
+ children?: RemixNode;
70
+ }
71
+ /**
72
+ * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.
73
+ * `children` composes the field's own control and
74
+ * {@link ColorPicker.Trigger} into one visual row.
75
+ */
76
+ interface GroupProps extends TagProps<"div"> {
77
+ }
78
+ /**
79
+ * Every native `<button>` attribute except `children`, fixed to this
80
+ * button's own {@link ColorSwatch}. Point `commandfor` at
81
+ * {@link ColorPicker.Dialog}'s `id` with `command="toggle-popover"` to wire it up.
82
+ */
83
+ interface TriggerProps extends Omit<TagProps<"button">, "children"> {
84
+ /**
85
+ * The color this trigger previews, already resolved to a literal CSS
86
+ * color value — the same value its inner {@link ColorSwatch} paints.
87
+ * Required, since a trigger with nothing to preview has no reason to render.
88
+ */
89
+ value: string;
90
+ /** Shape variant for the inner {@link ColorSwatch}, mirrored onto the button host so its own corners match. Defaults to {@link DEFAULT_TRIGGER_SHAPE}. */
91
+ shape?: ColorSwatch.Shape;
92
+ }
93
+ /**
94
+ * Every prop {@link Popover.Props} accepts, since {@link ColorPicker.Dialog}
95
+ * renders one directly as its host. `placement` defaults to
96
+ * {@link DEFAULT_DIALOG_PLACEMENT}.
97
+ */
98
+ interface DialogProps extends Popover.Props {
99
+ }
100
+ }
101
+ /**
102
+ * Renders {@link ColorPicker}'s root: {@link ColorField}'s plain fallback
103
+ * when `children` is unset, or the trigger-and-panel layout composed from
104
+ * {@link ColorPicker.Group} and {@link ColorPicker.Dialog} otherwise.
105
+ *
106
+ * @param handle Runtime handle carrying the root element's props.
107
+ * @returns The render function producing the color picker's markup.
108
+ * @example
109
+ * <ColorPicker label={t("form.accentColor.label")} name="accentColor" defaultValue="#3b82f6" />
110
+ * @example
111
+ * <ColorPicker>
112
+ * <Label htmlFor="brandColor">{t("form.brandColor.label")}</Label>
113
+ * <ColorPicker.Group>
114
+ * <Input id="brandColor" type="text" name="brandColor" defaultValue="#3b82f6" />
115
+ * <ColorPicker.Trigger
116
+ * commandfor="brandColor-panel"
117
+ * command="toggle-popover"
118
+ * aria-label={t("form.brandColor.toggle")}
119
+ * value="#3b82f6"
120
+ * />
121
+ * </ColorPicker.Group>
122
+ * <ColorPicker.Dialog id="brandColor-panel">
123
+ * {...the picking surface — see ColorPicker.Dialog's own doc comment}
124
+ * </ColorPicker.Dialog>
125
+ * </ColorPicker>
126
+ */
127
+ export declare function ColorPicker(handle: Handle<ColorPicker.Props>): () => import("remix/ui").RemixElement;
128
+ export declare namespace ColorPicker {
129
+ var Group: (handle: Handle<ColorPicker.GroupProps>) => () => import("remix/ui").RemixElement;
130
+ var Trigger: (handle: Handle<ColorPicker.TriggerProps>) => () => import("remix/ui").RemixElement;
131
+ var Dialog: (handle: Handle<ColorPicker.DialogProps>) => () => import("remix/ui").RemixElement;
132
+ }
@@ -0,0 +1,183 @@
1
+ import { jsx as _jsx } from "remix/ui/jsx-runtime";
2
+ import { outline } from "@sdxc/u/color";
3
+ import { opacity, rounded, transition } from "@sdxc/u/effects";
4
+ import { cursor, raw } from "@sdxc/u/general";
5
+ import { hstack, inlineFlex, relative, shrink, vstack } from "@sdxc/u/layout";
6
+ import { media } from "@sdxc/u/responsive";
7
+ import { bs, is, p } from "@sdxc/u/size";
8
+ import { when } from "@sdxc/u/state";
9
+ import { attrs } from "remix/ui";
10
+ import { warnIfNoAccessibleLabel } from "../utils/warn-if-no-accessible-name.js";
11
+ import { ColorField } from "./color-field.js";
12
+ import { ColorSwatch } from "./color-swatch.js";
13
+ import { Popover } from "./popover.js";
14
+ /**
15
+ * Native `<button>` `type` {@link ColorPicker.Trigger} falls back to,
16
+ * keeping an omitted `type` from implicitly submitting an enclosing
17
+ * `<form>` the way a bare `<button>` would.
18
+ */
19
+ const DEFAULT_BUTTON_TYPE = "button";
20
+ /**
21
+ * Shape variant {@link ColorPicker.Trigger} falls back to when `shape` is
22
+ * omitted, mirroring {@link ColorSwatch}'s own default so a trigger left
23
+ * unstyled reads the same as a bare swatch.
24
+ */
25
+ const DEFAULT_TRIGGER_SHAPE = "rounded";
26
+ /**
27
+ * `role` applied to {@link ColorPicker.Dialog}'s host through {@link attrs}
28
+ * unless a consumer supplies its own `role`, identifying the surface as a
29
+ * non-modal dialog layered above the page rather than a full-screen modal.
30
+ */
31
+ const DEFAULT_DIALOG_ROLE = "dialog";
32
+ /**
33
+ * Side of the trigger {@link ColorPicker.Dialog} renders against when
34
+ * `placement` is left unset, reading down and start-ward the way a dropdown
35
+ * conventionally does.
36
+ */
37
+ const DEFAULT_DIALOG_PLACEMENT = "bottom-start";
38
+ /**
39
+ * Renders {@link ColorPicker}'s root: {@link ColorField}'s plain fallback
40
+ * when `children` is unset, or the trigger-and-panel layout composed from
41
+ * {@link ColorPicker.Group} and {@link ColorPicker.Dialog} otherwise.
42
+ *
43
+ * @param handle Runtime handle carrying the root element's props.
44
+ * @returns The render function producing the color picker's markup.
45
+ * @example
46
+ * <ColorPicker label={t("form.accentColor.label")} name="accentColor" defaultValue="#3b82f6" />
47
+ * @example
48
+ * <ColorPicker>
49
+ * <Label htmlFor="brandColor">{t("form.brandColor.label")}</Label>
50
+ * <ColorPicker.Group>
51
+ * <Input id="brandColor" type="text" name="brandColor" defaultValue="#3b82f6" />
52
+ * <ColorPicker.Trigger
53
+ * commandfor="brandColor-panel"
54
+ * command="toggle-popover"
55
+ * aria-label={t("form.brandColor.toggle")}
56
+ * value="#3b82f6"
57
+ * />
58
+ * </ColorPicker.Group>
59
+ * <ColorPicker.Dialog id="brandColor-panel">
60
+ * {...the picking surface — see ColorPicker.Dialog's own doc comment}
61
+ * </ColorPicker.Dialog>
62
+ * </ColorPicker>
63
+ */
64
+ export function ColorPicker(handle) {
65
+ return () => {
66
+ let { color, label, description, errorMessage, format, name, value, defaultValue, placeholder, required, disabled, readOnly, autoComplete, parts, children, mix, ...rest } = handle.props;
67
+ if (import.meta.env.DEV && !children && !label) {
68
+ console.warn('ColorPicker: falling back to ColorField\'s plain color-notation field needs a "label" describing what it collects for assistive technology.');
69
+ }
70
+ if (!children) {
71
+ return (_jsx(ColorField, { ...rest, color: color, label: label, description: description, errorMessage: errorMessage, format: format, name: name, value: value, defaultValue: defaultValue, placeholder: placeholder, required: required, disabled: disabled, readOnly: readOnly, autoComplete: autoComplete, parts: parts, mix: mix }));
72
+ }
73
+ return (_jsx("div", { ...rest, "data-slot": "color-picker", mix: [vstack({ gap: 1 }), mix], children: children }));
74
+ };
75
+ }
76
+ /**
77
+ * Renders {@link ColorPicker}'s control row: a plain flex host laying the
78
+ * field's own control and {@link ColorPicker.Trigger} side by side, with a
79
+ * keyboard focus ring on the whole row the moment focus lands anywhere inside.
80
+ *
81
+ * @param handle Runtime handle carrying the host `<div>`'s props.
82
+ * @returns The render function producing the row's markup.
83
+ * @example
84
+ * <ColorPicker.Group>
85
+ * <Input id="brandColor" type="text" name="brandColor" defaultValue="#3b82f6" />
86
+ * <ColorPicker.Trigger
87
+ * commandfor="brandColor-panel"
88
+ * command="toggle-popover"
89
+ * aria-label={t("form.brandColor.toggle")}
90
+ * value="#3b82f6"
91
+ * />
92
+ * </ColorPicker.Group>
93
+ */
94
+ ColorPicker.Group = function ColorPickerGroup(handle) {
95
+ return () => {
96
+ let { mix, ...rest } = handle.props;
97
+ return (_jsx("div", { ...rest, "data-slot": "group", mix: [
98
+ when("&:focus-within", outline({ color: "brand.ring", offset: 2 })),
99
+ hstack({ gap: 2, align: "center" }),
100
+ mix,
101
+ ] }));
102
+ };
103
+ };
104
+ /**
105
+ * Renders {@link ColorPicker}'s trailing trigger: a `<button>` housing a
106
+ * {@link ColorSwatch} that fills it as a live preview, wired via
107
+ * `commandfor`/`command="toggle-popover"` to {@link ColorPicker.Dialog}'s `id`.
108
+ *
109
+ * @param handle Runtime handle carrying the host `<button>`'s props.
110
+ * @returns The render function producing the trigger's markup.
111
+ * @example
112
+ * <ColorPicker.Trigger
113
+ * commandfor="brandColor-panel"
114
+ * command="toggle-popover"
115
+ * aria-label={t("form.brandColor.toggle")}
116
+ * value="#3b82f6"
117
+ * />
118
+ */
119
+ ColorPicker.Trigger = function ColorPickerTrigger(handle) {
120
+ return () => {
121
+ let { type, value, shape, mix, ...rest } = handle.props;
122
+ let resolvedType = type ?? DEFAULT_BUTTON_TYPE;
123
+ let resolvedShape = shape ?? DEFAULT_TRIGGER_SHAPE;
124
+ warnIfNoAccessibleLabel(handle.props, "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.");
125
+ return (_jsx("button", { type: resolvedType, ...rest, "data-slot": "trigger", "data-shape": resolvedShape, mix: [
126
+ when("&:focus-visible", outline({ color: "brand.ring", offset: 2 })),
127
+ relative(),
128
+ inlineFlex(),
129
+ is("var(--ui-color-picker-trigger-size, 2.25rem)"),
130
+ bs("var(--ui-color-picker-trigger-size, 2.25rem)"),
131
+ rounded("md"),
132
+ cursor("pointer"),
133
+ transition("box-shadow"),
134
+ when('&[data-shape="circle"]', rounded("full")),
135
+ when("&:disabled", [cursor("not-allowed"), opacity(50)]),
136
+ p(0),
137
+ shrink(),
138
+ when('&[data-shape="square"]', rounded("none")),
139
+ when("&:hover", raw({ boxShadow: "0 0 0 2px var(--ui-neutral-border)" })),
140
+ media("(prefers-reduced-motion: reduce)", raw({ transitionDuration: "0s" })),
141
+ mix,
142
+ ], children: _jsx(ColorSwatch, { value: value, shape: resolvedShape, mix: [is("full"), bs("full")] }) }));
143
+ };
144
+ };
145
+ /**
146
+ * Renders {@link ColorPicker}'s picking surface: a Popover, defaulting
147
+ * `placement` to bottom-start and `role` to `"dialog"`, padding whatever
148
+ * picking controls a consumer composes as `children` in a single column.
149
+ *
150
+ * @param handle Runtime handle carrying the host's `Popover` props.
151
+ * @returns The render function producing the surface's markup.
152
+ * @example
153
+ * <ColorPicker.Dialog id="brandColor-panel">
154
+ * <ColorArea aria-label={t("colorPicker.area")} hue={hue} defaultSaturation={saturation} defaultValue={brightness} mix={colorAreaDrag()}>
155
+ * <ColorArea.SaturationThumb data-color-area-axis="x" aria-label={t("colorPicker.saturation")} />
156
+ * <ColorArea.ValueThumb data-color-area-axis="y" aria-label={t("colorPicker.brightness")} />
157
+ * </ColorArea>
158
+ * <ColorWheel aria-label={t("colorPicker.hue")} defaultValue={hue} mix={colorWheelDrag()} />
159
+ * <ColorSlider channel="alpha" defaultValue={alpha}>
160
+ * <ColorSlider.Track hue={hue}>
161
+ * <ColorSlider.Thumb aria-label={t("colorPicker.alpha")} />
162
+ * </ColorSlider.Track>
163
+ * </ColorSlider>
164
+ * <ColorField label={t("colorPicker.hex")} format="hex" defaultValue="#3b82f6" mix={colorPreview()} />
165
+ * <ColorSwatchPicker aria-label={t("colorPicker.presets")}>
166
+ * <ColorSwatchPicker.Swatch value="#ef4444" aria-label={t("color.red")} />
167
+ * <ColorSwatchPicker.Swatch value="#3b82f6" aria-label={t("color.blue")} defaultChecked />
168
+ * </ColorSwatchPicker>
169
+ * </ColorPicker.Dialog>
170
+ */
171
+ ColorPicker.Dialog = function ColorPickerDialog(handle) {
172
+ return () => {
173
+ let { placement, children, mix, ...rest } = handle.props;
174
+ let resolvedPlacement = placement ?? DEFAULT_DIALOG_PLACEMENT;
175
+ return (_jsx(Popover, { ...rest, placement: resolvedPlacement, mix: [
176
+ attrs({ role: DEFAULT_DIALOG_ROLE }),
177
+ vstack({ gap: 4 }),
178
+ p(4),
179
+ raw({ outline: "none" }),
180
+ mix,
181
+ ], children: children }));
182
+ };
183
+ };
@@ -0,0 +1,103 @@
1
+ /**
2
+ * A single-channel color control on a native `<input type="range">`, pairing
3
+ * a track painting the channel's gradient with a thumb reporting the current
4
+ * value and an `<output>` for its formatted display. The root shares the
5
+ * resolved channel, range, and value with every part through context.
6
+ *
7
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
8
+ * @copyright Sergio Xalambrí 2026
9
+ */
10
+ import type { Handle, Props as TagProps } from "remix/ui";
11
+ /**
12
+ * Prop types for {@link ColorSlider} and its compound parts.
13
+ */
14
+ export declare namespace ColorSlider {
15
+ /**
16
+ * The single color channel one {@link ColorSlider} instance edits. Every
17
+ * channel but `"hue"` itself also shares its live color through the `hue`
18
+ * prop its {@link Track} reads.
19
+ */
20
+ type Channel = "hue" | "saturation" | "lightness" | "alpha";
21
+ /**
22
+ * Value {@link ColorSlider} stores in component context so every
23
+ * {@link ColorSlider.Track} and {@link ColorSlider.Thumb} nested inside
24
+ * shares the same resolved channel, range, and value.
25
+ */
26
+ interface Context {
27
+ /** The channel this instance edits. Mirrored onto the root's own `data-channel` attribute, which {@link ColorSlider.Track} reads to pick its gradient formula. */
28
+ channel: Channel;
29
+ /** Resolved lower bound of the channel's range, shared with {@link ColorSlider.Thumb}. */
30
+ min: number;
31
+ /** Resolved upper bound of the channel's range, shared with {@link ColorSlider.Thumb}. */
32
+ max: number;
33
+ /** Resolved current value, used as {@link ColorSlider.Thumb}'s own default value. */
34
+ value: number;
35
+ }
36
+ /**
37
+ * Props accepted by {@link ColorSlider}.
38
+ */
39
+ interface Props extends TagProps<"div"> {
40
+ /** The single channel this instance edits. */
41
+ channel: Channel;
42
+ /** Lower bound of the channel's range. Defaults to {@link DEFAULT_MIN}. */
43
+ min?: number;
44
+ /** Upper bound of the channel's range. Defaults to `channel`'s entry in {@link DEFAULT_MAX_BY_CHANNEL}. */
45
+ max?: number;
46
+ /** Current value, for an instance whose value the consumer tracks itself. */
47
+ value?: number;
48
+ /** Starting value, for an instance that never tracks its own value. */
49
+ defaultValue?: number;
50
+ }
51
+ /**
52
+ * Props accepted by {@link ColorSlider.Track}.
53
+ */
54
+ interface TrackProps extends TagProps<"div"> {
55
+ /**
56
+ * The color's current hue, in degrees `0`–`360`, read into
57
+ * {@link TRACK_HUE_PROPERTY} at render time so a `"saturation"`,
58
+ * `"lightness"`, or `"alpha"` track's gradient matches it. Defaults to {@link DEFAULT_HUE}.
59
+ */
60
+ hue?: number;
61
+ }
62
+ /**
63
+ * Every native `<input>` attribute except `type` and `role`, fixed to
64
+ * `"range"` and the platform's implicit `"slider"` role, plus the `mix`
65
+ * passthrough. `min`/`max`/`step` override the range inherited from the nearest ancestor {@link ColorSlider}.
66
+ */
67
+ interface ThumbProps extends Omit<TagProps<"input">, "type" | "role"> {
68
+ }
69
+ /**
70
+ * Props accepted by {@link ColorSlider.Output}. Associate it with a thumb
71
+ * by passing the paired {@link ColorSlider.Thumb}'s own `id` explicitly as
72
+ * `htmlFor`.
73
+ */
74
+ interface OutputProps extends TagProps<"output"> {
75
+ }
76
+ }
77
+ /**
78
+ * Renders the root host: a `<div>` stacking its children with a small gap,
79
+ * resolving the channel, range, and value into component context and
80
+ * mirroring the channel onto its own `data-channel` attribute.
81
+ *
82
+ * @param handle Runtime handle carrying the host `<div>`'s props and providing {@link ColorSlider.Context}.
83
+ * @returns The render function producing the root's markup.
84
+ * @example
85
+ * <ColorSlider channel="hue" defaultValue={210}>
86
+ * <ColorSlider.Output htmlFor="accent-hue-thumb">210°</ColorSlider.Output>
87
+ * <ColorSlider.Track>
88
+ * <ColorSlider.Thumb id="accent-hue-thumb" aria-label={t("colorPicker.hue")} />
89
+ * </ColorSlider.Track>
90
+ * </ColorSlider>
91
+ * @example
92
+ * <ColorSlider channel="alpha" min={0} max={1} defaultValue={1}>
93
+ * <ColorSlider.Track hue={210}>
94
+ * <ColorSlider.Thumb aria-label={t("colorPicker.alpha")} />
95
+ * </ColorSlider.Track>
96
+ * </ColorSlider>
97
+ */
98
+ export declare function ColorSlider(handle: Handle<ColorSlider.Props, ColorSlider.Context>): () => import("remix/ui").RemixElement;
99
+ export declare namespace ColorSlider {
100
+ var Track: (handle: Handle<ColorSlider.TrackProps>) => () => import("remix/ui").RemixElement;
101
+ var Thumb: (handle: Handle<ColorSlider.ThumbProps>) => () => import("remix/ui").RemixElement;
102
+ var Output: (handle: Handle<ColorSlider.OutputProps>) => () => import("remix/ui").RemixElement;
103
+ }