@fusion.dev/helix-headless 0.148.0 → 0.149.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 (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 +7 -6
  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
@@ -90,6 +90,11 @@ import '../../copy-button/index.js';
90
90
  * @cssstate expanded - The expand button has shown every line of a capped block.
91
91
  */
92
92
  export declare class HelixHeadlessCodeBlock extends HelixElement {
93
+ /**
94
+ * The key this family's words are registered under, its styled tag:
95
+ * `registerWords('de', { 'helix-code-block': { copyLabel: 'Code kopieren' } })`.
96
+ */
97
+ static words: string;
93
98
  /**
94
99
  * The expand button's words while the block shows every line.
95
100
  */
@@ -102,10 +107,15 @@ export declare class HelixHeadlessCodeBlock extends HelixElement {
102
107
  * The copy button's name and tooltip text before a copy.
103
108
  *
104
109
  * Where the block has a name, the button says it too, such as "Copy code,
105
- * app.ts", so each copy button on a page with several blocks is told apart.
106
- * In a diff, that is each file's own name.
110
+ * app.ts", as `copy-name-label` puts it, so each copy button on a page with
111
+ * several blocks is told apart. In a diff, that is each file's own name.
107
112
  */
108
113
  copyLabel: string;
114
+ /**
115
+ * The copy button's name and tooltip text before a copy, where the block
116
+ * has a name. `{copy}` is `copy-label` and `{name}` the block's name.
117
+ */
118
+ copyNameLabel: string;
109
119
  /**
110
120
  * Whether the content is a unified diff, drawn as the lines it changed.
111
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 { customElement, HelixElement } from '@fusion.dev/helix-core';
7
+ import { customElement, formatWords, HelixElement, words } from '@fusion.dev/helix-core';
8
8
  import { nothing } from 'lit';
9
9
  import { property, state } from 'lit/decorators.js';
10
10
  import { unsafeHTML } from 'lit/directives/unsafe-html.js';
@@ -19,6 +19,7 @@ let HelixHeadlessCodeBlock = class HelixHeadlessCodeBlock extends HelixElement {
19
19
  this.collapseLabel = 'Show fewer lines';
20
20
  this.copiedLabel = 'Copied';
21
21
  this.copyLabel = 'Copy code';
22
+ this.copyNameLabel = '{copy}, {name}';
22
23
  this.diff = false;
23
24
  this.expandable = false;
24
25
  this.expandLabel = 'Show all lines';
@@ -38,6 +39,7 @@ let HelixHeadlessCodeBlock = class HelixHeadlessCodeBlock extends HelixElement {
38
39
  }
39
40
  };
40
41
  }
42
+ static { this.words = 'helix-code-block'; }
41
43
  get files() {
42
44
  if (!this.diff) {
43
45
  return [];
@@ -150,7 +152,7 @@ let HelixHeadlessCodeBlock = class HelixHeadlessCodeBlock extends HelixElement {
150
152
  tooltip-arrow-top: copy-tooltip-arrow-top, tooltip-bottom: copy-tooltip-bottom,
151
153
  tooltip-left: copy-tooltip-left, tooltip-right: copy-tooltip-right, tooltip-top: copy-tooltip-top"
152
154
  copied-label=${this.copiedLabel}
153
- label=${name ? `${this.copyLabel}, ${name}` : this.copyLabel}
155
+ label=${name ? formatWords(this, 'copyNameLabel', { copy: this.copyLabel, name }) : this.copyLabel}
154
156
  .value=${value}
155
157
  ></${this.tag('copy-button')}>`;
156
158
  }
@@ -203,14 +205,21 @@ let HelixHeadlessCodeBlock = class HelixHeadlessCodeBlock extends HelixElement {
203
205
  }
204
206
  };
205
207
  __decorate([
208
+ words,
206
209
  property({ attribute: 'collapse-label' })
207
210
  ], HelixHeadlessCodeBlock.prototype, "collapseLabel", void 0);
208
211
  __decorate([
212
+ words,
209
213
  property({ attribute: 'copied-label' })
210
214
  ], HelixHeadlessCodeBlock.prototype, "copiedLabel", void 0);
211
215
  __decorate([
216
+ words,
212
217
  property({ attribute: 'copy-label' })
213
218
  ], HelixHeadlessCodeBlock.prototype, "copyLabel", void 0);
219
+ __decorate([
220
+ words,
221
+ property({ attribute: 'copy-name-label' })
222
+ ], HelixHeadlessCodeBlock.prototype, "copyNameLabel", void 0);
214
223
  __decorate([
215
224
  property({ reflect: true, type: Boolean })
216
225
  ], HelixHeadlessCodeBlock.prototype, "diff", void 0);
@@ -218,6 +227,7 @@ __decorate([
218
227
  property({ type: Boolean })
219
228
  ], HelixHeadlessCodeBlock.prototype, "expandable", void 0);
220
229
  __decorate([
230
+ words,
221
231
  property({ attribute: 'expand-label' })
222
232
  ], HelixHeadlessCodeBlock.prototype, "expandLabel", void 0);
223
233
  __decorate([
@@ -115,6 +115,11 @@ declare const HelixHeadlessColorInput_base: (new (...args: any[]) => import("@fu
115
115
  * @cssstate open - While the picker is open.
116
116
  */
117
117
  export declare class HelixHeadlessColorInput extends HelixHeadlessColorInput_base {
118
+ /**
119
+ * The key this family's words are registered under, its styled tag:
120
+ * `registerWords('de', { 'helix-color-input': { triggerLabel: 'Farbe auswählen' } })`.
121
+ */
122
+ static words: string;
118
123
  protected readonly aria: AriaForwardController;
119
124
  /**
120
125
  * Whether the color carries an alpha channel.
@@ -180,6 +185,12 @@ export declare class HelixHeadlessColorInput extends HelixHeadlessColorInput_bas
180
185
  * Colors offered under the picker, as a comma-separated list.
181
186
  */
182
187
  swatches: string;
188
+ /**
189
+ * What the swatch says in `variant="swatch"`, after the field's label, once
190
+ * there is a color. `{name}` is the color's name, such as "vibrant red", and
191
+ * `{value}` the value as written.
192
+ */
193
+ swatchLabel: string;
183
194
  /**
184
195
  * Accessible name for the control that opens the panel.
185
196
  */
@@ -232,6 +243,8 @@ export declare class HelixHeadlessColorInput extends HelixHeadlessColorInput_bas
232
243
  * field. It carries `id="control"` there for the same reason.
233
244
  */
234
245
  protected get anchor(): HTMLElement | null;
246
+ /** The swatch's words in `swatch`, which its label points at, and never drawn. */
247
+ private renderSwatchValue;
235
248
  /** What the picker should show, which is only ever a color. */
236
249
  private get picked();
237
250
  /**
@@ -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, colorName, customElement, HelixFormElement, localeOf, MixinControllerOpen, MixinControllerValue, MixinField, MixinPickerField, parseColor, toCss, wordsConverter, } from '@fusion.dev/helix-core';
7
+ import { AriaForwardController, colorName, customElement, formatWords, HelixFormElement, MixinControllerOpen, MixinControllerValue, MixinField, MixinPickerField, parseColor, toCss, words, wordsConverter, wordsLocale, } 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';
@@ -24,6 +24,7 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinPickerF
24
24
  this.readOnly = false;
25
25
  this.announcesInput = true;
26
26
  this.swatches = '';
27
+ this.swatchLabel = '{name} {value}';
27
28
  this.triggerLabel = 'Choose a color';
28
29
  this.wheel = false;
29
30
  this.settled = '';
@@ -55,6 +56,7 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinPickerF
55
56
  this.requestOpen(true);
56
57
  };
57
58
  }
59
+ static { this.words = 'helix-color-input'; }
58
60
  requestValue(next) {
59
61
  if (this.readOnly) {
60
62
  return false;
@@ -70,6 +72,11 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinPickerF
70
72
  get anchor() {
71
73
  return this.control ?? this.partNamed('trigger');
72
74
  }
75
+ renderSwatchValue() {
76
+ return this.variant === 'swatch'
77
+ ? html `<span id="swatch-value" hidden>${this.swatchWords}</span>`
78
+ : nothing;
79
+ }
73
80
  get picked() {
74
81
  return parseColor(this.value) ? this.value : this.settled;
75
82
  }
@@ -78,7 +85,10 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinPickerF
78
85
  if (!parsed) {
79
86
  return this.value || this.triggerLabel;
80
87
  }
81
- return `${colorName(parsed, this.colorWords, localeOf(this))} ${this.value}`;
88
+ return formatWords(this, 'swatchLabel', {
89
+ name: colorName(parsed, this.colorWords, wordsLocale(this)),
90
+ value: this.value,
91
+ });
82
92
  }
83
93
  get painted() {
84
94
  const parsed = parseColor(this.value);
@@ -199,9 +209,7 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinPickerF
199
209
  style="--color-input-swatch: ${this.value === '' ? 'transparent' : this.painted}"
200
210
  ></span>
201
211
  <slot name="trigger"></slot>
202
- ${this.variant === 'swatch'
203
- ? html `<span id="swatch-value" hidden>${this.swatchWords}</span>`
204
- : nothing}
212
+ ${this.renderSwatchValue()}
205
213
  </button>
206
214
  </div>
207
215
 
@@ -249,6 +257,11 @@ __decorate([
249
257
  property()
250
258
  ], HelixHeadlessColorInput.prototype, "swatches", void 0);
251
259
  __decorate([
260
+ words,
261
+ property({ attribute: 'swatch-label' })
262
+ ], HelixHeadlessColorInput.prototype, "swatchLabel", void 0);
263
+ __decorate([
264
+ words,
252
265
  property({ attribute: 'trigger-label' })
253
266
  ], HelixHeadlessColorInput.prototype, "triggerLabel", void 0);
254
267
  __decorate([
@@ -103,6 +103,11 @@ declare const HelixHeadlessColorPicker_base: (new (...args: any[]) => import("@f
103
103
  * @cssstate invalid - While `invalid` is set or `feedback` says what is wrong.
104
104
  */
105
105
  export declare class HelixHeadlessColorPicker extends HelixHeadlessColorPicker_base {
106
+ /**
107
+ * The key this family's words are registered under, its styled tag:
108
+ * `registerWords('de', { 'helix-color-picker': { hueLabel: 'Farbton' } })`.
109
+ */
110
+ static words: string;
106
111
  /**
107
112
  * Whether the color carries an alpha channel.
108
113
  *
@@ -122,7 +127,7 @@ export declare class HelixHeadlessColorPicker extends HelixHeadlessColorPicker_b
122
127
  /**
123
128
  * The message shown when the value is text that is not a color.
124
129
  */
125
- badInputMessage?: string;
130
+ badInputMessage: string;
126
131
  /**
127
132
  * What the blue channel's field is called, in `channel-fields`.
128
133
  */
@@ -288,6 +293,16 @@ export declare class HelixHeadlessColorPicker extends HelixHeadlessColorPicker_b
288
293
  * What the square's horizontal ramp is called.
289
294
  */
290
295
  saturationLabel: string;
296
+ /**
297
+ * What a screen reader hears for the square's place, the color's two
298
+ * numbers and its name, on whichever of its two inputs it is on.
299
+ * `{first}` is `saturation` or `brightness`, the input's own channel, which
300
+ * is said first, so each order is its whole sentence. `{saturation}` and
301
+ * `{brightness}` are shares from 0 to 1, written as percentages with
302
+ * `number, percent`, `{saturationLabel}` and `{brightnessLabel}` the
303
+ * channels' names, and `{name}` the color's, such as "vibrant red".
304
+ */
305
+ squareText: string;
291
306
  /**
292
307
  * Colors offered under the picker, as a comma-separated list.
293
308
  */
@@ -305,9 +320,10 @@ export declare class HelixHeadlessColorPicker extends HelixHeadlessColorPicker_b
305
320
  *
306
321
  * **Every sentence a control raises in the browser's bubble is a property**,
307
322
  * named for the validity flag it reports, so a form in another language
308
- * speaks it. Absent is the control's own sentence, in English.
323
+ * speaks it. Unset is the sentence registered for the page's language, then
324
+ * the English.
309
325
  */
310
- valueMissingMessage?: string;
326
+ valueMissingMessage: string;
311
327
  /**
312
328
  * Draws the hue as a wheel around the square, in place of the hue ramp, as
313
329
  * React Aria's ColorWheel sits round its ColorArea.
@@ -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 { CopyController, capturePointer, clamp, colorName, customElement, drawIcon, fillTemplate, focusItemOf, formatColor, formatNumber, HelixFormElement, HelixSampleEndEvent, HelixSampleStartEvent, hostAria, hueName, isRtl, KeyboardNavigationController, localeOf, MixinControllerValue, MixinPickerFeedback, parseColor, rovingStop, splitValues, toCss, wordsConverter, } from '@fusion.dev/helix-core';
7
+ import { CopyController, capturePointer, clamp, colorName, customElement, drawIcon, focusItemOf, formatColor, formatNumber, formatWords, HelixFormElement, HelixSampleEndEvent, HelixSampleStartEvent, hostAria, hueName, isRtl, KeyboardNavigationController, MixinControllerValue, MixinPickerFeedback, parseColor, rovingStop, splitValues, toCss, words, wordsConverter, wordsLocale, } from '@fusion.dev/helix-core';
8
8
  import { eyedropper } from '@fusion.dev/helix-icons';
9
9
  import { nothing } from 'lit';
10
10
  import { property, state } from 'lit/decorators.js';
@@ -22,6 +22,7 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
22
22
  super(...arguments);
23
23
  this.alpha = false;
24
24
  this.autocomplete = 'off';
25
+ this.badInputMessage = 'Enter a color, like #ff0000, rgb(255 0 0) or hsl(0 100% 50%).';
25
26
  this.blueLabel = 'Blue';
26
27
  this.brightnessLabel = 'Brightness';
27
28
  this.channelFields = false;
@@ -42,9 +43,11 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
42
43
  this.redLabel = 'Red';
43
44
  this.required = false;
44
45
  this.saturationLabel = 'Saturation';
46
+ this.squareText = '{first, select, brightness {{brightnessLabel} {brightness, number, percent}, {saturationLabel} {saturation, number, percent}, {name}} other {{saturationLabel} {saturation, number, percent}, {brightnessLabel} {brightness, number, percent}, {name}}}';
45
47
  this.swatches = '';
46
48
  this.toolsLabel = 'Color tools';
47
49
  this.valueLabel = 'Color';
50
+ this.valueMissingMessage = 'Choose a color.';
48
51
  this.wheel = false;
49
52
  this.sampling = false;
50
53
  this.owned = false;
@@ -228,6 +231,7 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
228
231
  event.stopPropagation();
229
232
  };
230
233
  }
234
+ static { this.words = 'helix-color-picker'; }
231
235
  settle() {
232
236
  if (this.unsettled) {
233
237
  this.unsettled = false;
@@ -264,11 +268,11 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
264
268
  }
265
269
  reportRequired() {
266
270
  if (this.required && this.value === '') {
267
- this.internals.setValidity({ valueMissing: true }, this.valueMissingMessage || 'Choose a color.', this.partNamed('grid') ?? undefined);
271
+ this.internals.setValidity({ valueMissing: true }, this.valueMissingMessage, this.partNamed('grid') ?? undefined);
268
272
  return;
269
273
  }
270
274
  if (this.value !== '' && parseColor(this.value) === null) {
271
- this.internals.setValidity({ badInput: true }, this.badInputMessage || 'Enter a color, like #ff0000, rgb(255 0 0) or hsl(0 100% 50%).', this.partNamed('value') ?? this.partNamed('grid') ?? undefined);
275
+ this.internals.setValidity({ badInput: true }, this.badInputMessage, this.partNamed('value') ?? this.partNamed('grid') ?? undefined);
272
276
  return;
273
277
  }
274
278
  this.internals.setValidity({});
@@ -410,7 +414,7 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
410
414
  : html `<${this.tag('button')}
411
415
  part="format"
412
416
  exportparts="button: format-button, live: format-live, spinner: format-spinner, text: format-text"
413
- label=${fillTemplate(this.formatLabel, { format: this.format ?? 'hex' })}
417
+ label=${formatWords(this, 'formatLabel', { format: this.format ?? 'hex' })}
414
418
  ?disabled=${this.isDisabled}
415
419
  @click=${this.handleFormat}
416
420
  >
@@ -439,7 +443,7 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
439
443
  type="button"
440
444
  role="option"
441
445
  tabindex=${index === stop ? '0' : '-1'}
442
- aria-label=${parsed ? colorName(parsed, this.colorWords, localeOf(this)) : preset}
446
+ aria-label=${parsed ? colorName(parsed, this.colorWords, wordsLocale(this)) : preset}
443
447
  aria-selected=${chosen[index] ? 'true' : 'false'}
444
448
  style="--color-picker-swatch: ${preset}"
445
449
  ?disabled=${this.isDisabled}
@@ -454,10 +458,19 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
454
458
  render() {
455
459
  const color = this.color;
456
460
  const painted = toCss(color);
457
- const named = colorName(color, this.colorWords, localeOf(this));
458
- const both = `${this.saturationLabel} ${color.saturation}%, ${this.brightnessLabel} ${color.brightness}%, ${named}`;
459
- const reversed = `${this.brightnessLabel} ${color.brightness}%, ${this.saturationLabel} ${color.saturation}%, ${named}`;
460
- const hue = hueName({ alpha: 100, brightness: 100, hue: color.hue, saturation: 100 }, this.colorWords, localeOf(this));
461
+ const locale = wordsLocale(this);
462
+ const square = (first) => formatWords(this, 'squareText', {
463
+ brightness: color.brightness / 100,
464
+ brightnessLabel: this.brightnessLabel,
465
+ first,
466
+ name: colorName(color, this.colorWords, locale),
467
+ saturation: color.saturation / 100,
468
+ saturationLabel: this.saturationLabel,
469
+ });
470
+ const both = square('saturation');
471
+ const reversed = square('brightness');
472
+ const hue = hueName({ alpha: 100, brightness: 100, hue: color.hue, saturation: 100 }, this.colorWords, locale);
473
+ const hueSaid = (value) => new Intl.ListFormat(locale, { style: 'short', type: 'unit' }).format([String(value), hue]);
461
474
  const owner = this.getAttribute('aria-label')?.trim();
462
475
  const axisName = (channel) => (owner ? `${owner}, ${channel}` : channel);
463
476
  const area = html `<div
@@ -518,7 +531,7 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
518
531
  dir="ltr"
519
532
  aria-label=${axisName(this.hueLabel)}
520
533
  aria-describedby=${this.feedback === '' ? nothing : 'feedback'}
521
- aria-valuetext=${`${color.hue}, ${hue}`}
534
+ aria-valuetext=${hueSaid(color.hue)}
522
535
  aria-invalid=${this.marked ? 'true' : nothing}
523
536
  .value=${String(color.hue)}
524
537
  ?disabled=${this.isDisabled}
@@ -535,15 +548,15 @@ let HelixHeadlessColorPicker = class HelixHeadlessColorPicker extends MixinPicke
535
548
  type="button"
536
549
  aria-label=${this.copier.copied
537
550
  ? this.copiedLabel
538
- : fillTemplate(this.copyLabel, { value: this.value }).trim()}
551
+ : formatWords(this, 'copyLabel', { value: this.value }).trim()}
539
552
  data-copied=${this.copier.copied ? '' : nothing}
540
553
  ?disabled=${this.isDisabled || this.value === ''}
541
554
  @click=${() => this.copier.copy(this.value)}
542
555
  ></button>
543
556
  <div part="channels">
544
- ${this.wheel ? nothing : this.renderChannel('hue', this.hueLabel, 360, color.hue, `{value}, ${hue}`)}
557
+ ${this.wheel ? nothing : this.renderChannel('hue', this.hueLabel, 360, color.hue, hueSaid('{value}'))}
545
558
  ${this.alpha
546
- ? this.renderChannel('alpha', this.opacityLabel, 100, color.alpha, formatNumber(color.alpha / 100, localeOf(this), { style: 'percent' }))
559
+ ? this.renderChannel('alpha', this.opacityLabel, 100, color.alpha, formatNumber(color.alpha / 100, locale, { style: 'percent' }))
547
560
  : nothing}
548
561
  </div>
549
562
  </div>
@@ -587,12 +600,15 @@ __decorate([
587
600
  property()
588
601
  ], HelixHeadlessColorPicker.prototype, "autocomplete", void 0);
589
602
  __decorate([
603
+ words,
590
604
  property({ attribute: 'bad-input-message' })
591
605
  ], HelixHeadlessColorPicker.prototype, "badInputMessage", void 0);
592
606
  __decorate([
607
+ words,
593
608
  property({ attribute: 'blue-label' })
594
609
  ], HelixHeadlessColorPicker.prototype, "blueLabel", void 0);
595
610
  __decorate([
611
+ words,
596
612
  property({ attribute: 'brightness-label' })
597
613
  ], HelixHeadlessColorPicker.prototype, "brightnessLabel", void 0);
598
614
  __decorate([
@@ -602,27 +618,34 @@ __decorate([
602
618
  property({ attribute: 'color-words', converter: wordsConverter })
603
619
  ], HelixHeadlessColorPicker.prototype, "colorWords", void 0);
604
620
  __decorate([
621
+ words,
605
622
  property({ attribute: 'copied-label' })
606
623
  ], HelixHeadlessColorPicker.prototype, "copiedLabel", void 0);
607
624
  __decorate([
625
+ words,
608
626
  property({ attribute: 'copy-label' })
609
627
  ], HelixHeadlessColorPicker.prototype, "copyLabel", void 0);
610
628
  __decorate([
629
+ words,
611
630
  property({ attribute: 'eyedropper-label' })
612
631
  ], HelixHeadlessColorPicker.prototype, "eyedropperLabel", void 0);
613
632
  __decorate([
614
633
  property({ reflect: true })
615
634
  ], HelixHeadlessColorPicker.prototype, "format", void 0);
616
635
  __decorate([
636
+ words,
617
637
  property({ attribute: 'format-label' })
618
638
  ], HelixHeadlessColorPicker.prototype, "formatLabel", void 0);
619
639
  __decorate([
640
+ words,
620
641
  property({ attribute: 'green-label' })
621
642
  ], HelixHeadlessColorPicker.prototype, "greenLabel", void 0);
622
643
  __decorate([
644
+ words,
623
645
  property({ attribute: 'hue-label' })
624
646
  ], HelixHeadlessColorPicker.prototype, "hueLabel", void 0);
625
647
  __decorate([
648
+ words,
626
649
  property({ attribute: 'lightness-label' })
627
650
  ], HelixHeadlessColorPicker.prototype, "lightnessLabel", void 0);
628
651
  __decorate([
@@ -635,33 +658,44 @@ __decorate([
635
658
  property({ attribute: 'no-value', type: Boolean })
636
659
  ], HelixHeadlessColorPicker.prototype, "noValue", void 0);
637
660
  __decorate([
661
+ words,
638
662
  property({ attribute: 'opacity-label' })
639
663
  ], HelixHeadlessColorPicker.prototype, "opacityLabel", void 0);
640
664
  __decorate([
665
+ words,
641
666
  property({ attribute: 'presets-label' })
642
667
  ], HelixHeadlessColorPicker.prototype, "presetsLabel", void 0);
643
668
  __decorate([
644
669
  property({ attribute: 'readonly', reflect: true, type: Boolean })
645
670
  ], HelixHeadlessColorPicker.prototype, "readOnly", void 0);
646
671
  __decorate([
672
+ words,
647
673
  property({ attribute: 'red-label' })
648
674
  ], HelixHeadlessColorPicker.prototype, "redLabel", void 0);
649
675
  __decorate([
650
676
  property({ reflect: true, type: Boolean })
651
677
  ], HelixHeadlessColorPicker.prototype, "required", void 0);
652
678
  __decorate([
679
+ words,
653
680
  property({ attribute: 'saturation-label' })
654
681
  ], HelixHeadlessColorPicker.prototype, "saturationLabel", void 0);
682
+ __decorate([
683
+ words,
684
+ property({ attribute: 'square-text' })
685
+ ], HelixHeadlessColorPicker.prototype, "squareText", void 0);
655
686
  __decorate([
656
687
  property()
657
688
  ], HelixHeadlessColorPicker.prototype, "swatches", void 0);
658
689
  __decorate([
690
+ words,
659
691
  property({ attribute: 'tools-label' })
660
692
  ], HelixHeadlessColorPicker.prototype, "toolsLabel", void 0);
661
693
  __decorate([
694
+ words,
662
695
  property({ attribute: 'value-label' })
663
696
  ], HelixHeadlessColorPicker.prototype, "valueLabel", void 0);
664
697
  __decorate([
698
+ words,
665
699
  property({ attribute: 'value-missing-message' })
666
700
  ], HelixHeadlessColorPicker.prototype, "valueMissingMessage", void 0);
667
701
  __decorate([
@@ -123,6 +123,11 @@ declare const HelixHeadlessCombobox_base: (new (...args: any[]) => import("@fusi
123
123
  * @cssstate open - While the list is open.
124
124
  */
125
125
  export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
126
+ /**
127
+ * The key this family's words are registered under, its styled tag:
128
+ * `registerWords('de', { 'helix-combobox': { emptyText: 'Keine Treffer' } })`.
129
+ */
130
+ static words: string;
126
131
  protected readonly aria: AriaForwardController;
127
132
  /** The region VoiceOver hears the highlight, the count and a choice from. */
128
133
  private readonly status;
@@ -169,7 +174,10 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
169
174
  */
170
175
  creatable: boolean;
171
176
  /**
172
- * The text of the create row, shown before the typed words it adds.
177
+ * The text of the create row. `{value}` is what was typed.
178
+ *
179
+ * A sentence without `{value}`, such as `Create`, is followed by what was
180
+ * typed in quotes, as before `{value}` existed.
173
181
  */
174
182
  createLabel: string;
175
183
  /**
@@ -208,6 +216,12 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
208
216
  * Text the list shows while the options load.
209
217
  */
210
218
  loadingText: string;
219
+ /**
220
+ * The locale the words, plural forms, and numbers are in, as a BCP 47 tag
221
+ * such as `pl`. Empty reads the nearest `lang`, then the browser's
222
+ * language.
223
+ */
224
+ locale: string;
211
225
  /**
212
226
  * Whether more than one option can be chosen.
213
227
  *
@@ -264,14 +278,18 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
264
278
  */
265
279
  removeLabel: string;
266
280
  /**
267
- * What a screen reader hears when typing leaves one option. `{count}` is
268
- * the count.
281
+ * What a screen reader hears when typing leaves one option, where
282
+ * `results-label` should not say it. `{count}` is the count.
283
+ *
284
+ * @deprecated Write every form in `results-label`, as `{count, plural, one
285
+ * {# result} other {# results}}`. Removed in the next major version.
269
286
  */
270
- resultLabel: string;
287
+ resultLabel?: string;
271
288
  /**
272
- * What a screen reader hears when typing leaves any other number of
273
- * options. `{count}` is the count, and `Intl.PluralRules` picks between the
274
- * two.
289
+ * What a screen reader hears when typing narrows the list. `{count}` is how
290
+ * many options are left, written in the locale, and each language writes
291
+ * the forms it has: `{count, plural, one {# wynik} few {# wyniki} many
292
+ * {# wyników} other {# wyniku}}`.
275
293
  */
276
294
  resultsLabel: string;
277
295
  /**
@@ -288,6 +306,12 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
288
306
  * should not have to ask.
289
307
  */
290
308
  suggest: boolean;
309
+ /**
310
+ * The message reported when the field is required and nothing is chosen.
311
+ * Absent, or empty, is this sentence, or the words registered for the page's
312
+ * locale.
313
+ */
314
+ valueMissingMessage: string;
291
315
  /**
292
316
  * What the reader has typed, which narrows the list and is not the value.
293
317
  *
@@ -516,6 +540,11 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
516
540
  private tell;
517
541
  /** How many options there are, said as the list opens, until an option is said with it. */
518
542
  private counted;
543
+ /**
544
+ * How many options are left, in `results-label`, or in the deprecated
545
+ * `result-label` for one where a page still sets it.
546
+ */
547
+ private countSaid;
519
548
  /**
520
549
  * Takes what the list announced and stops it there.
521
550
  *