@fusion.dev/helix-headless 0.143.0 → 0.145.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/custom-elements.json +16990 -1383
  2. package/dist/accordion/item/accordion-item.d.ts +48 -12
  3. package/dist/accordion/item/accordion-item.js +26 -5
  4. package/dist/accordion/root/accordion-root.d.ts +6 -0
  5. package/dist/accordion/root/accordion-root.js +7 -1
  6. package/dist/announcement/root/announcement-root.d.ts +21 -1
  7. package/dist/announcement/root/announcement-root.js +36 -1
  8. package/dist/app-header/root/app-header-root.d.ts +7 -0
  9. package/dist/app-header/root/app-header-root.js +5 -1
  10. package/dist/app-header/sectioning.d.ts +7 -0
  11. package/dist/app-header/sectioning.js +26 -0
  12. package/dist/area-chart/root/area-chart-root.d.ts +12 -4
  13. package/dist/area-chart/root/area-chart-root.js +24 -7
  14. package/dist/avatar/root/avatar-root.d.ts +14 -0
  15. package/dist/avatar/root/avatar-root.js +23 -9
  16. package/dist/badge/root/badge-root.d.ts +11 -7
  17. package/dist/badge/root/badge-root.js +1 -1
  18. package/dist/bar-chart/root/bar-chart-root.d.ts +12 -3
  19. package/dist/bar-chart/root/bar-chart-root.js +17 -10
  20. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +32 -1
  21. package/dist/breadcrumbs/root/breadcrumbs-root.js +25 -2
  22. package/dist/button/root/button-root.d.ts +47 -1
  23. package/dist/button/root/button-root.js +38 -4
  24. package/dist/callout/root/callout-root.d.ts +18 -1
  25. package/dist/callout/root/callout-root.js +15 -4
  26. package/dist/canvas/root/canvas-root.d.ts +38 -3
  27. package/dist/canvas/root/canvas-root.js +121 -40
  28. package/dist/card/root/card-root.d.ts +30 -1
  29. package/dist/card/root/card-root.js +38 -5
  30. package/dist/carousel/root/carousel-root.d.ts +90 -0
  31. package/dist/carousel/root/carousel-root.js +134 -12
  32. package/dist/chat/composer/chat-composer.d.ts +38 -6
  33. package/dist/chat/composer/chat-composer.js +42 -9
  34. package/dist/chat/message/chat-message.d.ts +32 -1
  35. package/dist/chat/message/chat-message.js +25 -9
  36. package/dist/chat/naming.d.ts +22 -0
  37. package/dist/chat/naming.js +12 -0
  38. package/dist/chat/relative-clock.d.ts +39 -0
  39. package/dist/chat/relative-clock.js +31 -0
  40. package/dist/chat/root/chat-root.d.ts +36 -0
  41. package/dist/chat/root/chat-root.js +24 -1
  42. package/dist/checkbox/root/checkbox-root.js +2 -0
  43. package/dist/checkbox-group/root/checkbox-group-root.d.ts +53 -3
  44. package/dist/checkbox-group/root/checkbox-group-root.js +71 -22
  45. package/dist/code-block/lines.d.ts +13 -0
  46. package/dist/code-block/lines.js +2 -0
  47. package/dist/code-block/root/code-block-root.d.ts +38 -1
  48. package/dist/code-block/root/code-block-root.js +28 -7
  49. package/dist/color-input/root/color-input-root.d.ts +34 -1
  50. package/dist/color-input/root/color-input-root.js +23 -4
  51. package/dist/color-picker/channels.d.ts +26 -0
  52. package/dist/color-picker/channels.js +84 -0
  53. package/dist/color-picker/root/color-picker-root.d.ts +81 -5
  54. package/dist/color-picker/root/color-picker-root.js +103 -10
  55. package/dist/combobox/root/combobox-root.d.ts +38 -3
  56. package/dist/combobox/root/combobox-root.js +64 -2
  57. package/dist/command/root/command-root.d.ts +30 -4
  58. package/dist/command/root/command-root.js +33 -3
  59. package/dist/copy-button/from.d.ts +22 -0
  60. package/dist/copy-button/from.js +28 -0
  61. package/dist/copy-button/root/copy-button-root.d.ts +47 -1
  62. package/dist/copy-button/root/copy-button-root.js +44 -8
  63. package/dist/data-table/root/data-table-root.d.ts +150 -2
  64. package/dist/data-table/root/data-table-root.js +303 -29
  65. package/dist/data-table/tree.d.ts +40 -0
  66. package/dist/data-table/tree.js +55 -0
  67. package/dist/date-input/root/date-input-root.d.ts +73 -4
  68. package/dist/date-input/root/date-input-root.js +93 -43
  69. package/dist/date-picker/root/date-picker-root.d.ts +145 -1
  70. package/dist/date-picker/root/date-picker-root.js +239 -48
  71. package/dist/description-list/item/description-list-item.d.ts +17 -2
  72. package/dist/description-list/item/description-list-item.js +15 -2
  73. package/dist/description-list/root/description-list-root.d.ts +27 -1
  74. package/dist/description-list/root/description-list-root.js +26 -1
  75. package/dist/dialog/description.d.ts +9 -0
  76. package/dist/dialog/description.js +14 -0
  77. package/dist/dialog/root/dialog-root.d.ts +64 -1
  78. package/dist/dialog/root/dialog-root.js +49 -23
  79. package/dist/donut-chart/root/donut-chart-root.d.ts +25 -4
  80. package/dist/donut-chart/root/donut-chart-root.js +21 -6
  81. package/dist/drawer/root/drawer-root.d.ts +63 -2
  82. package/dist/drawer/root/drawer-root.js +95 -19
  83. package/dist/drawer/swipe-start.d.ts +9 -0
  84. package/dist/drawer/swipe-start.js +12 -0
  85. package/dist/drilldown/item/drilldown-item.d.ts +11 -6
  86. package/dist/drilldown/item/drilldown-item.js +8 -5
  87. package/dist/drilldown/root/drilldown-root.d.ts +11 -0
  88. package/dist/drilldown/root/drilldown-root.js +8 -3
  89. package/dist/element-events.generated.js +61 -13
  90. package/dist/empty/root/empty-root.d.ts +1 -1
  91. package/dist/file-input/root/file-input-root.d.ts +47 -0
  92. package/dist/file-input/root/file-input-root.js +60 -22
  93. package/dist/file-input/screen.d.ts +35 -0
  94. package/dist/file-input/screen.js +49 -0
  95. package/dist/filter-input/menu/filter-menu.d.ts +3 -0
  96. package/dist/filter-input/menu/filter-menu.js +8 -4
  97. package/dist/filter-input/root/filter-input-root.d.ts +38 -4
  98. package/dist/filter-input/root/filter-input-root.js +67 -3
  99. package/dist/filter-input/suggest.d.ts +17 -0
  100. package/dist/filter-input/suggest.js +23 -0
  101. package/dist/format-date/options.d.ts +33 -0
  102. package/dist/format-date/options.js +42 -0
  103. package/dist/format-date/root/format-date-root.d.ts +51 -0
  104. package/dist/format-date/root/format-date-root.js +58 -38
  105. package/dist/heatmap/root/heatmap-root.d.ts +23 -6
  106. package/dist/heatmap/root/heatmap-root.js +24 -13
  107. package/dist/icon/index.d.ts +2 -0
  108. package/dist/icon/index.js +2 -0
  109. package/dist/icon/registry.d.ts +37 -0
  110. package/dist/icon/registry.js +83 -0
  111. package/dist/icon/root/icon-root.d.ts +30 -4
  112. package/dist/icon/root/icon-root.js +41 -6
  113. package/dist/icon/root/index.d.ts +2 -0
  114. package/dist/icon/root/index.js +2 -0
  115. package/dist/icon/set.d.ts +1 -0
  116. package/dist/icon/set.js +3 -0
  117. package/dist/image/root/image-root.d.ts +14 -0
  118. package/dist/image/root/image-root.js +23 -2
  119. package/dist/input/root/input-root.d.ts +11 -0
  120. package/dist/input/root/input-root.js +16 -1
  121. package/dist/kbd/root/kbd-root.d.ts +20 -13
  122. package/dist/kbd/root/kbd-root.js +35 -37
  123. package/dist/kbd/shortcut.d.ts +18 -0
  124. package/dist/kbd/shortcut.js +35 -0
  125. package/dist/legend/hidden-series.d.ts +8 -0
  126. package/dist/legend/hidden-series.js +13 -0
  127. package/dist/legend/root/legend-root.d.ts +56 -0
  128. package/dist/legend/root/legend-root.js +54 -5
  129. package/dist/lightbox/item/lightbox-item.d.ts +15 -0
  130. package/dist/lightbox/item/lightbox-item.js +10 -1
  131. package/dist/lightbox/root/lightbox-root.d.ts +61 -1
  132. package/dist/lightbox/root/lightbox-root.js +94 -4
  133. package/dist/line-chart/root/line-chart-root.d.ts +11 -3
  134. package/dist/line-chart/root/line-chart-root.js +19 -5
  135. package/dist/list/item/list-item.d.ts +68 -1
  136. package/dist/list/item/list-item.js +66 -4
  137. package/dist/list/numbering.d.ts +14 -0
  138. package/dist/list/numbering.js +8 -0
  139. package/dist/list/root/list-root.d.ts +106 -9
  140. package/dist/list/root/list-root.js +189 -4
  141. package/dist/list/selection.d.ts +19 -0
  142. package/dist/list/selection.js +21 -0
  143. package/dist/listbox/root/listbox-root.d.ts +74 -3
  144. package/dist/listbox/root/listbox-root.js +86 -9
  145. package/dist/loader/busy.d.ts +17 -0
  146. package/dist/loader/busy.js +24 -0
  147. package/dist/loader/root/loader-root.d.ts +37 -0
  148. package/dist/loader/root/loader-root.js +52 -3
  149. package/dist/map/root/map-root.d.ts +6 -2
  150. package/dist/map/root/map-root.js +5 -2
  151. package/dist/megamenu/root/megamenu-root.d.ts +21 -0
  152. package/dist/megamenu/root/megamenu-root.js +16 -2
  153. package/dist/menu/index.d.ts +1 -0
  154. package/dist/menu/index.js +1 -0
  155. package/dist/menu/item/menu-item.d.ts +38 -11
  156. package/dist/menu/item/menu-item.js +33 -1
  157. package/dist/menu/root/menu-root.d.ts +25 -1
  158. package/dist/menu/root/menu-root.js +63 -6
  159. package/dist/menu/section/menu-section.d.ts +55 -0
  160. package/dist/menu/section/menu-section.js +60 -0
  161. package/dist/meter/root/meter-root.d.ts +7 -0
  162. package/dist/meter/root/meter-root.js +6 -3
  163. package/dist/navigation/root/navigation-root.d.ts +16 -1
  164. package/dist/navigation/root/navigation-root.js +27 -1
  165. package/dist/notifications/feed-keys.d.ts +10 -0
  166. package/dist/notifications/feed-keys.js +14 -0
  167. package/dist/notifications/notification/notification.d.ts +17 -0
  168. package/dist/notifications/notification/notification.js +21 -2
  169. package/dist/notifications/root/notifications-root.d.ts +60 -0
  170. package/dist/notifications/root/notifications-root.js +76 -1
  171. package/dist/number-input/root/number-input-root.d.ts +47 -0
  172. package/dist/number-input/root/number-input-root.js +58 -22
  173. package/dist/object-inspector/root/object-inspector-root.d.ts +98 -16
  174. package/dist/object-inspector/root/object-inspector-root.js +180 -80
  175. package/dist/object-inspector/rows.d.ts +57 -0
  176. package/dist/object-inspector/rows.js +86 -0
  177. package/dist/option/root/option-root.d.ts +54 -5
  178. package/dist/option/root/option-root.js +34 -5
  179. package/dist/outline/levels.d.ts +31 -0
  180. package/dist/outline/levels.js +23 -0
  181. package/dist/outline/root/outline-root.d.ts +68 -3
  182. package/dist/outline/root/outline-root.js +73 -8
  183. package/dist/pagination/size/pagination-size.d.ts +11 -2
  184. package/dist/pagination/size/pagination-size.js +19 -4
  185. package/dist/pin-input/format.d.ts +7 -0
  186. package/dist/pin-input/format.js +16 -0
  187. package/dist/pin-input/root/pin-input-root.d.ts +21 -0
  188. package/dist/pin-input/root/pin-input-root.js +29 -2
  189. package/dist/popover/root/popover-root.d.ts +62 -4
  190. package/dist/popover/root/popover-root.js +53 -5
  191. package/dist/progress/root/progress-root.d.ts +7 -0
  192. package/dist/progress/root/progress-root.js +9 -3
  193. package/dist/qr-code/export.d.ts +31 -0
  194. package/dist/qr-code/export.js +10 -0
  195. package/dist/qr-code/root/qr-code-root.d.ts +26 -0
  196. package/dist/qr-code/root/qr-code-root.js +49 -2
  197. package/dist/radio/group/radio-group.d.ts +17 -0
  198. package/dist/radio/group/radio-group.js +14 -1
  199. package/dist/rating/root/rating-root.d.ts +25 -0
  200. package/dist/rating/root/rating-root.js +46 -4
  201. package/dist/scatter-chart/root/scatter-chart-root.d.ts +17 -3
  202. package/dist/scatter-chart/root/scatter-chart-root.js +25 -7
  203. package/dist/scroll-area/root/scroll-area-root.d.ts +113 -0
  204. package/dist/scroll-area/root/scroll-area-root.js +218 -3
  205. package/dist/scroll-area/scrollbar.d.ts +65 -0
  206. package/dist/scroll-area/scrollbar.js +24 -0
  207. package/dist/select/root/select-root.d.ts +24 -0
  208. package/dist/select/root/select-root.js +21 -7
  209. package/dist/skeleton/root/skeleton-root.d.ts +25 -0
  210. package/dist/skeleton/root/skeleton-root.js +17 -2
  211. package/dist/slider/root/slider-root.d.ts +39 -0
  212. package/dist/slider/root/slider-root.js +45 -9
  213. package/dist/splitter/root/splitter-root.d.ts +13 -0
  214. package/dist/splitter/root/splitter-root.js +20 -2
  215. package/dist/splitter/snap.d.ts +9 -0
  216. package/dist/splitter/snap.js +12 -0
  217. package/dist/stat/root/stat-root.d.ts +2 -0
  218. package/dist/stat/root/stat-root.js +1 -1
  219. package/dist/steps/reach.d.ts +15 -0
  220. package/dist/steps/reach.js +12 -0
  221. package/dist/steps/root/steps-root.d.ts +30 -0
  222. package/dist/steps/root/steps-root.js +53 -0
  223. package/dist/steps/step/step.d.ts +39 -2
  224. package/dist/steps/step/step.js +29 -7
  225. package/dist/switch/root/switch-root.d.ts +12 -2
  226. package/dist/switch/root/switch-root.js +6 -1
  227. package/dist/table/column/table-column.d.ts +11 -0
  228. package/dist/table/column/table-column.js +6 -1
  229. package/dist/table/root/table-root.d.ts +101 -0
  230. package/dist/table/root/table-root.js +166 -5
  231. package/dist/table/row/table-row.d.ts +47 -1
  232. package/dist/table/row/table-row.js +39 -2
  233. package/dist/tabs/panel/tab-panel.d.ts +9 -5
  234. package/dist/tabs/panel/tab-panel.js +3 -4
  235. package/dist/tabs/root/tabs-root.d.ts +25 -1
  236. package/dist/tabs/root/tabs-root.js +21 -3
  237. package/dist/tabs/tab/tab.d.ts +36 -4
  238. package/dist/tabs/tab/tab.js +46 -3
  239. package/dist/tag/group/tag-group.d.ts +107 -0
  240. package/dist/tag/group/tag-group.js +157 -0
  241. package/dist/tag/index.d.ts +1 -0
  242. package/dist/tag/index.js +1 -0
  243. package/dist/tag/root/tag-root.d.ts +60 -0
  244. package/dist/tag/root/tag-root.js +74 -18
  245. package/dist/tag/selection.d.ts +10 -0
  246. package/dist/tag/selection.js +12 -0
  247. package/dist/textarea/grow.d.ts +22 -0
  248. package/dist/textarea/grow.js +20 -0
  249. package/dist/textarea/root/textarea-root.d.ts +9 -0
  250. package/dist/textarea/root/textarea-root.js +9 -1
  251. package/dist/time-input/root/time-input-root.d.ts +44 -5
  252. package/dist/time-input/root/time-input-root.js +69 -39
  253. package/dist/time-picker/root/time-picker-root.d.ts +54 -8
  254. package/dist/time-picker/root/time-picker-root.js +121 -91
  255. package/dist/timeline/group/timeline-group.d.ts +46 -0
  256. package/dist/timeline/group/timeline-group.js +37 -0
  257. package/dist/timeline/index.d.ts +1 -0
  258. package/dist/timeline/index.js +1 -0
  259. package/dist/timeline/root/timeline-root.d.ts +10 -3
  260. package/dist/toast/hotkey.d.ts +22 -0
  261. package/dist/toast/hotkey.js +23 -0
  262. package/dist/toast/item/toast-item.d.ts +26 -18
  263. package/dist/toast/item/toast-item.js +55 -48
  264. package/dist/toast/root/toast-root.d.ts +42 -8
  265. package/dist/toast/root/toast-root.js +64 -4
  266. package/dist/toggle/group/toggle-group.d.ts +57 -15
  267. package/dist/toggle/group/toggle-group.js +69 -9
  268. package/dist/toggle/root/toggle-root.d.ts +12 -1
  269. package/dist/toggle/root/toggle-root.js +11 -3
  270. package/dist/toolbar/root/toolbar-root.d.ts +13 -0
  271. package/dist/toolbar/root/toolbar-root.js +15 -5
  272. package/dist/tooltip/focus-target.d.ts +6 -0
  273. package/dist/tooltip/focus-target.js +9 -0
  274. package/dist/tooltip/root/tooltip-root.d.ts +42 -17
  275. package/dist/tooltip/root/tooltip-root.js +50 -9
  276. package/dist/tour/naming.d.ts +30 -0
  277. package/dist/tour/naming.js +10 -0
  278. package/dist/tour/root/tour-root.d.ts +35 -0
  279. package/dist/tour/root/tour-root.js +56 -5
  280. package/dist/tour/stop/tour-stop.d.ts +53 -8
  281. package/dist/tour/stop/tour-stop.js +45 -15
  282. package/dist/tour/wait.d.ts +11 -0
  283. package/dist/tour/wait.js +19 -0
  284. package/dist/tree/item/tree-item.d.ts +54 -1
  285. package/dist/tree/item/tree-item.js +89 -20
  286. package/dist/tree/root/tree-root.d.ts +37 -0
  287. package/dist/tree/root/tree-root.js +51 -6
  288. package/dist/tree/selection.d.ts +24 -0
  289. package/dist/tree/selection.js +26 -0
  290. package/dist/trend/root/trend-root.d.ts +13 -0
  291. package/dist/trend/root/trend-root.js +14 -9
  292. package/dist/video/media-events.d.ts +49 -0
  293. package/dist/video/media-events.js +39 -0
  294. package/dist/video/root/video-root.d.ts +99 -13
  295. package/dist/video/root/video-root.js +84 -47
  296. package/dist/video-playlist/menu/video-playlist-menu.d.ts +3 -0
  297. package/dist/video-playlist/menu/video-playlist-menu.js +2 -1
  298. package/dist/video-playlist/order.d.ts +41 -0
  299. package/dist/video-playlist/order.js +34 -0
  300. package/dist/video-playlist/root/video-playlist-root.d.ts +70 -2
  301. package/dist/video-playlist/root/video-playlist-root.js +60 -16
  302. package/dist/virtual-list/controls.d.ts +4 -0
  303. package/dist/virtual-list/controls.js +30 -0
  304. package/dist/virtual-list/fill.d.ts +30 -0
  305. package/dist/virtual-list/fill.js +39 -0
  306. package/dist/virtual-list/keys.d.ts +15 -0
  307. package/dist/virtual-list/keys.js +24 -0
  308. package/dist/virtual-list/root/virtual-list-root.d.ts +155 -23
  309. package/dist/virtual-list/root/virtual-list-root.js +175 -34
  310. package/lint.json +1 -1
  311. package/package.json +5 -5
  312. package/types/jsx.d.ts +8871 -1286
  313. package/types/svelte.d.ts +3 -0
  314. package/types/vue.d.ts +1918 -269
@@ -610,6 +610,10 @@ let HelixHeadlessCanvas = class HelixHeadlessCanvas extends MixinViewport(HelixE
610
610
  this.requestUpdate();
611
611
  };
612
612
  }
613
+ static { this.shadowRootOptions = {
614
+ ...HelixElement.shadowRootOptions,
615
+ slotAssignment: 'manual',
616
+ }; }
613
617
  get box() {
614
618
  const viewport = this.renderRoot?.querySelector('[part="viewport"]');
615
619
  return {
@@ -1530,6 +1534,12 @@ let HelixHeadlessCanvas = class HelixHeadlessCanvas extends MixinViewport(HelixE
1530
1534
  updated(changed) {
1531
1535
  this.keying = undefined;
1532
1536
  super.updated(changed);
1537
+ this.assign();
1538
+ const edge = this.focusedEdge;
1539
+ this.focusedEdge = undefined;
1540
+ if (edge && (!edge.target.isConnected || edge.target.getAttribute('data-edge') !== edge.key)) {
1541
+ this.focusStop(edge.key);
1542
+ }
1533
1543
  if (this.holding && !this.held) {
1534
1544
  this.letGo();
1535
1545
  }
@@ -1661,6 +1671,11 @@ let HelixHeadlessCanvas = class HelixHeadlessCanvas extends MixinViewport(HelixE
1661
1671
  willUpdate(changed) {
1662
1672
  this.keying = this.keyAll();
1663
1673
  super.willUpdate(changed);
1674
+ const focused = this.ownerDocument?.activeElement === this
1675
+ ? this.renderRoot.activeElement
1676
+ : undefined;
1677
+ const key = focused?.getAttribute?.('data-edge');
1678
+ this.focusedEdge = focused && key ? { key, target: focused } : undefined;
1664
1679
  const drawn = extent(this.nodes);
1665
1680
  const origin = { x: drawn.x - MARGIN, y: drawn.y - MARGIN };
1666
1681
  if (this.origin && (origin.x !== this.origin.x || origin.y !== this.origin.y)) {
@@ -1732,9 +1747,6 @@ let HelixHeadlessCanvas = class HelixHeadlessCanvas extends MixinViewport(HelixE
1732
1747
  });
1733
1748
  }
1734
1749
  renderEdges(origin, box) {
1735
- const elements = new Map(this.edgeElements.map((child) => [this.keyOfElement(child), child]));
1736
- const stop = this.stop !== undefined && this.keyNamed(this.stop) === this.stop ? this.stop : undefined;
1737
- const pickedKeys = new Set(this.picked);
1738
1750
  return html `<svg
1739
1751
  part="edges"
1740
1752
  role="none"
@@ -1755,46 +1767,114 @@ let HelixHeadlessCanvas = class HelixHeadlessCanvas extends MixinViewport(HelixE
1755
1767
  <path part="arrow" d="M0 0 L8 4 L0 8 z" />
1756
1768
  </marker>
1757
1769
  </defs>
1758
- ${this.edges.map((edge) => {
1759
- const key = this.keyOf(edge);
1760
- const element = elements.get(key);
1761
- const drawn = this.geometryOf(edge, origin);
1762
- const lifted = this.linking?.edge === key && !this.linking.pressed;
1763
- if (!drawn || (lifted && this.linking?.pointer !== undefined)) {
1764
- return nothing;
1765
- }
1766
- const { from, to } = drawn;
1767
- const ends = heads(edge);
1768
- return svg `<path
1769
- part="edge-target"
1770
- aria-description=${[element?.tone ? this.toneLabels[element.tone] : undefined, edge.label].filter(Boolean).join(', ') || nothing}
1771
- aria-label=${fillTemplate(this.connectionLabel, { from: this.textOf(from), to: this.textOf(to) })}
1772
- d=${drawn.d}
1773
- data-edge=${key}
1774
- fill="none"
1775
- aria-keyshortcuts="Enter F2 C Delete"
1776
- role="button"
1777
- tabindex=${key === stop ? '0' : '-1'}
1778
- />
1779
- ${lifted
1780
- ? nothing
1781
- : svg `<path
1782
- part="edge"
1783
- aria-hidden="true"
1784
- d=${drawn.d}
1785
- data-selected=${pickedKeys.has(key) ? '' : nothing}
1786
- data-tone=${element?.tone ?? nothing}
1787
- data-variant=${element?.variant ?? nothing}
1788
- fill="none"
1789
- marker-end=${ends.end ? `url(#${ARROW})` : nothing}
1790
- marker-start=${ends.start ? `url(#${ARROW})` : nothing}
1791
- style=${custom(element, '--canvas-edge-color') ? `--_canvas-edge-color: ${custom(element, '--canvas-edge-color')}` : nothing}
1792
- />`}
1793
- `;
1794
- })}
1795
1770
  ${this.renderDraft(origin)}
1796
1771
  </svg>`;
1797
1772
  }
1773
+ renderStops(origin, box) {
1774
+ const elements = new Map(this.edgeElements.map((child) => [this.keyOfElement(child), child]));
1775
+ const stop = this.stop !== undefined && this.keyNamed(this.stop) === this.stop ? this.stop : undefined;
1776
+ const picked = new Set(this.picked);
1777
+ const groups = [];
1778
+ for (const one of this.walk) {
1779
+ if (one.kind === 'node') {
1780
+ groups.push({ edges: [], key: one.key });
1781
+ }
1782
+ else {
1783
+ groups.at(-1)?.edges.push(one.edge);
1784
+ }
1785
+ }
1786
+ return groups.map(({ edges }, at) => html `<slot name=${`card-${at}`}></slot>${edges.length === 0
1787
+ ? nothing
1788
+ : html `<svg
1789
+ part="edges"
1790
+ role="none"
1791
+ viewBox=${`0 0 ${box.width} ${box.height}`}
1792
+ width=${box.width}
1793
+ height=${box.height}
1794
+ >
1795
+ ${edges.map((edge) => this.renderEdge(edge, origin, elements, stop, picked))}
1796
+ </svg>`}`);
1797
+ }
1798
+ renderEdge(edge, origin, elements, stop, pickedKeys) {
1799
+ const key = this.keyOf(edge);
1800
+ const element = elements.get(key);
1801
+ const drawn = this.geometryOf(edge, origin);
1802
+ const lifted = this.linking?.edge === key && !this.linking.pressed;
1803
+ if (!drawn || (lifted && this.linking?.pointer !== undefined)) {
1804
+ return nothing;
1805
+ }
1806
+ const { from, to } = drawn;
1807
+ const ends = heads(edge);
1808
+ return svg `<path
1809
+ part="edge-target"
1810
+ aria-description=${[element?.tone ? this.toneLabels[element.tone] : undefined, edge.label].filter(Boolean).join(', ') || nothing}
1811
+ aria-label=${fillTemplate(this.connectionLabel, { from: this.textOf(from), to: this.textOf(to) })}
1812
+ d=${drawn.d}
1813
+ data-edge=${key}
1814
+ fill="none"
1815
+ aria-keyshortcuts="Enter F2 C Delete"
1816
+ role="button"
1817
+ tabindex=${key === stop ? '0' : '-1'}
1818
+ />
1819
+ ${lifted
1820
+ ? nothing
1821
+ : svg `<path
1822
+ part="edge"
1823
+ aria-hidden="true"
1824
+ d=${drawn.d}
1825
+ data-selected=${pickedKeys.has(key) ? '' : nothing}
1826
+ data-tone=${element?.tone ?? nothing}
1827
+ data-variant=${element?.variant ?? nothing}
1828
+ fill="none"
1829
+ marker-end=${ends.end ? `url(#${ARROW})` : nothing}
1830
+ marker-start=${ends.start ? `url(#${ARROW})` : nothing}
1831
+ style=${custom(element, '--canvas-edge-color') ? `--_canvas-edge-color: ${custom(element, '--canvas-edge-color')}` : nothing}
1832
+ />`}
1833
+ `;
1834
+ }
1835
+ assign() {
1836
+ if (!this.childrenKnown) {
1837
+ return;
1838
+ }
1839
+ const cards = new Map();
1840
+ for (const card of this.cards) {
1841
+ if (!cards.has(card.name)) {
1842
+ cards.set(card.name, card);
1843
+ }
1844
+ }
1845
+ const placed = new Map();
1846
+ for (const [at, one] of this.walk.filter((stop) => stop.kind === 'node').entries()) {
1847
+ const card = cards.get(one.key);
1848
+ if (card) {
1849
+ placed.set(card, `card-${at}`);
1850
+ }
1851
+ }
1852
+ if (this.assignsByName) {
1853
+ for (const card of this.cards) {
1854
+ this.route(card, placed.get(card));
1855
+ }
1856
+ return;
1857
+ }
1858
+ const root = this.renderRoot;
1859
+ const rest = [];
1860
+ const named = new Map();
1861
+ for (const child of this.knownChildren) {
1862
+ const name = placed.get(child) ?? child.getAttribute('slot') ?? undefined;
1863
+ if (name === undefined) {
1864
+ rest.push(child);
1865
+ }
1866
+ else {
1867
+ named.set(name, [...(named.get(name) ?? []), child]);
1868
+ }
1869
+ }
1870
+ for (const slot of root?.querySelectorAll?.('slot') ?? []) {
1871
+ const wanted = slot.name === '' ? rest : (named.get(slot.name) ?? []);
1872
+ const had = slot.assignedNodes();
1873
+ if (had.length !== wanted.length || had.some((one, at) => one !== wanted[at])) {
1874
+ slot.assign?.(...wanted);
1875
+ }
1876
+ }
1877
+ }
1798
1878
  renderLabels(origin) {
1799
1879
  return this.edges.map((edge) => {
1800
1880
  const lifted = this.linking?.edge === this.keyOf(edge) && !this.linking.pressed;
@@ -1903,6 +1983,7 @@ let HelixHeadlessCanvas = class HelixHeadlessCanvas extends MixinViewport(HelixE
1903
1983
  @focusin=${this.handleFocusIn}
1904
1984
  >
1905
1985
  ${this.renderEdges(origin, box)} ${this.renderLabels(origin)}
1986
+ ${this.renderStops(origin, box)}
1906
1987
  <slot @slotchange=${this.handleSlotChange}></slot>
1907
1988
  ${this.renderEnds(origin)}
1908
1989
  ${this.renderEditor(origin)}
@@ -14,7 +14,15 @@ import { type PropertyValues, type TemplateResult } from 'lit';
14
14
  *
15
15
  * Name the card with `aria-label` or `aria-labelledby`. These are the only
16
16
  * names that work with server rendering, because reading a title from the light
17
- * DOM needs a DOM, and the server has none.
17
+ * DOM needs a DOM, and the server has none. **A named card is a group**, so a
18
+ * reader entering it hears its name; an unnamed one has no role, since a group
19
+ * with no name only adds "group" to what a reader says.
20
+ *
21
+ * `header-actions` and `footer-actions` hold controls at the end of the
22
+ * header's and the footer's line, as Web Awesome's card does. While one holds
23
+ * something, its line is a `header-row` or `footer-row` part; otherwise there
24
+ * is no wrapper and every region is a bare slot. A server cannot see slotted
25
+ * content, so served actions sit on their own line until the script runs.
18
26
  *
19
27
  * @since 0.1.0
20
28
  * @status stable
@@ -24,8 +32,13 @@ import { type PropertyValues, type TemplateResult } from 'lit';
24
32
  *
25
33
  * @slot - The card's main content.
26
34
  * @slot footer - Actions that conclude the card.
35
+ * @slot footer-actions - Controls at the end of the footer's line, with the footer at its start.
27
36
  * @slot header - Title and any actions for the whole card.
37
+ * @slot header-actions - Controls for the whole card at the end of the header's line, such as a menu.
28
38
  * @slot media - Image, video, or chart that runs edge to edge, outside the inset.
39
+ *
40
+ * @csspart footer-row - The line holding `footer` and `footer-actions`, drawn only while `footer-actions` holds something.
41
+ * @csspart header-row - The line holding `header` and `header-actions`, drawn only while `header-actions` holds something.
29
42
  */
30
43
  export declare class HelixHeadlessCard extends HelixElement {
31
44
  /**
@@ -42,7 +55,23 @@ export declare class HelixHeadlessCard extends HelixElement {
42
55
  * with no attribute on it and the stylesheet only describes the departure.
43
56
  */
44
57
  mediaPlacement?: 'end';
58
+ /**
59
+ * @internal The host's `aria-labelledby`, observed so the card becomes a
60
+ * group once it is named. Not reflected: the attribute is the consumer's.
61
+ */
62
+ protected labelledBy: string | null;
63
+ /**
64
+ * @internal The host's `aria-label`, observed for the same reason as
65
+ * `labelledBy`. Not reflected: the attribute is the consumer's.
66
+ */
67
+ protected namedBy: string | null;
68
+ /** Whether `footer-actions` holds something, read from the slot. */
69
+ private footerActions;
70
+ /** Whether `header-actions` holds something, read from the slot. */
71
+ private headerActions;
45
72
  protected willUpdate(changed: PropertyValues): void;
73
+ protected updated(changed: PropertyValues): void;
74
+ private readonly readActions;
46
75
  protected render(): TemplateResult;
47
76
  }
48
77
  declare global {
@@ -4,26 +4,59 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
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
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { customElement, HelixElement, hostAria } from '@fusion.dev/helix-core';
7
+ import { customElement, HelixElement, hostAria, slotFilled } from '@fusion.dev/helix-core';
8
8
  import { html } from 'lit';
9
- import { property } from 'lit/decorators.js';
9
+ import { property, state } from 'lit/decorators.js';
10
10
  let HelixHeadlessCard = class HelixHeadlessCard extends HelixElement {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.labelledBy = null;
14
+ this.namedBy = null;
15
+ this.footerActions = false;
16
+ this.headerActions = false;
17
+ this.readActions = () => {
18
+ const filled = (name) => slotFilled(this.renderRoot?.querySelector(`slot[name="${name}"]`));
19
+ this.headerActions = filled('header-actions');
20
+ this.footerActions = filled('footer-actions');
21
+ };
22
+ }
11
23
  willUpdate(changed) {
12
24
  super.willUpdate(changed);
13
- hostAria(this.internals, { role: 'group' });
25
+ const named = Boolean(this.namedBy?.trim() || this.labelledBy?.trim());
26
+ hostAria(this.internals, { role: named ? 'group' : '' });
27
+ }
28
+ updated(changed) {
29
+ super.updated(changed);
30
+ this.readActions();
14
31
  }
15
32
  render() {
33
+ const header = html `<slot name="header"></slot
34
+ ><slot name="header-actions" @slotchange=${this.readActions}></slot>`;
35
+ const footer = html `<slot name="footer"></slot
36
+ ><slot name="footer-actions" @slotchange=${this.readActions}></slot>`;
16
37
  return html `
17
38
  <slot name="media"></slot>
18
- <slot name="header"></slot>
39
+ ${this.headerActions ? html `<div part="header-row">${header}</div>` : header}
19
40
  <slot></slot>
20
- <slot name="footer"></slot>
41
+ ${this.footerActions ? html `<div part="footer-row">${footer}</div>` : footer}
21
42
  `;
22
43
  }
23
44
  };
24
45
  __decorate([
25
46
  property({ attribute: 'media-placement', reflect: true })
26
47
  ], HelixHeadlessCard.prototype, "mediaPlacement", void 0);
48
+ __decorate([
49
+ property({ attribute: 'aria-labelledby' })
50
+ ], HelixHeadlessCard.prototype, "labelledBy", void 0);
51
+ __decorate([
52
+ property({ attribute: 'aria-label' })
53
+ ], HelixHeadlessCard.prototype, "namedBy", void 0);
54
+ __decorate([
55
+ state()
56
+ ], HelixHeadlessCard.prototype, "footerActions", void 0);
57
+ __decorate([
58
+ state()
59
+ ], HelixHeadlessCard.prototype, "headerActions", void 0);
27
60
  HelixHeadlessCard = __decorate([
28
61
  customElement('helix-headless-card')
29
62
  ], HelixHeadlessCard);
@@ -29,6 +29,15 @@ import { type PropertyValues, type TemplateResult } from 'lit';
29
29
  * and the last. Without `loop`, Previous on the first slide and Next on the
30
30
  * last are marked `aria-disabled`.
31
31
  *
32
+ * **`mouse-drag` lets a mouse drag the track**, which otherwise only a touch
33
+ * screen, a trackpad, or the scroll wheel moves. The drag follows the pointer
34
+ * with snapping off and settles on the nearest slide when it is let go, and
35
+ * that move is announced and refusable like a press of Next. A link in a slide
36
+ * is not followed at the end of a drag.
37
+ *
38
+ * The glyphs on Previous and Next can be replaced by slotting an icon of your
39
+ * own into `previous-icon` and `next-icon`.
40
+ *
32
41
  * @since 0.1.0
33
42
  * @status stable
34
43
  * @category layout
@@ -36,6 +45,8 @@ import { type PropertyValues, type TemplateResult } from 'lit';
36
45
  * @documentation https://fusion.dev/helix/components/carousel
37
46
  *
38
47
  * @slot - The slides.
48
+ * @slot next-icon - The glyph on the control that moves to the next slide. Defaults to a caret.
49
+ * @slot previous-icon - The glyph on the control that moves to the previous slide. Defaults to a caret.
39
50
  *
40
51
  * @event {HelixActivateEvent} helix-activate - Fired after the slide in view changes, with the new index as a string in `detail.value`.
41
52
  * @event {HelixSelectEvent} helix-select - Fired before the slide in view changes, with the requested index. Cancelable: cancel it to keep the current slide. Nothing moves, and a drag returns to the slide the index still holds. See `handleScroll`.
@@ -59,6 +70,8 @@ import { type PropertyValues, type TemplateResult } from 'lit';
59
70
  * @cssproperty --carousel-per-view - How many slides go across. The component writes it onto the track, so your stylesheet divides the track by the same number the component counts positions from. Read this property to follow `per-view`, because attribute selectors cannot cover every possible count. Under `per-view="auto"` the component writes nothing and your stylesheet declares it, so the same name works in both modes. See `perView`.
60
71
  * @cssproperty --carousel-run-end - How far short of a whole pixel the run ends, set on the last slide only. Your stylesheet applies it as `margin-inline-end`. See `runEnd`.
61
72
  * @cssproperty --carousel-slide-min - The narrowest a slide may be. `per-view="auto"` uses it to fit slides into the track. It must be a length, because the stylesheet divides by it. When unset, it is the whole track, which shows one slide across.
73
+ *
74
+ * @cssstate dragging - While a mouse drags the track, under `mouse-drag`.
62
75
  */
63
76
  export declare class HelixHeadlessCarousel extends HelixElement {
64
77
  /**
@@ -154,6 +167,14 @@ export declare class HelixHeadlessCarousel extends HelixElement {
154
167
  * Whether moving past either end wraps to the other.
155
168
  */
156
169
  loop: boolean;
170
+ /**
171
+ * Whether a mouse can drag the track from slide to slide.
172
+ *
173
+ * Off unless asked for, because a press on a slide is then the start of a
174
+ * drag, and text in a slide can no longer be selected with the mouse. A drag
175
+ * of a few pixels or less is still a press.
176
+ */
177
+ mouseDrag: boolean;
157
178
  /**
158
179
  * The name of the control that moves to the next slide.
159
180
  */
@@ -246,6 +267,12 @@ export declare class HelixHeadlessCarousel extends HelixElement {
246
267
  * The name of the control that moves to the previous slide.
247
268
  */
248
269
  previousLabel: string;
270
+ /**
271
+ * The word screen readers announce in place of the carousel's role, set as
272
+ * `aria-roledescription`. Translate it with the rest of your text, or empty
273
+ * it to leave the role as `group`.
274
+ */
275
+ roleLabel: string;
249
276
  /**
250
277
  * The name of each slide, with `{index}` and `{count}` filled in.
251
278
  */
@@ -386,6 +413,25 @@ export declare class HelixHeadlessCarousel extends HelixElement {
386
413
  * in exactly as the inline one did.
387
414
  */
388
415
  private handed;
416
+ /**
417
+ * The track's inline style: the count above, and snapping off while a mouse
418
+ * drags it.
419
+ *
420
+ * **Inline, because the drag does not work without it.** A track that snaps
421
+ * puts every scroll the drag asks for back on the nearest slide, so the
422
+ * slides jump from one to the next under the pointer. A stylesheet cannot be
423
+ * relied on to turn snapping off, since the headless tier has none, so the
424
+ * component says it for the length of the drag and no longer.
425
+ *
426
+ * **And `!important`, because a document rule beats a shadow root's inline
427
+ * style.** The style attribute is in the shadow tree's context, and a
428
+ * consumer's `::part(track)` rule is in the document's, which wins every
429
+ * normal declaration. Measured in Chromium on a headless track snapping from
430
+ * the document: the inline `none` was there and the computed value stayed
431
+ * `x mandatory`, and the drag never moved the track. An important
432
+ * declaration sorts the other way, the inner context first.
433
+ */
434
+ private trackStyle;
389
435
  /** What the box resolved to, and `undefined` until it has been laid out. */
390
436
  private fitted;
391
437
  /** Watches the pane a fitted track laid out, while `auto` is what was asked. */
@@ -425,6 +471,8 @@ export declare class HelixHeadlessCarousel extends HelixElement {
425
471
  private get panes();
426
472
  /** The slides, in light-DOM order. Empty on the server, which has no tree. */
427
473
  get slides(): HTMLElement[];
474
+ /** What a consumer slotted into one of the arrows' glyph slots. */
475
+ private iconsFor;
428
476
  /**
429
477
  * The arrows move between indicators, which is the tablist pattern.
430
478
  *
@@ -509,6 +557,38 @@ export declare class HelixHeadlessCarousel extends HelixElement {
509
557
  */
510
558
  private settling;
511
559
  private readonly handleTake;
560
+ /** Whether a mouse is dragging the track. */
561
+ private dragging;
562
+ /** A mouse pressed on the track under `mouse-drag`, from where it pressed. */
563
+ private pull;
564
+ /** Takes the press, and under `mouse-drag` the start of a drag. */
565
+ private readonly handlePress;
566
+ /**
567
+ * Moves the track with the pointer.
568
+ *
569
+ * Not until the pointer has moved a few pixels, so a press on a link or a
570
+ * button in a slide stays a press. Instant scrolls, since a smooth one would
571
+ * trail the pointer.
572
+ */
573
+ private readonly handlePull;
574
+ /**
575
+ * Lets go of the track, and settles on the slide nearest to where it was let
576
+ * go.
577
+ *
578
+ * Through the same request as a press of Next, so the move is refusable,
579
+ * sends `helix-activate`, and is announced. A refusal, or a drag that ends on
580
+ * the slide it began on, goes back to that slide once snapping is on again.
581
+ */
582
+ private readonly handleLetGo;
583
+ /**
584
+ * Keeps the click that ends a drag from following a link in the slide.
585
+ *
586
+ * Once, in capture on the track, and given up a moment later where no click
587
+ * comes, which is a drag let go off the track.
588
+ */
589
+ private swallowClick;
590
+ /** Keeps a mouse drag from picking up a link or an image under `mouse-drag`. */
591
+ private readonly handleDragStart;
512
592
  /**
513
593
  * Stops rotation for good.
514
594
  *
@@ -705,6 +785,16 @@ export declare class HelixHeadlessCarousel extends HelixElement {
705
785
  * server, which knows no slides and so no ends.
706
786
  */
707
787
  private atEnd;
788
+ /**
789
+ * The glyph on Previous: the `previous-icon` slot, holding a caret until
790
+ * something is slotted. A tier above overrides this to draw its own caret.
791
+ */
792
+ protected renderPreviousMark(): TemplateResult;
793
+ /**
794
+ * The glyph on Next: the `next-icon` slot, holding a caret until something
795
+ * is slotted. A tier above overrides this to draw its own caret.
796
+ */
797
+ protected renderNextMark(): TemplateResult;
708
798
  protected render(): TemplateResult;
709
799
  }
710
800
  declare global {