@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,837 @@
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 { valueAsDate as asDate, customElement, dateAsValue as fromDate, HelixFormElement, HelixNavigateEvent, hostAria, MixinControllerValue, requestChange, } from '@fusion.dev/helix-core';
8
+ import { caretLeft, caretRight } from '@fusion.dev/helix-icons';
9
+ import { html, nothing } from 'lit';
10
+ import { property, state } from 'lit/decorators.js';
11
+ import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
12
+ /** Keys the grid answers to, per the APG date grid. */
13
+ const KEYS = new Set([
14
+ 'ArrowDown',
15
+ 'ArrowLeft',
16
+ 'ArrowRight',
17
+ 'ArrowUp',
18
+ 'End',
19
+ 'Enter',
20
+ 'Home',
21
+ 'PageDown',
22
+ 'PageUp',
23
+ ' ',
24
+ ]);
25
+ /**
26
+ * Dates are held as `YYYY-MM-DD` and computed in UTC.
27
+ *
28
+ * A local-time `Date` shifts across a timezone or a daylight-saving boundary,
29
+ * so the same calendar renders a different grid depending on where it is read.
30
+ * Parsing and formatting both in UTC makes the string the source of truth and
31
+ * the arithmetic total.
32
+ */
33
+ const toUtc = (iso) => {
34
+ const parts = /^(\d{4})-(\d{2})-(\d{2})$/.exec(iso);
35
+ if (!parts) {
36
+ return null;
37
+ }
38
+ const date = new Date(Date.UTC(Number(parts[1]), Number(parts[2]) - 1, Number(parts[3])));
39
+ return Number.isNaN(date.getTime()) ? null : date;
40
+ };
41
+ const toIso = (date) => date.toISOString().slice(0, 10);
42
+ /**
43
+ * Today, in the reader's own timezone.
44
+ *
45
+ * **`toISOString` converts to UTC first, which makes "today" a different day
46
+ * for most of the planet.** Anywhere west of UTC, from late afternoon onward,
47
+ * `toIso(new Date())` names tomorrow: the mark landed on the wrong cell and the
48
+ * server and the client disagreed about which one, since the two run in
49
+ * different zones. The parts are read locally instead and pasted together,
50
+ * which is the only way to get a calendar date out of a `Date` without a
51
+ * conversion happening on the way.
52
+ */
53
+ const localToday = () => {
54
+ const now = new Date();
55
+ const month = `${now.getMonth() + 1}`.padStart(2, '0');
56
+ const day = `${now.getDate()}`.padStart(2, '0');
57
+ return `${now.getFullYear()}-${month}-${day}`;
58
+ };
59
+ /** Splits a comma-separated attribute, tolerating spaces and empty entries. */
60
+ const list = (value) => value
61
+ .split(',')
62
+ .map((entry) => entry.trim())
63
+ .filter(Boolean);
64
+ const addDays = (date, days) => new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate() + days));
65
+ /** Whether two dates fall in the same month of the same year. */
66
+ const sameMonth = (left, right) => left.getUTCFullYear() === right.getUTCFullYear() && left.getUTCMonth() === right.getUTCMonth();
67
+ const addMonths = (date, months) => {
68
+ const target = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + months, 1));
69
+ // Clamped, so the last of a long month lands on the last of a short one
70
+ // instead of rolling into the month after it.
71
+ const last = new Date(Date.UTC(target.getUTCFullYear(), target.getUTCMonth() + 1, 0)).getUTCDate();
72
+ return new Date(Date.UTC(target.getUTCFullYear(), target.getUTCMonth(), Math.min(date.getUTCDate(), last)));
73
+ };
74
+ /**
75
+ * @summary Shows a month, and takes a date from it.
76
+ *
77
+ * @description
78
+ * A grid of days, per the APG date grid: the whole grid is one tab stop, arrows
79
+ * move by day and week, `PageUp` and `PageDown` move by month, and `Home` and
80
+ * `End` go to the ends of the week. Only the focused cell is in the tab
81
+ * sequence.
82
+ *
83
+ * Roving `tabindex` is written on the cells, which is free here because they
84
+ * are rendered into this shadow root rather than being markup a consumer wrote.
85
+ *
86
+ * Dates are `YYYY-MM-DD` strings and every calculation is in UTC. A local-time
87
+ * `Date` shifts across a timezone or a daylight-saving boundary, so the string
88
+ * is what the component holds and the arithmetic never leaves UTC.
89
+ *
90
+ * `month` is what the grid shows, separately from `value`, so paging through
91
+ * months does not select anything and a consumer can drive the view. Left
92
+ * unset, it follows the first selected date, and then the current month.
93
+ *
94
+ * `mode` decides how many dates are held. Absent takes one. `range` takes two
95
+ * and marks everything between them, starting over on the third click rather
96
+ * than replacing an end at random. `multiple` toggles, so clicking a chosen
97
+ * date takes it out. All three read and write the same comma-separated
98
+ * `value`.
99
+ *
100
+ * `locale` is worth setting where the output is compared across environments.
101
+ * Left unset, month and day names come from the runtime's own locale, and a
102
+ * server and a browser need not agree on what that is.
103
+ *
104
+ * `helix-before-change` was `helix-select`, and it moved when the calendar became
105
+ * form control. A control whose value changes dispatches `helix-before-change` here:
106
+ * `Input`, `Select`, `Listbox`, `Radio.Group` and `Toggle.Group` all do, and a
107
+ * calendar submitting a date is the same kind of thing. `helix-select` stays
108
+ * what it is elsewhere, which is a row or an item being chosen in something
109
+ * that reports no value at all, such as `Menu` or `Tree`.
110
+ *
111
+ * Paging is `helix-navigate` and not either of those, because it chooses
112
+ * nothing: the view moves and the answer does not.
113
+ *
114
+ * The properties below are written by this component and read by whoever draws
115
+ * it. A consumer sets none of them: they carry a number this element computed
116
+ * and CSS cannot, which is what lets a stylesheet on this tier draw the thing
117
+ * without measuring anything itself.
118
+ *
119
+ * @since 0.1.0
120
+ * @status experimental
121
+ * @category forms
122
+ * @aliases Calendar, Date grid, Month view
123
+ * @documentation https://helix.fusion.dev/components/date-picker
124
+ *
125
+ * @slot next-icon - The glyph on the control that moves forward a month, usually a caret.
126
+ * @slot previous-icon - The glyph on the control that moves back a month, usually a caret.
127
+ *
128
+ * @event {Event} change - Announced once the value has moved.
129
+ * @event {HelixBeforeChangeEvent} helix-before-change - Fired before the dates change, and cancelable.
130
+ * @event {HelixNavigateEvent} helix-navigate - Fired before the month on show changes, and cancelable.
131
+ * @event {Event} input - Announced once the value has moved.
132
+ *
133
+ * @csspart cell - One column of a row, which is what a range paints.
134
+ * @csspart day - The shape inside a cell, which is what a single date paints.
135
+ * @csspart grid - The grid of days.
136
+ * @csspart header - The month name and its controls.
137
+ * @csspart heading - The month and year being shown.
138
+ * @csspart month - One month, its header and its grid.
139
+ * @csspart months - The run of months.
140
+ * @csspart next - The control that moves to the next month.
141
+ * @csspart next-mark - The glyph on the next month control, where none is slotted.
142
+ * @csspart previous - The control that moves to the previous month.
143
+ * @csspart previous-mark - The glyph on the previous month control, where none is slotted.
144
+ * @csspart week - One row of days.
145
+ * @csspart weekday - A column header naming a day of the week.
146
+ *
147
+ * @cssproperty --date-picker-column-count - How many month columns are drawn, capped at two. `--date-picker-columns` overrides it.
148
+ */
149
+ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControllerValue(HelixFormElement) {
150
+ constructor() {
151
+ super(...arguments);
152
+ /**
153
+ * How many months to show, side by side.
154
+ */
155
+ this.months = 1;
156
+ /**
157
+ * Locale for month and day names.
158
+ *
159
+ * Absent uses the runtime's own.
160
+ */
161
+ this.locale = '';
162
+ /**
163
+ * Dates that cannot be chosen, comma separated, as `YYYY-MM-DD`.
164
+ */
165
+ this.disableDates = '';
166
+ /**
167
+ * Days of the week that cannot be chosen, comma separated, `0` to `6`.
168
+ */
169
+ this.disableDays = '';
170
+ /**
171
+ * Whether the current selection fails validation.
172
+ */
173
+ this.invalid = false;
174
+ /**
175
+ * Accessible name for the control that pages back.
176
+ *
177
+ * A property because this is the one component in the library that takes a
178
+ * `locale`, and it carried two hardcoded English names with no way to change
179
+ * them: a calendar rendering its own month names in Japanese still announced
180
+ * its controls in English. `attribute:` spelled out, since Lit lowercases a
181
+ * camelCase name rather than dash-casing it.
182
+ */
183
+ this.previousLabel = 'Previous month';
184
+ /**
185
+ * Accessible name for the control that pages forward.
186
+ */
187
+ this.nextLabel = 'Next month';
188
+ /**
189
+ * Month to open on, where nothing declared one.
190
+ */
191
+ this.defaultMonth = '';
192
+ /** The month on show, whoever set it, and `undefined` until somebody has. */
193
+ this.monthState = undefined;
194
+ /**
195
+ * Earliest selectable date, as `YYYY-MM-DD`.
196
+ */
197
+ this.min = '';
198
+ /**
199
+ * How far apart the selectable dates are, in days.
200
+ *
201
+ * `<input type="date" step>`'s own unit, counted from `min` where there is
202
+ * one and from 1 January 1970 where there is not, which is the platform's own
203
+ * base. A booking calendar that only takes Mondays is `step="7"` with a `min`
204
+ * on a Monday, and there was no way to say that: `disable-dates` takes a list
205
+ * and a year of Mondays is not a list anybody writes.
206
+ *
207
+ * One is every date and needs no rule, which is why anything below one is
208
+ * treated as one rather than as an error: a step of zero would block every
209
+ * date including the one already chosen.
210
+ */
211
+ this.step = 1;
212
+ /**
213
+ * Latest selectable date, as `YYYY-MM-DD`.
214
+ */
215
+ this.max = '';
216
+ /**
217
+ * Accessible name for the grid.
218
+ */
219
+ this.label = 'Date Picker';
220
+ /**
221
+ * First column of the week, `0` for Sunday through `6` for Saturday.
222
+ */
223
+ this.firstDayOfWeek = 0;
224
+ /**
225
+ * The date the grid's tab stop is on.
226
+ *
227
+ * Absent until the grid is used.
228
+ */
229
+ this.focused = '';
230
+ this.handleKeydown = (event) => {
231
+ if (!KEYS.has(event.key) || this.disabled) {
232
+ return;
233
+ }
234
+ /* Grid keys, from the grid.
235
+ *
236
+ * The listener is on the host and the host holds the previous and next
237
+ * buttons as well, so Enter and Space pressed on one of those were read as
238
+ * "choose the focused day" and then `preventDefault()`ed: the button's own
239
+ * activation was canceled and the month never moved. Every arrow was taken
240
+ * from them too. */
241
+ const path = event.composedPath();
242
+ const grid = this.renderRoot?.querySelector('[part="grid"]');
243
+ if (!grid || !path.includes(grid)) {
244
+ return;
245
+ }
246
+ const from = this.anchor;
247
+ if (event.key === 'Enter' || event.key === ' ') {
248
+ this.select(from);
249
+ }
250
+ else if (event.key === 'ArrowLeft') {
251
+ this.moveTo(addDays(from, -1));
252
+ }
253
+ else if (event.key === 'ArrowRight') {
254
+ this.moveTo(addDays(from, 1));
255
+ }
256
+ else if (event.key === 'ArrowUp') {
257
+ this.moveTo(addDays(from, -7));
258
+ }
259
+ else if (event.key === 'ArrowDown') {
260
+ this.moveTo(addDays(from, 7));
261
+ }
262
+ else if (event.key === 'Home') {
263
+ this.moveTo(addDays(from, -((from.getUTCDay() - this.firstDayOfWeek + 7) % 7)));
264
+ }
265
+ else if (event.key === 'End') {
266
+ this.moveTo(addDays(from, 6 - ((from.getUTCDay() - this.firstDayOfWeek + 7) % 7)));
267
+ }
268
+ else {
269
+ // Shift pages by a year, which is the same move twelve months over.
270
+ const step = event.key === 'PageUp' ? -1 : 1;
271
+ this.moveTo(addMonths(from, event.shiftKey ? step * 12 : step));
272
+ }
273
+ event.preventDefault();
274
+ };
275
+ /**
276
+ * Whether the control refuses changes while still submitting its value.
277
+ *
278
+ * **Enforced by refusing every request in one place**, which is the seam this
279
+ * component already has: `requestValue` is what every path here comes through,
280
+ * and gating it once is what stops the next call site from being written
281
+ * without the check.
282
+ *
283
+ * Not `disabled`, which is the confusion worth naming: a disabled control
284
+ * submits nothing and leaves the tab order, and a read-only one submits its
285
+ * value and stays reachable, which is what a form showing a value somebody
286
+ * else set needs.
287
+ */
288
+ this.readOnly = false;
289
+ /**
290
+ * Whether the form refuses to submit while nothing is chosen.
291
+ */
292
+ this.required = false;
293
+ }
294
+ /**
295
+ * The month on show, as `YYYY-MM`. Follows `value`, then the current month.
296
+ *
297
+ * Separate from `value` on purpose, so paging selects nothing and a consumer
298
+ * can drive the view. It said that and could not do it: the calendar wrote
299
+ * this when the reader paged, so a consumer holding it was overwritten and
300
+ * never told. Reading gives the month on show; writing declares it theirs,
301
+ * and `default-month` seeds one the calendar owns.
302
+ *
303
+ *
304
+ */
305
+ get month() {
306
+ /* What is on show, which is what the tag says it gives.
307
+ *
308
+ * It returned `''` while a month was plainly on display, because nothing had
309
+ * declared one, and `show()` compares against it before moving: the guard
310
+ * was dead, so the first arrow key wrote `monthState` and from then on the
311
+ * grid stopped following `value`. A calendar whose consumer moved the value
312
+ * showed the month the reader had last paged to instead. */
313
+ return this.monthState ?? (this.defaultMonth || toIso(this.derivedMonth).slice(0, 7));
314
+ }
315
+ set month(next) {
316
+ const previous = this.month;
317
+ this.monthState = next;
318
+ this.requestUpdate('month', previous);
319
+ }
320
+ /** The selected dates, in order. */
321
+ get selected() {
322
+ return list(this.value);
323
+ }
324
+ /** The range's ends, when there are two and the mode asks for them. */
325
+ get range() {
326
+ const dates = this.selected;
327
+ if (this.mode !== 'range' || dates.length < 2) {
328
+ return null;
329
+ }
330
+ const [first, second] = [dates[0], dates[1]];
331
+ return first <= second ? [first, second] : [second, first];
332
+ }
333
+ isSelected(iso) {
334
+ const range = this.range;
335
+ if (range) {
336
+ return iso >= range[0] && iso <= range[1];
337
+ }
338
+ return this.selected.includes(iso);
339
+ }
340
+ /** The month being shown, resolved from `month`, then `value`, then today. */
341
+ get shown() {
342
+ const explicit = /^(\d{4})-(\d{2})$/.exec(this.monthState ?? this.defaultMonth);
343
+ if (explicit) {
344
+ return new Date(Date.UTC(Number(explicit[1]), Number(explicit[2]) - 1, 1));
345
+ }
346
+ return this.derivedMonth;
347
+ }
348
+ /**
349
+ * The month to open on when nothing has declared one.
350
+ *
351
+ * Split out from `shown` so `month` can report what is on display without the
352
+ * two calling each other: `month` reading `shown` and `shown` reading `month`
353
+ * is a stack overflow, and the specs found it immediately.
354
+ */
355
+ get derivedMonth() {
356
+ const from = toUtc(this.selected[0] ?? '') ?? new Date();
357
+ return new Date(Date.UTC(from.getUTCFullYear(), from.getUTCMonth(), 1));
358
+ }
359
+ /**
360
+ * The date the tab stop sits on, which is where the arrows move from.
361
+ *
362
+ * It has to be a date the grid actually renders, so the month is compared
363
+ * with its year. Comparing the month alone puts the stop on the same date a
364
+ * year away, which is rendered nowhere, and the grid is left with no tab stop
365
+ * at all and no way into it from the keyboard.
366
+ *
367
+ * Each candidate is tested in turn rather than the first one winning
368
+ * outright. Where the last date focused is in some other month, the selected
369
+ * date still holds the stop, and only with neither in view does it fall to
370
+ * the first of the month.
371
+ */
372
+ get anchor() {
373
+ const shown = this.shown;
374
+ for (const candidate of [toUtc(this.focused), toUtc(this.selected[0] ?? '')]) {
375
+ if (candidate && sameMonth(candidate, shown)) {
376
+ return candidate;
377
+ }
378
+ }
379
+ return shown;
380
+ }
381
+ /** Six weeks of dates, so a grid does not change height between months. */
382
+ weeksOf(month) {
383
+ const offset = (month.getUTCDay() - this.firstDayOfWeek + 7) % 7;
384
+ const start = addDays(month, -offset);
385
+ return Array.from({ length: 6 }, (_, week) => Array.from({ length: 7 }, (_, day) => addDays(start, week * 7 + day)));
386
+ }
387
+ /**
388
+ * Whether a date is barred, by bound, by weekday, or by name.
389
+ *
390
+ * `barred`, not `disabled`: the calendar is a form control now, and
391
+ * `HelixFormElement.disabled` is a boolean about the whole control. A method
392
+ * and a flag cannot share a name, and of the two it is the method that should
393
+ * move, because "disabled" on a control means one thing everywhere else in
394
+ * the library.
395
+ */
396
+ barred(date) {
397
+ const iso = toIso(date);
398
+ if (this.min !== '' && iso < this.min) {
399
+ return true;
400
+ }
401
+ if (this.max !== '' && iso > this.max) {
402
+ return true;
403
+ }
404
+ if (list(this.disableDays).includes(String(date.getUTCDay()))) {
405
+ return true;
406
+ }
407
+ /* Counted from `min` where there is one and from the epoch where there is
408
+ not, which is what the platform does with a `step` and no `min`. Whole
409
+ days, because both ends are midnight UTC and neither carries a time. */
410
+ const step = Math.max(1, Math.floor(this.step) || 1);
411
+ if (step > 1) {
412
+ const base = this.min === '' ? 0 : (asDate(this.min)?.getTime() ?? 0);
413
+ const days = Math.round((date.getTime() - base) / 86_400_000);
414
+ if (days % step !== 0) {
415
+ return true;
416
+ }
417
+ }
418
+ return list(this.disableDates).includes(iso);
419
+ }
420
+ /**
421
+ * Moves the view, announcing it first.
422
+ *
423
+ * `helix-navigate` and not `helix-change`: paging chooses nothing, and a
424
+ * consumer driving the view has to hear that it moved without being told the
425
+ * answer did. In controlled mode nothing moves and the consumer decides,
426
+ * which is the point of them holding it.
427
+ */
428
+ show(date) {
429
+ if (this.disabled) {
430
+ return;
431
+ }
432
+ const next = `${date.getUTCFullYear()}-${String(date.getUTCMonth() + 1).padStart(2, '0')}`;
433
+ if (next === this.month) {
434
+ return;
435
+ }
436
+ requestChange({
437
+ apply: (month) => {
438
+ const previous = this.month;
439
+ this.monthState = month;
440
+ this.requestUpdate('month', previous);
441
+ },
442
+ event: (month) => new HelixNavigateEvent({ value: month }),
443
+ host: this,
444
+ next,
445
+ });
446
+ }
447
+ moveTo(date) {
448
+ this.focused = toIso(date);
449
+ this.show(date);
450
+ this.updateComplete.then(() => {
451
+ this.renderRoot.querySelector('[part="cell"][tabindex="0"]')?.focus();
452
+ });
453
+ }
454
+ /**
455
+ * Adds a date to the selection, as the mode allows.
456
+ *
457
+ * `range` starts over once it holds two, so a third click begins a new range
458
+ * rather than extending or replacing an end at random. `multiple` toggles, so
459
+ * clicking a chosen date takes it out.
460
+ */
461
+ select(date) {
462
+ /* `disabled` meant nothing here beyond dropping the value at submit time:
463
+ days still took a click, the keyboard still moved through the grid, and
464
+ nothing said the control was off. Refused at the source rather than at
465
+ each cell, so every path in is covered by one check. */
466
+ if (this.disabled) {
467
+ return;
468
+ }
469
+ if (this.barred(date)) {
470
+ return;
471
+ }
472
+ const iso = toIso(date);
473
+ const held = this.selected;
474
+ let next;
475
+ if (this.mode === 'range') {
476
+ next = held.length === 1 ? [...held, iso].sort() : [iso];
477
+ }
478
+ else if (this.mode === 'multiple') {
479
+ next = held.includes(iso) ? held.filter((entry) => entry !== iso) : [...held, iso].sort();
480
+ }
481
+ else {
482
+ next = [iso];
483
+ }
484
+ /* Focus moves whatever happens, because the reader pressed there and the
485
+ roving tab stop is about where they are rather than about what is
486
+ chosen. The selection is the part that can be refused. */
487
+ this.focused = iso;
488
+ /* Announced before it is written, which it was not: this set `value` and
489
+ then dispatched, so a listener calling `preventDefault()` was refusing a
490
+ date that had already been chosen. `requestChange` is the one
491
+ audited path its own documentation claims for every stateful change in
492
+ the system, and this was not on it. */
493
+ this.requestValue(next.join(','));
494
+ }
495
+ connectedCallback() {
496
+ super.connectedCallback();
497
+ this.addEventListener('keydown', this.handleKeydown);
498
+ }
499
+ disconnectedCallback() {
500
+ super.disconnectedCallback();
501
+ this.removeEventListener('keydown', this.handleKeydown);
502
+ }
503
+ /** Refuses every change while read-only. See `readOnly`. */
504
+ requestValue(next) {
505
+ if (this.readOnly) {
506
+ return false;
507
+ }
508
+ return super.requestValue(next);
509
+ }
510
+ /**
511
+ * Reports "required and empty", or clears it.
512
+ *
513
+ * Written out rather than taken from `MixinField`, which is where the seven
514
+ * form controls get this. That mixin brings a label, a hint and a feedback
515
+ * region with it, and this is a grid rather than a field: it is composed
516
+ * *into* the field that has those, so taking the mixin would give one control
517
+ * two of each. What is shared is five lines, and the anchor is what the
518
+ * browser points its bubble at.
519
+ */
520
+ reportRequired() {
521
+ const anchor = this.renderRoot?.querySelector('[part="grid"]') ?? undefined;
522
+ if (this.required && this.value === '') {
523
+ this.internals.setValidity({ valueMissing: true }, 'Choose a date.', anchor);
524
+ return;
525
+ }
526
+ /* **A value the calendar cannot read is bad input, and it used to be
527
+ valid.** The grid draws only what it can parse, so `value="not-a-date"`
528
+ selected nothing, said nothing, reported `:valid`, and handed the string
529
+ to the form: measured, a form carrying `dp=not-a-date` that submitted
530
+ without complaint. `DateInput` had this right all along, because it
531
+ relays the validity of an inner control it can ask.
532
+
533
+ `asDate` rather than the shape alone, which is the half `DateInput`'s own
534
+ regex still misses: `2026-02-30` matches `YYYY-MM-DD` and is not a day,
535
+ and `valueAsDate` reads the parts back after constructing to say so. */
536
+ const held = this.selected;
537
+ if (held.length > 0 && held.some((one) => asDate(one) === null)) {
538
+ this.internals.setValidity({ badInput: true }, this.mode === undefined
539
+ ? 'Enter a date as YYYY-MM-DD.'
540
+ : 'Enter dates as YYYY-MM-DD, separated by commas.', anchor);
541
+ return;
542
+ }
543
+ this.internals.setValidity({});
544
+ }
545
+ willUpdate(changed) {
546
+ super.willUpdate(changed);
547
+ hostAria(this.internals, { label: this.label, role: 'group' });
548
+ /* Announced as off, not merely inert. Removing it from the accessibility
549
+ tree would take the dates with it; this says the control exists and
550
+ cannot be used, which is the same call `HelixFormElement` documents. */
551
+ /* `isDisabled` and not `disabled`, which is the whole reason the getter
552
+ exists: a calendar inside a disabled fieldset is disabled and its own
553
+ property says nothing about it. Writing `disabled` here also overwrote
554
+ the answer `HelixFormElement.willUpdate` had just computed. */
555
+ this.internals.ariaDisabled = this.isDisabled ? 'true' : null;
556
+ this.internals.ariaInvalid = this.invalid ? 'true' : null;
557
+ this.report();
558
+ }
559
+ /**
560
+ * Reports validity after render, because the bubble needs somewhere to point.
561
+ *
562
+ * `updated` and not `willUpdate`: the anchor is a rendered part, and on the
563
+ * first pass through `willUpdate` there is no grid yet, so the browser would
564
+ * put the message in the corner of the viewport rather than on the calendar.
565
+ */
566
+ updated(changed) {
567
+ super.updated(changed);
568
+ this.reportRequired();
569
+ }
570
+ /**
571
+ * Reports the dates to the form, one entry each.
572
+ *
573
+ * `FormData` rather than the comma-joined string the property holds, because
574
+ * `mode="multiple"` is genuinely several answers and a server reading
575
+ * `dates=2026-08-04,2026-08-06` has to know to split it on a convention this
576
+ * library invented. One entry per date is what every other multi-valued
577
+ * control on the platform sends, and `range` sends its two the same way, in
578
+ * order, so start and end arrive as the pair they already are.
579
+ *
580
+ * **Nothing at all without a `name`, and that is the mechanism rather than a
581
+ * detail.** It is what lets a calendar sit inside something that owns the
582
+ * form value, which is how `DatePicker` will hold one. The guard has to be
583
+ * explicit here in a way it does not for `Listbox`: a control reporting a
584
+ * plain string is skipped by the form when it has no name, but a `FormData`
585
+ * carries its own names and its entries are appended whatever the element is
586
+ * called, so an unnamed calendar would submit empty-named dates.
587
+ */
588
+ report() {
589
+ const dates = this.selected;
590
+ if (this.name === '' || this.disabled || dates.length === 0) {
591
+ this.internals.setFormValue(null);
592
+ return;
593
+ }
594
+ const data = new FormData();
595
+ for (const date of dates) {
596
+ data.append(this.name, date);
597
+ }
598
+ this.internals.setFormValue(data);
599
+ }
600
+ /**
601
+ * How many months are shown, clamped once.
602
+ *
603
+ * `months` was clamped at the call site and read raw where the last month is
604
+ * identified, so a zero, a negative or a non-numeric value rendered nothing
605
+ * and took the forward control with it: `index === this.months - 1` is never
606
+ * true for `NaN`. One getter both read.
607
+ */
608
+ get monthCount() {
609
+ return Math.max(1, Math.floor(this.months) || 1);
610
+ }
611
+ get formats() {
612
+ if (this.cachedFormats?.locale === this.locale) {
613
+ return this.cachedFormats;
614
+ }
615
+ const locale = this.locale || undefined;
616
+ const built = {
617
+ full: new Intl.DateTimeFormat(locale, { dateStyle: 'full', timeZone: 'UTC' }),
618
+ heading: new Intl.DateTimeFormat(locale, { month: 'long', timeZone: 'UTC', year: 'numeric' }),
619
+ locale: this.locale,
620
+ weekday: new Intl.DateTimeFormat(locale, { timeZone: 'UTC', weekday: 'short' }),
621
+ };
622
+ this.cachedFormats = built;
623
+ return built;
624
+ }
625
+ /**
626
+ * The caret saying which way the month moves, behind a seam.
627
+ *
628
+ * Slot fallback, so a consumer replaces it by slotting; and a method, so the
629
+ * tier above replaces it by overriding. Those answer different people, which
630
+ * is the same pairing `Select` records on its indicator.
631
+ *
632
+ * **One of each is rendered at most**, whatever `months` is set to: the
633
+ * controls are drawn on the first month and the last rather than once per
634
+ * month, so a duplicate `<slot name="previous-icon">` cannot arise. A second
635
+ * slot of the same name is assigned nothing, which would have left one of two
636
+ * calendars with no mark and no error.
637
+ */
638
+ renderPreviousMark() {
639
+ return html `<slot name="previous-icon">
640
+ <svg part="previous-mark" fill="currentColor" viewBox=${caretLeft.viewBox} aria-hidden="true">
641
+ ${unsafeSVG(caretLeft.content)}
642
+ </svg>
643
+ </slot>`;
644
+ }
645
+ renderNextMark() {
646
+ return html `<slot name="next-icon">
647
+ <svg part="next-mark" fill="currentColor" viewBox=${caretRight.viewBox} aria-hidden="true">
648
+ ${unsafeSVG(caretRight.content)}
649
+ </svg>
650
+ </slot>`;
651
+ }
652
+ renderMonth(month, index) {
653
+ const { full, heading, weekday } = this.formats;
654
+ const weeks = this.weeksOf(month);
655
+ const anchor = toIso(this.anchor);
656
+ /* Today, which nothing marked at all: not in the accessibility tree, where
657
+ `aria-current="date"` is the word for it, and not on the cell either, so a
658
+ consumer could not add the mark from CSS. Computed once per month rather
659
+ than per cell. */
660
+ const today = localToday();
661
+ const range = this.range;
662
+ // One set of controls across the whole run: back on the first month,
663
+ // forward on the last. A pair per month would offer six ways to make the
664
+ // same move and leave the reader to work out which.
665
+ const first = index === 0;
666
+ const last = index === this.monthCount - 1;
667
+ return html `<div part="month">
668
+ <div part="header">
669
+ ${first
670
+ ? html `<button
671
+ part="previous"
672
+ type="button"
673
+ aria-label=${this.previousLabel}
674
+ @click=${() => this.show(addMonths(this.shown, -1))}
675
+ >
676
+ ${this.renderPreviousMark()}
677
+ </button>`
678
+ : nothing}
679
+ <span part="heading">${heading.format(month)}</span>
680
+ ${last
681
+ ? html `<button
682
+ part="next"
683
+ type="button"
684
+ aria-label=${this.nextLabel}
685
+ @click=${() => this.show(addMonths(this.shown, 1))}
686
+ >
687
+ ${this.renderNextMark()}
688
+ </button>`
689
+ : nothing}
690
+ </div>
691
+ <div
692
+ part="grid"
693
+ role="grid"
694
+ aria-label=${heading.format(month)}
695
+ data-unset=${this.value === '' ? '' : nothing}
696
+ >
697
+ <div part="week" role="row">
698
+ ${weeks[0]?.map((date) => html `<span part="weekday" role="columnheader">${weekday.format(date)}</span>`)}
699
+ </div>
700
+ ${weeks.map((week) => html `<div part="week" role="row">
701
+ ${week.map((date) => {
702
+ const iso = toIso(date);
703
+ const disabled = this.barred(date);
704
+ const selected = this.isSelected(iso);
705
+ /* A day from a neighbouring month is filler, so the grid is a
706
+ rectangle, and nothing else. It takes no click and shows no
707
+ selection.
708
+ It used to take both, and at `months="2"` that put the same
709
+ date on the page twice: September the 5th is a trailing cell in
710
+ August's grid and a real cell in September's, so choosing the
711
+ end of a range drew the dark terminus in both, and the band ran
712
+ through August's last row and then again through September's
713
+ first. Two cells cannot be the answer to one question. The band
714
+ now stops at the last day the grid owns and picks up in the
715
+ next, which is where those dates actually are. */
716
+ const outside = !sameMonth(date, month);
717
+ // The cell is the column track and the day is the shape centered
718
+ // in it. A range paints the track, so it runs continuously
719
+ // between days and stops at the ends of a row on its own.
720
+ return html `<span
721
+ part="cell"
722
+ role="gridcell"
723
+ aria-disabled=${disabled ? 'true' : nothing}
724
+ aria-label=${full.format(date)}
725
+ aria-current=${iso === today ? 'date' : nothing}
726
+ aria-selected=${!outside && selected ? 'true' : nothing}
727
+ data-outside=${outside ? '' : nothing}
728
+ data-range-end=${!outside && range && iso === range[1] ? '' : nothing}
729
+ data-range-middle=${!outside && range && iso > range[0] && iso < range[1] ? '' : nothing}
730
+ data-range-start=${!outside && range && iso === range[0] ? '' : nothing}
731
+ data-today=${iso === today ? '' : nothing}
732
+ tabindex=${!outside && iso === anchor ? '0' : '-1'}
733
+ @click=${outside ? nothing : () => this.select(date)}
734
+ ><span part="day">${date.getUTCDate()}</span></span
735
+ >`;
736
+ })}
737
+ </div>`)}
738
+ </div>
739
+ </div>`;
740
+ }
741
+ render() {
742
+ const shown = this.shown;
743
+ const count = this.monthCount;
744
+ /* The column count, written out for the tier above.
745
+ Data rather than styling, the same arrangement Slider uses for its
746
+ fraction: only this element knows how many months there are, and a
747
+ stylesheet cannot count children into a `repeat()`. Capped at two, and a
748
+ consumer wanting more sets `--date-picker-columns`. */
749
+ return html `<div part="months" style="--date-picker-column-count: ${Math.min(count, 2)}">
750
+ ${Array.from({ length: count }, (_, index) => this.renderMonth(addMonths(shown, index), index))}
751
+ </div>`;
752
+ }
753
+ /**
754
+ * The value as a `Date`, at midnight UTC, or `null` while there is no date.
755
+ *
756
+ * The platform's own pair on `<input type="date">`, and this control holds the
757
+ * same `YYYY-MM-DD` string, so a consumer moving from one to the other reads
758
+ * the same two properties. UTC because the platform chose UTC: a date that is
759
+ * the same date everywhere must not become a different one by crossing a
760
+ * timezone, and midnight local would do exactly that for anybody west of
761
+ * Greenwich.
762
+ *
763
+ * `null` while the value is half typed, which is most of the keystrokes a
764
+ * reader makes in one of these.
765
+ */
766
+ get valueAsDate() {
767
+ return asDate(this.value);
768
+ }
769
+ set valueAsDate(date) {
770
+ this.value = fromDate(date);
771
+ }
772
+ /** The value as milliseconds since the epoch, or `NaN` while there is no date. */
773
+ get valueAsNumber() {
774
+ return asDate(this.value)?.getTime() ?? Number.NaN;
775
+ }
776
+ set valueAsNumber(ms) {
777
+ this.value = Number.isNaN(ms) ? '' : fromDate(new Date(ms));
778
+ }
779
+ };
780
+ __decorate([
781
+ property({ reflect: true })
782
+ ], HelixHeadlessDatePicker.prototype, "mode", void 0);
783
+ __decorate([
784
+ property({ type: Number })
785
+ ], HelixHeadlessDatePicker.prototype, "months", void 0);
786
+ __decorate([
787
+ property()
788
+ ], HelixHeadlessDatePicker.prototype, "locale", void 0);
789
+ __decorate([
790
+ property({ attribute: 'disable-dates' })
791
+ ], HelixHeadlessDatePicker.prototype, "disableDates", void 0);
792
+ __decorate([
793
+ property({ attribute: 'disable-days' })
794
+ ], HelixHeadlessDatePicker.prototype, "disableDays", void 0);
795
+ __decorate([
796
+ property({ reflect: true, type: Boolean })
797
+ ], HelixHeadlessDatePicker.prototype, "invalid", void 0);
798
+ __decorate([
799
+ property()
800
+ ], HelixHeadlessDatePicker.prototype, "month", null);
801
+ __decorate([
802
+ property({ attribute: 'previous-label' })
803
+ ], HelixHeadlessDatePicker.prototype, "previousLabel", void 0);
804
+ __decorate([
805
+ property({ attribute: 'next-label' })
806
+ ], HelixHeadlessDatePicker.prototype, "nextLabel", void 0);
807
+ __decorate([
808
+ property({ attribute: 'default-month' })
809
+ ], HelixHeadlessDatePicker.prototype, "defaultMonth", void 0);
810
+ __decorate([
811
+ property()
812
+ ], HelixHeadlessDatePicker.prototype, "min", void 0);
813
+ __decorate([
814
+ property({ type: Number })
815
+ ], HelixHeadlessDatePicker.prototype, "step", void 0);
816
+ __decorate([
817
+ property()
818
+ ], HelixHeadlessDatePicker.prototype, "max", void 0);
819
+ __decorate([
820
+ property()
821
+ ], HelixHeadlessDatePicker.prototype, "label", void 0);
822
+ __decorate([
823
+ property({ attribute: 'first-day-of-week', type: Number })
824
+ ], HelixHeadlessDatePicker.prototype, "firstDayOfWeek", void 0);
825
+ __decorate([
826
+ state()
827
+ ], HelixHeadlessDatePicker.prototype, "focused", void 0);
828
+ __decorate([
829
+ property({ attribute: 'readonly', reflect: true, type: Boolean })
830
+ ], HelixHeadlessDatePicker.prototype, "readOnly", void 0);
831
+ __decorate([
832
+ property({ reflect: true, type: Boolean })
833
+ ], HelixHeadlessDatePicker.prototype, "required", void 0);
834
+ HelixHeadlessDatePicker = __decorate([
835
+ customElement('helix-headless-date-picker')
836
+ ], HelixHeadlessDatePicker);
837
+ export { HelixHeadlessDatePicker };