@fusion.dev/helix-headless 0.0.0-dev

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 (424) hide show
  1. package/LICENSE +21 -0
  2. package/custom-elements.json +75202 -0
  3. package/dist/accordion/index.d.ts +2 -0
  4. package/dist/accordion/index.js +2 -0
  5. package/dist/accordion/item/accordion-item.d.ts +141 -0
  6. package/dist/accordion/item/accordion-item.js +214 -0
  7. package/dist/accordion/root/accordion-root.d.ts +57 -0
  8. package/dist/accordion/root/accordion-root.js +96 -0
  9. package/dist/announcement/index.d.ts +1 -0
  10. package/dist/announcement/index.js +1 -0
  11. package/dist/announcement/root/announcement-root.d.ts +106 -0
  12. package/dist/announcement/root/announcement-root.js +144 -0
  13. package/dist/app-header/index.d.ts +1 -0
  14. package/dist/app-header/index.js +1 -0
  15. package/dist/app-header/root/app-header-root.d.ts +113 -0
  16. package/dist/app-header/root/app-header-root.js +147 -0
  17. package/dist/avatar/group/avatar-group.d.ts +116 -0
  18. package/dist/avatar/group/avatar-group.js +136 -0
  19. package/dist/avatar/index.d.ts +2 -0
  20. package/dist/avatar/index.js +2 -0
  21. package/dist/avatar/root/avatar-root.d.ts +71 -0
  22. package/dist/avatar/root/avatar-root.js +147 -0
  23. package/dist/badge/index.d.ts +1 -0
  24. package/dist/badge/index.js +1 -0
  25. package/dist/badge/root/badge-root.d.ts +61 -0
  26. package/dist/badge/root/badge-root.js +121 -0
  27. package/dist/bar-chart/index.d.ts +1 -0
  28. package/dist/bar-chart/index.js +1 -0
  29. package/dist/bar-chart/root/bar-chart-root.d.ts +266 -0
  30. package/dist/bar-chart/root/bar-chart-root.js +515 -0
  31. package/dist/blockquote/index.d.ts +1 -0
  32. package/dist/blockquote/index.js +1 -0
  33. package/dist/blockquote/root/blockquote-root.d.ts +51 -0
  34. package/dist/blockquote/root/blockquote-root.js +84 -0
  35. package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +104 -0
  36. package/dist/breadcrumbs/breadcrumb/breadcrumb.js +137 -0
  37. package/dist/breadcrumbs/index.d.ts +2 -0
  38. package/dist/breadcrumbs/index.js +2 -0
  39. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +77 -0
  40. package/dist/breadcrumbs/root/breadcrumbs-root.js +94 -0
  41. package/dist/button/index.d.ts +1 -0
  42. package/dist/button/index.js +1 -0
  43. package/dist/button/root/button-root.d.ts +251 -0
  44. package/dist/button/root/button-root.js +401 -0
  45. package/dist/button-group/index.d.ts +1 -0
  46. package/dist/button-group/index.js +1 -0
  47. package/dist/button-group/root/button-group-root.d.ts +62 -0
  48. package/dist/button-group/root/button-group-root.js +62 -0
  49. package/dist/callout/index.d.ts +1 -0
  50. package/dist/callout/index.js +1 -0
  51. package/dist/callout/root/callout-root.d.ts +72 -0
  52. package/dist/callout/root/callout-root.js +90 -0
  53. package/dist/card/index.d.ts +1 -0
  54. package/dist/card/index.js +1 -0
  55. package/dist/card/root/card-root.d.ts +54 -0
  56. package/dist/card/root/card-root.js +71 -0
  57. package/dist/carousel/index.d.ts +1 -0
  58. package/dist/carousel/index.js +1 -0
  59. package/dist/carousel/root/carousel-root.d.ts +399 -0
  60. package/dist/carousel/root/carousel-root.js +723 -0
  61. package/dist/chat/composer/chat-composer.d.ts +160 -0
  62. package/dist/chat/composer/chat-composer.js +273 -0
  63. package/dist/chat/index.d.ts +3 -0
  64. package/dist/chat/index.js +3 -0
  65. package/dist/chat/message/chat-message.d.ts +170 -0
  66. package/dist/chat/message/chat-message.js +271 -0
  67. package/dist/chat/root/chat-root.d.ts +216 -0
  68. package/dist/chat/root/chat-root.js +389 -0
  69. package/dist/checkbox/index.d.ts +1 -0
  70. package/dist/checkbox/index.js +1 -0
  71. package/dist/checkbox/root/checkbox-root.d.ts +108 -0
  72. package/dist/checkbox/root/checkbox-root.js +207 -0
  73. package/dist/checkbox-group/index.d.ts +1 -0
  74. package/dist/checkbox-group/index.js +1 -0
  75. package/dist/checkbox-group/root/checkbox-group-root.d.ts +155 -0
  76. package/dist/checkbox-group/root/checkbox-group-root.js +293 -0
  77. package/dist/code/index.d.ts +1 -0
  78. package/dist/code/index.js +1 -0
  79. package/dist/code/root/code-root.d.ts +36 -0
  80. package/dist/code/root/code-root.js +43 -0
  81. package/dist/code-block/index.d.ts +1 -0
  82. package/dist/code-block/index.js +1 -0
  83. package/dist/code-block/root/code-block-root.d.ts +112 -0
  84. package/dist/code-block/root/code-block-root.js +155 -0
  85. package/dist/color-input/index.d.ts +1 -0
  86. package/dist/color-input/index.js +1 -0
  87. package/dist/color-input/root/color-input-root.d.ts +227 -0
  88. package/dist/color-input/root/color-input-root.js +456 -0
  89. package/dist/color-picker/color.d.ts +74 -0
  90. package/dist/color-picker/color.js +238 -0
  91. package/dist/color-picker/index.d.ts +2 -0
  92. package/dist/color-picker/index.js +2 -0
  93. package/dist/color-picker/root/color-picker-root.d.ts +303 -0
  94. package/dist/color-picker/root/color-picker-root.js +576 -0
  95. package/dist/combobox/index.d.ts +1 -0
  96. package/dist/combobox/index.js +1 -0
  97. package/dist/combobox/root/combobox-root.d.ts +396 -0
  98. package/dist/combobox/root/combobox-root.js +808 -0
  99. package/dist/command/index.d.ts +1 -0
  100. package/dist/command/index.js +1 -0
  101. package/dist/command/root/command-root.d.ts +166 -0
  102. package/dist/command/root/command-root.js +353 -0
  103. package/dist/copy-button/index.d.ts +1 -0
  104. package/dist/copy-button/index.js +1 -0
  105. package/dist/copy-button/root/copy-button-root.d.ts +154 -0
  106. package/dist/copy-button/root/copy-button-root.js +225 -0
  107. package/dist/data-table/index.d.ts +2 -0
  108. package/dist/data-table/index.js +2 -0
  109. package/dist/data-table/root/data-table-root.d.ts +392 -0
  110. package/dist/data-table/root/data-table-root.js +729 -0
  111. package/dist/data-table/root/order.d.ts +116 -0
  112. package/dist/data-table/root/order.js +175 -0
  113. package/dist/date-input/index.d.ts +1 -0
  114. package/dist/date-input/index.js +1 -0
  115. package/dist/date-input/root/date-input-root.d.ts +361 -0
  116. package/dist/date-input/root/date-input-root.js +791 -0
  117. package/dist/date-picker/index.d.ts +1 -0
  118. package/dist/date-picker/index.js +1 -0
  119. package/dist/date-picker/root/date-picker-root.d.ts +361 -0
  120. package/dist/date-picker/root/date-picker-root.js +837 -0
  121. package/dist/dialog/index.d.ts +1 -0
  122. package/dist/dialog/index.js +1 -0
  123. package/dist/dialog/root/dialog-root.d.ts +185 -0
  124. package/dist/dialog/root/dialog-root.js +319 -0
  125. package/dist/divider/index.d.ts +1 -0
  126. package/dist/divider/index.js +1 -0
  127. package/dist/divider/root/divider-root.d.ts +68 -0
  128. package/dist/divider/root/divider-root.js +116 -0
  129. package/dist/donut-chart/index.d.ts +1 -0
  130. package/dist/donut-chart/index.js +1 -0
  131. package/dist/donut-chart/root/donut-chart-root.d.ts +209 -0
  132. package/dist/donut-chart/root/donut-chart-root.js +395 -0
  133. package/dist/drawer/index.d.ts +1 -0
  134. package/dist/drawer/index.js +1 -0
  135. package/dist/drawer/root/drawer-root.d.ts +144 -0
  136. package/dist/drawer/root/drawer-root.js +222 -0
  137. package/dist/drilldown/index.d.ts +2 -0
  138. package/dist/drilldown/index.js +2 -0
  139. package/dist/drilldown/item/drilldown-item.d.ts +87 -0
  140. package/dist/drilldown/item/drilldown-item.js +152 -0
  141. package/dist/drilldown/root/drilldown-root.d.ts +115 -0
  142. package/dist/drilldown/root/drilldown-root.js +263 -0
  143. package/dist/element-events.generated.d.ts +1 -0
  144. package/dist/element-events.generated.js +125 -0
  145. package/dist/empty/index.d.ts +1 -0
  146. package/dist/empty/index.js +1 -0
  147. package/dist/empty/root/empty-root.d.ts +47 -0
  148. package/dist/empty/root/empty-root.js +68 -0
  149. package/dist/file-input/index.d.ts +1 -0
  150. package/dist/file-input/index.js +1 -0
  151. package/dist/file-input/root/file-input-root.d.ts +196 -0
  152. package/dist/file-input/root/file-input-root.js +488 -0
  153. package/dist/format-date/index.d.ts +1 -0
  154. package/dist/format-date/index.js +1 -0
  155. package/dist/format-date/root/format-date-root.d.ts +151 -0
  156. package/dist/format-date/root/format-date-root.js +266 -0
  157. package/dist/heatmap/index.d.ts +2 -0
  158. package/dist/heatmap/index.js +2 -0
  159. package/dist/heatmap/root/buckets.d.ts +62 -0
  160. package/dist/heatmap/root/buckets.js +85 -0
  161. package/dist/heatmap/root/heatmap-root.d.ts +330 -0
  162. package/dist/heatmap/root/heatmap-root.js +526 -0
  163. package/dist/icon/index.d.ts +1 -0
  164. package/dist/icon/index.js +1 -0
  165. package/dist/icon/root/icon-root.d.ts +53 -0
  166. package/dist/icon/root/icon-root.js +93 -0
  167. package/dist/icon-button/index.d.ts +1 -0
  168. package/dist/icon-button/index.js +1 -0
  169. package/dist/icon-button/root/icon-button-root.d.ts +40 -0
  170. package/dist/icon-button/root/icon-button-root.js +46 -0
  171. package/dist/image/index.d.ts +1 -0
  172. package/dist/image/index.js +1 -0
  173. package/dist/image/root/image-root.d.ts +213 -0
  174. package/dist/image/root/image-root.js +335 -0
  175. package/dist/index.d.ts +99 -0
  176. package/dist/index.js +99 -0
  177. package/dist/input/index.d.ts +1 -0
  178. package/dist/input/index.js +1 -0
  179. package/dist/input/root/input-root.d.ts +281 -0
  180. package/dist/input/root/input-root.js +472 -0
  181. package/dist/kbd/index.d.ts +1 -0
  182. package/dist/kbd/index.js +1 -0
  183. package/dist/kbd/root/kbd-root.d.ts +98 -0
  184. package/dist/kbd/root/kbd-root.js +230 -0
  185. package/dist/legend/index.d.ts +1 -0
  186. package/dist/legend/index.js +1 -0
  187. package/dist/legend/root/legend-root.d.ts +83 -0
  188. package/dist/legend/root/legend-root.js +125 -0
  189. package/dist/line-chart/index.d.ts +1 -0
  190. package/dist/line-chart/index.js +1 -0
  191. package/dist/line-chart/root/line-chart-root.d.ts +238 -0
  192. package/dist/line-chart/root/line-chart-root.js +365 -0
  193. package/dist/list/index.d.ts +2 -0
  194. package/dist/list/index.js +2 -0
  195. package/dist/list/item/list-item.d.ts +95 -0
  196. package/dist/list/item/list-item.js +148 -0
  197. package/dist/list/root/list-root.d.ts +72 -0
  198. package/dist/list/root/list-root.js +61 -0
  199. package/dist/listbox/index.d.ts +1 -0
  200. package/dist/listbox/index.js +1 -0
  201. package/dist/listbox/root/listbox-root.d.ts +357 -0
  202. package/dist/listbox/root/listbox-root.js +890 -0
  203. package/dist/loader/index.d.ts +1 -0
  204. package/dist/loader/index.js +1 -0
  205. package/dist/loader/root/loader-root.d.ts +52 -0
  206. package/dist/loader/root/loader-root.js +74 -0
  207. package/dist/megamenu/index.d.ts +1 -0
  208. package/dist/megamenu/index.js +1 -0
  209. package/dist/megamenu/root/megamenu-root.d.ts +254 -0
  210. package/dist/megamenu/root/megamenu-root.js +526 -0
  211. package/dist/menu/index.d.ts +2 -0
  212. package/dist/menu/index.js +2 -0
  213. package/dist/menu/item/menu-item.d.ts +231 -0
  214. package/dist/menu/item/menu-item.js +405 -0
  215. package/dist/menu/root/menu-root.d.ts +158 -0
  216. package/dist/menu/root/menu-root.js +422 -0
  217. package/dist/meter/index.d.ts +1 -0
  218. package/dist/meter/index.js +1 -0
  219. package/dist/meter/root/meter-root.d.ts +234 -0
  220. package/dist/meter/root/meter-root.js +316 -0
  221. package/dist/navigation/index.d.ts +1 -0
  222. package/dist/navigation/index.js +1 -0
  223. package/dist/navigation/root/navigation-root.d.ts +55 -0
  224. package/dist/navigation/root/navigation-root.js +130 -0
  225. package/dist/notifications/index.d.ts +2 -0
  226. package/dist/notifications/index.js +2 -0
  227. package/dist/notifications/notification/notification.d.ts +181 -0
  228. package/dist/notifications/notification/notification.js +305 -0
  229. package/dist/notifications/root/notifications-root.d.ts +168 -0
  230. package/dist/notifications/root/notifications-root.js +291 -0
  231. package/dist/number-input/index.d.ts +1 -0
  232. package/dist/number-input/index.js +1 -0
  233. package/dist/number-input/root/number-input-root.d.ts +282 -0
  234. package/dist/number-input/root/number-input-root.js +592 -0
  235. package/dist/option/group/option-group.d.ts +38 -0
  236. package/dist/option/group/option-group.js +58 -0
  237. package/dist/option/index.d.ts +2 -0
  238. package/dist/option/index.js +2 -0
  239. package/dist/option/root/option-root.d.ts +194 -0
  240. package/dist/option/root/option-root.js +247 -0
  241. package/dist/outline/index.d.ts +1 -0
  242. package/dist/outline/index.js +1 -0
  243. package/dist/outline/root/outline-root.d.ts +237 -0
  244. package/dist/outline/root/outline-root.js +519 -0
  245. package/dist/pagination/index.d.ts +3 -0
  246. package/dist/pagination/index.js +3 -0
  247. package/dist/pagination/root/pagination-root.d.ts +390 -0
  248. package/dist/pagination/root/pagination-root.js +695 -0
  249. package/dist/pagination/size/pagination-size.d.ts +127 -0
  250. package/dist/pagination/size/pagination-size.js +232 -0
  251. package/dist/pagination/summary/pagination-summary.d.ts +90 -0
  252. package/dist/pagination/summary/pagination-summary.js +145 -0
  253. package/dist/pin-input/index.d.ts +1 -0
  254. package/dist/pin-input/index.js +1 -0
  255. package/dist/pin-input/root/pin-input-root.d.ts +292 -0
  256. package/dist/pin-input/root/pin-input-root.js +553 -0
  257. package/dist/popover/index.d.ts +1 -0
  258. package/dist/popover/index.js +1 -0
  259. package/dist/popover/root/popover-root.d.ts +108 -0
  260. package/dist/popover/root/popover-root.js +231 -0
  261. package/dist/progress/index.d.ts +1 -0
  262. package/dist/progress/index.js +1 -0
  263. package/dist/progress/root/progress-root.d.ts +125 -0
  264. package/dist/progress/root/progress-root.js +212 -0
  265. package/dist/qr-code/index.d.ts +1 -0
  266. package/dist/qr-code/index.js +1 -0
  267. package/dist/qr-code/root/qr-code-root.d.ts +93 -0
  268. package/dist/qr-code/root/qr-code-root.js +233 -0
  269. package/dist/quote/index.d.ts +1 -0
  270. package/dist/quote/index.js +1 -0
  271. package/dist/quote/root/quote-root.d.ts +36 -0
  272. package/dist/quote/root/quote-root.js +50 -0
  273. package/dist/radio/group/radio-group.d.ts +84 -0
  274. package/dist/radio/group/radio-group.js +170 -0
  275. package/dist/radio/index.d.ts +2 -0
  276. package/dist/radio/index.js +2 -0
  277. package/dist/radio/root/radio-root.d.ts +102 -0
  278. package/dist/radio/root/radio-root.js +151 -0
  279. package/dist/rating/index.d.ts +1 -0
  280. package/dist/rating/index.js +1 -0
  281. package/dist/rating/root/rating-root.d.ts +242 -0
  282. package/dist/rating/root/rating-root.js +484 -0
  283. package/dist/scroll-area/index.d.ts +1 -0
  284. package/dist/scroll-area/index.js +1 -0
  285. package/dist/scroll-area/root/scroll-area-root.d.ts +96 -0
  286. package/dist/scroll-area/root/scroll-area-root.js +215 -0
  287. package/dist/select/index.d.ts +1 -0
  288. package/dist/select/index.js +1 -0
  289. package/dist/select/root/select-root.d.ts +170 -0
  290. package/dist/select/root/select-root.js +419 -0
  291. package/dist/skeleton/index.d.ts +1 -0
  292. package/dist/skeleton/index.js +1 -0
  293. package/dist/skeleton/root/skeleton-root.d.ts +31 -0
  294. package/dist/skeleton/root/skeleton-root.js +42 -0
  295. package/dist/slider/index.d.ts +1 -0
  296. package/dist/slider/index.js +1 -0
  297. package/dist/slider/root/slider-root.d.ts +235 -0
  298. package/dist/slider/root/slider-root.js +488 -0
  299. package/dist/sparkline/index.d.ts +1 -0
  300. package/dist/sparkline/index.js +1 -0
  301. package/dist/sparkline/root/sparkline-root.d.ts +147 -0
  302. package/dist/sparkline/root/sparkline-root.js +278 -0
  303. package/dist/speed-dial/index.d.ts +2 -0
  304. package/dist/speed-dial/index.js +2 -0
  305. package/dist/speed-dial/item/speed-dial-item.d.ts +71 -0
  306. package/dist/speed-dial/item/speed-dial-item.js +113 -0
  307. package/dist/speed-dial/root/speed-dial-root.d.ts +122 -0
  308. package/dist/speed-dial/root/speed-dial-root.js +251 -0
  309. package/dist/splitter/index.d.ts +1 -0
  310. package/dist/splitter/index.js +1 -0
  311. package/dist/splitter/root/splitter-root.d.ts +491 -0
  312. package/dist/splitter/root/splitter-root.js +1030 -0
  313. package/dist/stat/group/stat-group.d.ts +30 -0
  314. package/dist/stat/group/stat-group.js +47 -0
  315. package/dist/stat/index.d.ts +2 -0
  316. package/dist/stat/index.js +2 -0
  317. package/dist/stat/root/stat-root.d.ts +62 -0
  318. package/dist/stat/root/stat-root.js +51 -0
  319. package/dist/steps/index.d.ts +2 -0
  320. package/dist/steps/index.js +2 -0
  321. package/dist/steps/root/steps-root.d.ts +110 -0
  322. package/dist/steps/root/steps-root.js +130 -0
  323. package/dist/steps/step/step.d.ts +139 -0
  324. package/dist/steps/step/step.js +215 -0
  325. package/dist/switch/index.d.ts +1 -0
  326. package/dist/switch/index.js +1 -0
  327. package/dist/switch/root/switch-root.d.ts +74 -0
  328. package/dist/switch/root/switch-root.js +153 -0
  329. package/dist/table/cell/table-cell.d.ts +34 -0
  330. package/dist/table/cell/table-cell.js +52 -0
  331. package/dist/table/column/table-column.d.ts +165 -0
  332. package/dist/table/column/table-column.js +222 -0
  333. package/dist/table/index.d.ts +4 -0
  334. package/dist/table/index.js +4 -0
  335. package/dist/table/root/table-root.d.ts +98 -0
  336. package/dist/table/root/table-root.js +161 -0
  337. package/dist/table/row/table-row.d.ts +27 -0
  338. package/dist/table/row/table-row.js +42 -0
  339. package/dist/tabs/index.d.ts +3 -0
  340. package/dist/tabs/index.js +3 -0
  341. package/dist/tabs/panel/tab-panel.d.ts +67 -0
  342. package/dist/tabs/panel/tab-panel.js +98 -0
  343. package/dist/tabs/root/tabs-root.d.ts +123 -0
  344. package/dist/tabs/root/tabs-root.js +217 -0
  345. package/dist/tabs/tab/tab.d.ts +64 -0
  346. package/dist/tabs/tab/tab.js +116 -0
  347. package/dist/tag/index.d.ts +1 -0
  348. package/dist/tag/index.js +1 -0
  349. package/dist/tag/root/tag-root.d.ts +41 -0
  350. package/dist/tag/root/tag-root.js +67 -0
  351. package/dist/textarea/index.d.ts +1 -0
  352. package/dist/textarea/index.js +1 -0
  353. package/dist/textarea/root/textarea-root.d.ts +215 -0
  354. package/dist/textarea/root/textarea-root.js +380 -0
  355. package/dist/time-input/index.d.ts +1 -0
  356. package/dist/time-input/index.js +1 -0
  357. package/dist/time-input/root/time-input-root.d.ts +322 -0
  358. package/dist/time-input/root/time-input-root.js +661 -0
  359. package/dist/time-picker/index.d.ts +1 -0
  360. package/dist/time-picker/index.js +1 -0
  361. package/dist/time-picker/root/time-picker-root.d.ts +380 -0
  362. package/dist/time-picker/root/time-picker-root.js +669 -0
  363. package/dist/timeline/index.d.ts +2 -0
  364. package/dist/timeline/index.js +2 -0
  365. package/dist/timeline/item/timeline-item.d.ts +81 -0
  366. package/dist/timeline/item/timeline-item.js +128 -0
  367. package/dist/timeline/root/timeline-root.d.ts +52 -0
  368. package/dist/timeline/root/timeline-root.js +72 -0
  369. package/dist/toast/index.d.ts +2 -0
  370. package/dist/toast/index.js +2 -0
  371. package/dist/toast/item/toast-item.d.ts +183 -0
  372. package/dist/toast/item/toast-item.js +345 -0
  373. package/dist/toast/root/toast-root.d.ts +72 -0
  374. package/dist/toast/root/toast-root.js +87 -0
  375. package/dist/toggle/group/toggle-group.d.ts +140 -0
  376. package/dist/toggle/group/toggle-group.js +278 -0
  377. package/dist/toggle/index.d.ts +2 -0
  378. package/dist/toggle/index.js +2 -0
  379. package/dist/toggle/root/toggle-root.d.ts +99 -0
  380. package/dist/toggle/root/toggle-root.js +146 -0
  381. package/dist/toolbar/index.d.ts +1 -0
  382. package/dist/toolbar/index.js +1 -0
  383. package/dist/toolbar/root/toolbar-root.d.ts +105 -0
  384. package/dist/toolbar/root/toolbar-root.js +260 -0
  385. package/dist/tooltip/index.d.ts +1 -0
  386. package/dist/tooltip/index.js +1 -0
  387. package/dist/tooltip/root/tooltip-root.d.ts +388 -0
  388. package/dist/tooltip/root/tooltip-root.js +707 -0
  389. package/dist/tour/index.d.ts +2 -0
  390. package/dist/tour/index.js +2 -0
  391. package/dist/tour/root/tour-root.d.ts +161 -0
  392. package/dist/tour/root/tour-root.js +351 -0
  393. package/dist/tour/stop/tour-stop.d.ts +131 -0
  394. package/dist/tour/stop/tour-stop.js +249 -0
  395. package/dist/tree/index.d.ts +2 -0
  396. package/dist/tree/index.js +2 -0
  397. package/dist/tree/item/tree-item.d.ts +208 -0
  398. package/dist/tree/item/tree-item.js +381 -0
  399. package/dist/tree/root/tree-root.d.ts +88 -0
  400. package/dist/tree/root/tree-root.js +287 -0
  401. package/dist/trend/index.d.ts +1 -0
  402. package/dist/trend/index.js +1 -0
  403. package/dist/trend/root/trend-root.d.ts +67 -0
  404. package/dist/trend/root/trend-root.js +106 -0
  405. package/dist/video/index.d.ts +1 -0
  406. package/dist/video/index.js +1 -0
  407. package/dist/video/root/video-root.d.ts +711 -0
  408. package/dist/video/root/video-root.js +1821 -0
  409. package/dist/video-playlist/index.d.ts +3 -0
  410. package/dist/video-playlist/index.js +3 -0
  411. package/dist/video-playlist/item/video-playlist-item.d.ts +101 -0
  412. package/dist/video-playlist/item/video-playlist-item.js +162 -0
  413. package/dist/video-playlist/menu/video-playlist-menu.d.ts +121 -0
  414. package/dist/video-playlist/menu/video-playlist-menu.js +237 -0
  415. package/dist/video-playlist/root/video-playlist-root.d.ts +108 -0
  416. package/dist/video-playlist/root/video-playlist-root.js +218 -0
  417. package/dist/virtual-list/index.d.ts +1 -0
  418. package/dist/virtual-list/index.js +1 -0
  419. package/dist/virtual-list/root/virtual-list-root.d.ts +121 -0
  420. package/dist/virtual-list/root/virtual-list-root.js +221 -0
  421. package/jsx.d.ts +49767 -0
  422. package/package.json +77 -0
  423. package/svelte.d.ts +129 -0
  424. package/vue.d.ts +9242 -0
@@ -0,0 +1,456 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { AriaForwardController, customElement, HelixFormElement, MixinControllerOpen, MixinControllerValue, MixinField, PopoverController, } from '@fusion.dev/helix-core';
8
+ import { nothing } from 'lit';
9
+ import { property } from 'lit/decorators.js';
10
+ import { html } from 'lit/static-html.js';
11
+ /* Side-effect import, because this renders a picker in its own shadow root and
12
+ a custom element registers on import. The path is relative, so this registers
13
+ the base picker and the styled file's identical import registers the styled
14
+ one; `tier` picks which name the template asks for. */
15
+ import '../../color-picker/index.js';
16
+ import { parseColor, toCss } from '../../color-picker/color.js';
17
+ /**
18
+ * @summary A color, typed in any syntax or picked from a panel.
19
+ *
20
+ * @description
21
+ * **The picker is `helix-color-picker`, not a second one written here.** It owns the
22
+ * square, the ramps, the eyedropper and the syntax toggle, and it is worth
23
+ * having on its own: a settings pane wants a picker flat on the page with
24
+ * nothing to open. This element is the field, the overlay, and the form.
25
+ * Exactly the arrangement Date Input has with `helix-date-picker`.
26
+ *
27
+ * **Typed as well as picked, and the typing is the reason this is not
28
+ * `<input type="color">`.** The native control gives a free picker and takes
29
+ * nearly all styling with it, which is a fair trade until a product needs the
30
+ * panel to match everything around it. What is kept from the native one is the
31
+ * part worth keeping: a real text field, so a reader who has the hex pastes it
32
+ * and never opens anything.
33
+ *
34
+ * **Every syntax is read; the one `format` names is written.** `#f00`,
35
+ * `#ff0000`, `rgb(255 0 0)`, `rgba(255,0,0,.5)`, `rgb(255 0 0 / 50%)` and
36
+ * `hsl(0 100% 50%)` are all colors, and a field that refuses one because it
37
+ * prefers another is arguing with the person using it. What the field *shows* is
38
+ * the value itself, for the reason Date Input gives about its dates: half-typed
39
+ * input does not survive a round trip through a formatter.
40
+ *
41
+ * The properties below are written by this component and read by whoever draws
42
+ * it. A consumer sets none of them: they carry a number this element computed
43
+ * and CSS cannot, which is what lets a stylesheet on this tier draw the thing
44
+ * without measuring anything itself.
45
+ *
46
+ * @since 0.1.0
47
+ * @status experimental
48
+ * @category forms
49
+ * @aliases ColorField, ColourInput, InputColor
50
+ * @documentation https://helix.fusion.dev/components/color-input
51
+ *
52
+ * @slot end - Content at the trailing end, before the trigger.
53
+ * @slot feedback - What is wrong with it.
54
+ * @slot hint - Help under the field.
55
+ * @slot start - Content at the leading end of the field, inside its border.
56
+ * @slot trigger - The mark on the field saying a panel opens.
57
+ *
58
+ * @event {Event} change - Announced once the value has moved.
59
+ * @event {HelixBeforeChangeEvent} helix-before-change - Fired before the color changes. Cancelable: refusing it takes the decision and nothing moves.
60
+ * @event {HelixBeforeCloseEvent} helix-before-close - Fired before it closes. Cancelable: refusing it takes the decision and nothing moves.
61
+ * @event {HelixBeforeOpenEvent} helix-before-open - Fired before the panel opens. Cancelable: refusing it takes the decision and nothing moves.
62
+ * @event {Event} input - Announced once the value has moved.
63
+ * @event {Event} toggle - Says the state moved, carrying `newState` and `oldState`.
64
+ *
65
+ * @csspart control - The text input carrying the value. Absent in `swatch`.
66
+ * @csspart feedback - What is wrong with it.
67
+ * @csspart field - The box holding the text and the trigger.
68
+ * @csspart hint - Help under the field, while nothing is wrong.
69
+ * @csspart label - The question, over the field.
70
+ * @csspart picker - The color picker inside it.
71
+ * @csspart picker-actions - The group holding the eyedropper and the syntax toggle.
72
+ * @csspart picker-channel - One ramp.
73
+ * @csspart picker-channel-control - The range input.
74
+ * @csspart picker-channel-feedback - What is wrong with it.
75
+ * @csspart picker-channel-field - The row: the control and its readout.
76
+ * @csspart picker-channel-hint - Help under the track, while nothing is wrong.
77
+ * @csspart picker-channel-label - The question, over the track.
78
+ * @csspart picker-channel-marker - One mark.
79
+ * @csspart picker-channel-marker-label - The value a mark stands at, when `marker-labels` is set.
80
+ * @csspart picker-channel-markers - The row of marks along the track.
81
+ * @csspart picker-channel-output - The current value, shown beside it.
82
+ * @csspart picker-channels - The ramps beside it.
83
+ * @csspart picker-controls - The row under the square.
84
+ * @csspart picker-eyedropper - The control that samples a color from the screen.
85
+ * @csspart picker-eyedropper-button - The inner control.
86
+ * @csspart picker-footer - The row holding the value and the tools.
87
+ * @csspart picker-format - The control that changes the syntax the value is written in.
88
+ * @csspart picker-format-button - The inner control.
89
+ * @csspart picker-grid - The saturation and brightness square.
90
+ * @csspart picker-grid-brightness - The range input for its vertical axis.
91
+ * @csspart picker-grid-handle - The mark showing where in the square the color sits.
92
+ * @csspart picker-grid-saturation - The range input for the square's horizontal axis.
93
+ * @csspart picker-icon - A glyph this component draws.
94
+ * @csspart picker-sample - The chip of the current color, which copies it when pressed.
95
+ * @csspart picker-swatch - One preset.
96
+ * @csspart picker-swatches - The row of presets.
97
+ * @csspart picker-value - The color as text, which can be typed or pasted.
98
+ * @csspart preview - The chip showing the color, inside the trigger.
99
+ * @csspart surface - The floating panel.
100
+ * @csspart trigger - The control that opens the panel.
101
+ *
102
+ * @cssproperty --color-input-swatch - The chosen color, to paint over the transparency check.
103
+ */
104
+ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinControllerOpen(MixinControllerValue(MixinField(HelixFormElement))) {
105
+ constructor() {
106
+ super(...arguments);
107
+ /* A consumer's `aria-describedby` names ids in their own tree and the control
108
+ is in this shadow root, so the reference has to be carried down as an
109
+ element rather than copied as an id. See `AriaForwardController`: measured
110
+ in Chrome's own tree, the host held the description and the control the
111
+ reader is actually on was exposed without it. */
112
+ this.aria = new AriaForwardController(this, {
113
+ target: () => this.renderRoot?.querySelector('[part="control"]') ?? null,
114
+ });
115
+ /**
116
+ * What the browser may autofill in the text field, as a platform token.
117
+ *
118
+ * **Defaults to `off`, which is not the platform's default and is the
119
+ * point.** The field filters a list rather than collecting a value, so a
120
+ * browser offering to fill it with a saved address is competing for the same
121
+ * keystrokes as the listbox. A consumer who wants autofill can still ask.
122
+ */
123
+ this.autocomplete = 'off';
124
+ /**
125
+ * Whether the color carries an alpha channel.
126
+ */
127
+ this.alpha = false;
128
+ /**
129
+ * Whether the reader may change the format from the panel.
130
+ */
131
+ this.noFormat = false;
132
+ /**
133
+ * What the field says before a color is in it.
134
+ */
135
+ this.placeholder = '#000000';
136
+ /**
137
+ * Colors offered under the picker, as a comma-separated list.
138
+ */
139
+ this.swatches = '';
140
+ /**
141
+ * Accessible name for the control that opens the panel.
142
+ */
143
+ this.triggerLabel = 'Choose a color';
144
+ /** The overlay, placed against the field for the reason Date Input gives. */
145
+ this.panel = new PopoverController(this, {
146
+ anchor: () => this.renderRoot?.querySelector('[part="field"]'),
147
+ /* The surface *and* the trigger.
148
+ *
149
+ * A control is not always one element: the button that opens this panel is
150
+ * part of it, and a press on it is not a press outside. Scoped to the
151
+ * surface alone, `pointerdown` on the trigger closed the panel and the
152
+ * trigger's own `toggleOpen` reopened it on the `click` that followed, so
153
+ * the panel could never be closed by the button that opened it. Measured
154
+ * across all five popover-bearing components: Menu, Popover and Tooltip
155
+ * already named their invoker; this one and its three siblings did not, and
156
+ * all four stayed open on a second press where Menu closed.
157
+ *
158
+ * `DismissController` documents this exact failure and takes a list for it.
159
+ * The list was the fix; using it was the part that did not happen here. */
160
+ boundary: () => [
161
+ this.renderRoot?.querySelector('[part="surface"]'),
162
+ this.renderRoot?.querySelector('[part="trigger"]'),
163
+ ],
164
+ offset: () => 8,
165
+ onDismiss: () => this.requestOpen(false),
166
+ placement: 'bottom-start',
167
+ surface: () => this.renderRoot?.querySelector('[part="surface"]'),
168
+ });
169
+ /**
170
+ * The last value that was a color.
171
+ *
172
+ * Half-typed input reaches here on every keystroke and most of it is not a
173
+ * color, so the picker is given the last thing that was one rather than a
174
+ * fallback. Typing `#00ff00` one character at a time goes `#`, `#0`, `#00`,
175
+ * `#00f`, `#00ff`, `#00ff0`, `#00ff00`: measured, the square went red, red,
176
+ * red, blue, blue, **red**, green, because two of those are colors and the
177
+ * ones between are not. Holding the last good one takes the flicker out and
178
+ * leaves the square on blue until green arrives.
179
+ *
180
+ * Not state, because it is only ever read on a render the value already
181
+ * caused. The same reasoning Date Input records for its calendar, which will
182
+ * not follow a date until the field says something complete.
183
+ */
184
+ this.settled = '';
185
+ /** Relayed under this element's name, so a consumer hears one control. */
186
+ this.handleInput = (event) => {
187
+ event.stopPropagation();
188
+ this.requestValue(event.target.value);
189
+ this.restore();
190
+ };
191
+ this.handlePickerChange = (event) => {
192
+ event.stopPropagation();
193
+ this.requestValue(event.detail.value);
194
+ this.restore();
195
+ };
196
+ /**
197
+ * The picker is about to take the pointer over, so the panel gets out of the
198
+ * way and comes back after.
199
+ *
200
+ * `helix-color-picker` says what it is doing rather than reaching for a panel it
201
+ * cannot know it is in. A floating panel left up during an eyedropper is one
202
+ * the reader cannot dismiss and may well be trying to sample from underneath.
203
+ */
204
+ this.handleSampleStart = () => {
205
+ this.requestOpen(false);
206
+ };
207
+ this.handleSampleEnd = () => {
208
+ this.requestOpen(true);
209
+ };
210
+ /** Escape shuts the panel without moving the color. */
211
+ this.handleKeydown = (event) => {
212
+ if (event.key === 'Escape' && this.open) {
213
+ event.stopPropagation();
214
+ this.requestOpen(false);
215
+ this.control?.focus();
216
+ }
217
+ };
218
+ }
219
+ /**
220
+ * What the label points at and validity hangs off.
221
+ *
222
+ * The input where there is one, the trigger where there is not. `setValidity`
223
+ * needs an element to anchor the message to and a label needs something
224
+ * focusable to name, and in `swatch` the trigger is the only control in the
225
+ * field. It carries `id="control"` there for the same reason.
226
+ */
227
+ get anchor() {
228
+ if (typeof this.renderRoot?.querySelector !== 'function') {
229
+ return null;
230
+ }
231
+ return this.control ?? this.renderRoot.querySelector('[part="trigger"]');
232
+ }
233
+ get control() {
234
+ if (typeof this.renderRoot?.querySelector !== 'function') {
235
+ return null;
236
+ }
237
+ return this.renderRoot.querySelector('[part="control"]');
238
+ }
239
+ /** What the picker should show, which is only ever a color. */
240
+ get picked() {
241
+ return parseColor(this.value) ? this.value : this.settled;
242
+ }
243
+ /** What the trigger's swatch paints, which is only ever a color. */
244
+ get painted() {
245
+ const parsed = parseColor(this.value);
246
+ return parsed ? toCss(parsed) : 'transparent';
247
+ }
248
+ /*
249
+ * Puts the field back where the answer differs from what was typed.
250
+ *
251
+ * `requestValue` announces and decides; this is the other half, which Input
252
+ * and Date Input both need for the same reason: the native control has already
253
+ * changed, so wherever the answer does not follow it, it has to be restored.
254
+ */
255
+ restore() {
256
+ const control = this.control;
257
+ if (control && control.value !== this.value) {
258
+ control.value = this.value;
259
+ }
260
+ this.sync();
261
+ }
262
+ /** Reports the value and the validity the host stands behind. */
263
+ sync() {
264
+ this.internals.setFormValue(this.value);
265
+ const anchor = this.anchor;
266
+ if (!anchor) {
267
+ return;
268
+ }
269
+ const control = this.control;
270
+ /* Checked here rather than left to the input, which is `text` and has no
271
+ idea what a color is. `type="color"` is what was given up to own the
272
+ panel, and it would not have helped: it has no invalid state, because it
273
+ cannot hold one. */
274
+ if (this.value !== '' && parseColor(this.value) === null) {
275
+ this.internals.setValidity({ badInput: true }, 'Enter a color, like #ff0000, rgb(255 0 0) or hsl(0 100% 50%).', anchor);
276
+ }
277
+ else if (control) {
278
+ this.internals.setValidity(control.validity, control.validationMessage, control);
279
+ }
280
+ else {
281
+ /* A swatch has no native validity of its own, so `required` is the only
282
+ thing left to check and this element has to check it: an empty value on
283
+ a required field is the one state a block of color can be wrong in. */
284
+ this.internals.setValidity(this.required && this.value === '' ? { valueMissing: true } : {}, this.required && this.value === '' ? 'Choose a color.' : '', anchor);
285
+ }
286
+ this.refreshFeedback();
287
+ }
288
+ firstUpdated(changed) {
289
+ super.firstUpdated(changed);
290
+ // Whatever the markup arrived with, so a form knows before anything is typed.
291
+ this.sync();
292
+ }
293
+ updated(changed) {
294
+ super.updated(changed);
295
+ /* Every update, not only the ones that name `value`.
296
+ `value` is an accessor over `valueState ?? defaultValue`, so a consumer
297
+ moving `default-value` on an untouched control moves what the form
298
+ submits without ever putting `value` in the changed map, and the reported
299
+ entry went stale. Native `<input>` updates in exactly that case, which is
300
+ the behavior the mixin's own notes take as the reference. Fifteen of the
301
+ twenty controls here already reported unconditionally; this is one of the
302
+ five that did not. */
303
+ this.sync();
304
+ if (changed.has('value') && parseColor(this.value)) {
305
+ this.settled = this.value;
306
+ }
307
+ /* Driven from here rather than from the toggle, because `open` is a property
308
+ a consumer may set directly and the panel has to follow either way. The
309
+ controller is idempotent, so arriving twice for one open costs nothing.
310
+ Without this the surface stays `display: none`, a `popover` element being
311
+ hidden until something shows it, and the square inside measures zero,
312
+ which is the one measurement a drag cannot work without. */
313
+ if (this.open) {
314
+ this.panel.show();
315
+ }
316
+ else {
317
+ this.panel.hide();
318
+ }
319
+ }
320
+ /** Puts the caret in the field, the way a label pointing at one would. */
321
+ focus(options) {
322
+ this.anchor?.focus(options);
323
+ }
324
+ /*
325
+ * The picker is told `no-value` because the field above it is that input.
326
+ *
327
+ * Standing on a page, helix-color-picker states its own color as text: a square and
328
+ * two ramps can build one and cannot state one, and a reader who already has a
329
+ * hex should not have to find it by dragging. Here that row would be a second
330
+ * editable field for the same value, which is two places to type with no
331
+ * answer to which one is authoritative or which has the caret.
332
+ *
333
+ * The other way round was considered, this element dropping its own field and
334
+ * letting the panel's be the only one. It is worse for a form: the value could
335
+ * not be read at a glance or pasted without opening a panel.
336
+ */
337
+ /**
338
+ * The picker the field opens, behind a seam the styled tier can move.
339
+ *
340
+ * A method rather than a fragment inline, so a tier above can render its own,
341
+ * wrap this one, pass it a property the base does not know about, or leave it
342
+ * out, without reimplementing the whole template to do any of them. The tag is
343
+ * interpolated rather than written, so `tier` resolves it: this renders the
344
+ * headless element, and a styled subclass that sets `tier` renders the styled one
345
+ * from the same template.
346
+ */
347
+ renderPicker() {
348
+ return html `<${this.tag('color-picker')}
349
+ part="picker"
350
+ exportparts="actions: picker-actions, channel: picker-channel, channel-control: picker-channel-control,
351
+ channel-feedback: picker-channel-feedback, channel-field: picker-channel-field,
352
+ channel-hint: picker-channel-hint, channel-label: picker-channel-label,
353
+ channel-marker: picker-channel-marker, channel-marker-label: picker-channel-marker-label,
354
+ channel-markers: picker-channel-markers, channel-output: picker-channel-output,
355
+ channels: picker-channels, controls: picker-controls, eyedropper: picker-eyedropper,
356
+ eyedropper-button: picker-eyedropper-button, footer: picker-footer, format: picker-format,
357
+ format-button: picker-format-button, grid: picker-grid,
358
+ grid-brightness: picker-grid-brightness, grid-handle: picker-grid-handle,
359
+ grid-saturation: picker-grid-saturation, icon: picker-icon, sample: picker-sample,
360
+ swatch: picker-swatch, swatches: picker-swatches, value: picker-value"
361
+ ?invalid=${this.resolvedFeedback !== ''}
362
+ ?alpha=${this.alpha}
363
+ ?no-format=${this.noFormat}
364
+ ?no-value=${this.variant !== 'swatch'}
365
+ .format=${this.format ?? 'hex'}
366
+ .value=${this.picked}
367
+ swatches=${this.swatches || nothing}
368
+ ?disabled=${this.isDisabled}
369
+ @helix-before-change=${this.handlePickerChange}
370
+ @change=${this.stopInner}
371
+ @input=${this.stopInner}
372
+ @helix-sample-start=${this.handleSampleStart}
373
+ @helix-sample-end=${this.handleSampleEnd}
374
+ ></${this.tag('color-picker')}>`;
375
+ }
376
+ render() {
377
+ return html `${this.renderLabel()}
378
+ <div part="field" @keydown=${this.handleKeydown}>
379
+ <!-- The same pair Input carries, in the same places: leading content
380
+ before the text, trailing content after it and before the trigger.
381
+ A label wanting to sit inside the field rather than over it goes
382
+ here, which is what the toggle group's own label-placement does and
383
+ what this had no way to express. Backticks stay out of this
384
+ comment: it is inside a tagged template, so one would end the
385
+ literal and the error lands on a line further down. -->
386
+ <slot name="start"></slot>
387
+ ${this.variant === 'swatch'
388
+ ? nothing
389
+ : html `<input
390
+ part="control"
391
+ id="control"
392
+ type="text"
393
+ .value=${this.value}
394
+ name=${this.name || nothing}
395
+ placeholder=${this.placeholder || nothing}
396
+ autocomplete=${this.autocomplete || nothing}
397
+ spellcheck="false"
398
+ aria-describedby=${this.describedBy ?? nothing}
399
+ ?disabled=${this.isDisabled}
400
+ ?required=${this.required}
401
+ @input=${this.handleInput}
402
+ />`}
403
+ <slot name="end"></slot>
404
+ <button
405
+ part="trigger"
406
+ id=${this.variant === 'swatch' ? 'control' : nothing}
407
+ type="button"
408
+ aria-controls="surface"
409
+ aria-expanded=${this.open ? 'true' : 'false'}
410
+ aria-haspopup="dialog"
411
+ aria-label=${this.triggerLabel}
412
+ ?disabled=${this.isDisabled}
413
+ @click=${() => this.toggleOpen()}
414
+ >
415
+ <span
416
+ part="preview"
417
+ style="--color-input-swatch: ${this.value === '' ? 'transparent' : this.painted}"
418
+ ></span>
419
+ <slot name="trigger"></slot>
420
+ </button>
421
+ </div>
422
+
423
+ <div part="surface" id="surface" popover="manual" ?hidden=${!this.open}>
424
+ ${this.renderPicker()}
425
+ </div>
426
+ ${this.renderHint()}${this.renderFeedback()}`;
427
+ }
428
+ };
429
+ __decorate([
430
+ property()
431
+ ], HelixHeadlessColorInput.prototype, "autocomplete", void 0);
432
+ __decorate([
433
+ property({ reflect: true })
434
+ ], HelixHeadlessColorInput.prototype, "variant", void 0);
435
+ __decorate([
436
+ property({ reflect: true, type: Boolean })
437
+ ], HelixHeadlessColorInput.prototype, "alpha", void 0);
438
+ __decorate([
439
+ property({ reflect: true })
440
+ ], HelixHeadlessColorInput.prototype, "format", void 0);
441
+ __decorate([
442
+ property({ attribute: 'no-format', type: Boolean })
443
+ ], HelixHeadlessColorInput.prototype, "noFormat", void 0);
444
+ __decorate([
445
+ property()
446
+ ], HelixHeadlessColorInput.prototype, "placeholder", void 0);
447
+ __decorate([
448
+ property()
449
+ ], HelixHeadlessColorInput.prototype, "swatches", void 0);
450
+ __decorate([
451
+ property({ attribute: 'trigger-label' })
452
+ ], HelixHeadlessColorInput.prototype, "triggerLabel", void 0);
453
+ HelixHeadlessColorInput = __decorate([
454
+ customElement('helix-headless-color-input')
455
+ ], HelixHeadlessColorInput);
456
+ export { HelixHeadlessColorInput };
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Reading and writing the color syntaxes a field is allowed to hold.
3
+ *
4
+ * **The working model is HSB**, hue and saturation and brightness, because that
5
+ * is what the panel is: a square of saturation against brightness with a hue
6
+ * ramp beside it. HSL would put the square's corners somewhere a reader does not
7
+ * expect, since full saturation in HSL is a mid-lightness band rather than a
8
+ * corner.
9
+ *
10
+ * **Every syntax here is read; three are written.** A field that refuses
11
+ * `rgb(255 0 0)` because it prefers hex is a field arguing with the person using
12
+ * it, so the space-separated forms, the comma forms, `rgba` and `hsla` are all
13
+ * taken. What is written back is whichever of hex, rgb or hsl the component is
14
+ * set to, so a value stays in the shape the consumer asked for however it was
15
+ * entered.
16
+ *
17
+ * **What is written is the comma form.** Both are valid and the space-separated
18
+ * one is newer, which was the reason it was chosen first; the commas are what a
19
+ * reader recognizes, what most code around them holds, and what pastes into
20
+ * anything without a second thought. A syntax a value is handed *out* in is not
21
+ * the place to be early. `rgba` and `hsla` come with them, since a comma form
22
+ * with a fourth argument is spelled that way.
23
+ *
24
+ * Its own module rather than sitting in the element, because it is arithmetic
25
+ * with no DOM in it: this is the half worth testing directly.
26
+ */
27
+ /** A color as the panel holds it. Alpha and the two percentages are 0 to 100. */
28
+ export interface Color {
29
+ alpha: number;
30
+ brightness: number;
31
+ hue: number;
32
+ saturation: number;
33
+ }
34
+ /** The syntaxes a value can be written in. */
35
+ export type ColorFormat = 'hex' | 'hsl' | 'rgb';
36
+ /** HSB to bytes, which is the road every written syntax goes down. */
37
+ export declare const toRgb: (color: Color) => {
38
+ blue: number;
39
+ green: number;
40
+ red: number;
41
+ };
42
+ /**
43
+ * Splits a comma-separated list of colors, ignoring the commas inside them.
44
+ *
45
+ * A plain `split(',')` is what this was, and it cannot hold the legacy syntaxes:
46
+ * `#ef4444, rgb(249 115 22), rgba(34,197,94,.5)` came apart into six fragments,
47
+ * four of them not colors, and the row quietly rendered three swatches instead
48
+ * of four. The modern space-separated forms survived it, which is what made the
49
+ * list look like it worked.
50
+ *
51
+ * Depth rather than a regular expression, because the thing that matters is
52
+ * whether a comma is inside a function call and that is exactly what a counter
53
+ * answers. No color syntax nests, so a single counter is enough.
54
+ */
55
+ export declare const splitColors: (value: string) => string[];
56
+ /**
57
+ * Any of the syntaxes to the working model, or `null` where it is not a color.
58
+ *
59
+ * Named colors are not here. Resolving `rebeccapurple` means either shipping
60
+ * the table of a hundred and forty or asking the browser, and the browser is not
61
+ * present on the server: a field that accepted a name client-side and rejected
62
+ * it during a server render would be worse than one that never took it.
63
+ */
64
+ export declare const parseColor: (value: string) => Color | null;
65
+ /**
66
+ * The working model back out, in the syntax asked for.
67
+ *
68
+ * The alpha is written only where the component carries one. A consumer who did
69
+ * not ask for transparency should not have to strip `ff` off every hex or read
70
+ * past a fourth argument they never wanted.
71
+ */
72
+ export declare const formatColor: (color: Color, format: ColorFormat, withAlpha: boolean) => string;
73
+ /** The color as CSS, for the swatches and the tracks. Always with its alpha. */
74
+ export declare const toCss: (color: Color) => string;