@kumix/ui 0.6.0 → 0.8.0

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 (1488) hide show
  1. package/README.md +71 -48
  2. package/dist/animated-sidebar-CPdrqoGi.js +310 -0
  3. package/dist/animated-sidebar-CPdrqoGi.js.map +1 -0
  4. package/dist/animated-toast-stack-Cbdphi9x.d.ts +62 -0
  5. package/dist/animated-toast-stack-Cbdphi9x.d.ts.map +1 -0
  6. package/dist/animated-toast-stack-YcjQ2Uaw.js +568 -0
  7. package/dist/animated-toast-stack-YcjQ2Uaw.js.map +1 -0
  8. package/dist/components/agents/agent-activity/activity-row.d.ts +1 -1
  9. package/dist/components/agents/agent-activity/activity-row.d.ts.map +1 -1
  10. package/dist/components/agents/agent-activity/activity-row.js +31 -26
  11. package/dist/components/agents/agent-activity/activity-row.js.map +1 -1
  12. package/dist/components/agents/{agent-activity/index.d.ts → agent-activity.d.ts} +2 -2
  13. package/dist/components/agents/agent-activity.d.ts.map +1 -0
  14. package/dist/components/agents/{agent-activity/index.js → agent-activity.js} +13 -27
  15. package/dist/components/agents/agent-activity.js.map +1 -0
  16. package/dist/components/agents/agent-code.d.ts.map +1 -1
  17. package/dist/components/agents/agent-code.js +42 -16
  18. package/dist/components/agents/agent-code.js.map +1 -1
  19. package/dist/components/agents/agent-disclosure.d.ts +7 -2
  20. package/dist/components/agents/agent-disclosure.d.ts.map +1 -1
  21. package/dist/components/agents/agent-disclosure.js +15 -3
  22. package/dist/components/agents/agent-disclosure.js.map +1 -1
  23. package/dist/components/agents/ai-sidebar/marquee-label.d.ts +6 -0
  24. package/dist/components/agents/ai-sidebar/marquee-label.d.ts.map +1 -0
  25. package/dist/components/agents/ai-sidebar/marquee-label.js +55 -0
  26. package/dist/components/agents/ai-sidebar/marquee-label.js.map +1 -0
  27. package/dist/components/agents/ai-sidebar/resource-menu-action.d.ts +8 -0
  28. package/dist/components/agents/ai-sidebar/resource-menu-action.d.ts.map +1 -0
  29. package/dist/components/agents/ai-sidebar/resource-menu-action.js +20 -0
  30. package/dist/components/agents/ai-sidebar/resource-menu-action.js.map +1 -0
  31. package/dist/components/agents/ai-sidebar/resource-row.d.ts +32 -0
  32. package/dist/components/agents/ai-sidebar/resource-row.d.ts.map +1 -0
  33. package/dist/components/agents/ai-sidebar/resource-row.js +2 -0
  34. package/dist/components/agents/ai-sidebar.d.ts +2 -74
  35. package/dist/components/agents/ai-sidebar.d.ts.map +1 -1
  36. package/dist/components/agents/ai-sidebar.js +16 -332
  37. package/dist/components/agents/ai-sidebar.js.map +1 -1
  38. package/dist/components/agents/{approval-card/index.d.ts → approval-card.d.ts} +31 -1
  39. package/dist/components/agents/approval-card.d.ts.map +1 -0
  40. package/dist/components/agents/{approval-card/index.js → approval-card.js} +160 -80
  41. package/dist/components/agents/approval-card.js.map +1 -0
  42. package/dist/components/agents/chat-app.d.ts +1 -1
  43. package/dist/components/agents/chat-app.d.ts.map +1 -1
  44. package/dist/components/agents/chat-app.js +9 -6
  45. package/dist/components/agents/chat-app.js.map +1 -1
  46. package/dist/components/agents/citations.d.ts +24 -1
  47. package/dist/components/agents/citations.d.ts.map +1 -1
  48. package/dist/components/agents/citations.js +54 -9
  49. package/dist/components/agents/citations.js.map +1 -1
  50. package/dist/components/agents/clip-resize-frame.d.ts +31 -0
  51. package/dist/components/agents/clip-resize-frame.d.ts.map +1 -0
  52. package/dist/components/agents/clip-resize-frame.js +103 -0
  53. package/dist/components/agents/clip-resize-frame.js.map +1 -0
  54. package/dist/components/agents/code-block.d.ts +11 -0
  55. package/dist/components/agents/code-block.d.ts.map +1 -1
  56. package/dist/components/agents/code-block.js +34 -26
  57. package/dist/components/agents/code-block.js.map +1 -1
  58. package/dist/components/agents/context-meter.d.ts +53 -0
  59. package/dist/components/agents/context-meter.d.ts.map +1 -0
  60. package/dist/components/agents/context-meter.js +443 -0
  61. package/dist/components/agents/context-meter.js.map +1 -0
  62. package/dist/components/agents/file-diff.d.ts +17 -0
  63. package/dist/components/agents/file-diff.d.ts.map +1 -1
  64. package/dist/components/agents/file-diff.js +114 -82
  65. package/dist/components/agents/file-diff.js.map +1 -1
  66. package/dist/components/agents/icon-swap.d.ts +14 -0
  67. package/dist/components/agents/icon-swap.d.ts.map +1 -0
  68. package/dist/components/agents/icon-swap.js +41 -0
  69. package/dist/components/agents/icon-swap.js.map +1 -0
  70. package/dist/components/agents/image-generation.d.ts +10 -0
  71. package/dist/components/agents/image-generation.d.ts.map +1 -1
  72. package/dist/components/agents/image-generation.js +10 -6
  73. package/dist/components/agents/image-generation.js.map +1 -1
  74. package/dist/components/agents/loading-states/agent-progress.d.ts +1 -0
  75. package/dist/components/agents/loading-states/agent-progress.d.ts.map +1 -1
  76. package/dist/components/agents/loading-states/agent-progress.js.map +1 -1
  77. package/dist/components/agents/loading-states/reasoning-text.d.ts +1 -0
  78. package/dist/components/agents/loading-states/reasoning-text.d.ts.map +1 -1
  79. package/dist/components/agents/loading-states/reasoning-text.js +30 -7
  80. package/dist/components/agents/loading-states/reasoning-text.js.map +1 -1
  81. package/dist/components/agents/loading-states/thinking-shimmer.d.ts +1 -0
  82. package/dist/components/agents/loading-states/thinking-shimmer.d.ts.map +1 -1
  83. package/dist/components/agents/loading-states/thinking-shimmer.js.map +1 -1
  84. package/dist/components/agents/message-bubble.d.ts +10 -0
  85. package/dist/components/agents/message-bubble.d.ts.map +1 -1
  86. package/dist/components/agents/message-bubble.js +59 -39
  87. package/dist/components/agents/message-bubble.js.map +1 -1
  88. package/dist/components/agents/message-scroller.d.ts +10 -1
  89. package/dist/components/agents/message-scroller.d.ts.map +1 -1
  90. package/dist/components/agents/message-scroller.js +81 -16
  91. package/dist/components/agents/message-scroller.js.map +1 -1
  92. package/dist/components/agents/message.d.ts +3 -0
  93. package/dist/components/agents/message.d.ts.map +1 -1
  94. package/dist/components/agents/message.js +3 -3
  95. package/dist/components/agents/message.js.map +1 -1
  96. package/dist/components/agents/prompt-input.d.ts +41 -1
  97. package/dist/components/agents/prompt-input.d.ts.map +1 -1
  98. package/dist/components/agents/prompt-input.js +356 -93
  99. package/dist/components/agents/prompt-input.js.map +1 -1
  100. package/dist/components/agents/streaming-response.d.ts +12 -0
  101. package/dist/components/agents/streaming-response.d.ts.map +1 -1
  102. package/dist/components/agents/streaming-response.js +35 -28
  103. package/dist/components/agents/streaming-response.js.map +1 -1
  104. package/dist/components/agents/todo-list.d.ts +13 -0
  105. package/dist/components/agents/todo-list.d.ts.map +1 -1
  106. package/dist/components/agents/todo-list.js +114 -98
  107. package/dist/components/agents/todo-list.js.map +1 -1
  108. package/dist/components/agents/tool-approval.d.ts +18 -0
  109. package/dist/components/agents/tool-approval.d.ts.map +1 -1
  110. package/dist/components/agents/tool-approval.js +48 -22
  111. package/dist/components/agents/tool-approval.js.map +1 -1
  112. package/dist/components/agents/tool-result.d.ts +18 -0
  113. package/dist/components/agents/tool-result.d.ts.map +1 -1
  114. package/dist/components/agents/tool-result.js +48 -59
  115. package/dist/components/agents/tool-result.js.map +1 -1
  116. package/dist/components/agents/voice-note.d.ts +37 -0
  117. package/dist/components/agents/voice-note.d.ts.map +1 -0
  118. package/dist/components/agents/voice-note.js +326 -0
  119. package/dist/components/agents/voice-note.js.map +1 -0
  120. package/dist/components/charts/bar-chart/context.d.ts +15 -7
  121. package/dist/components/charts/bar-chart/context.d.ts.map +1 -1
  122. package/dist/components/charts/bar-chart/context.js +3 -1
  123. package/dist/components/charts/bar-chart/context.js.map +1 -1
  124. package/dist/components/charts/bar-chart/legend.d.ts +1 -0
  125. package/dist/components/charts/bar-chart/legend.d.ts.map +1 -1
  126. package/dist/components/charts/bar-chart/legend.js.map +1 -1
  127. package/dist/components/charts/bar-chart/plot.d.ts +2 -0
  128. package/dist/components/charts/bar-chart/plot.d.ts.map +1 -1
  129. package/dist/components/charts/bar-chart/plot.js +2 -2
  130. package/dist/components/charts/bar-chart/plot.js.map +1 -1
  131. package/dist/components/charts/bar-chart/tooltip.d.ts +2 -0
  132. package/dist/components/charts/bar-chart/tooltip.d.ts.map +1 -1
  133. package/dist/components/charts/bar-chart/tooltip.js +1 -1
  134. package/dist/components/charts/bar-chart/tooltip.js.map +1 -1
  135. package/dist/components/charts/bar-chart.d.ts +1 -1
  136. package/dist/components/charts/bump-chart/context.d.ts +1 -1
  137. package/dist/components/charts/bump-chart/context.js +1 -1
  138. package/dist/components/charts/bump-chart/legend.js +5 -5
  139. package/dist/components/charts/bump-chart/legend.js.map +1 -1
  140. package/dist/components/charts/bump-chart/plot.js +1 -1
  141. package/dist/components/charts/bump-chart/point.js +5 -5
  142. package/dist/components/charts/bump-chart/point.js.map +1 -1
  143. package/dist/components/charts/bump-chart/series.d.ts +1 -1
  144. package/dist/components/charts/bump-chart/series.js +2 -2
  145. package/dist/components/charts/bump-chart/series.js.map +1 -1
  146. package/dist/components/charts/bump-chart.d.ts +1 -1
  147. package/dist/components/charts/bump-chart.js +2 -2
  148. package/dist/components/charts/candlestick-chart/context.d.ts +14 -3
  149. package/dist/components/charts/candlestick-chart/context.d.ts.map +1 -1
  150. package/dist/components/charts/candlestick-chart/context.js.map +1 -1
  151. package/dist/components/charts/candlestick-chart/plot.js +2 -2
  152. package/dist/components/charts/candlestick-chart/plot.js.map +1 -1
  153. package/dist/components/charts/composition-chart/context.d.ts +1 -1
  154. package/dist/components/charts/composition-chart/legend.js +1 -1
  155. package/dist/components/charts/composition-chart/legend.js.map +1 -1
  156. package/dist/components/charts/composition-chart/plot.js +1 -1
  157. package/dist/components/charts/composition-chart.d.ts +1 -1
  158. package/dist/components/charts/donut-chart/center.d.ts +1 -1
  159. package/dist/components/charts/donut-chart/context.d.ts +6 -1
  160. package/dist/components/charts/donut-chart/context.d.ts.map +1 -1
  161. package/dist/components/charts/donut-chart/legend.d.ts +1 -1
  162. package/dist/components/charts/donut-chart.d.ts +1 -1
  163. package/dist/components/charts/funnel-chart.d.ts +8 -0
  164. package/dist/components/charts/funnel-chart.d.ts.map +1 -1
  165. package/dist/components/charts/funnel-chart.js +8 -8
  166. package/dist/components/charts/funnel-chart.js.map +1 -1
  167. package/dist/components/charts/heat-calendar/grid.js +2 -2
  168. package/dist/components/charts/heat-calendar/grid.js.map +1 -1
  169. package/dist/components/charts/heat-calendar/legend.js +1 -1
  170. package/dist/components/charts/heat-calendar/tooltip.d.ts +1 -1
  171. package/dist/components/charts/heat-calendar/tooltip.js +2 -2
  172. package/dist/components/charts/heat-calendar.d.ts +1 -1
  173. package/dist/components/charts/heat-calendar.js +1 -1
  174. package/dist/components/charts/line-chart/context.d.ts +12 -4
  175. package/dist/components/charts/line-chart/context.d.ts.map +1 -1
  176. package/dist/components/charts/line-chart/context.js +3 -1
  177. package/dist/components/charts/line-chart/context.js.map +1 -1
  178. package/dist/components/charts/line-chart/legend.d.ts +1 -0
  179. package/dist/components/charts/line-chart/legend.d.ts.map +1 -1
  180. package/dist/components/charts/line-chart/legend.js.map +1 -1
  181. package/dist/components/charts/line-chart/plot.d.ts +2 -0
  182. package/dist/components/charts/line-chart/plot.d.ts.map +1 -1
  183. package/dist/components/charts/line-chart/plot.js +3 -3
  184. package/dist/components/charts/line-chart/plot.js.map +1 -1
  185. package/dist/components/charts/line-chart/tooltip.d.ts +1 -0
  186. package/dist/components/charts/line-chart/tooltip.d.ts.map +1 -1
  187. package/dist/components/charts/line-chart/tooltip.js.map +1 -1
  188. package/dist/components/charts/line-chart.d.ts +1 -1
  189. package/dist/components/charts/liquidity-heatmap.d.ts +8 -0
  190. package/dist/components/charts/liquidity-heatmap.d.ts.map +1 -1
  191. package/dist/components/charts/liquidity-heatmap.js +4 -4
  192. package/dist/components/charts/liquidity-heatmap.js.map +1 -1
  193. package/dist/components/charts/order-book/depth-row.d.ts +1 -1
  194. package/dist/components/charts/order-book.d.ts +14 -2
  195. package/dist/components/charts/order-book.d.ts.map +1 -1
  196. package/dist/components/charts/order-book.js +6 -6
  197. package/dist/components/charts/order-book.js.map +1 -1
  198. package/dist/components/charts/price-target-fan/header.js +2 -2
  199. package/dist/components/charts/price-target-fan/header.js.map +1 -1
  200. package/dist/components/charts/price-target-fan/plot.js +1 -1
  201. package/dist/components/charts/price-target-fan/series.js +1 -1
  202. package/dist/components/charts/price-target-fan/tooltip.d.ts +1 -1
  203. package/dist/components/charts/price-target-fan/tooltip.js +3 -3
  204. package/dist/components/charts/price-target-fan/tooltip.js.map +1 -1
  205. package/dist/components/charts/price-target-fan.d.ts +1 -1
  206. package/dist/components/charts/price-target-fan.js +1 -1
  207. package/dist/components/charts/returns-calendar/grid.js +10 -7
  208. package/dist/components/charts/returns-calendar/grid.js.map +1 -1
  209. package/dist/components/charts/returns-calendar/tooltip.d.ts +1 -1
  210. package/dist/components/charts/returns-calendar/tooltip.js +2 -2
  211. package/dist/components/charts/returns-calendar/tooltip.js.map +1 -1
  212. package/dist/components/charts/returns-calendar.d.ts +1 -1
  213. package/dist/components/charts/returns-calendar.d.ts.map +1 -1
  214. package/dist/components/charts/returns-calendar.js +1 -1
  215. package/dist/components/charts/sankey-chart/context.d.ts +1 -1
  216. package/dist/components/charts/sankey-chart/context.js +1 -1
  217. package/dist/components/charts/sankey-chart/plot.d.ts.map +1 -1
  218. package/dist/components/charts/sankey-chart/plot.js +10 -32
  219. package/dist/components/charts/sankey-chart/plot.js.map +1 -1
  220. package/dist/components/charts/sankey-chart/tooltip.d.ts +3 -1
  221. package/dist/components/charts/sankey-chart/tooltip.d.ts.map +1 -1
  222. package/dist/components/charts/sankey-chart/tooltip.js +2 -2
  223. package/dist/components/charts/sankey-chart/tooltip.js.map +1 -1
  224. package/dist/components/charts/sankey-chart.d.ts +1 -1
  225. package/dist/components/charts/sankey-chart.js +1 -1
  226. package/dist/components/charts/sparkline.d.ts +4 -0
  227. package/dist/components/charts/sparkline.d.ts.map +1 -1
  228. package/dist/components/charts/sparkline.js +3 -3
  229. package/dist/components/charts/sparkline.js.map +1 -1
  230. package/dist/components/charts/status-bar/legend.d.ts +1 -0
  231. package/dist/components/charts/status-bar/legend.d.ts.map +1 -1
  232. package/dist/components/charts/status-bar/legend.js +1 -1
  233. package/dist/components/charts/status-bar/legend.js.map +1 -1
  234. package/dist/components/charts/status-bar/plot.d.ts +2 -0
  235. package/dist/components/charts/status-bar/plot.d.ts.map +1 -1
  236. package/dist/components/charts/status-bar/plot.js +1 -1
  237. package/dist/components/charts/status-bar/plot.js.map +1 -1
  238. package/dist/components/charts/status-bar/tooltip.d.ts +1 -1
  239. package/dist/components/charts/status-bar/tooltip.js +2 -2
  240. package/dist/components/charts/status-bar/tooltip.js.map +1 -1
  241. package/dist/components/charts/status-bar.d.ts +1 -1
  242. package/dist/components/charts/status-bar.js +1 -1
  243. package/dist/components/charts/treemap/legend.d.ts +2 -0
  244. package/dist/components/charts/treemap/legend.d.ts.map +1 -1
  245. package/dist/components/charts/treemap/legend.js +1 -1
  246. package/dist/components/charts/treemap/legend.js.map +1 -1
  247. package/dist/components/charts/treemap/plot.d.ts +2 -1
  248. package/dist/components/charts/treemap/plot.d.ts.map +1 -1
  249. package/dist/components/charts/treemap/plot.js +3 -16
  250. package/dist/components/charts/treemap/plot.js.map +1 -1
  251. package/dist/components/charts/treemap/tile.d.ts +1 -1
  252. package/dist/components/charts/treemap/tile.js +3 -3
  253. package/dist/components/charts/treemap/tile.js.map +1 -1
  254. package/dist/components/charts/treemap/tooltip.d.ts +3 -1
  255. package/dist/components/charts/treemap/tooltip.d.ts.map +1 -1
  256. package/dist/components/charts/treemap/tooltip.js +2 -2
  257. package/dist/components/charts/treemap/tooltip.js.map +1 -1
  258. package/dist/components/charts/treemap.d.ts +10 -4
  259. package/dist/components/charts/treemap.d.ts.map +1 -1
  260. package/dist/components/charts/treemap.js +1 -1
  261. package/dist/components/charts/volume-profile/plot.d.ts +2 -0
  262. package/dist/components/charts/volume-profile/plot.d.ts.map +1 -1
  263. package/dist/components/charts/volume-profile/plot.js +4 -4
  264. package/dist/components/charts/volume-profile/plot.js.map +1 -1
  265. package/dist/components/charts/volume-profile/summary.js +2 -2
  266. package/dist/components/charts/volume-profile/summary.js.map +1 -1
  267. package/dist/components/charts/volume-profile/tooltip.d.ts +1 -1
  268. package/dist/components/charts/volume-profile/tooltip.js +2 -2
  269. package/dist/components/charts/volume-profile/tooltip.js.map +1 -1
  270. package/dist/components/charts/volume-profile.d.ts +12 -3
  271. package/dist/components/charts/volume-profile.d.ts.map +1 -1
  272. package/dist/components/charts/volume-profile.js +2 -2
  273. package/dist/components/charts/volume-profile.js.map +1 -1
  274. package/dist/components/charts/xy/data-table.d.ts +1 -1
  275. package/dist/components/charts/xy/legend.d.ts +1 -1
  276. package/dist/components/custom/toast.d.ts +2 -1
  277. package/dist/components/custom/toast.d.ts.map +1 -1
  278. package/dist/components/custom/toast.js +1 -1
  279. package/dist/components/motion/action-swap.d.ts +19 -0
  280. package/dist/components/motion/action-swap.d.ts.map +1 -1
  281. package/dist/components/motion/action-swap.js.map +1 -1
  282. package/dist/components/motion/adaptive-stepper.d.ts +13 -0
  283. package/dist/components/motion/adaptive-stepper.d.ts.map +1 -1
  284. package/dist/components/motion/adaptive-stepper.js +2 -7
  285. package/dist/components/motion/adaptive-stepper.js.map +1 -1
  286. package/dist/components/motion/add-to-cart.d.ts +38 -0
  287. package/dist/components/motion/add-to-cart.d.ts.map +1 -0
  288. package/dist/components/motion/add-to-cart.js +228 -0
  289. package/dist/components/motion/add-to-cart.js.map +1 -0
  290. package/dist/components/motion/alert.d.ts +4 -0
  291. package/dist/components/motion/alert.d.ts.map +1 -1
  292. package/dist/components/motion/alert.js +2 -2
  293. package/dist/components/motion/alert.js.map +1 -1
  294. package/dist/components/motion/animated-badge.d.ts +6 -0
  295. package/dist/components/motion/animated-badge.d.ts.map +1 -1
  296. package/dist/components/motion/animated-badge.js +2 -2
  297. package/dist/components/motion/animated-badge.js.map +1 -1
  298. package/dist/components/motion/animated-number.d.ts +5 -0
  299. package/dist/components/motion/animated-number.d.ts.map +1 -1
  300. package/dist/components/motion/animated-number.js.map +1 -1
  301. package/dist/components/motion/animated-sidebar/menu-button.d.ts +2 -0
  302. package/dist/components/motion/animated-sidebar/menu-button.js +95 -0
  303. package/dist/components/motion/animated-sidebar/menu-button.js.map +1 -0
  304. package/dist/components/motion/animated-sidebar/menu-sub-button.d.ts +2 -0
  305. package/dist/components/motion/animated-sidebar/menu-sub-button.js +52 -0
  306. package/dist/components/motion/animated-sidebar/menu-sub-button.js.map +1 -0
  307. package/dist/components/motion/animated-sidebar/mobile-sidebar.d.ts +9 -0
  308. package/dist/components/motion/animated-sidebar/mobile-sidebar.d.ts.map +1 -0
  309. package/dist/components/motion/animated-sidebar/mobile-sidebar.js +73 -0
  310. package/dist/components/motion/animated-sidebar/mobile-sidebar.js.map +1 -0
  311. package/dist/components/motion/animated-sidebar.d.ts +17 -55
  312. package/dist/components/motion/animated-sidebar.d.ts.map +1 -1
  313. package/dist/components/motion/animated-sidebar.js +4 -628
  314. package/dist/components/motion/animated-toast-stack/toast-body.d.ts +19 -0
  315. package/dist/components/motion/animated-toast-stack/toast-body.d.ts.map +1 -0
  316. package/dist/components/motion/animated-toast-stack/toast-body.js +154 -0
  317. package/dist/components/motion/animated-toast-stack/toast-body.js.map +1 -0
  318. package/dist/components/motion/animated-toast-stack.d.ts +3 -69
  319. package/dist/components/motion/animated-toast-stack.js +1 -307
  320. package/dist/components/motion/arc-picker.js +1 -1
  321. package/dist/components/motion/arc-picker.js.map +1 -1
  322. package/dist/components/motion/aspect-ratio.d.ts +1 -0
  323. package/dist/components/motion/aspect-ratio.d.ts.map +1 -1
  324. package/dist/components/motion/aspect-ratio.js.map +1 -1
  325. package/dist/components/motion/attachment-upload/attachment-row.d.ts +20 -0
  326. package/dist/components/motion/attachment-upload/attachment-row.d.ts.map +1 -0
  327. package/dist/components/motion/attachment-upload/attachment-row.js +224 -0
  328. package/dist/components/motion/attachment-upload/attachment-row.js.map +1 -0
  329. package/dist/components/motion/attachment-upload/image-preview-dialog.d.ts +10 -0
  330. package/dist/components/motion/attachment-upload/image-preview-dialog.d.ts.map +1 -0
  331. package/dist/components/motion/attachment-upload/image-preview-dialog.js +84 -0
  332. package/dist/components/motion/attachment-upload/image-preview-dialog.js.map +1 -0
  333. package/dist/components/motion/attachment-upload/image-thumbnail.d.ts +10 -0
  334. package/dist/components/motion/attachment-upload/image-thumbnail.d.ts.map +1 -0
  335. package/dist/components/motion/attachment-upload/image-thumbnail.js +53 -0
  336. package/dist/components/motion/attachment-upload/image-thumbnail.js.map +1 -0
  337. package/dist/components/motion/attachment-upload/row-action.d.ts +11 -0
  338. package/dist/components/motion/attachment-upload/row-action.d.ts.map +1 -0
  339. package/dist/components/motion/attachment-upload/row-action.js +98 -0
  340. package/dist/components/motion/attachment-upload/row-action.js.map +1 -0
  341. package/dist/components/motion/attachment-upload.d.ts +22 -50
  342. package/dist/components/motion/attachment-upload.d.ts.map +1 -1
  343. package/dist/components/motion/attachment-upload.js +16 -492
  344. package/dist/components/motion/attachment-upload.js.map +1 -1
  345. package/dist/components/motion/availability-scheduler/copy-menu.js +1 -1
  346. package/dist/components/motion/availability-scheduler/day-row.js +2 -2
  347. package/dist/components/motion/availability-scheduler/day-row.js.map +1 -1
  348. package/dist/components/motion/availability-scheduler/icon-button.js +1 -1
  349. package/dist/components/motion/availability-scheduler/icon-button.js.map +1 -1
  350. package/dist/components/motion/{availability-scheduler/index.d.ts → availability-scheduler.d.ts} +7 -3
  351. package/dist/components/motion/availability-scheduler.d.ts.map +1 -0
  352. package/dist/components/motion/{availability-scheduler/index.js → availability-scheduler.js} +4 -4
  353. package/dist/components/motion/availability-scheduler.js.map +1 -0
  354. package/dist/components/motion/avatar-group.d.ts +10 -1
  355. package/dist/components/motion/avatar-group.d.ts.map +1 -1
  356. package/dist/components/motion/avatar-group.js +3 -3
  357. package/dist/components/motion/avatar-group.js.map +1 -1
  358. package/dist/components/motion/before-after-slider.d.ts +3 -0
  359. package/dist/components/motion/before-after-slider.d.ts.map +1 -1
  360. package/dist/components/motion/before-after-slider.js +2 -3
  361. package/dist/components/motion/before-after-slider.js.map +1 -1
  362. package/dist/components/motion/bloom-menu.d.ts +5 -0
  363. package/dist/components/motion/bloom-menu.d.ts.map +1 -1
  364. package/dist/components/motion/bloom-menu.js +10 -24
  365. package/dist/components/motion/bloom-menu.js.map +1 -1
  366. package/dist/components/motion/bookmark-button.d.ts +30 -0
  367. package/dist/components/motion/bookmark-button.d.ts.map +1 -0
  368. package/dist/components/motion/bookmark-button.js +107 -0
  369. package/dist/components/motion/bookmark-button.js.map +1 -0
  370. package/dist/components/motion/bookshelf.d.ts +7 -0
  371. package/dist/components/motion/bookshelf.d.ts.map +1 -1
  372. package/dist/components/motion/bookshelf.js +3 -3
  373. package/dist/components/motion/bookshelf.js.map +1 -1
  374. package/dist/components/motion/bottom-sheet.d.ts +6 -0
  375. package/dist/components/motion/bottom-sheet.d.ts.map +1 -1
  376. package/dist/components/motion/bottom-sheet.js +6 -30
  377. package/dist/components/motion/bottom-sheet.js.map +1 -1
  378. package/dist/components/motion/bounce-sidebar.d.ts +16 -0
  379. package/dist/components/motion/bounce-sidebar.d.ts.map +1 -1
  380. package/dist/components/motion/bounce-sidebar.js.map +1 -1
  381. package/dist/components/motion/bouncy-accordion.d.ts +20 -0
  382. package/dist/components/motion/bouncy-accordion.d.ts.map +1 -1
  383. package/dist/components/motion/bouncy-accordion.js +2 -2
  384. package/dist/components/motion/bouncy-accordion.js.map +1 -1
  385. package/dist/components/motion/breadcrumb.d.ts +2 -0
  386. package/dist/components/motion/breadcrumb.d.ts.map +1 -1
  387. package/dist/components/motion/breadcrumb.js +5 -6
  388. package/dist/components/motion/breadcrumb.js.map +1 -1
  389. package/dist/components/motion/button/base.d.ts +8 -0
  390. package/dist/components/motion/button/base.d.ts.map +1 -1
  391. package/dist/components/motion/button/base.js +15 -10
  392. package/dist/components/motion/button/base.js.map +1 -1
  393. package/dist/components/motion/button/metallic.d.ts.map +1 -1
  394. package/dist/components/motion/button/metallic.js +5 -4
  395. package/dist/components/motion/button/metallic.js.map +1 -1
  396. package/dist/components/motion/button/stateful.d.ts +5 -0
  397. package/dist/components/motion/button/stateful.d.ts.map +1 -1
  398. package/dist/components/motion/button/stateful.js +0 -1
  399. package/dist/components/motion/button/stateful.js.map +1 -1
  400. package/dist/components/motion/{button/index.d.ts → button.d.ts} +4 -4
  401. package/dist/components/motion/button.js +6 -0
  402. package/dist/components/motion/card-dealer.d.ts +2 -0
  403. package/dist/components/motion/card-dealer.d.ts.map +1 -1
  404. package/dist/components/motion/card-dealer.js +4 -4
  405. package/dist/components/motion/card-dealer.js.map +1 -1
  406. package/dist/components/motion/card-folder.d.ts +18 -0
  407. package/dist/components/motion/card-folder.d.ts.map +1 -1
  408. package/dist/components/motion/card-folder.js +9 -9
  409. package/dist/components/motion/card-folder.js.map +1 -1
  410. package/dist/components/motion/card.js +1 -1
  411. package/dist/components/motion/card.js.map +1 -1
  412. package/dist/components/motion/casino/game-parts.d.ts +1 -1
  413. package/dist/components/motion/casino/game-parts.js +5 -5
  414. package/dist/components/motion/casino/game-parts.js.map +1 -1
  415. package/dist/components/motion/center-morph-modal.d.ts +4 -0
  416. package/dist/components/motion/center-morph-modal.d.ts.map +1 -1
  417. package/dist/components/motion/center-morph-modal.js +64 -91
  418. package/dist/components/motion/center-morph-modal.js.map +1 -1
  419. package/dist/components/motion/checkbox.d.ts +8 -0
  420. package/dist/components/motion/checkbox.d.ts.map +1 -1
  421. package/dist/components/motion/checkbox.js.map +1 -1
  422. package/dist/components/motion/chromatic-text-reveal.js +3 -3
  423. package/dist/components/motion/chromatic-text-reveal.js.map +1 -1
  424. package/dist/components/motion/click-burst.d.ts +24 -0
  425. package/dist/components/motion/click-burst.d.ts.map +1 -0
  426. package/dist/components/motion/click-burst.js +133 -0
  427. package/dist/components/motion/click-burst.js.map +1 -0
  428. package/dist/components/motion/collapsible.d.ts +4 -0
  429. package/dist/components/motion/collapsible.d.ts.map +1 -1
  430. package/dist/components/motion/collapsible.js +1 -1
  431. package/dist/components/motion/collapsible.js.map +1 -1
  432. package/dist/components/motion/color-picker.d.ts +7 -21
  433. package/dist/components/motion/color-picker.d.ts.map +1 -1
  434. package/dist/components/motion/color-picker.js +7 -95
  435. package/dist/components/motion/color-picker.js.map +1 -1
  436. package/dist/components/motion/color-selector.d.ts +5 -0
  437. package/dist/components/motion/color-selector.d.ts.map +1 -1
  438. package/dist/components/motion/color-selector.js.map +1 -1
  439. package/dist/components/motion/combobox/content.d.ts +3 -10
  440. package/dist/components/motion/combobox/content.d.ts.map +1 -1
  441. package/dist/components/motion/combobox/content.js +14 -80
  442. package/dist/components/motion/combobox/content.js.map +1 -1
  443. package/dist/components/motion/combobox/context.d.ts +3 -2
  444. package/dist/components/motion/combobox/context.js +1 -1
  445. package/dist/components/motion/combobox/list.d.ts +12 -0
  446. package/dist/components/motion/combobox/list.d.ts.map +1 -1
  447. package/dist/components/motion/combobox/list.js +4 -4
  448. package/dist/components/motion/combobox/list.js.map +1 -1
  449. package/dist/components/motion/combobox/listbox-panel.d.ts +2 -0
  450. package/dist/components/motion/combobox/listbox-panel.js +99 -0
  451. package/dist/components/motion/combobox/listbox-panel.js.map +1 -0
  452. package/dist/components/motion/combobox/trigger.d.ts +5 -0
  453. package/dist/components/motion/combobox/trigger.d.ts.map +1 -1
  454. package/dist/components/motion/combobox/trigger.js +10 -4
  455. package/dist/components/motion/combobox/trigger.js.map +1 -1
  456. package/dist/components/motion/combobox.d.ts +1 -1
  457. package/dist/components/motion/combobox.js +1 -1
  458. package/dist/components/motion/command-palette.d.ts +29 -1
  459. package/dist/components/motion/command-palette.d.ts.map +1 -1
  460. package/dist/components/motion/command-palette.js +282 -124
  461. package/dist/components/motion/command-palette.js.map +1 -1
  462. package/dist/components/motion/confetti.d.ts +23 -0
  463. package/dist/components/motion/confetti.d.ts.map +1 -0
  464. package/dist/components/motion/confetti.js +154 -0
  465. package/dist/components/motion/confetti.js.map +1 -0
  466. package/dist/components/motion/context-menu.d.ts +25 -0
  467. package/dist/components/motion/context-menu.d.ts.map +1 -1
  468. package/dist/components/motion/context-menu.js +110 -112
  469. package/dist/components/motion/context-menu.js.map +1 -1
  470. package/dist/components/motion/copy-button.d.ts +27 -0
  471. package/dist/components/motion/copy-button.d.ts.map +1 -0
  472. package/dist/components/motion/copy-button.js +129 -0
  473. package/dist/components/motion/copy-button.js.map +1 -0
  474. package/dist/components/motion/crash/crash-balloon.d.ts +2 -2
  475. package/dist/components/motion/crash/crash-balloon.js +2 -2
  476. package/dist/components/motion/crash/crash-balloon.js.map +1 -1
  477. package/dist/components/motion/crash/crash-parts.d.ts +2 -2
  478. package/dist/components/motion/crash/crash-parts.js +1 -1
  479. package/dist/components/motion/crash/crash-tower.d.ts +2 -2
  480. package/dist/components/motion/crash/crash-tower.js +3 -3
  481. package/dist/components/motion/crash/crash-tower.js.map +1 -1
  482. package/dist/components/motion/crash.d.ts +2 -2
  483. package/dist/components/motion/crash.js +1 -1
  484. package/dist/components/motion/cylinder-carousel.d.ts +6 -3
  485. package/dist/components/motion/cylinder-carousel.d.ts.map +1 -1
  486. package/dist/components/motion/cylinder-carousel.js +1 -1
  487. package/dist/components/motion/cylinder-carousel.js.map +1 -1
  488. package/dist/components/motion/date-range-picker/calendar-choices.d.ts +18 -0
  489. package/dist/components/motion/date-range-picker/calendar-choices.d.ts.map +1 -0
  490. package/dist/components/motion/date-range-picker/calendar-choices.js +62 -0
  491. package/dist/components/motion/date-range-picker/calendar-choices.js.map +1 -0
  492. package/dist/components/motion/date-range-picker/calendar-presence.d.ts +5 -0
  493. package/dist/components/motion/date-range-picker/calendar-presence.d.ts.map +1 -0
  494. package/dist/components/motion/date-range-picker/calendar-presence.js +14 -0
  495. package/dist/components/motion/date-range-picker/calendar-presence.js.map +1 -0
  496. package/dist/components/motion/date-range-picker/calendar.d.ts +8 -0
  497. package/dist/components/motion/date-range-picker/calendar.d.ts.map +1 -0
  498. package/dist/components/motion/date-range-picker/calendar.js +46 -0
  499. package/dist/components/motion/date-range-picker/calendar.js.map +1 -0
  500. package/dist/components/motion/date-range-picker/clear.d.ts +4 -0
  501. package/dist/components/motion/date-range-picker/clear.d.ts.map +1 -0
  502. package/dist/components/motion/date-range-picker/clear.js +23 -0
  503. package/dist/components/motion/date-range-picker/clear.js.map +1 -0
  504. package/dist/components/motion/date-range-picker/content.d.ts +7 -0
  505. package/dist/components/motion/date-range-picker/content.d.ts.map +1 -0
  506. package/dist/components/motion/date-range-picker/content.js +36 -0
  507. package/dist/components/motion/date-range-picker/content.js.map +1 -0
  508. package/dist/components/motion/date-range-picker/dropdown.d.ts +12 -0
  509. package/dist/components/motion/date-range-picker/dropdown.d.ts.map +1 -0
  510. package/dist/components/motion/date-range-picker/dropdown.js +26 -0
  511. package/dist/components/motion/date-range-picker/dropdown.js.map +1 -0
  512. package/dist/components/motion/date-range-picker/footer.d.ts +4 -0
  513. package/dist/components/motion/date-range-picker/footer.d.ts.map +1 -0
  514. package/dist/components/motion/date-range-picker/footer.js +20 -0
  515. package/dist/components/motion/date-range-picker/footer.js.map +1 -0
  516. package/dist/components/motion/date-range-picker/grid.d.ts +4 -0
  517. package/dist/components/motion/date-range-picker/grid.d.ts.map +1 -0
  518. package/dist/components/motion/date-range-picker/grid.js +132 -0
  519. package/dist/components/motion/date-range-picker/grid.js.map +1 -0
  520. package/dist/components/motion/date-range-picker/header.d.ts +4 -0
  521. package/dist/components/motion/date-range-picker/header.d.ts.map +1 -0
  522. package/dist/components/motion/date-range-picker/header.js +85 -0
  523. package/dist/components/motion/date-range-picker/header.js.map +1 -0
  524. package/dist/components/motion/date-range-picker/preset.d.ts +10 -0
  525. package/dist/components/motion/date-range-picker/preset.d.ts.map +1 -0
  526. package/dist/components/motion/date-range-picker/preset.js +25 -0
  527. package/dist/components/motion/date-range-picker/preset.js.map +1 -0
  528. package/dist/components/motion/date-range-picker/presets.d.ts +4 -0
  529. package/dist/components/motion/date-range-picker/presets.d.ts.map +1 -0
  530. package/dist/components/motion/date-range-picker/presets.js +22 -0
  531. package/dist/components/motion/date-range-picker/presets.js.map +1 -0
  532. package/dist/components/motion/date-range-picker/root.d.ts +4 -0
  533. package/dist/components/motion/date-range-picker/root.d.ts.map +1 -0
  534. package/dist/components/motion/date-range-picker/root.js +3 -0
  535. package/dist/components/motion/date-range-picker/selection.d.ts +4 -0
  536. package/dist/components/motion/date-range-picker/selection.d.ts.map +1 -0
  537. package/dist/components/motion/date-range-picker/selection.js +17 -0
  538. package/dist/components/motion/date-range-picker/selection.js.map +1 -0
  539. package/dist/components/motion/date-range-picker/summary.d.ts +4 -0
  540. package/dist/components/motion/date-range-picker/summary.d.ts.map +1 -0
  541. package/dist/components/motion/date-range-picker/summary.js +40 -0
  542. package/dist/components/motion/date-range-picker/summary.js.map +1 -0
  543. package/dist/components/motion/date-range-picker/trigger.d.ts +7 -0
  544. package/dist/components/motion/date-range-picker/trigger.d.ts.map +1 -0
  545. package/dist/components/motion/date-range-picker/trigger.js +74 -0
  546. package/dist/components/motion/date-range-picker/trigger.js.map +1 -0
  547. package/dist/components/motion/date-range-picker.d.ts +16 -116
  548. package/dist/components/motion/date-range-picker.d.ts.map +1 -1
  549. package/dist/components/motion/date-range-picker.js +14 -922
  550. package/dist/components/motion/date-range-picker.js.map +1 -1
  551. package/dist/components/motion/delete-button.d.ts +31 -0
  552. package/dist/components/motion/delete-button.d.ts.map +1 -0
  553. package/dist/components/motion/delete-button.js +263 -0
  554. package/dist/components/motion/delete-button.js.map +1 -0
  555. package/dist/components/motion/digit-swap.d.ts +3 -0
  556. package/dist/components/motion/digit-swap.d.ts.map +1 -1
  557. package/dist/components/motion/digit-swap.js.map +1 -1
  558. package/dist/components/motion/dock.d.ts +4 -0
  559. package/dist/components/motion/dock.d.ts.map +1 -1
  560. package/dist/components/motion/dock.js +2 -2
  561. package/dist/components/motion/dock.js.map +1 -1
  562. package/dist/components/motion/download-button.d.ts +29 -0
  563. package/dist/components/motion/download-button.d.ts.map +1 -0
  564. package/dist/components/motion/download-button.js +305 -0
  565. package/dist/components/motion/download-button.js.map +1 -0
  566. package/dist/components/motion/drawer.d.ts +9 -1
  567. package/dist/components/motion/drawer.d.ts.map +1 -1
  568. package/dist/components/motion/drawer.js +65 -15
  569. package/dist/components/motion/drawer.js.map +1 -1
  570. package/dist/components/motion/dropdown-menu/item-base.d.ts +37 -0
  571. package/dist/components/motion/dropdown-menu/item-base.d.ts.map +1 -0
  572. package/dist/components/motion/dropdown-menu/item-base.js +78 -0
  573. package/dist/components/motion/dropdown-menu/item-base.js.map +1 -0
  574. package/dist/components/motion/dropdown-menu/menu-panel.d.ts +31 -0
  575. package/dist/components/motion/dropdown-menu/menu-panel.d.ts.map +1 -0
  576. package/dist/components/motion/dropdown-menu/menu-panel.js +201 -0
  577. package/dist/components/motion/dropdown-menu/menu-panel.js.map +1 -0
  578. package/dist/components/motion/dropdown-menu.d.ts +30 -18
  579. package/dist/components/motion/dropdown-menu.d.ts.map +1 -1
  580. package/dist/components/motion/dropdown-menu.js +113 -421
  581. package/dist/components/motion/dropdown-menu.js.map +1 -1
  582. package/dist/components/motion/dynamic-island.d.ts +2 -0
  583. package/dist/components/motion/dynamic-island.d.ts.map +1 -1
  584. package/dist/components/motion/dynamic-island.js.map +1 -1
  585. package/dist/components/motion/expandable-action-bar.d.ts +28 -0
  586. package/dist/components/motion/expandable-action-bar.d.ts.map +1 -1
  587. package/dist/components/motion/expandable-action-bar.js +5 -14
  588. package/dist/components/motion/expandable-action-bar.js.map +1 -1
  589. package/dist/components/motion/expandable-control.d.ts +14 -0
  590. package/dist/components/motion/expandable-control.d.ts.map +1 -1
  591. package/dist/components/motion/expandable-control.js +1 -1
  592. package/dist/components/motion/expandable-control.js.map +1 -1
  593. package/dist/components/motion/expandable-tabs.d.ts +16 -1
  594. package/dist/components/motion/expandable-tabs.d.ts.map +1 -1
  595. package/dist/components/motion/expandable-tabs.js +3 -15
  596. package/dist/components/motion/expandable-tabs.js.map +1 -1
  597. package/dist/components/motion/expanding-arrow-button.d.ts +2 -0
  598. package/dist/components/motion/expanding-arrow-button.d.ts.map +1 -1
  599. package/dist/components/motion/expanding-arrow-button.js +3 -3
  600. package/dist/components/motion/expanding-arrow-button.js.map +1 -1
  601. package/dist/components/motion/feedback-widget.d.ts +6 -0
  602. package/dist/components/motion/feedback-widget.d.ts.map +1 -1
  603. package/dist/components/motion/feedback-widget.js +13 -29
  604. package/dist/components/motion/feedback-widget.js.map +1 -1
  605. package/dist/components/motion/file-tree.d.ts +24 -0
  606. package/dist/components/motion/file-tree.d.ts.map +1 -1
  607. package/dist/components/motion/file-tree.js +4 -4
  608. package/dist/components/motion/file-tree.js.map +1 -1
  609. package/dist/components/motion/file-upload.d.ts +34 -0
  610. package/dist/components/motion/file-upload.d.ts.map +1 -1
  611. package/dist/components/motion/file-upload.js +26 -17
  612. package/dist/components/motion/file-upload.js.map +1 -1
  613. package/dist/components/motion/follow-button.d.ts +31 -0
  614. package/dist/components/motion/follow-button.d.ts.map +1 -0
  615. package/dist/components/motion/follow-button.js +184 -0
  616. package/dist/components/motion/follow-button.js.map +1 -0
  617. package/dist/components/motion/hold-action-button.d.ts +7 -0
  618. package/dist/components/motion/hold-action-button.d.ts.map +1 -1
  619. package/dist/components/motion/hold-action-button.js +1 -1
  620. package/dist/components/motion/hold-action-button.js.map +1 -1
  621. package/dist/components/motion/infinite-masonry.d.ts +22 -0
  622. package/dist/components/motion/infinite-masonry.d.ts.map +1 -1
  623. package/dist/components/motion/infinite-masonry.js.map +1 -1
  624. package/dist/components/motion/input.d.ts +17 -0
  625. package/dist/components/motion/input.d.ts.map +1 -1
  626. package/dist/components/motion/input.js +2 -1
  627. package/dist/components/motion/input.js.map +1 -1
  628. package/dist/components/motion/knockout-bracket.d.ts +11 -4
  629. package/dist/components/motion/knockout-bracket.d.ts.map +1 -1
  630. package/dist/components/motion/knockout-bracket.js +30 -21
  631. package/dist/components/motion/knockout-bracket.js.map +1 -1
  632. package/dist/components/motion/knockout-wheel.d.ts +9 -3
  633. package/dist/components/motion/knockout-wheel.d.ts.map +1 -1
  634. package/dist/components/motion/knockout-wheel.js +5 -5
  635. package/dist/components/motion/knockout-wheel.js.map +1 -1
  636. package/dist/components/motion/like-button.d.ts +26 -0
  637. package/dist/components/motion/like-button.d.ts.map +1 -0
  638. package/dist/components/motion/like-button.js +128 -0
  639. package/dist/components/motion/like-button.js.map +1 -0
  640. package/dist/components/motion/loader.d.ts +1 -0
  641. package/dist/components/motion/loader.d.ts.map +1 -1
  642. package/dist/components/motion/loader.js.map +1 -1
  643. package/dist/components/motion/lock-toggle.d.ts +29 -0
  644. package/dist/components/motion/lock-toggle.d.ts.map +1 -0
  645. package/dist/components/motion/lock-toggle.js +252 -0
  646. package/dist/components/motion/lock-toggle.js.map +1 -0
  647. package/dist/components/motion/marquee.d.ts +6 -0
  648. package/dist/components/motion/marquee.d.ts.map +1 -1
  649. package/dist/components/motion/marquee.js.map +1 -1
  650. package/dist/components/motion/menu/menu-item-highlight.d.ts +16 -0
  651. package/dist/components/motion/menu/menu-item-highlight.d.ts.map +1 -0
  652. package/dist/components/motion/menu/menu-item-highlight.js +20 -0
  653. package/dist/components/motion/menu/menu-item-highlight.js.map +1 -0
  654. package/dist/components/motion/message-status.d.ts +26 -0
  655. package/dist/components/motion/message-status.d.ts.map +1 -0
  656. package/dist/components/motion/message-status.js +198 -0
  657. package/dist/components/motion/message-status.js.map +1 -0
  658. package/dist/components/motion/mines.d.ts +2 -1
  659. package/dist/components/motion/mines.d.ts.map +1 -1
  660. package/dist/components/motion/mines.js +3 -3
  661. package/dist/components/motion/mines.js.map +1 -1
  662. package/dist/components/motion/morphing-lightbox.d.ts +16 -0
  663. package/dist/components/motion/morphing-lightbox.d.ts.map +1 -1
  664. package/dist/components/motion/morphing-lightbox.js +3 -3
  665. package/dist/components/motion/morphing-lightbox.js.map +1 -1
  666. package/dist/components/motion/morphing-modal.d.ts +2 -0
  667. package/dist/components/motion/morphing-modal.d.ts.map +1 -1
  668. package/dist/components/motion/morphing-modal.js +14 -13
  669. package/dist/components/motion/morphing-modal.js.map +1 -1
  670. package/dist/components/motion/morphing-search-chips.d.ts +12 -0
  671. package/dist/components/motion/morphing-search-chips.d.ts.map +1 -1
  672. package/dist/components/motion/morphing-search-chips.js +6 -16
  673. package/dist/components/motion/morphing-search-chips.js.map +1 -1
  674. package/dist/components/motion/morphing-search.d.ts +16 -0
  675. package/dist/components/motion/morphing-search.d.ts.map +1 -1
  676. package/dist/components/motion/morphing-search.js +9 -13
  677. package/dist/components/motion/morphing-search.js.map +1 -1
  678. package/dist/components/motion/morphing-tabs.d.ts +20 -0
  679. package/dist/components/motion/morphing-tabs.d.ts.map +1 -1
  680. package/dist/components/motion/morphing-tabs.js.map +1 -1
  681. package/dist/components/motion/multi-select/content.d.ts +3 -10
  682. package/dist/components/motion/multi-select/content.d.ts.map +1 -1
  683. package/dist/components/motion/multi-select/content.js +14 -80
  684. package/dist/components/motion/multi-select/content.js.map +1 -1
  685. package/dist/components/motion/multi-select/context.d.ts +2 -2
  686. package/dist/components/motion/multi-select/context.js +1 -1
  687. package/dist/components/motion/multi-select/list.d.ts +12 -0
  688. package/dist/components/motion/multi-select/list.d.ts.map +1 -1
  689. package/dist/components/motion/multi-select/list.js +5 -5
  690. package/dist/components/motion/multi-select/list.js.map +1 -1
  691. package/dist/components/motion/multi-select/trigger.d.ts +6 -0
  692. package/dist/components/motion/multi-select/trigger.d.ts.map +1 -1
  693. package/dist/components/motion/multi-select/trigger.js +5 -4
  694. package/dist/components/motion/multi-select/trigger.js.map +1 -1
  695. package/dist/components/motion/{multi-select/index.d.ts → multi-select.d.ts} +4 -4
  696. package/dist/components/motion/{multi-select/index.js → multi-select.js} +4 -4
  697. package/dist/components/motion/mute-toggle.d.ts +25 -0
  698. package/dist/components/motion/mute-toggle.d.ts.map +1 -0
  699. package/dist/components/motion/mute-toggle.js +221 -0
  700. package/dist/components/motion/mute-toggle.js.map +1 -0
  701. package/dist/components/motion/not-found/glitch.js +2 -2
  702. package/dist/components/motion/not-found/glitch.js.map +1 -1
  703. package/dist/components/motion/not-found/magnetic.js +2 -2
  704. package/dist/components/motion/not-found/magnetic.js.map +1 -1
  705. package/dist/components/motion/not-found/shared.d.ts +7 -0
  706. package/dist/components/motion/not-found/shared.d.ts.map +1 -1
  707. package/dist/components/motion/not-found/shared.js.map +1 -1
  708. package/dist/components/motion/not-found/spotlight.js +4 -4
  709. package/dist/components/motion/not-found/spotlight.js.map +1 -1
  710. package/dist/components/motion/not-found/stacked.js +2 -2
  711. package/dist/components/motion/not-found/stacked.js.map +1 -1
  712. package/dist/components/motion/not-found/terminal.d.ts.map +1 -1
  713. package/dist/components/motion/not-found/terminal.js +1 -1
  714. package/dist/components/motion/not-found/terminal.js.map +1 -1
  715. package/dist/components/motion/notification-bell.d.ts +29 -0
  716. package/dist/components/motion/notification-bell.d.ts.map +1 -0
  717. package/dist/components/motion/notification-bell.js +274 -0
  718. package/dist/components/motion/notification-bell.js.map +1 -0
  719. package/dist/components/motion/notification-stack.d.ts +23 -0
  720. package/dist/components/motion/notification-stack.d.ts.map +1 -1
  721. package/dist/components/motion/notification-stack.js.map +1 -1
  722. package/dist/components/motion/number-ticker.d.ts +6 -1
  723. package/dist/components/motion/number-ticker.d.ts.map +1 -1
  724. package/dist/components/motion/number-ticker.js.map +1 -1
  725. package/dist/components/motion/otp-input.d.ts +6 -0
  726. package/dist/components/motion/otp-input.d.ts.map +1 -1
  727. package/dist/components/motion/otp-input.js +3 -7
  728. package/dist/components/motion/otp-input.js.map +1 -1
  729. package/dist/components/motion/overflow-actions.d.ts +26 -0
  730. package/dist/components/motion/overflow-actions.d.ts.map +1 -1
  731. package/dist/components/motion/overflow-actions.js.map +1 -1
  732. package/dist/components/motion/pagination.d.ts +4 -0
  733. package/dist/components/motion/pagination.d.ts.map +1 -1
  734. package/dist/components/motion/pagination.js +2 -2
  735. package/dist/components/motion/pagination.js.map +1 -1
  736. package/dist/components/motion/parallax.d.ts +2 -0
  737. package/dist/components/motion/parallax.d.ts.map +1 -1
  738. package/dist/components/motion/parallax.js.map +1 -1
  739. package/dist/components/motion/plinko.d.ts +1 -0
  740. package/dist/components/motion/plinko.d.ts.map +1 -1
  741. package/dist/components/motion/plinko.js +2 -2
  742. package/dist/components/motion/plinko.js.map +1 -1
  743. package/dist/components/motion/poll-vote.d.ts +39 -0
  744. package/dist/components/motion/poll-vote.d.ts.map +1 -0
  745. package/dist/components/motion/poll-vote.js +209 -0
  746. package/dist/components/motion/poll-vote.js.map +1 -0
  747. package/dist/components/motion/popover-morph.d.ts +2 -50
  748. package/dist/components/motion/popover-morph.js +4 -24
  749. package/dist/components/motion/popover-morph.js.map +1 -1
  750. package/dist/components/motion/popover.d.ts +5 -2
  751. package/dist/components/motion/popover.d.ts.map +1 -1
  752. package/dist/components/motion/popover.js +151 -99
  753. package/dist/components/motion/popover.js.map +1 -1
  754. package/dist/components/motion/prediction-market-card.d.ts +15 -0
  755. package/dist/components/motion/prediction-market-card.d.ts.map +1 -1
  756. package/dist/components/motion/prediction-market-card.js +8 -8
  757. package/dist/components/motion/prediction-market-card.js.map +1 -1
  758. package/dist/components/motion/prediction-market.d.ts +34 -0
  759. package/dist/components/motion/prediction-market.d.ts.map +1 -1
  760. package/dist/components/motion/prediction-market.js +10 -10
  761. package/dist/components/motion/prediction-market.js.map +1 -1
  762. package/dist/components/motion/preview-rail.d.ts +23 -0
  763. package/dist/components/motion/preview-rail.d.ts.map +1 -1
  764. package/dist/components/motion/preview-rail.js.map +1 -1
  765. package/dist/components/motion/project-folder.d.ts +16 -0
  766. package/dist/components/motion/project-folder.d.ts.map +1 -1
  767. package/dist/components/motion/project-folder.js +10 -40
  768. package/dist/components/motion/project-folder.js.map +1 -1
  769. package/dist/components/motion/pull-to-refresh.d.ts +8 -0
  770. package/dist/components/motion/pull-to-refresh.d.ts.map +1 -1
  771. package/dist/components/motion/pull-to-refresh.js +1 -1
  772. package/dist/components/motion/pull-to-refresh.js.map +1 -1
  773. package/dist/components/motion/qr-code.d.ts +42 -0
  774. package/dist/components/motion/qr-code.d.ts.map +1 -0
  775. package/dist/components/motion/qr-code.js +443 -0
  776. package/dist/components/motion/qr-code.js.map +1 -0
  777. package/dist/components/motion/radio.d.ts +10 -0
  778. package/dist/components/motion/radio.d.ts.map +1 -1
  779. package/dist/components/motion/radio.js.map +1 -1
  780. package/dist/components/motion/range-slider-bubble.d.ts +1 -0
  781. package/dist/components/motion/range-slider-bubble.d.ts.map +1 -1
  782. package/dist/components/motion/range-slider-bubble.js +4 -4
  783. package/dist/components/motion/range-slider-bubble.js.map +1 -1
  784. package/dist/components/motion/range-slider-fluid.d.ts +1 -0
  785. package/dist/components/motion/range-slider-fluid.d.ts.map +1 -1
  786. package/dist/components/motion/range-slider-fluid.js +2 -2
  787. package/dist/components/motion/range-slider-fluid.js.map +1 -1
  788. package/dist/components/motion/range-slider-inline.d.ts +1 -0
  789. package/dist/components/motion/range-slider-inline.d.ts.map +1 -1
  790. package/dist/components/motion/range-slider-inline.js +1 -1
  791. package/dist/components/motion/range-slider-inline.js.map +1 -1
  792. package/dist/components/motion/range-slider-ruler.d.ts +1 -0
  793. package/dist/components/motion/range-slider-ruler.d.ts.map +1 -1
  794. package/dist/components/motion/range-slider-ruler.js +3 -3
  795. package/dist/components/motion/range-slider-ruler.js.map +1 -1
  796. package/dist/components/motion/range-slider-wave.d.ts +1 -0
  797. package/dist/components/motion/range-slider-wave.d.ts.map +1 -1
  798. package/dist/components/motion/range-slider-wave.js +3 -3
  799. package/dist/components/motion/range-slider-wave.js.map +1 -1
  800. package/dist/components/motion/range-slider.d.ts +1 -0
  801. package/dist/components/motion/range-slider.d.ts.map +1 -1
  802. package/dist/components/motion/range-slider.js +2 -2
  803. package/dist/components/motion/range-slider.js.map +1 -1
  804. package/dist/components/motion/reaction-picker.d.ts +50 -0
  805. package/dist/components/motion/reaction-picker.d.ts.map +1 -0
  806. package/dist/components/motion/reaction-picker.js +516 -0
  807. package/dist/components/motion/reaction-picker.js.map +1 -0
  808. package/dist/components/motion/refresh-button.d.ts +24 -0
  809. package/dist/components/motion/refresh-button.d.ts.map +1 -0
  810. package/dist/components/motion/refresh-button.js +267 -0
  811. package/dist/components/motion/refresh-button.js.map +1 -0
  812. package/dist/components/motion/scroll-progress.d.ts +2 -0
  813. package/dist/components/motion/scroll-progress.d.ts.map +1 -1
  814. package/dist/components/motion/scroll-progress.js +1 -1
  815. package/dist/components/motion/scroll-progress.js.map +1 -1
  816. package/dist/components/motion/scroll-reveal.d.ts +2 -0
  817. package/dist/components/motion/scroll-reveal.d.ts.map +1 -1
  818. package/dist/components/motion/scroll-reveal.js.map +1 -1
  819. package/dist/components/motion/scroll-to.d.ts +2 -1
  820. package/dist/components/motion/scroll-to.d.ts.map +1 -1
  821. package/dist/components/motion/scroll-to.js +1 -1
  822. package/dist/components/motion/scroll-to.js.map +1 -1
  823. package/dist/components/motion/select-morph.d.ts +16 -2
  824. package/dist/components/motion/select-morph.d.ts.map +1 -1
  825. package/dist/components/motion/select-morph.js +148 -85
  826. package/dist/components/motion/select-morph.js.map +1 -1
  827. package/dist/components/motion/select.d.ts +16 -2
  828. package/dist/components/motion/select.d.ts.map +1 -1
  829. package/dist/components/motion/select.js +150 -61
  830. package/dist/components/motion/select.js.map +1 -1
  831. package/dist/components/motion/send-button.d.ts +23 -0
  832. package/dist/components/motion/send-button.d.ts.map +1 -0
  833. package/dist/components/motion/send-button.js +273 -0
  834. package/dist/components/motion/send-button.js.map +1 -0
  835. package/dist/components/motion/share-button.d.ts +45 -0
  836. package/dist/components/motion/share-button.d.ts.map +1 -0
  837. package/dist/components/motion/share-button.js +324 -0
  838. package/dist/components/motion/share-button.js.map +1 -0
  839. package/dist/components/motion/signup-form.d.ts +24 -2
  840. package/dist/components/motion/signup-form.d.ts.map +1 -1
  841. package/dist/components/motion/signup-form.js +3 -3
  842. package/dist/components/motion/signup-form.js.map +1 -1
  843. package/dist/components/motion/slide-action-button.d.ts +6 -0
  844. package/dist/components/motion/slide-action-button.d.ts.map +1 -1
  845. package/dist/components/motion/slide-action-button.js.map +1 -1
  846. package/dist/components/motion/slide-game.d.ts +2 -1
  847. package/dist/components/motion/slide-game.d.ts.map +1 -1
  848. package/dist/components/motion/slide-game.js +9 -9
  849. package/dist/components/motion/slide-game.js.map +1 -1
  850. package/dist/components/motion/smooth-scroll.d.ts +3 -1
  851. package/dist/components/motion/smooth-scroll.d.ts.map +1 -1
  852. package/dist/components/motion/smooth-scroll.js.map +1 -1
  853. package/dist/components/motion/sortable-list.d.ts +8 -0
  854. package/dist/components/motion/sortable-list.d.ts.map +1 -1
  855. package/dist/components/motion/sortable-list.js +2 -2
  856. package/dist/components/motion/sortable-list.js.map +1 -1
  857. package/dist/components/motion/star-rating.d.ts +35 -0
  858. package/dist/components/motion/star-rating.d.ts.map +1 -0
  859. package/dist/components/motion/star-rating.js +253 -0
  860. package/dist/components/motion/star-rating.js.map +1 -0
  861. package/dist/components/motion/status-icon.d.ts +31 -0
  862. package/dist/components/motion/status-icon.d.ts.map +1 -0
  863. package/dist/components/motion/status-icon.js +259 -0
  864. package/dist/components/motion/status-icon.js.map +1 -0
  865. package/dist/components/motion/swap/controls.d.ts +1 -1
  866. package/dist/components/motion/swap/controls.d.ts.map +1 -1
  867. package/dist/components/motion/swap/controls.js +20 -20
  868. package/dist/components/motion/swap/controls.js.map +1 -1
  869. package/dist/components/motion/swap/field.d.ts +1 -1
  870. package/dist/components/motion/swap/field.js +8 -7
  871. package/dist/components/motion/swap/field.js.map +1 -1
  872. package/dist/components/motion/swap/quote-row.d.ts +1 -1
  873. package/dist/components/motion/swap/quote-row.js +1 -1
  874. package/dist/components/motion/swap/quote-row.js.map +1 -1
  875. package/dist/components/motion/swap/token-badges.d.ts +1 -1
  876. package/dist/components/motion/swap/token-badges.js +5 -6
  877. package/dist/components/motion/swap/token-badges.js.map +1 -1
  878. package/dist/components/motion/swap/token-picker.d.ts +1 -1
  879. package/dist/components/motion/swap/token-picker.d.ts.map +1 -1
  880. package/dist/components/motion/swap/token-picker.js +21 -18
  881. package/dist/components/motion/swap/token-picker.js.map +1 -1
  882. package/dist/components/motion/swap.d.ts +7 -2
  883. package/dist/components/motion/swap.d.ts.map +1 -1
  884. package/dist/components/motion/swap.js +1 -1
  885. package/dist/components/motion/swap.js.map +1 -1
  886. package/dist/components/motion/swipeable-list.d.ts +38 -0
  887. package/dist/components/motion/swipeable-list.d.ts.map +1 -1
  888. package/dist/components/motion/swipeable-list.js.map +1 -1
  889. package/dist/components/motion/switch.d.ts +9 -1
  890. package/dist/components/motion/switch.d.ts.map +1 -1
  891. package/dist/components/motion/switch.js +11 -2
  892. package/dist/components/motion/switch.js.map +1 -1
  893. package/dist/components/motion/table/skeleton-rows.d.ts +1 -1
  894. package/dist/components/motion/table/table-header.d.ts +1 -1
  895. package/dist/components/motion/table/table-menu.d.ts.map +1 -1
  896. package/dist/components/motion/table/table-menu.js +15 -15
  897. package/dist/components/motion/table/table-menu.js.map +1 -1
  898. package/dist/components/motion/{table/index.d.ts → table.d.ts} +3 -3
  899. package/dist/components/motion/table.d.ts.map +1 -0
  900. package/dist/components/motion/{table/index.js → table.js} +10 -10
  901. package/dist/components/motion/table.js.map +1 -0
  902. package/dist/components/motion/tabs.d.ts +16 -4
  903. package/dist/components/motion/tabs.d.ts.map +1 -1
  904. package/dist/components/motion/tabs.js +23 -10
  905. package/dist/components/motion/tabs.js.map +1 -1
  906. package/dist/components/motion/text-cascade.d.ts +2 -1
  907. package/dist/components/motion/text-cascade.d.ts.map +1 -1
  908. package/dist/components/motion/text-cascade.js +1 -1
  909. package/dist/components/motion/text-cascade.js.map +1 -1
  910. package/dist/components/motion/text-morph.d.ts +16 -0
  911. package/dist/components/motion/text-morph.d.ts.map +1 -0
  912. package/dist/components/motion/text-morph.js +239 -0
  913. package/dist/components/motion/text-morph.js.map +1 -0
  914. package/dist/components/motion/text-reveal.d.ts +11 -0
  915. package/dist/components/motion/text-reveal.d.ts.map +1 -1
  916. package/dist/components/motion/text-reveal.js +1 -1
  917. package/dist/components/motion/text-reveal.js.map +1 -1
  918. package/dist/components/motion/text-scramble.d.ts +2 -0
  919. package/dist/components/motion/text-scramble.d.ts.map +1 -1
  920. package/dist/components/motion/text-scramble.js.map +1 -1
  921. package/dist/components/motion/text-shimmer.d.ts +3 -0
  922. package/dist/components/motion/text-shimmer.d.ts.map +1 -1
  923. package/dist/components/motion/text-shimmer.js.map +1 -1
  924. package/dist/components/motion/theme-toggle.d.ts +3 -0
  925. package/dist/components/motion/theme-toggle.d.ts.map +1 -1
  926. package/dist/components/motion/theme-toggle.js +4 -3
  927. package/dist/components/motion/theme-toggle.js.map +1 -1
  928. package/dist/components/motion/tilt-card.d.ts +3 -0
  929. package/dist/components/motion/tilt-card.d.ts.map +1 -1
  930. package/dist/components/motion/tilt-card.js.map +1 -1
  931. package/dist/components/motion/timeline.d.ts +7 -0
  932. package/dist/components/motion/timeline.d.ts.map +1 -1
  933. package/dist/components/motion/timeline.js.map +1 -1
  934. package/dist/components/motion/tooltip/positioner.d.ts +1 -1
  935. package/dist/components/motion/tooltip/positioner.js +1 -1
  936. package/dist/components/motion/tooltip-surface.d.ts +6 -1
  937. package/dist/components/motion/tooltip-surface.d.ts.map +1 -1
  938. package/dist/components/motion/tooltip-surface.js +34 -24
  939. package/dist/components/motion/tooltip-surface.js.map +1 -1
  940. package/dist/components/motion/tooltip.d.ts +7 -1
  941. package/dist/components/motion/tooltip.d.ts.map +1 -1
  942. package/dist/components/motion/tooltip.js +1 -1
  943. package/dist/components/motion/upvote-button.d.ts +30 -0
  944. package/dist/components/motion/upvote-button.d.ts.map +1 -0
  945. package/dist/components/motion/upvote-button.js +144 -0
  946. package/dist/components/motion/upvote-button.js.map +1 -0
  947. package/dist/components/motion/wallet-card/account-avatar.d.ts +1 -1
  948. package/dist/components/motion/wallet-card/account-switcher.d.ts +2 -2
  949. package/dist/components/motion/wallet-card/account-switcher.js +7 -7
  950. package/dist/components/motion/wallet-card/account-switcher.js.map +1 -1
  951. package/dist/components/motion/wallet-card/balance-delta.js +1 -1
  952. package/dist/components/motion/wallet-card/balance-delta.js.map +1 -1
  953. package/dist/components/motion/wallet-card/copy-button.js +1 -1
  954. package/dist/components/motion/wallet-card/copy-button.js.map +1 -1
  955. package/dist/components/motion/wallet-card/search-bar.d.ts +1 -1
  956. package/dist/components/motion/wallet-card/search-bar.js +8 -8
  957. package/dist/components/motion/wallet-card/search-bar.js.map +1 -1
  958. package/dist/components/motion/{wallet-card/index.d.ts → wallet-card.d.ts} +4 -4
  959. package/dist/components/motion/wallet-card.d.ts.map +1 -0
  960. package/dist/components/motion/{wallet-card/index.js → wallet-card.js} +11 -11
  961. package/dist/components/motion/wallet-card.js.map +1 -0
  962. package/dist/components/motion/wave-reveal.d.ts +25 -0
  963. package/dist/components/motion/wave-reveal.d.ts.map +1 -0
  964. package/dist/components/motion/wave-reveal.js +630 -0
  965. package/dist/components/motion/wave-reveal.js.map +1 -0
  966. package/dist/components/motion/wheel-picker.d.ts +7 -0
  967. package/dist/components/motion/wheel-picker.d.ts.map +1 -1
  968. package/dist/components/motion/wheel-picker.js +12 -2
  969. package/dist/components/motion/wheel-picker.js.map +1 -1
  970. package/dist/components/reui/autocomplete.d.ts +1 -1
  971. package/dist/components/reui/badge.d.ts +2 -2
  972. package/dist/components/reui/color-picker.js +1 -1
  973. package/dist/components/reui/color-picker.js.map +1 -1
  974. package/dist/components/reui/file-type.d.ts +1 -1
  975. package/dist/components/reui/filters/filters-advanced.js.map +1 -1
  976. package/dist/components/reui/frame.d.ts +2 -2
  977. package/dist/components/reui/frame.js +1 -1
  978. package/dist/components/reui/frame.js.map +1 -1
  979. package/dist/components/reui/icon-tile.d.ts +2 -2
  980. package/dist/components/reui/number-field.d.ts +3 -3
  981. package/dist/components/reui/rating.d.ts +1 -1
  982. package/dist/components/ui/attachment.d.ts +3 -3
  983. package/dist/components/ui/badge.d.ts +1 -1
  984. package/dist/components/ui/bubble.d.ts +1 -1
  985. package/dist/components/ui/button-group.d.ts +1 -1
  986. package/dist/components/ui/button.d.ts +2 -2
  987. package/dist/components/ui/calendar.js +1 -1
  988. package/dist/components/ui/calendar.js.map +1 -1
  989. package/dist/components/ui/card.js +1 -1
  990. package/dist/components/ui/card.js.map +1 -1
  991. package/dist/components/ui/combobox.js +2 -2
  992. package/dist/components/ui/combobox.js.map +1 -1
  993. package/dist/components/ui/field.d.ts +1 -1
  994. package/dist/components/ui/input-group.d.ts +2 -2
  995. package/dist/components/ui/item.d.ts +2 -2
  996. package/dist/components/ui/marker.d.ts +1 -1
  997. package/dist/components/ui/questionnaire.js +2 -2
  998. package/dist/components/ui/questionnaire.js.map +1 -1
  999. package/dist/components/ui/sidebar.d.ts +1 -1
  1000. package/dist/components/ui/sidebar.js +1 -1
  1001. package/dist/components/ui/sidebar.js.map +1 -1
  1002. package/dist/components/ui/toggle-group.js +1 -1
  1003. package/dist/components/ui/toggle-group.js.map +1 -1
  1004. package/dist/components/ui/toggle.d.ts +1 -1
  1005. package/dist/components/ui/trace.js +1 -1
  1006. package/dist/components/ui/trace.js.map +1 -1
  1007. package/dist/{constants-CggcOqef.js → constants-DfbfCDSg.js} +3 -6
  1008. package/dist/constants-DfbfCDSg.js.map +1 -0
  1009. package/dist/{context-BrGWrRwa.d.ts → context-4tt2I7Qm.d.ts} +14 -4
  1010. package/dist/context-4tt2I7Qm.d.ts.map +1 -0
  1011. package/dist/{context-DWHy9EUW.js → context-B3BNuwGu.js} +8 -25
  1012. package/dist/context-B3BNuwGu.js.map +1 -0
  1013. package/dist/{context-BEYROlTB.d.ts → context-BFNkGCGz.d.ts} +18 -14
  1014. package/dist/context-BFNkGCGz.d.ts.map +1 -0
  1015. package/dist/{context-r3QNWoPh.js → context-BG1Wzdnj.js} +6 -10
  1016. package/dist/context-BG1Wzdnj.js.map +1 -0
  1017. package/dist/{context-Dae38FV_.js → context-Bx-OaIL8.js} +5 -9
  1018. package/dist/context-Bx-OaIL8.js.map +1 -0
  1019. package/dist/context-C92iQeLO.js.map +1 -1
  1020. package/dist/{context-CmexbpIK.js → context-C9LHO4MN.js} +12 -27
  1021. package/dist/context-C9LHO4MN.js.map +1 -0
  1022. package/dist/context-CHXHCbuu.js.map +1 -1
  1023. package/dist/{context-C5DO1oe1.js → context-CIzAPhXA.js} +37 -99
  1024. package/dist/context-CIzAPhXA.js.map +1 -0
  1025. package/dist/{context-B5NItr9C.d.ts → context-CP3spicY.d.ts} +20 -15
  1026. package/dist/context-CP3spicY.d.ts.map +1 -0
  1027. package/dist/{context-CwSk1WZR.js → context-Cg1VelQJ.js} +9 -25
  1028. package/dist/context-Cg1VelQJ.js.map +1 -0
  1029. package/dist/{context-C1Z_5vew.d.ts → context-Cyjsttyl.d.ts} +15 -4
  1030. package/dist/context-Cyjsttyl.d.ts.map +1 -0
  1031. package/dist/{context-CgRa89Bq.d.ts → context-D7eAawR3.d.ts} +12 -7
  1032. package/dist/context-D7eAawR3.d.ts.map +1 -0
  1033. package/dist/{context-BpHX6J1T.js → context-DDoVOc0D.js} +8 -25
  1034. package/dist/context-DDoVOc0D.js.map +1 -0
  1035. package/dist/context-DR6jkfea.js +11 -0
  1036. package/dist/context-DR6jkfea.js.map +1 -0
  1037. package/dist/{context-BLjAwZ5V.js → context-DcJtX6ht.js} +18 -95
  1038. package/dist/context-DcJtX6ht.js.map +1 -0
  1039. package/dist/{context-Cr2SLhVi.js → context-Dg48xMuG.js} +3 -7
  1040. package/dist/context-Dg48xMuG.js.map +1 -0
  1041. package/dist/context-DnM-b9yO.js +23 -0
  1042. package/dist/context-DnM-b9yO.js.map +1 -0
  1043. package/dist/context-DtFeYksF.d.ts +28 -0
  1044. package/dist/context-DtFeYksF.d.ts.map +1 -0
  1045. package/dist/{context-C8M88I1F.js → context-cRAJSFxf.js} +4 -8
  1046. package/dist/context-cRAJSFxf.js.map +1 -0
  1047. package/dist/{copy-menu-BizTEv8v.js → copy-menu-Di77fZ9p.js} +6 -6
  1048. package/dist/copy-menu-Di77fZ9p.js.map +1 -0
  1049. package/dist/{crash-parts-Dg5WC8u4.js → crash-parts-BkrZ6iBE.js} +2 -2
  1050. package/dist/crash-parts-BkrZ6iBE.js.map +1 -0
  1051. package/dist/date-utils-DVDYcEA_.js +35 -0
  1052. package/dist/date-utils-DVDYcEA_.js.map +1 -0
  1053. package/dist/{ease-DnPhwGe6.d.ts → ease-D_-bhUDt.d.ts} +13 -6
  1054. package/dist/ease-D_-bhUDt.d.ts.map +1 -0
  1055. package/dist/formats-ColrL9Eg.js +58 -0
  1056. package/dist/formats-ColrL9Eg.js.map +1 -0
  1057. package/dist/{game-parts-hATtqY3s.d.ts → game-parts-B635BoSe.d.ts} +4 -4
  1058. package/dist/{game-parts-hATtqY3s.d.ts.map → game-parts-B635BoSe.d.ts.map} +1 -1
  1059. package/dist/hooks/use-controllable.d.ts +10 -0
  1060. package/dist/hooks/use-controllable.d.ts.map +1 -0
  1061. package/dist/hooks/use-controllable.js +39 -0
  1062. package/dist/hooks/use-controllable.js.map +1 -0
  1063. package/dist/hooks/use-copy.d.ts +16 -0
  1064. package/dist/hooks/use-copy.d.ts.map +1 -0
  1065. package/dist/hooks/use-copy.js +36 -0
  1066. package/dist/hooks/use-copy.js.map +1 -0
  1067. package/dist/hooks/use-dismiss.d.ts +25 -5
  1068. package/dist/hooks/use-dismiss.d.ts.map +1 -1
  1069. package/dist/hooks/use-dismiss.js +39 -24
  1070. package/dist/hooks/use-dismiss.js.map +1 -1
  1071. package/dist/hooks/use-focus-trap.d.ts +4 -3
  1072. package/dist/hooks/use-focus-trap.d.ts.map +1 -1
  1073. package/dist/hooks/use-focus-trap.js +25 -37
  1074. package/dist/hooks/use-focus-trap.js.map +1 -1
  1075. package/dist/hooks/use-highlighted-code.d.ts +1 -1
  1076. package/dist/hooks/use-highlighted-code.d.ts.map +1 -1
  1077. package/dist/hooks/use-hover-capable.d.ts +1 -1
  1078. package/dist/hooks/use-hover-capable.js +1 -1
  1079. package/dist/hooks/use-hover-capable.js.map +1 -1
  1080. package/dist/hooks/use-hover-gesture.d.ts +5 -5
  1081. package/dist/hooks/use-hover-gesture.js +5 -5
  1082. package/dist/hooks/use-hover-gesture.js.map +1 -1
  1083. package/dist/hooks/use-listbox.d.ts +1 -0
  1084. package/dist/hooks/use-listbox.js +2 -1
  1085. package/dist/hooks/use-listbox.js.map +1 -1
  1086. package/dist/hooks/use-modal-scope.js +22 -26
  1087. package/dist/hooks/use-modal-scope.js.map +1 -1
  1088. package/dist/hooks/use-on-open.d.ts +3 -3
  1089. package/dist/hooks/use-on-open.js +3 -3
  1090. package/dist/hooks/use-on-open.js.map +1 -1
  1091. package/dist/hooks/use-row-cursor.d.ts +2 -2
  1092. package/dist/hooks/use-row-cursor.js +2 -2
  1093. package/dist/hooks/use-row-cursor.js.map +1 -1
  1094. package/dist/hooks/use-slider.d.ts +13 -3
  1095. package/dist/hooks/use-slider.d.ts.map +1 -1
  1096. package/dist/hooks/use-slider.js +23 -4
  1097. package/dist/hooks/use-slider.js.map +1 -1
  1098. package/dist/hooks/use-status-open.d.ts +26 -0
  1099. package/dist/hooks/use-status-open.d.ts.map +1 -0
  1100. package/dist/hooks/use-status-open.js +43 -0
  1101. package/dist/hooks/use-status-open.js.map +1 -0
  1102. package/dist/hooks/use-tap-gesture.d.ts +3 -3
  1103. package/dist/hooks/use-tap-gesture.js +3 -3
  1104. package/dist/hooks/use-tap-gesture.js.map +1 -1
  1105. package/dist/lib/audio-context.d.ts +27 -1
  1106. package/dist/lib/audio-context.d.ts.map +1 -1
  1107. package/dist/lib/audio-context.js +61 -2
  1108. package/dist/lib/audio-context.js.map +1 -1
  1109. package/dist/lib/book-sounds.d.ts.map +1 -1
  1110. package/dist/lib/book-sounds.js +8 -9
  1111. package/dist/lib/book-sounds.js.map +1 -1
  1112. package/dist/lib/color.d.ts +29 -0
  1113. package/dist/lib/color.d.ts.map +1 -0
  1114. package/dist/lib/color.js +93 -0
  1115. package/dist/lib/color.js.map +1 -0
  1116. package/dist/lib/command-search.d.ts +7 -1
  1117. package/dist/lib/command-search.d.ts.map +1 -1
  1118. package/dist/lib/command-search.js +42 -19
  1119. package/dist/lib/command-search.js.map +1 -1
  1120. package/dist/lib/ease.d.ts +2 -2
  1121. package/dist/lib/ease.js +12 -5
  1122. package/dist/lib/ease.js.map +1 -1
  1123. package/dist/lib/focusable.d.ts +10 -0
  1124. package/dist/lib/focusable.d.ts.map +1 -1
  1125. package/dist/lib/focusable.js +31 -1
  1126. package/dist/lib/focusable.js.map +1 -1
  1127. package/dist/lib/game-sounds.d.ts.map +1 -1
  1128. package/dist/lib/game-sounds.js +7 -14
  1129. package/dist/lib/game-sounds.js.map +1 -1
  1130. package/dist/lib/layers.d.ts +24 -0
  1131. package/dist/lib/layers.d.ts.map +1 -0
  1132. package/dist/lib/layers.js +47 -0
  1133. package/dist/lib/layers.js.map +1 -0
  1134. package/dist/lib/merge-refs.d.ts +6 -0
  1135. package/dist/lib/merge-refs.d.ts.map +1 -0
  1136. package/dist/lib/merge-refs.js +15 -0
  1137. package/dist/lib/merge-refs.js.map +1 -0
  1138. package/dist/lib/presence-gate.d.ts +2 -2
  1139. package/dist/lib/presence-gate.js.map +1 -1
  1140. package/dist/lib/scroll-lock.d.ts +13 -0
  1141. package/dist/lib/scroll-lock.d.ts.map +1 -0
  1142. package/dist/lib/scroll-lock.js +59 -0
  1143. package/dist/lib/scroll-lock.js.map +1 -0
  1144. package/dist/lib/sound.d.ts +30 -0
  1145. package/dist/lib/sound.d.ts.map +1 -0
  1146. package/dist/lib/sound.js +95 -0
  1147. package/dist/lib/sound.js.map +1 -0
  1148. package/dist/lib/sounds/bell.d.ts +4 -0
  1149. package/dist/lib/sounds/bell.d.ts.map +1 -0
  1150. package/dist/lib/sounds/bell.js +36 -0
  1151. package/dist/lib/sounds/bell.js.map +1 -0
  1152. package/dist/lib/sounds/bubble.d.ts +4 -0
  1153. package/dist/lib/sounds/bubble.d.ts.map +1 -0
  1154. package/dist/lib/sounds/bubble.js +27 -0
  1155. package/dist/lib/sounds/bubble.js.map +1 -0
  1156. package/dist/lib/sounds/burst.d.ts +4 -0
  1157. package/dist/lib/sounds/burst.d.ts.map +1 -0
  1158. package/dist/lib/sounds/burst.js +45 -0
  1159. package/dist/lib/sounds/burst.js.map +1 -0
  1160. package/dist/lib/sounds/buzz.d.ts +4 -0
  1161. package/dist/lib/sounds/buzz.d.ts.map +1 -0
  1162. package/dist/lib/sounds/buzz.js +26 -0
  1163. package/dist/lib/sounds/buzz.js.map +1 -0
  1164. package/dist/lib/sounds/camera.d.ts +4 -0
  1165. package/dist/lib/sounds/camera.d.ts.map +1 -0
  1166. package/dist/lib/sounds/camera.js +40 -0
  1167. package/dist/lib/sounds/camera.js.map +1 -0
  1168. package/dist/lib/sounds/check.d.ts +4 -0
  1169. package/dist/lib/sounds/check.d.ts.map +1 -0
  1170. package/dist/lib/sounds/check.js +40 -0
  1171. package/dist/lib/sounds/check.js.map +1 -0
  1172. package/dist/lib/sounds/chime.d.ts +4 -0
  1173. package/dist/lib/sounds/chime.d.ts.map +1 -0
  1174. package/dist/lib/sounds/chime.js +33 -0
  1175. package/dist/lib/sounds/chime.js.map +1 -0
  1176. package/dist/lib/sounds/close.d.ts +4 -0
  1177. package/dist/lib/sounds/close.d.ts.map +1 -0
  1178. package/dist/lib/sounds/close.js +36 -0
  1179. package/dist/lib/sounds/close.js.map +1 -0
  1180. package/dist/lib/sounds/coin.d.ts +4 -0
  1181. package/dist/lib/sounds/coin.d.ts.map +1 -0
  1182. package/dist/lib/sounds/coin.js +31 -0
  1183. package/dist/lib/sounds/coin.js.map +1 -0
  1184. package/dist/lib/sounds/collapse.d.ts +4 -0
  1185. package/dist/lib/sounds/collapse.d.ts.map +1 -0
  1186. package/dist/lib/sounds/collapse.js +41 -0
  1187. package/dist/lib/sounds/collapse.js.map +1 -0
  1188. package/dist/lib/sounds/connect.d.ts +4 -0
  1189. package/dist/lib/sounds/connect.d.ts.map +1 -0
  1190. package/dist/lib/sounds/connect.js +39 -0
  1191. package/dist/lib/sounds/connect.js.map +1 -0
  1192. package/dist/lib/sounds/copy.d.ts +4 -0
  1193. package/dist/lib/sounds/copy.d.ts.map +1 -0
  1194. package/dist/lib/sounds/copy.js +39 -0
  1195. package/dist/lib/sounds/copy.js.map +1 -0
  1196. package/dist/lib/sounds/delete.d.ts +4 -0
  1197. package/dist/lib/sounds/delete.d.ts.map +1 -0
  1198. package/dist/lib/sounds/delete.js +39 -0
  1199. package/dist/lib/sounds/delete.js.map +1 -0
  1200. package/dist/lib/sounds/disconnect.d.ts +4 -0
  1201. package/dist/lib/sounds/disconnect.d.ts.map +1 -0
  1202. package/dist/lib/sounds/disconnect.js +39 -0
  1203. package/dist/lib/sounds/disconnect.js.map +1 -0
  1204. package/dist/lib/sounds/dismiss.d.ts +4 -0
  1205. package/dist/lib/sounds/dismiss.d.ts.map +1 -0
  1206. package/dist/lib/sounds/dismiss.js +27 -0
  1207. package/dist/lib/sounds/dismiss.js.map +1 -0
  1208. package/dist/lib/sounds/dock.d.ts +4 -0
  1209. package/dist/lib/sounds/dock.d.ts.map +1 -0
  1210. package/dist/lib/sounds/dock.js +32 -0
  1211. package/dist/lib/sounds/dock.js.map +1 -0
  1212. package/dist/lib/sounds/drop.d.ts +4 -0
  1213. package/dist/lib/sounds/drop.d.ts.map +1 -0
  1214. package/dist/lib/sounds/drop.js +48 -0
  1215. package/dist/lib/sounds/drop.js.map +1 -0
  1216. package/dist/lib/sounds/engine.d.ts +142 -0
  1217. package/dist/lib/sounds/engine.d.ts.map +1 -0
  1218. package/dist/lib/sounds/engine.js +210 -0
  1219. package/dist/lib/sounds/engine.js.map +1 -0
  1220. package/dist/lib/sounds/error.d.ts +4 -0
  1221. package/dist/lib/sounds/error.d.ts.map +1 -0
  1222. package/dist/lib/sounds/error.js +51 -0
  1223. package/dist/lib/sounds/error.js.map +1 -0
  1224. package/dist/lib/sounds/expand.d.ts +4 -0
  1225. package/dist/lib/sounds/expand.d.ts.map +1 -0
  1226. package/dist/lib/sounds/expand.js +28 -0
  1227. package/dist/lib/sounds/expand.js.map +1 -0
  1228. package/dist/lib/sounds/heart.d.ts +4 -0
  1229. package/dist/lib/sounds/heart.d.ts.map +1 -0
  1230. package/dist/lib/sounds/heart.js +39 -0
  1231. package/dist/lib/sounds/heart.js.map +1 -0
  1232. package/dist/lib/sounds/lift.d.ts +4 -0
  1233. package/dist/lib/sounds/lift.d.ts.map +1 -0
  1234. package/dist/lib/sounds/lift.js +34 -0
  1235. package/dist/lib/sounds/lift.js.map +1 -0
  1236. package/dist/lib/sounds/lock.d.ts +4 -0
  1237. package/dist/lib/sounds/lock.d.ts.map +1 -0
  1238. package/dist/lib/sounds/lock.js +32 -0
  1239. package/dist/lib/sounds/lock.js.map +1 -0
  1240. package/dist/lib/sounds/navigate.d.ts +4 -0
  1241. package/dist/lib/sounds/navigate.d.ts.map +1 -0
  1242. package/dist/lib/sounds/navigate.js +36 -0
  1243. package/dist/lib/sounds/navigate.js.map +1 -0
  1244. package/dist/lib/sounds/notify.d.ts +4 -0
  1245. package/dist/lib/sounds/notify.d.ts.map +1 -0
  1246. package/dist/lib/sounds/notify.js +31 -0
  1247. package/dist/lib/sounds/notify.js.map +1 -0
  1248. package/dist/lib/sounds/open.d.ts +4 -0
  1249. package/dist/lib/sounds/open.d.ts.map +1 -0
  1250. package/dist/lib/sounds/open.js +36 -0
  1251. package/dist/lib/sounds/open.js.map +1 -0
  1252. package/dist/lib/sounds/ping.d.ts +4 -0
  1253. package/dist/lib/sounds/ping.d.ts.map +1 -0
  1254. package/dist/lib/sounds/ping.js +30 -0
  1255. package/dist/lib/sounds/ping.js.map +1 -0
  1256. package/dist/lib/sounds/pop.d.ts +4 -0
  1257. package/dist/lib/sounds/pop.d.ts.map +1 -0
  1258. package/dist/lib/sounds/pop.js +27 -0
  1259. package/dist/lib/sounds/pop.js.map +1 -0
  1260. package/dist/lib/sounds/press.d.ts +4 -0
  1261. package/dist/lib/sounds/press.d.ts.map +1 -0
  1262. package/dist/lib/sounds/press.js +40 -0
  1263. package/dist/lib/sounds/press.js.map +1 -0
  1264. package/dist/lib/sounds/receive.d.ts +4 -0
  1265. package/dist/lib/sounds/receive.d.ts.map +1 -0
  1266. package/dist/lib/sounds/receive.js +39 -0
  1267. package/dist/lib/sounds/receive.js.map +1 -0
  1268. package/dist/lib/sounds/refresh.d.ts +4 -0
  1269. package/dist/lib/sounds/refresh.d.ts.map +1 -0
  1270. package/dist/lib/sounds/refresh.js +34 -0
  1271. package/dist/lib/sounds/refresh.js.map +1 -0
  1272. package/dist/lib/sounds/reveal.d.ts +4 -0
  1273. package/dist/lib/sounds/reveal.d.ts.map +1 -0
  1274. package/dist/lib/sounds/reveal.js +34 -0
  1275. package/dist/lib/sounds/reveal.js.map +1 -0
  1276. package/dist/lib/sounds/select.d.ts +4 -0
  1277. package/dist/lib/sounds/select.d.ts.map +1 -0
  1278. package/dist/lib/sounds/select.js +32 -0
  1279. package/dist/lib/sounds/select.js.map +1 -0
  1280. package/dist/lib/sounds/send.d.ts +4 -0
  1281. package/dist/lib/sounds/send.d.ts.map +1 -0
  1282. package/dist/lib/sounds/send.js +35 -0
  1283. package/dist/lib/sounds/send.js.map +1 -0
  1284. package/dist/lib/sounds/shutter.d.ts +4 -0
  1285. package/dist/lib/sounds/shutter.d.ts.map +1 -0
  1286. package/dist/lib/sounds/shutter.js +40 -0
  1287. package/dist/lib/sounds/shutter.js.map +1 -0
  1288. package/dist/lib/sounds/snap.d.ts +4 -0
  1289. package/dist/lib/sounds/snap.d.ts.map +1 -0
  1290. package/dist/lib/sounds/snap.js +33 -0
  1291. package/dist/lib/sounds/snap.js.map +1 -0
  1292. package/dist/lib/sounds/star.d.ts +4 -0
  1293. package/dist/lib/sounds/star.d.ts.map +1 -0
  1294. package/dist/lib/sounds/star.js +38 -0
  1295. package/dist/lib/sounds/star.js.map +1 -0
  1296. package/dist/lib/sounds/success.d.ts +4 -0
  1297. package/dist/lib/sounds/success.d.ts.map +1 -0
  1298. package/dist/lib/sounds/success.js +39 -0
  1299. package/dist/lib/sounds/success.js.map +1 -0
  1300. package/dist/lib/sounds/swipe.d.ts +4 -0
  1301. package/dist/lib/sounds/swipe.d.ts.map +1 -0
  1302. package/dist/lib/sounds/swipe.js +29 -0
  1303. package/dist/lib/sounds/swipe.js.map +1 -0
  1304. package/dist/lib/sounds/switch.d.ts +4 -0
  1305. package/dist/lib/sounds/switch.d.ts.map +1 -0
  1306. package/dist/lib/sounds/switch.js +40 -0
  1307. package/dist/lib/sounds/switch.js.map +1 -0
  1308. package/dist/lib/sounds/tap.d.ts +4 -0
  1309. package/dist/lib/sounds/tap.d.ts.map +1 -0
  1310. package/dist/lib/sounds/tap.js +33 -0
  1311. package/dist/lib/sounds/tap.js.map +1 -0
  1312. package/dist/lib/sounds/tick.d.ts +4 -0
  1313. package/dist/lib/sounds/tick.d.ts.map +1 -0
  1314. package/dist/lib/sounds/tick.js +26 -0
  1315. package/dist/lib/sounds/tick.js.map +1 -0
  1316. package/dist/lib/sounds/timer.d.ts +4 -0
  1317. package/dist/lib/sounds/timer.d.ts.map +1 -0
  1318. package/dist/lib/sounds/timer.js +26 -0
  1319. package/dist/lib/sounds/timer.js.map +1 -0
  1320. package/dist/lib/sounds/toggle.d.ts +6 -0
  1321. package/dist/lib/sounds/toggle.d.ts.map +1 -0
  1322. package/dist/lib/sounds/toggle.js +79 -0
  1323. package/dist/lib/sounds/toggle.js.map +1 -0
  1324. package/dist/lib/sounds/trash.d.ts +4 -0
  1325. package/dist/lib/sounds/trash.d.ts.map +1 -0
  1326. package/dist/lib/sounds/trash.js +40 -0
  1327. package/dist/lib/sounds/trash.js.map +1 -0
  1328. package/dist/lib/sounds/type.d.ts +4 -0
  1329. package/dist/lib/sounds/type.d.ts.map +1 -0
  1330. package/dist/lib/sounds/type.js +35 -0
  1331. package/dist/lib/sounds/type.js.map +1 -0
  1332. package/dist/lib/sounds/unlock.d.ts +4 -0
  1333. package/dist/lib/sounds/unlock.d.ts.map +1 -0
  1334. package/dist/lib/sounds/unlock.js +41 -0
  1335. package/dist/lib/sounds/unlock.js.map +1 -0
  1336. package/dist/lib/sounds/warning.d.ts +4 -0
  1337. package/dist/lib/sounds/warning.d.ts.map +1 -0
  1338. package/dist/lib/sounds/warning.js +29 -0
  1339. package/dist/lib/sounds/warning.js.map +1 -0
  1340. package/dist/lib/sounds/whisper.d.ts +4 -0
  1341. package/dist/lib/sounds/whisper.d.ts.map +1 -0
  1342. package/dist/lib/sounds/whisper.js +27 -0
  1343. package/dist/lib/sounds/whisper.js.map +1 -0
  1344. package/dist/lib/text-shimmer.d.ts +6 -0
  1345. package/dist/lib/text-shimmer.d.ts.map +1 -1
  1346. package/dist/lib/text-shimmer.js +7 -1
  1347. package/dist/lib/text-shimmer.js.map +1 -1
  1348. package/dist/lib/tick-sound.d.ts.map +1 -1
  1349. package/dist/lib/tick-sound.js +8 -11
  1350. package/dist/lib/tick-sound.js.map +1 -1
  1351. package/dist/lib/touch.d.ts +10 -10
  1352. package/dist/lib/touch.js +10 -10
  1353. package/dist/lib/touch.js.map +1 -1
  1354. package/dist/listbox-panel-BX74YCzI.d.ts +31 -0
  1355. package/dist/listbox-panel-BX74YCzI.d.ts.map +1 -0
  1356. package/dist/menu-button-CbEYps6k.d.ts +29 -0
  1357. package/dist/menu-button-CbEYps6k.d.ts.map +1 -0
  1358. package/dist/menu-sub-button-NgS4JryG.d.ts +25 -0
  1359. package/dist/menu-sub-button-NgS4JryG.d.ts.map +1 -0
  1360. package/dist/messages-D0lxgjNm.d.ts +31 -0
  1361. package/dist/messages-D0lxgjNm.d.ts.map +1 -0
  1362. package/dist/{model-Cqi9KKo1.d.ts → model-CHHE1lHQ.d.ts} +5 -1
  1363. package/dist/{model-Cqi9KKo1.d.ts.map → model-CHHE1lHQ.d.ts.map} +1 -1
  1364. package/dist/{model-DP6FsG__.d.ts → model-D6sI_4m9.d.ts} +5 -1
  1365. package/dist/model-D6sI_4m9.d.ts.map +1 -0
  1366. package/dist/{model-B_LLKNOs.d.ts → model-DUQnYLRU.d.ts} +3 -1
  1367. package/dist/model-DUQnYLRU.d.ts.map +1 -0
  1368. package/dist/{model-Cbzktxjx.d.ts → model-Dafi-gx6.d.ts} +2 -1
  1369. package/dist/model-Dafi-gx6.d.ts.map +1 -0
  1370. package/dist/motion-1TeD2tw9.js +67 -0
  1371. package/dist/motion-1TeD2tw9.js.map +1 -0
  1372. package/dist/placement-BRE79jXm.d.ts +4 -0
  1373. package/dist/placement-BRE79jXm.d.ts.map +1 -0
  1374. package/dist/placement-Cg-Y5tLI.js +74 -0
  1375. package/dist/placement-Cg-Y5tLI.js.map +1 -0
  1376. package/dist/{plot-B2aPWHib.js → plot-CSTtMo6j.js} +3 -3
  1377. package/dist/{plot-B2aPWHib.js.map → plot-CSTtMo6j.js.map} +1 -1
  1378. package/dist/popover-morph-CWb4N9ux.d.ts +55 -0
  1379. package/dist/popover-morph-CWb4N9ux.d.ts.map +1 -0
  1380. package/dist/{positioner-DY1vB4rF.js → positioner-CFR4mJg6.js} +112 -4
  1381. package/dist/positioner-CFR4mJg6.js.map +1 -0
  1382. package/dist/resource-row-DByzjie0.js +290 -0
  1383. package/dist/resource-row-DByzjie0.js.map +1 -0
  1384. package/dist/root-C1n8-uIA.js +420 -0
  1385. package/dist/root-C1n8-uIA.js.map +1 -0
  1386. package/dist/{use-inspection-DWk6TdY9.js → scale-JwdKsMkj.js} +2 -55
  1387. package/dist/scale-JwdKsMkj.js.map +1 -0
  1388. package/dist/theme.css +98 -4
  1389. package/dist/{tooltip-UI0lMGya.d.ts → tooltip-CoAbjn9I.d.ts} +9 -1
  1390. package/dist/tooltip-CoAbjn9I.d.ts.map +1 -0
  1391. package/dist/{tooltip-CJccRGy9.d.ts → tooltip-CwsBzl7m.d.ts} +12 -3
  1392. package/dist/tooltip-CwsBzl7m.d.ts.map +1 -0
  1393. package/dist/{tooltip-CMtIWcUY.d.ts → tooltip-DI79u-1V.d.ts} +11 -2
  1394. package/dist/tooltip-DI79u-1V.d.ts.map +1 -0
  1395. package/dist/{tooltip-jQICwV_k.d.ts → tooltip-DPci40hM.d.ts} +9 -1
  1396. package/dist/tooltip-DPci40hM.d.ts.map +1 -0
  1397. package/dist/{tooltip-DuPE_3Gi.d.ts → tooltip-TdY1OH4j.d.ts} +9 -2
  1398. package/dist/tooltip-TdY1OH4j.d.ts.map +1 -0
  1399. package/dist/{tooltip-BUkacvMl.js → tooltip-eecPhLtC.js} +106 -48
  1400. package/dist/tooltip-eecPhLtC.js.map +1 -0
  1401. package/dist/types-BhZ0FwDi.d.ts +33 -0
  1402. package/dist/types-BhZ0FwDi.d.ts.map +1 -0
  1403. package/dist/types-BnHpfLje.d.ts +111 -0
  1404. package/dist/types-BnHpfLje.d.ts.map +1 -0
  1405. package/dist/types-COoUai3R.d.ts +64 -0
  1406. package/dist/types-COoUai3R.d.ts.map +1 -0
  1407. package/dist/{types-DJ8z6gW8.d.ts → types-CbBZy33k.d.ts} +3 -1
  1408. package/dist/{types-DJ8z6gW8.d.ts.map → types-CbBZy33k.d.ts.map} +1 -1
  1409. package/dist/{types-C_v1N4fH.d.ts → types-ClKnPGuP.d.ts} +18 -4
  1410. package/dist/types-ClKnPGuP.d.ts.map +1 -0
  1411. package/dist/types-DPKILbI9.d.ts +37 -0
  1412. package/dist/types-DPKILbI9.d.ts.map +1 -0
  1413. package/dist/types-Dbiy485_.d.ts +114 -0
  1414. package/dist/types-Dbiy485_.d.ts.map +1 -0
  1415. package/dist/types-DtUnNprK.d.ts +53 -0
  1416. package/dist/types-DtUnNprK.d.ts.map +1 -0
  1417. package/dist/{use-crash-game-DiGujbfH.d.ts → use-crash-game-C6JPLvAH.d.ts} +5 -2
  1418. package/dist/{use-crash-game-DiGujbfH.d.ts.map → use-crash-game-C6JPLvAH.d.ts.map} +1 -1
  1419. package/dist/use-filtered-options-3TcVsHzV.js +167 -0
  1420. package/dist/use-filtered-options-3TcVsHzV.js.map +1 -0
  1421. package/dist/use-filtered-options-BbXqmJmZ.d.ts +14 -0
  1422. package/dist/use-filtered-options-BbXqmJmZ.d.ts.map +1 -0
  1423. package/dist/use-inspection-LoyxxJk8.js +31 -0
  1424. package/dist/use-inspection-LoyxxJk8.js.map +1 -0
  1425. package/dist/use-menu-navigation-B17_iK_B.js +57 -0
  1426. package/dist/use-menu-navigation-B17_iK_B.js.map +1 -0
  1427. package/dist/{use-position-B1lYvN8D.d.ts → use-position-ac-sSZRY.d.ts} +3 -1
  1428. package/dist/use-position-ac-sSZRY.d.ts.map +1 -0
  1429. package/dist/use-width-DZex74TT.js +45 -0
  1430. package/dist/use-width-DZex74TT.js.map +1 -0
  1431. package/dist/utils-f7_cAAwc.js +55 -0
  1432. package/dist/utils-f7_cAAwc.js.map +1 -0
  1433. package/package.json +23 -18
  1434. package/dist/components/agents/agent-activity/index.d.ts.map +0 -1
  1435. package/dist/components/agents/agent-activity/index.js.map +0 -1
  1436. package/dist/components/agents/approval-card/index.d.ts.map +0 -1
  1437. package/dist/components/agents/approval-card/index.js.map +0 -1
  1438. package/dist/components/motion/animated-sidebar.js.map +0 -1
  1439. package/dist/components/motion/animated-toast-stack.d.ts.map +0 -1
  1440. package/dist/components/motion/animated-toast-stack.js.map +0 -1
  1441. package/dist/components/motion/availability-scheduler/index.d.ts.map +0 -1
  1442. package/dist/components/motion/availability-scheduler/index.js.map +0 -1
  1443. package/dist/components/motion/button/index.js +0 -6
  1444. package/dist/components/motion/popover-morph.d.ts.map +0 -1
  1445. package/dist/components/motion/table/index.d.ts.map +0 -1
  1446. package/dist/components/motion/table/index.js.map +0 -1
  1447. package/dist/components/motion/wallet-card/index.d.ts.map +0 -1
  1448. package/dist/components/motion/wallet-card/index.js.map +0 -1
  1449. package/dist/constants-CggcOqef.js.map +0 -1
  1450. package/dist/context-B5NItr9C.d.ts.map +0 -1
  1451. package/dist/context-BEYROlTB.d.ts.map +0 -1
  1452. package/dist/context-BLjAwZ5V.js.map +0 -1
  1453. package/dist/context-BpHX6J1T.js.map +0 -1
  1454. package/dist/context-BrGWrRwa.d.ts.map +0 -1
  1455. package/dist/context-C1Z_5vew.d.ts.map +0 -1
  1456. package/dist/context-C5DO1oe1.js.map +0 -1
  1457. package/dist/context-C8M88I1F.js.map +0 -1
  1458. package/dist/context-CgRa89Bq.d.ts.map +0 -1
  1459. package/dist/context-CmexbpIK.js.map +0 -1
  1460. package/dist/context-Cr2SLhVi.js.map +0 -1
  1461. package/dist/context-CwSk1WZR.js.map +0 -1
  1462. package/dist/context-DWHy9EUW.js.map +0 -1
  1463. package/dist/context-Dae38FV_.js.map +0 -1
  1464. package/dist/context-r3QNWoPh.js.map +0 -1
  1465. package/dist/copy-menu-BizTEv8v.js.map +0 -1
  1466. package/dist/crash-parts-Dg5WC8u4.js.map +0 -1
  1467. package/dist/ease-DnPhwGe6.d.ts.map +0 -1
  1468. package/dist/model-B_LLKNOs.d.ts.map +0 -1
  1469. package/dist/model-Cbzktxjx.d.ts.map +0 -1
  1470. package/dist/model-DP6FsG__.d.ts.map +0 -1
  1471. package/dist/positioner-DY1vB4rF.js.map +0 -1
  1472. package/dist/tooltip-BUkacvMl.js.map +0 -1
  1473. package/dist/tooltip-CJccRGy9.d.ts.map +0 -1
  1474. package/dist/tooltip-CMtIWcUY.d.ts.map +0 -1
  1475. package/dist/tooltip-DuPE_3Gi.d.ts.map +0 -1
  1476. package/dist/tooltip-UI0lMGya.d.ts.map +0 -1
  1477. package/dist/tooltip-jQICwV_k.d.ts.map +0 -1
  1478. package/dist/types-C1WFGMvf.d.ts +0 -34
  1479. package/dist/types-C1WFGMvf.d.ts.map +0 -1
  1480. package/dist/types-C_v1N4fH.d.ts.map +0 -1
  1481. package/dist/types-DROZkngo.d.ts +0 -20
  1482. package/dist/types-DROZkngo.d.ts.map +0 -1
  1483. package/dist/use-active-option-DbxnIM2n.js +0 -85
  1484. package/dist/use-active-option-DbxnIM2n.js.map +0 -1
  1485. package/dist/use-inspection-DWk6TdY9.js.map +0 -1
  1486. package/dist/use-position-B1lYvN8D.d.ts.map +0 -1
  1487. package/dist/use-width-Dmy1eT1-.js +0 -23
  1488. package/dist/use-width-Dmy1eT1-.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"color-picker.js","names":[],"sources":["../../../src/components/reui/color-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n ComponentProps,\n KeyboardEvent as ReactKeyboardEvent,\n ReactNode,\n PointerEvent as ReactPointerEvent,\n Ref,\n} from \"react\";\nimport {\n createContext,\n Fragment,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n useSyncExternalStore,\n} from \"react\";\nimport { CheckIcon, ChevronDownIcon, CopyIcon, PipetteIcon } from \"lucide-react\";\nimport { flushSync } from \"react-dom\";\n\nimport { cn } from \"@kumix/utils\";\nimport { Button } from \"../ui/button\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n} from \"../ui/dropdown-menu\";\nimport { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from \"../ui/input-group\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../ui/popover\";\nimport { Separator } from \"../ui/separator\";\n\n/* -------------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------------- */\n\n/** How a value is written: what `onValueChange` emits and what the fields show. */\nexport type ColorPickerFormat = \"hex\" | \"rgb\" | \"hsl\" | \"hsb\" | \"oklch\";\n\n/** Where channels live. HSB is `hsv` here, after the math. */\nexport type ColorPickerColorSpace = \"rgb\" | \"hsl\" | \"hsv\" | \"oklch\";\n\nexport type ColorPickerChannel =\n | \"hue\"\n | \"saturation\"\n | \"brightness\"\n | \"lightness\"\n | \"chroma\"\n | \"red\"\n | \"green\"\n | \"blue\"\n | \"alpha\";\n\n/**\n * A parsed color. Channels stay in the space they were given or edited in,\n * so the hue of a gray and an OKLCH color outside sRGB survive a round trip.\n * rgb runs 0 to 255; hsl and hsv take hue 0 to 360 and the rest 0 to 100;\n * oklch takes lightness 0 to 100, chroma 0 to 0.4 and hue 0 to 360. Alpha is\n * 0 to 1.\n */\nexport type ColorPickerColor = {\n space: ColorPickerColorSpace;\n channels: [number, number, number];\n alpha: number;\n};\n\nexport type ColorPickerLabels = {\n /** Trigger text while there is no value. */\n placeholder: string;\n /** Names the popup and an inline panel. */\n panelLabel: string;\n /** The swatch button in `ColorPickerInput`. */\n openPicker: string;\n /** The saturation and brightness area. */\n area: string;\n hue: string;\n saturation: string;\n brightness: string;\n lightness: string;\n chroma: string;\n red: string;\n green: string;\n blue: string;\n alpha: string;\n hex: string;\n format: string;\n eyeDropper: string;\n copy: string;\n copied: string;\n clear: string;\n swatches: string;\n};\n\nexport type ColorPickerFunctions = {\n /** Names a color for screen readers, in the area, the sliders and unlabelled swatches. */\n getColorName: (color: ColorPickerColor) => string;\n};\n\nexport type ColorPickerI18nConfig = {\n labels: ColorPickerLabels;\n functions: ColorPickerFunctions;\n};\n\n/** One level deeper than `Partial`, so a single label can be overridden. */\nexport type ColorPickerI18nOverrides = {\n labels?: Partial<ColorPickerLabels>;\n functions?: Partial<ColorPickerFunctions>;\n};\n\ntype Triple = [number, number, number];\n\nconst SPACE_CHANNELS: Record<\n ColorPickerColorSpace,\n [ColorPickerChannel, ColorPickerChannel, ColorPickerChannel]\n> = {\n rgb: [\"red\", \"green\", \"blue\"],\n hsl: [\"hue\", \"saturation\", \"lightness\"],\n hsv: [\"hue\", \"saturation\", \"brightness\"],\n oklch: [\"lightness\", \"chroma\", \"hue\"],\n};\n\nexport const COLOR_PICKER_FORMATS: ColorPickerFormat[] = [\"hex\", \"rgb\", \"hsl\", \"hsb\", \"oklch\"];\n\nconst FORMAT_LABELS: Record<ColorPickerFormat, string> = {\n hex: \"HEX\",\n rgb: \"RGB\",\n hsl: \"HSL\",\n hsb: \"HSB\",\n oklch: \"OKLCH\",\n};\n\n/* -------------------------------------------------------------------------- */\n/* Color math */\n/* -------------------------------------------------------------------------- */\n\nconst clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));\n\nconst wrapHue = (hue: number) => ((hue % 360) + 360) % 360;\n\n/* Trailing zeros dropped, and never \"-0\". */\nconst fixed = (value: number, digits: number) => String(Number(value.toFixed(digits)) + 0);\n\nfunction rgbToHsv([red, green, blue]: Triple, fallbackHue = 0): Triple {\n const r = red / 255;\n const g = green / 255;\n const b = blue / 255;\n const max = Math.max(r, g, b);\n const delta = max - Math.min(r, g, b);\n let hue = fallbackHue;\n if (delta > 1e-9) {\n hue = max === r ? ((g - b) / delta) % 6 : max === g ? (b - r) / delta + 2 : (r - g) / delta + 4;\n hue = wrapHue(hue * 60);\n }\n return [hue, max === 0 ? 0 : (delta / max) * 100, max * 100];\n}\n\nfunction hsvToRgb([hue, saturation, brightness]: Triple): Triple {\n const s = saturation / 100;\n const v = brightness / 100;\n const channel = (n: number) => {\n const k = (n + hue / 60) % 6;\n return (v - v * s * Math.max(0, Math.min(k, 4 - k, 1))) * 255;\n };\n return [channel(5), channel(3), channel(1)];\n}\n\n/* HSL and HSB share a hue, carried over as is, so a gray keeps it. */\nfunction hsvToHsl([hue, saturation, brightness]: Triple): Triple {\n const s = saturation / 100;\n const v = brightness / 100;\n const l = v * (1 - s / 2);\n const sl = l === 0 || l === 1 ? 0 : (v - l) / Math.min(l, 1 - l);\n return [hue, sl * 100, l * 100];\n}\n\nfunction hslToHsv([hue, saturation, lightness]: Triple): Triple {\n const s = saturation / 100;\n const l = lightness / 100;\n const v = l + s * Math.min(l, 1 - l);\n return [hue, v === 0 ? 0 : 2 * (1 - l / v) * 100, v * 100];\n}\n\nconst toLinear = (channel: number) => {\n const c = channel / 255;\n return c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n};\n\nconst fromLinear = (channel: number) =>\n 255 * (channel <= 0.0031308 ? 12.92 * channel : 1.055 * channel ** (1 / 2.4) - 0.055);\n\n/* OKLab by Björn Ottosson, the matrices CSS Color 4 uses. Linear sRGB in,\n unbounded, so a wide-gamut color converts without clipping. */\nfunction linearToOklab([r, g, b]: Triple): Triple {\n const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);\n const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);\n const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);\n return [\n 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,\n 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,\n 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,\n ];\n}\n\n/* OKLab, or polar a and b, to OKLCH in the picker's units: L 0 to 100. */\nfunction oklabToOklch([lightness, a, b]: Triple, fallbackHue = 0): Triple {\n const chroma = Math.sqrt(a * a + b * b);\n const hue = chroma < 1e-4 ? fallbackHue : wrapHue((Math.atan2(b, a) * 180) / Math.PI);\n return [lightness * 100, chroma, hue];\n}\n\nfunction rgbToOklch(rgb: Triple, fallbackHue = 0): Triple {\n return oklabToOklch(linearToOklab(rgb.map(toLinear) as Triple), fallbackHue);\n}\n\nfunction oklchToLinear([lightness, chroma, hue]: Triple): Triple {\n const angle = (hue * Math.PI) / 180;\n const L = lightness / 100;\n const a = chroma * Math.cos(angle);\n const b = chroma * Math.sin(angle);\n const l = (L + 0.3963377774 * a + 0.2158037573 * b) ** 3;\n const m = (L - 0.1055613458 * a - 0.0638541728 * b) ** 3;\n const s = (L - 0.0894841775 * a - 1.291485548 * b) ** 3;\n return [\n 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,\n -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,\n -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s,\n ];\n}\n\nconst inSrgb = (linear: Triple) =>\n linear.every((channel) => channel >= -1e-4 && channel <= 1 + 1e-4);\n\nconst clipLinear = (linear: Triple) => linear.map((channel) => clamp(channel, 0, 1)) as Triple;\n\n/* How far a clipped color lands from the OKLCH it stands for, in OKLab. */\nfunction clipError(clipped: Triple, [lightness, chroma, hue]: Triple) {\n const [l, a, b] = linearToOklab(clipped);\n const angle = (hue * Math.PI) / 180;\n return Math.hypot(\n l - lightness / 100,\n a - chroma * Math.cos(angle),\n b - chroma * Math.sin(angle),\n );\n}\n\n/* CSS Color 4 gamut mapping: lower chroma at the same lightness and hue\n until clipping the rest moves the color less than a just-noticeable\n difference (0.02 in OKLab), then clip. Pure chroma reduction drifted up to\n 27 units in hex from what a browser paints for Tailwind's P3 shades. */\nfunction oklchToRgb([lightness, chroma, hue]: Triple): Triple {\n const encode = (linear: Triple) => linear.map((channel) => fromLinear(channel)) as Triple;\n if (lightness >= 100) return [255, 255, 255];\n if (lightness <= 0) return [0, 0, 0];\n const target: Triple = [lightness, Math.max(0, chroma), hue];\n const origin = oklchToLinear(target);\n if (inSrgb(origin)) return encode(clipLinear(origin));\n let clipped = clipLinear(origin);\n if (clipError(clipped, target) < 0.02) return encode(clipped);\n let low = 0;\n let high = target[1];\n let lowInGamut = true;\n while (high - low > 1e-4) {\n const mid = (low + high) / 2;\n const current: Triple = [lightness, mid, hue];\n const linear = oklchToLinear(current);\n if (lowInGamut && inSrgb(linear)) {\n low = mid;\n continue;\n }\n clipped = clipLinear(linear);\n const error = clipError(clipped, current);\n if (error < 0.02) {\n if (0.02 - error < 1e-4) break;\n lowInGamut = false;\n low = mid;\n } else {\n high = mid;\n }\n }\n return encode(clipped);\n}\n\nfunction toRgb(color: ColorPickerColor): Triple {\n const { space, channels } = color;\n if (space === \"rgb\") return channels;\n if (space === \"hsv\") return hsvToRgb(channels);\n if (space === \"hsl\") return hsvToRgb(hslToHsv(channels));\n return oklchToRgb(channels);\n}\n\n/** A color's channels in another space. */\nfunction toSpace(color: ColorPickerColor, space: ColorPickerColorSpace): Triple {\n const { space: from, channels } = color;\n if (from === space) return channels;\n if (from === \"hsv\" && space === \"hsl\") return hsvToHsl(channels);\n if (from === \"hsl\" && space === \"hsv\") return hslToHsv(channels);\n const rgb = toRgb(color);\n const hue = from === \"rgb\" ? 0 : channels[from === \"oklch\" ? 2 : 0];\n if (space === \"rgb\") return rgb;\n if (space === \"hsv\") return rgbToHsv(rgb, hue);\n if (space === \"hsl\") return hsvToHsl(rgbToHsv(rgb, hue));\n return rgbToOklch(rgb, hue);\n}\n\n/** Whether a color fits sRGB. OKLCH can reach past it; the picker then maps it into sRGB the way CSS does. */\nexport function isColorInSrgb(color: ColorPickerColor) {\n return color.space !== \"oklch\" || inSrgb(oklchToLinear(color.channels));\n}\n\nconst HEX_PATTERN = /^#?([\\da-f]{3,4}|[\\da-f]{6}|[\\da-f]{8})$/;\n/* [\\s\\S], not \".\", so a function pretty-printed over several lines reads. */\nconst FUNCTION_PATTERN = /^([a-z][a-z\\d-]*)\\(([\\s\\S]*)\\)$/;\nconst NUMBER_PATTERN = /^([+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[+-]?\\d+)?)(%|deg|rad|grad|turn)?$/;\n\n/* The 148 CSS named colors, each name then its hex: about 2.3 KB, checked\n against Chrome, and safe to read on the server unlike a canvas. */\nconst NAMED_COLORS =\n \"alicebluef0f8ff antiquewhitefaebd7 aqua00ffff aquamarine7fffd4 \" +\n \"azuref0ffff beigef5f5dc bisqueffe4c4 black000000 blanchedalmondffebcd \" +\n \"blue0000ff blueviolet8a2be2 browna52a2a burlywooddeb887 \" +\n \"cadetblue5f9ea0 chartreuse7fff00 chocolated2691e coralff7f50 \" +\n \"cornflowerblue6495ed cornsilkfff8dc crimsondc143c cyan00ffff \" +\n \"darkblue00008b darkcyan008b8b darkgoldenrodb8860b darkgraya9a9a9 \" +\n \"darkgreen006400 darkgreya9a9a9 darkkhakibdb76b darkmagenta8b008b \" +\n \"darkolivegreen556b2f darkorangeff8c00 darkorchid9932cc darkred8b0000 \" +\n \"darksalmone9967a darkseagreen8fbc8f darkslateblue483d8b \" +\n \"darkslategray2f4f4f darkslategrey2f4f4f darkturquoise00ced1 \" +\n \"darkviolet9400d3 deeppinkff1493 deepskyblue00bfff dimgray696969 \" +\n \"dimgrey696969 dodgerblue1e90ff firebrickb22222 floralwhitefffaf0 \" +\n \"forestgreen228b22 fuchsiaff00ff gainsborodcdcdc ghostwhitef8f8ff \" +\n \"goldffd700 goldenroddaa520 gray808080 green008000 greenyellowadff2f \" +\n \"grey808080 honeydewf0fff0 hotpinkff69b4 indianredcd5c5c indigo4b0082 \" +\n \"ivoryfffff0 khakif0e68c lavendere6e6fa lavenderblushfff0f5 \" +\n \"lawngreen7cfc00 lemonchiffonfffacd lightblueadd8e6 lightcoralf08080 \" +\n \"lightcyane0ffff lightgoldenrodyellowfafad2 lightgrayd3d3d3 \" +\n \"lightgreen90ee90 lightgreyd3d3d3 lightpinkffb6c1 lightsalmonffa07a \" +\n \"lightseagreen20b2aa lightskyblue87cefa lightslategray778899 \" +\n \"lightslategrey778899 lightsteelblueb0c4de lightyellowffffe0 lime00ff00 \" +\n \"limegreen32cd32 linenfaf0e6 magentaff00ff maroon800000 \" +\n \"mediumaquamarine66cdaa mediumblue0000cd mediumorchidba55d3 \" +\n \"mediumpurple9370db mediumseagreen3cb371 mediumslateblue7b68ee \" +\n \"mediumspringgreen00fa9a mediumturquoise48d1cc mediumvioletredc71585 \" +\n \"midnightblue191970 mintcreamf5fffa mistyroseffe4e1 moccasinffe4b5 \" +\n \"navajowhiteffdead navy000080 oldlacefdf5e6 olive808000 olivedrab6b8e23 \" +\n \"orangeffa500 orangeredff4500 orchidda70d6 palegoldenrodeee8aa \" +\n \"palegreen98fb98 paleturquoiseafeeee palevioletreddb7093 \" +\n \"papayawhipffefd5 peachpuffffdab9 perucd853f pinkffc0cb plumdda0dd \" +\n \"powderblueb0e0e6 purple800080 rebeccapurple663399 redff0000 \" +\n \"rosybrownbc8f8f royalblue4169e1 saddlebrown8b4513 salmonfa8072 \" +\n \"sandybrownf4a460 seagreen2e8b57 seashellfff5ee siennaa0522d \" +\n \"silverc0c0c0 skyblue87ceeb slateblue6a5acd slategray708090 \" +\n \"slategrey708090 snowfffafa springgreen00ff7f steelblue4682b4 tand2b48c \" +\n \"teal008080 thistled8bfd8 tomatoff6347 turquoise40e0d0 violetee82ee \" +\n \"wheatf5deb3 whiteffffff whitesmokef5f5f5 yellowffff00 \" +\n \"yellowgreen9acd32\";\n\nlet namedColors: Map<string, string> | null = null;\n\nfunction namedColor(name: string) {\n namedColors ??= new Map(\n NAMED_COLORS.split(\" \").map((entry) => [entry.slice(0, -6), entry.slice(-6)]),\n );\n return namedColors.get(name);\n}\n\n/* One CSS number: 100% is worth `percentOf`, computed as value * percentOf\n / 100 so 50% of 255 is exactly 127.5; angles only where allowed. */\nfunction readNumber(token: string, percentOf: number, angle = false) {\n if (token === \"none\") return 0;\n const match = NUMBER_PATTERN.exec(token);\n if (!match) return null;\n const value = Number(match[1]);\n if (!Number.isFinite(value)) return null;\n const unit = match[2];\n if (!unit) return value;\n if (unit === \"%\") return angle ? null : (value * percentOf) / 100;\n if (!angle) return null;\n if (unit === \"rad\") return (value * 180) / Math.PI;\n if (unit === \"grad\") return value * 0.9;\n if (unit === \"turn\") return value * 360;\n return value;\n}\n\ntype Matrix = [Triple, Triple, Triple];\n\nconst multiply = (matrix: Matrix, [x, y, z]: Triple): Triple =>\n matrix.map((row) => row[0] * x + row[1] * y + row[2] * z) as Triple;\n\nconst compose = (outer: Matrix, inner: Matrix): Matrix =>\n outer.map((row) =>\n [0, 1, 2].map(\n (column) => row[0] * inner[0][column] + row[1] * inner[1][column] + row[2] * inner[2][column],\n ),\n ) as Matrix;\n\n/* CSS Color 4's matrices: XYZ D65 to linear sRGB, each RGB space to XYZ,\n and Bradford from D50, the white of lab(), lch() and ProPhoto. */\nconst XYZ_TO_SRGB: Matrix = [\n [12831 / 3959, -329 / 214, -1974 / 3959],\n [-851781 / 878810, 1648619 / 878810, 36519 / 878810],\n [705 / 12673, -2585 / 12673, 705 / 667],\n];\nconst D50_TO_D65: Matrix = [\n [0.955473421488075, -0.02309845494876471, 0.06325924320057072],\n [-0.0283697093338637, 1.0099953980813041, 0.021041441191917323],\n [0.012314014864481998, -0.020507649298898964, 1.330365926242124],\n];\nconst D50_TO_SRGB = compose(XYZ_TO_SRGB, D50_TO_D65);\n\n/* sRGB's curve, carried past 0 and 1 by symmetry, as color() allows. */\nconst decodeSrgb = (value: number) => {\n const size = Math.abs(value);\n return Math.sign(value) * (size <= 0.04045 ? size / 12.92 : ((size + 0.055) / 1.055) ** 2.4);\n};\n\nconst RGB_SPACES: Record<string, { decode: (value: number) => number; toSrgb: Matrix | null }> = {\n srgb: { decode: decodeSrgb, toSrgb: null },\n \"srgb-linear\": { decode: (value) => value, toSrgb: null },\n \"display-p3\": {\n decode: decodeSrgb,\n toSrgb: compose(XYZ_TO_SRGB, [\n [0.4865709486482162, 0.26566769316909306, 0.1982172852343625],\n [0.2289745640697488, 0.6917385218365064, 0.079286914093745],\n [0, 0.04511338185890264, 1.043944368900976],\n ]),\n },\n \"a98-rgb\": {\n decode: (value) => Math.sign(value) * Math.abs(value) ** (563 / 256),\n toSrgb: compose(XYZ_TO_SRGB, [\n [573536 / 994567, 263643 / 1420810, 187206 / 994567],\n [591459 / 1989134, 6239551 / 9945670, 374412 / 4972835],\n [53769 / 1989134, 351524 / 4972835, 4929758 / 4972835],\n ]),\n },\n \"prophoto-rgb\": {\n decode: (value) => {\n const size = Math.abs(value);\n return size <= 16 / 512 ? value / 16 : Math.sign(value) * size ** 1.8;\n },\n toSrgb: compose(D50_TO_SRGB, [\n [0.7977666449006423, 0.13518129740053308, 0.0313477341283922],\n [0.2880748288194013, 0.711835234241873, 0.00008993693872564],\n [0, 0, 0.8251046025104602],\n ]),\n },\n rec2020: {\n decode: (value) => {\n const size = Math.abs(value);\n return size < 0.018053968510807 * 4.5\n ? value / 4.5\n : Math.sign(value) * ((size + 0.09929682680944) / 1.09929682680944) ** (1 / 0.45);\n },\n toSrgb: compose(XYZ_TO_SRGB, [\n [0.6369580483012914, 0.14461690358620832, 0.1688809751641721],\n [0.2627002120112671, 0.6779980715188708, 0.05930171646986196],\n [0, 0.028072693049087428, 1.060985057710791],\n ]),\n },\n xyz: { decode: (value) => value, toSrgb: XYZ_TO_SRGB },\n \"xyz-d65\": { decode: (value) => value, toSrgb: XYZ_TO_SRGB },\n \"xyz-d50\": { decode: (value) => value, toSrgb: D50_TO_SRGB },\n};\n\n/* CIE Lab, D50 white, to XYZ D50, as CSS Color 4 writes it. */\nfunction labToXyz([lightness, a, b]: Triple): Triple {\n const kappa = 24389 / 27;\n const epsilon = 216 / 24389;\n const fy = (lightness + 16) / 116;\n const fx = a / 500 + fy;\n const fz = fy - b / 200;\n const x = fx ** 3 > epsilon ? fx ** 3 : (116 * fx - 16) / kappa;\n const y = lightness > kappa * epsilon ? fy ** 3 : lightness / kappa;\n const z = fz ** 3 > epsilon ? fz ** 3 : (116 * fz - 16) / kappa;\n return [x * (0.3457 / 0.3585), y, z * ((1 - 0.3457 - 0.3585) / 0.3585)];\n}\n\n/* A color that can reach past sRGB is kept as OKLCH, so nothing is clipped\n until a format or a screen needs sRGB. */\nconst fromLinearSrgb = (linear: Triple): Triple => oklabToOklch(linearToOklab(linear));\n\nconst isUnit = (channels: Triple) =>\n channels.every((channel) => channel >= -1e-6 && channel <= 1 + 1e-6);\n\n/* The channels of one function, as a color in the picker's spaces. */\nfunction readChannels(\n name: string,\n parts: string[],\n): { space: ColorPickerColorSpace; channels: Triple } | null {\n if (name === \"rgb\") {\n const rgb = parts.map((part) => readNumber(part, 255));\n if (rgb.some((value) => value === null)) return null;\n return {\n space: \"rgb\",\n channels: rgb.map((value) => clamp(value!, 0, 255)) as Triple,\n };\n }\n if (name === \"hsl\" || name === \"hsv\" || name === \"hsb\" || name === \"hwb\") {\n const hue = readNumber(parts[0], 1, true);\n const first = readNumber(parts[1], 100);\n const second = readNumber(parts[2], 100);\n if (hue === null || first === null || second === null) return null;\n const x = clamp(first, 0, 100);\n const y = clamp(second, 0, 100);\n if (name === \"hsl\") return { space: \"hsl\", channels: [hue, x, y] };\n if (name !== \"hwb\") return { space: \"hsv\", channels: [hue, x, y] };\n /* hwb(): whiteness and blackness are HSB's saturation and brightness\n read from the other end; summing past 100% gives their gray. */\n const total = x + y;\n if (total >= 100) {\n return { space: \"hsv\", channels: [hue, 0, (x / total) * 100] };\n }\n const brightness = 100 - y;\n return {\n space: \"hsv\",\n channels: [hue, (1 - x / brightness) * 100, brightness],\n };\n }\n if (name === \"oklch\" || name === \"oklab\") {\n const lightness = readNumber(parts[0], 1);\n const second = readNumber(parts[1], 0.4);\n const third = name === \"oklch\" ? readNumber(parts[2], 1, true) : readNumber(parts[2], 0.4);\n if (lightness === null || second === null || third === null) return null;\n const l = clamp(lightness, 0, 1);\n if (name === \"oklch\") {\n return {\n space: \"oklch\",\n channels: [l * 100, Math.max(0, second), third],\n };\n }\n return {\n space: \"oklch\",\n channels: oklabToOklch([l, second, third]),\n };\n }\n if (name === \"lab\" || name === \"lch\") {\n const lightness = readNumber(parts[0], 100);\n const second = readNumber(parts[1], name === \"lab\" ? 125 : 150);\n const third = name === \"lch\" ? readNumber(parts[2], 1, true) : readNumber(parts[2], 125);\n if (lightness === null || second === null || third === null) return null;\n const l = clamp(lightness, 0, 100);\n const angle = (third * Math.PI) / 180;\n const [a, b] =\n name === \"lab\"\n ? [second, third]\n : [Math.max(0, second) * Math.cos(angle), Math.max(0, second) * Math.sin(angle)];\n return {\n space: \"oklch\",\n channels: fromLinearSrgb(multiply(D50_TO_SRGB, labToXyz([l, a, b]))),\n };\n }\n if (name === \"color\") {\n const target = RGB_SPACES[parts[0]];\n if (!target || parts.length !== 4) return null;\n const values = parts.slice(1).map((part) => readNumber(part, 1));\n if (values.some((value) => value === null)) return null;\n const channels = values as Triple;\n if (parts[0] === \"srgb\" && isUnit(channels)) {\n return {\n space: \"rgb\",\n channels: channels.map((value) => clamp(value, 0, 1) * 255) as Triple,\n };\n }\n const linear = channels.map(target.decode) as Triple;\n return {\n space: \"oklch\",\n channels: fromLinearSrgb(target.toSrgb ? multiply(target.toSrgb, linear) : linear),\n };\n }\n return null;\n}\n\n/**\n * Reads a CSS color: hex with 3, 4, 6 or 8 digits, `#` optional; the 148\n * named colors and `transparent`; `rgb()`, `hsl()`, `hwb()`, `lab()`,\n * `lch()`, `oklab()`, `oklch()` and `color()` in any of CSS Color 4's RGB\n * and XYZ spaces, plus `hsb()` or `hsv()`; modern or comma syntax, with or\n * without alpha. A color that can fall outside sRGB is kept as OKLCH.\n * Anything else, `var()` and `currentColor` included, is `null`.\n */\nexport function parseColor(input: string | null | undefined): ColorPickerColor | null {\n if (typeof input !== \"string\") return null;\n const text = input.trim().toLowerCase();\n if (!text) return null;\n if (text === \"transparent\") {\n return { space: \"rgb\", channels: [0, 0, 0], alpha: 0 };\n }\n const hex = HEX_PATTERN.exec(namedColor(text) ?? text);\n if (hex) {\n let digits = hex[1];\n if (digits.length <= 4) {\n digits = [...digits].map((digit) => digit + digit).join(\"\");\n }\n const byte = (index: number) => parseInt(digits.slice(index, index + 2), 16);\n return {\n space: \"rgb\",\n channels: [byte(0), byte(2), byte(4)],\n alpha: digits.length === 8 ? byte(6) / 255 : 1,\n };\n }\n const call = FUNCTION_PATTERN.exec(text);\n if (!call) return null;\n const name = call[1].replace(/a$/, \"\");\n const [main, slash, ...rest] = call[2].split(\"/\");\n if (rest.length > 0) return null;\n const parts = main.split(/[\\s,]+/).filter(Boolean);\n /* color() names its space first, and takes alpha only after a slash. */\n const count = name === \"color\" ? 4 : 3;\n /* Alpha follows a slash, or is the fourth value of the comma syntax. */\n const alphaToken = slash?.trim() ?? (name === \"color\" ? undefined : parts[3]);\n if (parts.length !== count && !(name !== \"color\" && parts.length === 4 && slash === undefined)) {\n return null;\n }\n const alpha = alphaToken === undefined ? 1 : readNumber(alphaToken, 1);\n const read = readChannels(name, parts.slice(0, count));\n if (alpha === null || !read) return null;\n const channels = read.channels;\n if (channels.some((channel) => !Number.isFinite(channel))) return null;\n if (read.space !== \"rgb\") {\n const hueIndex = read.space === \"oklch\" ? 2 : 0;\n channels[hueIndex] = wrapHue(channels[hueIndex]);\n }\n return { space: read.space, channels, alpha: clamp(alpha, 0, 1) };\n}\n\nconst CSS_WIDE = /^(inherit|initial|unset|revert|revert-layer|currentcolor)$/;\n\n/* Whatever else the browser paints (color-mix(), relative colors,\n light-dark(), system colors), resolved by its computed style, which\n serializes as a function parseColor reads. Two parents of different\n colors expose anything that inherits (var() with no value, a CSS-wide\n keyword); a canvas would have read those as black. Only typing reaches\n this, never a render. */\nfunction parseWithBrowser(text: string): ColorPickerColor | null {\n if (\n typeof document === \"undefined\" ||\n CSS_WIDE.test(text.toLowerCase()) ||\n !CSS.supports?.(\"color\", text)\n ) {\n return null;\n }\n const parent = document.createElement(\"div\");\n const probe = document.createElement(\"div\");\n parent.style.display = \"none\";\n probe.style.color = text;\n parent.append(probe);\n document.body.append(parent);\n parent.style.color = \"rgb(1, 2, 3)\";\n const first = getComputedStyle(probe).color;\n parent.style.color = \"rgb(4, 5, 6)\";\n const second = getComputedStyle(probe).color;\n parent.remove();\n return first === second ? parseColor(first) : null;\n}\n\n/**\n * Writes a color in a format. HEX gains a fourth byte and the others a\n * `/ alpha` only when the color is translucent; OKLCH keeps channels outside\n * sRGB, every other format maps the color into sRGB the way CSS does.\n */\nexport function formatColor(color: ColorPickerColor, format: ColorPickerFormat): string {\n const alpha = clamp(color.alpha, 0, 1);\n /* Decided on the rounded alpha, so 0.996 writes no \"/ 1\" tail. */\n const tail = fixed(alpha, 2) !== \"1\" ? ` / ${fixed(alpha, 2)}` : \"\";\n if (format === \"hex\" || format === \"rgb\") {\n const rgb = toRgb(color).map((channel) => Math.round(clamp(channel, 0, 255)));\n if (format === \"rgb\") return `rgb(${rgb.join(\" \")}${tail})`;\n const opacity = Math.round(alpha * 255);\n const bytes = opacity < 255 ? [...rgb, opacity] : rgb;\n return `#${bytes.map((byte) => byte.toString(16).padStart(2, \"0\")).join(\"\")}`;\n }\n if (format === \"oklch\") {\n const [l, c, h] = toSpace(color, \"oklch\");\n /* Fine enough that hex to OKLCH and back is exact: 0 of 140,608 colors\n drift, where 0.1% and 3 decimals moved 29,278 by up to 7. */\n /* Chroma is never below 0, and a hue that rounds to 360 is 0. */\n const hue = fixed(wrapHue(Number(h.toFixed(3))), 3);\n return `oklch(${fixed(l, 2)}% ${fixed(Math.max(0, c), 5)} ${hue}${tail})`;\n }\n const [h, s, third] = toSpace(color, format === \"hsl\" ? \"hsl\" : \"hsv\");\n return `${format}(${fixed(h, 1)} ${fixed(s, 1)}% ${fixed(third, 1)}%${tail})`;\n}\n\n/* What CSS paints: OKLCH as itself, so a wide-gamut screen shows it. */\nconst toCss = (color: ColorPickerColor) =>\n formatColor(color, color.space === \"oklch\" ? \"oklch\" : \"rgb\");\n\nfunction luminance(rgb: Triple) {\n const [r, g, b] = rgb.map(toLinear);\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n}\n\n/* A translucent color composited onto an opaque one. */\nfunction over(top: ColorPickerColor, bottom: Triple): Triple {\n const rgb = toRgb(top);\n return rgb.map(\n (channel, index) => channel * top.alpha + bottom[index] * (1 - top.alpha),\n ) as Triple;\n}\n\n/**\n * The WCAG 2 contrast ratio, 1 to 21. A translucent foreground is laid over\n * the background, and a translucent background over white. `null` when either\n * color does not parse.\n */\nexport function getContrastRatio(\n foreground: string | ColorPickerColor,\n background: string | ColorPickerColor,\n): number | null {\n const front = typeof foreground === \"string\" ? parseColor(foreground) : foreground;\n const back = typeof background === \"string\" ? parseColor(background) : background;\n if (!front || !back) return null;\n const base = over(back, [255, 255, 255]);\n const a = luminance(over(front, base));\n const b = luminance(base);\n return (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);\n}\n\n/* The relative luminance where light and dark text read about equally well.\n It matches the APCA choice on all 110 Tailwind shades from 300 to 700; the\n WCAG 2 ratio flips near 0.18 and puts dark text on blue-500 and red-500. */\nconst FOREGROUND_SWITCH = 0.36;\n\n/**\n * The text color that reads better on a background: `light` on a dark one,\n * `dark` on a light one. Light text also has to reach 3:1 by WCAG 2, the AA\n * bar for large text and icons, so orange-500 and sky-500 take dark text.\n * A translucent background is laid over white, as in `getContrastRatio`.\n * `null` when the background does not parse.\n */\nexport function getForegroundColor(\n background: string | ColorPickerColor,\n { light = \"#ffffff\", dark = \"#0a0a0a\" }: { light?: string; dark?: string } = {},\n): string | null {\n const color = typeof background === \"string\" ? parseColor(background) : background;\n if (!color) return null;\n return luminance(over(color, [255, 255, 255])) < FOREGROUND_SWITCH &&\n (getContrastRatio(light, color) ?? 0) >= 3\n ? light\n : dark;\n}\n\n/* OKLCH hue boundaries, each the upper end of its name. */\nconst HUE_NAMES: Array<[number, string]> = [\n [15, \"pink\"],\n [45, \"red\"],\n [80, \"orange\"],\n [120, \"yellow\"],\n [135, \"lime\"],\n [165, \"green\"],\n [205, \"cyan\"],\n [250, \"sky blue\"],\n [280, \"blue\"],\n [300, \"violet\"],\n [320, \"purple\"],\n [345, \"magenta\"],\n [360, \"pink\"],\n];\n\n/** A rough English name: \"dark vibrant blue\", \"light gray\". Swap it through `i18n.functions`. */\nfunction nameColor(color: ColorPickerColor) {\n const [lightness, chroma, hue] = toSpace(color, \"oklch\");\n const l = lightness / 100;\n if (chroma < 0.025) {\n if (l < 0.2) return \"black\";\n if (l < 0.45) return \"dark gray\";\n if (l < 0.75) return \"gray\";\n return l < 0.95 ? \"light gray\" : \"white\";\n }\n let name = HUE_NAMES.find(([end]) => hue < end)?.[1] ?? \"pink\";\n if (l < 0.6 && hue >= 40 && hue < 100) name = \"brown\";\n else if (l < 0.6 && hue >= 100 && hue < 135) name = \"olive\";\n const tone = chroma < 0.07 ? \"grayish \" : chroma > 0.2 ? \"vibrant \" : \"\";\n const shade = l < 0.45 ? \"dark \" : l > 0.82 ? \"light \" : \"\";\n return `${shade}${tone}${name}`;\n}\n\nexport const DEFAULT_COLOR_PICKER_I18N: ColorPickerI18nConfig = {\n labels: {\n placeholder: \"Select color\",\n panelLabel: \"Choose color\",\n openPicker: \"Open color picker\",\n area: \"Color\",\n hue: \"Hue\",\n saturation: \"Saturation\",\n brightness: \"Brightness\",\n lightness: \"Lightness\",\n chroma: \"Chroma\",\n red: \"Red\",\n green: \"Green\",\n blue: \"Blue\",\n alpha: \"Opacity\",\n hex: \"Hex\",\n format: \"Color format\",\n eyeDropper: \"Pick a color from the screen\",\n copy: \"Copy color\",\n copied: \"Copied\",\n clear: \"Clear\",\n swatches: \"Swatches\",\n },\n functions: { getColorName: nameColor },\n};\n\n/** Merges per section, so an override can carry one key without restating the rest. */\nexport function mergeColorPickerI18n(overrides?: ColorPickerI18nOverrides): ColorPickerI18nConfig {\n if (!overrides?.labels && !overrides?.functions) {\n return DEFAULT_COLOR_PICKER_I18N;\n }\n return {\n labels: { ...DEFAULT_COLOR_PICKER_I18N.labels, ...overrides.labels },\n functions: {\n ...DEFAULT_COLOR_PICKER_I18N.functions,\n ...overrides.functions,\n },\n };\n}\n\n/* -------------------------------------------------------------------------- */\n/* Channels */\n/* -------------------------------------------------------------------------- */\n\nconst DEFAULT_SPACE: Record<ColorPickerChannel, ColorPickerColorSpace> = {\n hue: \"hsv\",\n saturation: \"hsv\",\n brightness: \"hsv\",\n lightness: \"hsl\",\n chroma: \"oklch\",\n red: \"rgb\",\n green: \"rgb\",\n blue: \"rgb\",\n alpha: \"rgb\",\n};\n\n/* A space that has no such channel falls back to the channel's own. */\nconst resolveSpace = (channel: ColorPickerChannel, space: ColorPickerColorSpace | undefined) =>\n channel !== \"alpha\" && space && SPACE_CHANNELS[space].includes(channel)\n ? space\n : DEFAULT_SPACE[channel];\n\nfunction channelRange(space: ColorPickerColorSpace, channel: ColorPickerChannel) {\n if (channel === \"alpha\") return { max: 1, step: 0.01 };\n if (channel === \"hue\") return { max: 360, step: 1 };\n if (channel === \"chroma\") return { max: 0.4, step: 0.004 };\n return { max: space === \"rgb\" ? 255 : 100, step: 1 };\n}\n\nfunction readChannel(\n color: ColorPickerColor,\n space: ColorPickerColorSpace,\n channel: ColorPickerChannel,\n) {\n if (channel === \"alpha\") return color.alpha;\n return toSpace(color, space)[SPACE_CHANNELS[space].indexOf(channel)];\n}\n\nfunction withChannel(\n color: ColorPickerColor,\n space: ColorPickerColorSpace,\n channel: ColorPickerChannel,\n value: number,\n): ColorPickerColor {\n if (channel === \"alpha\") return { ...color, alpha: clamp(value, 0, 1) };\n const channels = [...toSpace(color, space)] as Triple;\n channels[SPACE_CHANNELS[space].indexOf(channel)] = value;\n return { space, channels, alpha: color.alpha };\n}\n\n/* Screen reader text for one channel: \"210°, blue\", \"50%\", \"128\". */\nfunction channelValueText(\n color: ColorPickerColor,\n space: ColorPickerColorSpace,\n channel: ColorPickerChannel,\n i18n: ColorPickerI18nConfig,\n) {\n const value = readChannel(color, space, channel);\n if (channel === \"alpha\") return `${Math.round(value * 100)}%`;\n if (channel === \"chroma\") return fixed(value, 3);\n if (channel === \"hue\") {\n return `${Math.round(value)}°, ${i18n.functions.getColorName(color)}`;\n }\n return space === \"rgb\" ? String(Math.round(value)) : `${Math.round(value)}%`;\n}\n\n/* The colors a track runs through: the full spectrum for hue, so a gray\n still shows where it would go, and sampled stops elsewhere, since OKLCH\n and HSL lightness do not run straight in sRGB. */\nfunction trackStops(\n color: ColorPickerColor,\n space: ColorPickerColorSpace,\n channel: ColorPickerChannel,\n) {\n const opaque = { ...color, alpha: 1 };\n if (channel === \"alpha\") return [\"transparent\", toCss(opaque)];\n let base = opaque;\n if (channel === \"hue\") {\n base =\n space === \"oklch\"\n ? withChannel(\n opaque,\n \"oklch\",\n \"chroma\",\n Math.max(readChannel(opaque, \"oklch\", \"chroma\"), 0.12),\n )\n : { space: \"hsv\", channels: [0, 100, 100], alpha: 1 };\n }\n const count =\n channel === \"hue\" || space === \"oklch\"\n ? 13\n : space === \"hsl\" && channel === \"lightness\"\n ? 3\n : 2;\n const { max } = channelRange(space, channel);\n const target = channel === \"hue\" && space !== \"oklch\" ? \"hsv\" : space;\n return Array.from({ length: count }, (_, index) =>\n formatColor(withChannel(base, target, channel, (max * index) / (count - 1)), \"rgb\"),\n );\n}\n\n/* The transparency grid behind translucent colors, in theme tokens. */\nconst CHECKER =\n \"repeating-conic-gradient(var(--color-muted) 0 25%, var(--color-background) 0 50%) 50% / 8px 8px\";\n\n/* -------------------------------------------------------------------------- */\n/* Context */\n/* -------------------------------------------------------------------------- */\n\n/* What the controls show while the value is empty: white, hue 0. */\nconst EMPTY_COLOR: ColorPickerColor = {\n space: \"hsv\",\n channels: [0, 0, 100],\n alpha: 1,\n};\n\ntype ColorPickerContextValue = {\n id: string;\n value: string | null;\n /** The color written in `format` for display, hex in capitals, or `null`. */\n text: string | null;\n /** The committed color, or `null` while empty. */\n color: ColorPickerColor | null;\n /** What the controls show: the color, or white while empty. */\n display: ColorPickerColor;\n format: ColorPickerFormat;\n alpha: boolean;\n i18n: ColorPickerI18nConfig;\n disabled: boolean;\n readOnly: boolean;\n editable: boolean;\n invalid: boolean;\n required: boolean;\n label: string | undefined;\n labelledBy: string | undefined;\n describedBy: string | undefined;\n swatches: string[] | undefined;\n open: boolean;\n setOpen: (open: boolean) => void;\n /** The latest color, for handlers that fire before the next render. */\n getColor: () => ColorPickerColor;\n /** Changes the value mid-interaction; `onValueCommit` waits for the end. */\n emit: (color: ColorPickerColor | null) => void;\n startInteraction: () => void;\n endInteraction: () => void;\n /** A whole interaction in one: emits and commits. */\n change: (color: ColorPickerColor | null) => void;\n /** The trigger or the input: where a failed `required` check sends focus. */\n registerFocusTarget: (node: HTMLElement | null) => void;\n /** The format on screen: the fields' when they are shown, else `format`. */\n shownFormat: ColorPickerFormat;\n setFieldsFormat: (format: ColorPickerFormat | null) => void;\n /** Writes the value to the clipboard, in the format on screen by default. */\n copy: (format?: ColorPickerFormat) => void;\n /** The format just copied, for 1.5 seconds, so its button can confirm. */\n copied: ColorPickerFormat | null;\n};\n\nconst ColorPickerContext = createContext<ColorPickerContextValue | null>(null);\n\n/** \"inline\" unless a part renders inside `ColorPickerContent`. */\nconst SurfaceContext = createContext<\"inline\" | \"popup\">(\"inline\");\n\nfunction useColorPickerContext(part: string) {\n const context = useContext(ColorPickerContext);\n if (!context) throw new Error(`${part} must be used within a ColorPicker`);\n return context;\n}\n\nexport type ColorPickerApi = {\n /** The value as emitted, or `null`. */\n value: string | null;\n color: ColorPickerColor | null;\n format: ColorPickerFormat;\n open: boolean;\n setOpen: (open: boolean) => void;\n /** Commits any color `parseColor` reads; `null` or `\"\"` clears, anything else is ignored. */\n setValue: (value: string | null) => void;\n clear: () => void;\n};\n\n/** The picker's state and actions, inside a `ColorPicker`. */\nexport function useColorPicker(): ColorPickerApi {\n const context = useColorPickerContext(\"useColorPicker\");\n return {\n value: context.value,\n color: context.color,\n format: context.format,\n open: context.open,\n setOpen: context.setOpen,\n setValue: (value) => {\n if (!value) return context.change(null);\n const parsed = parseColor(value);\n if (parsed) context.change(parsed);\n },\n clear: () => context.change(null),\n };\n}\n\nfunction assignRef<T>(ref: Ref<T> | undefined, node: T | null) {\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Root */\n/* -------------------------------------------------------------------------- */\n\nexport type ColorPickerProps = {\n /** Controlled value: any color `parseColor` reads. `null` is empty. */\n value?: string | null;\n defaultValue?: string | null;\n /** Fires on every change, a drag included, with the value in `format`. */\n onValueChange?: (value: string | null) => void;\n /** Fires once an interaction ends: a drag released, a key, a field, a swatch. */\n onValueCommit?: (value: string | null) => void;\n /** How the value is written. */\n format?: ColorPickerFormat;\n /** Adds the opacity slider and field, and lets the value carry alpha. */\n alpha?: boolean;\n /** Preset colors under the default panel. */\n swatches?: string[];\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n disabled?: boolean;\n readOnly?: boolean;\n invalid?: boolean;\n /** Submits the value with a native form under this name. */\n name?: string;\n form?: string;\n required?: boolean;\n /** The hidden form field, for form libraries that focus a field on error. */\n inputRef?: Ref<HTMLInputElement>;\n /** Lands on the trigger or the input. */\n id?: string;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n i18n?: ColorPickerI18nOverrides;\n /** Without children the picker renders a trigger and a popover; these reach the trigger. */\n placeholder?: string;\n className?: string;\n children?: ReactNode;\n};\n\nexport function ColorPicker({\n value,\n defaultValue = null,\n onValueChange,\n onValueCommit,\n format = \"hex\",\n alpha = false,\n swatches,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n disabled = false,\n readOnly = false,\n invalid = false,\n name,\n form,\n required = false,\n inputRef,\n id: idProp,\n \"aria-label\": label,\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy,\n i18n: i18nProp,\n placeholder,\n className,\n children,\n}: ColorPickerProps) {\n const generatedId = useId();\n const id = idProp ?? generatedId;\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n /* What a form reset restores, as a native field returns to its default. */\n const [initialValue] = useState(defaultValue);\n const [openState, setOpenState] = useState(defaultOpen);\n const open = openProp ?? openState;\n const raw = (value !== undefined ? value : uncontrolled) || null;\n\n /* The channels behind the value, kept in the space they were edited in. A\n value from outside is parsed afresh; one this picker emitted keeps its\n channels, so the hue of a gray and an OKLCH chroma survive. */\n const [held, setHeld] = useState(() => ({\n value: raw,\n color: parseColor(raw),\n }));\n let color = held.color;\n if (held.value !== raw) {\n color = parseColor(raw);\n setHeld({ value: raw, color });\n }\n if (color && !alpha && color.alpha !== 1) color = { ...color, alpha: 1 };\n const display = color ?? EMPTY_COLOR;\n\n const latest = useRef({ value: raw, color: display });\n useLayoutEffect(() => {\n latest.current = { value: raw, color: display };\n });\n const interaction = useRef<{ from: string | null } | null>(null);\n const focusTarget = useRef<HTMLElement | null>(null);\n const fieldRef = useRef<HTMLInputElement | null>(null);\n const resetRef = useRef(() => {});\n const i18n = mergeColorPickerI18n(i18nProp);\n const editable = !disabled && !readOnly;\n\n const setOpen = (next: boolean) => {\n if (next && disabled) return;\n if (openProp === undefined) setOpenState(next);\n onOpenChange?.(next);\n };\n\n const canonical = (text: string | null) => {\n const parsed = parseColor(text);\n if (!parsed) return null;\n return formatColor(alpha ? parsed : { ...parsed, alpha: 1 }, format);\n };\n\n const emit = (next: ColorPickerColor | null) => {\n if (!editable) return;\n const normalized = next && !alpha ? { ...next, alpha: 1 } : next;\n const nextValue = normalized ? formatColor(normalized, format) : null;\n const previous = latest.current.value;\n /* The same color written another way, `#FF0000` for `#ff0000`, keeps its\n string: no change is emitted that nobody made. */\n const same = nextValue === previous || nextValue === canonical(previous);\n const kept = same ? previous : nextValue;\n latest.current = { value: kept, color: normalized ?? EMPTY_COLOR };\n setHeld({ value: kept, color: normalized });\n if (same) return;\n if (value === undefined) setUncontrolled(nextValue);\n onValueChange?.(nextValue);\n };\n\n const startInteraction = () => {\n interaction.current = { from: latest.current.value };\n };\n\n const endInteraction = () => {\n const started = interaction.current;\n interaction.current = null;\n if (started && started.from !== latest.current.value) {\n onValueCommit?.(latest.current.value);\n }\n };\n\n /* The fields report the format they show, so a copy takes what is seen. */\n const [fieldsFormat, setFieldsFormat] = useState<ColorPickerFormat | null>(null);\n const shownFormat = fieldsFormat ?? format;\n const [copied, setCopied] = useState<ColorPickerFormat | null>(null);\n const copiedTimer = useRef(0);\n useEffect(() => () => window.clearTimeout(copiedTimer.current), []);\n\n const context: ColorPickerContextValue = {\n id,\n value: raw,\n text: color\n ? format === \"hex\"\n ? formatColor(color, format).toUpperCase()\n : formatColor(color, format)\n : null,\n color,\n display,\n format,\n alpha,\n i18n,\n disabled,\n readOnly,\n editable,\n invalid,\n required,\n label,\n labelledBy,\n describedBy,\n swatches,\n open,\n setOpen,\n getColor: () => latest.current.color,\n emit,\n startInteraction,\n endInteraction,\n change: (next) => {\n startInteraction();\n emit(next);\n endInteraction();\n },\n registerFocusTarget: (node) => {\n if (node) focusTarget.current = node;\n },\n shownFormat,\n setFieldsFormat,\n copy: (to = shownFormat) => {\n if (!color) return;\n navigator.clipboard?.writeText(formatColor(color, to)).then(\n () => {\n setCopied(to);\n window.clearTimeout(copiedTimer.current);\n copiedTimer.current = window.setTimeout(() => setCopied(null), 1500);\n },\n /* No clipboard permission: nothing was copied, nothing to confirm. */\n () => {},\n );\n },\n copied,\n };\n\n useEffect(() => {\n resetRef.current = () => context.change(parseColor(initialValue));\n });\n\n /* Listens on the field's own root and asks for its form at reset time, so a\n `form` attribute is honoured. The restore waits a task, like a native\n reset's default action, because any listener may still cancel it. */\n const hasField = !!name || required;\n useEffect(() => {\n const root = fieldRef.current?.getRootNode();\n if (!root) return;\n let pending = 0;\n const onReset = (event: Event) => {\n if (event.target !== fieldRef.current?.form) return;\n pending = window.setTimeout(() => {\n if (!event.defaultPrevented) resetRef.current();\n });\n };\n root.addEventListener(\"reset\", onReset, true);\n return () => {\n root.removeEventListener(\"reset\", onReset, true);\n window.clearTimeout(pending);\n };\n }, []);\n\n return (\n <ColorPickerContext.Provider value={context}>\n <Popover open={open} onOpenChange={(next) => setOpen(next)}>\n {children === undefined ? (\n <>\n <ColorPickerTrigger className={className} placeholder={placeholder} />\n <ColorPickerContent />\n </>\n ) : (\n children\n )}\n </Popover>\n <span role=\"status\" className=\"sr-only\">\n {copied ? i18n.labels.copied : \"\"}\n </span>\n {hasField && (\n <input\n ref={(node) => {\n fieldRef.current = node;\n assignRef(inputRef, node);\n }}\n type=\"text\"\n name={name}\n form={form}\n required={required && !readOnly}\n disabled={disabled}\n value={color ? formatColor(color, format) : \"\"}\n onChange={() => {}}\n tabIndex={-1}\n aria-hidden=\"true\"\n data-slot=\"color-picker-field\"\n /* A failed `required` check focuses this field; hand that to the control. */\n onFocus={(event) => {\n const target =\n (focusTarget.current?.isConnected ? focusTarget.current : null) ??\n event.currentTarget.ownerDocument.getElementById(`${id}-area`);\n if (target) target.focus();\n else event.currentTarget.blur();\n }}\n className=\"pointer-events-none absolute size-px max-w-px opacity-0\"\n />\n )}\n </ColorPickerContext.Provider>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Swatch */\n/* -------------------------------------------------------------------------- */\n\n/* The inset ring keeps a white swatch visible on a white surface. */\nconst SWATCH_CLASS =\n \"forced-color-adjust-none relative inline-flex size-4 shrink-0 after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:inset-ring after:inset-ring-foreground/10\";\n\n/* A small square chip takes the shadcn Checkbox's radius in each style. */\nconst SWATCH_SQUARE = \"rounded-[4px]\";\n\n/* A slash through an empty swatch, the convention for \"no color\". */\nconst EMPTY_SWATCH =\n \"linear-gradient(to top right, transparent calc(50% - 0.75px), var(--color-destructive) calc(50% - 0.75px) calc(50% + 0.75px), transparent calc(50% + 0.75px))\";\n\nfunction swatchBackground(color: ColorPickerColor | null) {\n if (!color) return EMPTY_SWATCH;\n const css = toCss(color);\n return color.alpha < 1 ? `linear-gradient(${css}, ${css}), ${CHECKER}` : css;\n}\n\nexport type ColorPickerSwatchProps = Omit<ComponentProps<\"span\">, \"color\"> & {\n /** The color to show. Defaults to the picker's value, so it also works outside one. */\n color?: string | null;\n /** `square` follows each style's radius; `circle` is round in all of them. */\n shape?: \"square\" | \"circle\";\n};\n\n/** A color chip: the value in a trigger, or any color in a table or a legend. */\nexport function ColorPickerSwatch({\n color: colorProp,\n shape = \"square\",\n className,\n style,\n ...props\n}: ColorPickerSwatchProps) {\n const context = useContext(ColorPickerContext);\n const color = colorProp !== undefined ? parseColor(colorProp) : (context?.color ?? null);\n const labelled = !!props[\"aria-label\"] || !!props[\"aria-labelledby\"];\n return (\n <span\n role={labelled ? \"img\" : undefined}\n aria-hidden={labelled ? undefined : true}\n data-slot=\"color-picker-swatch\"\n data-empty={color ? undefined : \"\"}\n className={cn(SWATCH_CLASS, shape === \"circle\" ? \"rounded-full\" : SWATCH_SQUARE, className)}\n style={{ background: swatchBackground(color), ...style }}\n {...props}\n />\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Triggers */\n/* -------------------------------------------------------------------------- */\n\nconst CHEVRON_ICON = <ChevronDownIcon aria-hidden=\"true\" />;\n\nexport type ColorPickerValueProps = Omit<ComponentProps<\"span\">, \"children\"> & {\n placeholder?: ReactNode;\n};\n\n/** The value as text, or the placeholder. For custom trigger content. */\nexport function ColorPickerValue({ placeholder, className, ...props }: ColorPickerValueProps) {\n const context = useColorPickerContext(\"ColorPickerValue\");\n return (\n <span\n data-slot=\"color-picker-value\"\n data-placeholder={context.color ? undefined : \"\"}\n className={cn(\"truncate\", className)}\n {...props}\n >\n {context.text ?? placeholder ?? context.i18n.labels.placeholder}\n </span>\n );\n}\n\n/* `normal-case` and `tracking-normal` undo sera's uppercase button text: the\n trigger reads as a field, not an action. */\nconst TRIGGER_CLASS =\n \"font-normal normal-case tracking-normal tabular-nums data-placeholder:text-muted-foreground\";\n\nexport type ColorPickerTriggerProps = ComponentProps<typeof Button> & {\n placeholder?: ReactNode;\n};\n\n/** A shadcn Button that opens the picker. Children replace the swatch, value and chevron. */\nexport function ColorPickerTrigger({\n className,\n variant = \"outline\",\n placeholder,\n children,\n ref,\n ...props\n}: ColorPickerTriggerProps) {\n const context = useColorPickerContext(\"ColorPickerTrigger\");\n const labelledBy = props[\"aria-labelledby\"] ?? context.labelledBy;\n const buttonProps = {\n variant,\n disabled: context.disabled,\n \"aria-label\": context.label,\n \"aria-describedby\": context.describedBy,\n ...(context.invalid && { \"aria-invalid\": true, \"data-invalid\": \"\" }),\n ...props,\n /* The label, then the button's own text: a label alone would replace the\n value, or whatever custom children show. */\n \"aria-labelledby\": labelledBy ? `${labelledBy} ${context.id}` : undefined,\n onKeyDown: (event: Parameters<NonNullable<typeof props.onKeyDown>>[0]) => {\n props.onKeyDown?.(event);\n if (!event.defaultPrevented) copyOnShortcut(event, context);\n },\n id: context.id,\n ref: (node: HTMLButtonElement | null) => {\n context.registerFocusTarget(node);\n assignRef(ref, node);\n },\n \"data-slot\": \"color-picker-trigger\",\n \"data-placeholder\": context.color ? undefined : \"\",\n className: cn(TRIGGER_CLASS, children === undefined && \"justify-start\", className),\n };\n const content =\n children === undefined ? (\n <>\n <ColorPickerSwatch data-icon=\"inline-start\" />\n <ColorPickerValue placeholder={placeholder} className=\"flex-1 text-start\" />\n <span data-icon=\"inline-end\" aria-hidden=\"true\" className=\"text-muted-foreground flex\">\n {CHEVRON_ICON}\n </span>\n </>\n ) : (\n children\n );\n\n return (\n <PopoverTrigger id={context.id} render={<Button {...buttonProps} />}>\n {content}\n </PopoverTrigger>\n );\n}\n\nexport type ColorPickerInputProps = Omit<\n ComponentProps<typeof InputGroupInput>,\n \"value\" | \"defaultValue\"\n>;\n\n/**\n * A typable field with a swatch button that opens the picker. It reads any\n * CSS color the browser knows, named colors included, on blur and Enter;\n * Escape restores the value and Alt+ArrowDown opens the popover.\n */\nexport function ColorPickerInput({\n className,\n placeholder,\n onBlur,\n onKeyDown,\n onChange,\n ref,\n ...props\n}: ColorPickerInputProps) {\n const context = useColorPickerContext(\"ColorPickerInput\");\n /* `null` while the field shows the value rather than an edit in progress. */\n const [text, setText] = useState<string | null>(null);\n const current = context.text ?? \"\";\n const shown = text ?? current;\n const fieldRef = useRef<HTMLInputElement | null>(null);\n useEscapeRevert(fieldRef, text !== null, () => setText(null));\n\n const read = () => {\n if (text === null) return;\n setText(null);\n if (text === current) return;\n if (!text.trim()) return context.change(null);\n const typed = parseColor(text) ?? parseWithBrowser(text.trim());\n if (typed) context.change(typed);\n };\n\n const swatchProps = {\n size: \"icon-xs\" as const,\n disabled: context.disabled,\n \"aria-label\": context.i18n.labels.openPicker,\n \"data-slot\": \"color-picker-input-trigger\",\n };\n\n return (\n <InputGroup\n data-slot=\"color-picker-input\"\n data-disabled={context.disabled ? \"\" : undefined}\n className={className}\n >\n <InputGroupAddon align=\"inline-start\">\n <PopoverTrigger render={<InputGroupButton {...swatchProps} />}>\n <ColorPickerSwatch />\n </PopoverTrigger>\n </InputGroupAddon>\n <InputGroupInput\n value={shown}\n placeholder={placeholder ?? context.i18n.labels.placeholder}\n disabled={context.disabled}\n readOnly={context.readOnly}\n required={context.required}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n autoCapitalize=\"off\"\n spellCheck={false}\n aria-keyshortcuts=\"Alt+ArrowDown\"\n aria-label={context.label}\n aria-labelledby={context.labelledBy}\n aria-describedby={context.describedBy}\n aria-invalid={context.invalid || undefined}\n className=\"tabular-nums\"\n onChange={(event) => {\n onChange?.(event);\n setText(event.target.value);\n }}\n onBlur={(event) => {\n onBlur?.(event);\n read();\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || copyOnShortcut(event, context)) return;\n if (event.key === \"Enter\") {\n /* Flushed, so an implicit form submit reads the new value. */\n flushSync(() => read());\n } else if (event.altKey && event.key === \"ArrowDown\") {\n event.preventDefault();\n read();\n context.setOpen(true);\n }\n }}\n {...props}\n id={context.id}\n ref={(node: HTMLInputElement | null) => {\n fieldRef.current = node;\n context.registerFocusTarget(node);\n assignRef(ref, node);\n }}\n />\n </InputGroup>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Panel */\n/* -------------------------------------------------------------------------- */\n\nconst TABBABLE =\n 'button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])';\n\nexport type ColorPickerContentProps = ComponentProps<typeof PopoverContent>;\n\n/**\n * The popover: the default panel unless given children. Tab cycles inside\n * it, as in a date picker dialog, in both twins.\n */\nexport function ColorPickerContent({\n className,\n align = \"start\",\n onKeyDown,\n children,\n ...props\n}: ColorPickerContentProps) {\n const context = useColorPickerContext(\"ColorPickerContent\");\n return (\n <PopoverContent\n align={align}\n aria-labelledby={context.labelledBy}\n aria-label={\n context.labelledBy ? undefined : (context.label ?? context.i18n.labels.panelLabel)\n }\n /* OKLCH with opacity needs the extra width for its four fields, and\n more below md, where the shadcn input's text grows to 16px so iOS\n does not zoom on focus. Capped to the viewport. A variable, not\n md:w-*, so one plain w-* in className wins at every breakpoint. */\n className={cn(\n \"w-(--color-picker-content-width) max-w-[calc(100vw-1rem)]\",\n context.alpha\n ? \"[--color-picker-content-width:--spacing(96)] md:[--color-picker-content-width:--spacing(84)]\"\n : \"[--color-picker-content-width:--spacing(72)]\",\n className,\n )}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || event.key !== \"Tab\") return;\n if (event.altKey || event.ctrlKey || event.metaKey) return;\n const items = Array.from(event.currentTarget.querySelectorAll<HTMLElement>(TABBABLE));\n const active = event.currentTarget.ownerDocument.activeElement;\n const first = items[0];\n const last = items[items.length - 1];\n if (!event.shiftKey && active === last) {\n event.preventDefault();\n first?.focus();\n } else if (event.shiftKey && active === first) {\n event.preventDefault();\n last?.focus();\n }\n }}\n {...props}\n >\n <SurfaceContext.Provider value=\"popup\">\n {children === undefined ? <ColorPickerPanel /> : children}\n </SurfaceContext.Provider>\n </PopoverContent>\n );\n}\n\n/* Bespoke spacing, a step tighter than each style's popover gap: the area,\n the sliders and the fields read as one control. */\nconst PANEL_CLASS = \"flex w-full min-w-0 flex-col gap-2.5\";\n\nexport type ColorPickerPanelProps = ComponentProps<\"div\">;\n\n/**\n * The area, the sliders, the fields and any `swatches`, rendered in place:\n * put it straight inside a `ColorPicker` for an always-open picker.\n */\nexport function ColorPickerPanel({ className, children, ...props }: ColorPickerPanelProps) {\n const context = useColorPickerContext(\"ColorPickerPanel\");\n const inline = useContext(SurfaceContext) === \"inline\";\n return (\n <div\n role={inline ? \"group\" : undefined}\n aria-labelledby={inline ? context.labelledBy : undefined}\n aria-label={\n inline && !context.labelledBy\n ? (context.label ?? context.i18n.labels.panelLabel)\n : undefined\n }\n data-slot=\"color-picker-panel\"\n data-disabled={context.disabled ? \"\" : undefined}\n className={cn(PANEL_CLASS, className)}\n {...props}\n >\n {children === undefined ? (\n <>\n <ColorPickerArea />\n <div className=\"flex items-center gap-3\">\n <ColorPickerEyeDropper />\n <div className=\"flex min-w-0 flex-1 flex-col gap-2.5\">\n <ColorPickerSlider channel=\"hue\" />\n {context.alpha && <ColorPickerSlider channel=\"alpha\" />}\n </div>\n <ColorPickerCopy />\n </div>\n <ColorPickerFields />\n {context.swatches && context.swatches.length > 0 && (\n <ColorPickerSwatches colors={context.swatches} />\n )}\n </>\n ) : (\n children\n )}\n </div>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Controls */\n/* -------------------------------------------------------------------------- */\n\n/* Cmd+C or Ctrl+C on a control with nothing selected copies the value in the\n format on screen. A selection in a field keeps the browser's own copy. */\nfunction copyOnShortcut(event: ReactKeyboardEvent<HTMLElement>, context: ColorPickerContextValue) {\n if (\n !(event.metaKey || event.ctrlKey) ||\n event.altKey ||\n event.shiftKey ||\n event.key.toLowerCase() !== \"c\" ||\n !context.color\n ) {\n return false;\n }\n const target = event.target;\n const selected =\n target instanceof HTMLInputElement\n ? target.selectionStart !== target.selectionEnd\n : !!event.currentTarget.ownerDocument.getSelection()?.toString();\n if (selected) return false;\n event.preventDefault();\n context.copy();\n return true;\n}\n\n/* While a field holds an edit, Escape puts the value back and stops there.\n Both popover libraries close on a document listener, which an element\n handler runs too late to stop, so this one listens on the window first. */\nfunction useEscapeRevert(\n field: { current: HTMLElement | null },\n editing: boolean,\n revert: () => void,\n) {\n const revertRef = useRef(revert);\n useLayoutEffect(() => {\n revertRef.current = revert;\n });\n useEffect(() => {\n const view = field.current?.ownerDocument.defaultView;\n if (!editing || !view) return;\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.target !== field.current) return;\n event.preventDefault();\n event.stopPropagation();\n revertRef.current();\n };\n view.addEventListener(\"keydown\", onKeyDown, true);\n return () => view.removeEventListener(\"keydown\", onKeyDown, true);\n }, [editing, field]);\n}\n\n/* Thumbs copy the shadcn Slider thumb in each style: its shape (round,\n squircle in mira, square in lyra and sera) and its keyboard ring, drawn on\n the thumb while its control has focus. */\nconst THUMB_CLASS =\n \"pointer-events-none absolute size-(--color-picker-thumb-size) -translate-x-1/2 -translate-y-1/2 border-2 border-white shadow-[0_0_0_1px_rgb(0_0_0/0.12),0_1px_3px_rgb(0_0_0/0.3)] transition-[box-shadow] rounded-full ring-ring/50 group-focus-visible/color-picker-control:ring-3 forced-colors:outline-2 forced-colors:outline-solid\";\n\n/* A hairline inside the edge, so the white corner of the area and the light\n end of a track stay visible on a white surface. */\nconst EDGE_CLASS =\n \"after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:inset-ring after:inset-ring-foreground/10\";\n\nconst CONTROL_CLASS =\n \"group/color-picker-control relative outline-none [--color-picker-thumb-size:calc(var(--spacing)*4)] select-none aria-disabled:pointer-events-none aria-disabled:opacity-50 data-dragging:cursor-grabbing\";\n\n/* Where the pointer sits, 0 to 1 each way, over a travel `inset` pixels\n shorter than the element: a slider thumb stays inside its track. */\nfunction pointerRatio(event: ReactPointerEvent<HTMLElement>, element: HTMLElement, inset = 0) {\n const rect = element.getBoundingClientRect();\n const ratio = (offset: number, size: number) =>\n size > inset ? clamp((offset - inset / 2) / (size - inset), 0, 1) : 0;\n return {\n x: ratio(event.clientX - rect.left, rect.width),\n y: ratio(event.clientY - rect.top, rect.height),\n };\n}\n\n/* A point along a slider's travel, inset by half a thumb at each end. */\nconst travel = (fraction: number) =>\n `calc(var(--color-picker-thumb-size) / 2 + (100% - var(--color-picker-thumb-size)) * ${fraction})`;\n\n/* Pointer drags shared by the area, the sliders and the wheel. The pointer is\n captured, so a drag carries on outside the control, and the browser's own\n mousedown focuses it, so a click never paints the keyboard ring. */\nfunction useDrag(\n context: ColorPickerContextValue,\n update: (event: ReactPointerEvent<HTMLElement>, element: HTMLElement) => void,\n) {\n const pointer = useRef<number | null>(null);\n const [dragging, setDragging] = useState(false);\n const end = (event: ReactPointerEvent<HTMLElement>) => {\n if (pointer.current !== event.pointerId) return;\n pointer.current = null;\n setDragging(false);\n context.endInteraction();\n };\n return {\n dragging,\n handlers: {\n onPointerDown: (event: ReactPointerEvent<HTMLElement>) => {\n if (event.button !== 0 || !context.editable) return;\n pointer.current = event.pointerId;\n event.currentTarget.setPointerCapture?.(event.pointerId);\n setDragging(true);\n context.startInteraction();\n update(event, event.currentTarget);\n },\n onPointerMove: (event: ReactPointerEvent<HTMLElement>) => {\n if (pointer.current === event.pointerId) {\n update(event, event.currentTarget);\n }\n },\n onPointerUp: end,\n onPointerCancel: end,\n },\n };\n}\n\n/* Arrows move a step, ten with Shift; Page keys ten; Home and End the ends. */\nfunction keyDelta(event: ReactKeyboardEvent, step: number) {\n const size = event.shiftKey ? step * 10 : step;\n switch (event.key) {\n case \"ArrowUp\":\n case \"ArrowRight\":\n return size;\n case \"ArrowDown\":\n case \"ArrowLeft\":\n return -size;\n case \"PageUp\":\n return step * 10;\n case \"PageDown\":\n return -step * 10;\n case \"Home\":\n return -Infinity;\n case \"End\":\n return Infinity;\n }\n return null;\n}\n\nconst snap = (value: number, step: number) => Number((Math.round(value / step) * step).toFixed(4));\n\n/* Both ends of the area run 0 to 100: saturation across, brightness up. */\nconst AREA_CLASS =\n \"forced-color-adjust-none h-40 w-full touch-none bg-[linear-gradient(to_top,#000,transparent),linear-gradient(to_right,#fff,transparent)] rounded-md\";\n\nexport type ColorPickerAreaProps = ComponentProps<\"div\">;\n\n/**\n * The saturation and brightness square, at the current hue. A single slider\n * to assistive tech, whose value text names both channels and the color.\n * Arrows move it, Shift by ten, Page keys move brightness.\n */\nexport function ColorPickerArea({ className, style, onKeyDown, ...props }: ColorPickerAreaProps) {\n const context = useColorPickerContext(\"ColorPickerArea\");\n const { labels } = context.i18n;\n const [hue, saturation, brightness] = toSpace(context.display, \"hsv\");\n const set = (s: number, v: number) => {\n const [h] = toSpace(context.getColor(), \"hsv\");\n context.emit({\n space: \"hsv\",\n channels: [h, clamp(s, 0, 100), clamp(v, 0, 100)],\n alpha: context.getColor().alpha,\n });\n };\n const { dragging, handlers } = useDrag(context, (event, element) => {\n const { x, y } = pointerRatio(event, element);\n set(x * 100, (1 - y) * 100);\n });\n\n return (\n <div\n id={`${context.id}-area`}\n role=\"slider\"\n tabIndex={context.disabled ? -1 : 0}\n aria-label={labels.area}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={Math.round(saturation)}\n aria-valuetext={`${labels.saturation} ${Math.round(saturation)}%, ${labels.brightness} ${Math.round(brightness)}%, ${context.i18n.functions.getColorName(context.display)}`}\n aria-disabled={context.disabled || undefined}\n aria-readonly={context.readOnly || undefined}\n dir=\"ltr\"\n data-slot=\"color-picker-area\"\n data-dragging={dragging ? \"\" : undefined}\n className={cn(CONTROL_CLASS, EDGE_CLASS, AREA_CLASS, className)}\n style={{ backgroundColor: `hsl(${hue} 100% 50%)`, ...style }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || copyOnShortcut(event, context)) return;\n if (!context.editable) return;\n const delta = keyDelta(event, 1);\n if (delta === null) return;\n event.preventDefault();\n const vertical =\n event.key === \"ArrowUp\" || event.key === \"ArrowDown\" || event.key.startsWith(\"Page\");\n context.startInteraction();\n /* Only the channel that moves is rounded to the step. */\n if (vertical) set(saturation, Math.round(brightness) + delta);\n else set(Math.round(saturation) + delta, brightness);\n context.endInteraction();\n }}\n {...handlers}\n {...props}\n >\n <div\n data-slot=\"color-picker-area-thumb\"\n className={THUMB_CLASS}\n style={{ left: `${saturation}%`, top: `${100 - brightness}%` }}\n />\n </div>\n );\n}\n\n/* Track thickness is the primitive's own; the radius follows the shadcn\n Slider track in each style. Vertical tracks default to the area's height. */\n/* A horizontal track fills its row and shrinks beside a sibling (an eye\n dropper); min-h-3 keeps its height in a column. A vertical one never shrinks.\n Every color surface opts out of forced colors, which would paint it over\n with a system color and drop its gradient: the color is the content. */\nconst SLIDER_CLASS =\n \"forced-color-adjust-none data-[orientation=horizontal]:h-3 data-[orientation=horizontal]:min-h-3 data-[orientation=horizontal]:w-full data-[orientation=horizontal]:min-w-0 data-[orientation=horizontal]:touch-pan-y data-[orientation=vertical]:h-40 data-[orientation=vertical]:shrink-0 data-[orientation=vertical]:w-3 data-[orientation=vertical]:touch-pan-x rounded-full\";\n\nexport type ColorPickerSliderProps = Omit<ComponentProps<\"div\">, \"children\"> & {\n channel: ColorPickerChannel;\n /** The space the channel belongs to. Defaults to HSB for hue, saturation and brightness, HSL for lightness, OKLCH for chroma and RGB for red, green and blue. */\n colorSpace?: ColorPickerColorSpace;\n orientation?: \"horizontal\" | \"vertical\";\n};\n\n/** One channel as a gradient track. Vertical tracks run bottom to top. */\nexport function ColorPickerSlider({\n channel,\n colorSpace,\n orientation = \"horizontal\",\n className,\n style,\n onKeyDown,\n ...props\n}: ColorPickerSliderProps) {\n const context = useColorPickerContext(\"ColorPickerSlider\");\n const space = resolveSpace(channel, colorSpace);\n const { max, step } = channelRange(space, channel);\n const precision = channel === \"chroma\" ? 0.001 : step;\n const value = readChannel(context.display, space, channel);\n const vertical = orientation === \"vertical\";\n const set = (next: number) => {\n context.emit(\n withChannel(context.getColor(), space, channel, clamp(snap(next, precision), 0, max)),\n );\n };\n const { dragging, handlers } = useDrag(context, (event, element) => {\n const thumb = element.lastElementChild as HTMLElement | null;\n const inset = (vertical ? thumb?.offsetHeight : thumb?.offsetWidth) ?? 0;\n const { x, y } = pointerRatio(event, element, inset);\n set((vertical ? 1 - y : x) * max);\n });\n /* Stops follow the thumb's travel, so the color under its center is the\n value's own. */\n const colors = trackStops(context.display, space, channel);\n const stops = colors.map((color, index) => `${color} ${travel(index / (colors.length - 1))}`);\n const gradient = `linear-gradient(${vertical ? \"to top\" : \"to right\"}, ${stops.join(\", \")})`;\n const fraction = clamp(value, 0, max) / max;\n const scale = channel === \"alpha\" ? 100 : 1;\n\n return (\n <div\n role=\"slider\"\n tabIndex={context.disabled ? -1 : 0}\n aria-label={context.i18n.labels[channel]}\n aria-orientation={orientation}\n aria-valuemin={0}\n aria-valuemax={max * scale}\n aria-valuenow={Number((value * scale).toFixed(3))}\n aria-valuetext={channelValueText(context.display, space, channel, context.i18n)}\n aria-disabled={context.disabled || undefined}\n aria-readonly={context.readOnly || undefined}\n dir=\"ltr\"\n data-slot=\"color-picker-slider\"\n data-channel={channel}\n data-orientation={orientation}\n data-dragging={dragging ? \"\" : undefined}\n className={cn(CONTROL_CLASS, EDGE_CLASS, SLIDER_CLASS, className)}\n style={{\n background: channel === \"alpha\" ? `${gradient}, ${CHECKER}` : gradient,\n ...style,\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || copyOnShortcut(event, context)) return;\n if (!context.editable) return;\n const delta = keyDelta(event, step);\n if (delta === null) return;\n event.preventDefault();\n context.startInteraction();\n set(snap(value, step) + delta);\n context.endInteraction();\n }}\n {...handlers}\n {...props}\n >\n <div\n data-slot=\"color-picker-slider-thumb\"\n className={THUMB_CLASS}\n style={\n vertical\n ? { left: \"50%\", top: travel(1 - fraction) }\n : { left: travel(fraction), top: \"50%\" }\n }\n />\n </div>\n );\n}\n\n/* Hue 0 at the top, increasing clockwise, as a conic gradient starts. The\n ring is a masked layer of its own, so the thumb and its focus ring are\n never masked with it. */\nconst WHEEL_RING_CLASS =\n \"forced-color-adjust-none pointer-events-none absolute inset-0 rounded-full bg-[conic-gradient(#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)] mask-[radial-gradient(farthest-side,transparent_calc(100%-var(--color-picker-wheel-thickness)),#000_calc(100%-var(--color-picker-wheel-thickness)+1px))]\";\n\nexport type ColorPickerWheelProps = ComponentProps<\"div\">;\n\n/**\n * A hue ring. Children fill the square inscribed in its hole: an area there\n * gives the classic ring-and-square picker. `--color-picker-wheel-thickness`\n * sets the ring's width.\n */\nexport function ColorPickerWheel({\n className,\n children,\n onKeyDown,\n ...props\n}: ColorPickerWheelProps) {\n const context = useColorPickerContext(\"ColorPickerWheel\");\n const [hue] = toSpace(context.display, \"hsv\");\n const set = (next: number) => {\n context.emit(withChannel(context.getColor(), \"hsv\", \"hue\", wrapHue(Math.round(next))));\n };\n const { dragging, handlers } = useDrag(context, (event, element) => {\n const rect = element.getBoundingClientRect();\n const x = event.clientX - rect.left - rect.width / 2;\n const y = event.clientY - rect.top - rect.height / 2;\n set((Math.atan2(x, -y) * 180) / Math.PI);\n });\n /* Only the ring starts a drag. The thumb rides the ring's middle, so the\n hole's edge is that radius times two, less the outer radius. */\n const onPointerDown = (event: ReactPointerEvent<HTMLElement>) => {\n const rect = event.currentTarget.getBoundingClientRect();\n const thumb = event.currentTarget\n .querySelector(\"[data-slot=color-picker-wheel-thumb]\")\n ?.getBoundingClientRect();\n if (thumb) {\n const centerX = rect.left + rect.width / 2;\n const centerY = rect.top + rect.height / 2;\n const middle = Math.hypot(\n thumb.left + thumb.width / 2 - centerX,\n thumb.top + thumb.height / 2 - centerY,\n );\n const inner = 2 * middle - rect.width / 2;\n const distance = Math.hypot(event.clientX - centerX, event.clientY - centerY);\n if (distance < inner - 2) return;\n }\n handlers.onPointerDown(event);\n };\n const angle = (hue * Math.PI) / 180;\n const radius = \"(50% - var(--color-picker-wheel-thickness) / 2)\";\n\n return (\n <div\n data-slot=\"color-picker-wheel\"\n className={cn(\n \"relative size-48 shrink-0 [--color-picker-wheel-thickness:calc(var(--spacing)*5)]\",\n className,\n )}\n {...props}\n >\n <div\n role=\"slider\"\n tabIndex={context.disabled ? -1 : 0}\n aria-label={context.i18n.labels.hue}\n aria-valuemin={0}\n aria-valuemax={360}\n aria-valuenow={Math.round(hue)}\n aria-valuetext={channelValueText(context.display, \"hsv\", \"hue\", context.i18n)}\n aria-disabled={context.disabled || undefined}\n aria-readonly={context.readOnly || undefined}\n data-slot=\"color-picker-wheel-track\"\n data-dragging={dragging ? \"\" : undefined}\n className={cn(CONTROL_CLASS, \"absolute inset-0 touch-none rounded-full\")}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || copyOnShortcut(event, context)) return;\n if (!context.editable) return;\n const delta = keyDelta(event, 1);\n if (delta === null) return;\n event.preventDefault();\n context.startInteraction();\n set(Number.isFinite(delta) ? Math.round(hue) + delta : delta > 0 ? 359 : 0);\n context.endInteraction();\n }}\n {...handlers}\n onPointerDown={onPointerDown}\n >\n <div className={WHEEL_RING_CLASS} />\n <div\n data-slot=\"color-picker-wheel-thumb\"\n className={THUMB_CLASS}\n style={{\n left: `calc(50% + ${radius} * ${Math.sin(angle)})`,\n top: `calc(50% - ${radius} * ${Math.cos(angle)})`,\n }}\n />\n </div>\n {children !== undefined && (\n <div className=\"absolute inset-[calc(50%-(50%-var(--color-picker-wheel-thickness))*0.7071+var(--spacing)*1.5)] flex items-center justify-center\">\n {children}\n </div>\n )}\n </div>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Actions */\n/* -------------------------------------------------------------------------- */\n\ntype EyeDropperConstructor = new () => {\n open: (options?: { signal?: AbortSignal }) => Promise<{ sRGBHex: string }>;\n};\n\nconst getEyeDropper = () =>\n (window as unknown as { EyeDropper?: EyeDropperConstructor }).EyeDropper;\n\nconst noSubscribe = () => () => {};\n\nexport type ColorPickerActionProps = ComponentProps<typeof Button>;\n\n/**\n * Samples a color from anywhere on screen, keeping the current opacity.\n * Renders nothing where the browser has no EyeDropper (Firefox, Safari).\n */\nexport function ColorPickerEyeDropper({\n variant = \"ghost\",\n size = \"icon-sm\",\n onClick,\n children,\n ...props\n}: ColorPickerActionProps) {\n const context = useColorPickerContext(\"ColorPickerEyeDropper\");\n /* False on the server and in the first client render, so markup matches. */\n const supported = useSyncExternalStore(\n noSubscribe,\n () => !!getEyeDropper(),\n () => false,\n );\n if (!supported) return null;\n return (\n <Button\n type=\"button\"\n variant={variant}\n size={size}\n disabled={!context.editable}\n aria-label={context.i18n.labels.eyeDropper}\n data-slot=\"color-picker-eye-dropper\"\n onClick={async (event) => {\n onClick?.(event);\n const EyeDropper = getEyeDropper();\n if (event.defaultPrevented || !EyeDropper) return;\n try {\n const { sRGBHex } = await new EyeDropper().open();\n const picked = parseColor(sRGBHex);\n if (picked) {\n context.change({ ...picked, alpha: context.getColor().alpha });\n }\n } catch {\n /* Escape cancels the sampler with an AbortError. */\n }\n }}\n {...props}\n >\n {children === undefined ? <PipetteIcon aria-hidden=\"true\" /> : children}\n </Button>\n );\n}\n\nexport type ColorPickerCopyProps = ColorPickerActionProps & {\n /** The format copied. Defaults to the picker's. */\n format?: ColorPickerFormat;\n};\n\n/**\n * Copies the value and confirms for a moment, in `format` or, by default, the\n * format on screen: what the fields show, else the picker's.\n */\nexport function ColorPickerCopy({\n format,\n variant = \"ghost\",\n size = \"icon-sm\",\n onClick,\n children,\n ...props\n}: ColorPickerCopyProps) {\n const context = useColorPickerContext(\"ColorPickerCopy\");\n const target = format ?? context.shownFormat;\n const copied = context.copied === target;\n const { labels } = context.i18n;\n return (\n <Button\n type=\"button\"\n variant={variant}\n size={size}\n disabled={context.disabled || !context.color}\n aria-label={copied ? labels.copied : labels.copy}\n aria-keyshortcuts=\"Control+C Meta+C\"\n data-slot=\"color-picker-copy\"\n data-copied={copied ? \"\" : undefined}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) context.copy(target);\n }}\n {...props}\n >\n {children === undefined ? (\n copied ? (\n <CheckIcon aria-hidden=\"true\" />\n ) : (\n <CopyIcon aria-hidden=\"true\" />\n )\n ) : (\n children\n )}\n </Button>\n );\n}\n\n/**\n * Empties the value, for an optional color. It stays enabled while empty:\n * disabling itself on click would drop keyboard focus to the page.\n */\nexport function ColorPickerClear({\n variant = \"ghost\",\n size = \"sm\",\n onClick,\n children,\n ...props\n}: ColorPickerActionProps) {\n const context = useColorPickerContext(\"ColorPickerClear\");\n return (\n <Button\n type=\"button\"\n variant={variant}\n size={size}\n disabled={!context.editable}\n data-slot=\"color-picker-clear\"\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) context.change(null);\n }}\n {...props}\n >\n {children === undefined ? context.i18n.labels.clear : children}\n </Button>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Fields */\n/* -------------------------------------------------------------------------- */\n\ntype FieldChannel = ColorPickerChannel | \"hex\";\n\nconst FORMAT_FIELDS: Record<\n ColorPickerFormat,\n { space: ColorPickerColorSpace; channels: FieldChannel[] }\n> = {\n hex: { space: \"rgb\", channels: [\"hex\"] },\n rgb: { space: \"rgb\", channels: [\"red\", \"green\", \"blue\"] },\n hsl: { space: \"hsl\", channels: [\"hue\", \"saturation\", \"lightness\"] },\n hsb: { space: \"hsv\", channels: [\"hue\", \"saturation\", \"brightness\"] },\n oklch: { space: \"oklch\", channels: [\"lightness\", \"chroma\", \"hue\"] },\n};\n\nfunction channelText(color: ColorPickerColor, space: ColorPickerColorSpace, channel: FieldChannel) {\n if (channel === \"hex\") {\n return formatColor({ ...color, alpha: 1 }, \"hex\")\n .slice(1)\n .toUpperCase();\n }\n if (channel === \"alpha\") return `${Math.round(color.alpha * 100)}%`;\n const value = readChannel(color, space, channel);\n if (channel === \"chroma\") return fixed(value, 3);\n return space === \"oklch\" ? fixed(value, 1) : String(Math.round(value));\n}\n\nconst FIELD_NUMBER = /^([+-]?(?:\\d+(?:[.,]\\d*)?|[.,]\\d+))\\s*(%|°|deg|grad|rad|turn)?$/;\n\n/* A typed channel. Hex keeps the current opacity unless it carries its own.\n A number takes a comma decimal; % is a share of the channel's range, as in\n CSS (50% red is 127.5, 50% chroma 0.2), and a hue takes an angle unit and\n wraps, so -30 is 330. Anything else is rejected. */\nfunction readChannelText(\n text: string,\n color: ColorPickerColor,\n space: ColorPickerColorSpace,\n channel: FieldChannel,\n): ColorPickerColor | null {\n if (channel === \"hex\") {\n const digits = text.trim().replace(/^#/, \"\");\n const parsed = /^[\\da-f]+$/i.test(digits) ? parseColor(digits) : null;\n if (!parsed) return null;\n return digits.length === 4 || digits.length === 8 ? parsed : { ...parsed, alpha: color.alpha };\n }\n const match = FIELD_NUMBER.exec(text.trim().toLowerCase());\n if (!match) return null;\n const value = Number(match[1].replace(\",\", \".\"));\n const unit = match[2];\n if (!Number.isFinite(value)) return null;\n if (channel === \"hue\") {\n if (unit === \"%\") return null;\n const degrees =\n unit === \"rad\"\n ? (value * 180) / Math.PI\n : unit === \"grad\"\n ? value * 0.9\n : unit === \"turn\"\n ? value * 360\n : value;\n return withChannel(color, space, channel, wrapHue(degrees));\n }\n if (unit && unit !== \"%\") return null;\n if (channel === \"alpha\") return { ...color, alpha: clamp(value / 100, 0, 1) };\n const { max } = channelRange(space, channel);\n const scaled = unit === \"%\" ? (value * max) / 100 : value;\n return withChannel(color, space, channel, clamp(scaled, 0, max));\n}\n\nexport type ColorPickerChannelInputProps = Omit<\n ComponentProps<typeof InputGroupInput>,\n \"value\" | \"defaultValue\"\n> & {\n /** A channel, or `\"hex\"` for the six hex digits. */\n channel: FieldChannel;\n colorSpace?: ColorPickerColorSpace;\n};\n\n/**\n * One channel as a borderless field for an `InputGroup`. Text is read on blur\n * and Enter; ArrowUp and ArrowDown step it, Shift by ten.\n */\nexport function ColorPickerChannelInput({\n channel,\n colorSpace,\n className,\n onBlur,\n onKeyDown,\n onChange,\n ref,\n ...props\n}: ColorPickerChannelInputProps) {\n const context = useColorPickerContext(\"ColorPickerChannelInput\");\n const space = channel === \"hex\" ? \"rgb\" : resolveSpace(channel, colorSpace);\n const [text, setText] = useState<string | null>(null);\n const current = channelText(context.display, space, channel);\n const shown = text ?? current;\n const fieldRef = useRef<HTMLInputElement | null>(null);\n useEscapeRevert(fieldRef, text !== null, () => setText(null));\n const { max } = channelRange(space, channel === \"hex\" ? \"red\" : channel);\n /* A number field is a spin button: a screen reader hears its range. */\n const spin =\n channel === \"hex\"\n ? {}\n : {\n role: \"spinbutton\",\n \"aria-valuemin\": 0,\n \"aria-valuemax\": channel === \"alpha\" ? 100 : max,\n \"aria-valuenow\":\n channel === \"alpha\"\n ? Math.round(context.display.alpha * 100)\n : Number(channelText(context.display, space, channel)),\n \"aria-valuetext\": shown,\n };\n\n const read = () => {\n if (text === null) return;\n setText(null);\n if (text === current) return;\n const next = readChannelText(text, context.display, space, channel);\n if (next) context.change(next);\n };\n\n return (\n <InputGroupInput\n value={shown}\n inputMode={channel === \"hex\" ? \"text\" : \"decimal\"}\n maxLength={channel === \"hex\" ? 9 : 8}\n disabled={context.disabled}\n readOnly={context.readOnly}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n autoCapitalize=\"off\"\n spellCheck={false}\n aria-label={context.i18n.labels[channel]}\n {...spin}\n data-channel={channel}\n className={cn(\n \"h-auto min-w-0 self-stretch pr-1 pl-2 tabular-nums\",\n /* Each field starts at its widest value plus padding, in ch so it\n tracks the font, where a tabular digit measures 1.03ch: 255 or 360,\n 99.9 for OKLCH lightness, 0.399, 359.9, 100% and six hex digits. A\n short row shrinks every field in proportion. Equal shares clipped\n 100% and every OKLCH channel. Text sits left, so the right padding\n is only the gap before the next separator. */\n channel === \"hex\"\n ? \"flex-[1_1_calc(5.8ch+0.75rem)] uppercase\"\n : channel === \"alpha\"\n ? \"flex-[1_1_calc(4.8ch+0.75rem)]\"\n : space !== \"oklch\"\n ? \"flex-[1_1_calc(3.25ch+0.75rem)]\"\n : channel === \"lightness\"\n ? \"flex-[1_1_calc(3.7ch+0.75rem)]\"\n : \"flex-[1_1_calc(4.7ch+0.75rem)]\",\n className,\n )}\n onChange={(event) => {\n onChange?.(event);\n setText(event.target.value);\n }}\n onBlur={(event) => {\n onBlur?.(event);\n read();\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || copyOnShortcut(event, context)) return;\n const step = STEP_KEYS[event.key];\n if (event.key === \"Enter\") {\n /* Flushed, so an implicit form submit reads the new value. */\n flushSync(() => read());\n } else if (step && channel !== \"hex\" && context.editable) {\n event.preventDefault();\n const from = readChannelText(shown, context.display, space, channel);\n if (!from) return;\n const unit = channel === \"alpha\" ? 0.01 : channel === \"chroma\" ? 0.001 : 1;\n const delta = step * unit * (event.shiftKey ? 10 : 1);\n const { max: top } = channelRange(space, channel);\n const next = snap(readChannel(from, space, channel) + delta, unit);\n setText(null);\n context.change(\n withChannel(\n from,\n space,\n channel,\n channel === \"hue\" ? wrapHue(next) : clamp(next, 0, top),\n ),\n );\n }\n }}\n {...props}\n ref={(node: HTMLInputElement | null) => {\n fieldRef.current = node;\n assignRef(ref, node);\n }}\n />\n );\n}\n\n/* Arrows step a field, ten with Shift; Page keys always ten. A hue wraps. */\nconst STEP_KEYS: Record<string, number> = {\n ArrowUp: 1,\n ArrowDown: -1,\n PageUp: 10,\n PageDown: -10,\n};\n\n/* Full height, so the fields read as cells of one control. */\nconst DIVIDER = <Separator orientation=\"vertical\" aria-hidden=\"true\" />;\n\n/* The shadcn inline-start addon insets its button on the left only (padding\n less a pull-in), so the format button met the first divider. Each rung\n repeats that inset on the right. maia and luma take 5px a side, concentric\n with the pill: 8px a side clipped OKLCH in the popover on a phone. */\nconst FORMAT_ADDON_CLASS = \"pr-[0.2rem]\";\n\nexport type ColorPickerFieldsProps = Omit<ComponentProps<typeof InputGroup>, \"children\"> & {\n /** The format shown, controlled. It does not change what `onValueChange` emits. */\n format?: ColorPickerFormat;\n /** Defaults to the picker's `format`. */\n defaultFormat?: ColorPickerFormat;\n onFormatChange?: (format: ColorPickerFormat) => void;\n /** The formats in the menu. One format hides the menu. */\n formats?: ColorPickerFormat[];\n};\n\n/**\n * A format menu and the value's channels as joined fields: one hex field, or\n * three channels, plus opacity when the picker takes alpha.\n */\nexport function ColorPickerFields({\n format: formatProp,\n defaultFormat,\n onFormatChange,\n formats = COLOR_PICKER_FORMATS,\n className,\n ...props\n}: ColorPickerFieldsProps) {\n const context = useColorPickerContext(\"ColorPickerFields\");\n const [formatState, setFormatState] = useState(defaultFormat ?? context.format);\n const shown = formatProp ?? formatState;\n const fields = FORMAT_FIELDS[shown];\n const { setFieldsFormat } = context;\n useLayoutEffect(() => {\n setFieldsFormat(shown);\n return () => setFieldsFormat(null);\n }, [shown, setFieldsFormat]);\n const menu = formats.length > 1;\n const setFormat = (next: ColorPickerFormat) => {\n if (formatProp === undefined) setFormatState(next);\n onFormatChange?.(next);\n };\n const menuProps = {\n size: \"xs\" as const,\n disabled: context.disabled,\n \"aria-label\": `${context.i18n.labels.format}, ${FORMAT_LABELS[shown]}`,\n \"data-slot\": \"color-picker-format-trigger\",\n className: \"gap-1 text-xs font-medium\",\n };\n\n return (\n <InputGroup\n dir=\"ltr\"\n data-slot=\"color-picker-fields\"\n data-disabled={context.disabled ? \"\" : undefined}\n className={className}\n {...props}\n >\n {menu && (\n <InputGroupAddon align=\"inline-start\" className={FORMAT_ADDON_CLASS}>\n <DropdownMenu>\n <DropdownMenuTrigger render={<InputGroupButton {...menuProps} />}>\n {FORMAT_LABELS[shown]}\n {CHEVRON_ICON}\n </DropdownMenuTrigger>\n {/* A pick's click bubbles through the portal to InputGroupAddon,\n whose own handler would move focus into a field. */}\n <DropdownMenuContent\n align=\"start\"\n className=\"w-auto min-w-56\"\n onClick={(event) => event.stopPropagation()}\n >\n <DropdownMenuRadioGroup\n value={shown}\n onValueChange={(next) => setFormat(next as ColorPickerFormat)}\n >\n {formats.map((item) => (\n <DropdownMenuRadioItem key={item} value={item} closeOnClick>\n <span className=\"w-12 shrink-0 font-medium\">{FORMAT_LABELS[item]}</span>\n <span className=\"text-muted-foreground truncate text-xs tabular-nums\">\n {formatColor(context.display, item).replace(/^\\w+\\(|\\)$/g, \"\")}\n </span>\n </DropdownMenuRadioItem>\n ))}\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </InputGroupAddon>\n )}\n <div className=\"flex min-w-0 flex-1 self-stretch\">\n {fields.channels.map((channel, index) => (\n <Fragment key={`${shown}-${channel}`}>\n {(menu || index > 0) && DIVIDER}\n <ColorPickerChannelInput channel={channel} colorSpace={fields.space} />\n </Fragment>\n ))}\n {/* Opacity keeps its own width at the end: hex, or the channels,\n take the rest of the row. */}\n {context.alpha && (\n <>\n {DIVIDER}\n <ColorPickerChannelInput\n channel=\"alpha\"\n className=\"w-[calc(4.8ch+0.75rem)] flex-none\"\n />\n </>\n )}\n </div>\n </InputGroup>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Swatches */\n/* -------------------------------------------------------------------------- */\n\ntype SwatchesContextValue = {\n shape: \"square\" | \"circle\";\n activeId: string | null;\n setActiveId: (id: string | null) => void;\n};\n\nconst SwatchesContext = createContext<SwatchesContextValue>({\n shape: \"square\",\n activeId: null,\n setActiveId: () => {},\n});\n\nexport type ColorPickerSwatchInput = string | { value: string; label?: string };\n\nconst OPTION_SELECTOR = '[data-slot=\"color-picker-swatch-item\"]:not([aria-disabled=\"true\"])';\n\n/* Arrows move to the previous or next swatch in order, mirrored right to\n left, and Home and End to the ends: the listbox model, row or wrapped. */\nfunction neighbor(\n options: HTMLElement[],\n current: HTMLElement | undefined,\n key: string,\n rtl: boolean,\n) {\n if (key === \"Home\") return options[0];\n if (key === \"End\") return options[options.length - 1];\n if (!current) return options[0];\n const forward = key === \"ArrowDown\" || key === (rtl ? \"ArrowLeft\" : \"ArrowRight\");\n return options[options.indexOf(current) + (forward ? 1 : -1)];\n}\n\nexport type ColorPickerSwatchesProps = Omit<ComponentProps<\"div\">, \"children\"> & {\n colors?: ColorPickerSwatchInput[];\n shape?: \"square\" | \"circle\";\n children?: ReactNode;\n};\n\n/**\n * Preset colors as a listbox: one tab stop, arrow keys move through them in\n * order, Enter or Space picks. `--color-picker-swatch-size` sets the chip size.\n */\nexport function ColorPickerSwatches({\n colors,\n shape = \"square\",\n className,\n children,\n onKeyDown,\n onFocus,\n ...props\n}: ColorPickerSwatchesProps) {\n const context = useColorPickerContext(\"ColorPickerSwatches\");\n const [activeId, setActiveId] = useState<string | null>(null);\n const listRef = useRef<HTMLDivElement>(null);\n const options = () =>\n Array.from(listRef.current?.querySelectorAll<HTMLElement>(OPTION_SELECTOR) ?? []);\n const activate = (option: HTMLElement | undefined) => {\n if (!option) return;\n setActiveId(option.id);\n option.scrollIntoView?.({ block: \"nearest\" });\n };\n\n return (\n <SwatchesContext.Provider value={{ shape, activeId, setActiveId }}>\n <div\n ref={listRef}\n role=\"listbox\"\n tabIndex={context.disabled ? -1 : 0}\n aria-label={context.i18n.labels.swatches}\n aria-activedescendant={activeId ?? undefined}\n aria-disabled={context.disabled || undefined}\n aria-readonly={context.readOnly || undefined}\n data-slot=\"color-picker-swatches\"\n data-empty={activeId ? undefined : \"\"}\n className={cn(\n \"group/color-picker-swatches data-empty:focus-visible:outline-ring grid grid-cols-[repeat(auto-fill,var(--color-picker-swatch-size))] justify-between gap-x-1 gap-y-1.5 outline-none [--color-picker-swatch-size:calc(var(--spacing)*6)] aria-disabled:opacity-50 data-empty:focus-visible:outline-2 data-empty:focus-visible:outline-offset-2\",\n className,\n )}\n onFocus={(event) => {\n onFocus?.(event);\n if (event.target !== event.currentTarget) return;\n const found = activeId\n ? event.currentTarget.ownerDocument.getElementById(activeId)\n : null;\n if (!found) {\n const selected = event.currentTarget.querySelector<HTMLElement>(\n `${OPTION_SELECTOR}[aria-selected=\"true\"]`,\n );\n setActiveId(selected?.id ?? null);\n }\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || copyOnShortcut(event, context)) return;\n if (context.disabled) return;\n const list = options();\n const current = list.find((option) => option.id === activeId);\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n current?.click();\n return;\n }\n if (\n ![\"ArrowLeft\", \"ArrowRight\", \"ArrowUp\", \"ArrowDown\", \"Home\", \"End\"].includes(event.key)\n ) {\n return;\n }\n event.preventDefault();\n const rtl = getComputedStyle(event.currentTarget).direction === \"rtl\";\n activate(neighbor(list, current, event.key, rtl) ?? current);\n }}\n {...props}\n >\n {children ??\n colors?.map((item, index) => {\n const swatch = typeof item === \"string\" ? { value: item } : item;\n return (\n <ColorPickerSwatchItem\n key={`${index}-${swatch.value}`}\n value={swatch.value}\n label={swatch.label}\n />\n );\n })}\n </div>\n </SwatchesContext.Provider>\n );\n}\n\n/* A 24px chip takes the shadcn Select item's radius, square in lyra and sera.\n The keyboard ring is an offset outline, so it never sits on the color. */\nconst SWATCH_ITEM_SQUARE = \"rounded-md\";\n\nconst SWATCH_ITEM_CLASS =\n \"forced-color-adjust-none relative flex size-(--color-picker-swatch-size) shrink-0 cursor-default items-center justify-center outline-offset-2 transition-[scale] duration-150 after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:inset-ring after:inset-ring-foreground/10 not-aria-disabled:hover:scale-110 aria-disabled:opacity-40 motion-reduce:transition-none group-focus-visible/color-picker-swatches:data-active:outline-2 group-focus-visible/color-picker-swatches:data-active:outline-ring [&_svg]:size-3.5\";\n\nexport type ColorPickerSwatchItemProps = Omit<ComponentProps<\"div\">, \"children\"> & {\n /** Any color `parseColor` reads. */\n value: string;\n /** Read out instead of the generated color name. */\n label?: string;\n disabled?: boolean;\n};\n\n/** One preset. Selected while the picker's value is this color. */\nexport function ColorPickerSwatchItem({\n value,\n label,\n disabled = false,\n className,\n style,\n onClick,\n ...props\n}: ColorPickerSwatchItemProps) {\n const context = useColorPickerContext(\"ColorPickerSwatchItem\");\n const swatches = useContext(SwatchesContext);\n const id = useId();\n const parsed = parseColor(value);\n const color = parsed && !context.alpha ? { ...parsed, alpha: 1 } : parsed;\n const selected =\n !!color && !!context.color && formatColor(color, \"hex\") === formatColor(context.color, \"hex\");\n /* The check reads like text on the swatch: one rule for both. */\n const check = (color && getForegroundColor(color, { light: \"#fff\", dark: \"#000\" })) ?? \"#000\";\n const inactive = disabled || !color;\n\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: <>\n <div\n id={id}\n role=\"option\"\n aria-selected={selected}\n aria-disabled={inactive || undefined}\n aria-label={label ?? (color ? context.i18n.functions.getColorName(color) : value)}\n data-slot=\"color-picker-swatch-item\"\n data-active={swatches.activeId === id ? \"\" : undefined}\n data-selected={selected ? \"\" : undefined}\n className={cn(\n SWATCH_ITEM_CLASS,\n swatches.shape === \"circle\" ? \"rounded-full\" : SWATCH_ITEM_SQUARE,\n className,\n )}\n style={{ background: swatchBackground(color), color: check, ...style }}\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented || inactive || !context.editable) return;\n swatches.setActiveId(id);\n context.change(color);\n }}\n {...props}\n >\n {selected && <CheckIcon aria-hidden=\"true\" />}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAmHA,MAAM,iBAGF;CACF,KAAK;EAAC;EAAO;EAAS;CAAM;CAC5B,KAAK;EAAC;EAAO;EAAc;CAAW;CACtC,KAAK;EAAC;EAAO;EAAc;CAAY;CACvC,OAAO;EAAC;EAAa;EAAU;CAAK;AACtC;AAEA,MAAa,uBAA4C;CAAC;CAAO;CAAO;CAAO;CAAO;AAAO;AAE7F,MAAM,gBAAmD;CACvD,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,OAAO;AACT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GAAG,SAC0B;CAC7B,MAAM,UAAU,sBAAsB,uBAAuB;CAC7D,MAAM,WAAW,WAAW,eAAe;CAC3C,MAAM,KAAK,MAAM;CACjB,MAAM,SAAS,WAAW,KAAK;CAC/B,MAAM,QAAQ,UAAU,CAAC,QAAQ,QAAQ;EAAE,GAAG;EAAQ,OAAO;CAAE,IAAI;CACnE,MAAM,WACJ,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,SAAS,YAAY,OAAO,KAAK,MAAM,YAAY,QAAQ,OAAO,KAAK;CAE9F,MAAM,SAAS,SAAS,mBAAmB,OAAO;EAAE,OAAO;EAAQ,MAAM;CAAO,CAAC,MAAM;CACvF,MAAM,WAAW,YAAY,CAAC;CAE9B,OAEE,oBAAC,OAAD;EACM;EACJ,MAAK;EACL,iBAAe;EACf,iBAAe,YAAY,KAAA;EAC3B,cAAY,UAAU,QAAQ,QAAQ,KAAK,UAAU,aAAa,KAAK,IAAI;EAC3E,aAAU;EACV,eAAa,SAAS,aAAa,KAAK,KAAK,KAAA;EAC7C,iBAAe,WAAW,KAAK,KAAA;EAC/B,WAAW,GACT,mBACA,SAAS,UAAU,WAAW,iBAAiB,oBAC/C,SACF;EACA,OAAO;GAAE,YAAY,iBAAiB,KAAK;GAAG,OAAO;GAAO,GAAG;EAAM;EACrE,UAAU,UAAU;GAClB,UAAU,KAAK;GACf,IAAI,MAAM,oBAAoB,YAAY,CAAC,QAAQ,UAAU;GAC7D,SAAS,YAAY,EAAE;GACvB,QAAQ,OAAO,KAAK;EACtB;EACA,GAAI;EAEH,UAAA,YAAY,oBAAC,WAAD,EAAW,eAAY,OAAQ,CAAA;CACzC,CAAA;AAET"}
1
+ {"version":3,"file":"color-picker.js","names":[],"sources":["../../../src/components/reui/color-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n ComponentProps,\n KeyboardEvent as ReactKeyboardEvent,\n ReactNode,\n PointerEvent as ReactPointerEvent,\n Ref,\n} from \"react\";\nimport {\n createContext,\n Fragment,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n useSyncExternalStore,\n} from \"react\";\nimport { CheckIcon, ChevronDownIcon, CopyIcon, PipetteIcon } from \"lucide-react\";\nimport { flushSync } from \"react-dom\";\n\nimport { cn } from \"@kumix/utils\";\nimport { Button } from \"../ui/button\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n} from \"../ui/dropdown-menu\";\nimport { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from \"../ui/input-group\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../ui/popover\";\nimport { Separator } from \"../ui/separator\";\n\n/* -------------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------------- */\n\n/** How a value is written: what `onValueChange` emits and what the fields show. */\nexport type ColorPickerFormat = \"hex\" | \"rgb\" | \"hsl\" | \"hsb\" | \"oklch\";\n\n/** Where channels live. HSB is `hsv` here, after the math. */\nexport type ColorPickerColorSpace = \"rgb\" | \"hsl\" | \"hsv\" | \"oklch\";\n\nexport type ColorPickerChannel =\n | \"hue\"\n | \"saturation\"\n | \"brightness\"\n | \"lightness\"\n | \"chroma\"\n | \"red\"\n | \"green\"\n | \"blue\"\n | \"alpha\";\n\n/**\n * A parsed color. Channels stay in the space they were given or edited in,\n * so the hue of a gray and an OKLCH color outside sRGB survive a round trip.\n * rgb runs 0 to 255; hsl and hsv take hue 0 to 360 and the rest 0 to 100;\n * oklch takes lightness 0 to 100, chroma 0 to 0.4 and hue 0 to 360. Alpha is\n * 0 to 1.\n */\nexport type ColorPickerColor = {\n space: ColorPickerColorSpace;\n channels: [number, number, number];\n alpha: number;\n};\n\nexport type ColorPickerLabels = {\n /** Trigger text while there is no value. */\n placeholder: string;\n /** Names the popup and an inline panel. */\n panelLabel: string;\n /** The swatch button in `ColorPickerInput`. */\n openPicker: string;\n /** The saturation and brightness area. */\n area: string;\n hue: string;\n saturation: string;\n brightness: string;\n lightness: string;\n chroma: string;\n red: string;\n green: string;\n blue: string;\n alpha: string;\n hex: string;\n format: string;\n eyeDropper: string;\n copy: string;\n copied: string;\n clear: string;\n swatches: string;\n};\n\nexport type ColorPickerFunctions = {\n /** Names a color for screen readers, in the area, the sliders and unlabelled swatches. */\n getColorName: (color: ColorPickerColor) => string;\n};\n\nexport type ColorPickerI18nConfig = {\n labels: ColorPickerLabels;\n functions: ColorPickerFunctions;\n};\n\n/** One level deeper than `Partial`, so a single label can be overridden. */\nexport type ColorPickerI18nOverrides = {\n labels?: Partial<ColorPickerLabels>;\n functions?: Partial<ColorPickerFunctions>;\n};\n\ntype Triple = [number, number, number];\n\nconst SPACE_CHANNELS: Record<\n ColorPickerColorSpace,\n [ColorPickerChannel, ColorPickerChannel, ColorPickerChannel]\n> = {\n rgb: [\"red\", \"green\", \"blue\"],\n hsl: [\"hue\", \"saturation\", \"lightness\"],\n hsv: [\"hue\", \"saturation\", \"brightness\"],\n oklch: [\"lightness\", \"chroma\", \"hue\"],\n};\n\nexport const COLOR_PICKER_FORMATS: ColorPickerFormat[] = [\"hex\", \"rgb\", \"hsl\", \"hsb\", \"oklch\"];\n\nconst FORMAT_LABELS: Record<ColorPickerFormat, string> = {\n hex: \"HEX\",\n rgb: \"RGB\",\n hsl: \"HSL\",\n hsb: \"HSB\",\n oklch: \"OKLCH\",\n};\n\n/* -------------------------------------------------------------------------- */\n/* Color math */\n/* -------------------------------------------------------------------------- */\n\nconst clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));\n\nconst wrapHue = (hue: number) => ((hue % 360) + 360) % 360;\n\n/* Trailing zeros dropped, and never \"-0\". */\nconst fixed = (value: number, digits: number) => String(Number(value.toFixed(digits)) + 0);\n\nfunction rgbToHsv([red, green, blue]: Triple, fallbackHue = 0): Triple {\n const r = red / 255;\n const g = green / 255;\n const b = blue / 255;\n const max = Math.max(r, g, b);\n const delta = max - Math.min(r, g, b);\n let hue = fallbackHue;\n if (delta > 1e-9) {\n hue = max === r ? ((g - b) / delta) % 6 : max === g ? (b - r) / delta + 2 : (r - g) / delta + 4;\n hue = wrapHue(hue * 60);\n }\n return [hue, max === 0 ? 0 : (delta / max) * 100, max * 100];\n}\n\nfunction hsvToRgb([hue, saturation, brightness]: Triple): Triple {\n const s = saturation / 100;\n const v = brightness / 100;\n const channel = (n: number) => {\n const k = (n + hue / 60) % 6;\n return (v - v * s * Math.max(0, Math.min(k, 4 - k, 1))) * 255;\n };\n return [channel(5), channel(3), channel(1)];\n}\n\n/* HSL and HSB share a hue, carried over as is, so a gray keeps it. */\nfunction hsvToHsl([hue, saturation, brightness]: Triple): Triple {\n const s = saturation / 100;\n const v = brightness / 100;\n const l = v * (1 - s / 2);\n const sl = l === 0 || l === 1 ? 0 : (v - l) / Math.min(l, 1 - l);\n return [hue, sl * 100, l * 100];\n}\n\nfunction hslToHsv([hue, saturation, lightness]: Triple): Triple {\n const s = saturation / 100;\n const l = lightness / 100;\n const v = l + s * Math.min(l, 1 - l);\n return [hue, v === 0 ? 0 : 2 * (1 - l / v) * 100, v * 100];\n}\n\nconst toLinear = (channel: number) => {\n const c = channel / 255;\n return c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n};\n\nconst fromLinear = (channel: number) =>\n 255 * (channel <= 0.0031308 ? 12.92 * channel : 1.055 * channel ** (1 / 2.4) - 0.055);\n\n/* OKLab by Björn Ottosson, the matrices CSS Color 4 uses. Linear sRGB in,\n unbounded, so a wide-gamut color converts without clipping. */\nfunction linearToOklab([r, g, b]: Triple): Triple {\n const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);\n const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);\n const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);\n return [\n 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,\n 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,\n 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,\n ];\n}\n\n/* OKLab, or polar a and b, to OKLCH in the picker's units: L 0 to 100. */\nfunction oklabToOklch([lightness, a, b]: Triple, fallbackHue = 0): Triple {\n const chroma = Math.sqrt(a * a + b * b);\n const hue = chroma < 1e-4 ? fallbackHue : wrapHue((Math.atan2(b, a) * 180) / Math.PI);\n return [lightness * 100, chroma, hue];\n}\n\nfunction rgbToOklch(rgb: Triple, fallbackHue = 0): Triple {\n return oklabToOklch(linearToOklab(rgb.map(toLinear) as Triple), fallbackHue);\n}\n\nfunction oklchToLinear([lightness, chroma, hue]: Triple): Triple {\n const angle = (hue * Math.PI) / 180;\n const L = lightness / 100;\n const a = chroma * Math.cos(angle);\n const b = chroma * Math.sin(angle);\n const l = (L + 0.3963377774 * a + 0.2158037573 * b) ** 3;\n const m = (L - 0.1055613458 * a - 0.0638541728 * b) ** 3;\n const s = (L - 0.0894841775 * a - 1.291485548 * b) ** 3;\n return [\n 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,\n -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,\n -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s,\n ];\n}\n\nconst inSrgb = (linear: Triple) =>\n linear.every((channel) => channel >= -1e-4 && channel <= 1 + 1e-4);\n\nconst clipLinear = (linear: Triple) => linear.map((channel) => clamp(channel, 0, 1)) as Triple;\n\n/* How far a clipped color lands from the OKLCH it stands for, in OKLab. */\nfunction clipError(clipped: Triple, [lightness, chroma, hue]: Triple) {\n const [l, a, b] = linearToOklab(clipped);\n const angle = (hue * Math.PI) / 180;\n return Math.hypot(\n l - lightness / 100,\n a - chroma * Math.cos(angle),\n b - chroma * Math.sin(angle),\n );\n}\n\n/* CSS Color 4 gamut mapping: lower chroma at the same lightness and hue\n until clipping the rest moves the color less than a just-noticeable\n difference (0.02 in OKLab), then clip. Pure chroma reduction drifted up to\n 27 units in hex from what a browser paints for Tailwind's P3 shades. */\nfunction oklchToRgb([lightness, chroma, hue]: Triple): Triple {\n const encode = (linear: Triple) => linear.map((channel) => fromLinear(channel)) as Triple;\n if (lightness >= 100) return [255, 255, 255];\n if (lightness <= 0) return [0, 0, 0];\n const target: Triple = [lightness, Math.max(0, chroma), hue];\n const origin = oklchToLinear(target);\n if (inSrgb(origin)) return encode(clipLinear(origin));\n let clipped = clipLinear(origin);\n if (clipError(clipped, target) < 0.02) return encode(clipped);\n let low = 0;\n let high = target[1];\n let lowInGamut = true;\n while (high - low > 1e-4) {\n const mid = (low + high) / 2;\n const current: Triple = [lightness, mid, hue];\n const linear = oklchToLinear(current);\n if (lowInGamut && inSrgb(linear)) {\n low = mid;\n continue;\n }\n clipped = clipLinear(linear);\n const error = clipError(clipped, current);\n if (error < 0.02) {\n if (0.02 - error < 1e-4) break;\n lowInGamut = false;\n low = mid;\n } else {\n high = mid;\n }\n }\n return encode(clipped);\n}\n\nfunction toRgb(color: ColorPickerColor): Triple {\n const { space, channels } = color;\n if (space === \"rgb\") return channels;\n if (space === \"hsv\") return hsvToRgb(channels);\n if (space === \"hsl\") return hsvToRgb(hslToHsv(channels));\n return oklchToRgb(channels);\n}\n\n/** A color's channels in another space. */\nfunction toSpace(color: ColorPickerColor, space: ColorPickerColorSpace): Triple {\n const { space: from, channels } = color;\n if (from === space) return channels;\n if (from === \"hsv\" && space === \"hsl\") return hsvToHsl(channels);\n if (from === \"hsl\" && space === \"hsv\") return hslToHsv(channels);\n const rgb = toRgb(color);\n const hue = from === \"rgb\" ? 0 : channels[from === \"oklch\" ? 2 : 0];\n if (space === \"rgb\") return rgb;\n if (space === \"hsv\") return rgbToHsv(rgb, hue);\n if (space === \"hsl\") return hsvToHsl(rgbToHsv(rgb, hue));\n return rgbToOklch(rgb, hue);\n}\n\n/** Whether a color fits sRGB. OKLCH can reach past it; the picker then maps it into sRGB the way CSS does. */\nexport function isColorInSrgb(color: ColorPickerColor) {\n return color.space !== \"oklch\" || inSrgb(oklchToLinear(color.channels));\n}\n\nconst HEX_PATTERN = /^#?([\\da-f]{3,4}|[\\da-f]{6}|[\\da-f]{8})$/;\n/* [\\s\\S], not \".\", so a function pretty-printed over several lines reads. */\nconst FUNCTION_PATTERN = /^([a-z][a-z\\d-]*)\\(([\\s\\S]*)\\)$/;\nconst NUMBER_PATTERN = /^([+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[+-]?\\d+)?)(%|deg|rad|grad|turn)?$/;\n\n/* The 148 CSS named colors, each name then its hex: about 2.3 KB, checked\n against Chrome, and safe to read on the server unlike a canvas. */\nconst NAMED_COLORS =\n \"alicebluef0f8ff antiquewhitefaebd7 aqua00ffff aquamarine7fffd4 \" +\n \"azuref0ffff beigef5f5dc bisqueffe4c4 black000000 blanchedalmondffebcd \" +\n \"blue0000ff blueviolet8a2be2 browna52a2a burlywooddeb887 \" +\n \"cadetblue5f9ea0 chartreuse7fff00 chocolated2691e coralff7f50 \" +\n \"cornflowerblue6495ed cornsilkfff8dc crimsondc143c cyan00ffff \" +\n \"darkblue00008b darkcyan008b8b darkgoldenrodb8860b darkgraya9a9a9 \" +\n \"darkgreen006400 darkgreya9a9a9 darkkhakibdb76b darkmagenta8b008b \" +\n \"darkolivegreen556b2f darkorangeff8c00 darkorchid9932cc darkred8b0000 \" +\n \"darksalmone9967a darkseagreen8fbc8f darkslateblue483d8b \" +\n \"darkslategray2f4f4f darkslategrey2f4f4f darkturquoise00ced1 \" +\n \"darkviolet9400d3 deeppinkff1493 deepskyblue00bfff dimgray696969 \" +\n \"dimgrey696969 dodgerblue1e90ff firebrickb22222 floralwhitefffaf0 \" +\n \"forestgreen228b22 fuchsiaff00ff gainsborodcdcdc ghostwhitef8f8ff \" +\n \"goldffd700 goldenroddaa520 gray808080 green008000 greenyellowadff2f \" +\n \"grey808080 honeydewf0fff0 hotpinkff69b4 indianredcd5c5c indigo4b0082 \" +\n \"ivoryfffff0 khakif0e68c lavendere6e6fa lavenderblushfff0f5 \" +\n \"lawngreen7cfc00 lemonchiffonfffacd lightblueadd8e6 lightcoralf08080 \" +\n \"lightcyane0ffff lightgoldenrodyellowfafad2 lightgrayd3d3d3 \" +\n \"lightgreen90ee90 lightgreyd3d3d3 lightpinkffb6c1 lightsalmonffa07a \" +\n \"lightseagreen20b2aa lightskyblue87cefa lightslategray778899 \" +\n \"lightslategrey778899 lightsteelblueb0c4de lightyellowffffe0 lime00ff00 \" +\n \"limegreen32cd32 linenfaf0e6 magentaff00ff maroon800000 \" +\n \"mediumaquamarine66cdaa mediumblue0000cd mediumorchidba55d3 \" +\n \"mediumpurple9370db mediumseagreen3cb371 mediumslateblue7b68ee \" +\n \"mediumspringgreen00fa9a mediumturquoise48d1cc mediumvioletredc71585 \" +\n \"midnightblue191970 mintcreamf5fffa mistyroseffe4e1 moccasinffe4b5 \" +\n \"navajowhiteffdead navy000080 oldlacefdf5e6 olive808000 olivedrab6b8e23 \" +\n \"orangeffa500 orangeredff4500 orchidda70d6 palegoldenrodeee8aa \" +\n \"palegreen98fb98 paleturquoiseafeeee palevioletreddb7093 \" +\n \"papayawhipffefd5 peachpuffffdab9 perucd853f pinkffc0cb plumdda0dd \" +\n \"powderblueb0e0e6 purple800080 rebeccapurple663399 redff0000 \" +\n \"rosybrownbc8f8f royalblue4169e1 saddlebrown8b4513 salmonfa8072 \" +\n \"sandybrownf4a460 seagreen2e8b57 seashellfff5ee siennaa0522d \" +\n \"silverc0c0c0 skyblue87ceeb slateblue6a5acd slategray708090 \" +\n \"slategrey708090 snowfffafa springgreen00ff7f steelblue4682b4 tand2b48c \" +\n \"teal008080 thistled8bfd8 tomatoff6347 turquoise40e0d0 violetee82ee \" +\n \"wheatf5deb3 whiteffffff whitesmokef5f5f5 yellowffff00 \" +\n \"yellowgreen9acd32\";\n\nlet namedColors: Map<string, string> | null = null;\n\nfunction namedColor(name: string) {\n namedColors ??= new Map(\n NAMED_COLORS.split(\" \").map((entry) => [entry.slice(0, -6), entry.slice(-6)]),\n );\n return namedColors.get(name);\n}\n\n/* One CSS number: 100% is worth `percentOf`, computed as value * percentOf\n / 100 so 50% of 255 is exactly 127.5; angles only where allowed. */\nfunction readNumber(token: string, percentOf: number, angle = false) {\n if (token === \"none\") return 0;\n const match = NUMBER_PATTERN.exec(token);\n if (!match) return null;\n const value = Number(match[1]);\n if (!Number.isFinite(value)) return null;\n const unit = match[2];\n if (!unit) return value;\n if (unit === \"%\") return angle ? null : (value * percentOf) / 100;\n if (!angle) return null;\n if (unit === \"rad\") return (value * 180) / Math.PI;\n if (unit === \"grad\") return value * 0.9;\n if (unit === \"turn\") return value * 360;\n return value;\n}\n\ntype Matrix = [Triple, Triple, Triple];\n\nconst multiply = (matrix: Matrix, [x, y, z]: Triple): Triple =>\n matrix.map((row) => row[0] * x + row[1] * y + row[2] * z) as Triple;\n\nconst compose = (outer: Matrix, inner: Matrix): Matrix =>\n outer.map((row) =>\n [0, 1, 2].map(\n (column) => row[0] * inner[0][column] + row[1] * inner[1][column] + row[2] * inner[2][column],\n ),\n ) as Matrix;\n\n/* CSS Color 4's matrices: XYZ D65 to linear sRGB, each RGB space to XYZ,\n and Bradford from D50, the white of lab(), lch() and ProPhoto. */\nconst XYZ_TO_SRGB: Matrix = [\n [12831 / 3959, -329 / 214, -1974 / 3959],\n [-851781 / 878810, 1648619 / 878810, 36519 / 878810],\n [705 / 12673, -2585 / 12673, 705 / 667],\n];\nconst D50_TO_D65: Matrix = [\n [0.955473421488075, -0.02309845494876471, 0.06325924320057072],\n [-0.0283697093338637, 1.0099953980813041, 0.021041441191917323],\n [0.012314014864481998, -0.020507649298898964, 1.330365926242124],\n];\nconst D50_TO_SRGB = compose(XYZ_TO_SRGB, D50_TO_D65);\n\n/* sRGB's curve, carried past 0 and 1 by symmetry, as color() allows. */\nconst decodeSrgb = (value: number) => {\n const size = Math.abs(value);\n return Math.sign(value) * (size <= 0.04045 ? size / 12.92 : ((size + 0.055) / 1.055) ** 2.4);\n};\n\nconst RGB_SPACES: Record<string, { decode: (value: number) => number; toSrgb: Matrix | null }> = {\n srgb: { decode: decodeSrgb, toSrgb: null },\n \"srgb-linear\": { decode: (value) => value, toSrgb: null },\n \"display-p3\": {\n decode: decodeSrgb,\n toSrgb: compose(XYZ_TO_SRGB, [\n [0.4865709486482162, 0.26566769316909306, 0.1982172852343625],\n [0.2289745640697488, 0.6917385218365064, 0.079286914093745],\n [0, 0.04511338185890264, 1.043944368900976],\n ]),\n },\n \"a98-rgb\": {\n decode: (value) => Math.sign(value) * Math.abs(value) ** (563 / 256),\n toSrgb: compose(XYZ_TO_SRGB, [\n [573536 / 994567, 263643 / 1420810, 187206 / 994567],\n [591459 / 1989134, 6239551 / 9945670, 374412 / 4972835],\n [53769 / 1989134, 351524 / 4972835, 4929758 / 4972835],\n ]),\n },\n \"prophoto-rgb\": {\n decode: (value) => {\n const size = Math.abs(value);\n return size <= 16 / 512 ? value / 16 : Math.sign(value) * size ** 1.8;\n },\n toSrgb: compose(D50_TO_SRGB, [\n [0.7977666449006423, 0.13518129740053308, 0.0313477341283922],\n [0.2880748288194013, 0.711835234241873, 0.00008993693872564],\n [0, 0, 0.8251046025104602],\n ]),\n },\n rec2020: {\n decode: (value) => {\n const size = Math.abs(value);\n return size < 0.018053968510807 * 4.5\n ? value / 4.5\n : Math.sign(value) * ((size + 0.09929682680944) / 1.09929682680944) ** (1 / 0.45);\n },\n toSrgb: compose(XYZ_TO_SRGB, [\n [0.6369580483012914, 0.14461690358620832, 0.1688809751641721],\n [0.2627002120112671, 0.6779980715188708, 0.05930171646986196],\n [0, 0.028072693049087428, 1.060985057710791],\n ]),\n },\n xyz: { decode: (value) => value, toSrgb: XYZ_TO_SRGB },\n \"xyz-d65\": { decode: (value) => value, toSrgb: XYZ_TO_SRGB },\n \"xyz-d50\": { decode: (value) => value, toSrgb: D50_TO_SRGB },\n};\n\n/* CIE Lab, D50 white, to XYZ D50, as CSS Color 4 writes it. */\nfunction labToXyz([lightness, a, b]: Triple): Triple {\n const kappa = 24389 / 27;\n const epsilon = 216 / 24389;\n const fy = (lightness + 16) / 116;\n const fx = a / 500 + fy;\n const fz = fy - b / 200;\n const x = fx ** 3 > epsilon ? fx ** 3 : (116 * fx - 16) / kappa;\n const y = lightness > kappa * epsilon ? fy ** 3 : lightness / kappa;\n const z = fz ** 3 > epsilon ? fz ** 3 : (116 * fz - 16) / kappa;\n return [x * (0.3457 / 0.3585), y, z * ((1 - 0.3457 - 0.3585) / 0.3585)];\n}\n\n/* A color that can reach past sRGB is kept as OKLCH, so nothing is clipped\n until a format or a screen needs sRGB. */\nconst fromLinearSrgb = (linear: Triple): Triple => oklabToOklch(linearToOklab(linear));\n\nconst isUnit = (channels: Triple) =>\n channels.every((channel) => channel >= -1e-6 && channel <= 1 + 1e-6);\n\n/* The channels of one function, as a color in the picker's spaces. */\nfunction readChannels(\n name: string,\n parts: string[],\n): { space: ColorPickerColorSpace; channels: Triple } | null {\n if (name === \"rgb\") {\n const rgb = parts.map((part) => readNumber(part, 255));\n if (rgb.some((value) => value === null)) return null;\n return {\n space: \"rgb\",\n channels: rgb.map((value) => clamp(value!, 0, 255)) as Triple,\n };\n }\n if (name === \"hsl\" || name === \"hsv\" || name === \"hsb\" || name === \"hwb\") {\n const hue = readNumber(parts[0], 1, true);\n const first = readNumber(parts[1], 100);\n const second = readNumber(parts[2], 100);\n if (hue === null || first === null || second === null) return null;\n const x = clamp(first, 0, 100);\n const y = clamp(second, 0, 100);\n if (name === \"hsl\") return { space: \"hsl\", channels: [hue, x, y] };\n if (name !== \"hwb\") return { space: \"hsv\", channels: [hue, x, y] };\n /* hwb(): whiteness and blackness are HSB's saturation and brightness\n read from the other end; summing past 100% gives their gray. */\n const total = x + y;\n if (total >= 100) {\n return { space: \"hsv\", channels: [hue, 0, (x / total) * 100] };\n }\n const brightness = 100 - y;\n return {\n space: \"hsv\",\n channels: [hue, (1 - x / brightness) * 100, brightness],\n };\n }\n if (name === \"oklch\" || name === \"oklab\") {\n const lightness = readNumber(parts[0], 1);\n const second = readNumber(parts[1], 0.4);\n const third = name === \"oklch\" ? readNumber(parts[2], 1, true) : readNumber(parts[2], 0.4);\n if (lightness === null || second === null || third === null) return null;\n const l = clamp(lightness, 0, 1);\n if (name === \"oklch\") {\n return {\n space: \"oklch\",\n channels: [l * 100, Math.max(0, second), third],\n };\n }\n return {\n space: \"oklch\",\n channels: oklabToOklch([l, second, third]),\n };\n }\n if (name === \"lab\" || name === \"lch\") {\n const lightness = readNumber(parts[0], 100);\n const second = readNumber(parts[1], name === \"lab\" ? 125 : 150);\n const third = name === \"lch\" ? readNumber(parts[2], 1, true) : readNumber(parts[2], 125);\n if (lightness === null || second === null || third === null) return null;\n const l = clamp(lightness, 0, 100);\n const angle = (third * Math.PI) / 180;\n const [a, b] =\n name === \"lab\"\n ? [second, third]\n : [Math.max(0, second) * Math.cos(angle), Math.max(0, second) * Math.sin(angle)];\n return {\n space: \"oklch\",\n channels: fromLinearSrgb(multiply(D50_TO_SRGB, labToXyz([l, a, b]))),\n };\n }\n if (name === \"color\") {\n const target = RGB_SPACES[parts[0]];\n if (!target || parts.length !== 4) return null;\n const values = parts.slice(1).map((part) => readNumber(part, 1));\n if (values.some((value) => value === null)) return null;\n const channels = values as Triple;\n if (parts[0] === \"srgb\" && isUnit(channels)) {\n return {\n space: \"rgb\",\n channels: channels.map((value) => clamp(value, 0, 1) * 255) as Triple,\n };\n }\n const linear = channels.map(target.decode) as Triple;\n return {\n space: \"oklch\",\n channels: fromLinearSrgb(target.toSrgb ? multiply(target.toSrgb, linear) : linear),\n };\n }\n return null;\n}\n\n/**\n * Reads a CSS color: hex with 3, 4, 6 or 8 digits, `#` optional; the 148\n * named colors and `transparent`; `rgb()`, `hsl()`, `hwb()`, `lab()`,\n * `lch()`, `oklab()`, `oklch()` and `color()` in any of CSS Color 4's RGB\n * and XYZ spaces, plus `hsb()` or `hsv()`; modern or comma syntax, with or\n * without alpha. A color that can fall outside sRGB is kept as OKLCH.\n * Anything else, `var()` and `currentColor` included, is `null`.\n */\nexport function parseColor(input: string | null | undefined): ColorPickerColor | null {\n if (typeof input !== \"string\") return null;\n const text = input.trim().toLowerCase();\n if (!text) return null;\n if (text === \"transparent\") {\n return { space: \"rgb\", channels: [0, 0, 0], alpha: 0 };\n }\n const hex = HEX_PATTERN.exec(namedColor(text) ?? text);\n if (hex) {\n let digits = hex[1];\n if (digits.length <= 4) {\n digits = [...digits].map((digit) => digit + digit).join(\"\");\n }\n const byte = (index: number) => parseInt(digits.slice(index, index + 2), 16);\n return {\n space: \"rgb\",\n channels: [byte(0), byte(2), byte(4)],\n alpha: digits.length === 8 ? byte(6) / 255 : 1,\n };\n }\n const call = FUNCTION_PATTERN.exec(text);\n if (!call) return null;\n const name = call[1].replace(/a$/, \"\");\n const [main, slash, ...rest] = call[2].split(\"/\");\n if (rest.length > 0) return null;\n const parts = main.split(/[\\s,]+/).filter(Boolean);\n /* color() names its space first, and takes alpha only after a slash. */\n const count = name === \"color\" ? 4 : 3;\n /* Alpha follows a slash, or is the fourth value of the comma syntax. */\n const alphaToken = slash?.trim() ?? (name === \"color\" ? undefined : parts[3]);\n if (parts.length !== count && !(name !== \"color\" && parts.length === 4 && slash === undefined)) {\n return null;\n }\n const alpha = alphaToken === undefined ? 1 : readNumber(alphaToken, 1);\n const read = readChannels(name, parts.slice(0, count));\n if (alpha === null || !read) return null;\n const channels = read.channels;\n if (channels.some((channel) => !Number.isFinite(channel))) return null;\n if (read.space !== \"rgb\") {\n const hueIndex = read.space === \"oklch\" ? 2 : 0;\n channels[hueIndex] = wrapHue(channels[hueIndex]);\n }\n return { space: read.space, channels, alpha: clamp(alpha, 0, 1) };\n}\n\nconst CSS_WIDE = /^(inherit|initial|unset|revert|revert-layer|currentcolor)$/;\n\n/* Whatever else the browser paints (color-mix(), relative colors,\n light-dark(), system colors), resolved by its computed style, which\n serializes as a function parseColor reads. Two parents of different\n colors expose anything that inherits (var() with no value, a CSS-wide\n keyword); a canvas would have read those as black. Only typing reaches\n this, never a render. */\nfunction parseWithBrowser(text: string): ColorPickerColor | null {\n if (\n typeof document === \"undefined\" ||\n CSS_WIDE.test(text.toLowerCase()) ||\n !CSS.supports?.(\"color\", text)\n ) {\n return null;\n }\n const parent = document.createElement(\"div\");\n const probe = document.createElement(\"div\");\n parent.style.display = \"none\";\n probe.style.color = text;\n parent.append(probe);\n document.body.append(parent);\n parent.style.color = \"rgb(1, 2, 3)\";\n const first = getComputedStyle(probe).color;\n parent.style.color = \"rgb(4, 5, 6)\";\n const second = getComputedStyle(probe).color;\n parent.remove();\n return first === second ? parseColor(first) : null;\n}\n\n/**\n * Writes a color in a format. HEX gains a fourth byte and the others a\n * `/ alpha` only when the color is translucent; OKLCH keeps channels outside\n * sRGB, every other format maps the color into sRGB the way CSS does.\n */\nexport function formatColor(color: ColorPickerColor, format: ColorPickerFormat): string {\n const alpha = clamp(color.alpha, 0, 1);\n /* Decided on the rounded alpha, so 0.996 writes no \"/ 1\" tail. */\n const tail = fixed(alpha, 2) !== \"1\" ? ` / ${fixed(alpha, 2)}` : \"\";\n if (format === \"hex\" || format === \"rgb\") {\n const rgb = toRgb(color).map((channel) => Math.round(clamp(channel, 0, 255)));\n if (format === \"rgb\") return `rgb(${rgb.join(\" \")}${tail})`;\n const opacity = Math.round(alpha * 255);\n const bytes = opacity < 255 ? [...rgb, opacity] : rgb;\n return `#${bytes.map((byte) => byte.toString(16).padStart(2, \"0\")).join(\"\")}`;\n }\n if (format === \"oklch\") {\n const [l, c, h] = toSpace(color, \"oklch\");\n /* Fine enough that hex to OKLCH and back is exact: 0 of 140,608 colors\n drift, where 0.1% and 3 decimals moved 29,278 by up to 7. */\n /* Chroma is never below 0, and a hue that rounds to 360 is 0. */\n const hue = fixed(wrapHue(Number(h.toFixed(3))), 3);\n return `oklch(${fixed(l, 2)}% ${fixed(Math.max(0, c), 5)} ${hue}${tail})`;\n }\n const [h, s, third] = toSpace(color, format === \"hsl\" ? \"hsl\" : \"hsv\");\n return `${format}(${fixed(h, 1)} ${fixed(s, 1)}% ${fixed(third, 1)}%${tail})`;\n}\n\n/* What CSS paints: OKLCH as itself, so a wide-gamut screen shows it. */\nconst toCss = (color: ColorPickerColor) =>\n formatColor(color, color.space === \"oklch\" ? \"oklch\" : \"rgb\");\n\nfunction luminance(rgb: Triple) {\n const [r, g, b] = rgb.map(toLinear);\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n}\n\n/* A translucent color composited onto an opaque one. */\nfunction over(top: ColorPickerColor, bottom: Triple): Triple {\n const rgb = toRgb(top);\n return rgb.map(\n (channel, index) => channel * top.alpha + bottom[index] * (1 - top.alpha),\n ) as Triple;\n}\n\n/**\n * The WCAG 2 contrast ratio, 1 to 21. A translucent foreground is laid over\n * the background, and a translucent background over white. `null` when either\n * color does not parse.\n */\nexport function getContrastRatio(\n foreground: string | ColorPickerColor,\n background: string | ColorPickerColor,\n): number | null {\n const front = typeof foreground === \"string\" ? parseColor(foreground) : foreground;\n const back = typeof background === \"string\" ? parseColor(background) : background;\n if (!front || !back) return null;\n const base = over(back, [255, 255, 255]);\n const a = luminance(over(front, base));\n const b = luminance(base);\n return (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);\n}\n\n/* The relative luminance where light and dark text read about equally well.\n It matches the APCA choice on all 110 Tailwind shades from 300 to 700; the\n WCAG 2 ratio flips near 0.18 and puts dark text on blue-500 and red-500. */\nconst FOREGROUND_SWITCH = 0.36;\n\n/**\n * The text color that reads better on a background: `light` on a dark one,\n * `dark` on a light one. Light text also has to reach 3:1 by WCAG 2, the AA\n * bar for large text and icons, so orange-500 and sky-500 take dark text.\n * A translucent background is laid over white, as in `getContrastRatio`.\n * `null` when the background does not parse.\n */\nexport function getForegroundColor(\n background: string | ColorPickerColor,\n { light = \"#ffffff\", dark = \"#0a0a0a\" }: { light?: string; dark?: string } = {},\n): string | null {\n const color = typeof background === \"string\" ? parseColor(background) : background;\n if (!color) return null;\n return luminance(over(color, [255, 255, 255])) < FOREGROUND_SWITCH &&\n (getContrastRatio(light, color) ?? 0) >= 3\n ? light\n : dark;\n}\n\n/* OKLCH hue boundaries, each the upper end of its name. */\nconst HUE_NAMES: Array<[number, string]> = [\n [15, \"pink\"],\n [45, \"red\"],\n [80, \"orange\"],\n [120, \"yellow\"],\n [135, \"lime\"],\n [165, \"green\"],\n [205, \"cyan\"],\n [250, \"sky blue\"],\n [280, \"blue\"],\n [300, \"violet\"],\n [320, \"purple\"],\n [345, \"magenta\"],\n [360, \"pink\"],\n];\n\n/** A rough English name: \"dark vibrant blue\", \"light gray\". Swap it through `i18n.functions`. */\nfunction nameColor(color: ColorPickerColor) {\n const [lightness, chroma, hue] = toSpace(color, \"oklch\");\n const l = lightness / 100;\n if (chroma < 0.025) {\n if (l < 0.2) return \"black\";\n if (l < 0.45) return \"dark gray\";\n if (l < 0.75) return \"gray\";\n return l < 0.95 ? \"light gray\" : \"white\";\n }\n let name = HUE_NAMES.find(([end]) => hue < end)?.[1] ?? \"pink\";\n if (l < 0.6 && hue >= 40 && hue < 100) name = \"brown\";\n else if (l < 0.6 && hue >= 100 && hue < 135) name = \"olive\";\n const tone = chroma < 0.07 ? \"grayish \" : chroma > 0.2 ? \"vibrant \" : \"\";\n const shade = l < 0.45 ? \"dark \" : l > 0.82 ? \"light \" : \"\";\n return `${shade}${tone}${name}`;\n}\n\nexport const DEFAULT_COLOR_PICKER_I18N: ColorPickerI18nConfig = {\n labels: {\n placeholder: \"Select color\",\n panelLabel: \"Choose color\",\n openPicker: \"Open color picker\",\n area: \"Color\",\n hue: \"Hue\",\n saturation: \"Saturation\",\n brightness: \"Brightness\",\n lightness: \"Lightness\",\n chroma: \"Chroma\",\n red: \"Red\",\n green: \"Green\",\n blue: \"Blue\",\n alpha: \"Opacity\",\n hex: \"Hex\",\n format: \"Color format\",\n eyeDropper: \"Pick a color from the screen\",\n copy: \"Copy color\",\n copied: \"Copied\",\n clear: \"Clear\",\n swatches: \"Swatches\",\n },\n functions: { getColorName: nameColor },\n};\n\n/** Merges per section, so an override can carry one key without restating the rest. */\nexport function mergeColorPickerI18n(overrides?: ColorPickerI18nOverrides): ColorPickerI18nConfig {\n if (!overrides?.labels && !overrides?.functions) {\n return DEFAULT_COLOR_PICKER_I18N;\n }\n return {\n labels: { ...DEFAULT_COLOR_PICKER_I18N.labels, ...overrides.labels },\n functions: {\n ...DEFAULT_COLOR_PICKER_I18N.functions,\n ...overrides.functions,\n },\n };\n}\n\n/* -------------------------------------------------------------------------- */\n/* Channels */\n/* -------------------------------------------------------------------------- */\n\nconst DEFAULT_SPACE: Record<ColorPickerChannel, ColorPickerColorSpace> = {\n hue: \"hsv\",\n saturation: \"hsv\",\n brightness: \"hsv\",\n lightness: \"hsl\",\n chroma: \"oklch\",\n red: \"rgb\",\n green: \"rgb\",\n blue: \"rgb\",\n alpha: \"rgb\",\n};\n\n/* A space that has no such channel falls back to the channel's own. */\nconst resolveSpace = (channel: ColorPickerChannel, space: ColorPickerColorSpace | undefined) =>\n channel !== \"alpha\" && space && SPACE_CHANNELS[space].includes(channel)\n ? space\n : DEFAULT_SPACE[channel];\n\nfunction channelRange(space: ColorPickerColorSpace, channel: ColorPickerChannel) {\n if (channel === \"alpha\") return { max: 1, step: 0.01 };\n if (channel === \"hue\") return { max: 360, step: 1 };\n if (channel === \"chroma\") return { max: 0.4, step: 0.004 };\n return { max: space === \"rgb\" ? 255 : 100, step: 1 };\n}\n\nfunction readChannel(\n color: ColorPickerColor,\n space: ColorPickerColorSpace,\n channel: ColorPickerChannel,\n) {\n if (channel === \"alpha\") return color.alpha;\n return toSpace(color, space)[SPACE_CHANNELS[space].indexOf(channel)];\n}\n\nfunction withChannel(\n color: ColorPickerColor,\n space: ColorPickerColorSpace,\n channel: ColorPickerChannel,\n value: number,\n): ColorPickerColor {\n if (channel === \"alpha\") return { ...color, alpha: clamp(value, 0, 1) };\n const channels = [...toSpace(color, space)] as Triple;\n channels[SPACE_CHANNELS[space].indexOf(channel)] = value;\n return { space, channels, alpha: color.alpha };\n}\n\n/* Screen reader text for one channel: \"210°, blue\", \"50%\", \"128\". */\nfunction channelValueText(\n color: ColorPickerColor,\n space: ColorPickerColorSpace,\n channel: ColorPickerChannel,\n i18n: ColorPickerI18nConfig,\n) {\n const value = readChannel(color, space, channel);\n if (channel === \"alpha\") return `${Math.round(value * 100)}%`;\n if (channel === \"chroma\") return fixed(value, 3);\n if (channel === \"hue\") {\n return `${Math.round(value)}°, ${i18n.functions.getColorName(color)}`;\n }\n return space === \"rgb\" ? String(Math.round(value)) : `${Math.round(value)}%`;\n}\n\n/* The colors a track runs through: the full spectrum for hue, so a gray\n still shows where it would go, and sampled stops elsewhere, since OKLCH\n and HSL lightness do not run straight in sRGB. */\nfunction trackStops(\n color: ColorPickerColor,\n space: ColorPickerColorSpace,\n channel: ColorPickerChannel,\n) {\n const opaque = { ...color, alpha: 1 };\n if (channel === \"alpha\") return [\"transparent\", toCss(opaque)];\n let base = opaque;\n if (channel === \"hue\") {\n base =\n space === \"oklch\"\n ? withChannel(\n opaque,\n \"oklch\",\n \"chroma\",\n Math.max(readChannel(opaque, \"oklch\", \"chroma\"), 0.12),\n )\n : { space: \"hsv\", channels: [0, 100, 100], alpha: 1 };\n }\n const count =\n channel === \"hue\" || space === \"oklch\"\n ? 13\n : space === \"hsl\" && channel === \"lightness\"\n ? 3\n : 2;\n const { max } = channelRange(space, channel);\n const target = channel === \"hue\" && space !== \"oklch\" ? \"hsv\" : space;\n return Array.from({ length: count }, (_, index) =>\n formatColor(withChannel(base, target, channel, (max * index) / (count - 1)), \"rgb\"),\n );\n}\n\n/* The transparency grid behind translucent colors, in theme tokens. */\nconst CHECKER =\n \"repeating-conic-gradient(var(--color-muted) 0 25%, var(--color-background) 0 50%) 50% / 8px 8px\";\n\n/* -------------------------------------------------------------------------- */\n/* Context */\n/* -------------------------------------------------------------------------- */\n\n/* What the controls show while the value is empty: white, hue 0. */\nconst EMPTY_COLOR: ColorPickerColor = {\n space: \"hsv\",\n channels: [0, 0, 100],\n alpha: 1,\n};\n\ntype ColorPickerContextValue = {\n id: string;\n value: string | null;\n /** The color written in `format` for display, hex in capitals, or `null`. */\n text: string | null;\n /** The committed color, or `null` while empty. */\n color: ColorPickerColor | null;\n /** What the controls show: the color, or white while empty. */\n display: ColorPickerColor;\n format: ColorPickerFormat;\n alpha: boolean;\n i18n: ColorPickerI18nConfig;\n disabled: boolean;\n readOnly: boolean;\n editable: boolean;\n invalid: boolean;\n required: boolean;\n label: string | undefined;\n labelledBy: string | undefined;\n describedBy: string | undefined;\n swatches: string[] | undefined;\n open: boolean;\n setOpen: (open: boolean) => void;\n /** The latest color, for handlers that fire before the next render. */\n getColor: () => ColorPickerColor;\n /** Changes the value mid-interaction; `onValueCommit` waits for the end. */\n emit: (color: ColorPickerColor | null) => void;\n startInteraction: () => void;\n endInteraction: () => void;\n /** A whole interaction in one: emits and commits. */\n change: (color: ColorPickerColor | null) => void;\n /** The trigger or the input: where a failed `required` check sends focus. */\n registerFocusTarget: (node: HTMLElement | null) => void;\n /** The format on screen: the fields' when they are shown, else `format`. */\n shownFormat: ColorPickerFormat;\n setFieldsFormat: (format: ColorPickerFormat | null) => void;\n /** Writes the value to the clipboard, in the format on screen by default. */\n copy: (format?: ColorPickerFormat) => void;\n /** The format just copied, for 1.5 seconds, so its button can confirm. */\n copied: ColorPickerFormat | null;\n};\n\nconst ColorPickerContext = createContext<ColorPickerContextValue | null>(null);\n\n/** \"inline\" unless a part renders inside `ColorPickerContent`. */\nconst SurfaceContext = createContext<\"inline\" | \"popup\">(\"inline\");\n\nfunction useColorPickerContext(part: string) {\n const context = useContext(ColorPickerContext);\n if (!context) throw new Error(`${part} must be used within a ColorPicker`);\n return context;\n}\n\nexport type ColorPickerApi = {\n /** The value as emitted, or `null`. */\n value: string | null;\n color: ColorPickerColor | null;\n format: ColorPickerFormat;\n open: boolean;\n setOpen: (open: boolean) => void;\n /** Commits any color `parseColor` reads; `null` or `\"\"` clears, anything else is ignored. */\n setValue: (value: string | null) => void;\n clear: () => void;\n};\n\n/** The picker's state and actions, inside a `ColorPicker`. */\nexport function useColorPicker(): ColorPickerApi {\n const context = useColorPickerContext(\"useColorPicker\");\n return {\n value: context.value,\n color: context.color,\n format: context.format,\n open: context.open,\n setOpen: context.setOpen,\n setValue: (value) => {\n if (!value) return context.change(null);\n const parsed = parseColor(value);\n if (parsed) context.change(parsed);\n },\n clear: () => context.change(null),\n };\n}\n\nfunction assignRef<T>(ref: Ref<T> | undefined, node: T | null) {\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Root */\n/* -------------------------------------------------------------------------- */\n\nexport type ColorPickerProps = {\n /** Controlled value: any color `parseColor` reads. `null` is empty. */\n value?: string | null;\n defaultValue?: string | null;\n /** Fires on every change, a drag included, with the value in `format`. */\n onValueChange?: (value: string | null) => void;\n /** Fires once an interaction ends: a drag released, a key, a field, a swatch. */\n onValueCommit?: (value: string | null) => void;\n /** How the value is written. */\n format?: ColorPickerFormat;\n /** Adds the opacity slider and field, and lets the value carry alpha. */\n alpha?: boolean;\n /** Preset colors under the default panel. */\n swatches?: string[];\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n disabled?: boolean;\n readOnly?: boolean;\n invalid?: boolean;\n /** Submits the value with a native form under this name. */\n name?: string;\n form?: string;\n required?: boolean;\n /** The hidden form field, for form libraries that focus a field on error. */\n inputRef?: Ref<HTMLInputElement>;\n /** Lands on the trigger or the input. */\n id?: string;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n i18n?: ColorPickerI18nOverrides;\n /** Without children the picker renders a trigger and a popover; these reach the trigger. */\n placeholder?: string;\n className?: string;\n children?: ReactNode;\n};\n\nexport function ColorPicker({\n value,\n defaultValue = null,\n onValueChange,\n onValueCommit,\n format = \"hex\",\n alpha = false,\n swatches,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n disabled = false,\n readOnly = false,\n invalid = false,\n name,\n form,\n required = false,\n inputRef,\n id: idProp,\n \"aria-label\": label,\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy,\n i18n: i18nProp,\n placeholder,\n className,\n children,\n}: ColorPickerProps) {\n const generatedId = useId();\n const id = idProp ?? generatedId;\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n /* What a form reset restores, as a native field returns to its default. */\n const [initialValue] = useState(defaultValue);\n const [openState, setOpenState] = useState(defaultOpen);\n const open = openProp ?? openState;\n const raw = (value !== undefined ? value : uncontrolled) || null;\n\n /* The channels behind the value, kept in the space they were edited in. A\n value from outside is parsed afresh; one this picker emitted keeps its\n channels, so the hue of a gray and an OKLCH chroma survive. */\n const [held, setHeld] = useState(() => ({\n value: raw,\n color: parseColor(raw),\n }));\n let color = held.color;\n if (held.value !== raw) {\n color = parseColor(raw);\n setHeld({ value: raw, color });\n }\n if (color && !alpha && color.alpha !== 1) color = { ...color, alpha: 1 };\n const display = color ?? EMPTY_COLOR;\n\n const latest = useRef({ value: raw, color: display });\n useLayoutEffect(() => {\n latest.current = { value: raw, color: display };\n });\n const interaction = useRef<{ from: string | null } | null>(null);\n const focusTarget = useRef<HTMLElement | null>(null);\n const fieldRef = useRef<HTMLInputElement | null>(null);\n const resetRef = useRef(() => {});\n const i18n = mergeColorPickerI18n(i18nProp);\n const editable = !disabled && !readOnly;\n\n const setOpen = (next: boolean) => {\n if (next && disabled) return;\n if (openProp === undefined) setOpenState(next);\n onOpenChange?.(next);\n };\n\n const canonical = (text: string | null) => {\n const parsed = parseColor(text);\n if (!parsed) return null;\n return formatColor(alpha ? parsed : { ...parsed, alpha: 1 }, format);\n };\n\n const emit = (next: ColorPickerColor | null) => {\n if (!editable) return;\n const normalized = next && !alpha ? { ...next, alpha: 1 } : next;\n const nextValue = normalized ? formatColor(normalized, format) : null;\n const previous = latest.current.value;\n /* The same color written another way, `#FF0000` for `#ff0000`, keeps its\n string: no change is emitted that nobody made. */\n const same = nextValue === previous || nextValue === canonical(previous);\n const kept = same ? previous : nextValue;\n latest.current = { value: kept, color: normalized ?? EMPTY_COLOR };\n setHeld({ value: kept, color: normalized });\n if (same) return;\n if (value === undefined) setUncontrolled(nextValue);\n onValueChange?.(nextValue);\n };\n\n const startInteraction = () => {\n interaction.current = { from: latest.current.value };\n };\n\n const endInteraction = () => {\n const started = interaction.current;\n interaction.current = null;\n if (started && started.from !== latest.current.value) {\n onValueCommit?.(latest.current.value);\n }\n };\n\n /* The fields report the format they show, so a copy takes what is seen. */\n const [fieldsFormat, setFieldsFormat] = useState<ColorPickerFormat | null>(null);\n const shownFormat = fieldsFormat ?? format;\n const [copied, setCopied] = useState<ColorPickerFormat | null>(null);\n const copiedTimer = useRef(0);\n useEffect(() => () => window.clearTimeout(copiedTimer.current), []);\n\n const context: ColorPickerContextValue = {\n id,\n value: raw,\n text: color\n ? format === \"hex\"\n ? formatColor(color, format).toUpperCase()\n : formatColor(color, format)\n : null,\n color,\n display,\n format,\n alpha,\n i18n,\n disabled,\n readOnly,\n editable,\n invalid,\n required,\n label,\n labelledBy,\n describedBy,\n swatches,\n open,\n setOpen,\n getColor: () => latest.current.color,\n emit,\n startInteraction,\n endInteraction,\n change: (next) => {\n startInteraction();\n emit(next);\n endInteraction();\n },\n registerFocusTarget: (node) => {\n if (node) focusTarget.current = node;\n },\n shownFormat,\n setFieldsFormat,\n copy: (to = shownFormat) => {\n if (!color) return;\n navigator.clipboard?.writeText(formatColor(color, to)).then(\n () => {\n setCopied(to);\n window.clearTimeout(copiedTimer.current);\n copiedTimer.current = window.setTimeout(() => setCopied(null), 1500);\n },\n /* No clipboard permission: nothing was copied, nothing to confirm. */\n () => {},\n );\n },\n copied,\n };\n\n useEffect(() => {\n resetRef.current = () => context.change(parseColor(initialValue));\n });\n\n /* Listens on the field's own root and asks for its form at reset time, so a\n `form` attribute is honoured. The restore waits a task, like a native\n reset's default action, because any listener may still cancel it. */\n const hasField = !!name || required;\n useEffect(() => {\n const root = fieldRef.current?.getRootNode();\n if (!root) return;\n let pending = 0;\n const onReset = (event: Event) => {\n if (event.target !== fieldRef.current?.form) return;\n pending = window.setTimeout(() => {\n if (!event.defaultPrevented) resetRef.current();\n });\n };\n root.addEventListener(\"reset\", onReset, true);\n return () => {\n root.removeEventListener(\"reset\", onReset, true);\n window.clearTimeout(pending);\n };\n }, []);\n\n return (\n <ColorPickerContext.Provider value={context}>\n <Popover open={open} onOpenChange={(next) => setOpen(next)}>\n {children === undefined ? (\n <>\n <ColorPickerTrigger className={className} placeholder={placeholder} />\n <ColorPickerContent />\n </>\n ) : (\n children\n )}\n </Popover>\n <span role=\"status\" className=\"sr-only\">\n {copied ? i18n.labels.copied : \"\"}\n </span>\n {hasField && (\n <input\n ref={(node) => {\n fieldRef.current = node;\n assignRef(inputRef, node);\n }}\n type=\"text\"\n name={name}\n form={form}\n required={required && !readOnly}\n disabled={disabled}\n value={color ? formatColor(color, format) : \"\"}\n onChange={() => {}}\n tabIndex={-1}\n aria-hidden=\"true\"\n data-slot=\"color-picker-field\"\n /* A failed `required` check focuses this field; hand that to the control. */\n onFocus={(event) => {\n const target =\n (focusTarget.current?.isConnected ? focusTarget.current : null) ??\n event.currentTarget.ownerDocument.getElementById(`${id}-area`);\n if (target) target.focus();\n else event.currentTarget.blur();\n }}\n className=\"pointer-events-none absolute size-px max-w-px opacity-0\"\n />\n )}\n </ColorPickerContext.Provider>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Swatch */\n/* -------------------------------------------------------------------------- */\n\n/* The inset ring keeps a white swatch visible on a white surface. */\nconst SWATCH_CLASS =\n \"forced-color-adjust-none relative inline-flex size-4 shrink-0 after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:inset-ring after:inset-ring-foreground/10\";\n\n/* A small square chip takes the shadcn Checkbox's radius in each style. */\nconst SWATCH_SQUARE = \"rounded-[4px]\";\n\n/* A slash through an empty swatch, the convention for \"no color\". */\nconst EMPTY_SWATCH =\n \"linear-gradient(to top right, transparent calc(50% - 0.75px), var(--color-destructive) calc(50% - 0.75px) calc(50% + 0.75px), transparent calc(50% + 0.75px))\";\n\nfunction swatchBackground(color: ColorPickerColor | null) {\n if (!color) return EMPTY_SWATCH;\n const css = toCss(color);\n return color.alpha < 1 ? `linear-gradient(${css}, ${css}), ${CHECKER}` : css;\n}\n\nexport type ColorPickerSwatchProps = Omit<ComponentProps<\"span\">, \"color\"> & {\n /** The color to show. Defaults to the picker's value, so it also works outside one. */\n color?: string | null;\n /** `square` follows each style's radius; `circle` is round in all of them. */\n shape?: \"square\" | \"circle\";\n};\n\n/** A color chip: the value in a trigger, or any color in a table or a legend. */\nexport function ColorPickerSwatch({\n color: colorProp,\n shape = \"square\",\n className,\n style,\n ...props\n}: ColorPickerSwatchProps) {\n const context = useContext(ColorPickerContext);\n const color = colorProp !== undefined ? parseColor(colorProp) : (context?.color ?? null);\n const labelled = !!props[\"aria-label\"] || !!props[\"aria-labelledby\"];\n return (\n <span\n role={labelled ? \"img\" : undefined}\n aria-hidden={labelled ? undefined : true}\n data-slot=\"color-picker-swatch\"\n data-empty={color ? undefined : \"\"}\n className={cn(SWATCH_CLASS, shape === \"circle\" ? \"rounded-full\" : SWATCH_SQUARE, className)}\n style={{ background: swatchBackground(color), ...style }}\n {...props}\n />\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Triggers */\n/* -------------------------------------------------------------------------- */\n\nconst CHEVRON_ICON = <ChevronDownIcon aria-hidden=\"true\" />;\n\nexport type ColorPickerValueProps = Omit<ComponentProps<\"span\">, \"children\"> & {\n placeholder?: ReactNode;\n};\n\n/** The value as text, or the placeholder. For custom trigger content. */\nexport function ColorPickerValue({ placeholder, className, ...props }: ColorPickerValueProps) {\n const context = useColorPickerContext(\"ColorPickerValue\");\n return (\n <span\n data-slot=\"color-picker-value\"\n data-placeholder={context.color ? undefined : \"\"}\n className={cn(\"truncate\", className)}\n {...props}\n >\n {context.text ?? placeholder ?? context.i18n.labels.placeholder}\n </span>\n );\n}\n\n/* `normal-case` and `tracking-normal` undo sera's uppercase button text: the\n trigger reads as a field, not an action. */\nconst TRIGGER_CLASS =\n \"font-normal normal-case tracking-normal tabular-nums data-placeholder:text-muted-foreground\";\n\nexport type ColorPickerTriggerProps = ComponentProps<typeof Button> & {\n placeholder?: ReactNode;\n};\n\n/** A shadcn Button that opens the picker. Children replace the swatch, value and chevron. */\nexport function ColorPickerTrigger({\n className,\n variant = \"outline\",\n placeholder,\n children,\n ref,\n ...props\n}: ColorPickerTriggerProps) {\n const context = useColorPickerContext(\"ColorPickerTrigger\");\n const labelledBy = props[\"aria-labelledby\"] ?? context.labelledBy;\n const buttonProps = {\n variant,\n disabled: context.disabled,\n \"aria-label\": context.label,\n \"aria-describedby\": context.describedBy,\n ...(context.invalid && { \"aria-invalid\": true, \"data-invalid\": \"\" }),\n ...props,\n /* The label, then the button's own text: a label alone would replace the\n value, or whatever custom children show. */\n \"aria-labelledby\": labelledBy ? `${labelledBy} ${context.id}` : undefined,\n onKeyDown: (event: Parameters<NonNullable<typeof props.onKeyDown>>[0]) => {\n props.onKeyDown?.(event);\n if (!event.defaultPrevented) copyOnShortcut(event, context);\n },\n id: context.id,\n ref: (node: HTMLButtonElement | null) => {\n context.registerFocusTarget(node);\n assignRef(ref, node);\n },\n \"data-slot\": \"color-picker-trigger\",\n \"data-placeholder\": context.color ? undefined : \"\",\n className: cn(TRIGGER_CLASS, children === undefined && \"justify-start\", className),\n };\n const content =\n children === undefined ? (\n <>\n <ColorPickerSwatch data-icon=\"inline-start\" />\n <ColorPickerValue placeholder={placeholder} className=\"flex-1 text-start\" />\n <span data-icon=\"inline-end\" aria-hidden=\"true\" className=\"text-muted-foreground flex\">\n {CHEVRON_ICON}\n </span>\n </>\n ) : (\n children\n );\n\n return (\n <PopoverTrigger id={context.id} render={<Button {...buttonProps} />}>\n {content}\n </PopoverTrigger>\n );\n}\n\nexport type ColorPickerInputProps = Omit<\n ComponentProps<typeof InputGroupInput>,\n \"value\" | \"defaultValue\"\n>;\n\n/**\n * A typable field with a swatch button that opens the picker. It reads any\n * CSS color the browser knows, named colors included, on blur and Enter;\n * Escape restores the value and Alt+ArrowDown opens the popover.\n */\nexport function ColorPickerInput({\n className,\n placeholder,\n onBlur,\n onKeyDown,\n onChange,\n ref,\n ...props\n}: ColorPickerInputProps) {\n const context = useColorPickerContext(\"ColorPickerInput\");\n /* `null` while the field shows the value rather than an edit in progress. */\n const [text, setText] = useState<string | null>(null);\n const current = context.text ?? \"\";\n const shown = text ?? current;\n const fieldRef = useRef<HTMLInputElement | null>(null);\n useEscapeRevert(fieldRef, text !== null, () => setText(null));\n\n const read = () => {\n if (text === null) return;\n setText(null);\n if (text === current) return;\n if (!text.trim()) return context.change(null);\n const typed = parseColor(text) ?? parseWithBrowser(text.trim());\n if (typed) context.change(typed);\n };\n\n const swatchProps = {\n size: \"icon-xs\" as const,\n disabled: context.disabled,\n \"aria-label\": context.i18n.labels.openPicker,\n \"data-slot\": \"color-picker-input-trigger\",\n };\n\n return (\n <InputGroup\n data-slot=\"color-picker-input\"\n data-disabled={context.disabled ? \"\" : undefined}\n className={className}\n >\n <InputGroupAddon align=\"inline-start\">\n <PopoverTrigger render={<InputGroupButton {...swatchProps} />}>\n <ColorPickerSwatch />\n </PopoverTrigger>\n </InputGroupAddon>\n <InputGroupInput\n value={shown}\n placeholder={placeholder ?? context.i18n.labels.placeholder}\n disabled={context.disabled}\n readOnly={context.readOnly}\n required={context.required}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n autoCapitalize=\"off\"\n spellCheck={false}\n aria-keyshortcuts=\"Alt+ArrowDown\"\n aria-label={context.label}\n aria-labelledby={context.labelledBy}\n aria-describedby={context.describedBy}\n aria-invalid={context.invalid || undefined}\n className=\"tabular-nums\"\n onChange={(event) => {\n onChange?.(event);\n setText(event.target.value);\n }}\n onBlur={(event) => {\n onBlur?.(event);\n read();\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || copyOnShortcut(event, context)) return;\n if (event.key === \"Enter\") {\n /* Flushed, so an implicit form submit reads the new value. */\n flushSync(() => read());\n } else if (event.altKey && event.key === \"ArrowDown\") {\n event.preventDefault();\n read();\n context.setOpen(true);\n }\n }}\n {...props}\n id={context.id}\n ref={(node: HTMLInputElement | null) => {\n fieldRef.current = node;\n context.registerFocusTarget(node);\n assignRef(ref, node);\n }}\n />\n </InputGroup>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Panel */\n/* -------------------------------------------------------------------------- */\n\nconst TABBABLE =\n 'button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])';\n\nexport type ColorPickerContentProps = ComponentProps<typeof PopoverContent>;\n\n/**\n * The popover: the default panel unless given children. Tab cycles inside\n * it, as in a date picker dialog, in both twins.\n */\nexport function ColorPickerContent({\n className,\n align = \"start\",\n onKeyDown,\n children,\n ...props\n}: ColorPickerContentProps) {\n const context = useColorPickerContext(\"ColorPickerContent\");\n return (\n <PopoverContent\n align={align}\n aria-labelledby={context.labelledBy}\n aria-label={\n context.labelledBy ? undefined : (context.label ?? context.i18n.labels.panelLabel)\n }\n /* OKLCH with opacity needs the extra width for its four fields, and\n more below md, where the shadcn input's text grows to 16px so iOS\n does not zoom on focus. Capped to the viewport. A variable, not\n md:w-*, so one plain w-* in className wins at every breakpoint. */\n className={cn(\n \"w-(--color-picker-content-width) max-w-[calc(100vw-1rem)]\",\n context.alpha\n ? \"[--color-picker-content-width:--spacing(96)] md:[--color-picker-content-width:--spacing(84)]\"\n : \"[--color-picker-content-width:--spacing(72)]\",\n className,\n )}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || event.key !== \"Tab\") return;\n if (event.altKey || event.ctrlKey || event.metaKey) return;\n const items = Array.from(event.currentTarget.querySelectorAll<HTMLElement>(TABBABLE));\n const active = event.currentTarget.ownerDocument.activeElement;\n const first = items[0];\n const last = items[items.length - 1];\n if (!event.shiftKey && active === last) {\n event.preventDefault();\n first?.focus();\n } else if (event.shiftKey && active === first) {\n event.preventDefault();\n last?.focus();\n }\n }}\n {...props}\n >\n <SurfaceContext.Provider value=\"popup\">\n {children === undefined ? <ColorPickerPanel /> : children}\n </SurfaceContext.Provider>\n </PopoverContent>\n );\n}\n\n/* Bespoke spacing, a step tighter than each style's popover gap: the area,\n the sliders and the fields read as one control. */\nconst PANEL_CLASS = \"flex w-full min-w-0 flex-col gap-2.5\";\n\nexport type ColorPickerPanelProps = ComponentProps<\"div\">;\n\n/**\n * The area, the sliders, the fields and any `swatches`, rendered in place:\n * put it straight inside a `ColorPicker` for an always-open picker.\n */\nexport function ColorPickerPanel({ className, children, ...props }: ColorPickerPanelProps) {\n const context = useColorPickerContext(\"ColorPickerPanel\");\n const inline = useContext(SurfaceContext) === \"inline\";\n return (\n <div\n role={inline ? \"group\" : undefined}\n aria-labelledby={inline ? context.labelledBy : undefined}\n aria-label={\n inline && !context.labelledBy\n ? (context.label ?? context.i18n.labels.panelLabel)\n : undefined\n }\n data-slot=\"color-picker-panel\"\n data-disabled={context.disabled ? \"\" : undefined}\n className={cn(PANEL_CLASS, className)}\n {...props}\n >\n {children === undefined ? (\n <>\n <ColorPickerArea />\n <div className=\"flex items-center gap-3\">\n <ColorPickerEyeDropper />\n <div className=\"flex min-w-0 flex-1 flex-col gap-2.5\">\n <ColorPickerSlider channel=\"hue\" />\n {context.alpha && <ColorPickerSlider channel=\"alpha\" />}\n </div>\n <ColorPickerCopy />\n </div>\n <ColorPickerFields />\n {context.swatches && context.swatches.length > 0 && (\n <ColorPickerSwatches colors={context.swatches} />\n )}\n </>\n ) : (\n children\n )}\n </div>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Controls */\n/* -------------------------------------------------------------------------- */\n\n/* Cmd+C or Ctrl+C on a control with nothing selected copies the value in the\n format on screen. A selection in a field keeps the browser's own copy. */\nfunction copyOnShortcut(event: ReactKeyboardEvent<HTMLElement>, context: ColorPickerContextValue) {\n if (\n !(event.metaKey || event.ctrlKey) ||\n event.altKey ||\n event.shiftKey ||\n event.key.toLowerCase() !== \"c\" ||\n !context.color\n ) {\n return false;\n }\n const target = event.target;\n const selected =\n target instanceof HTMLInputElement\n ? target.selectionStart !== target.selectionEnd\n : !!event.currentTarget.ownerDocument.getSelection()?.toString();\n if (selected) return false;\n event.preventDefault();\n context.copy();\n return true;\n}\n\n/* While a field holds an edit, Escape puts the value back and stops there.\n Both popover libraries close on a document listener, which an element\n handler runs too late to stop, so this one listens on the window first. */\nfunction useEscapeRevert(\n field: { current: HTMLElement | null },\n editing: boolean,\n revert: () => void,\n) {\n const revertRef = useRef(revert);\n useLayoutEffect(() => {\n revertRef.current = revert;\n });\n useEffect(() => {\n const view = field.current?.ownerDocument.defaultView;\n if (!editing || !view) return;\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.target !== field.current) return;\n event.preventDefault();\n event.stopPropagation();\n revertRef.current();\n };\n view.addEventListener(\"keydown\", onKeyDown, true);\n return () => view.removeEventListener(\"keydown\", onKeyDown, true);\n }, [editing, field]);\n}\n\n/* Thumbs copy the shadcn Slider thumb in each style: its shape (round,\n squircle in mira, square in lyra and sera) and its keyboard ring, drawn on\n the thumb while its control has focus. */\nconst THUMB_CLASS =\n \"pointer-events-none absolute size-(--color-picker-thumb-size) -translate-x-1/2 -translate-y-1/2 border-2 border-white shadow-[0_0_0_1px_rgb(0_0_0/0.12),0_1px_3px_rgb(0_0_0/0.3)] transition-[box-shadow] rounded-full ring-ring/50 group-focus-visible/color-picker-control:ring-3 forced-colors:outline-2 forced-colors:outline-solid\";\n\n/* A hairline inside the edge, so the white corner of the area and the light\n end of a track stay visible on a white surface. */\nconst EDGE_CLASS =\n \"after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:inset-ring after:inset-ring-foreground/10\";\n\nconst CONTROL_CLASS =\n \"group/color-picker-control relative outline-none [--color-picker-thumb-size:calc(var(--spacing)*4)] select-none aria-disabled:pointer-events-none aria-disabled:opacity-50 data-dragging:cursor-grabbing\";\n\n/* Where the pointer sits, 0 to 1 each way, over a travel `inset` pixels\n shorter than the element: a slider thumb stays inside its track. */\nfunction pointerRatio(event: ReactPointerEvent<HTMLElement>, element: HTMLElement, inset = 0) {\n const rect = element.getBoundingClientRect();\n const ratio = (offset: number, size: number) =>\n size > inset ? clamp((offset - inset / 2) / (size - inset), 0, 1) : 0;\n return {\n x: ratio(event.clientX - rect.left, rect.width),\n y: ratio(event.clientY - rect.top, rect.height),\n };\n}\n\n/* A point along a slider's travel, inset by half a thumb at each end. */\nconst travel = (fraction: number) =>\n `calc(var(--color-picker-thumb-size) / 2 + (100% - var(--color-picker-thumb-size)) * ${fraction})`;\n\n/* Pointer drags shared by the area, the sliders and the wheel. The pointer is\n captured, so a drag carries on outside the control, and the browser's own\n mousedown focuses it, so a click never paints the keyboard ring. */\nfunction useDrag(\n context: ColorPickerContextValue,\n update: (event: ReactPointerEvent<HTMLElement>, element: HTMLElement) => void,\n) {\n const pointer = useRef<number | null>(null);\n const [dragging, setDragging] = useState(false);\n const end = (event: ReactPointerEvent<HTMLElement>) => {\n if (pointer.current !== event.pointerId) return;\n pointer.current = null;\n setDragging(false);\n context.endInteraction();\n };\n return {\n dragging,\n handlers: {\n onPointerDown: (event: ReactPointerEvent<HTMLElement>) => {\n if (event.button !== 0 || !context.editable) return;\n pointer.current = event.pointerId;\n event.currentTarget.setPointerCapture?.(event.pointerId);\n setDragging(true);\n context.startInteraction();\n update(event, event.currentTarget);\n },\n onPointerMove: (event: ReactPointerEvent<HTMLElement>) => {\n if (pointer.current === event.pointerId) {\n update(event, event.currentTarget);\n }\n },\n onPointerUp: end,\n onPointerCancel: end,\n },\n };\n}\n\n/* Arrows move a step, ten with Shift; Page keys ten; Home and End the ends. */\nfunction keyDelta(event: ReactKeyboardEvent, step: number) {\n const size = event.shiftKey ? step * 10 : step;\n switch (event.key) {\n case \"ArrowUp\":\n case \"ArrowRight\":\n return size;\n case \"ArrowDown\":\n case \"ArrowLeft\":\n return -size;\n case \"PageUp\":\n return step * 10;\n case \"PageDown\":\n return -step * 10;\n case \"Home\":\n return -Infinity;\n case \"End\":\n return Infinity;\n }\n return null;\n}\n\nconst snap = (value: number, step: number) => Number((Math.round(value / step) * step).toFixed(4));\n\n/* Both ends of the area run 0 to 100: saturation across, brightness up. */\nconst AREA_CLASS =\n \"forced-color-adjust-none h-40 w-full touch-none bg-[linear-gradient(to_top,#000,transparent),linear-gradient(to_right,#fff,transparent)] rounded-md\";\n\nexport type ColorPickerAreaProps = ComponentProps<\"div\">;\n\n/**\n * The saturation and brightness square, at the current hue. A single slider\n * to assistive tech, whose value text names both channels and the color.\n * Arrows move it, Shift by ten, Page keys move brightness.\n */\nexport function ColorPickerArea({ className, style, onKeyDown, ...props }: ColorPickerAreaProps) {\n const context = useColorPickerContext(\"ColorPickerArea\");\n const { labels } = context.i18n;\n const [hue, saturation, brightness] = toSpace(context.display, \"hsv\");\n const set = (s: number, v: number) => {\n const [h] = toSpace(context.getColor(), \"hsv\");\n context.emit({\n space: \"hsv\",\n channels: [h, clamp(s, 0, 100), clamp(v, 0, 100)],\n alpha: context.getColor().alpha,\n });\n };\n const { dragging, handlers } = useDrag(context, (event, element) => {\n const { x, y } = pointerRatio(event, element);\n set(x * 100, (1 - y) * 100);\n });\n\n return (\n <div\n id={`${context.id}-area`}\n role=\"slider\"\n tabIndex={context.disabled ? -1 : 0}\n aria-label={labels.area}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={Math.round(saturation)}\n aria-valuetext={`${labels.saturation} ${Math.round(saturation)}%, ${labels.brightness} ${Math.round(brightness)}%, ${context.i18n.functions.getColorName(context.display)}`}\n aria-disabled={context.disabled || undefined}\n aria-readonly={context.readOnly || undefined}\n dir=\"ltr\"\n data-slot=\"color-picker-area\"\n data-dragging={dragging ? \"\" : undefined}\n className={cn(CONTROL_CLASS, EDGE_CLASS, AREA_CLASS, className)}\n style={{ backgroundColor: `hsl(${hue} 100% 50%)`, ...style }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || copyOnShortcut(event, context)) return;\n if (!context.editable) return;\n const delta = keyDelta(event, 1);\n if (delta === null) return;\n event.preventDefault();\n const vertical =\n event.key === \"ArrowUp\" || event.key === \"ArrowDown\" || event.key.startsWith(\"Page\");\n context.startInteraction();\n /* Only the channel that moves is rounded to the step. */\n if (vertical) set(saturation, Math.round(brightness) + delta);\n else set(Math.round(saturation) + delta, brightness);\n context.endInteraction();\n }}\n {...handlers}\n {...props}\n >\n <div\n data-slot=\"color-picker-area-thumb\"\n className={THUMB_CLASS}\n style={{ left: `${saturation}%`, top: `${100 - brightness}%` }}\n />\n </div>\n );\n}\n\n/* Track thickness is the primitive's own; the radius follows the shadcn\n Slider track in each style. Vertical tracks default to the area's height. */\n/* A horizontal track fills its row and shrinks beside a sibling (an eye\n dropper); min-h-3 keeps its height in a column. A vertical one never shrinks.\n Every color surface opts out of forced colors, which would paint it over\n with a system color and drop its gradient: the color is the content. */\nconst SLIDER_CLASS =\n \"forced-color-adjust-none data-[orientation=horizontal]:h-3 data-[orientation=horizontal]:min-h-3 data-[orientation=horizontal]:w-full data-[orientation=horizontal]:min-w-0 data-[orientation=horizontal]:touch-pan-y data-[orientation=vertical]:h-40 data-[orientation=vertical]:shrink-0 data-[orientation=vertical]:w-3 data-[orientation=vertical]:touch-pan-x rounded-full\";\n\nexport type ColorPickerSliderProps = Omit<ComponentProps<\"div\">, \"children\"> & {\n channel: ColorPickerChannel;\n /** The space the channel belongs to. Defaults to HSB for hue, saturation and brightness, HSL for lightness, OKLCH for chroma and RGB for red, green and blue. */\n colorSpace?: ColorPickerColorSpace;\n orientation?: \"horizontal\" | \"vertical\";\n};\n\n/** One channel as a gradient track. Vertical tracks run bottom to top. */\nexport function ColorPickerSlider({\n channel,\n colorSpace,\n orientation = \"horizontal\",\n className,\n style,\n onKeyDown,\n ...props\n}: ColorPickerSliderProps) {\n const context = useColorPickerContext(\"ColorPickerSlider\");\n const space = resolveSpace(channel, colorSpace);\n const { max, step } = channelRange(space, channel);\n const precision = channel === \"chroma\" ? 0.001 : step;\n const value = readChannel(context.display, space, channel);\n const vertical = orientation === \"vertical\";\n const set = (next: number) => {\n context.emit(\n withChannel(context.getColor(), space, channel, clamp(snap(next, precision), 0, max)),\n );\n };\n const { dragging, handlers } = useDrag(context, (event, element) => {\n const thumb = element.lastElementChild as HTMLElement | null;\n const inset = (vertical ? thumb?.offsetHeight : thumb?.offsetWidth) ?? 0;\n const { x, y } = pointerRatio(event, element, inset);\n set((vertical ? 1 - y : x) * max);\n });\n /* Stops follow the thumb's travel, so the color under its center is the\n value's own. */\n const colors = trackStops(context.display, space, channel);\n const stops = colors.map((color, index) => `${color} ${travel(index / (colors.length - 1))}`);\n const gradient = `linear-gradient(${vertical ? \"to top\" : \"to right\"}, ${stops.join(\", \")})`;\n const fraction = clamp(value, 0, max) / max;\n const scale = channel === \"alpha\" ? 100 : 1;\n\n return (\n <div\n role=\"slider\"\n tabIndex={context.disabled ? -1 : 0}\n aria-label={context.i18n.labels[channel]}\n aria-orientation={orientation}\n aria-valuemin={0}\n aria-valuemax={max * scale}\n aria-valuenow={Number((value * scale).toFixed(3))}\n aria-valuetext={channelValueText(context.display, space, channel, context.i18n)}\n aria-disabled={context.disabled || undefined}\n aria-readonly={context.readOnly || undefined}\n dir=\"ltr\"\n data-slot=\"color-picker-slider\"\n data-channel={channel}\n data-orientation={orientation}\n data-dragging={dragging ? \"\" : undefined}\n className={cn(CONTROL_CLASS, EDGE_CLASS, SLIDER_CLASS, className)}\n style={{\n background: channel === \"alpha\" ? `${gradient}, ${CHECKER}` : gradient,\n ...style,\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || copyOnShortcut(event, context)) return;\n if (!context.editable) return;\n const delta = keyDelta(event, step);\n if (delta === null) return;\n event.preventDefault();\n context.startInteraction();\n set(snap(value, step) + delta);\n context.endInteraction();\n }}\n {...handlers}\n {...props}\n >\n <div\n data-slot=\"color-picker-slider-thumb\"\n className={THUMB_CLASS}\n style={\n vertical\n ? { left: \"50%\", top: travel(1 - fraction) }\n : { left: travel(fraction), top: \"50%\" }\n }\n />\n </div>\n );\n}\n\n/* Hue 0 at the top, increasing clockwise, as a conic gradient starts. The\n ring is a masked layer of its own, so the thumb and its focus ring are\n never masked with it. */\nconst WHEEL_RING_CLASS =\n \"forced-color-adjust-none pointer-events-none absolute inset-0 rounded-full bg-[conic-gradient(#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)] mask-[radial-gradient(farthest-side,transparent_calc(100%-var(--color-picker-wheel-thickness)),#000_calc(100%-var(--color-picker-wheel-thickness)+1px))]\";\n\nexport type ColorPickerWheelProps = ComponentProps<\"div\">;\n\n/**\n * A hue ring. Children fill the square inscribed in its hole: an area there\n * gives the classic ring-and-square picker. `--color-picker-wheel-thickness`\n * sets the ring's width.\n */\nexport function ColorPickerWheel({\n className,\n children,\n onKeyDown,\n ...props\n}: ColorPickerWheelProps) {\n const context = useColorPickerContext(\"ColorPickerWheel\");\n const [hue] = toSpace(context.display, \"hsv\");\n const set = (next: number) => {\n context.emit(withChannel(context.getColor(), \"hsv\", \"hue\", wrapHue(Math.round(next))));\n };\n const { dragging, handlers } = useDrag(context, (event, element) => {\n const rect = element.getBoundingClientRect();\n const x = event.clientX - rect.left - rect.width / 2;\n const y = event.clientY - rect.top - rect.height / 2;\n set((Math.atan2(x, -y) * 180) / Math.PI);\n });\n /* Only the ring starts a drag. The thumb rides the ring's middle, so the\n hole's edge is that radius times two, less the outer radius. */\n const onPointerDown = (event: ReactPointerEvent<HTMLElement>) => {\n const rect = event.currentTarget.getBoundingClientRect();\n const thumb = event.currentTarget\n .querySelector(\"[data-slot=color-picker-wheel-thumb]\")\n ?.getBoundingClientRect();\n if (thumb) {\n const centerX = rect.left + rect.width / 2;\n const centerY = rect.top + rect.height / 2;\n const middle = Math.hypot(\n thumb.left + thumb.width / 2 - centerX,\n thumb.top + thumb.height / 2 - centerY,\n );\n const inner = 2 * middle - rect.width / 2;\n const distance = Math.hypot(event.clientX - centerX, event.clientY - centerY);\n if (distance < inner - 2) return;\n }\n handlers.onPointerDown(event);\n };\n const angle = (hue * Math.PI) / 180;\n const radius = \"(50% - var(--color-picker-wheel-thickness) / 2)\";\n\n return (\n <div\n data-slot=\"color-picker-wheel\"\n className={cn(\n \"relative size-48 shrink-0 [--color-picker-wheel-thickness:calc(var(--spacing)*5)]\",\n className,\n )}\n {...props}\n >\n <div\n role=\"slider\"\n tabIndex={context.disabled ? -1 : 0}\n aria-label={context.i18n.labels.hue}\n aria-valuemin={0}\n aria-valuemax={360}\n aria-valuenow={Math.round(hue)}\n aria-valuetext={channelValueText(context.display, \"hsv\", \"hue\", context.i18n)}\n aria-disabled={context.disabled || undefined}\n aria-readonly={context.readOnly || undefined}\n data-slot=\"color-picker-wheel-track\"\n data-dragging={dragging ? \"\" : undefined}\n className={cn(CONTROL_CLASS, \"absolute inset-0 touch-none rounded-full\")}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || copyOnShortcut(event, context)) return;\n if (!context.editable) return;\n const delta = keyDelta(event, 1);\n if (delta === null) return;\n event.preventDefault();\n context.startInteraction();\n set(Number.isFinite(delta) ? Math.round(hue) + delta : delta > 0 ? 359 : 0);\n context.endInteraction();\n }}\n {...handlers}\n onPointerDown={onPointerDown}\n >\n <div className={WHEEL_RING_CLASS} />\n <div\n data-slot=\"color-picker-wheel-thumb\"\n className={THUMB_CLASS}\n style={{\n left: `calc(50% + ${radius} * ${Math.sin(angle)})`,\n top: `calc(50% - ${radius} * ${Math.cos(angle)})`,\n }}\n />\n </div>\n {children !== undefined && (\n <div className=\"absolute inset-[calc(50%-(50%-var(--color-picker-wheel-thickness))*0.7071+var(--spacing)*1.5)] flex items-center justify-center\">\n {children}\n </div>\n )}\n </div>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Actions */\n/* -------------------------------------------------------------------------- */\n\ntype EyeDropperConstructor = new () => {\n open: (options?: { signal?: AbortSignal }) => Promise<{ sRGBHex: string }>;\n};\n\nconst getEyeDropper = () =>\n (window as unknown as { EyeDropper?: EyeDropperConstructor }).EyeDropper;\n\nconst noSubscribe = () => () => {};\n\nexport type ColorPickerActionProps = ComponentProps<typeof Button>;\n\n/**\n * Samples a color from anywhere on screen, keeping the current opacity.\n * Renders nothing where the browser has no EyeDropper (Firefox, Safari).\n */\nexport function ColorPickerEyeDropper({\n variant = \"ghost\",\n size = \"icon-sm\",\n onClick,\n children,\n ...props\n}: ColorPickerActionProps) {\n const context = useColorPickerContext(\"ColorPickerEyeDropper\");\n /* False on the server and in the first client render, so markup matches. */\n const supported = useSyncExternalStore(\n noSubscribe,\n () => !!getEyeDropper(),\n () => false,\n );\n if (!supported) return null;\n return (\n <Button\n type=\"button\"\n variant={variant}\n size={size}\n disabled={!context.editable}\n aria-label={context.i18n.labels.eyeDropper}\n data-slot=\"color-picker-eye-dropper\"\n onClick={async (event) => {\n onClick?.(event);\n const EyeDropper = getEyeDropper();\n if (event.defaultPrevented || !EyeDropper) return;\n try {\n const { sRGBHex } = await new EyeDropper().open();\n const picked = parseColor(sRGBHex);\n if (picked) {\n context.change({ ...picked, alpha: context.getColor().alpha });\n }\n } catch {\n /* Escape cancels the sampler with an AbortError. */\n }\n }}\n {...props}\n >\n {children === undefined ? <PipetteIcon aria-hidden=\"true\" /> : children}\n </Button>\n );\n}\n\nexport type ColorPickerCopyProps = ColorPickerActionProps & {\n /** The format copied. Defaults to the picker's. */\n format?: ColorPickerFormat;\n};\n\n/**\n * Copies the value and confirms for a moment, in `format` or, by default, the\n * format on screen: what the fields show, else the picker's.\n */\nexport function ColorPickerCopy({\n format,\n variant = \"ghost\",\n size = \"icon-sm\",\n onClick,\n children,\n ...props\n}: ColorPickerCopyProps) {\n const context = useColorPickerContext(\"ColorPickerCopy\");\n const target = format ?? context.shownFormat;\n const copied = context.copied === target;\n const { labels } = context.i18n;\n return (\n <Button\n type=\"button\"\n variant={variant}\n size={size}\n disabled={context.disabled || !context.color}\n aria-label={copied ? labels.copied : labels.copy}\n aria-keyshortcuts=\"Control+C Meta+C\"\n data-slot=\"color-picker-copy\"\n data-copied={copied ? \"\" : undefined}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) context.copy(target);\n }}\n {...props}\n >\n {children === undefined ? (\n copied ? (\n <CheckIcon aria-hidden=\"true\" />\n ) : (\n <CopyIcon aria-hidden=\"true\" />\n )\n ) : (\n children\n )}\n </Button>\n );\n}\n\n/**\n * Empties the value, for an optional color. It stays enabled while empty:\n * disabling itself on click would drop keyboard focus to the page.\n */\nexport function ColorPickerClear({\n variant = \"ghost\",\n size = \"sm\",\n onClick,\n children,\n ...props\n}: ColorPickerActionProps) {\n const context = useColorPickerContext(\"ColorPickerClear\");\n return (\n <Button\n type=\"button\"\n variant={variant}\n size={size}\n disabled={!context.editable}\n data-slot=\"color-picker-clear\"\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) context.change(null);\n }}\n {...props}\n >\n {children === undefined ? context.i18n.labels.clear : children}\n </Button>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Fields */\n/* -------------------------------------------------------------------------- */\n\ntype FieldChannel = ColorPickerChannel | \"hex\";\n\nconst FORMAT_FIELDS: Record<\n ColorPickerFormat,\n { space: ColorPickerColorSpace; channels: FieldChannel[] }\n> = {\n hex: { space: \"rgb\", channels: [\"hex\"] },\n rgb: { space: \"rgb\", channels: [\"red\", \"green\", \"blue\"] },\n hsl: { space: \"hsl\", channels: [\"hue\", \"saturation\", \"lightness\"] },\n hsb: { space: \"hsv\", channels: [\"hue\", \"saturation\", \"brightness\"] },\n oklch: { space: \"oklch\", channels: [\"lightness\", \"chroma\", \"hue\"] },\n};\n\nfunction channelText(color: ColorPickerColor, space: ColorPickerColorSpace, channel: FieldChannel) {\n if (channel === \"hex\") {\n return formatColor({ ...color, alpha: 1 }, \"hex\")\n .slice(1)\n .toUpperCase();\n }\n if (channel === \"alpha\") return `${Math.round(color.alpha * 100)}%`;\n const value = readChannel(color, space, channel);\n if (channel === \"chroma\") return fixed(value, 3);\n return space === \"oklch\" ? fixed(value, 1) : String(Math.round(value));\n}\n\nconst FIELD_NUMBER = /^([+-]?(?:\\d+(?:[.,]\\d*)?|[.,]\\d+))\\s*(%|°|deg|grad|rad|turn)?$/;\n\n/* A typed channel. Hex keeps the current opacity unless it carries its own.\n A number takes a comma decimal; % is a share of the channel's range, as in\n CSS (50% red is 127.5, 50% chroma 0.2), and a hue takes an angle unit and\n wraps, so -30 is 330. Anything else is rejected. */\nfunction readChannelText(\n text: string,\n color: ColorPickerColor,\n space: ColorPickerColorSpace,\n channel: FieldChannel,\n): ColorPickerColor | null {\n if (channel === \"hex\") {\n const digits = text.trim().replace(/^#/, \"\");\n const parsed = /^[\\da-f]+$/i.test(digits) ? parseColor(digits) : null;\n if (!parsed) return null;\n return digits.length === 4 || digits.length === 8 ? parsed : { ...parsed, alpha: color.alpha };\n }\n const match = FIELD_NUMBER.exec(text.trim().toLowerCase());\n if (!match) return null;\n const value = Number(match[1].replace(\",\", \".\"));\n const unit = match[2];\n if (!Number.isFinite(value)) return null;\n if (channel === \"hue\") {\n if (unit === \"%\") return null;\n const degrees =\n unit === \"rad\"\n ? (value * 180) / Math.PI\n : unit === \"grad\"\n ? value * 0.9\n : unit === \"turn\"\n ? value * 360\n : value;\n return withChannel(color, space, channel, wrapHue(degrees));\n }\n if (unit && unit !== \"%\") return null;\n if (channel === \"alpha\") return { ...color, alpha: clamp(value / 100, 0, 1) };\n const { max } = channelRange(space, channel);\n const scaled = unit === \"%\" ? (value * max) / 100 : value;\n return withChannel(color, space, channel, clamp(scaled, 0, max));\n}\n\nexport type ColorPickerChannelInputProps = Omit<\n ComponentProps<typeof InputGroupInput>,\n \"value\" | \"defaultValue\"\n> & {\n /** A channel, or `\"hex\"` for the six hex digits. */\n channel: FieldChannel;\n colorSpace?: ColorPickerColorSpace;\n};\n\n/**\n * One channel as a borderless field for an `InputGroup`. Text is read on blur\n * and Enter; ArrowUp and ArrowDown step it, Shift by ten.\n */\nexport function ColorPickerChannelInput({\n channel,\n colorSpace,\n className,\n onBlur,\n onKeyDown,\n onChange,\n ref,\n ...props\n}: ColorPickerChannelInputProps) {\n const context = useColorPickerContext(\"ColorPickerChannelInput\");\n const space = channel === \"hex\" ? \"rgb\" : resolveSpace(channel, colorSpace);\n const [text, setText] = useState<string | null>(null);\n const current = channelText(context.display, space, channel);\n const shown = text ?? current;\n const fieldRef = useRef<HTMLInputElement | null>(null);\n useEscapeRevert(fieldRef, text !== null, () => setText(null));\n const { max } = channelRange(space, channel === \"hex\" ? \"red\" : channel);\n /* A number field is a spin button: a screen reader hears its range. */\n const spin =\n channel === \"hex\"\n ? {}\n : {\n role: \"spinbutton\",\n \"aria-valuemin\": 0,\n \"aria-valuemax\": channel === \"alpha\" ? 100 : max,\n \"aria-valuenow\":\n channel === \"alpha\"\n ? Math.round(context.display.alpha * 100)\n : Number(channelText(context.display, space, channel)),\n \"aria-valuetext\": shown,\n };\n\n const read = () => {\n if (text === null) return;\n setText(null);\n if (text === current) return;\n const next = readChannelText(text, context.display, space, channel);\n if (next) context.change(next);\n };\n\n return (\n <InputGroupInput\n value={shown}\n inputMode={channel === \"hex\" ? \"text\" : \"decimal\"}\n maxLength={channel === \"hex\" ? 9 : 8}\n disabled={context.disabled}\n readOnly={context.readOnly}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n autoCapitalize=\"off\"\n spellCheck={false}\n aria-label={context.i18n.labels[channel]}\n {...spin}\n data-channel={channel}\n className={cn(\n \"h-auto min-w-0 self-stretch pr-1 pl-2 tabular-nums\",\n /* Each field starts at its widest value plus padding, in ch so it\n tracks the font, where a tabular digit measures 1.03ch: 255 or 360,\n 99.9 for OKLCH lightness, 0.399, 359.9, 100% and six hex digits. A\n short row shrinks every field in proportion. Equal shares clipped\n 100% and every OKLCH channel. Text sits left, so the right padding\n is only the gap before the next separator. */\n channel === \"hex\"\n ? \"flex-[1_1_calc(5.8ch+0.75rem)] uppercase\"\n : channel === \"alpha\"\n ? \"flex-[1_1_calc(4.8ch+0.75rem)]\"\n : space !== \"oklch\"\n ? \"flex-[1_1_calc(3.25ch+0.75rem)]\"\n : channel === \"lightness\"\n ? \"flex-[1_1_calc(3.7ch+0.75rem)]\"\n : \"flex-[1_1_calc(4.7ch+0.75rem)]\",\n className,\n )}\n onChange={(event) => {\n onChange?.(event);\n setText(event.target.value);\n }}\n onBlur={(event) => {\n onBlur?.(event);\n read();\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || copyOnShortcut(event, context)) return;\n const step = STEP_KEYS[event.key];\n if (event.key === \"Enter\") {\n /* Flushed, so an implicit form submit reads the new value. */\n flushSync(() => read());\n } else if (step && channel !== \"hex\" && context.editable) {\n event.preventDefault();\n const from = readChannelText(shown, context.display, space, channel);\n if (!from) return;\n const unit = channel === \"alpha\" ? 0.01 : channel === \"chroma\" ? 0.001 : 1;\n const delta = step * unit * (event.shiftKey ? 10 : 1);\n const { max: top } = channelRange(space, channel);\n const next = snap(readChannel(from, space, channel) + delta, unit);\n setText(null);\n context.change(\n withChannel(\n from,\n space,\n channel,\n channel === \"hue\" ? wrapHue(next) : clamp(next, 0, top),\n ),\n );\n }\n }}\n {...props}\n ref={(node: HTMLInputElement | null) => {\n fieldRef.current = node;\n assignRef(ref, node);\n }}\n />\n );\n}\n\n/* Arrows step a field, ten with Shift; Page keys always ten. A hue wraps. */\nconst STEP_KEYS: Record<string, number> = {\n ArrowUp: 1,\n ArrowDown: -1,\n PageUp: 10,\n PageDown: -10,\n};\n\n/* Full height, so the fields read as cells of one control. */\nconst DIVIDER = <Separator orientation=\"vertical\" aria-hidden=\"true\" />;\n\n/* The shadcn inline-start addon insets its button on the left only (padding\n less a pull-in), so the format button met the first divider. Each rung\n repeats that inset on the right. maia and luma take 5px a side, concentric\n with the pill: 8px a side clipped OKLCH in the popover on a phone. */\nconst FORMAT_ADDON_CLASS = \"pr-[0.2rem]\";\n\nexport type ColorPickerFieldsProps = Omit<ComponentProps<typeof InputGroup>, \"children\"> & {\n /** The format shown, controlled. It does not change what `onValueChange` emits. */\n format?: ColorPickerFormat;\n /** Defaults to the picker's `format`. */\n defaultFormat?: ColorPickerFormat;\n onFormatChange?: (format: ColorPickerFormat) => void;\n /** The formats in the menu. One format hides the menu. */\n formats?: ColorPickerFormat[];\n};\n\n/**\n * A format menu and the value's channels as joined fields: one hex field, or\n * three channels, plus opacity when the picker takes alpha.\n */\nexport function ColorPickerFields({\n format: formatProp,\n defaultFormat,\n onFormatChange,\n formats = COLOR_PICKER_FORMATS,\n className,\n ...props\n}: ColorPickerFieldsProps) {\n const context = useColorPickerContext(\"ColorPickerFields\");\n const [formatState, setFormatState] = useState(defaultFormat ?? context.format);\n const shown = formatProp ?? formatState;\n const fields = FORMAT_FIELDS[shown];\n const { setFieldsFormat } = context;\n useLayoutEffect(() => {\n setFieldsFormat(shown);\n return () => setFieldsFormat(null);\n }, [shown, setFieldsFormat]);\n const menu = formats.length > 1;\n const setFormat = (next: ColorPickerFormat) => {\n if (formatProp === undefined) setFormatState(next);\n onFormatChange?.(next);\n };\n const menuProps = {\n size: \"xs\" as const,\n disabled: context.disabled,\n \"aria-label\": `${context.i18n.labels.format}, ${FORMAT_LABELS[shown]}`,\n \"data-slot\": \"color-picker-format-trigger\",\n className: \"gap-1 text-xs font-medium\",\n };\n\n return (\n <InputGroup\n dir=\"ltr\"\n data-slot=\"color-picker-fields\"\n data-disabled={context.disabled ? \"\" : undefined}\n className={className}\n {...props}\n >\n {menu && (\n <InputGroupAddon align=\"inline-start\" className={FORMAT_ADDON_CLASS}>\n <DropdownMenu>\n <DropdownMenuTrigger render={<InputGroupButton {...menuProps} />}>\n {FORMAT_LABELS[shown]}\n {CHEVRON_ICON}\n </DropdownMenuTrigger>\n {/* A pick's click bubbles through the portal to InputGroupAddon,\n whose own handler would move focus into a field. */}\n <DropdownMenuContent\n align=\"start\"\n className=\"w-auto min-w-56\"\n onClick={(event) => event.stopPropagation()}\n >\n <DropdownMenuRadioGroup\n value={shown}\n onValueChange={(next) => setFormat(next as ColorPickerFormat)}\n >\n {formats.map((item) => (\n <DropdownMenuRadioItem key={item} value={item} closeOnClick>\n <span className=\"w-12 shrink-0 font-medium\">{FORMAT_LABELS[item]}</span>\n <span className=\"text-muted-foreground truncate text-xs tabular-nums\">\n {formatColor(context.display, item).replace(/^\\w+\\(|\\)$/g, \"\")}\n </span>\n </DropdownMenuRadioItem>\n ))}\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </InputGroupAddon>\n )}\n <div className=\"flex min-w-0 flex-1 self-stretch\">\n {fields.channels.map((channel, index) => (\n <Fragment key={`${shown}-${channel}`}>\n {(menu || index > 0) && DIVIDER}\n <ColorPickerChannelInput channel={channel} colorSpace={fields.space} />\n </Fragment>\n ))}\n {/* Opacity keeps its own width at the end: hex, or the channels,\n take the rest of the row. */}\n {context.alpha && (\n <>\n {DIVIDER}\n <ColorPickerChannelInput\n channel=\"alpha\"\n className=\"w-[calc(4.8ch+0.75rem)] flex-none\"\n />\n </>\n )}\n </div>\n </InputGroup>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Swatches */\n/* -------------------------------------------------------------------------- */\n\ntype SwatchesContextValue = {\n shape: \"square\" | \"circle\";\n activeId: string | null;\n setActiveId: (id: string | null) => void;\n};\n\nconst SwatchesContext = createContext<SwatchesContextValue>({\n shape: \"square\",\n activeId: null,\n setActiveId: () => {},\n});\n\nexport type ColorPickerSwatchInput = string | { value: string; label?: string };\n\nconst OPTION_SELECTOR = '[data-slot=\"color-picker-swatch-item\"]:not([aria-disabled=\"true\"])';\n\n/* Arrows move to the previous or next swatch in order, mirrored right to\n left, and Home and End to the ends: the listbox model, row or wrapped. */\nfunction neighbor(\n options: HTMLElement[],\n current: HTMLElement | undefined,\n key: string,\n rtl: boolean,\n) {\n if (key === \"Home\") return options[0];\n if (key === \"End\") return options[options.length - 1];\n if (!current) return options[0];\n const forward = key === \"ArrowDown\" || key === (rtl ? \"ArrowLeft\" : \"ArrowRight\");\n return options[options.indexOf(current) + (forward ? 1 : -1)];\n}\n\nexport type ColorPickerSwatchesProps = Omit<ComponentProps<\"div\">, \"children\"> & {\n colors?: ColorPickerSwatchInput[];\n shape?: \"square\" | \"circle\";\n children?: ReactNode;\n};\n\n/**\n * Preset colors as a listbox: one tab stop, arrow keys move through them in\n * order, Enter or Space picks. `--color-picker-swatch-size` sets the chip size.\n */\nexport function ColorPickerSwatches({\n colors,\n shape = \"square\",\n className,\n children,\n onKeyDown,\n onFocus,\n ...props\n}: ColorPickerSwatchesProps) {\n const context = useColorPickerContext(\"ColorPickerSwatches\");\n const [activeId, setActiveId] = useState<string | null>(null);\n const listRef = useRef<HTMLDivElement>(null);\n const options = () =>\n Array.from(listRef.current?.querySelectorAll<HTMLElement>(OPTION_SELECTOR) ?? []);\n const activate = (option: HTMLElement | undefined) => {\n if (!option) return;\n setActiveId(option.id);\n option.scrollIntoView?.({ block: \"nearest\" });\n };\n\n return (\n <SwatchesContext.Provider value={{ shape, activeId, setActiveId }}>\n <div\n ref={listRef}\n role=\"listbox\"\n tabIndex={context.disabled ? -1 : 0}\n aria-label={context.i18n.labels.swatches}\n aria-activedescendant={activeId ?? undefined}\n aria-disabled={context.disabled || undefined}\n aria-readonly={context.readOnly || undefined}\n data-slot=\"color-picker-swatches\"\n data-empty={activeId ? undefined : \"\"}\n className={cn(\n \"group/color-picker-swatches data-empty:focus-visible:outline-ring grid grid-cols-[repeat(auto-fill,var(--color-picker-swatch-size))] justify-between gap-x-1 gap-y-1.5 outline-none [--color-picker-swatch-size:calc(var(--spacing)*6)] aria-disabled:opacity-50 data-empty:focus-visible:outline-2 data-empty:focus-visible:outline-offset-2\",\n className,\n )}\n onFocus={(event) => {\n onFocus?.(event);\n if (event.target !== event.currentTarget) return;\n const found = activeId\n ? event.currentTarget.ownerDocument.getElementById(activeId)\n : null;\n if (!found) {\n const selected = event.currentTarget.querySelector<HTMLElement>(\n `${OPTION_SELECTOR}[aria-selected=\"true\"]`,\n );\n setActiveId(selected?.id ?? null);\n }\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || copyOnShortcut(event, context)) return;\n if (context.disabled) return;\n const list = options();\n const current = list.find((option) => option.id === activeId);\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n current?.click();\n return;\n }\n if (\n ![\"ArrowLeft\", \"ArrowRight\", \"ArrowUp\", \"ArrowDown\", \"Home\", \"End\"].includes(event.key)\n ) {\n return;\n }\n event.preventDefault();\n const rtl = getComputedStyle(event.currentTarget).direction === \"rtl\";\n activate(neighbor(list, current, event.key, rtl) ?? current);\n }}\n {...props}\n >\n {children ??\n colors?.map((item, index) => {\n const swatch = typeof item === \"string\" ? { value: item } : item;\n return (\n <ColorPickerSwatchItem\n key={`${index}-${swatch.value}`}\n value={swatch.value}\n label={swatch.label}\n />\n );\n })}\n </div>\n </SwatchesContext.Provider>\n );\n}\n\n/* A 24px chip takes the shadcn Select item's radius, square in lyra and sera.\n The keyboard ring is an offset outline, so it never sits on the color. */\nconst SWATCH_ITEM_SQUARE = \"rounded-md\";\n\nconst SWATCH_ITEM_CLASS =\n \"forced-color-adjust-none relative flex size-(--color-picker-swatch-size) shrink-0 cursor-default items-center justify-center outline-offset-2 transition-[scale] duration-150 after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:inset-ring after:inset-ring-foreground/10 not-aria-disabled:hover:scale-110 aria-disabled:opacity-40 motion-reduce:transition-none group-focus-visible/color-picker-swatches:data-active:outline-2 group-focus-visible/color-picker-swatches:data-active:outline-ring [&_svg]:size-3.5\";\n\nexport type ColorPickerSwatchItemProps = Omit<ComponentProps<\"div\">, \"children\"> & {\n /** Any color `parseColor` reads. */\n value: string;\n /** Read out instead of the generated color name. */\n label?: string;\n disabled?: boolean;\n};\n\n/** One preset. Selected while the picker's value is this color. */\nexport function ColorPickerSwatchItem({\n value,\n label,\n disabled = false,\n className,\n style,\n onClick,\n ...props\n}: ColorPickerSwatchItemProps) {\n const context = useColorPickerContext(\"ColorPickerSwatchItem\");\n const swatches = useContext(SwatchesContext);\n const id = useId();\n const parsed = parseColor(value);\n const color = parsed && !context.alpha ? { ...parsed, alpha: 1 } : parsed;\n const selected =\n !!color && !!context.color && formatColor(color, \"hex\") === formatColor(context.color, \"hex\");\n /* The check reads like text on the swatch: one rule for both. */\n const check = (color && getForegroundColor(color, { light: \"#fff\", dark: \"#000\" })) ?? \"#000\";\n const inactive = disabled || !color;\n\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: <>\n <div\n id={id}\n role=\"option\"\n aria-selected={selected}\n aria-disabled={inactive || undefined}\n aria-label={label ?? (color ? context.i18n.functions.getColorName(color) : value)}\n data-slot=\"color-picker-swatch-item\"\n data-active={swatches.activeId === id ? \"\" : undefined}\n data-selected={selected ? \"\" : undefined}\n className={cn(\n SWATCH_ITEM_CLASS,\n swatches.shape === \"circle\" ? \"rounded-full\" : SWATCH_ITEM_SQUARE,\n className,\n )}\n style={{ background: swatchBackground(color), color: check, ...style }}\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented || inactive || !context.editable) return;\n swatches.setActiveId(id);\n context.change(color);\n }}\n {...props}\n >\n {selected && <CheckIcon aria-hidden=\"true\" />}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAmHA,MAAM,iBAGF;CACF,KAAK;EAAC;EAAO;EAAS;CAAM;CAC5B,KAAK;EAAC;EAAO;EAAc;CAAW;CACtC,KAAK;EAAC;EAAO;EAAc;CAAY;CACvC,OAAO;EAAC;EAAa;EAAU;CAAK;AACtC;AAEA,MAAa,uBAA4C;CAAC;CAAO;CAAO;CAAO;CAAO;AAAO;AAE7F,MAAM,gBAAmD;CACvD,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,OAAO;AACT;AAMA,MAAM,SAAS,OAAe,KAAa,QAAgB,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAE7F,MAAM,WAAW,SAAkB,MAAM,MAAO,OAAO;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