@fusion.dev/helix-headless 0.147.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 (296) hide show
  1. package/custom-elements.json +11222 -2332
  2. package/dist/accordion/item/accordion-item.d.ts +5 -2
  3. package/dist/accordion/item/accordion-item.js +11 -7
  4. package/dist/accordion/root/accordion-root.js +4 -6
  5. package/dist/announcement/root/announcement-root.d.ts +61 -5
  6. package/dist/announcement/root/announcement-root.js +126 -20
  7. package/dist/area-chart/root/area-chart-root.d.ts +11 -0
  8. package/dist/area-chart/root/area-chart-root.js +21 -9
  9. package/dist/avatar/group/avatar-group.d.ts +10 -2
  10. package/dist/avatar/group/avatar-group.js +10 -5
  11. package/dist/badge/count.d.ts +19 -0
  12. package/dist/badge/count.js +20 -0
  13. package/dist/badge/root/badge-root.d.ts +6 -2
  14. package/dist/badge/root/badge-root.js +8 -22
  15. package/dist/bar-chart/root/bar-chart-root.d.ts +13 -1
  16. package/dist/bar-chart/root/bar-chart-root.js +17 -4
  17. package/dist/blockquote/root/blockquote-root.d.ts +66 -8
  18. package/dist/blockquote/root/blockquote-root.js +85 -8
  19. package/dist/breadcrumbs/breadcrumb/breadcrumb.js +2 -2
  20. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +8 -1
  21. package/dist/breadcrumbs/root/breadcrumbs-root.js +5 -2
  22. package/dist/button/root/button-root.d.ts +10 -1
  23. package/dist/button/root/button-root.js +3 -2
  24. package/dist/button-group/arrows.d.ts +14 -0
  25. package/dist/button-group/arrows.js +10 -0
  26. package/dist/button-group/root/button-group-root.d.ts +144 -3
  27. package/dist/button-group/root/button-group-root.js +142 -2
  28. package/dist/callout/root/callout-root.d.ts +16 -2
  29. package/dist/callout/root/callout-root.js +16 -4
  30. package/dist/canvas/describe.d.ts +10 -0
  31. package/dist/canvas/describe.js +9 -0
  32. package/dist/canvas/edge-pan.d.ts +61 -0
  33. package/dist/canvas/edge-pan.js +63 -0
  34. package/dist/canvas/neighbor.d.ts +17 -0
  35. package/dist/canvas/neighbor.js +1 -0
  36. package/dist/canvas/node/canvas-node.d.ts +12 -2
  37. package/dist/canvas/node/canvas-node.js +8 -3
  38. package/dist/canvas/root/canvas-document.d.ts +10 -0
  39. package/dist/canvas/root/canvas-document.js +1 -0
  40. package/dist/canvas/root/canvas-root.d.ts +168 -9
  41. package/dist/canvas/root/canvas-root.js +239 -69
  42. package/dist/canvas/snap.d.ts +42 -0
  43. package/dist/canvas/snap.js +32 -0
  44. package/dist/carousel/root/carousel-root.d.ts +9 -3
  45. package/dist/carousel/root/carousel-root.js +17 -10
  46. package/dist/chat/composer/chat-composer.d.ts +5 -0
  47. package/dist/chat/composer/chat-composer.js +4 -1
  48. package/dist/chat/message/chat-message.d.ts +9 -5
  49. package/dist/chat/message/chat-message.js +8 -4
  50. package/dist/chat/naming.js +2 -2
  51. package/dist/chat/root/chat-root.d.ts +40 -4
  52. package/dist/chat/root/chat-root.js +38 -14
  53. package/dist/checkbox/root/checkbox-root.d.ts +11 -0
  54. package/dist/checkbox/root/checkbox-root.js +8 -2
  55. package/dist/checkbox-group/root/checkbox-group-root.d.ts +24 -0
  56. package/dist/checkbox-group/root/checkbox-group-root.js +28 -12
  57. package/dist/checkbox-group/select-all.d.ts +11 -0
  58. package/dist/checkbox-group/select-all.js +5 -0
  59. package/dist/code-block/root/code-block-root.d.ts +20 -8
  60. package/dist/code-block/root/code-block-root.js +16 -5
  61. package/dist/color-input/root/color-input-root.d.ts +13 -0
  62. package/dist/color-input/root/color-input-root.js +18 -5
  63. package/dist/color-picker/root/color-picker-root.d.ts +19 -3
  64. package/dist/color-picker/root/color-picker-root.js +52 -24
  65. package/dist/color-picker/wheel.d.ts +11 -0
  66. package/dist/color-picker/wheel.js +9 -0
  67. package/dist/combobox/root/combobox-root.d.ts +106 -18
  68. package/dist/combobox/root/combobox-root.js +101 -26
  69. package/dist/command/root/command-root.d.ts +19 -9
  70. package/dist/command/root/command-root.js +9 -4
  71. package/dist/copy-button/root/copy-button-root.d.ts +5 -0
  72. package/dist/copy-button/root/copy-button-root.js +7 -2
  73. package/dist/data-table/root/data-table-root.d.ts +171 -29
  74. package/dist/data-table/root/data-table-root.js +284 -161
  75. package/dist/date-input/root/date-input-root.d.ts +32 -9
  76. package/dist/date-input/root/date-input-root.js +66 -44
  77. package/dist/date-picker/root/date-picker-root.d.ts +38 -15
  78. package/dist/date-picker/root/date-picker-root.js +52 -33
  79. package/dist/description-list/item/description-list-item.d.ts +4 -0
  80. package/dist/description-list/item/description-list-item.js +7 -1
  81. package/dist/dialog/root/dialog-root.d.ts +12 -1
  82. package/dist/dialog/root/dialog-root.js +11 -4
  83. package/dist/divider/root/divider-root.d.ts +45 -16
  84. package/dist/divider/root/divider-root.js +28 -4
  85. package/dist/donut-chart/root/donut-chart-root.d.ts +5 -0
  86. package/dist/donut-chart/root/donut-chart-root.js +8 -5
  87. package/dist/drawer/root/drawer-root.d.ts +12 -1
  88. package/dist/drawer/root/drawer-root.js +9 -2
  89. package/dist/drilldown/item/drilldown-item.js +3 -4
  90. package/dist/drilldown/root/drilldown-root.d.ts +5 -0
  91. package/dist/drilldown/root/drilldown-root.js +4 -1
  92. package/dist/element-events.generated.js +26 -3
  93. package/dist/empty/root/empty-root.d.ts +17 -3
  94. package/dist/empty/root/empty-root.js +29 -5
  95. package/dist/file-input/root/file-input-root.d.ts +18 -3
  96. package/dist/file-input/root/file-input-root.js +34 -18
  97. package/dist/file-input/status.js +2 -1
  98. package/dist/filter-input/chip/filter-chip.d.ts +13 -0
  99. package/dist/filter-input/chip/filter-chip.js +7 -3
  100. package/dist/filter-input/menu/filter-menu.d.ts +5 -0
  101. package/dist/filter-input/menu/filter-menu.js +3 -1
  102. package/dist/filter-input/root/filter-input-root.d.ts +20 -3
  103. package/dist/filter-input/root/filter-input-root.js +8 -4
  104. package/dist/format-date/fields.d.ts +20 -0
  105. package/dist/format-date/fields.js +14 -0
  106. package/dist/format-date/options.d.ts +2 -1
  107. package/dist/format-date/options.js +9 -38
  108. package/dist/format-date/root/format-date-root.d.ts +55 -5
  109. package/dist/format-date/root/format-date-root.js +29 -34
  110. package/dist/graph/root/graph-model.d.ts +11 -0
  111. package/dist/graph/root/graph-model.js +4 -0
  112. package/dist/graph/root/graph-root.d.ts +101 -14
  113. package/dist/graph/root/graph-root.js +140 -46
  114. package/dist/heatmap/root/heatmap-root.d.ts +37 -4
  115. package/dist/heatmap/root/heatmap-root.js +51 -16
  116. package/dist/icon-button/root/icon-button-root.d.ts +5 -0
  117. package/dist/icon-button/root/icon-button-root.js +1 -0
  118. package/dist/image/root/image-root.d.ts +11 -0
  119. package/dist/input/root/input-root.d.ts +5 -0
  120. package/dist/input/root/input-root.js +4 -1
  121. package/dist/kbd/root/kbd-root.js +1 -2
  122. package/dist/legend/root/legend-root.js +4 -17
  123. package/dist/lightbox/root/lightbox-root.d.ts +14 -4
  124. package/dist/lightbox/root/lightbox-root.js +25 -7
  125. package/dist/line-chart/root/line-chart-root.d.ts +5 -0
  126. package/dist/line-chart/root/line-chart-root.js +4 -2
  127. package/dist/list/item/list-item.d.ts +32 -0
  128. package/dist/list/item/list-item.js +34 -7
  129. package/dist/list/root/list-root.d.ts +87 -0
  130. package/dist/list/root/list-root.js +119 -23
  131. package/dist/listbox/reorder/index.d.ts +1 -0
  132. package/dist/listbox/reorder/index.js +4 -0
  133. package/dist/listbox/reorder/listbox-reorder.d.ts +83 -0
  134. package/dist/listbox/reorder/listbox-reorder.js +151 -0
  135. package/dist/listbox/root/listbox-root.d.ts +185 -33
  136. package/dist/listbox/root/listbox-root.js +166 -136
  137. package/dist/loader/root/loader-root.d.ts +5 -0
  138. package/dist/loader/root/loader-root.js +3 -1
  139. package/dist/map/area/map-area.d.ts +5 -0
  140. package/dist/map/area/map-area.js +3 -1
  141. package/dist/map/buildings/map-buildings.d.ts +5 -0
  142. package/dist/map/buildings/map-buildings.js +3 -1
  143. package/dist/map/contours/map-contours.d.ts +5 -0
  144. package/dist/map/contours/map-contours.js +3 -1
  145. package/dist/map/landcover/map-landcover.d.ts +5 -0
  146. package/dist/map/landcover/map-landcover.js +3 -1
  147. package/dist/map/marker/map-marker.d.ts +18 -2
  148. package/dist/map/marker/map-marker.js +13 -5
  149. package/dist/map/points/map-points.d.ts +5 -0
  150. package/dist/map/points/map-points.js +6 -4
  151. package/dist/map/position/map-position.d.ts +5 -0
  152. package/dist/map/position/map-position.js +3 -1
  153. package/dist/map/raster/map-raster.d.ts +5 -0
  154. package/dist/map/raster/map-raster.js +3 -1
  155. package/dist/map/root/map-root.d.ts +73 -16
  156. package/dist/map/root/map-root.js +122 -44
  157. package/dist/map/route/map-route.d.ts +5 -0
  158. package/dist/map/route/map-route.js +3 -1
  159. package/dist/map/terrain/map-terrain.d.ts +5 -0
  160. package/dist/map/terrain/map-terrain.js +3 -1
  161. package/dist/megamenu/root/megamenu-root.js +4 -11
  162. package/dist/menu/root/menu-root.d.ts +7 -2
  163. package/dist/menu/root/menu-root.js +3 -1
  164. package/dist/meter/root/meter-root.d.ts +16 -3
  165. package/dist/meter/root/meter-root.js +12 -5
  166. package/dist/navigation/root/navigation-root.d.ts +5 -0
  167. package/dist/navigation/root/navigation-root.js +7 -8
  168. package/dist/notifications/group/notification-group.d.ts +8 -1
  169. package/dist/notifications/group/notification-group.js +12 -6
  170. package/dist/notifications/notification/notification.d.ts +17 -1
  171. package/dist/notifications/notification/notification.js +6 -2
  172. package/dist/notifications/root/notifications-root.d.ts +49 -5
  173. package/dist/notifications/root/notifications-root.js +36 -8
  174. package/dist/number-input/root/number-input-root.d.ts +21 -8
  175. package/dist/number-input/root/number-input-root.js +26 -11
  176. package/dist/object-inspector/root/object-inspector-root.d.ts +56 -13
  177. package/dist/object-inspector/root/object-inspector-root.js +41 -30
  178. package/dist/outline/root/outline-root.d.ts +5 -0
  179. package/dist/outline/root/outline-root.js +3 -1
  180. package/dist/pagination/root/pagination-root.d.ts +7 -1
  181. package/dist/pagination/root/pagination-root.js +16 -7
  182. package/dist/pagination/size/pagination-size.d.ts +8 -3
  183. package/dist/pagination/size/pagination-size.js +5 -3
  184. package/dist/pagination/summary/pagination-summary.d.ts +8 -6
  185. package/dist/pagination/summary/pagination-summary.js +4 -9
  186. package/dist/pin-input/code.d.ts +23 -0
  187. package/dist/pin-input/code.js +21 -0
  188. package/dist/pin-input/root/pin-input-root.d.ts +9 -3
  189. package/dist/pin-input/root/pin-input-root.js +13 -23
  190. package/dist/popover/root/popover-root.d.ts +12 -2
  191. package/dist/popover/root/popover-root.js +10 -4
  192. package/dist/progress/root/progress-root.d.ts +7 -2
  193. package/dist/progress/root/progress-root.js +5 -2
  194. package/dist/qr-code/name.d.ts +3 -2
  195. package/dist/qr-code/name.js +2 -2
  196. package/dist/qr-code/root/qr-code-root.d.ts +26 -5
  197. package/dist/qr-code/root/qr-code-root.js +27 -6
  198. package/dist/radio/group/radio-group.d.ts +11 -0
  199. package/dist/radio/group/radio-group.js +8 -2
  200. package/dist/rating/root/rating-root.d.ts +12 -1
  201. package/dist/rating/root/rating-root.js +10 -3
  202. package/dist/scatter-chart/measures.d.ts +22 -0
  203. package/dist/scatter-chart/measures.js +11 -0
  204. package/dist/scatter-chart/root/scatter-chart-root.d.ts +22 -8
  205. package/dist/scatter-chart/root/scatter-chart-root.js +25 -23
  206. package/dist/select/root/select-root.d.ts +67 -8
  207. package/dist/select/root/select-root.js +45 -11
  208. package/dist/skip-link/root/skip-link-root.d.ts +5 -0
  209. package/dist/skip-link/root/skip-link-root.js +3 -1
  210. package/dist/slider/root/slider-root.d.ts +7 -2
  211. package/dist/slider/root/slider-root.js +11 -5
  212. package/dist/sparkline/readings.d.ts +15 -5
  213. package/dist/sparkline/readings.js +3 -3
  214. package/dist/sparkline/root/sparkline-root.d.ts +9 -4
  215. package/dist/sparkline/root/sparkline-root.js +9 -3
  216. package/dist/speed-dial/group/speed-dial-group.d.ts +48 -0
  217. package/dist/speed-dial/group/speed-dial-group.js +43 -0
  218. package/dist/speed-dial/index.d.ts +1 -0
  219. package/dist/speed-dial/index.js +1 -0
  220. package/dist/speed-dial/item/speed-dial-item.d.ts +26 -1
  221. package/dist/speed-dial/item/speed-dial-item.js +41 -3
  222. package/dist/speed-dial/long-press.d.ts +50 -0
  223. package/dist/speed-dial/long-press.js +48 -0
  224. package/dist/speed-dial/root/speed-dial-root.d.ts +85 -1
  225. package/dist/speed-dial/root/speed-dial-root.js +117 -5
  226. package/dist/splitter/root/splitter-root.d.ts +12 -3
  227. package/dist/splitter/root/splitter-root.js +22 -4
  228. package/dist/steps/root/steps-root.d.ts +9 -2
  229. package/dist/steps/root/steps-root.js +6 -3
  230. package/dist/steps/step/step.d.ts +12 -0
  231. package/dist/steps/step/step.js +11 -2
  232. package/dist/switch/root/switch-root.d.ts +11 -0
  233. package/dist/switch/root/switch-root.js +8 -2
  234. package/dist/table/cell/table-cell.d.ts +8 -1
  235. package/dist/table/cell/table-cell.js +6 -2
  236. package/dist/table/column/table-column.d.ts +11 -4
  237. package/dist/table/column/table-column.js +15 -10
  238. package/dist/table/grid-controller.d.ts +122 -0
  239. package/dist/table/grid-controller.js +299 -0
  240. package/dist/table/root/table-root.d.ts +154 -8
  241. package/dist/table/root/table-root.js +197 -38
  242. package/dist/table/row/table-row.d.ts +55 -1
  243. package/dist/table/row/table-row.js +60 -7
  244. package/dist/tabs/root/tabs-root.d.ts +5 -0
  245. package/dist/tabs/root/tabs-root.js +3 -1
  246. package/dist/tag/group/tag-group.d.ts +5 -0
  247. package/dist/tag/group/tag-group.js +8 -15
  248. package/dist/tag/root/tag-root.d.ts +14 -1
  249. package/dist/tag/root/tag-root.js +11 -8
  250. package/dist/textarea/root/textarea-root.d.ts +5 -0
  251. package/dist/textarea/root/textarea-root.js +3 -1
  252. package/dist/time-input/root/time-input-root.d.ts +14 -7
  253. package/dist/time-input/root/time-input-root.js +43 -32
  254. package/dist/time-picker/root/time-picker-root.d.ts +16 -7
  255. package/dist/time-picker/root/time-picker-root.js +28 -12
  256. package/dist/toast/item/toast-item.d.ts +13 -3
  257. package/dist/toast/item/toast-item.js +2 -0
  258. package/dist/toast/root/toast-root.d.ts +22 -2
  259. package/dist/toast/root/toast-root.js +24 -17
  260. package/dist/toggle/group/toggle-group.js +3 -5
  261. package/dist/toolbar/root/toolbar-root.d.ts +36 -0
  262. package/dist/toolbar/root/toolbar-root.js +43 -9
  263. package/dist/tooltip/root/tooltip-root.d.ts +27 -17
  264. package/dist/tooltip/root/tooltip-root.js +1 -2
  265. package/dist/tour/root/tour-root.d.ts +8 -2
  266. package/dist/tour/root/tour-root.js +4 -2
  267. package/dist/tour/stop/tour-stop.d.ts +5 -0
  268. package/dist/tour/stop/tour-stop.js +6 -1
  269. package/dist/tree/grip.d.ts +5 -0
  270. package/dist/tree/grip.js +1 -0
  271. package/dist/tree/item/tree-item.d.ts +24 -0
  272. package/dist/tree/item/tree-item.js +27 -5
  273. package/dist/tree/root/tree-root.d.ts +66 -1
  274. package/dist/tree/root/tree-root.js +77 -5
  275. package/dist/trend/root/trend-root.d.ts +20 -4
  276. package/dist/trend/root/trend-root.js +20 -5
  277. package/dist/video/root/video-root.d.ts +23 -3
  278. package/dist/video/root/video-root.js +56 -15
  279. package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -0
  280. package/dist/video-playlist/menu/video-playlist-menu.js +3 -1
  281. package/dist/video-playlist/root/video-playlist-root.d.ts +5 -0
  282. package/dist/video-playlist/root/video-playlist-root.js +3 -1
  283. package/dist/virtual-list/root/virtual-list-root.d.ts +19 -3
  284. package/dist/virtual-list/root/virtual-list-root.js +10 -19
  285. package/lint.json +1 -1
  286. package/package.json +7 -6
  287. package/types/jsx.d.ts +6005 -2114
  288. package/types/svelte.d.ts +1 -0
  289. package/types/vue.d.ts +1594 -676
  290. package/types/words.d.ts +3280 -0
  291. package/dist/kbd/keys.d.ts +0 -29
  292. package/dist/kbd/keys.js +0 -52
  293. package/dist/toast/hotkey.d.ts +0 -22
  294. package/dist/toast/hotkey.js +0 -23
  295. package/dist/tooltip/focus-target.d.ts +0 -6
  296. package/dist/tooltip/focus-target.js +0 -9
@@ -132,6 +132,11 @@ declare const HelixHeadlessFilterInput_base: (new (...args: any[]) => import("@f
132
132
  * @cssstate open - The suggestions are open.
133
133
  */
134
134
  export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_base {
135
+ /**
136
+ * The key this family's words are registered under, its styled tag:
137
+ * `registerWords('de', { 'helix-filter-input': { clearLabel: 'Leeren' } })`.
138
+ */
139
+ static words: string;
135
140
  protected readonly aria: AriaForwardController;
136
141
  /** Typed, so every keystroke is announced. See `announcesInput`. */
137
142
  protected readonly announcesInput = true;
@@ -161,9 +166,21 @@ export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_b
161
166
  * Not a label: it goes when typing starts.
162
167
  */
163
168
  placeholder: string;
164
- /** What a reader hears for one suggestion, with `{count}` filled in. */
165
- suggestionLabel: string;
166
- /** What a reader hears for any other number of suggestions, with `{count}` filled in. */
169
+ /**
170
+ * What a reader hears for one suggestion, where `suggestions-label` should
171
+ * not say it. `{count}` is the count.
172
+ *
173
+ * @deprecated Write every form in `suggestions-label`, as `{count, plural,
174
+ * one {# suggestion} other {# suggestions}}`. Removed in the next major
175
+ * version.
176
+ */
177
+ suggestionLabel?: string;
178
+ /**
179
+ * What a reader hears as the panel opens on its suggestions. `{count}` is
180
+ * how many, written in the locale, and each language writes the forms it
181
+ * has: `{count, plural, one {# sugestia} few {# sugestie} many {# sugestii}
182
+ * other {# sugestii}}`.
183
+ */
167
184
  suggestionsLabel: string;
168
185
  /** The live region, rendered from the first count said. */
169
186
  private readonly status;
@@ -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, countLabel, customElement, drawIcon, drawStatus, HelixFacetEvent, HelixFormElement, holdCaret, MixinControllerOpen, MixinControllerValue, MixinField, MixinTokens, PopoverController, restoreValue, StatusController, scrollItemIntoView, } from '@fusion.dev/helix-core';
7
+ import { AriaForwardController, countLabel, customElement, drawIcon, drawStatus, formatWords, HelixFacetEvent, HelixFormElement, holdCaret, MixinControllerOpen, MixinControllerValue, MixinField, MixinTokens, PopoverController, restoreValue, StatusController, scrollItemIntoView, words, wordsLocale, } from '@fusion.dev/helix-core';
8
8
  import { x } from '@fusion.dev/helix-icons';
9
9
  import { html, nothing } from 'lit';
10
10
  import { property, state } from 'lit/decorators.js';
@@ -25,8 +25,7 @@ let HelixHeadlessFilterInput = class HelixHeadlessFilterInput extends MixinContr
25
25
  this.clearLabel = 'Clear';
26
26
  this.filterSuggestions = false;
27
27
  this.placeholder = '';
28
- this.suggestionLabel = '{count} suggestion';
29
- this.suggestionsLabel = '{count} suggestions';
28
+ this.suggestionsLabel = '{count, plural, one {# suggestion} other {# suggestions}}';
30
29
  this.status = new StatusController(this);
31
30
  this.saidCount = -1;
32
31
  this.narrowed = new Set();
@@ -161,6 +160,7 @@ let HelixHeadlessFilterInput = class HelixHeadlessFilterInput extends MixinContr
161
160
  this.over = this.hideOverflow(this.tokens);
162
161
  };
163
162
  }
163
+ static { this.words = 'helix-filter-input'; }
164
164
  narrow() {
165
165
  const term = this.filterSuggestions
166
166
  ? currentTerm(this.value, this.control?.selectionStart ?? this.value.length)
@@ -186,7 +186,9 @@ let HelixHeadlessFilterInput = class HelixHeadlessFilterInput extends MixinContr
186
186
  if (count < 0) {
187
187
  return;
188
188
  }
189
- this.status.sayNow(countLabel(count, this.suggestionLabel, this.suggestionsLabel, this.lang));
189
+ this.status.sayNow(this.suggestionLabel
190
+ ? countLabel(count, this.suggestionLabel, this.suggestionsLabel, wordsLocale(this))
191
+ : formatWords(this, 'suggestionsLabel', { count }));
190
192
  }
191
193
  formValue() {
192
194
  const entries = (this.tokens?.assignedElements({ flatten: true }) ?? [])
@@ -443,6 +445,7 @@ __decorate([
443
445
  property({ type: Boolean })
444
446
  ], HelixHeadlessFilterInput.prototype, "clearable", void 0);
445
447
  __decorate([
448
+ words,
446
449
  property({ attribute: 'clear-label' })
447
450
  ], HelixHeadlessFilterInput.prototype, "clearLabel", void 0);
448
451
  __decorate([
@@ -455,6 +458,7 @@ __decorate([
455
458
  property({ attribute: 'suggestion-label' })
456
459
  ], HelixHeadlessFilterInput.prototype, "suggestionLabel", void 0);
457
460
  __decorate([
461
+ words,
458
462
  property({ attribute: 'suggestions-label' })
459
463
  ], HelixHeadlessFilterInput.prototype, "suggestionsLabel", void 0);
460
464
  __decorate([
@@ -0,0 +1,20 @@
1
+ import { type TemplateResult } from 'lit';
2
+ /**
3
+ * Each date field `Intl` names, drawn as a part of its own.
4
+ *
5
+ * Keyed by the `type` of `Intl.DateTimeFormat#formatToParts`. Written out one
6
+ * template to a field rather than bound through one `part` binding, because a
7
+ * part is read from the source as a literal: a bound name is a part no
8
+ * stylesheet check can find. A type left out, the punctuation between the
9
+ * fields among them, is drawn as plain text.
10
+ */
11
+ export declare const FIELD: Record<string, (value: string) => TemplateResult>;
12
+ /**
13
+ * A formatted date, each field in a part of its own and the text between them
14
+ * as it is.
15
+ *
16
+ * The words are the ones `format` would give, in the same order, so the reading
17
+ * a screen reader hears and the text a reader copies do not change: an inline
18
+ * span with no style of its own changes nothing on the page either.
19
+ */
20
+ export declare const drawFields: (parts: readonly Intl.DateTimeFormatPart[]) => unknown[];
@@ -0,0 +1,14 @@
1
+ import { html } from 'lit';
2
+ export const FIELD = {
3
+ day: (value) => html `<span part="day">${value}</span>`,
4
+ dayPeriod: (value) => html `<span part="day-period">${value}</span>`,
5
+ era: (value) => html `<span part="era">${value}</span>`,
6
+ hour: (value) => html `<span part="hour">${value}</span>`,
7
+ minute: (value) => html `<span part="minute">${value}</span>`,
8
+ month: (value) => html `<span part="month">${value}</span>`,
9
+ second: (value) => html `<span part="second">${value}</span>`,
10
+ timeZoneName: (value) => html `<span part="time-zone-name">${value}</span>`,
11
+ weekday: (value) => html `<span part="weekday">${value}</span>`,
12
+ year: (value) => html `<span part="year">${value}</span>`,
13
+ };
14
+ export const drawFields = (parts) => parts.map(({ type, value }) => FIELD[type]?.(value) ?? value);
@@ -18,7 +18,8 @@ export interface Asked {
18
18
  year?: 'numeric' | '2-digit' | undefined;
19
19
  }
20
20
  /**
21
- * The `Intl.DateTimeFormat` options for what was asked, and none that was not.
21
+ * The `Intl.DateTimeFormat` options for what was asked, and none that was not:
22
+ * an option not asked for is `undefined`, which `Intl` reads as absent.
22
23
  *
23
24
  * **A style wins over the fields.** `dateStyle` and `timeStyle` are each
24
25
  * locale's own whole pattern, and `Intl` throws a `TypeError` when one is
@@ -1,42 +1,13 @@
1
- const FIELDS = [
2
- 'day',
3
- 'era',
4
- 'hour',
5
- 'minute',
6
- 'month',
7
- 'second',
8
- 'timeZoneName',
9
- 'weekday',
10
- 'year',
11
- ];
1
+ import { FIELD } from './fields.js';
2
+ const FIELDS = Object.keys(FIELD);
12
3
  export const formatOptions = (asked, dateOnly = false) => {
13
- const options = {};
14
- const styled = asked.dateStyle !== undefined || asked.timeStyle !== undefined;
15
- if (styled) {
16
- if (asked.dateStyle) {
17
- options.dateStyle = asked.dateStyle;
18
- }
19
- if (asked.timeStyle) {
20
- options.timeStyle = asked.timeStyle;
21
- }
22
- }
23
- else {
24
- for (const field of FIELDS) {
25
- const value = asked[field];
26
- if (value) {
27
- ;
28
- options[field] = value;
29
- }
30
- }
31
- }
32
- if (asked.hourCycle) {
33
- options.hourCycle = asked.hourCycle;
34
- }
35
- if (asked.timeZone) {
36
- options.timeZone = asked.timeZone;
37
- }
38
- else if (dateOnly) {
39
- options.timeZone = 'UTC';
4
+ const options = {
5
+ hourCycle: asked.hourCycle,
6
+ timeZone: asked.timeZone || (dateOnly ? 'UTC' : undefined),
7
+ };
8
+ const styled = asked.dateStyle || asked.timeStyle;
9
+ for (const field of styled ? ['dateStyle', 'timeStyle'] : FIELDS) {
10
+ options[field] = asked[field];
40
11
  }
41
12
  return options;
42
13
  };
@@ -1,4 +1,4 @@
1
- import { HelixElement } from '@fusion.dev/helix-core';
1
+ import { type DateCalendar, HelixElement } from '@fusion.dev/helix-core';
2
2
  import { nothing, type PropertyValues, type TemplateResult } from 'lit';
3
3
  /**
4
4
  * @summary A timestamp, formatted for the user's locale.
@@ -27,6 +27,12 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
27
27
  * showing a date schedules none, so a long feed left open costs almost nothing.
28
28
  * `frozen` draws the reading once and leaves it.
29
29
  *
30
+ * **`fields` draws each field of a date as a part of its own**, such as
31
+ * `day`, `month` and `year`, so a stylesheet can set the year in a lighter ink
32
+ * or the weekday in capitals with `::part()`. The text between the fields is
33
+ * the locale's own and has no part. An `elapsed` or `relative` reading is one
34
+ * phrase, with no parts inside it.
35
+ *
30
36
  * **The output is always `<time datetime>`**, so copy and paste and scripts
31
37
  * parsing the page get the exact instant, whatever the visible text says. A
32
38
  * screen reader reads the text, so an `elapsed` reading is named in full, such
@@ -37,15 +43,43 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
37
43
  * Picker format their dates, so a reader west of UTC sees August 4 and not
38
44
  * August 3.
39
45
  *
46
+ * **A date is written in a calendar Date Picker draws**: the locale's own
47
+ * where its months are the Gregorian months, as `th-TH` writes 2569 for 2026,
48
+ * and `gregory` where they are not, as for `fa-IR`. `calendar` picks one of
49
+ * the five.
50
+ *
40
51
  * @since 0.1.0
41
52
  * @status stable
42
53
  * @category typography
43
54
  * @aliases RelativeTime, Timestamp, TimeAgo
44
55
  * @documentation https://fusion.dev/helix/components/format-date
45
56
  *
57
+ * @csspart day - The day of the month, with `fields`.
58
+ * @csspart day-period - AM or PM, or the locale's word for the part of the day, with `fields`.
59
+ * @csspart era - The era, such as AD, with `fields` and `era`.
60
+ * @csspart hour - The hour, with `fields`.
61
+ * @csspart minute - The minute, with `fields`.
62
+ * @csspart month - The month, with `fields`.
63
+ * @csspart second - The second, with `fields`.
46
64
  * @csspart time - The `<time>` element that holds the formatted text.
65
+ * @csspart time-zone-name - The time zone's name, with `fields`, where `time-zone-name` or a `long` or `full` `time-style` shows it.
66
+ * @csspart weekday - The day of the week, with `fields`.
67
+ * @csspart year - The year, with `fields`.
68
+ *
69
+ * @cssstate future - An `elapsed` or `relative` reading of a moment still to come, such as "in 3 hours".
70
+ * @cssstate past - An `elapsed` or `relative` reading of a moment gone, such as "3 hours ago".
47
71
  */
48
72
  export declare class HelixHeadlessFormatDate extends HelixElement {
73
+ /**
74
+ * The calendar a date is written in: `gregory`, `buddhist`, `japanese`,
75
+ * `roc`, or `iso8601`, the calendars Date Picker and Date Input draw.
76
+ *
77
+ * Absent is the locale's own where it is one of the five, such as
78
+ * `buddhist` for `th-TH`, and `gregory` for every other, such as `persian`
79
+ * for `fa-IR`, so a date written here reads as the same date a Date Picker
80
+ * beside it shows.
81
+ */
82
+ calendar?: DateCalendar;
49
83
  /**
50
84
  * The timestamp, in any format `Date` can parse.
51
85
  *
@@ -86,6 +120,16 @@ export declare class HelixHeadlessFormatDate extends HelixElement {
86
120
  * How the era is written, such as AD, where a date is shown.
87
121
  */
88
122
  era?: 'long' | 'narrow' | 'short';
123
+ /**
124
+ * Draws each field of a date in a part of its own: `weekday`, `day`,
125
+ * `month`, `year`, `era`, `hour`, `minute`, `second`, `day-period` and
126
+ * `time-zone-name`, so `::part(year)` can set the year apart.
127
+ *
128
+ * Off by default, which draws the date as one run of text, as Shoelace and
129
+ * Web Awesome do. An `elapsed` or `relative` reading is one phrase either
130
+ * way.
131
+ */
132
+ fields?: boolean;
89
133
  /**
90
134
  * Draws an `elapsed` or `relative` reading once and leaves it, where it
91
135
  * would otherwise move on as it goes stale.
@@ -118,7 +162,10 @@ export declare class HelixHeadlessFormatDate extends HelixElement {
118
162
  * Shoelace and Web Awesome read it, then the runtime's own.
119
163
  */
120
164
  locale: string;
121
- /** The locale the words are written in: `locale`, or the page's `lang`. */
165
+ /**
166
+ * The locale the words are written in, `locale` or the page's `lang`, with
167
+ * the calendar.
168
+ */
122
169
  private get language();
123
170
  /**
124
171
  * How the minute is written, where a time of day is shown.
@@ -184,15 +231,18 @@ export declare class HelixHeadlessFormatDate extends HelixElement {
184
231
  private readonly clock;
185
232
  /**
186
233
  * The date read out of the light DOM, where no attribute carried one.
234
+ *
235
+ * Not a reactive state: `read` asks for the update itself, which keeps the
236
+ * `state` decorator out of this element's bundle.
187
237
  */
188
238
  private written;
189
- private watching;
239
+ private watching?;
190
240
  /** Whether the timestamp is a day with no time, which is formatted in UTC. */
191
241
  private get dateOnly();
192
242
  /** The timestamp, or nothing where there is not one to read. */
193
243
  private get moment();
194
- /** Every `Intl.DateTimeFormat` option a consumer set, and none they did not. */
195
- private get options();
244
+ /** The timestamp as written, in the attribute or in the light DOM. */
245
+ private get source();
196
246
  /** Whether the reading is how long ago rather than the date. */
197
247
  private get reading();
198
248
  /** What the reading says now, and when it stops being true. */
@@ -4,9 +4,10 @@ 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, elapsedTime, HelixElement, localeOf, RelativeClockController, relativeTime, } from '@fusion.dev/helix-core';
7
+ import { calendarLocale, customElement, elapsedTime, HelixElement, RelativeClockController, relativeTime, wordsLocale, } from '@fusion.dev/helix-core';
8
8
  import { html, nothing } from 'lit';
9
- import { property, state } from 'lit/decorators.js';
9
+ import { property } from 'lit/decorators.js';
10
+ import { drawFields } from '../fields.js';
10
11
  import { formatOptions } from '../options.js';
11
12
  const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
12
13
  let HelixHeadlessFormatDate = class HelixHeadlessFormatDate extends HelixElement {
@@ -22,28 +23,27 @@ let HelixHeadlessFormatDate = class HelixHeadlessFormatDate extends HelixElement
22
23
  if (!moment || !this.reading) {
23
24
  return undefined;
24
25
  }
25
- return this.frozen ? Number.POSITIVE_INFINITY : this.readingAt(moment, now).next;
26
+ return this.frozen ? Infinity : this.readingAt(moment, now).next;
26
27
  },
27
28
  });
28
29
  this.written = '';
29
- this.watching = undefined;
30
30
  }
31
31
  get language() {
32
- return localeOf(this, this.locale);
32
+ return calendarLocale(wordsLocale(this), this.calendar);
33
33
  }
34
34
  get dateOnly() {
35
- return DATE_ONLY.test((this.date || this.written).trim());
35
+ return DATE_ONLY.test(this.source);
36
36
  }
37
37
  get moment() {
38
- const source = this.date || this.written;
38
+ const source = this.source;
39
39
  if (source === '') {
40
40
  return undefined;
41
41
  }
42
42
  const parsed = new Date(source);
43
43
  return Number.isNaN(parsed.getTime()) ? undefined : parsed;
44
44
  }
45
- get options() {
46
- return formatOptions(this, this.dateOnly);
45
+ get source() {
46
+ return (this.date || this.written).trim();
47
47
  }
48
48
  get reading() {
49
49
  return this.elapsed || this.relative !== undefined;
@@ -65,7 +65,6 @@ let HelixHeadlessFormatDate = class HelixHeadlessFormatDate extends HelixElement
65
65
  disconnectedCallback() {
66
66
  super.disconnectedCallback();
67
67
  this.watching?.disconnect();
68
- this.watching = undefined;
69
68
  }
70
69
  firstUpdated(changed) {
71
70
  super.firstUpdated(changed);
@@ -77,14 +76,12 @@ let HelixHeadlessFormatDate = class HelixHeadlessFormatDate extends HelixElement
77
76
  if (this.childrenKnown) {
78
77
  this.read();
79
78
  }
80
- if (changed.has('date') ||
81
- changed.has('elapsed') ||
82
- changed.has('frozen') ||
83
- changed.has('locale') ||
84
- changed.has('numeric') ||
85
- changed.has('relative')) {
79
+ if (['date', 'elapsed', 'frozen', 'locale', 'numeric', 'relative'].some((key) => changed.has(key))) {
86
80
  this.clock.tick();
87
81
  }
82
+ const ahead = this.reading ? (this.moment?.getTime() ?? NaN) - this.clock.now : NaN;
83
+ this.toggleState('past', ahead <= 0);
84
+ this.toggleState('future', ahead > 0);
88
85
  }
89
86
  read() {
90
87
  if (this.date !== '') {
@@ -93,6 +90,7 @@ let HelixHeadlessFormatDate = class HelixHeadlessFormatDate extends HelixElement
93
90
  const written = this.textContent?.trim() ?? '';
94
91
  if (written !== this.written) {
95
92
  this.written = written;
93
+ this.requestUpdate();
96
94
  this.clock.tick();
97
95
  }
98
96
  }
@@ -106,28 +104,25 @@ let HelixHeadlessFormatDate = class HelixHeadlessFormatDate extends HelixElement
106
104
  if (!moment) {
107
105
  return nothing;
108
106
  }
109
- const datetime = this.dateOnly ? (this.date || this.written).trim() : moment.toISOString();
107
+ const datetime = this.dateOnly ? this.source : moment.toISOString();
110
108
  if (!this.reading) {
111
- const text = new Intl.DateTimeFormat(this.language || undefined, this.options).format(moment);
112
- return html `<time part="time" datetime=${datetime}>${text}</time>`;
109
+ const format = new Intl.DateTimeFormat(this.language || undefined, formatOptions(this, this.dateOnly));
110
+ return html `<time part="time" datetime=${datetime}>${this.fields ? drawFields(format.formatToParts(moment)) : format.format(moment)}</time>`;
113
111
  }
114
112
  const now = new Date(this.clock.now);
115
- const zone = this.timeZone || (this.dateOnly ? 'UTC' : undefined);
116
- const whole = new Intl.DateTimeFormat(this.language || undefined, {
113
+ const whole = new Intl.DateTimeFormat(this.language || undefined, formatOptions({
117
114
  dateStyle: 'long',
118
- ...(this.dateOnly ? {} : { timeStyle: 'short' }),
119
- ...(this.hourCycle ? { hourCycle: this.hourCycle } : {}),
120
- ...(zone ? { timeZone: zone } : {}),
121
- }).format(moment);
115
+ hourCycle: this.hourCycle,
116
+ timeStyle: this.dateOnly ? undefined : 'short',
117
+ timeZone: this.timeZone,
118
+ }, this.dateOnly)).format(moment);
122
119
  const spoken = relativeTime(this.language, { numeric: this.numeric ?? 'auto' })(moment, now).text;
123
- return html `<time
124
- part="time"
125
- datetime=${datetime}
126
- aria-label=${spoken}
127
- title=${whole}
128
- >${this.readingAt(moment, now).text}</time>`;
120
+ return html `<time part="time" datetime=${datetime} aria-label=${spoken} title=${whole}>${this.readingAt(moment, now).text}</time>`;
129
121
  }
130
122
  };
123
+ __decorate([
124
+ property()
125
+ ], HelixHeadlessFormatDate.prototype, "calendar", void 0);
131
126
  __decorate([
132
127
  property()
133
128
  ], HelixHeadlessFormatDate.prototype, "date", void 0);
@@ -143,6 +138,9 @@ __decorate([
143
138
  __decorate([
144
139
  property()
145
140
  ], HelixHeadlessFormatDate.prototype, "era", void 0);
141
+ __decorate([
142
+ property({ type: Boolean })
143
+ ], HelixHeadlessFormatDate.prototype, "fields", void 0);
146
144
  __decorate([
147
145
  property({ type: Boolean })
148
146
  ], HelixHeadlessFormatDate.prototype, "frozen", void 0);
@@ -185,9 +183,6 @@ __decorate([
185
183
  __decorate([
186
184
  property()
187
185
  ], HelixHeadlessFormatDate.prototype, "year", void 0);
188
- __decorate([
189
- state()
190
- ], HelixHeadlessFormatDate.prototype, "written", void 0);
191
186
  HelixHeadlessFormatDate = __decorate([
192
187
  customElement('helix-headless-format-date')
193
188
  ], HelixHeadlessFormatDate);
@@ -87,6 +87,17 @@ export declare const within: (adjacency: Adjacency, from: string, depth: number)
87
87
  * its order instead.
88
88
  */
89
89
  export declare const entriesOf: (sorted: readonly GraphNode[], adjacency: Adjacency, active: string, query: string, shown?: ReadonlySet<string>) => Entry[];
90
+ /**
91
+ * The row the keyboard stays on once the rows are read again from changed
92
+ * notes or links: the row of the note it was on, `id`, wherever that note now
93
+ * is, or, where the note was taken away, the row at `at` that took its place,
94
+ * the last row where the list grew shorter than that.
95
+ *
96
+ * **The reader stays where they were.** A graph a page feeds as things happen
97
+ * changes its notes every few seconds, and a cursor sent to the top on each
98
+ * change threw a reader moving through the list back to its first row.
99
+ */
100
+ export declare const cursorAfter: (entries: readonly Entry[], id: string | undefined, at: number) => number;
90
101
  /** The notes in the order of their names, as the page's language orders words. */
91
102
  export declare const sortedOf: (nodes: readonly GraphNode[], lang?: string) => GraphNode[];
92
103
  /** One group the notes are in, as the legend names it. */
@@ -69,6 +69,10 @@ export const entriesOf = (sorted, adjacency, active, query, shown) => {
69
69
  }
70
70
  return [...first, ...neighbors, ...rest];
71
71
  };
72
+ export const cursorAfter = (entries, id, at) => {
73
+ const found = id === undefined ? -1 : entries.findIndex((entry) => entry.node.id === id);
74
+ return found >= 0 ? found : Math.max(0, Math.min(at, entries.length - 1));
75
+ };
72
76
  export const sortedOf = (nodes, lang) => {
73
77
  const collator = new Intl.Collator(lang || undefined, { numeric: true, sensitivity: 'base' });
74
78
  return [...nodes].sort((one, other) => collator.compare(nameOf(one), nameOf(other)));