@fusion.dev/helix-headless 0.142.1 → 0.144.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 (285) hide show
  1. package/custom-elements.json +25381 -1202
  2. package/dist/accordion/item/accordion-item.d.ts +38 -2
  3. package/dist/accordion/item/accordion-item.js +38 -6
  4. package/dist/accordion/root/accordion-root.d.ts +23 -1
  5. package/dist/accordion/root/accordion-root.js +39 -3
  6. package/dist/announcement/root/announcement-root.d.ts +11 -7
  7. package/dist/announcement/root/announcement-root.js +1 -1
  8. package/dist/app-header/root/app-header-root.d.ts +21 -0
  9. package/dist/app-header/root/app-header-root.js +31 -5
  10. package/dist/area-chart/root/area-chart-root.d.ts +12 -4
  11. package/dist/area-chart/root/area-chart-root.js +39 -11
  12. package/dist/avatar/group/avatar-group.d.ts +24 -3
  13. package/dist/avatar/group/avatar-group.js +34 -2
  14. package/dist/avatar/root/avatar-root.d.ts +17 -1
  15. package/dist/avatar/root/avatar-root.js +31 -10
  16. package/dist/badge/root/badge-root.d.ts +12 -0
  17. package/dist/badge/root/badge-root.js +1 -1
  18. package/dist/bar-chart/root/bar-chart-root.d.ts +30 -5
  19. package/dist/bar-chart/root/bar-chart-root.js +58 -21
  20. package/dist/blockquote/root/blockquote-root.d.ts +12 -7
  21. package/dist/blockquote/root/blockquote-root.js +6 -4
  22. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +9 -3
  23. package/dist/breadcrumbs/root/breadcrumbs-root.js +9 -1
  24. package/dist/button/root/button-root.d.ts +84 -1
  25. package/dist/button/root/button-root.js +81 -3
  26. package/dist/callout/root/callout-root.d.ts +32 -6
  27. package/dist/callout/root/callout-root.js +26 -7
  28. package/dist/canvas/root/canvas-root.d.ts +1 -0
  29. package/dist/canvas/root/canvas-root.js +10 -1
  30. package/dist/card/root/card-root.d.ts +30 -1
  31. package/dist/card/root/card-root.js +38 -5
  32. package/dist/carousel/root/carousel-root.d.ts +47 -5
  33. package/dist/carousel/root/carousel-root.js +53 -21
  34. package/dist/chat/composer/chat-composer.d.ts +13 -11
  35. package/dist/chat/composer/chat-composer.js +6 -12
  36. package/dist/chat/message/chat-message.js +8 -1
  37. package/dist/chat/root/chat-root.d.ts +1 -0
  38. package/dist/chat/root/chat-root.js +2 -1
  39. package/dist/checkbox/root/checkbox-root.d.ts +7 -0
  40. package/dist/checkbox/root/checkbox-root.js +9 -3
  41. package/dist/checkbox-group/root/checkbox-group-root.d.ts +116 -33
  42. package/dist/checkbox-group/root/checkbox-group-root.js +141 -44
  43. package/dist/code/root/code-root.d.ts +1 -1
  44. package/dist/code-block/lines.d.ts +13 -0
  45. package/dist/code-block/lines.js +2 -0
  46. package/dist/code-block/root/code-block-root.d.ts +49 -0
  47. package/dist/code-block/root/code-block-root.js +44 -3
  48. package/dist/color-input/root/color-input-root.d.ts +60 -2
  49. package/dist/color-input/root/color-input-root.js +55 -7
  50. package/dist/color-picker/channels.d.ts +26 -0
  51. package/dist/color-picker/channels.js +84 -0
  52. package/dist/color-picker/root/color-picker-root.d.ts +118 -12
  53. package/dist/color-picker/root/color-picker-root.js +183 -13
  54. package/dist/combobox/root/combobox-root.d.ts +126 -3
  55. package/dist/combobox/root/combobox-root.js +224 -21
  56. package/dist/command/root/command-root.d.ts +47 -10
  57. package/dist/command/root/command-root.js +45 -4
  58. package/dist/copy-button/from.d.ts +22 -0
  59. package/dist/copy-button/from.js +28 -0
  60. package/dist/copy-button/root/copy-button-root.d.ts +48 -7
  61. package/dist/copy-button/root/copy-button-root.js +54 -8
  62. package/dist/data-table/root/data-table-root.d.ts +164 -10
  63. package/dist/data-table/root/data-table-root.js +488 -57
  64. package/dist/date-input/root/date-input-root.d.ts +123 -9
  65. package/dist/date-input/root/date-input-root.js +147 -45
  66. package/dist/date-picker/root/date-picker-root.d.ts +229 -18
  67. package/dist/date-picker/root/date-picker-root.js +342 -46
  68. package/dist/dialog/description.d.ts +9 -0
  69. package/dist/dialog/description.js +14 -0
  70. package/dist/dialog/root/dialog-root.d.ts +101 -10
  71. package/dist/dialog/root/dialog-root.js +83 -4
  72. package/dist/donut-chart/root/donut-chart-root.d.ts +61 -16
  73. package/dist/donut-chart/root/donut-chart-root.js +48 -13
  74. package/dist/drawer/root/drawer-root.d.ts +93 -7
  75. package/dist/drawer/root/drawer-root.js +126 -5
  76. package/dist/drawer/swipe-start.d.ts +9 -0
  77. package/dist/drawer/swipe-start.js +12 -0
  78. package/dist/drilldown/item/drilldown-item.d.ts +16 -13
  79. package/dist/drilldown/item/drilldown-item.js +6 -2
  80. package/dist/drilldown/root/drilldown-root.d.ts +21 -5
  81. package/dist/drilldown/root/drilldown-root.js +26 -10
  82. package/dist/element-events.generated.js +42 -13
  83. package/dist/empty/root/empty-root.d.ts +1 -1
  84. package/dist/file-input/root/file-input-root.d.ts +65 -1
  85. package/dist/file-input/root/file-input-root.js +76 -12
  86. package/dist/file-input/screen.d.ts +35 -0
  87. package/dist/file-input/screen.js +49 -0
  88. package/dist/filter-input/menu/filter-menu.d.ts +9 -0
  89. package/dist/filter-input/menu/filter-menu.js +8 -0
  90. package/dist/filter-input/root/filter-input-root.d.ts +43 -6
  91. package/dist/filter-input/root/filter-input-root.js +89 -10
  92. package/dist/filter-input/suggest.d.ts +17 -0
  93. package/dist/filter-input/suggest.js +23 -0
  94. package/dist/format-date/options.d.ts +33 -0
  95. package/dist/format-date/options.js +42 -0
  96. package/dist/format-date/root/format-date-root.d.ts +62 -3
  97. package/dist/format-date/root/format-date-root.js +78 -37
  98. package/dist/graph/root/graph-root.d.ts +24 -3
  99. package/dist/graph/root/graph-root.js +66 -12
  100. package/dist/heatmap/root/buckets.d.ts +2 -1
  101. package/dist/heatmap/root/buckets.js +5 -1
  102. package/dist/heatmap/root/heatmap-root.d.ts +47 -9
  103. package/dist/heatmap/root/heatmap-root.js +46 -18
  104. package/dist/icon/index.d.ts +2 -0
  105. package/dist/icon/index.js +2 -0
  106. package/dist/icon/registry.d.ts +37 -0
  107. package/dist/icon/registry.js +83 -0
  108. package/dist/icon/root/icon-root.d.ts +53 -6
  109. package/dist/icon/root/icon-root.js +72 -4
  110. package/dist/icon/root/index.d.ts +2 -0
  111. package/dist/icon/root/index.js +2 -0
  112. package/dist/icon/set.d.ts +1 -0
  113. package/dist/icon/set.js +3 -0
  114. package/dist/icon-button/root/icon-button-root.d.ts +1 -1
  115. package/dist/image/root/image-root.d.ts +23 -2
  116. package/dist/image/root/image-root.js +23 -4
  117. package/dist/input/root/input-root.d.ts +62 -9
  118. package/dist/input/root/input-root.js +61 -5
  119. package/dist/kbd/root/kbd-root.d.ts +26 -11
  120. package/dist/kbd/root/kbd-root.js +35 -38
  121. package/dist/kbd/shortcut.d.ts +18 -0
  122. package/dist/kbd/shortcut.js +35 -0
  123. package/dist/legend/hidden-series.d.ts +8 -0
  124. package/dist/legend/hidden-series.js +13 -0
  125. package/dist/legend/root/legend-root.d.ts +63 -0
  126. package/dist/legend/root/legend-root.js +61 -7
  127. package/dist/lightbox/item/lightbox-item.d.ts +17 -1
  128. package/dist/lightbox/item/lightbox-item.js +10 -1
  129. package/dist/lightbox/root/lightbox-root.d.ts +77 -6
  130. package/dist/lightbox/root/lightbox-root.js +116 -5
  131. package/dist/line-chart/root/line-chart-root.d.ts +29 -4
  132. package/dist/line-chart/root/line-chart-root.js +58 -17
  133. package/dist/list/item/list-item.d.ts +11 -5
  134. package/dist/list/item/list-item.js +5 -6
  135. package/dist/listbox/range.d.ts +17 -0
  136. package/dist/listbox/range.js +5 -0
  137. package/dist/listbox/root/listbox-root.d.ts +184 -4
  138. package/dist/listbox/root/listbox-root.js +229 -23
  139. package/dist/loader/busy.d.ts +17 -0
  140. package/dist/loader/busy.js +24 -0
  141. package/dist/loader/root/loader-root.d.ts +37 -0
  142. package/dist/loader/root/loader-root.js +52 -3
  143. package/dist/map/root/map-root.d.ts +19 -4
  144. package/dist/map/root/map-root.js +36 -7
  145. package/dist/megamenu/root/megamenu-root.d.ts +10 -1
  146. package/dist/megamenu/root/megamenu-root.js +10 -1
  147. package/dist/menu/item/menu-item.d.ts +41 -12
  148. package/dist/menu/item/menu-item.js +46 -3
  149. package/dist/menu/root/menu-root.d.ts +32 -2
  150. package/dist/menu/root/menu-root.js +48 -8
  151. package/dist/meter/root/meter-root.d.ts +13 -0
  152. package/dist/meter/root/meter-root.js +24 -5
  153. package/dist/navigation/root/navigation-root.d.ts +10 -2
  154. package/dist/navigation/root/navigation-root.js +13 -2
  155. package/dist/notifications/feed-keys.d.ts +10 -0
  156. package/dist/notifications/feed-keys.js +14 -0
  157. package/dist/notifications/group/notification-group.d.ts +1 -0
  158. package/dist/notifications/notification/notification.d.ts +29 -0
  159. package/dist/notifications/notification/notification.js +51 -3
  160. package/dist/notifications/root/notifications-root.d.ts +49 -0
  161. package/dist/notifications/root/notifications-root.js +76 -2
  162. package/dist/number-input/root/number-input-root.d.ts +109 -7
  163. package/dist/number-input/root/number-input-root.js +109 -21
  164. package/dist/object-inspector/root/object-inspector-root.d.ts +49 -5
  165. package/dist/object-inspector/root/object-inspector-root.js +92 -12
  166. package/dist/option/root/option-root.d.ts +58 -6
  167. package/dist/option/root/option-root.js +35 -5
  168. package/dist/outline/root/outline-root.d.ts +13 -2
  169. package/dist/outline/root/outline-root.js +4 -2
  170. package/dist/pagination/root/pagination-root.d.ts +19 -1
  171. package/dist/pagination/root/pagination-root.js +49 -9
  172. package/dist/pagination/size/pagination-size.d.ts +13 -3
  173. package/dist/pagination/size/pagination-size.js +7 -0
  174. package/dist/pin-input/format.d.ts +7 -0
  175. package/dist/pin-input/format.js +16 -0
  176. package/dist/pin-input/root/pin-input-root.d.ts +37 -0
  177. package/dist/pin-input/root/pin-input-root.js +48 -7
  178. package/dist/popover/root/popover-root.d.ts +78 -3
  179. package/dist/popover/root/popover-root.js +74 -5
  180. package/dist/progress/root/progress-root.d.ts +23 -1
  181. package/dist/progress/root/progress-root.js +40 -10
  182. package/dist/qr-code/export.d.ts +31 -0
  183. package/dist/qr-code/export.js +10 -0
  184. package/dist/qr-code/root/qr-code-root.d.ts +45 -0
  185. package/dist/qr-code/root/qr-code-root.js +78 -3
  186. package/dist/radio/group/radio-group.d.ts +64 -0
  187. package/dist/radio/group/radio-group.js +66 -12
  188. package/dist/radio/root/radio-root.d.ts +8 -5
  189. package/dist/radio/root/radio-root.js +1 -2
  190. package/dist/rating/root/rating-root.d.ts +49 -1
  191. package/dist/rating/root/rating-root.js +69 -10
  192. package/dist/scatter-chart/root/scatter-chart-root.d.ts +17 -3
  193. package/dist/scatter-chart/root/scatter-chart-root.js +40 -14
  194. package/dist/select/root/select-root.d.ts +93 -3
  195. package/dist/select/root/select-root.js +111 -13
  196. package/dist/skeleton/root/skeleton-root.d.ts +39 -3
  197. package/dist/skeleton/root/skeleton-root.js +33 -4
  198. package/dist/skip-link/root/skip-link-root.d.ts +10 -0
  199. package/dist/skip-link/root/skip-link-root.js +15 -1
  200. package/dist/slider/root/slider-root.d.ts +59 -2
  201. package/dist/slider/root/slider-root.js +82 -8
  202. package/dist/sparkline/root/sparkline-root.d.ts +9 -10
  203. package/dist/speed-dial/item/speed-dial-item.d.ts +11 -5
  204. package/dist/speed-dial/item/speed-dial-item.js +7 -2
  205. package/dist/speed-dial/root/speed-dial-root.d.ts +15 -4
  206. package/dist/speed-dial/root/speed-dial-root.js +19 -5
  207. package/dist/splitter/root/splitter-root.d.ts +28 -6
  208. package/dist/splitter/root/splitter-root.js +35 -1
  209. package/dist/stat/root/stat-root.d.ts +9 -1
  210. package/dist/stat/root/stat-root.js +15 -2
  211. package/dist/steps/root/steps-root.js +1 -1
  212. package/dist/steps/step/step.d.ts +1 -0
  213. package/dist/steps/step/step.js +1 -1
  214. package/dist/switch/root/switch-root.d.ts +14 -2
  215. package/dist/switch/root/switch-root.js +7 -1
  216. package/dist/table/cell/table-cell.d.ts +24 -4
  217. package/dist/table/cell/table-cell.js +21 -1
  218. package/dist/table/column/table-column.d.ts +32 -6
  219. package/dist/table/column/table-column.js +36 -6
  220. package/dist/table/root/table-root.d.ts +94 -3
  221. package/dist/table/root/table-root.js +128 -5
  222. package/dist/table/row/table-row.d.ts +7 -0
  223. package/dist/table/row/table-row.js +9 -1
  224. package/dist/tabs/root/tabs-root.d.ts +6 -1
  225. package/dist/tabs/root/tabs-root.js +6 -2
  226. package/dist/tag/group/tag-group.d.ts +107 -0
  227. package/dist/tag/group/tag-group.js +157 -0
  228. package/dist/tag/index.d.ts +1 -0
  229. package/dist/tag/index.js +1 -0
  230. package/dist/tag/root/tag-root.d.ts +83 -1
  231. package/dist/tag/root/tag-root.js +87 -17
  232. package/dist/tag/selection.d.ts +10 -0
  233. package/dist/tag/selection.js +12 -0
  234. package/dist/textarea/grow.d.ts +22 -0
  235. package/dist/textarea/grow.js +20 -0
  236. package/dist/textarea/root/textarea-root.d.ts +13 -0
  237. package/dist/textarea/root/textarea-root.js +10 -2
  238. package/dist/time-input/root/time-input-root.d.ts +71 -6
  239. package/dist/time-input/root/time-input-root.js +110 -44
  240. package/dist/time-picker/root/time-picker-root.d.ts +155 -26
  241. package/dist/time-picker/root/time-picker-root.js +192 -63
  242. package/dist/toast/hotkey.d.ts +22 -0
  243. package/dist/toast/hotkey.js +23 -0
  244. package/dist/toast/item/toast-item.d.ts +16 -1
  245. package/dist/toast/item/toast-item.js +41 -13
  246. package/dist/toast/root/toast-root.d.ts +105 -8
  247. package/dist/toast/root/toast-root.js +209 -4
  248. package/dist/toggle/group/toggle-group.d.ts +95 -16
  249. package/dist/toggle/group/toggle-group.js +99 -13
  250. package/dist/toggle/root/toggle-root.d.ts +26 -11
  251. package/dist/toggle/root/toggle-root.js +14 -6
  252. package/dist/toolbar/root/toolbar-root.d.ts +55 -15
  253. package/dist/toolbar/root/toolbar-root.js +99 -16
  254. package/dist/tooltip/focus-target.d.ts +6 -0
  255. package/dist/tooltip/focus-target.js +9 -0
  256. package/dist/tooltip/root/tooltip-root.d.ts +73 -15
  257. package/dist/tooltip/root/tooltip-root.js +96 -7
  258. package/dist/tour/naming.d.ts +30 -0
  259. package/dist/tour/naming.js +10 -0
  260. package/dist/tour/root/tour-root.d.ts +67 -3
  261. package/dist/tour/root/tour-root.js +105 -17
  262. package/dist/tour/stop/tour-stop.d.ts +65 -3
  263. package/dist/tour/stop/tour-stop.js +61 -11
  264. package/dist/tour/wait.d.ts +11 -0
  265. package/dist/tour/wait.js +19 -0
  266. package/dist/tree/item/tree-item.d.ts +21 -5
  267. package/dist/tree/item/tree-item.js +14 -4
  268. package/dist/tree/root/tree-root.d.ts +29 -5
  269. package/dist/tree/root/tree-root.js +64 -8
  270. package/dist/trend/root/trend-root.d.ts +36 -1
  271. package/dist/trend/root/trend-root.js +41 -15
  272. package/dist/video/root/keys.d.ts +5 -0
  273. package/dist/video/root/keys.js +13 -1
  274. package/dist/video/root/video-root.d.ts +19 -0
  275. package/dist/video/root/video-root.js +48 -4
  276. package/dist/video-playlist/menu/video-playlist-menu.d.ts +20 -2
  277. package/dist/video-playlist/menu/video-playlist-menu.js +27 -5
  278. package/dist/video-playlist/root/video-playlist-root.js +6 -3
  279. package/dist/virtual-list/root/virtual-list-root.d.ts +52 -4
  280. package/dist/virtual-list/root/virtual-list-root.js +103 -21
  281. package/lint.json +1 -1
  282. package/package.json +5 -5
  283. package/types/jsx.d.ts +9140 -1149
  284. package/types/svelte.d.ts +1 -0
  285. package/types/vue.d.ts +2089 -267
@@ -4,25 +4,25 @@ 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 { valueAsTime as asTime, customElement, timeAsValue as fromTime, HelixFormElement, MixinControllerValue, minutesAsValue, reportValues, valueAsMinutes, writeTime, } from '@fusion.dev/helix-core';
7
+ import { clockLocale, commaList, customElement, dayPeriod, elementById, fillTemplate, HelixFormElement, inlineStep, isTwelveHour, MixinControllerValue, nearestTime, offeredTimes, reportValues, secondsAsValue, timeBarred, timeFault, valueAsSeconds, wheelParts, wholeHour, writeClock, } from '@fusion.dev/helix-core';
8
8
  import { nothing } from 'lit';
9
9
  import { property } from 'lit/decorators.js';
10
10
  import { html } from 'lit/static-html.js';
11
11
  import '../../listbox/index.js';
12
12
  import '../../option/index.js';
13
- const isTwelveHour = (locale) => new Intl.DateTimeFormat(locale || undefined, { timeStyle: 'short' }).resolvedOptions().hour12 ===
14
- true;
15
13
  let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControllerValue(HelixFormElement) {
16
14
  constructor() {
17
15
  super(...arguments);
18
16
  this.disableTimes = '';
17
+ this.hourLabel = 'Hour';
19
18
  this.invalid = false;
20
19
  this.label = 'Time';
21
20
  this.locale = '';
21
+ this.manual = false;
22
22
  this.max = '23:59';
23
+ this.meridiemLabel = 'Before or after noon';
23
24
  this.min = '00:00';
24
- this.readOnly = false;
25
- this.required = false;
25
+ this.minuteLabel = 'Minute';
26
26
  this.handleListInput = (event) => {
27
27
  event.stopPropagation();
28
28
  };
@@ -55,60 +55,78 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
55
55
  if (this.isDisabled) {
56
56
  return;
57
57
  }
58
- const { hour, meridiem, minute } = this.parts;
59
- let next = hour * 60 + minute;
58
+ const { hour, meridiem, minute, second } = this.parts;
59
+ let [h, m, sec] = [hour, minute, second];
60
60
  if (part === 'minute') {
61
- next = hour * 60 + Number(to);
61
+ m = Number(to);
62
+ }
63
+ else if (part === 'second') {
64
+ sec = Number(to);
62
65
  }
63
66
  else if (part === 'hour') {
64
- const shown = Number(to);
65
- const whole = isTwelveHour(this.locale) ? (shown % 12) + (meridiem === 'PM' ? 12 : 0) : shown;
66
- next = whole * 60 + minute;
67
+ h = wholeHour(Number(to), isTwelveHour(this.clock) ? meridiem : undefined);
67
68
  }
68
69
  else {
69
- const half = hour % 12;
70
- next = (half + (to === 'PM' ? 12 : 0)) * 60 + minute;
70
+ h = (hour % 12) + (to === 'PM' ? 12 : 0);
71
71
  }
72
- const whole = minutesAsValue(next);
73
- if (this.barred(whole)) {
72
+ const nearest = this.nearest(h * 3600 + m * 60 + sec);
73
+ if (this.barredAt(nearest)) {
74
74
  return;
75
75
  }
76
- this.requestValue(whole);
76
+ this.requestValue(this.valueFor(nearest));
77
77
  };
78
+ this.readOnly = false;
79
+ this.required = false;
80
+ this.secondLabel = 'Second';
81
+ this.seconds = false;
78
82
  this.step = 15;
79
83
  this.listRevealed = false;
84
+ this.naming = undefined;
85
+ this.handleColumnsKeydown = (event) => {
86
+ const step = inlineStep(this, event.key);
87
+ if (step === 0 || event.altKey || event.ctrlKey || event.metaKey) {
88
+ return;
89
+ }
90
+ const columns = [...(this.renderRoot?.querySelectorAll('[part="column"]') ?? [])];
91
+ const at = columns.findIndex((column) => event.composedPath().includes(column));
92
+ const next = columns[at + step];
93
+ if (at < 0 || !next) {
94
+ return;
95
+ }
96
+ event.preventDefault();
97
+ next.focus();
98
+ };
80
99
  }
81
100
  get times() {
82
- const from = valueAsMinutes(this.min) ?? 0;
83
- const to = valueAsMinutes(this.max) ?? 1439;
84
- const step = Math.max(1, Math.round(this.step));
85
- const found = [];
86
- for (let at = from; at <= to; at += step) {
87
- found.push(at);
88
- }
89
- return found;
101
+ return offeredTimes(this.min, this.max, this.step, this.seconds);
102
+ }
103
+ get clock() {
104
+ return clockLocale(this.locale, this.hourCycle);
105
+ }
106
+ valueFor(at) {
107
+ return secondsAsValue(at, this.seconds);
90
108
  }
91
109
  barred(at) {
92
- return this.disableTimes
93
- .split(',')
94
- .map((one) => one.trim())
95
- .filter(Boolean)
96
- .includes(at);
110
+ const seconds = valueAsSeconds(at);
111
+ return seconds !== null && this.barredAt(seconds);
112
+ }
113
+ barredAt(at) {
114
+ return timeBarred(at, this.disableTimes);
115
+ }
116
+ nearest(at) {
117
+ return nearestTime(this.times, at);
97
118
  }
98
119
  wholeHourBarred(shown, half) {
99
- const whole = half === undefined ? shown : (shown % 12) + (half === 'PM' ? 12 : 0);
100
- const within = this.times.filter((at) => Math.floor(at / 60) === whole);
101
- return within.length > 0 && within.every((at) => this.barred(minutesAsValue(at)));
120
+ const whole = wholeHour(shown, half);
121
+ const within = this.times.filter((at) => Math.floor(at / 3600) === whole);
122
+ return within.length > 0 && within.every((at) => this.barredAt(at));
102
123
  }
103
124
  halfBarred(half) {
104
- const within = this.times.filter((at) => (half === 'PM') === at >= 720);
105
- return within.length > 0 && within.every((at) => this.barred(minutesAsValue(at)));
125
+ const within = this.times.filter((at) => (half === 'PM') === at >= 43_200);
126
+ return within.length > 0 && within.every((at) => this.barredAt(at));
106
127
  }
107
128
  get held() {
108
- return this.value
109
- .split(',')
110
- .map((one) => one.trim())
111
- .filter(Boolean);
129
+ return commaList(this.value);
112
130
  }
113
131
  between(at) {
114
132
  if (this.mode !== 'range') {
@@ -118,17 +136,25 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
118
136
  return from !== undefined && to !== undefined && at > from && at < to;
119
137
  }
120
138
  get parts() {
121
- const at = valueAsMinutes(this.value) ?? valueAsMinutes(this.min) ?? 0;
122
- const hour = Math.floor(at / 60);
123
- return { hour, meridiem: hour < 12 ? 'AM' : 'PM', minute: at % 60 };
139
+ const at = valueAsSeconds(this.value) ?? valueAsSeconds(this.min) ?? 0;
140
+ return wheelParts(at, isTwelveHour(this.clock));
124
141
  }
125
142
  get hours() {
126
- const found = new Set(this.times.map((at) => Math.floor(at / 60)));
143
+ const found = new Set(this.times.map((at) => Math.floor(at / 3600)));
127
144
  return [...found];
128
145
  }
129
146
  get minutes() {
130
147
  const hour = this.parts.hour;
131
- return this.times.filter((at) => Math.floor(at / 60) === hour).map((at) => at % 60);
148
+ const found = new Set(this.times
149
+ .filter((at) => Math.floor(at / 3600) === hour)
150
+ .map((at) => Math.floor(at / 60) % 60));
151
+ return [...found];
152
+ }
153
+ get secondsShown() {
154
+ const { hour, minute } = this.parts;
155
+ return this.times
156
+ .filter((at) => Math.floor(at / 60) === hour * 60 + minute)
157
+ .map((at) => at % 60);
132
158
  }
133
159
  reveal() {
134
160
  if (this.mode !== undefined) {
@@ -148,6 +174,35 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
148
174
  }
149
175
  return super.requestValue(next);
150
176
  }
177
+ fault(at) {
178
+ switch (timeFault(at, {
179
+ disableTimes: this.disableTimes,
180
+ max: this.max,
181
+ min: this.min,
182
+ offered: this.times,
183
+ })) {
184
+ case 'rangeUnderflow':
185
+ return [
186
+ 'rangeUnderflow',
187
+ fillTemplate(this.rangeUnderflowMessage || 'Choose a time at or after {min}.', {
188
+ min: writeClock(this.min, this.clock, this.seconds),
189
+ }),
190
+ ];
191
+ case 'rangeOverflow':
192
+ return [
193
+ 'rangeOverflow',
194
+ fillTemplate(this.rangeOverflowMessage || 'Choose a time at or before {max}.', {
195
+ max: writeClock(this.max, this.clock, this.seconds),
196
+ }),
197
+ ];
198
+ case 'unavailable':
199
+ return ['badInput', this.unavailableMessage || 'Choose a time that is available.'];
200
+ case 'stepMismatch':
201
+ return ['stepMismatch', this.stepMismatchMessage || 'Choose one of the times on offer.'];
202
+ default:
203
+ return undefined;
204
+ }
205
+ }
151
206
  reportRequired() {
152
207
  const anchor = this.partNamed('list') ?? undefined;
153
208
  if (this.required && this.value === '') {
@@ -155,17 +210,25 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
155
210
  return;
156
211
  }
157
212
  const held = this.held;
158
- if (held.length > 0 && held.some((one) => asTime(one) === null)) {
213
+ if (held.length > 0 && held.some((one) => valueAsSeconds(one) === null)) {
214
+ const shape = this.seconds ? 'HH:mm:ss' : 'HH:mm';
159
215
  this.internals.setValidity({ badInput: true }, this.badInputMessage ||
160
216
  (this.mode === undefined
161
- ? 'Enter a time as HH:mm.'
162
- : 'Enter times as HH:mm, separated by commas.'), anchor);
217
+ ? `Enter a time as ${shape}.`
218
+ : `Enter times as ${shape}, separated by commas.`), anchor);
163
219
  return;
164
220
  }
221
+ for (const one of held) {
222
+ const fault = this.fault(one);
223
+ if (fault) {
224
+ this.internals.setValidity({ [fault[0]]: true }, fault[1], anchor);
225
+ return;
226
+ }
227
+ }
165
228
  this.internals.setValidity({});
166
229
  }
167
230
  report() {
168
- if (this.disabled) {
231
+ if (this.isDisabled) {
169
232
  this.internals.setFormValue(null);
170
233
  return;
171
234
  }
@@ -178,6 +241,25 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
178
241
  await Promise.all(settling.map((one) => one.updateComplete));
179
242
  this.reveal();
180
243
  }
244
+ get listName() {
245
+ const named = (this.getAttribute('aria-labelledby') ?? '')
246
+ .split(/\s+/)
247
+ .filter(Boolean)
248
+ .map((id) => elementById(this, id)?.textContent?.trim() ?? '')
249
+ .filter(Boolean)
250
+ .join(' ');
251
+ return named || this.getAttribute('aria-label') || this.label;
252
+ }
253
+ connectedCallback() {
254
+ super.connectedCallback();
255
+ this.naming = new MutationObserver(() => this.requestUpdate());
256
+ this.naming.observe(this, { attributeFilter: ['aria-label', 'aria-labelledby'] });
257
+ }
258
+ disconnectedCallback() {
259
+ super.disconnectedCallback();
260
+ this.naming?.disconnect();
261
+ this.naming = undefined;
262
+ }
181
263
  willUpdate(changed) {
182
264
  super.willUpdate(changed);
183
265
  this.internals.ariaInvalid = this.invalid ? 'true' : null;
@@ -196,7 +278,8 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
196
278
  }
197
279
  }
198
280
  focus(options) {
199
- this.partNamed('list')?.focus(options);
281
+ ;
282
+ (this.partNamed('list') ?? this.partNamed('column'))?.focus(options);
200
283
  }
201
284
  renderColumn(part, label, values, written, value, barred = () => false) {
202
285
  return html `<${this.tag('listbox')}
@@ -228,17 +311,25 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
228
311
  </${this.tag('listbox')}>`;
229
312
  }
230
313
  renderSpinner() {
231
- const twelve = isTwelveHour(this.locale);
232
- const { hour, meridiem, minute } = this.parts;
233
- const shownHour = twelve ? String(hour % 12 === 0 ? 12 : hour % 12) : String(hour);
314
+ const twelve = isTwelveHour(this.clock);
315
+ const { hour, meridiem, minute, second, shown } = this.parts;
234
316
  const hours = twelve
235
317
  ? [...new Set(this.hours.map((one) => (one % 12 === 0 ? 12 : one % 12)))].sort((a, b) => a - b)
236
318
  : this.hours;
237
- return html `<div part="columns" data-unset=${this.value === '' ? '' : nothing}>
238
- ${this.renderColumn('hour', 'Hour', hours.map(String), (one) => (twelve ? one : one.padStart(2, '0')), shownHour, (one) => this.wholeHourBarred(Number(one), twelve ? meridiem : undefined))}
239
- ${this.renderColumn('minute', 'Minute', this.minutes.map(String), (one) => one.padStart(2, '0'), String(minute), (one) => this.barred(minutesAsValue(hour * 60 + Number(one))))}
319
+ return html `<div
320
+ part="columns"
321
+ role="group"
322
+ aria-label=${this.listName}
323
+ data-unset=${this.value === '' ? '' : nothing}
324
+ @keydown=${this.handleColumnsKeydown}
325
+ >
326
+ ${this.renderColumn('hour', this.hourLabel, hours.map(String), (one) => (twelve ? one : one.padStart(2, '0')), String(shown), (one) => this.wholeHourBarred(Number(one), twelve ? meridiem : undefined))}
327
+ ${this.renderColumn('minute', this.minuteLabel, this.minutes.map(String), (one) => one.padStart(2, '0'), String(minute), (one) => this.barredAt(hour * 3600 + Number(one) * 60))}
328
+ ${this.seconds
329
+ ? this.renderColumn('second', this.secondLabel, this.secondsShown.map(String), (one) => one.padStart(2, '0'), String(second), (one) => this.barredAt(hour * 3600 + minute * 60 + Number(one)))
330
+ : nothing}
240
331
  ${twelve
241
- ? this.renderColumn('meridiem', 'Before or after noon', ['AM', 'PM'], (one) => one, meridiem, (one) => this.halfBarred(one))
332
+ ? this.renderColumn('meridiem', this.meridiemLabel, ['AM', 'PM'], (one) => dayPeriod(one, this.clock), meridiem, (one) => this.halfBarred(one))
242
333
  : nothing}
243
334
  </div>`;
244
335
  }
@@ -249,16 +340,17 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
249
340
  exportparts="empty: list-empty, feedback: list-feedback, filter-icon: list-filter-icon,
250
341
  filter-mark: list-filter-mark, hint: list-hint, items: list-items, label: list-label,
251
342
  live: list-live, loading: list-loading, search: list-search, search-field: list-search-field"
252
- aria-label=${this.label}
343
+ aria-label=${this.listName}
253
344
  data-unset=${this.value === '' ? '' : nothing}
254
345
  ?disabled=${this.isDisabled}
346
+ ?manual=${this.manual}
255
347
  ?multiple=${this.mode !== undefined}
256
348
  .value=${this.value}
257
349
  @helix-before-change=${this.handleChange}
258
350
  @input=${this.handleListInput}
259
351
  >
260
- ${this.times.map((minutes) => {
261
- const at = minutesAsValue(minutes);
352
+ ${this.times.map((seconds) => {
353
+ const at = this.valueFor(seconds);
262
354
  const between = this.between(at);
263
355
  return html `<${this.tag('option')}
264
356
  part="option${between ? ' option-between' : ''}"
@@ -269,7 +361,7 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
269
361
  ?disabled=${this.barred(at)}
270
362
  ?selected=${this.held.includes(at)}
271
363
  data-between=${between ? '' : nothing}
272
- >${writeTime(at, this.locale)}</${this.tag('option')}
364
+ >${writeClock(at, this.clock, this.seconds)}</${this.tag('option')}
273
365
  >`;
274
366
  })}
275
367
  </${this.tag('listbox')}>`;
@@ -281,16 +373,20 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
281
373
  return html `${this.renderList()}`;
282
374
  }
283
375
  get valueAsDate() {
284
- return asTime(this.value);
376
+ const at = valueAsSeconds(this.value);
377
+ return at === null ? null : new Date(at * 1000);
285
378
  }
286
379
  set valueAsDate(date) {
287
- this.value = fromTime(date);
380
+ this.valueAsNumber = date ? date.getTime() : Number.NaN;
288
381
  }
289
382
  get valueAsNumber() {
290
- return asTime(this.value)?.getTime() ?? Number.NaN;
383
+ const at = valueAsSeconds(this.value);
384
+ return at === null ? Number.NaN : at * 1000;
291
385
  }
292
386
  set valueAsNumber(ms) {
293
- this.value = Number.isNaN(ms) ? '' : fromTime(new Date(ms));
387
+ this.value = Number.isNaN(ms)
388
+ ? ''
389
+ : this.valueFor(Math.floor((((ms % 86_400_000) + 86_400_000) % 86_400_000) / 1000));
294
390
  }
295
391
  };
296
392
  __decorate([
@@ -299,6 +395,12 @@ __decorate([
299
395
  __decorate([
300
396
  property({ attribute: 'disable-times' })
301
397
  ], HelixHeadlessTimePicker.prototype, "disableTimes", void 0);
398
+ __decorate([
399
+ property({ attribute: 'hour-cycle' })
400
+ ], HelixHeadlessTimePicker.prototype, "hourCycle", void 0);
401
+ __decorate([
402
+ property({ attribute: 'hour-label' })
403
+ ], HelixHeadlessTimePicker.prototype, "hourLabel", void 0);
302
404
  __decorate([
303
405
  property({ reflect: true, type: Boolean })
304
406
  ], HelixHeadlessTimePicker.prototype, "invalid", void 0);
@@ -308,24 +410,51 @@ __decorate([
308
410
  __decorate([
309
411
  property()
310
412
  ], HelixHeadlessTimePicker.prototype, "locale", void 0);
413
+ __decorate([
414
+ property({ type: Boolean })
415
+ ], HelixHeadlessTimePicker.prototype, "manual", void 0);
311
416
  __decorate([
312
417
  property()
313
418
  ], HelixHeadlessTimePicker.prototype, "max", void 0);
419
+ __decorate([
420
+ property({ attribute: 'meridiem-label' })
421
+ ], HelixHeadlessTimePicker.prototype, "meridiemLabel", void 0);
314
422
  __decorate([
315
423
  property()
316
424
  ], HelixHeadlessTimePicker.prototype, "min", void 0);
425
+ __decorate([
426
+ property({ attribute: 'minute-label' })
427
+ ], HelixHeadlessTimePicker.prototype, "minuteLabel", void 0);
317
428
  __decorate([
318
429
  property({ reflect: true })
319
430
  ], HelixHeadlessTimePicker.prototype, "mode", void 0);
431
+ __decorate([
432
+ property({ attribute: 'range-overflow-message' })
433
+ ], HelixHeadlessTimePicker.prototype, "rangeOverflowMessage", void 0);
434
+ __decorate([
435
+ property({ attribute: 'range-underflow-message' })
436
+ ], HelixHeadlessTimePicker.prototype, "rangeUnderflowMessage", void 0);
320
437
  __decorate([
321
438
  property({ attribute: 'readonly', reflect: true, type: Boolean })
322
439
  ], HelixHeadlessTimePicker.prototype, "readOnly", void 0);
323
440
  __decorate([
324
441
  property({ reflect: true, type: Boolean })
325
442
  ], HelixHeadlessTimePicker.prototype, "required", void 0);
443
+ __decorate([
444
+ property({ attribute: 'second-label' })
445
+ ], HelixHeadlessTimePicker.prototype, "secondLabel", void 0);
446
+ __decorate([
447
+ property({ type: Boolean })
448
+ ], HelixHeadlessTimePicker.prototype, "seconds", void 0);
326
449
  __decorate([
327
450
  property({ type: Number })
328
451
  ], HelixHeadlessTimePicker.prototype, "step", void 0);
452
+ __decorate([
453
+ property({ attribute: 'step-mismatch-message' })
454
+ ], HelixHeadlessTimePicker.prototype, "stepMismatchMessage", void 0);
455
+ __decorate([
456
+ property({ attribute: 'unavailable-message' })
457
+ ], HelixHeadlessTimePicker.prototype, "unavailableMessage", void 0);
329
458
  __decorate([
330
459
  property({ attribute: 'value-missing-message' })
331
460
  ], HelixHeadlessTimePicker.prototype, "valueMissingMessage", void 0);
@@ -0,0 +1,22 @@
1
+ import { type ChordPress } from '@fusion.dev/helix-core';
2
+ /** A key and the modifiers held with it. */
3
+ export interface Chord {
4
+ alt: boolean;
5
+ ctrl: boolean;
6
+ key: string;
7
+ meta: boolean;
8
+ shift: boolean;
9
+ }
10
+ /** What a key press carries that a chord is compared against. */
11
+ export type Pressed = ChordPress;
12
+ /**
13
+ * Reads a chord written as keys joined by `+`, such as `F8` or `Alt+T`, case
14
+ * aside. The last part is the key. Empty, or a chord with no key, is none.
15
+ *
16
+ * Split as core's `chordParts` splits every chord, and read more strictly than
17
+ * Kbd reads one: four modifiers by their own names, no `mod`, and Shift held
18
+ * exactly as written, so the key that moves to the stack is the one written.
19
+ */
20
+ export declare const parseHotkey: (text: string) => Chord | null;
21
+ /** Whether a press is the chord: the same key, case aside, and exactly its modifiers. */
22
+ export declare const matchesHotkey: (pressed: Pressed, chord: Chord | null) => boolean;
@@ -0,0 +1,23 @@
1
+ import { chordParts } from '@fusion.dev/helix-core';
2
+ const MODIFIERS = new Set(['alt', 'ctrl', 'meta', 'shift']);
3
+ export const parseHotkey = (text) => {
4
+ const parts = chordParts(text);
5
+ const key = parts.pop();
6
+ if (!key || MODIFIERS.has(key.toLowerCase())) {
7
+ return null;
8
+ }
9
+ const held = new Set(parts.map((one) => one.toLowerCase()));
10
+ return {
11
+ alt: held.has('alt'),
12
+ ctrl: held.has('ctrl'),
13
+ key,
14
+ meta: held.has('meta'),
15
+ shift: held.has('shift'),
16
+ };
17
+ };
18
+ export const matchesHotkey = (pressed, chord) => chord !== null &&
19
+ pressed.key.toLowerCase() === chord.key.toLowerCase() &&
20
+ pressed.altKey === chord.alt &&
21
+ pressed.ctrlKey === chord.ctrl &&
22
+ pressed.metaKey === chord.meta &&
23
+ pressed.shiftKey === chord.shift;
@@ -1,4 +1,4 @@
1
- import { HelixElement, type ToneMark } from '@fusion.dev/helix-core';
1
+ import { HelixElement, SwipeController, type ToneMark } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  declare const HelixHeadlessToastItem_base: (new (...args: any[]) => import("@fusion.dev/helix-core").DismissibleElement) & typeof HelixElement;
4
4
  /**
@@ -12,6 +12,16 @@ declare const HelixHeadlessToastItem_base: (new (...args: any[]) => import("@fus
12
12
  * with each new message, and the last of three messages would stay for nine
13
13
  * seconds.
14
14
  *
15
+ * **Each message is an `alertdialog` named by its words**, which is how a reader
16
+ * who moves into the stack hears which message they are on. A `danger` message
17
+ * is its own assertive live region, so it is announced at once; every other one
18
+ * is announced politely by the region.
19
+ *
20
+ * A touch or a pen swipes a message toward the end of the line, and past
21
+ * halfway, or quickly, dismisses it through the same `helix-dismiss` as its
22
+ * control. While it moves, the distance is on the `item` part as
23
+ * `--toast-swipe-x`.
24
+ *
15
25
  * **Messages are inverted by default.** The item flips `color-scheme`, so a new
16
26
  * message stands out from the page without using a color that carries meaning.
17
27
  *
@@ -39,6 +49,7 @@ declare const HelixHeadlessToastItem_base: (new (...args: any[]) => import("@fus
39
49
  * @csspart timer - The bar showing how long is left, where a duration was given.
40
50
  *
41
51
  * @cssproperty --toast-duration - How long this message stays, in milliseconds, for a progress hint.
52
+ * @cssproperty --toast-swipe-x - How far a swipe has moved the message across, in pixels, toward the right.
42
53
  */
43
54
  export declare class HelixHeadlessToastItem extends HelixHeadlessToastItem_base {
44
55
  /**
@@ -64,6 +75,9 @@ export declare class HelixHeadlessToastItem extends HelixHeadlessToastItem_base
64
75
  */
65
76
  get open(): boolean;
66
77
  set open(next: boolean);
78
+ protected readonly swipes: SwipeController;
79
+ /** Writes how far a swipe has moved the message toward the end of the line. */
80
+ private slide;
67
81
  /** When the current run of the timer began, or nothing while it is paused. */
68
82
  private startedAt;
69
83
  /** What is left of the duration, so resuming continues rather than restarts. */
@@ -106,6 +120,7 @@ export declare class HelixHeadlessToastItem extends HelixHeadlessToastItem_base
106
120
  connectedCallback(): void;
107
121
  disconnectedCallback(): void;
108
122
  protected willUpdate(changed: PropertyValues): void;
123
+ protected updated(changed: PropertyValues): void;
109
124
  protected firstUpdated(changed: PropertyValues): void;
110
125
  /**
111
126
  * The mark for the message's tone, behind a seam.
@@ -4,14 +4,33 @@ 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, MixinDismissible, requestChange, toneMark, } from '@fusion.dev/helix-core';
8
- import { x } from '@fusion.dev/helix-icons';
7
+ import { customElement, drawDismiss, drawDismissGlyph, HelixElement, hostAria, isRtl, MixinDismissible, requestChange, SwipeController, settleSwipe, swipeEdge, toneMark, towardEdge, } from '@fusion.dev/helix-core';
9
8
  import { html, nothing } from 'lit';
10
9
  import { property } from 'lit/decorators.js';
11
10
  import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
12
11
  let HelixHeadlessToastItem = class HelixHeadlessToastItem extends MixinDismissible(HelixElement) {
13
12
  constructor() {
14
13
  super(...arguments);
14
+ this.swipes = new SwipeController(this, {
15
+ axis: () => (this.open ? 'x' : undefined),
16
+ end: (dx, _dy, vx) => {
17
+ const edge = swipeEdge('end', isRtl(this));
18
+ const width = this.partNamed('item')?.getBoundingClientRect().width ?? 0;
19
+ const shown = settleSwipe({
20
+ points: [1],
21
+ size: width,
22
+ travel: Math.max(0, towardEdge(edge, dx, 0)),
23
+ velocity: towardEdge(edge, vx, 0),
24
+ });
25
+ if (shown === 0 && this.dismiss()) {
26
+ return;
27
+ }
28
+ this.slide(0);
29
+ },
30
+ move: (dx) => this.slide(Math.max(0, towardEdge(swipeEdge('end', isRtl(this)), dx, 0))),
31
+ start: (_target, event) => event.pointerType !== 'mouse',
32
+ surface: () => this.partNamed('item'),
33
+ });
15
34
  this.openState = undefined;
16
35
  this.holds = 0;
17
36
  this.handlePause = () => {
@@ -33,6 +52,10 @@ let HelixHeadlessToastItem = class HelixHeadlessToastItem extends MixinDismissib
33
52
  this.openState = next;
34
53
  this.requestUpdate('open', previous);
35
54
  }
55
+ slide(travel) {
56
+ const physical = isRtl(this) ? -travel : travel;
57
+ this.partNamed('item')?.style.setProperty('--toast-swipe-x', travel === 0 ? '' : `${Math.round(physical)}px`);
58
+ }
36
59
  dismiss() {
37
60
  if (!this.open) {
38
61
  return true;
@@ -86,6 +109,16 @@ let HelixHeadlessToastItem = class HelixHeadlessToastItem extends MixinDismissib
86
109
  super.willUpdate(changed);
87
110
  this.toggleAttribute('data-closed', !this.open);
88
111
  this.toggleAttribute('hidden', !this.open);
112
+ hostAria(this.internals, { role: 'alertdialog' });
113
+ this.internals.ariaModal = 'false';
114
+ this.internals.ariaLive = this.tone === 'danger' ? 'assertive' : null;
115
+ }
116
+ updated(changed) {
117
+ super.updated(changed);
118
+ const words = this.partNamed('content');
119
+ if (words) {
120
+ hostAria(this.internals, { labelledBy: [words] });
121
+ }
89
122
  }
90
123
  firstUpdated(changed) {
91
124
  super.firstUpdated(changed);
@@ -108,9 +141,7 @@ let HelixHeadlessToastItem = class HelixHeadlessToastItem extends MixinDismissib
108
141
  }
109
142
  renderDismissIcon() {
110
143
  return html `<slot name="dismiss-icon">
111
- <svg part="dismiss-mark" viewBox=${x.viewBox} fill="currentColor" aria-hidden="true">
112
- ${unsafeSVG(x.content)}
113
- </svg>
144
+ ${drawDismissGlyph()}
114
145
  </slot>`;
115
146
  }
116
147
  render() {
@@ -130,14 +161,11 @@ let HelixHeadlessToastItem = class HelixHeadlessToastItem extends MixinDismissib
130
161
  <div part="content"><slot></slot></div>
131
162
  <div part="actions"><slot name="actions"></slot></div>
132
163
  ${this.dismissible
133
- ? html `<button
134
- part="dismiss"
135
- type="button"
136
- aria-label=${this.dismissLabel}
137
- @click=${() => this.dismiss()}
138
- >
139
- ${this.renderDismissIcon()}
140
- </button>`
164
+ ? drawDismiss({
165
+ label: this.dismissLabel,
166
+ mark: this.renderDismissIcon(),
167
+ onDismiss: () => this.dismiss(),
168
+ })
141
169
  : nothing}
142
170
  ${this.duration
143
171
  ? html `<div