@fusion.dev/helix-headless 0.142.1 → 0.144.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/custom-elements.json +25381 -1202
  2. package/dist/accordion/item/accordion-item.d.ts +38 -2
  3. package/dist/accordion/item/accordion-item.js +38 -6
  4. package/dist/accordion/root/accordion-root.d.ts +23 -1
  5. package/dist/accordion/root/accordion-root.js +39 -3
  6. package/dist/announcement/root/announcement-root.d.ts +11 -7
  7. package/dist/announcement/root/announcement-root.js +1 -1
  8. package/dist/app-header/root/app-header-root.d.ts +21 -0
  9. package/dist/app-header/root/app-header-root.js +31 -5
  10. package/dist/area-chart/root/area-chart-root.d.ts +12 -4
  11. package/dist/area-chart/root/area-chart-root.js +39 -11
  12. package/dist/avatar/group/avatar-group.d.ts +24 -3
  13. package/dist/avatar/group/avatar-group.js +34 -2
  14. package/dist/avatar/root/avatar-root.d.ts +17 -1
  15. package/dist/avatar/root/avatar-root.js +31 -10
  16. package/dist/badge/root/badge-root.d.ts +12 -0
  17. package/dist/badge/root/badge-root.js +1 -1
  18. package/dist/bar-chart/root/bar-chart-root.d.ts +30 -5
  19. package/dist/bar-chart/root/bar-chart-root.js +58 -21
  20. package/dist/blockquote/root/blockquote-root.d.ts +12 -7
  21. package/dist/blockquote/root/blockquote-root.js +6 -4
  22. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +9 -3
  23. package/dist/breadcrumbs/root/breadcrumbs-root.js +9 -1
  24. package/dist/button/root/button-root.d.ts +84 -1
  25. package/dist/button/root/button-root.js +81 -3
  26. package/dist/callout/root/callout-root.d.ts +32 -6
  27. package/dist/callout/root/callout-root.js +26 -7
  28. package/dist/canvas/root/canvas-root.d.ts +1 -0
  29. package/dist/canvas/root/canvas-root.js +10 -1
  30. package/dist/card/root/card-root.d.ts +30 -1
  31. package/dist/card/root/card-root.js +38 -5
  32. package/dist/carousel/root/carousel-root.d.ts +47 -5
  33. package/dist/carousel/root/carousel-root.js +53 -21
  34. package/dist/chat/composer/chat-composer.d.ts +13 -11
  35. package/dist/chat/composer/chat-composer.js +6 -12
  36. package/dist/chat/message/chat-message.js +8 -1
  37. package/dist/chat/root/chat-root.d.ts +1 -0
  38. package/dist/chat/root/chat-root.js +2 -1
  39. package/dist/checkbox/root/checkbox-root.d.ts +7 -0
  40. package/dist/checkbox/root/checkbox-root.js +9 -3
  41. package/dist/checkbox-group/root/checkbox-group-root.d.ts +116 -33
  42. package/dist/checkbox-group/root/checkbox-group-root.js +141 -44
  43. package/dist/code/root/code-root.d.ts +1 -1
  44. package/dist/code-block/lines.d.ts +13 -0
  45. package/dist/code-block/lines.js +2 -0
  46. package/dist/code-block/root/code-block-root.d.ts +49 -0
  47. package/dist/code-block/root/code-block-root.js +44 -3
  48. package/dist/color-input/root/color-input-root.d.ts +60 -2
  49. package/dist/color-input/root/color-input-root.js +55 -7
  50. package/dist/color-picker/channels.d.ts +26 -0
  51. package/dist/color-picker/channels.js +84 -0
  52. package/dist/color-picker/root/color-picker-root.d.ts +118 -12
  53. package/dist/color-picker/root/color-picker-root.js +183 -13
  54. package/dist/combobox/root/combobox-root.d.ts +126 -3
  55. package/dist/combobox/root/combobox-root.js +224 -21
  56. package/dist/command/root/command-root.d.ts +47 -10
  57. package/dist/command/root/command-root.js +45 -4
  58. package/dist/copy-button/from.d.ts +22 -0
  59. package/dist/copy-button/from.js +28 -0
  60. package/dist/copy-button/root/copy-button-root.d.ts +48 -7
  61. package/dist/copy-button/root/copy-button-root.js +54 -8
  62. package/dist/data-table/root/data-table-root.d.ts +164 -10
  63. package/dist/data-table/root/data-table-root.js +488 -57
  64. package/dist/date-input/root/date-input-root.d.ts +123 -9
  65. package/dist/date-input/root/date-input-root.js +147 -45
  66. package/dist/date-picker/root/date-picker-root.d.ts +229 -18
  67. package/dist/date-picker/root/date-picker-root.js +342 -46
  68. package/dist/dialog/description.d.ts +9 -0
  69. package/dist/dialog/description.js +14 -0
  70. package/dist/dialog/root/dialog-root.d.ts +101 -10
  71. package/dist/dialog/root/dialog-root.js +83 -4
  72. package/dist/donut-chart/root/donut-chart-root.d.ts +61 -16
  73. package/dist/donut-chart/root/donut-chart-root.js +48 -13
  74. package/dist/drawer/root/drawer-root.d.ts +93 -7
  75. package/dist/drawer/root/drawer-root.js +126 -5
  76. package/dist/drawer/swipe-start.d.ts +9 -0
  77. package/dist/drawer/swipe-start.js +12 -0
  78. package/dist/drilldown/item/drilldown-item.d.ts +16 -13
  79. package/dist/drilldown/item/drilldown-item.js +6 -2
  80. package/dist/drilldown/root/drilldown-root.d.ts +21 -5
  81. package/dist/drilldown/root/drilldown-root.js +26 -10
  82. package/dist/element-events.generated.js +42 -13
  83. package/dist/empty/root/empty-root.d.ts +1 -1
  84. package/dist/file-input/root/file-input-root.d.ts +65 -1
  85. package/dist/file-input/root/file-input-root.js +76 -12
  86. package/dist/file-input/screen.d.ts +35 -0
  87. package/dist/file-input/screen.js +49 -0
  88. package/dist/filter-input/menu/filter-menu.d.ts +9 -0
  89. package/dist/filter-input/menu/filter-menu.js +8 -0
  90. package/dist/filter-input/root/filter-input-root.d.ts +43 -6
  91. package/dist/filter-input/root/filter-input-root.js +89 -10
  92. package/dist/filter-input/suggest.d.ts +17 -0
  93. package/dist/filter-input/suggest.js +23 -0
  94. package/dist/format-date/options.d.ts +33 -0
  95. package/dist/format-date/options.js +42 -0
  96. package/dist/format-date/root/format-date-root.d.ts +62 -3
  97. package/dist/format-date/root/format-date-root.js +78 -37
  98. package/dist/graph/root/graph-root.d.ts +24 -3
  99. package/dist/graph/root/graph-root.js +66 -12
  100. package/dist/heatmap/root/buckets.d.ts +2 -1
  101. package/dist/heatmap/root/buckets.js +5 -1
  102. package/dist/heatmap/root/heatmap-root.d.ts +47 -9
  103. package/dist/heatmap/root/heatmap-root.js +46 -18
  104. package/dist/icon/index.d.ts +2 -0
  105. package/dist/icon/index.js +2 -0
  106. package/dist/icon/registry.d.ts +37 -0
  107. package/dist/icon/registry.js +83 -0
  108. package/dist/icon/root/icon-root.d.ts +53 -6
  109. package/dist/icon/root/icon-root.js +72 -4
  110. package/dist/icon/root/index.d.ts +2 -0
  111. package/dist/icon/root/index.js +2 -0
  112. package/dist/icon/set.d.ts +1 -0
  113. package/dist/icon/set.js +3 -0
  114. package/dist/icon-button/root/icon-button-root.d.ts +1 -1
  115. package/dist/image/root/image-root.d.ts +23 -2
  116. package/dist/image/root/image-root.js +23 -4
  117. package/dist/input/root/input-root.d.ts +62 -9
  118. package/dist/input/root/input-root.js +61 -5
  119. package/dist/kbd/root/kbd-root.d.ts +26 -11
  120. package/dist/kbd/root/kbd-root.js +35 -38
  121. package/dist/kbd/shortcut.d.ts +18 -0
  122. package/dist/kbd/shortcut.js +35 -0
  123. package/dist/legend/hidden-series.d.ts +8 -0
  124. package/dist/legend/hidden-series.js +13 -0
  125. package/dist/legend/root/legend-root.d.ts +63 -0
  126. package/dist/legend/root/legend-root.js +61 -7
  127. package/dist/lightbox/item/lightbox-item.d.ts +17 -1
  128. package/dist/lightbox/item/lightbox-item.js +10 -1
  129. package/dist/lightbox/root/lightbox-root.d.ts +77 -6
  130. package/dist/lightbox/root/lightbox-root.js +116 -5
  131. package/dist/line-chart/root/line-chart-root.d.ts +29 -4
  132. package/dist/line-chart/root/line-chart-root.js +58 -17
  133. package/dist/list/item/list-item.d.ts +11 -5
  134. package/dist/list/item/list-item.js +5 -6
  135. package/dist/listbox/range.d.ts +17 -0
  136. package/dist/listbox/range.js +5 -0
  137. package/dist/listbox/root/listbox-root.d.ts +184 -4
  138. package/dist/listbox/root/listbox-root.js +229 -23
  139. package/dist/loader/busy.d.ts +17 -0
  140. package/dist/loader/busy.js +24 -0
  141. package/dist/loader/root/loader-root.d.ts +37 -0
  142. package/dist/loader/root/loader-root.js +52 -3
  143. package/dist/map/root/map-root.d.ts +19 -4
  144. package/dist/map/root/map-root.js +36 -7
  145. package/dist/megamenu/root/megamenu-root.d.ts +10 -1
  146. package/dist/megamenu/root/megamenu-root.js +10 -1
  147. package/dist/menu/item/menu-item.d.ts +41 -12
  148. package/dist/menu/item/menu-item.js +46 -3
  149. package/dist/menu/root/menu-root.d.ts +32 -2
  150. package/dist/menu/root/menu-root.js +48 -8
  151. package/dist/meter/root/meter-root.d.ts +13 -0
  152. package/dist/meter/root/meter-root.js +24 -5
  153. package/dist/navigation/root/navigation-root.d.ts +10 -2
  154. package/dist/navigation/root/navigation-root.js +13 -2
  155. package/dist/notifications/feed-keys.d.ts +10 -0
  156. package/dist/notifications/feed-keys.js +14 -0
  157. package/dist/notifications/group/notification-group.d.ts +1 -0
  158. package/dist/notifications/notification/notification.d.ts +29 -0
  159. package/dist/notifications/notification/notification.js +51 -3
  160. package/dist/notifications/root/notifications-root.d.ts +49 -0
  161. package/dist/notifications/root/notifications-root.js +76 -2
  162. package/dist/number-input/root/number-input-root.d.ts +109 -7
  163. package/dist/number-input/root/number-input-root.js +109 -21
  164. package/dist/object-inspector/root/object-inspector-root.d.ts +49 -5
  165. package/dist/object-inspector/root/object-inspector-root.js +92 -12
  166. package/dist/option/root/option-root.d.ts +58 -6
  167. package/dist/option/root/option-root.js +35 -5
  168. package/dist/outline/root/outline-root.d.ts +13 -2
  169. package/dist/outline/root/outline-root.js +4 -2
  170. package/dist/pagination/root/pagination-root.d.ts +19 -1
  171. package/dist/pagination/root/pagination-root.js +49 -9
  172. package/dist/pagination/size/pagination-size.d.ts +13 -3
  173. package/dist/pagination/size/pagination-size.js +7 -0
  174. package/dist/pin-input/format.d.ts +7 -0
  175. package/dist/pin-input/format.js +16 -0
  176. package/dist/pin-input/root/pin-input-root.d.ts +37 -0
  177. package/dist/pin-input/root/pin-input-root.js +48 -7
  178. package/dist/popover/root/popover-root.d.ts +78 -3
  179. package/dist/popover/root/popover-root.js +74 -5
  180. package/dist/progress/root/progress-root.d.ts +23 -1
  181. package/dist/progress/root/progress-root.js +40 -10
  182. package/dist/qr-code/export.d.ts +31 -0
  183. package/dist/qr-code/export.js +10 -0
  184. package/dist/qr-code/root/qr-code-root.d.ts +45 -0
  185. package/dist/qr-code/root/qr-code-root.js +78 -3
  186. package/dist/radio/group/radio-group.d.ts +64 -0
  187. package/dist/radio/group/radio-group.js +66 -12
  188. package/dist/radio/root/radio-root.d.ts +8 -5
  189. package/dist/radio/root/radio-root.js +1 -2
  190. package/dist/rating/root/rating-root.d.ts +49 -1
  191. package/dist/rating/root/rating-root.js +69 -10
  192. package/dist/scatter-chart/root/scatter-chart-root.d.ts +17 -3
  193. package/dist/scatter-chart/root/scatter-chart-root.js +40 -14
  194. package/dist/select/root/select-root.d.ts +93 -3
  195. package/dist/select/root/select-root.js +111 -13
  196. package/dist/skeleton/root/skeleton-root.d.ts +39 -3
  197. package/dist/skeleton/root/skeleton-root.js +33 -4
  198. package/dist/skip-link/root/skip-link-root.d.ts +10 -0
  199. package/dist/skip-link/root/skip-link-root.js +15 -1
  200. package/dist/slider/root/slider-root.d.ts +59 -2
  201. package/dist/slider/root/slider-root.js +82 -8
  202. package/dist/sparkline/root/sparkline-root.d.ts +9 -10
  203. package/dist/speed-dial/item/speed-dial-item.d.ts +11 -5
  204. package/dist/speed-dial/item/speed-dial-item.js +7 -2
  205. package/dist/speed-dial/root/speed-dial-root.d.ts +15 -4
  206. package/dist/speed-dial/root/speed-dial-root.js +19 -5
  207. package/dist/splitter/root/splitter-root.d.ts +28 -6
  208. package/dist/splitter/root/splitter-root.js +35 -1
  209. package/dist/stat/root/stat-root.d.ts +9 -1
  210. package/dist/stat/root/stat-root.js +15 -2
  211. package/dist/steps/root/steps-root.js +1 -1
  212. package/dist/steps/step/step.d.ts +1 -0
  213. package/dist/steps/step/step.js +1 -1
  214. package/dist/switch/root/switch-root.d.ts +14 -2
  215. package/dist/switch/root/switch-root.js +7 -1
  216. package/dist/table/cell/table-cell.d.ts +24 -4
  217. package/dist/table/cell/table-cell.js +21 -1
  218. package/dist/table/column/table-column.d.ts +32 -6
  219. package/dist/table/column/table-column.js +36 -6
  220. package/dist/table/root/table-root.d.ts +94 -3
  221. package/dist/table/root/table-root.js +128 -5
  222. package/dist/table/row/table-row.d.ts +7 -0
  223. package/dist/table/row/table-row.js +9 -1
  224. package/dist/tabs/root/tabs-root.d.ts +6 -1
  225. package/dist/tabs/root/tabs-root.js +6 -2
  226. package/dist/tag/group/tag-group.d.ts +107 -0
  227. package/dist/tag/group/tag-group.js +157 -0
  228. package/dist/tag/index.d.ts +1 -0
  229. package/dist/tag/index.js +1 -0
  230. package/dist/tag/root/tag-root.d.ts +83 -1
  231. package/dist/tag/root/tag-root.js +87 -17
  232. package/dist/tag/selection.d.ts +10 -0
  233. package/dist/tag/selection.js +12 -0
  234. package/dist/textarea/grow.d.ts +22 -0
  235. package/dist/textarea/grow.js +20 -0
  236. package/dist/textarea/root/textarea-root.d.ts +13 -0
  237. package/dist/textarea/root/textarea-root.js +10 -2
  238. package/dist/time-input/root/time-input-root.d.ts +71 -6
  239. package/dist/time-input/root/time-input-root.js +110 -44
  240. package/dist/time-picker/root/time-picker-root.d.ts +155 -26
  241. package/dist/time-picker/root/time-picker-root.js +192 -63
  242. package/dist/toast/hotkey.d.ts +22 -0
  243. package/dist/toast/hotkey.js +23 -0
  244. package/dist/toast/item/toast-item.d.ts +16 -1
  245. package/dist/toast/item/toast-item.js +41 -13
  246. package/dist/toast/root/toast-root.d.ts +105 -8
  247. package/dist/toast/root/toast-root.js +209 -4
  248. package/dist/toggle/group/toggle-group.d.ts +95 -16
  249. package/dist/toggle/group/toggle-group.js +99 -13
  250. package/dist/toggle/root/toggle-root.d.ts +26 -11
  251. package/dist/toggle/root/toggle-root.js +14 -6
  252. package/dist/toolbar/root/toolbar-root.d.ts +55 -15
  253. package/dist/toolbar/root/toolbar-root.js +99 -16
  254. package/dist/tooltip/focus-target.d.ts +6 -0
  255. package/dist/tooltip/focus-target.js +9 -0
  256. package/dist/tooltip/root/tooltip-root.d.ts +73 -15
  257. package/dist/tooltip/root/tooltip-root.js +96 -7
  258. package/dist/tour/naming.d.ts +30 -0
  259. package/dist/tour/naming.js +10 -0
  260. package/dist/tour/root/tour-root.d.ts +67 -3
  261. package/dist/tour/root/tour-root.js +105 -17
  262. package/dist/tour/stop/tour-stop.d.ts +65 -3
  263. package/dist/tour/stop/tour-stop.js +61 -11
  264. package/dist/tour/wait.d.ts +11 -0
  265. package/dist/tour/wait.js +19 -0
  266. package/dist/tree/item/tree-item.d.ts +21 -5
  267. package/dist/tree/item/tree-item.js +14 -4
  268. package/dist/tree/root/tree-root.d.ts +29 -5
  269. package/dist/tree/root/tree-root.js +64 -8
  270. package/dist/trend/root/trend-root.d.ts +36 -1
  271. package/dist/trend/root/trend-root.js +41 -15
  272. package/dist/video/root/keys.d.ts +5 -0
  273. package/dist/video/root/keys.js +13 -1
  274. package/dist/video/root/video-root.d.ts +19 -0
  275. package/dist/video/root/video-root.js +48 -4
  276. package/dist/video-playlist/menu/video-playlist-menu.d.ts +20 -2
  277. package/dist/video-playlist/menu/video-playlist-menu.js +27 -5
  278. package/dist/video-playlist/root/video-playlist-root.js +6 -3
  279. package/dist/virtual-list/root/virtual-list-root.d.ts +52 -4
  280. package/dist/virtual-list/root/virtual-list-root.js +103 -21
  281. package/lint.json +1 -1
  282. package/package.json +5 -5
  283. package/types/jsx.d.ts +9140 -1149
  284. package/types/svelte.d.ts +1 -0
  285. package/types/vue.d.ts +2089 -267
@@ -4,9 +4,11 @@ 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, subscribe } from '@fusion.dev/helix-core';
7
+ import { customElement, elapsedTime, HelixElement, relativeTime, subscribe, } from '@fusion.dev/helix-core';
8
8
  import { html, nothing } from 'lit';
9
9
  import { property, state } from 'lit/decorators.js';
10
+ import { formatOptions } from '../options.js';
11
+ const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
10
12
  let HelixHeadlessFormatDate = class HelixHeadlessFormatDate extends HelixElement {
11
13
  constructor() {
12
14
  super(...arguments);
@@ -18,6 +20,9 @@ let HelixHeadlessFormatDate = class HelixHeadlessFormatDate extends HelixElement
18
20
  this.stopTicking = undefined;
19
21
  this.watching = undefined;
20
22
  }
23
+ get dateOnly() {
24
+ return DATE_ONLY.test((this.date || this.written).trim());
25
+ }
21
26
  get moment() {
22
27
  const source = this.date || this.written;
23
28
  if (source === '') {
@@ -27,35 +32,33 @@ let HelixHeadlessFormatDate = class HelixHeadlessFormatDate extends HelixElement
27
32
  return Number.isNaN(parsed.getTime()) ? undefined : parsed;
28
33
  }
29
34
  get options() {
30
- const asked = {};
31
- if (this.day) {
32
- asked.day = this.day;
33
- }
34
- if (this.hour) {
35
- asked.hour = this.hour;
36
- }
37
- if (this.minute) {
38
- asked.minute = this.minute;
39
- }
40
- if (this.month) {
41
- asked.month = this.month;
42
- }
43
- if (this.second) {
44
- asked.second = this.second;
45
- }
46
- if (this.timeZone) {
47
- asked.timeZone = this.timeZone;
48
- }
49
- if (this.timeZoneName) {
50
- asked.timeZoneName = this.timeZoneName;
51
- }
52
- if (this.weekday) {
53
- asked.weekday = this.weekday;
54
- }
55
- if (this.year) {
56
- asked.year = this.year;
57
- }
58
- return asked;
35
+ return formatOptions({
36
+ dateOnly: this.dateOnly,
37
+ dateStyle: this.dateStyle,
38
+ day: this.day,
39
+ era: this.era,
40
+ hour: this.hour,
41
+ hourCycle: this.hourCycle,
42
+ minute: this.minute,
43
+ month: this.month,
44
+ second: this.second,
45
+ timeStyle: this.timeStyle,
46
+ timeZone: this.timeZone,
47
+ timeZoneName: this.timeZoneName,
48
+ weekday: this.weekday,
49
+ year: this.year,
50
+ });
51
+ }
52
+ get reading() {
53
+ return this.elapsed || this.relative !== undefined;
54
+ }
55
+ readingAt(moment, now) {
56
+ return this.elapsed
57
+ ? elapsedTime(this.locale)(moment, now)
58
+ : relativeTime(this.locale, {
59
+ numeric: this.numeric ?? 'auto',
60
+ style: this.relative ?? 'long',
61
+ })(moment, now);
59
62
  }
60
63
  connectedCallback() {
61
64
  super.connectedCallback();
@@ -81,7 +84,11 @@ let HelixHeadlessFormatDate = class HelixHeadlessFormatDate extends HelixElement
81
84
  if (this.childrenKnown) {
82
85
  this.read();
83
86
  }
84
- if (changed.has('date') || changed.has('elapsed') || changed.has('locale')) {
87
+ if (changed.has('date') ||
88
+ changed.has('elapsed') ||
89
+ changed.has('locale') ||
90
+ changed.has('numeric') ||
91
+ changed.has('relative')) {
85
92
  this.tick();
86
93
  }
87
94
  }
@@ -104,12 +111,12 @@ let HelixHeadlessFormatDate = class HelixHeadlessFormatDate extends HelixElement
104
111
  this.stopTicking?.();
105
112
  this.stopTicking = undefined;
106
113
  const moment = this.moment;
107
- if (!moment || !this.elapsed) {
114
+ if (!moment || !this.reading) {
108
115
  return;
109
116
  }
110
117
  const now = new Date();
111
118
  this.clock = now.getTime();
112
- const { next } = elapsedTime(this.locale)(moment, now);
119
+ const { next } = this.readingAt(moment, now);
113
120
  if (!Number.isFinite(next) || !this.isConnected) {
114
121
  return;
115
122
  }
@@ -120,24 +127,49 @@ let HelixHeadlessFormatDate = class HelixHeadlessFormatDate extends HelixElement
120
127
  if (!moment) {
121
128
  return nothing;
122
129
  }
123
- const text = this.elapsed
124
- ? elapsedTime(this.locale)(moment, new Date(this.clock ?? Date.now())).text
125
- : new Intl.DateTimeFormat(this.locale || undefined, this.options).format(moment);
126
- return html `<time part="time" datetime=${moment.toISOString()}>${text}</time>`;
130
+ const datetime = this.dateOnly ? (this.date || this.written).trim() : moment.toISOString();
131
+ if (!this.reading) {
132
+ const text = new Intl.DateTimeFormat(this.locale || undefined, this.options).format(moment);
133
+ return html `<time part="time" datetime=${datetime}>${text}</time>`;
134
+ }
135
+ const now = new Date(this.clock ?? Date.now());
136
+ const zone = this.timeZone || (this.dateOnly ? 'UTC' : undefined);
137
+ const whole = new Intl.DateTimeFormat(this.locale || undefined, {
138
+ dateStyle: 'long',
139
+ ...(this.dateOnly ? {} : { timeStyle: 'short' }),
140
+ ...(this.hourCycle ? { hourCycle: this.hourCycle } : {}),
141
+ ...(zone ? { timeZone: zone } : {}),
142
+ }).format(moment);
143
+ const spoken = relativeTime(this.locale, { numeric: this.numeric ?? 'auto' })(moment, now).text;
144
+ return html `<time
145
+ part="time"
146
+ datetime=${datetime}
147
+ aria-label=${spoken}
148
+ title=${whole}
149
+ >${this.readingAt(moment, now).text}</time>`;
127
150
  }
128
151
  };
129
152
  __decorate([
130
153
  property()
131
154
  ], HelixHeadlessFormatDate.prototype, "date", void 0);
155
+ __decorate([
156
+ property({ attribute: 'date-style' })
157
+ ], HelixHeadlessFormatDate.prototype, "dateStyle", void 0);
132
158
  __decorate([
133
159
  property()
134
160
  ], HelixHeadlessFormatDate.prototype, "day", void 0);
135
161
  __decorate([
136
162
  property({ reflect: true, type: Boolean })
137
163
  ], HelixHeadlessFormatDate.prototype, "elapsed", void 0);
164
+ __decorate([
165
+ property()
166
+ ], HelixHeadlessFormatDate.prototype, "era", void 0);
138
167
  __decorate([
139
168
  property()
140
169
  ], HelixHeadlessFormatDate.prototype, "hour", void 0);
170
+ __decorate([
171
+ property({ attribute: 'hour-cycle' })
172
+ ], HelixHeadlessFormatDate.prototype, "hourCycle", void 0);
141
173
  __decorate([
142
174
  property()
143
175
  ], HelixHeadlessFormatDate.prototype, "locale", void 0);
@@ -147,9 +179,18 @@ __decorate([
147
179
  __decorate([
148
180
  property()
149
181
  ], HelixHeadlessFormatDate.prototype, "month", void 0);
182
+ __decorate([
183
+ property()
184
+ ], HelixHeadlessFormatDate.prototype, "numeric", void 0);
185
+ __decorate([
186
+ property()
187
+ ], HelixHeadlessFormatDate.prototype, "relative", void 0);
150
188
  __decorate([
151
189
  property()
152
190
  ], HelixHeadlessFormatDate.prototype, "second", void 0);
191
+ __decorate([
192
+ property({ attribute: 'time-style' })
193
+ ], HelixHeadlessFormatDate.prototype, "timeStyle", void 0);
153
194
  __decorate([
154
195
  property({ attribute: 'time-zone' })
155
196
  ], HelixHeadlessFormatDate.prototype, "timeZone", void 0);
@@ -232,16 +232,37 @@ export declare class HelixHeadlessGraph extends HelixHeadlessGraph_base {
232
232
  /**
233
233
  * Moves the keyboard to a row, and the list to show it.
234
234
  *
235
- * **Scrolled by the row's own box where it is drawn, and by the estimate
236
- * where it is not**, so a jump to the end of ten thousand notes lands there
237
- * and the row is drawn by the update the scroll asks for.
235
+ * **The row the keys are on is always drawn**, beside the window where it is
236
+ * outside it, so `aria-activedescendant` names a row that exists. The list
237
+ * then scrolls to it, see `revealCursor`.
238
238
  */
239
239
  private moveTo;
240
+ /**
241
+ * Brings the cursor's row into the list's box.
242
+ *
243
+ * **By the row's own box once it is in the window, and by the window
244
+ * otherwise.** The offset of a row that has not been drawn is a guess at its
245
+ * height, and a guess at 32 pixels was where End and Page Down sent the list
246
+ * when rows were taller: the list landed far from the row, which then was
247
+ * not drawn. So the window is moved toward the row, the rows it draws are
248
+ * measured, and the next try starts from there, a few times at most.
249
+ */
250
+ private revealCursor;
251
+ /** The cursor's row, where it is outside the window and drawn beside it. */
252
+ private get keptRow();
240
253
  /**
241
254
  * The keys in the list. **Kept from the frame**, whose arrows pan the
242
255
  * drawing: a reader moving through the list was moving the graph under it.
243
256
  */
244
257
  private readonly handleListKeydown;
258
+ /** What has been typed toward a note's name, and when the last letter came. */
259
+ private typed;
260
+ /**
261
+ * Moves to the next note whose name starts with what was typed, as a
262
+ * listbox does. Letters within half a second of each other run together,
263
+ * and a repeated letter steps through the names that start with it.
264
+ */
265
+ private typeahead;
245
266
  /**
246
267
  * The search field's keys, which belong to the field and never pan the
247
268
  * graph. Escape empties a search that has words in it, and passes through
@@ -4,10 +4,11 @@ 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, formatNumbers, HelixElement, HelixGraphFilterEvent, HelixGraphLayoutEvent, HelixGraphPanEvent, HelixGraphPartChangeEvent, HelixGraphReadyEvent, HelixGraphSignalEvent, HelixGraphZoomEvent, MixinControllerActive, MixinViewport, VirtualizeController, } from '@fusion.dev/helix-core';
7
+ import { customElement, fillTemplate, formatNumbers, HelixElement, HelixGraphFilterEvent, HelixGraphLayoutEvent, HelixGraphPanEvent, HelixGraphPartChangeEvent, HelixGraphReadyEvent, HelixGraphSignalEvent, HelixGraphZoomEvent, MixinControllerActive, MixinViewport, scrollItemIntoView, VirtualizeController, } from '@fusion.dev/helix-core';
8
8
  import { list, magnifyingGlass } from '@fusion.dev/helix-icons';
9
9
  import { html, nothing } from 'lit';
10
10
  import { property, state } from 'lit/decorators.js';
11
+ import { repeat } from 'lit/directives/repeat.js';
11
12
  import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
12
13
  import { adjacencyOf, entriesOf, groupsOf, nameOf, sortedOf, within, withoutGroups, } from './graph-model.js';
13
14
  const PAGE = 10;
@@ -65,8 +66,15 @@ let HelixHeadlessGraph = class HelixHeadlessGraph extends MixinViewport(MixinCon
65
66
  event.preventDefault();
66
67
  event.stopPropagation();
67
68
  this.choose(this.cursor);
69
+ return;
70
+ }
71
+ if (event.key.length === 1 && !event.altKey && !event.ctrlKey && !event.metaKey) {
72
+ event.preventDefault();
73
+ event.stopPropagation();
74
+ this.typeahead(event.key);
68
75
  }
69
76
  };
77
+ this.typed = { at: 0, text: '' };
70
78
  this.handleSearchKeydown = (event) => {
71
79
  if (event.key === 'ArrowDown') {
72
80
  event.preventDefault();
@@ -236,18 +244,50 @@ let HelixHeadlessGraph = class HelixHeadlessGraph extends MixinViewport(MixinCon
236
244
  moveTo(index) {
237
245
  const last = this.entries.length - 1;
238
246
  this.cursor = Math.min(Math.max(index, 0), Math.max(last, 0));
247
+ void this.updateComplete.then(() => this.revealCursor());
248
+ }
249
+ revealCursor(attempts = 8) {
239
250
  const list = this.partNamed('list');
240
251
  if (!list) {
241
252
  return;
242
253
  }
243
- const row = this.renderRoot.querySelector?.(`[data-index="${this.cursor}"]`);
244
- if (row) {
245
- row.scrollIntoView?.({ block: 'nearest' });
254
+ const { first, last } = this.virtualize.window;
255
+ if (this.cursor >= first && this.cursor < last) {
256
+ const row = this.renderRoot.querySelector?.(`[data-index="${this.cursor}"]`);
257
+ if (row) {
258
+ scrollItemIntoView(row, { scroller: list });
259
+ }
260
+ return;
246
261
  }
247
- else {
248
- list.scrollTop = this.cursor * 32;
262
+ if (attempts === 0) {
263
+ return;
249
264
  }
265
+ this.virtualize.reveal(this.cursor);
250
266
  this.virtualize.measure();
267
+ void this.updateComplete.then(() => this.revealCursor(attempts - 1));
268
+ }
269
+ get keptRow() {
270
+ const { first, last } = this.virtualize.window;
271
+ const cursor = this.cursor;
272
+ return this.entries.length > 0 && (cursor < first || cursor >= last) ? cursor : undefined;
273
+ }
274
+ typeahead(letter) {
275
+ const now = Date.now();
276
+ const text = now - this.typed.at < 500 ? this.typed.text + letter : letter;
277
+ this.typed = { at: now, text };
278
+ const wanted = text.toLocaleLowerCase();
279
+ const repeated = [...wanted].every((one) => one === wanted[0]);
280
+ const prefix = repeated ? (wanted[0] ?? '') : wanted;
281
+ const entries = this.entries;
282
+ const start = repeated ? this.cursor + 1 : this.cursor;
283
+ for (let step = 0; step < entries.length; step += 1) {
284
+ const at = (start + step) % entries.length;
285
+ const entry = entries[at];
286
+ if (entry && nameOf(entry.node).toLocaleLowerCase().startsWith(prefix)) {
287
+ this.moveTo(at);
288
+ return;
289
+ }
290
+ }
251
291
  }
252
292
  togglePanel(open = !this.panelOpen) {
253
293
  const inside = this.panelOpen && this.partNamed('panel')?.contains(this.shadowRoot?.activeElement ?? null);
@@ -290,8 +330,18 @@ let HelixHeadlessGraph = class HelixHeadlessGraph extends MixinViewport(MixinCon
290
330
  renderRows() {
291
331
  const { first, last } = this.virtualize.window;
292
332
  const total = this.entries.length;
293
- return this.entries.slice(first, last).map((entry, offset) => {
294
- const index = first + offset;
333
+ const indices = Array.from({ length: Math.max(0, Math.min(last, total) - first) }, (_, at) => first + at);
334
+ const kept = this.keptRow;
335
+ if (kept !== undefined && kept < total) {
336
+ if (kept < first) {
337
+ indices.unshift(kept);
338
+ }
339
+ else {
340
+ indices.push(kept);
341
+ }
342
+ }
343
+ return html `${repeat(indices, (index) => index, (index) => {
344
+ const entry = this.entries[index];
295
345
  const relation = this.relationText(entry);
296
346
  const chosen = entry.relation === 'selected';
297
347
  return html `<div
@@ -311,10 +361,14 @@ let HelixHeadlessGraph = class HelixHeadlessGraph extends MixinViewport(MixinCon
311
361
  <span part="note-name">${nameOf(entry.node)}</span>
312
362
  ${relation ? html `<span part="note-relation" aria-hidden="true">${relation}</span>` : nothing}
313
363
  </div>`;
314
- });
364
+ })}`;
315
365
  }
316
366
  render() {
317
- const { after, before } = this.virtualize.window;
367
+ const window = this.virtualize.window;
368
+ const kept = this.keptRow;
369
+ const room = kept === undefined ? 0 : this.virtualize.sizeOf(kept);
370
+ const before = Math.max(0, window.before - (kept !== undefined && kept < window.first ? room : 0));
371
+ const after = Math.max(0, window.after - (kept !== undefined && kept >= window.last ? room : 0));
318
372
  const cursor = this.entries.length > 0 ? `note-${this.cursor}` : nothing;
319
373
  return html `<div
320
374
  part="region"
@@ -368,9 +422,9 @@ let HelixHeadlessGraph = class HelixHeadlessGraph extends MixinViewport(MixinCon
368
422
  @keydown=${this.handleListKeydown}
369
423
  @scroll=${() => this.virtualize.measure()}
370
424
  >
371
- <div part="before" style="block-size: ${before}px"></div>
425
+ <div part="before" role="presentation" style="block-size: ${before}px"></div>
372
426
  ${this.renderRows()}
373
- <div part="after" style="block-size: ${after}px"></div>
427
+ <div part="after" role="presentation" style="block-size: ${after}px"></div>
374
428
  </div>
375
429
  </div>
376
430
  </div>
@@ -10,7 +10,8 @@
10
10
  /** A reading, reduced to what the bucketing needs. */
11
11
  export interface Reading {
12
12
  tone?: string | undefined;
13
- value: number;
13
+ /** The number, or undefined for a row whose cell was blank. */
14
+ value: number | undefined;
14
15
  }
15
16
  /**
16
17
  * The tone for one reading, from its own `data-tone` or from the thresholds.
@@ -6,8 +6,12 @@ export const toneOf = (reading, thresholds, tones) => {
6
6
  return undefined;
7
7
  }
8
8
  let chosen;
9
+ const value = reading.value;
10
+ if (value === undefined) {
11
+ return undefined;
12
+ }
9
13
  for (const [index, bound] of thresholds.entries()) {
10
- if (reading.value >= bound) {
14
+ if (value >= bound) {
11
15
  chosen = tones[index] ?? chosen;
12
16
  }
13
17
  }
@@ -1,4 +1,4 @@
1
- import { HelixElement } from '@fusion.dev/helix-core';
1
+ import { AriaForwardController, HelixElement } from '@fusion.dev/helix-core';
2
2
  import { nothing, type PropertyValues, type TemplateResult } from 'lit';
3
3
  import '../../tooltip/index.js';
4
4
  declare const HelixHeadlessHeatmap_base: typeof HelixElement & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinChartSourceInterface);
@@ -26,6 +26,12 @@ declare const HelixHeadlessHeatmap_base: typeof HelixElement & (new (...args: an
26
26
  * your own stylesheet defines that property. The headless tier does not use
27
27
  * `var(--helix-color-*)`.
28
28
  *
29
+ * **The strip is read by key.** It takes focus once it has cells. The up and
30
+ * down arrows move a cell, the left and right arrows move a column, which is a
31
+ * week with `rows="7"`, and Home and End go to the first and the last. The
32
+ * tooltip follows, the `live` part says the cell's row in words, and Escape
33
+ * puts the tooltip away.
34
+ *
29
35
  * @since 0.1.0
30
36
  * @status stable
31
37
  * @category charts
@@ -39,12 +45,14 @@ declare const HelixHeadlessHeatmap_base: typeof HelixElement & (new (...args: an
39
45
  * @event {HelixResizeEvent} helix-resize - Fired when the number of cells drawn changes, with the new number.
40
46
  *
41
47
  * @csspart cell - One reading.
48
+ * @csspart cell-active - The cell the pointer or the keys rest on. Set alongside `cell`.
42
49
  * @csspart empty - Shown when the table has no readings. It stays hidden until the table can be read: on the server and during hydration, there is no document to resolve `for` in.
43
50
  * @csspart end - The trailing slot's box.
44
51
  * @csspart footer - The three-slot row under the strip.
52
+ * @csspart live - The readout: a polite live region that says the cell the keys moved to. Hide it visually.
45
53
  * @csspart mark - The invisible point the tooltip is anchored to.
46
54
  * @csspart start - The leading slot's box.
47
- * @csspart strip - The grid of cells.
55
+ * @csspart strip - The grid of cells, which takes focus to be read by key. It is named by the host's `aria-labelledby` or `aria-label`, then by `label`, then by the caption of the table.
48
56
  * @csspart summary - The middle slot's box.
49
57
  * @csspart tooltip - The bubble, forwarded from `Tooltip`.
50
58
  * @csspart tooltip-anchor - The `Tooltip` element itself.
@@ -55,6 +63,7 @@ declare const HelixHeadlessHeatmap_base: typeof HelixElement & (new (...args: an
55
63
  * @csspart tooltip-arrow-top - The point while the bubble is above the reading, on its bottom edge. Set alongside `tooltip-arrow`.
56
64
  * @csspart tooltip-bottom - The bubble while it is below the reading. Set alongside `tooltip`.
57
65
  * @csspart tooltip-cell - One column's name and value inside the tooltip.
66
+ * @csspart tooltip-cell-current - The cell the series keys rest on, in the charts whose readings hold several series. A strip draws one, so it is never set here.
58
67
  * @csspart tooltip-label - The reading's own name inside the tooltip.
59
68
  * @csspart tooltip-left - The bubble while it is left of the reading. Set alongside `tooltip`.
60
69
  * @csspart tooltip-name - A column's name inside the tooltip.
@@ -184,18 +193,36 @@ export declare class HelixHeadlessHeatmap extends HelixHeadlessHeatmap_base {
184
193
  */
185
194
  private metrics;
186
195
  /**
187
- * Which drawn cell the pointer is on, as an index into `drawn`, or -1 for
188
- * none.
196
+ * Carries a host `aria-labelledby` and `aria-describedby` to the strip, the
197
+ * image a reader lands on. The host is a generic around it.
198
+ */
199
+ protected readonly aria: AriaForwardController;
200
+ /**
201
+ * Hears an `aria-label` written on the element, which no property mirrors.
202
+ *
203
+ * Lit observes the attributes of its own properties only, and `ariaLabel`
204
+ * belongs to the platform.
205
+ */
206
+ static get observedAttributes(): string[];
207
+ /**
208
+ * Called by the browser when an observed attribute changes. A new
209
+ * `aria-label` asks for an update, because it names the strip.
189
210
  */
190
- private hovered;
211
+ attributeChangedCallback(name: string, old: string | null, value: string | null): void;
191
212
  private observer;
192
213
  private announced;
193
214
  /**
194
- * Every reading in the table, oldest first, as the table is written.
215
+ * Every row in the table, oldest first, as the table is written, with its
216
+ * reading where the row has one.
195
217
  *
196
218
  * **Not `readings`, which the mixin already has and which means a count.**
197
219
  * Two members of the same name meaning a number and an array is the kind of
198
220
  * collision that type-checks in one direction and reads wrong in both.
221
+ *
222
+ * **One cell per row, and a blank row is a cell with no reading.** Taken from
223
+ * the series alone, a blank dropped its day and every day after it moved one
224
+ * cell along, while the tooltip still counted rows and named the day beside
225
+ * the one under the pointer.
199
226
  */
200
227
  private get points();
201
228
  /**
@@ -260,9 +287,21 @@ export declare class HelixHeadlessHeatmap extends HelixHeadlessHeatmap_base {
260
287
  * keep the oldest is answering a question nobody asked.
261
288
  */
262
289
  private get drawn();
290
+ /**
291
+ * The number of cells drawn, which the keys walk.
292
+ *
293
+ * The mixin counts the table's rows, and a strip too narrow for all of them
294
+ * draws the newest, so a key stepping by rows would walk off the drawing.
295
+ */
296
+ get readings(): number;
297
+ /**
298
+ * Tells the keys how many days stand in a column, so the up and down arrows
299
+ * move a day and the across pair a week. Here rather than in `updated`, for
300
+ * the reason `BarChart` gives: SSR calls this one.
301
+ */
302
+ protected willUpdate(changed: PropertyValues<this>): void;
263
303
  connectedCallback(): void;
264
304
  disconnectedCallback(): void;
265
- protected willUpdate(changed: PropertyValues): void;
266
305
  /**
267
306
  * Says on the footer whether any of its three slots holds anything.
268
307
  *
@@ -303,8 +342,7 @@ export declare class HelixHeadlessHeatmap extends HelixHeadlessHeatmap_base {
303
342
  *
304
343
  * `pointerover` on the strip rather than a listener per cell: the event
305
344
  * bubbles, so one handler covers however many cells there are, and unlike
306
- * `mouseover` it is delivered for a pen and for the touch that follows a long
307
- * press.
345
+ * `mouseover` it is delivered for a pen.
308
346
  */
309
347
  private readonly onPointerOver;
310
348
  private readonly onPointerLeave;
@@ -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, customElement, drawTooltip, HelixElement, HelixResizeEvent, hostAria, MixinChartSource, markRegion, searchableById, writtenList, writtenNumbers, } from '@fusion.dev/helix-core';
7
+ import { AriaForwardController, byRow, CHART_PLOT, customElement, drawTooltip, HelixElement, HelixResizeEvent, MixinChartSource, markRegion, searchableById, writtenList, writtenNumbers, } from '@fusion.dev/helix-core';
8
8
  import { html, nothing } from 'lit';
9
9
  import { property, state } from 'lit/decorators.js';
10
10
  import '../../tooltip/index.js';
@@ -20,23 +20,43 @@ let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartSource(H
20
20
  this.tones = '';
21
21
  this.width = undefined;
22
22
  this.metrics = undefined;
23
- this.hovered = -1;
23
+ this.aria = new AriaForwardController(this, {
24
+ target: () => this.partNamed('strip'),
25
+ });
24
26
  this.observer = undefined;
25
27
  this.announced = undefined;
26
28
  this.onPointerOver = (event) => {
27
- const cell = event.target?.closest?.('[part="cell"]');
29
+ if (!this.pointer.accepts(event)) {
30
+ return;
31
+ }
32
+ const cell = event.target?.closest?.('[part~="cell"]');
28
33
  const index = Number(cell?.getAttribute('data-index') ?? -1);
29
- this.hovered = Number.isInteger(index) ? index : -1;
34
+ this.pointer.set(Number.isInteger(index) ? index : -1);
30
35
  };
31
36
  this.onPointerLeave = () => {
32
- this.hovered = -1;
37
+ if (!this.pointer.keyed) {
38
+ this.pointer.set(-1);
39
+ }
33
40
  };
34
41
  }
35
42
  get visible() {
36
43
  return Math.min(this.points.length, this.room);
37
44
  }
45
+ static get observedAttributes() {
46
+ return [...super.observedAttributes, 'aria-label'];
47
+ }
48
+ attributeChangedCallback(name, old, value) {
49
+ super.attributeChangedCallback(name, old, value);
50
+ if (name === 'aria-label') {
51
+ this.requestUpdate();
52
+ }
53
+ }
38
54
  get points() {
39
- return this.series[0]?.points ?? [];
55
+ const series = this.series[0];
56
+ if (!series) {
57
+ return [];
58
+ }
59
+ return byRow(series, this.sourceRows.length).map((point) => point ?? { value: undefined });
40
60
  }
41
61
  get sourceKnown() {
42
62
  if (this.for === '') {
@@ -79,6 +99,13 @@ let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartSource(H
79
99
  const all = this.points;
80
100
  return all.slice(Math.max(0, all.length - this.room));
81
101
  }
102
+ get readings() {
103
+ return this.drawn.length;
104
+ }
105
+ willUpdate(changed) {
106
+ super.willUpdate(changed);
107
+ this.pointer.grid = this.rowCount;
108
+ }
82
109
  connectedCallback() {
83
110
  super.connectedCallback();
84
111
  if (typeof ResizeObserver !== 'undefined') {
@@ -96,10 +123,6 @@ let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartSource(H
96
123
  this.observer?.disconnect();
97
124
  this.observer = undefined;
98
125
  }
99
- willUpdate(changed) {
100
- super.willUpdate(changed);
101
- hostAria(this.internals, { label: this.label || 'Heatmap', role: 'img' });
102
- }
103
126
  markEmpty() {
104
127
  markRegion(this.renderRoot, 'footer', ['start', 'summary', 'end']);
105
128
  }
@@ -126,10 +149,14 @@ let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartSource(H
126
149
  const bounds = writtenNumbers(this.thresholds);
127
150
  const palette = writtenList(this.tones);
128
151
  const cells = this.drawn;
152
+ const readable = cells.length > 0;
129
153
  return html `<div
154
+ aria-label=${this.getAttribute?.('aria-label') || this.named || 'Heatmap'}
130
155
  part="strip"
131
156
  id=${CHART_PLOT}
157
+ role=${readable ? 'application' : 'img'}
132
158
  style="--heatmap-rows: ${this.rowCount}"
159
+ tabindex=${readable ? '0' : nothing}
133
160
  @pointerover=${this.onPointerOver}
134
161
  @pointerleave=${this.onPointerLeave}
135
162
  >
@@ -137,10 +164,14 @@ let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartSource(H
137
164
  ? nothing
138
165
  : cells.map((reading, index) => {
139
166
  const tone = toneOf(reading, bounds, palette);
167
+ const active = this.pointer.at === index;
140
168
  return tone === undefined
141
- ? html `<span part="cell" data-index=${index}></span>`
169
+ ? html `<span
170
+ part="cell${active ? ' cell-active' : ''}"
171
+ data-index=${index}
172
+ ></span>`
142
173
  : html `<span
143
- part="cell"
174
+ part="cell${active ? ' cell-active' : ''}"
144
175
  data-index=${index}
145
176
  data-tone=${tone}
146
177
  style="--heatmap-tone: var(--heatmap-tone-${tone})"
@@ -156,9 +187,9 @@ let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartSource(H
156
187
  </div>`;
157
188
  }
158
189
  renderTooltip() {
159
- const at = this.hovered;
190
+ const at = this.pointer.at;
160
191
  if (at < 0) {
161
- return nothing;
192
+ return drawTooltip(this.sourceRows, -1, this.tag('tooltip'), undefined, undefined, this.pointer);
162
193
  }
163
194
  const offset = this.points.length - this.drawn.length;
164
195
  const cell = this.cellPx;
@@ -169,7 +200,7 @@ let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartSource(H
169
200
  placement: 'top',
170
201
  x: `${column * (cell + gap) + cell / 2}px`,
171
202
  y: `${row * (cell + gap)}px`,
172
- });
203
+ }, undefined, this.pointer);
173
204
  }
174
205
  };
175
206
  __decorate([
@@ -196,9 +227,6 @@ __decorate([
196
227
  __decorate([
197
228
  state()
198
229
  ], HelixHeadlessHeatmap.prototype, "metrics", void 0);
199
- __decorate([
200
- state()
201
- ], HelixHeadlessHeatmap.prototype, "hovered", void 0);
202
230
  HelixHeadlessHeatmap = __decorate([
203
231
  customElement('helix-headless-heatmap')
204
232
  ], HelixHeadlessHeatmap);
@@ -1 +1,3 @@
1
+ import './set.js';
2
+ export { type IconResolver, registerIconLibrary, registerIcons, resolveIcon } from './registry.js';
1
3
  export * from './root/icon-root.js';
@@ -1 +1,3 @@
1
+ import './set.js';
2
+ export { registerIconLibrary, registerIcons, resolveIcon } from './registry.js';
1
3
  export * from './root/icon-root.js';