@fusion.dev/helix-headless 0.148.0 → 0.149.1

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 (240) hide show
  1. package/custom-elements.json +6966 -1798
  2. package/dist/announcement/root/announcement-root.d.ts +5 -0
  3. package/dist/announcement/root/announcement-root.js +5 -2
  4. package/dist/area-chart/root/area-chart-root.d.ts +11 -0
  5. package/dist/area-chart/root/area-chart-root.js +20 -7
  6. package/dist/avatar/group/avatar-group.d.ts +10 -2
  7. package/dist/avatar/group/avatar-group.js +10 -5
  8. package/dist/badge/count.d.ts +6 -1
  9. package/dist/badge/count.js +3 -3
  10. package/dist/badge/root/badge-root.d.ts +6 -2
  11. package/dist/badge/root/badge-root.js +3 -3
  12. package/dist/bar-chart/root/bar-chart-root.d.ts +13 -1
  13. package/dist/bar-chart/root/bar-chart-root.js +17 -4
  14. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +8 -1
  15. package/dist/breadcrumbs/root/breadcrumbs-root.js +5 -2
  16. package/dist/button/root/button-root.d.ts +10 -1
  17. package/dist/button/root/button-root.js +3 -2
  18. package/dist/button-group/root/button-group-root.d.ts +3 -0
  19. package/dist/button-group/root/button-group-root.js +2 -2
  20. package/dist/callout/root/callout-root.d.ts +16 -2
  21. package/dist/callout/root/callout-root.js +16 -4
  22. package/dist/canvas/describe.d.ts +10 -0
  23. package/dist/canvas/describe.js +9 -0
  24. package/dist/canvas/neighbor.d.ts +17 -0
  25. package/dist/canvas/neighbor.js +1 -0
  26. package/dist/canvas/node/canvas-node.js +3 -2
  27. package/dist/canvas/root/canvas-root.d.ts +65 -8
  28. package/dist/canvas/root/canvas-root.js +115 -49
  29. package/dist/carousel/root/carousel-root.d.ts +5 -0
  30. package/dist/carousel/root/carousel-root.js +16 -5
  31. package/dist/chat/composer/chat-composer.d.ts +5 -0
  32. package/dist/chat/composer/chat-composer.js +4 -1
  33. package/dist/chat/message/chat-message.d.ts +9 -5
  34. package/dist/chat/message/chat-message.js +8 -4
  35. package/dist/chat/naming.js +2 -2
  36. package/dist/chat/root/chat-root.d.ts +27 -1
  37. package/dist/chat/root/chat-root.js +37 -9
  38. package/dist/checkbox/root/checkbox-root.d.ts +11 -0
  39. package/dist/checkbox/root/checkbox-root.js +8 -2
  40. package/dist/checkbox-group/root/checkbox-group-root.d.ts +11 -0
  41. package/dist/checkbox-group/root/checkbox-group-root.js +11 -3
  42. package/dist/code-block/root/code-block-root.d.ts +12 -2
  43. package/dist/code-block/root/code-block-root.js +12 -2
  44. package/dist/color-input/root/color-input-root.d.ts +13 -0
  45. package/dist/color-input/root/color-input-root.js +18 -5
  46. package/dist/color-picker/root/color-picker-root.d.ts +19 -3
  47. package/dist/color-picker/root/color-picker-root.js +47 -13
  48. package/dist/combobox/root/combobox-root.d.ts +36 -7
  49. package/dist/combobox/root/combobox-root.js +37 -12
  50. package/dist/command/root/command-root.d.ts +15 -6
  51. package/dist/command/root/command-root.js +9 -4
  52. package/dist/copy-button/root/copy-button-root.d.ts +5 -0
  53. package/dist/copy-button/root/copy-button-root.js +7 -2
  54. package/dist/data-table/root/data-table-root.d.ts +171 -29
  55. package/dist/data-table/root/data-table-root.js +268 -118
  56. package/dist/date-input/root/date-input-root.d.ts +32 -9
  57. package/dist/date-input/root/date-input-root.js +66 -44
  58. package/dist/date-picker/root/date-picker-root.d.ts +38 -15
  59. package/dist/date-picker/root/date-picker-root.js +52 -33
  60. package/dist/dialog/root/dialog-root.d.ts +12 -1
  61. package/dist/dialog/root/dialog-root.js +11 -4
  62. package/dist/donut-chart/root/donut-chart-root.d.ts +5 -0
  63. package/dist/donut-chart/root/donut-chart-root.js +8 -5
  64. package/dist/drawer/root/drawer-root.d.ts +12 -1
  65. package/dist/drawer/root/drawer-root.js +9 -2
  66. package/dist/drilldown/root/drilldown-root.d.ts +5 -0
  67. package/dist/drilldown/root/drilldown-root.js +4 -1
  68. package/dist/element-events.generated.js +25 -3
  69. package/dist/file-input/root/file-input-root.d.ts +18 -3
  70. package/dist/file-input/root/file-input-root.js +34 -17
  71. package/dist/filter-input/chip/filter-chip.d.ts +13 -0
  72. package/dist/filter-input/chip/filter-chip.js +6 -1
  73. package/dist/filter-input/menu/filter-menu.d.ts +5 -0
  74. package/dist/filter-input/menu/filter-menu.js +3 -1
  75. package/dist/filter-input/root/filter-input-root.d.ts +20 -3
  76. package/dist/filter-input/root/filter-input-root.js +8 -4
  77. package/dist/format-date/root/format-date-root.d.ts +20 -2
  78. package/dist/format-date/root/format-date-root.js +5 -2
  79. package/dist/graph/root/graph-model.d.ts +11 -0
  80. package/dist/graph/root/graph-model.js +4 -0
  81. package/dist/graph/root/graph-root.d.ts +78 -9
  82. package/dist/graph/root/graph-root.js +124 -27
  83. package/dist/heatmap/root/heatmap-root.d.ts +25 -4
  84. package/dist/heatmap/root/heatmap-root.js +27 -7
  85. package/dist/icon-button/root/icon-button-root.d.ts +5 -0
  86. package/dist/icon-button/root/icon-button-root.js +1 -0
  87. package/dist/input/root/input-root.d.ts +5 -0
  88. package/dist/input/root/input-root.js +4 -1
  89. package/dist/lightbox/root/lightbox-root.d.ts +14 -4
  90. package/dist/lightbox/root/lightbox-root.js +25 -7
  91. package/dist/line-chart/root/line-chart-root.d.ts +5 -0
  92. package/dist/line-chart/root/line-chart-root.js +4 -2
  93. package/dist/list/item/list-item.d.ts +32 -0
  94. package/dist/list/item/list-item.js +34 -7
  95. package/dist/list/root/list-root.d.ts +87 -0
  96. package/dist/list/root/list-root.js +112 -2
  97. package/dist/listbox/reorder/index.d.ts +1 -0
  98. package/dist/listbox/reorder/index.js +4 -0
  99. package/dist/listbox/reorder/listbox-reorder.d.ts +83 -0
  100. package/dist/listbox/reorder/listbox-reorder.js +151 -0
  101. package/dist/listbox/root/listbox-root.d.ts +68 -11
  102. package/dist/listbox/root/listbox-root.js +41 -9
  103. package/dist/loader/root/loader-root.d.ts +5 -0
  104. package/dist/loader/root/loader-root.js +3 -1
  105. package/dist/map/area/map-area.d.ts +5 -0
  106. package/dist/map/area/map-area.js +3 -1
  107. package/dist/map/buildings/map-buildings.d.ts +5 -0
  108. package/dist/map/buildings/map-buildings.js +3 -1
  109. package/dist/map/contours/map-contours.d.ts +5 -0
  110. package/dist/map/contours/map-contours.js +3 -1
  111. package/dist/map/landcover/map-landcover.d.ts +5 -0
  112. package/dist/map/landcover/map-landcover.js +3 -1
  113. package/dist/map/marker/map-marker.d.ts +16 -1
  114. package/dist/map/marker/map-marker.js +13 -5
  115. package/dist/map/points/map-points.d.ts +5 -0
  116. package/dist/map/points/map-points.js +6 -4
  117. package/dist/map/position/map-position.d.ts +5 -0
  118. package/dist/map/position/map-position.js +3 -1
  119. package/dist/map/raster/map-raster.d.ts +5 -0
  120. package/dist/map/raster/map-raster.js +3 -1
  121. package/dist/map/root/map-root.d.ts +33 -14
  122. package/dist/map/root/map-root.js +59 -22
  123. package/dist/map/route/map-route.d.ts +5 -0
  124. package/dist/map/route/map-route.js +3 -1
  125. package/dist/map/terrain/map-terrain.d.ts +5 -0
  126. package/dist/map/terrain/map-terrain.js +3 -1
  127. package/dist/menu/root/menu-root.d.ts +5 -0
  128. package/dist/menu/root/menu-root.js +3 -1
  129. package/dist/meter/root/meter-root.d.ts +16 -3
  130. package/dist/meter/root/meter-root.js +12 -5
  131. package/dist/navigation/root/navigation-root.d.ts +5 -0
  132. package/dist/navigation/root/navigation-root.js +3 -1
  133. package/dist/notifications/notification/notification.d.ts +5 -0
  134. package/dist/notifications/notification/notification.js +3 -1
  135. package/dist/notifications/root/notifications-root.d.ts +8 -0
  136. package/dist/notifications/root/notifications-root.js +10 -2
  137. package/dist/number-input/root/number-input-root.d.ts +21 -8
  138. package/dist/number-input/root/number-input-root.js +26 -11
  139. package/dist/object-inspector/root/object-inspector-root.d.ts +51 -12
  140. package/dist/object-inspector/root/object-inspector-root.js +21 -20
  141. package/dist/outline/root/outline-root.d.ts +5 -0
  142. package/dist/outline/root/outline-root.js +3 -1
  143. package/dist/pagination/root/pagination-root.d.ts +7 -1
  144. package/dist/pagination/root/pagination-root.js +16 -7
  145. package/dist/pagination/size/pagination-size.d.ts +7 -3
  146. package/dist/pagination/size/pagination-size.js +4 -2
  147. package/dist/pagination/summary/pagination-summary.d.ts +8 -6
  148. package/dist/pagination/summary/pagination-summary.js +4 -9
  149. package/dist/pin-input/code.d.ts +6 -6
  150. package/dist/pin-input/code.js +1 -5
  151. package/dist/pin-input/root/pin-input-root.d.ts +9 -3
  152. package/dist/pin-input/root/pin-input-root.js +6 -2
  153. package/dist/popover/root/popover-root.d.ts +12 -2
  154. package/dist/popover/root/popover-root.js +10 -4
  155. package/dist/progress/root/progress-root.d.ts +7 -2
  156. package/dist/progress/root/progress-root.js +5 -2
  157. package/dist/qr-code/name.d.ts +3 -2
  158. package/dist/qr-code/name.js +2 -2
  159. package/dist/qr-code/root/qr-code-root.d.ts +12 -2
  160. package/dist/qr-code/root/qr-code-root.js +9 -2
  161. package/dist/radio/group/radio-group.d.ts +11 -0
  162. package/dist/radio/group/radio-group.js +8 -2
  163. package/dist/rating/root/rating-root.d.ts +12 -1
  164. package/dist/rating/root/rating-root.js +10 -3
  165. package/dist/scatter-chart/root/scatter-chart-root.d.ts +20 -2
  166. package/dist/scatter-chart/root/scatter-chart-root.js +20 -5
  167. package/dist/select/root/select-root.d.ts +11 -0
  168. package/dist/select/root/select-root.js +13 -3
  169. package/dist/skip-link/root/skip-link-root.d.ts +5 -0
  170. package/dist/skip-link/root/skip-link-root.js +3 -1
  171. package/dist/slider/root/slider-root.d.ts +7 -2
  172. package/dist/slider/root/slider-root.js +11 -5
  173. package/dist/sparkline/readings.d.ts +15 -5
  174. package/dist/sparkline/readings.js +3 -3
  175. package/dist/sparkline/root/sparkline-root.d.ts +9 -4
  176. package/dist/sparkline/root/sparkline-root.js +9 -3
  177. package/dist/speed-dial/root/speed-dial-root.d.ts +5 -0
  178. package/dist/speed-dial/root/speed-dial-root.js +4 -1
  179. package/dist/splitter/root/splitter-root.d.ts +6 -1
  180. package/dist/splitter/root/splitter-root.js +9 -4
  181. package/dist/steps/root/steps-root.d.ts +9 -2
  182. package/dist/steps/root/steps-root.js +6 -3
  183. package/dist/steps/step/step.d.ts +12 -0
  184. package/dist/steps/step/step.js +11 -2
  185. package/dist/switch/root/switch-root.d.ts +11 -0
  186. package/dist/switch/root/switch-root.js +8 -2
  187. package/dist/table/column/table-column.d.ts +11 -4
  188. package/dist/table/column/table-column.js +15 -10
  189. package/dist/table/grid-controller.d.ts +8 -3
  190. package/dist/table/grid-controller.js +17 -11
  191. package/dist/table/root/table-root.d.ts +107 -5
  192. package/dist/table/root/table-root.js +122 -20
  193. package/dist/table/row/table-row.d.ts +42 -0
  194. package/dist/table/row/table-row.js +40 -1
  195. package/dist/tabs/root/tabs-root.d.ts +5 -0
  196. package/dist/tabs/root/tabs-root.js +3 -1
  197. package/dist/tag/group/tag-group.d.ts +5 -0
  198. package/dist/tag/group/tag-group.js +3 -1
  199. package/dist/tag/root/tag-root.d.ts +14 -1
  200. package/dist/tag/root/tag-root.js +11 -8
  201. package/dist/textarea/root/textarea-root.d.ts +5 -0
  202. package/dist/textarea/root/textarea-root.js +3 -1
  203. package/dist/time-input/root/time-input-root.d.ts +14 -7
  204. package/dist/time-input/root/time-input-root.js +43 -32
  205. package/dist/time-picker/root/time-picker-root.d.ts +15 -7
  206. package/dist/time-picker/root/time-picker-root.js +25 -12
  207. package/dist/toast/item/toast-item.d.ts +7 -0
  208. package/dist/toast/item/toast-item.js +1 -0
  209. package/dist/toast/root/toast-root.d.ts +9 -1
  210. package/dist/toast/root/toast-root.js +5 -4
  211. package/dist/toolbar/root/toolbar-root.d.ts +5 -0
  212. package/dist/toolbar/root/toolbar-root.js +5 -2
  213. package/dist/tooltip/root/tooltip-root.d.ts +27 -17
  214. package/dist/tour/root/tour-root.d.ts +8 -2
  215. package/dist/tour/root/tour-root.js +4 -2
  216. package/dist/tour/stop/tour-stop.d.ts +5 -0
  217. package/dist/tour/stop/tour-stop.js +6 -1
  218. package/dist/tree/grip.d.ts +5 -0
  219. package/dist/tree/grip.js +1 -0
  220. package/dist/tree/item/tree-item.d.ts +24 -0
  221. package/dist/tree/item/tree-item.js +27 -5
  222. package/dist/tree/root/tree-root.d.ts +66 -1
  223. package/dist/tree/root/tree-root.js +77 -5
  224. package/dist/trend/root/trend-root.d.ts +20 -4
  225. package/dist/trend/root/trend-root.js +20 -5
  226. package/dist/video/root/video-root.d.ts +12 -3
  227. package/dist/video/root/video-root.js +41 -14
  228. package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -0
  229. package/dist/video-playlist/menu/video-playlist-menu.js +3 -1
  230. package/dist/video-playlist/root/video-playlist-root.d.ts +5 -0
  231. package/dist/video-playlist/root/video-playlist-root.js +3 -1
  232. package/dist/virtual-list/root/virtual-list-root.d.ts +19 -3
  233. package/dist/virtual-list/root/virtual-list-root.js +5 -2
  234. package/lint.json +1 -1
  235. package/package.json +9 -8
  236. package/types/jsx.d.ts +4014 -1862
  237. package/types/vue.d.ts +1266 -624
  238. package/types/words.d.ts +3280 -0
  239. package/dist/toast/hotkey.d.ts +0 -22
  240. package/dist/toast/hotkey.js +0 -23
@@ -4,7 +4,7 @@ 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 { AriaForwardController, afterLinkFollowed, customElement, drawAutofill, drawStatus, HelixFormElement, hostAria, hostWords, isRtl, MixinControllerOpen, MixinControllerValue, MixinField, onApple, PopoverController, reportValues, StatusController, typesCharacter, } from '@fusion.dev/helix-core';
7
+ import { AriaForwardController, afterLinkFollowed, customElement, drawAutofill, drawStatus, HelixFormElement, hostAria, hostWords, isRtl, MixinControllerOpen, MixinControllerValue, MixinField, onApple, PopoverController, reportValues, StatusController, typesCharacter, words, wordsLocale, } from '@fusion.dev/helix-core';
8
8
  import { caretDown } from '@fusion.dev/helix-icons';
9
9
  import { nothing } from 'lit';
10
10
  import { property } from 'lit/decorators.js';
@@ -34,6 +34,7 @@ let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(
34
34
  this.multiple = false;
35
35
  this.placeholder = 'Choose';
36
36
  this.position = 'floating';
37
+ this.valueMissingMessage = 'Choose one to continue.';
37
38
  this.panel = new PopoverController(this, {
38
39
  anchor: () => this.partNamed('trigger'),
39
40
  boundary: () => [
@@ -150,6 +151,7 @@ let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(
150
151
  }
151
152
  };
152
153
  }
154
+ static { this.words = 'helix-select'; }
153
155
  get selectedIndex() {
154
156
  return this.listbox?.selectedIndex ?? -1;
155
157
  }
@@ -165,7 +167,7 @@ let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(
165
167
  get display() {
166
168
  const words = this.chosenOptions.map((option) => option.text);
167
169
  if (words.length > 0) {
168
- return new Intl.ListFormat(this.lang || undefined, { style: 'short', type: 'unit' }).format(words);
170
+ return new Intl.ListFormat(wordsLocale(this), { style: 'short', type: 'unit' }).format(words);
169
171
  }
170
172
  return this.value !== '' && !this.childrenKnown ? nothing : this.placeholder;
171
173
  }
@@ -248,7 +250,7 @@ let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(
248
250
  else {
249
251
  this.internals.setFormValue(this.value === '' ? null : this.value);
250
252
  }
251
- this.reportRequired(this.value === '', 'Choose one to continue.', 'trigger');
253
+ this.reportRequired(this.value === '', this.valueMissingMessage, 'trigger');
252
254
  }
253
255
  willUpdate(changed) {
254
256
  super.willUpdate(changed);
@@ -364,6 +366,7 @@ __decorate([
364
366
  property()
365
367
  ], HelixHeadlessSelect.prototype, "autocomplete", void 0);
366
368
  __decorate([
369
+ words,
367
370
  property({ attribute: 'empty-text' })
368
371
  ], HelixHeadlessSelect.prototype, "emptyText", void 0);
369
372
  __decorate([
@@ -373,18 +376,21 @@ __decorate([
373
376
  property({ attribute: false })
374
377
  ], HelixHeadlessSelect.prototype, "focusable", void 0);
375
378
  __decorate([
379
+ words,
376
380
  property({ attribute: 'list-label' })
377
381
  ], HelixHeadlessSelect.prototype, "listLabel", void 0);
378
382
  __decorate([
379
383
  property({ reflect: true, type: Boolean })
380
384
  ], HelixHeadlessSelect.prototype, "loading", void 0);
381
385
  __decorate([
386
+ words,
382
387
  property({ attribute: 'loading-text' })
383
388
  ], HelixHeadlessSelect.prototype, "loadingText", void 0);
384
389
  __decorate([
385
390
  property({ reflect: true, type: Boolean })
386
391
  ], HelixHeadlessSelect.prototype, "multiple", void 0);
387
392
  __decorate([
393
+ words,
388
394
  property()
389
395
  ], HelixHeadlessSelect.prototype, "placeholder", void 0);
390
396
  __decorate([
@@ -393,6 +399,10 @@ __decorate([
393
399
  __decorate([
394
400
  property({ attribute: false })
395
401
  ], HelixHeadlessSelect.prototype, "valueContent", void 0);
402
+ __decorate([
403
+ words,
404
+ property({ attribute: 'value-missing-message' })
405
+ ], HelixHeadlessSelect.prototype, "valueMissingMessage", void 0);
396
406
  HelixHeadlessSelect = __decorate([
397
407
  customElement('helix-headless-select')
398
408
  ], HelixHeadlessSelect);
@@ -35,6 +35,11 @@ import { type TemplateResult } from 'lit';
35
35
  * @csspart link - The anchor. It takes the focus.
36
36
  */
37
37
  export declare class HelixHeadlessSkipLink extends HelixElement {
38
+ /**
39
+ * The key this family's words are registered under, its styled tag:
40
+ * `registerWords('de', { 'helix-skip-link': { label: 'Zum Inhalt springen' } })`.
41
+ */
42
+ static words: string;
38
43
  /** Focus goes to the anchor inside, so the host is never the focus target. */
39
44
  static shadowRootOptions: ShadowRootInit;
40
45
  /**
@@ -4,7 +4,7 @@ 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, elementById, HelixElement, plainClick, reportRuntime, } from '@fusion.dev/helix-core';
7
+ import { customElement, elementById, HelixElement, plainClick, reportRuntime, words, } from '@fusion.dev/helix-core';
8
8
  import { html } from 'lit';
9
9
  import { property } from 'lit/decorators.js';
10
10
  let HelixHeadlessSkipLink = class HelixHeadlessSkipLink extends HelixElement {
@@ -32,6 +32,7 @@ let HelixHeadlessSkipLink = class HelixHeadlessSkipLink extends HelixElement {
32
32
  };
33
33
  this.missed = '';
34
34
  }
35
+ static { this.words = 'helix-skip-link'; }
35
36
  static { this.shadowRootOptions = {
36
37
  ...HelixElement.shadowRootOptions,
37
38
  delegatesFocus: true,
@@ -62,6 +63,7 @@ __decorate([
62
63
  property()
63
64
  ], HelixHeadlessSkipLink.prototype, "href", void 0);
64
65
  __decorate([
66
+ words,
65
67
  property()
66
68
  ], HelixHeadlessSkipLink.prototype, "label", void 0);
67
69
  HelixHeadlessSkipLink = __decorate([
@@ -89,6 +89,11 @@ declare const HelixHeadlessSlider_base: (new (...args: any[]) => import("@fusion
89
89
  * @cssstate invalid - The slider has an error to show, from the browser's validation or from your `feedback`.
90
90
  */
91
91
  export declare class HelixHeadlessSlider extends HelixHeadlessSlider_base {
92
+ /**
93
+ * The key this family's words are registered under, its styled tag:
94
+ * `registerWords('de', { 'helix-slider': { rangeText: '{start} bis {end}' } })`.
95
+ */
96
+ static words: string;
92
97
  protected readonly aria: AriaForwardController;
93
98
  /** Typed or dragged, so every edit is announced. See `announcesInput`. */
94
99
  protected readonly announcesInput = true;
@@ -109,8 +114,8 @@ export declare class HelixHeadlessSlider extends HelixHeadlessSlider_base {
109
114
  */
110
115
  formatter?: (value: number) => string;
111
116
  /**
112
- * The locale `format-options` writes the value in, such as `de-DE`. Empty is
113
- * the reader's own.
117
+ * The locale the value and the words are written in, such as `de-DE`. Empty
118
+ * reads the nearest `lang`, then the browser's language.
114
119
  */
115
120
  locale: string;
116
121
  /**
@@ -4,7 +4,7 @@ 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 { AriaForwardController, customElement, fillTemplate, formatNumber, HelixFormElement, MixinControllerValue, MixinField, restoreValue, } from '@fusion.dev/helix-core';
7
+ import { AriaForwardController, customElement, formatNumber, formatWords, HelixFormElement, MixinControllerValue, MixinField, restoreValue, words, wordsLocale, } from '@fusion.dev/helix-core';
8
8
  import { html, nothing } from 'lit';
9
9
  import { property } from 'lit/decorators.js';
10
10
  let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue(MixinField(HelixFormElement)) {
@@ -51,10 +51,11 @@ let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue
51
51
  };
52
52
  this.valueText = '';
53
53
  }
54
+ static { this.words = 'helix-slider'; }
54
55
  get reserve() {
55
56
  const widest = Math.max(this.said(this.min).length, this.said(this.max).length);
56
57
  return this.range
57
- ? widest * 2 + fillTemplate(this.rangeText, { end: '', start: '' }).length
58
+ ? widest * 2 + formatWords(this, 'rangeText', { end: '', start: '' }).length
58
59
  : widest;
59
60
  }
60
61
  get precision() {
@@ -170,11 +171,13 @@ let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue
170
171
  if (this.formatter) {
171
172
  return this.formatter(number);
172
173
  }
173
- return this.formatOptions ? formatNumber(number, this.locale, this.formatOptions) : String(at);
174
+ return this.formatOptions
175
+ ? formatNumber(number, wordsLocale(this), this.formatOptions)
176
+ : String(at);
174
177
  }
175
178
  spoken(at) {
176
179
  if (this.valueText) {
177
- return fillTemplate(this.valueText, { value: this.said(at) });
180
+ return formatWords(this, 'valueText', { value: this.said(at) });
178
181
  }
179
182
  return this.formats ? this.said(at) : nothing;
180
183
  }
@@ -273,7 +276,7 @@ let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue
273
276
  aria-hidden="true"
274
277
  style=${`--_slider-output-reserve: ${this.reserve}ch`}
275
278
  >${this.range
276
- ? fillTemplate(this.rangeText, { end: this.said(end), start: this.said(start) })
279
+ ? formatWords(this, 'rangeText', { end: this.said(end), start: this.said(start) })
277
280
  : this.said(this.value)}</output
278
281
  >`
279
282
  : nothing}
@@ -300,12 +303,14 @@ __decorate([
300
303
  property({ type: Number })
301
304
  ], HelixHeadlessSlider.prototype, "max", void 0);
302
305
  __decorate([
306
+ words,
303
307
  property({ attribute: 'maximum-label' })
304
308
  ], HelixHeadlessSlider.prototype, "maximumLabel", void 0);
305
309
  __decorate([
306
310
  property({ type: Number })
307
311
  ], HelixHeadlessSlider.prototype, "min", void 0);
308
312
  __decorate([
313
+ words,
309
314
  property({ attribute: 'minimum-label' })
310
315
  ], HelixHeadlessSlider.prototype, "minimumLabel", void 0);
311
316
  __decorate([
@@ -321,6 +326,7 @@ __decorate([
321
326
  property({ reflect: true, type: Boolean })
322
327
  ], HelixHeadlessSlider.prototype, "range", void 0);
323
328
  __decorate([
329
+ words,
324
330
  property({ attribute: 'range-text' })
325
331
  ], HelixHeadlessSlider.prototype, "rangeText", void 0);
326
332
  __decorate([
@@ -27,10 +27,20 @@ export interface Run {
27
27
  * first. Empty where there are no runs.
28
28
  */
29
29
  export declare const areaPath: (runs: readonly Run[], floor: number) => string;
30
+ /** The readings an overview names, each as the readout writes it. */
31
+ export interface Overview {
32
+ /** The first reading. */
33
+ first: string;
34
+ /** The highest reading. */
35
+ high: string;
36
+ /** The last reading. */
37
+ last: string;
38
+ /** The lowest reading. */
39
+ low: string;
40
+ }
30
41
  /**
31
- * What the readings come to, in `template`: `{first}` and `{last}` for the
32
- * first and the last reading, `{high}` and `{low}` for the highest and the
33
- * lowest, each written by `write`. Empty where there are fewer than two
34
- * readings, which make no trend.
42
+ * What the readings come to, as `say` puts it: the first and the last
43
+ * reading, and the highest and the lowest, each written by `write`. Empty
44
+ * where there are fewer than two readings, which make no trend.
35
45
  */
36
- export declare const overviewWords: (template: string, slots: readonly (number | undefined)[], write: (at: number) => string) => string;
46
+ export declare const overviewWords: (say: (overview: Overview) => string, slots: readonly (number | undefined)[], write: (at: number) => string) => string;
@@ -1,4 +1,4 @@
1
- import { extremesOf, fillTemplate } from '@fusion.dev/helix-core';
1
+ import { extremesOf } from '@fusion.dev/helix-core';
2
2
  export const readingWords = (label, text, position) => {
3
3
  const named = label === '' ? text : text === '' ? label : `${label}: ${text}`;
4
4
  return position === '' ? named : `${named} (${position})`;
@@ -19,7 +19,7 @@ export const areaPath = (runs, floor) => runs
19
19
  return `${one.path}L${last[0]},${floor}L${first[0]},${floor}Z`;
20
20
  })
21
21
  .join('');
22
- export const overviewWords = (template, slots, write) => {
22
+ export const overviewWords = (say, slots, write) => {
23
23
  const placed = slots.flatMap((value, at) => (value === undefined ? [] : [at]));
24
24
  const first = placed[0];
25
25
  const last = placed.at(-1);
@@ -27,7 +27,7 @@ export const overviewWords = (template, slots, write) => {
27
27
  if (placed.length < 2 || first === undefined || last === undefined) {
28
28
  return '';
29
29
  }
30
- return fillTemplate(template, {
30
+ return say({
31
31
  first: write(first),
32
32
  high: write(high),
33
33
  last: write(last),
@@ -64,6 +64,11 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
64
64
  * @cssproperty --chart-terminus-y - Where the last point sits vertically, as a percentage.
65
65
  */
66
66
  export declare class HelixHeadlessSparkline extends HelixElement {
67
+ /**
68
+ * The key this family's words are registered under, its styled tag:
69
+ * `registerWords('de', { 'helix-sparkline': { positionLabel: '{position} von {count}' } })`.
70
+ */
71
+ static words: string;
67
72
  /**
68
73
  * How the line is drawn from one reading to the next.
69
74
  *
@@ -114,11 +119,11 @@ export declare class HelixHeadlessSparkline extends HelixElement {
114
119
  */
115
120
  label: string;
116
121
  /**
117
- * The locale the readout's numbers and positions are written in, such as
118
- * `de` for `1.240`.
122
+ * The locale the words, the readout's numbers and positions are in, such
123
+ * as `de` for `1.240`.
119
124
  *
120
- * Absent uses the runtime's own. A table's cells are shown as the table
121
- * writes them, whatever this says.
125
+ * Absent reads the nearest `lang`, then the runtime's own. A table's cells
126
+ * are shown as the table writes them, whatever this says.
122
127
  */
123
128
  locale: string;
124
129
  /**
@@ -4,7 +4,7 @@ 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 { CHART_PLOT, ChartPointerController, customElement, extent, extremesOf, formatNumbers, HelixElement, linear, linePath, PLOT_WIDTH, SourceController, unbroken, writtenList, writtenNumbers, } from '@fusion.dev/helix-core';
7
+ import { CHART_PLOT, ChartPointerController, customElement, extent, extremesOf, formatNumbers, formatWords, HelixElement, linear, linePath, PLOT_WIDTH, SourceController, unbroken, words, wordsLocale, writtenList, writtenNumbers, } from '@fusion.dev/helix-core';
8
8
  import { html, nothing, svg } from 'lit';
9
9
  import { property } from 'lit/decorators.js';
10
10
  import { areaPath, overviewWords, readingWords, slotsOf } from '../readings.js';
@@ -23,6 +23,7 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
23
23
  this.source = new SourceController(this);
24
24
  this.pointer = new ChartPointerController(this);
25
25
  }
26
+ static { this.words = 'helix-sparkline'; }
26
27
  static get observedAttributes() {
27
28
  return [...super.observedAttributes, 'aria-label'];
28
29
  }
@@ -67,7 +68,10 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
67
68
  const rows = this.source.rows;
68
69
  const row = rows[at];
69
70
  if (!row) {
70
- return { label: '', text: value === undefined ? '' : formatNumbers(this.locale)(value) };
71
+ return {
72
+ label: '',
73
+ text: value === undefined ? '' : formatNumbers(wordsLocale(this))(value),
74
+ };
71
75
  }
72
76
  const column = row.cells.findIndex((_, index) => rows.some((one) => one.cells[index]?.value !== undefined));
73
77
  return { label: row.label, text: row.cells[column]?.text ?? '' };
@@ -115,7 +119,7 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
115
119
  const name = this.named;
116
120
  const named = name !== '';
117
121
  const overview = named
118
- ? overviewWords(this.overviewLabel, slots, (index) => this.reading(index, slots[index]).text)
122
+ ? overviewWords((values) => formatWords(this, 'overviewLabel', { ...values }), slots, (index) => this.reading(index, slots[index]).text)
119
123
  : '';
120
124
  return html `<svg
121
125
  aria-describedby=${overview === '' ? nothing : 'sparkline-overview'}
@@ -218,12 +222,14 @@ __decorate([
218
222
  property()
219
223
  ], HelixHeadlessSparkline.prototype, "marks", void 0);
220
224
  __decorate([
225
+ words,
221
226
  property({ attribute: 'overview-label' })
222
227
  ], HelixHeadlessSparkline.prototype, "overviewLabel", void 0);
223
228
  __decorate([
224
229
  property({ reflect: true })
225
230
  ], HelixHeadlessSparkline.prototype, "plot", void 0);
226
231
  __decorate([
232
+ words,
227
233
  property({ attribute: 'position-label' })
228
234
  ], HelixHeadlessSparkline.prototype, "positionLabel", void 0);
229
235
  __decorate([
@@ -70,6 +70,11 @@ declare const HelixHeadlessSpeedDial_base: (new (...args: any[]) => import("@fus
70
70
  * @cssstate open - While the actions are out.
71
71
  */
72
72
  export declare class HelixHeadlessSpeedDial extends HelixHeadlessSpeedDial_base {
73
+ /**
74
+ * The key this family's words are registered under, its styled tag:
75
+ * `registerWords('de', { 'helix-speed-dial': { label: 'Aktionen' } })`.
76
+ */
77
+ static words: string;
73
78
  /**
74
79
  * Accessible name for the trigger and the set of actions it opens.
75
80
  */
@@ -4,7 +4,7 @@ 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 { anchorElement, customElement, drawIcon, focusTarget, HelixElement, KeyboardNavigationController, linkDescription, MixinControllerOpen, PopoverController, slottedWords, tellDisclosure, typeaheadByWords, unlinkDescription, } from '@fusion.dev/helix-core';
7
+ import { anchorElement, customElement, drawIcon, focusTarget, HelixElement, KeyboardNavigationController, linkDescription, MixinControllerOpen, PopoverController, slottedWords, tellDisclosure, typeaheadByWords, unlinkDescription, words, } from '@fusion.dev/helix-core';
8
8
  import { plus } from '@fusion.dev/helix-icons';
9
9
  import { html, nothing } from 'lit';
10
10
  import { property } from 'lit/decorators.js';
@@ -116,6 +116,7 @@ let HelixHeadlessSpeedDial = class HelixHeadlessSpeedDial extends MixinControlle
116
116
  }
117
117
  };
118
118
  }
119
+ static { this.words = 'helix-speed-dial'; }
119
120
  get trigger() {
120
121
  return anchorElement(this.renderRoot?.querySelector('slot[name="trigger"]'), this.partNamed('trigger') ?? this);
121
122
  }
@@ -240,9 +241,11 @@ let HelixHeadlessSpeedDial = class HelixHeadlessSpeedDial extends MixinControlle
240
241
  }
241
242
  };
242
243
  __decorate([
244
+ words,
243
245
  property()
244
246
  ], HelixHeadlessSpeedDial.prototype, "label", void 0);
245
247
  __decorate([
248
+ words,
246
249
  property({ attribute: 'long-press-label' })
247
250
  ], HelixHeadlessSpeedDial.prototype, "longPressLabel", void 0);
248
251
  __decorate([
@@ -15,7 +15,7 @@ import { type PropertyValues, type TemplateResult } from 'lit';
15
15
  *
16
16
  * The divider has `role="separator"` and `aria-valuenow`, with
17
17
  * `aria-valuetext` saying the start pane's share as a percentage in the
18
- * reader's locale, and `aria-controls` names the start pane. Drag it with a pointer or move it with the arrow keys,
18
+ * nearest `lang`, or in the reader's locale where no `lang` is set, and `aria-controls` names the start pane. Drag it with a pointer or move it with the arrow keys,
19
19
  * press `Home` or `End` to move it to its bounds, and press `Enter` to collapse
20
20
  * the start pane and open it again. A drag in progress is tracked as a state, so both dividers a
21
21
  * corner moves stay lit for as long as they move.
@@ -59,6 +59,11 @@ import { type PropertyValues, type TemplateResult } from 'lit';
59
59
  * @cssstate vertical - While the panes are one above the other, whether `orientation` says so or `auto` turned them.
60
60
  */
61
61
  export declare class HelixHeadlessSplitter extends HelixElement {
62
+ /**
63
+ * The key this family's words are registered under, its styled tag:
64
+ * `registerWords('de', { 'helix-splitter': { label: 'Bereiche anpassen' } })`.
65
+ */
66
+ static words: string;
62
67
  /**
63
68
  * Which pane is shut, if either.
64
69
  *
@@ -5,13 +5,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  var HelixHeadlessSplitter_1;
8
- import { AriaForwardController, capturePointer, closestInstance, commaList, customElement, formatPercent, HelixBeforeCollapseEvent, HelixBeforeResizeEvent, HelixCollapseEvent, HelixElement, HelixResizedEvent, inlineStep, isRtl, requestChange, } from '@fusion.dev/helix-core';
8
+ import { AriaForwardController, capturePointer, closestInstance, commaList, customElement, formatPercent, HelixBeforeCollapseEvent, HelixBeforeResizeEvent, HelixCollapseEvent, HelixElement, HelixResizedEvent, inlineStep, isRtl, requestChange, words, wordsLocale, } from '@fusion.dev/helix-core';
9
9
  import { html, nothing } from 'lit';
10
10
  import { property, state } from 'lit/decorators.js';
11
11
  import { snapTo } from '../snap.js';
12
12
  const STACK_BELOW = 512;
13
13
  const channel = new WeakMap();
14
- let HelixHeadlessSplitter = HelixHeadlessSplitter_1 = class HelixHeadlessSplitter extends HelixElement {
14
+ let HelixHeadlessSplitter = class HelixHeadlessSplitter extends HelixElement {
15
+ static { HelixHeadlessSplitter_1 = this; }
16
+ static { this.words = 'helix-splitter'; }
15
17
  get collapsed() {
16
18
  const held = this.collapsedState;
17
19
  if (held === undefined) {
@@ -504,7 +506,7 @@ let HelixHeadlessSplitter = HelixHeadlessSplitter_1 = class HelixHeadlessSplitte
504
506
  ? this.collapsedLabel
505
507
  : this.hydrating
506
508
  ? nothing
507
- : formatPercent(Math.round(position) / 100)}
509
+ : formatPercent(Math.round(position) / 100, wordsLocale(this))}
508
510
  ?data-dragging=${this.dragging}
509
511
  ?data-flush=${this.flush}
510
512
  @dblclick=${this.handleDoubleClick}
@@ -528,7 +530,7 @@ let HelixHeadlessSplitter = HelixHeadlessSplitter_1 = class HelixHeadlessSplitte
528
530
  aria-valuemax="100"
529
531
  aria-valuemin="0"
530
532
  aria-valuenow=${Math.round(crossing.at)}
531
- aria-valuetext=${formatPercent(Math.round(crossing.at) / 100)}
533
+ aria-valuetext=${formatPercent(Math.round(crossing.at) / 100, wordsLocale(this))}
532
534
  data-cross=${index}
533
535
  style="--splitter-corner-at: ${crossing.at}%; --splitter-position: ${position}%"
534
536
  @dblclick=${this.handleCornerDoubleClick}
@@ -544,12 +546,14 @@ __decorate([
544
546
  property()
545
547
  ], HelixHeadlessSplitter.prototype, "collapsed", null);
546
548
  __decorate([
549
+ words,
547
550
  property({ attribute: 'collapsed-label' })
548
551
  ], HelixHeadlessSplitter.prototype, "collapsedLabel", void 0);
549
552
  __decorate([
550
553
  property({ attribute: 'collapsed-size', type: Number })
551
554
  ], HelixHeadlessSplitter.prototype, "collapsedSize", void 0);
552
555
  __decorate([
556
+ words,
553
557
  property({ attribute: 'corner-label' })
554
558
  ], HelixHeadlessSplitter.prototype, "cornerLabel", void 0);
555
559
  __decorate([
@@ -559,6 +563,7 @@ __decorate([
559
563
  property({ attribute: 'default-position', type: Number })
560
564
  ], HelixHeadlessSplitter.prototype, "defaultPosition", void 0);
561
565
  __decorate([
566
+ words,
562
567
  property()
563
568
  ], HelixHeadlessSplitter.prototype, "label", void 0);
564
569
  __decorate([
@@ -58,6 +58,11 @@ declare const HelixHeadlessSteps_base: (new (...args: any[]) => import("@fusion.
58
58
  * @cssstate complete - Every stage is complete.
59
59
  */
60
60
  export declare class HelixHeadlessSteps extends HelixHeadlessSteps_base {
61
+ /**
62
+ * The key this family's words are registered under, its styled tag:
63
+ * `registerWords('de', { 'helix-steps': { progressLabel: '{share, number, percent} erledigt' } })`.
64
+ */
65
+ static words: string;
61
66
  /**
62
67
  * The sequence's name, read by screen readers.
63
68
  *
@@ -85,8 +90,10 @@ export declare class HelixHeadlessSteps extends HelixHeadlessSteps_base {
85
90
  */
86
91
  orientation?: 'vertical';
87
92
  /**
88
- * What the `progress` part says to a screen reader, with `{percent}` filled
89
- * in with `progress`.
93
+ * What the `progress` part says to a screen reader. `{share, number,
94
+ * percent}` writes `progress` as a percentage the way the locale writes one,
95
+ * such as `40%`, or `40 %` in French. `{percent}` is `progress` as a whole
96
+ * number, for a sentence that places the sign itself.
90
97
  */
91
98
  progressLabel: string;
92
99
  /**
@@ -4,7 +4,7 @@ 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, fillTemplate, HelixElement, hostAria, MixinControllerActive, whenHydrated, } from '@fusion.dev/helix-core';
7
+ import { customElement, formatWords, HelixElement, hostAria, MixinControllerActive, whenHydrated, words, } from '@fusion.dev/helix-core';
8
8
  import { html } from 'lit';
9
9
  import { property } from 'lit/decorators.js';
10
10
  import { canReach, progressOf } from '../reach.js';
@@ -13,7 +13,7 @@ let HelixHeadlessSteps = class HelixHeadlessSteps extends MixinControllerActive(
13
13
  super(...arguments);
14
14
  this.label = 'Steps';
15
15
  this.linear = false;
16
- this.progressLabel = '{percent}% complete';
16
+ this.progressLabel = '{share, number, percent} complete';
17
17
  this.handleSelection = (event) => {
18
18
  if (event.defaultPrevented || !this.steps.includes(event.target)) {
19
19
  return;
@@ -29,6 +29,7 @@ let HelixHeadlessSteps = class HelixHeadlessSteps extends MixinControllerActive(
29
29
  this.lock();
30
30
  };
31
31
  }
32
+ static { this.words = 'helix-steps'; }
32
33
  get progress() {
33
34
  return progressOf(this.steps);
34
35
  }
@@ -141,13 +142,14 @@ let HelixHeadlessSteps = class HelixHeadlessSteps extends MixinControllerActive(
141
142
  aria-valuemin="0"
142
143
  aria-valuemax="100"
143
144
  aria-valuenow=${progress}
144
- aria-valuetext=${fillTemplate(this.progressLabel, { percent: String(progress) })}
145
+ aria-valuetext=${formatWords(this, 'progressLabel', { percent: progress, share: progress / 100 })}
145
146
  style="--steps-progress: ${progress}%"
146
147
  hidden
147
148
  ></div>`;
148
149
  }
149
150
  };
150
151
  __decorate([
152
+ words,
151
153
  property()
152
154
  ], HelixHeadlessSteps.prototype, "label", void 0);
153
155
  __decorate([
@@ -157,6 +159,7 @@ __decorate([
157
159
  property({ reflect: true })
158
160
  ], HelixHeadlessSteps.prototype, "orientation", void 0);
159
161
  __decorate([
162
+ words,
160
163
  property({ attribute: 'progress-label' })
161
164
  ], HelixHeadlessSteps.prototype, "progressLabel", void 0);
162
165
  __decorate([
@@ -55,10 +55,22 @@ import '../../button/index.js';
55
55
  * @cssstate invalid - The sequence's `validate` last answered that this stage is not valid.
56
56
  */
57
57
  export declare class HelixHeadlessStep extends HelixElement {
58
+ /**
59
+ * The key this family's words are registered under, its styled tag:
60
+ * `registerWords('de', { 'helix-step': { completeLabel: 'Erledigt' } })`.
61
+ */
62
+ static words: string;
58
63
  /**
59
64
  * Whether this stage is finished.
60
65
  */
61
66
  complete: boolean;
67
+ /**
68
+ * What a screen reader hears when the stage is finished while the page is
69
+ * open. `{name}` is the stage's name and `{complete}` is `complete-label`, so
70
+ * a language can write the whole sentence in its own order. A stage with no
71
+ * name says `complete-label` alone.
72
+ */
73
+ completedLabel: string;
62
74
  /**
63
75
  * The words that tell a screen reader the stage is finished. Translate it
64
76
  * with the page.
@@ -4,7 +4,7 @@ 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, drawStatus, HelixElement, HelixSelectEvent, hostAria, StatusController, slottedWords, } from '@fusion.dev/helix-core';
7
+ import { customElement, drawStatus, formatWords, HelixElement, HelixSelectEvent, hostAria, StatusController, slottedWords, words, } from '@fusion.dev/helix-core';
8
8
  import { check, circle, record } from '@fusion.dev/helix-icons';
9
9
  import { nothing } from 'lit';
10
10
  import { property } from 'lit/decorators.js';
@@ -15,6 +15,7 @@ let HelixHeadlessStep = class HelixHeadlessStep extends HelixElement {
15
15
  constructor() {
16
16
  super(...arguments);
17
17
  this.complete = false;
18
+ this.completedLabel = '{name}, {complete}';
18
19
  this.completeLabel = 'Complete';
19
20
  this.current = false;
20
21
  this.disabled = false;
@@ -24,6 +25,7 @@ let HelixHeadlessStep = class HelixHeadlessStep extends HelixElement {
24
25
  this.value = '';
25
26
  this.status = new StatusController(this);
26
27
  }
28
+ static { this.words = 'helix-step'; }
27
29
  select() {
28
30
  if (this.disabled || this.locked) {
29
31
  return;
@@ -47,7 +49,9 @@ let HelixHeadlessStep = class HelixHeadlessStep extends HelixElement {
47
49
  super.updated(changed);
48
50
  if (changed.get('complete') === false && this.complete) {
49
51
  const name = slottedWords(this, ['']);
50
- this.status.say(name === '' ? this.completeLabel : `${name}, ${this.completeLabel}`);
52
+ this.status.say(name === ''
53
+ ? this.completeLabel
54
+ : formatWords(this, 'completedLabel', { complete: this.completeLabel, name }));
51
55
  }
52
56
  }
53
57
  renderLabel() {
@@ -78,6 +82,11 @@ __decorate([
78
82
  property({ reflect: true, type: Boolean })
79
83
  ], HelixHeadlessStep.prototype, "complete", void 0);
80
84
  __decorate([
85
+ words,
86
+ property({ attribute: 'completed-label' })
87
+ ], HelixHeadlessStep.prototype, "completedLabel", void 0);
88
+ __decorate([
89
+ words,
81
90
  property({ attribute: 'complete-label' })
82
91
  ], HelixHeadlessStep.prototype, "completeLabel", void 0);
83
92
  __decorate([
@@ -58,6 +58,11 @@ declare const HelixHeadlessSwitch_base: (new (...args: any[]) => import("@fusion
58
58
  * @cssstate invalid - The control has an error to show, from the browser's validation or from your `feedback`.
59
59
  */
60
60
  export declare class HelixHeadlessSwitch extends HelixHeadlessSwitch_base {
61
+ /**
62
+ * The key this family's words are registered under, its styled tag:
63
+ * `registerWords('de', { 'helix-switch': { valueMissingMessage: '...' } })`.
64
+ */
65
+ static words: string;
61
66
  protected readonly aria: AriaForwardController;
62
67
  /** A click on the element itself, `click()` or a page's `<label for>`, toggles it. */
63
68
  protected readonly clicks: HostClickController;
@@ -65,6 +70,12 @@ export declare class HelixHeadlessSwitch extends HelixHeadlessSwitch_base {
65
70
  * Value submitted when the switch is on.
66
71
  */
67
72
  value: string;
73
+ /**
74
+ * The message reported when the field is required and the switch is off.
75
+ * Absent, or empty, is this sentence, or the words registered for the page's
76
+ * locale.
77
+ */
78
+ valueMissingMessage: string;
68
79
  private readonly handleChange;
69
80
  /** Reports what the form would submit, and the verdict on it. */
70
81
  private sync;