@human-kit/ui 1.5.3 → 1.6.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 (491) hide show
  1. package/README.md +1 -0
  2. package/dist/accordion/header/accordion-header.svelte +2 -2
  3. package/dist/accordion/index.d.ts +1 -1
  4. package/dist/accordion/index.js +1 -1
  5. package/dist/accordion/item/accordion-item.svelte +2 -2
  6. package/dist/accordion/item/context.d.ts +1 -1
  7. package/dist/accordion/panel/accordion-panel.svelte +3 -3
  8. package/dist/accordion/root/accordion-root.svelte +1 -1
  9. package/dist/accordion/trigger/accordion-trigger.svelte +4 -4
  10. package/dist/accordion/types.d.ts +2 -2
  11. package/dist/autocomplete/empty/autocomplete-empty.svelte +1 -1
  12. package/dist/autocomplete/input/autocomplete-input.svelte +3 -3
  13. package/dist/autocomplete/item/autocomplete-item.svelte +1 -1
  14. package/dist/autocomplete/item-indicator/autocomplete-item-indicator.svelte +1 -1
  15. package/dist/autocomplete/list/autocomplete-list.svelte +2 -2
  16. package/dist/autocomplete/list/autocomplete-list.svelte.d.ts +1 -1
  17. package/dist/autocomplete/root/autocomplete.svelte +3 -3
  18. package/dist/autocomplete/root/autocomplete.svelte.d.ts +1 -1
  19. package/dist/autocomplete/root/context.d.ts +1 -1
  20. package/dist/autocomplete/status/autocomplete-status.svelte +2 -2
  21. package/dist/avatar/count/avatar-count.svelte +3 -3
  22. package/dist/avatar/fallback/avatar-fallback.svelte +1 -1
  23. package/dist/avatar/group/avatar-group.svelte +1 -1
  24. package/dist/avatar/image/avatar-image.svelte +1 -1
  25. package/dist/avatar/root/avatar-root.svelte +2 -2
  26. package/dist/breadcrumbs/ellipsis/breadcrumbs-ellipsis.svelte +3 -3
  27. package/dist/breadcrumbs/item/breadcrumbs-item.svelte +1 -1
  28. package/dist/breadcrumbs/root/breadcrumbs-root.svelte +3 -3
  29. package/dist/button/root/button-root.svelte +4 -4
  30. package/dist/calendar/body-cell/calendar-body-cell.svelte +5 -5
  31. package/dist/calendar/grid/calendar-grid-month-scope.svelte +1 -1
  32. package/dist/calendar/grid/calendar-grid.svelte +3 -3
  33. package/dist/calendar/grid/calendar-grid.svelte.d.ts +1 -1
  34. package/dist/calendar/grid/context.d.ts +1 -1
  35. package/dist/calendar/grid-body/calendar-grid-body.svelte +2 -2
  36. package/dist/calendar/grid-header/calendar-grid-header.svelte +2 -2
  37. package/dist/calendar/heading/calendar-heading.svelte +1 -1
  38. package/dist/calendar/index.d.ts +1 -1
  39. package/dist/calendar/index.js +1 -1
  40. package/dist/calendar/root/calendar-root.svelte +3 -3
  41. package/dist/calendar/root/calendar-root.svelte.d.ts +2 -2
  42. package/dist/calendar/root/context.svelte.d.ts +1 -1
  43. package/dist/calendar/root/context.svelte.js +1 -1
  44. package/dist/calendar/root/date-utils.js +1 -1
  45. package/dist/calendar/trigger-next/calendar-trigger-next.svelte +2 -2
  46. package/dist/calendar/trigger-previous/calendar-trigger-previous.svelte +2 -2
  47. package/dist/chart/README.md +51 -0
  48. package/dist/chart/arc/chart-arc.svelte +160 -0
  49. package/dist/chart/arc/chart-arc.svelte.d.ts +25 -0
  50. package/dist/chart/area/chart-area.svelte +106 -0
  51. package/dist/chart/area/chart-area.svelte.d.ts +25 -0
  52. package/dist/chart/axis/chart-axis.svelte +133 -0
  53. package/dist/chart/axis/chart-axis.svelte.d.ts +4 -0
  54. package/dist/chart/bar/chart-bar.svelte +271 -0
  55. package/dist/chart/bar/chart-bar.svelte.d.ts +25 -0
  56. package/dist/chart/data-table/chart-data-table.svelte +126 -0
  57. package/dist/chart/data-table/chart-data-table.svelte.d.ts +4 -0
  58. package/dist/chart/dot/chart-dot.svelte +93 -0
  59. package/dist/chart/dot/chart-dot.svelte.d.ts +25 -0
  60. package/dist/chart/grid/chart-grid.svelte +22 -0
  61. package/dist/chart/grid/chart-grid.svelte.d.ts +4 -0
  62. package/dist/chart/index.d.ts +16 -0
  63. package/dist/chart/index.js +15 -0
  64. package/dist/chart/index.parts.d.ts +13 -0
  65. package/dist/chart/index.parts.js +13 -0
  66. package/dist/chart/internal/arc.d.ts +13 -0
  67. package/dist/chart/internal/arc.js +32 -0
  68. package/dist/chart/internal/channel.d.ts +15 -0
  69. package/dist/chart/internal/channel.js +8 -0
  70. package/dist/chart/internal/modality.d.ts +11 -0
  71. package/dist/chart/internal/modality.js +44 -0
  72. package/dist/chart/internal/navigation.d.ts +16 -0
  73. package/dist/chart/internal/navigation.js +67 -0
  74. package/dist/chart/internal/path.d.ts +14 -0
  75. package/dist/chart/internal/path.js +36 -0
  76. package/dist/chart/internal/series.d.ts +19 -0
  77. package/dist/chart/internal/series.js +64 -0
  78. package/dist/chart/internal/stack.d.ts +14 -0
  79. package/dist/chart/internal/stack.js +29 -0
  80. package/dist/chart/internal/symbol.d.ts +8 -0
  81. package/dist/chart/internal/symbol.js +39 -0
  82. package/dist/chart/legend/chart-legend.svelte +50 -0
  83. package/dist/chart/legend/chart-legend.svelte.d.ts +4 -0
  84. package/dist/chart/line/chart-line.svelte +72 -0
  85. package/dist/chart/line/chart-line.svelte.d.ts +25 -0
  86. package/dist/chart/plot/chart-plot.svelte +39 -0
  87. package/dist/chart/plot/chart-plot.svelte.d.ts +4 -0
  88. package/dist/chart/root/chart-root.svelte +622 -0
  89. package/dist/chart/root/chart-root.svelte.d.ts +25 -0
  90. package/dist/chart/root/context.d.ts +226 -0
  91. package/dist/chart/root/context.js +17 -0
  92. package/dist/chart/scales/band.d.ts +14 -0
  93. package/dist/chart/scales/band.js +30 -0
  94. package/dist/chart/scales/linear.d.ts +16 -0
  95. package/dist/chart/scales/linear.js +80 -0
  96. package/dist/chart/scales/time.d.ts +9 -0
  97. package/dist/chart/scales/time.js +155 -0
  98. package/dist/chart/scales/types.d.ts +43 -0
  99. package/dist/chart/scales/types.js +1 -0
  100. package/dist/chart/title/chart-title.svelte +17 -0
  101. package/dist/chart/title/chart-title.svelte.d.ts +4 -0
  102. package/dist/chart/tooltip/chart-tooltip.svelte +200 -0
  103. package/dist/chart/tooltip/chart-tooltip.svelte.d.ts +4 -0
  104. package/dist/chart/types.d.ts +309 -0
  105. package/dist/chart/types.js +1 -0
  106. package/dist/checkbox/indicator/checkbox-indicator.svelte +1 -1
  107. package/dist/checkbox/root/checkbox-root.svelte +4 -4
  108. package/dist/checkbox-group/index.d.ts +1 -1
  109. package/dist/checkbox-group/index.js +1 -1
  110. package/dist/checkbox-group/label/checkbox-group-label.svelte +1 -1
  111. package/dist/checkbox-group/root/checkbox-group-root.svelte +1 -1
  112. package/dist/clock/axis/clock-axis.svelte +1 -1
  113. package/dist/clock/root/clock-root.svelte +4 -4
  114. package/dist/clock/root/clock-root.svelte.d.ts +2 -2
  115. package/dist/clock/root/context.d.ts +1 -1
  116. package/dist/clock/root/create-time-selection-state.svelte.d.ts +1 -1
  117. package/dist/clock/root/create-time-selection-state.svelte.js +3 -3
  118. package/dist/clock/root/resolve-visible-columns.d.ts +2 -2
  119. package/dist/clock/root/wheel-options.d.ts +1 -1
  120. package/dist/clock/root/wheel-options.js +1 -1
  121. package/dist/clock/wheel-column/clock-wheel-column.svelte +5 -5
  122. package/dist/clock/wheel-column/clock-wheel-column.svelte.d.ts +1 -1
  123. package/dist/clock/wheel-item/clock-wheel-item.svelte +1 -1
  124. package/dist/clock/wheel-item/clock-wheel-item.svelte.d.ts +1 -1
  125. package/dist/collapsible/panel/collapsible-panel.svelte +2 -2
  126. package/dist/collapsible/root/collapsible-root.svelte +1 -1
  127. package/dist/collapsible/trigger/collapsible-trigger.svelte +1 -1
  128. package/dist/color-picker/area/color-picker-area.svelte +4 -4
  129. package/dist/color-picker/area/color-picker-area.svelte.d.ts +1 -1
  130. package/dist/color-picker/area-thumb/color-picker-area-thumb.svelte +5 -5
  131. package/dist/color-picker/area-thumb/color-picker-area-thumb.svelte.d.ts +1 -1
  132. package/dist/color-picker/channel-field/color-picker-channel-field.svelte +2 -2
  133. package/dist/color-picker/channel-field/color-picker-channel-field.svelte.d.ts +1 -1
  134. package/dist/color-picker/eye-dropper/color-picker-eye-dropper.svelte +4 -4
  135. package/dist/color-picker/eye-dropper/color-picker-eye-dropper.svelte.d.ts +1 -1
  136. package/dist/color-picker/hex-field/color-picker-hex-field.svelte +5 -5
  137. package/dist/color-picker/hex-field/color-picker-hex-field.svelte.d.ts +1 -1
  138. package/dist/color-picker/label/color-picker-label.svelte +2 -2
  139. package/dist/color-picker/label/color-picker-label.svelte.d.ts +1 -1
  140. package/dist/color-picker/preview/color-picker-preview.svelte +2 -2
  141. package/dist/color-picker/preview/color-picker-preview.svelte.d.ts +1 -1
  142. package/dist/color-picker/root/color-picker-root.svelte +6 -6
  143. package/dist/color-picker/root/color-picker-root.svelte.d.ts +1 -1
  144. package/dist/color-picker/root/context.d.ts +1 -1
  145. package/dist/color-picker/slider/color-picker-slider.svelte +3 -3
  146. package/dist/color-picker/slider/color-picker-slider.svelte.d.ts +1 -1
  147. package/dist/color-picker/slider-thumb/color-picker-slider-thumb.svelte +5 -5
  148. package/dist/color-picker/slider-thumb/color-picker-slider-thumb.svelte.d.ts +1 -1
  149. package/dist/color-picker/swatch/color-picker-swatch.svelte +5 -5
  150. package/dist/color-picker/swatch/color-picker-swatch.svelte.d.ts +1 -1
  151. package/dist/color-picker/swatch-list/color-picker-swatch-list.svelte +7 -7
  152. package/dist/color-picker/swatch-list/color-picker-swatch-list.svelte.d.ts +1 -1
  153. package/dist/color-picker/types.d.ts +1 -1
  154. package/dist/combobox/clear/combobox-clear.svelte +1 -1
  155. package/dist/combobox/input/combobox-input.svelte +3 -3
  156. package/dist/combobox/item/combobox-listboxitem.svelte +1 -1
  157. package/dist/combobox/item/combobox-listboxitem.svelte.d.ts +1 -1
  158. package/dist/combobox/item-indicator/combobox-item-indicator.svelte +1 -1
  159. package/dist/combobox/list/combobox-listbox.svelte +3 -3
  160. package/dist/combobox/list/combobox-listbox.svelte.d.ts +1 -1
  161. package/dist/combobox/popover/combobox-popover.svelte +5 -5
  162. package/dist/combobox/popover/combobox-popover.svelte.d.ts +1 -1
  163. package/dist/combobox/root/combobox.svelte +6 -6
  164. package/dist/combobox/root/combobox.svelte.d.ts +1 -1
  165. package/dist/combobox/root/context.d.ts +1 -1
  166. package/dist/combobox/status/combobox-status.svelte +4 -4
  167. package/dist/combobox/tag/combobox-tag.svelte +1 -1
  168. package/dist/combobox/trigger/combobox-trigger.svelte +3 -3
  169. package/dist/datepicker/calendar/date-picker-calendar.svelte +3 -3
  170. package/dist/datepicker/calendar/date-picker-calendar.svelte.d.ts +1 -1
  171. package/dist/datepicker/input/date-picker-input.svelte +2 -2
  172. package/dist/datepicker/input/date-picker-input.svelte.d.ts +1 -1
  173. package/dist/datepicker/internal/strict-props.d.ts +1 -1
  174. package/dist/datepicker/internal/strict-props.js +2 -2
  175. package/dist/datepicker/popover/date-picker-popover.svelte +6 -6
  176. package/dist/datepicker/popover/date-picker-popover.svelte.d.ts +1 -1
  177. package/dist/datepicker/root/context.d.ts +2 -2
  178. package/dist/datepicker/root/date-picker-root.svelte +12 -12
  179. package/dist/datepicker/root/date-picker-root.svelte.d.ts +2 -2
  180. package/dist/datepicker/root/date-utils.js +1 -1
  181. package/dist/datepicker/root/draft-evaluation.d.ts +2 -2
  182. package/dist/datepicker/root/draft-evaluation.js +1 -1
  183. package/dist/datepicker/root/focus-controller.d.ts +1 -1
  184. package/dist/datepicker/root/focus-controller.js +1 -1
  185. package/dist/datepicker/root/open-change.d.ts +1 -1
  186. package/dist/datepicker/root/open-controller.d.ts +1 -1
  187. package/dist/datepicker/root/open-controller.js +1 -1
  188. package/dist/datepicker/root/segment-controller.d.ts +1 -1
  189. package/dist/datepicker/root/segment-engine.d.ts +2 -2
  190. package/dist/datepicker/root/segment-engine.js +1 -1
  191. package/dist/datepicker/root/segment-state.d.ts +1 -1
  192. package/dist/datepicker/root/segment-state.js +1 -1
  193. package/dist/datepicker/root/value-commit.d.ts +1 -1
  194. package/dist/datepicker/segment/date-picker-segment.svelte +5 -5
  195. package/dist/datepicker/segment/date-picker-segment.svelte.d.ts +1 -1
  196. package/dist/datepicker/trigger/date-picker-trigger.svelte +2 -2
  197. package/dist/daterangepicker/calendar/date-range-picker-calendar.svelte +4 -4
  198. package/dist/daterangepicker/calendar/date-range-picker-calendar.svelte.d.ts +1 -1
  199. package/dist/daterangepicker/index.d.ts +1 -1
  200. package/dist/daterangepicker/index.js +1 -1
  201. package/dist/daterangepicker/input/date-range-picker-input.svelte +2 -2
  202. package/dist/daterangepicker/input/date-range-picker-input.svelte.d.ts +1 -1
  203. package/dist/daterangepicker/internal/strict-props.d.ts +1 -1
  204. package/dist/daterangepicker/internal/strict-props.js +2 -2
  205. package/dist/daterangepicker/popover/date-range-picker-popover.svelte +6 -6
  206. package/dist/daterangepicker/popover/date-range-picker-popover.svelte.d.ts +1 -1
  207. package/dist/daterangepicker/root/context.d.ts +2 -2
  208. package/dist/daterangepicker/root/date-range-picker-root.svelte +13 -13
  209. package/dist/daterangepicker/root/date-range-picker-root.svelte.d.ts +2 -2
  210. package/dist/daterangepicker/root/value-commit.d.ts +1 -1
  211. package/dist/daterangepicker/root/value-commit.js +1 -1
  212. package/dist/daterangepicker/segment/date-range-picker-segment.svelte +5 -5
  213. package/dist/daterangepicker/segment/date-range-picker-segment.svelte.d.ts +1 -1
  214. package/dist/daterangepicker/trigger/date-range-picker-trigger.svelte +2 -2
  215. package/dist/dialog/close/dialog-close.svelte +1 -1
  216. package/dist/dialog/content/dialog-content.svelte +8 -8
  217. package/dist/dialog/description/dialog-description.svelte +1 -1
  218. package/dist/dialog/overlay/dialog-overlay.svelte +3 -3
  219. package/dist/dialog/portal/dialog-portal.svelte +4 -4
  220. package/dist/dialog/root/dialog-root.svelte +5 -5
  221. package/dist/dialog/root/dialog-root.svelte.d.ts +1 -1
  222. package/dist/dialog/root/dialog-stack.d.ts +1 -1
  223. package/dist/dialog/root/dialog-stack.js +2 -2
  224. package/dist/dialog/title/dialog-title.svelte +1 -1
  225. package/dist/dialog/trigger/dialog-trigger.svelte +1 -1
  226. package/dist/drawer/body/drawer-body.svelte +1 -1
  227. package/dist/drawer/close/drawer-close.svelte +1 -1
  228. package/dist/drawer/content/drawer-content.svelte +15 -15
  229. package/dist/drawer/description/drawer-description.svelte +1 -1
  230. package/dist/drawer/indent/drawer-indent-background.svelte +1 -1
  231. package/dist/drawer/indent/drawer-indent.svelte +1 -1
  232. package/dist/drawer/overlay/drawer-overlay.svelte +4 -4
  233. package/dist/drawer/portal/drawer-portal.svelte +4 -4
  234. package/dist/drawer/root/context.d.ts +1 -1
  235. package/dist/drawer/root/drawer-root.svelte +5 -5
  236. package/dist/drawer/root/drawer-root.svelte.d.ts +2 -2
  237. package/dist/drawer/root/snap-points.d.ts +1 -1
  238. package/dist/drawer/root/snap-points.js +1 -1
  239. package/dist/drawer/swipe-area/drawer-swipe-area.svelte +4 -4
  240. package/dist/drawer/title/drawer-title.svelte +1 -1
  241. package/dist/drawer/trigger/drawer-trigger.svelte +2 -2
  242. package/dist/drawer/trigger/drawer-trigger.svelte.d.ts +1 -1
  243. package/dist/drawer/viewport/drawer-viewport.svelte +5 -5
  244. package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte +2 -2
  245. package/dist/dropzone/dropzone.svelte +7 -4
  246. package/dist/dropzone/dropzone.svelte.d.ts +1 -1
  247. package/dist/index.d.ts +2 -0
  248. package/dist/index.js +2 -0
  249. package/dist/input/input.svelte +8 -5
  250. package/dist/input/input.svelte.d.ts +1 -1
  251. package/dist/internal/strict-props.d.ts +1 -1
  252. package/dist/internal/strict-props.js +2 -2
  253. package/dist/label/label.svelte +2 -2
  254. package/dist/label/label.svelte.d.ts +1 -1
  255. package/dist/listbox/item/listbox-item.svelte +2 -2
  256. package/dist/listbox/root/context.d.ts +1 -1
  257. package/dist/listbox/root/context.js +1 -1
  258. package/dist/listbox/root/listbox.svelte +3 -3
  259. package/dist/listbox/root/listbox.svelte.d.ts +1 -1
  260. package/dist/locale-provider/index.d.ts +1 -1
  261. package/dist/locale-provider/index.js +1 -1
  262. package/dist/locale-provider/locale-provider-value-probe.svelte +1 -1
  263. package/dist/locale-provider/locale-provider.svelte +1 -1
  264. package/dist/menu/content/menu-content.svelte +14 -10
  265. package/dist/menu/content/menu-content.svelte.d.ts +1 -1
  266. package/dist/menu/context-trigger/menu-context-trigger.svelte +2 -2
  267. package/dist/menu/group/menu-group-label.svelte +1 -1
  268. package/dist/menu/group/menu-group.svelte +1 -1
  269. package/dist/menu/item/menu-item.svelte +1 -1
  270. package/dist/menu/overlay/menu-overlay.svelte +4 -4
  271. package/dist/menu/root/context.d.ts +1 -1
  272. package/dist/menu/root/focus-state.d.ts +2 -2
  273. package/dist/menu/root/focus-state.js +1 -1
  274. package/dist/menu/root/menu-root.svelte +2 -2
  275. package/dist/menu/root/menu-root.svelte.d.ts +1 -1
  276. package/dist/menu/root/menu-stack.js +1 -1
  277. package/dist/menu/root/menu-state.svelte.d.ts +1 -1
  278. package/dist/menu/root/menu-state.svelte.js +3 -3
  279. package/dist/menu/root/submenu-intent.d.ts +1 -1
  280. package/dist/menu/submenu/menu-submenu-root.svelte +2 -2
  281. package/dist/menu/submenu/menu-submenu-root.svelte.d.ts +1 -1
  282. package/dist/menu/submenu/menu-submenu-trigger.svelte +1 -1
  283. package/dist/menu/trigger/menu-trigger.svelte +1 -1
  284. package/dist/numberfield/group/number-field-group.svelte +2 -2
  285. package/dist/numberfield/input/number-field-input.svelte +4 -4
  286. package/dist/numberfield/internal/number-field-stepper.svelte +1 -1
  287. package/dist/numberfield/root/context.d.ts +1 -1
  288. package/dist/numberfield/root/number-field-root.svelte +5 -5
  289. package/dist/numberfield/root/number-field-root.svelte.d.ts +1 -1
  290. package/dist/numberfield/root/number-utils.js +1 -1
  291. package/dist/numberfield/scrub-area/number-field-scrub-area.svelte +2 -2
  292. package/dist/numberfield/scrub-area-cursor/number-field-scrub-area-cursor.svelte +2 -2
  293. package/dist/overflow-row/overflow-row.svelte +1 -1
  294. package/dist/overflow-row/overflow-row.svelte.d.ts +1 -1
  295. package/dist/pin-input/cell/pin-input-cell.svelte +5 -5
  296. package/dist/pin-input/cell/pin-input-cell.svelte.d.ts +1 -1
  297. package/dist/pin-input/label/pin-input-label.svelte +2 -2
  298. package/dist/pin-input/label/pin-input-label.svelte.d.ts +1 -1
  299. package/dist/pin-input/root/context.d.ts +1 -1
  300. package/dist/pin-input/root/pin-input-root.svelte +11 -7
  301. package/dist/pin-input/root/pin-input-root.svelte.d.ts +1 -1
  302. package/dist/pin-input/types.d.ts +1 -1
  303. package/dist/popover/content/popover-content.svelte +13 -13
  304. package/dist/popover/content/popover-content.svelte.d.ts +3 -3
  305. package/dist/popover/overlay/popover-overlay.svelte +4 -4
  306. package/dist/popover/root/focus-state.d.ts +2 -2
  307. package/dist/popover/root/focus-state.js +1 -1
  308. package/dist/popover/root/popover-root.svelte +2 -2
  309. package/dist/popover/root/popover-root.svelte.d.ts +1 -1
  310. package/dist/popover/root/popover-stack.js +1 -1
  311. package/dist/popover/trigger/popover-trigger.svelte +1 -1
  312. package/dist/portal/portal.svelte +1 -1
  313. package/dist/primitives/aria-hide-outside.js +1 -1
  314. package/dist/primitives/collapse-transition.svelte.js +1 -1
  315. package/dist/primitives/focus-trap.js +2 -2
  316. package/dist/primitives/presence.svelte.js +1 -1
  317. package/dist/primitives/release-focused-descendant.js +1 -1
  318. package/dist/progress/indicator/progress-indicator.svelte +1 -1
  319. package/dist/progress/label/progress-label.svelte +1 -1
  320. package/dist/progress/root/context.d.ts +1 -1
  321. package/dist/progress/root/progress-root.svelte +3 -3
  322. package/dist/progress/track/progress-track.svelte +1 -1
  323. package/dist/progress/value/progress-value.svelte +1 -1
  324. package/dist/radio-group/index.d.ts +1 -1
  325. package/dist/radio-group/index.js +1 -1
  326. package/dist/radio-group/indicator/radio-group-indicator.svelte +1 -1
  327. package/dist/radio-group/item/radio-group-item.svelte +4 -4
  328. package/dist/radio-group/label/radio-group-label.svelte +1 -1
  329. package/dist/radio-group/root/radio-group-root.svelte +3 -3
  330. package/dist/rating/item/rating-item.svelte +5 -5
  331. package/dist/rating/item/rating-item.svelte.d.ts +1 -1
  332. package/dist/rating/label/rating-label.svelte +2 -2
  333. package/dist/rating/label/rating-label.svelte.d.ts +1 -1
  334. package/dist/rating/output/rating-output.svelte +2 -2
  335. package/dist/rating/output/rating-output.svelte.d.ts +1 -1
  336. package/dist/rating/root/rating-root.svelte +9 -9
  337. package/dist/rating/root/rating-root.svelte.d.ts +1 -1
  338. package/dist/rating/types.d.ts +1 -1
  339. package/dist/search-field/clear/search-field-clear.svelte +3 -3
  340. package/dist/search-field/input/search-field-input.svelte +5 -5
  341. package/dist/search-field/label/search-field-label.svelte +1 -1
  342. package/dist/search-field/root/search-field-root.svelte +5 -5
  343. package/dist/select/item/select-item.svelte +1 -1
  344. package/dist/select/item-indicator/select-item-indicator.svelte +2 -2
  345. package/dist/select/item-indicator/select-item-indicator.svelte.d.ts +1 -1
  346. package/dist/select/label/select-label.svelte +2 -2
  347. package/dist/select/label/select-label.svelte.d.ts +1 -1
  348. package/dist/select/list/select-list.svelte +2 -2
  349. package/dist/select/list/select-list.svelte.d.ts +1 -1
  350. package/dist/select/popover/select-popover.svelte +4 -4
  351. package/dist/select/popover/select-popover.svelte.d.ts +1 -1
  352. package/dist/select/root/context.d.ts +2 -2
  353. package/dist/select/root/select-root.svelte +7 -7
  354. package/dist/select/root/select-root.svelte.d.ts +1 -1
  355. package/dist/select/trigger/select-trigger.svelte +4 -4
  356. package/dist/select/trigger/select-trigger.svelte.d.ts +1 -1
  357. package/dist/select/types.d.ts +1 -1
  358. package/dist/select/value/select-value.svelte +3 -3
  359. package/dist/select/value/select-value.svelte.d.ts +1 -1
  360. package/dist/separator/separator.svelte +5 -2
  361. package/dist/slider/fill/slider-fill.svelte +2 -2
  362. package/dist/slider/fill/slider-fill.svelte.d.ts +1 -1
  363. package/dist/slider/label/slider-label.svelte +2 -2
  364. package/dist/slider/label/slider-label.svelte.d.ts +1 -1
  365. package/dist/slider/output/slider-output.svelte +3 -3
  366. package/dist/slider/output/slider-output.svelte.d.ts +1 -1
  367. package/dist/slider/root/slider-root.svelte +7 -7
  368. package/dist/slider/root/slider-root.svelte.d.ts +1 -1
  369. package/dist/slider/root/slider-utils.d.ts +1 -1
  370. package/dist/slider/root/slider-utils.js +1 -1
  371. package/dist/slider/thumb/slider-thumb.svelte +7 -7
  372. package/dist/slider/thumb/slider-thumb.svelte.d.ts +1 -1
  373. package/dist/slider/track/slider-track.svelte +2 -2
  374. package/dist/slider/track/slider-track.svelte.d.ts +1 -1
  375. package/dist/slider/types.d.ts +1 -1
  376. package/dist/switch/root/switch-root.svelte +3 -3
  377. package/dist/switch/thumb/switch-thumb.svelte +1 -1
  378. package/dist/table/body/table-body.svelte +1 -1
  379. package/dist/table/cell/table-cell.svelte +3 -3
  380. package/dist/table/checkbox/table-checkbox.svelte +5 -5
  381. package/dist/table/checkbox-indicator/table-checkbox-indicator.svelte +2 -2
  382. package/dist/table/column/table-column.svelte +1 -1
  383. package/dist/table/column-header-cell/table-column-header-cell.svelte +4 -4
  384. package/dist/table/column-resizer/table-column-resizer.svelte +6 -6
  385. package/dist/table/empty-state/table-empty-state.svelte +1 -1
  386. package/dist/table/footer/table-footer.svelte +1 -1
  387. package/dist/table/header/table-header.svelte +1 -1
  388. package/dist/table/index.d.ts +1 -1
  389. package/dist/table/index.js +1 -1
  390. package/dist/table/interactive-cell/table-interactive-cell.svelte +3 -3
  391. package/dist/table/root/context.svelte.js +1 -1
  392. package/dist/table/root/table-root.svelte +7 -7
  393. package/dist/table/root/table-ssr-wrapper-column.svelte +1 -1
  394. package/dist/table/root/table-ssr-wrapper-column.svelte.d.ts +1 -1
  395. package/dist/table/row/table-row.svelte +3 -3
  396. package/dist/table/section-row/table-section-row.svelte +3 -3
  397. package/dist/table/sort-trigger/table-sort-trigger.svelte +2 -2
  398. package/dist/table/types.d.ts +2 -2
  399. package/dist/table/utils/handle-body-keydown.d.ts +1 -1
  400. package/dist/table/utils/handle-body-keydown.js +1 -1
  401. package/dist/table/utils/ssr-min-width.d.ts +1 -1
  402. package/dist/table/utils/ssr-min-width.js +1 -1
  403. package/dist/tabs/index.d.ts +1 -1
  404. package/dist/tabs/index.js +1 -1
  405. package/dist/tabs/indicator/tabs-indicator.svelte +1 -1
  406. package/dist/tabs/list/tabs-list.svelte +3 -3
  407. package/dist/tabs/panel/tabs-panel.svelte +1 -1
  408. package/dist/tabs/root/tabs-root.svelte +1 -1
  409. package/dist/tabs/tab/tabs-tab.svelte +2 -2
  410. package/dist/tabs/types.d.ts +2 -2
  411. package/dist/textarea/textarea.svelte +8 -5
  412. package/dist/textarea/textarea.svelte.d.ts +1 -1
  413. package/dist/timepicker/clock/time-picker-clock.svelte +3 -3
  414. package/dist/timepicker/clock/time-picker-clock.svelte.d.ts +1 -1
  415. package/dist/timepicker/input/time-picker-input.svelte +3 -3
  416. package/dist/timepicker/input/time-picker-input.svelte.d.ts +1 -1
  417. package/dist/timepicker/internal/strict-props.d.ts +1 -1
  418. package/dist/timepicker/internal/strict-props.js +2 -2
  419. package/dist/timepicker/popover/time-picker-popover.svelte +5 -5
  420. package/dist/timepicker/popover/time-picker-popover.svelte.d.ts +1 -1
  421. package/dist/timepicker/root/context.d.ts +2 -2
  422. package/dist/timepicker/root/time-picker-root.svelte +4 -4
  423. package/dist/timepicker/root/time-picker-root.svelte.d.ts +2 -2
  424. package/dist/timepicker/root/time-utils.d.ts +1 -1
  425. package/dist/timepicker/root/time-utils.js +1 -1
  426. package/dist/timepicker/segment/time-picker-segment.svelte +5 -5
  427. package/dist/timepicker/segment/time-picker-segment.svelte.d.ts +1 -1
  428. package/dist/timepicker/trigger/time-picker-trigger.svelte +3 -3
  429. package/dist/toast/action/toast-action.svelte +2 -2
  430. package/dist/toast/close/toast-close.svelte +2 -2
  431. package/dist/toast/content/toast-content.svelte +1 -1
  432. package/dist/toast/description/toast-description.svelte +1 -1
  433. package/dist/toast/positioner/toast-positioner.svelte +3 -3
  434. package/dist/toast/provider/context.d.ts +1 -1
  435. package/dist/toast/provider/toast-manager.svelte.d.ts +1 -1
  436. package/dist/toast/provider/toast-provider.svelte +2 -2
  437. package/dist/toast/root/context.d.ts +1 -1
  438. package/dist/toast/root/toast-root.svelte +4 -4
  439. package/dist/toast/title/toast-title.svelte +1 -1
  440. package/dist/toast/viewport/toast-viewport.svelte +10 -10
  441. package/dist/toggle/root/toggle-root.svelte +3 -3
  442. package/dist/toggle/root/toggle-root.svelte.d.ts +1 -1
  443. package/dist/toggle/types.d.ts +1 -1
  444. package/dist/toggle-group/index.d.ts +1 -1
  445. package/dist/toggle-group/index.js +1 -1
  446. package/dist/toggle-group/root/toggle-group-root.svelte +3 -3
  447. package/dist/toggle-group/types.d.ts +2 -2
  448. package/dist/tooltip/arrow/tooltip-arrow.svelte +2 -2
  449. package/dist/tooltip/arrow/tooltip-arrow.svelte.d.ts +1 -1
  450. package/dist/tooltip/content/tooltip-content.svelte +6 -6
  451. package/dist/tooltip/content/tooltip-content.svelte.d.ts +1 -1
  452. package/dist/tooltip/provider/tooltip-provider.svelte +3 -3
  453. package/dist/tooltip/provider/tooltip-provider.svelte.d.ts +1 -1
  454. package/dist/tooltip/root/tooltip-root.svelte +7 -7
  455. package/dist/tooltip/root/tooltip-root.svelte.d.ts +1 -1
  456. package/dist/tooltip/trigger/tooltip-trigger.svelte +2 -2
  457. package/dist/tooltip/trigger/tooltip-trigger.svelte.d.ts +1 -1
  458. package/dist/tooltip/types.d.ts +2 -2
  459. package/dist/transfer-list/item/transfer-list-item.svelte +3 -3
  460. package/dist/transfer-list/list/transfer-list-list.svelte +4 -4
  461. package/dist/transfer-list/list/transfer-list-list.svelte.d.ts +1 -1
  462. package/dist/transfer-list/move/transfer-list-move-button.svelte +5 -5
  463. package/dist/transfer-list/move/transfer-list-move-button.svelte.d.ts +1 -1
  464. package/dist/transfer-list/move/transfer-list-reorder-button.svelte +4 -4
  465. package/dist/transfer-list/root/context.d.ts +2 -2
  466. package/dist/transfer-list/root/transfer-list-root.svelte +4 -4
  467. package/dist/transfer-list/root/transfer-list-root.svelte.d.ts +1 -1
  468. package/dist/transfer-list/status/transfer-list-status.svelte +5 -5
  469. package/dist/transfer-list/status/transfer-list-status.svelte.d.ts +1 -1
  470. package/dist/tree/checkbox/tree-checkbox.svelte +8 -8
  471. package/dist/tree/checkbox/tree-checkbox.svelte.d.ts +1 -1
  472. package/dist/tree/checkbox-indicator/tree-checkbox-indicator.svelte +3 -3
  473. package/dist/tree/checkbox-indicator/tree-checkbox-indicator.svelte.d.ts +1 -1
  474. package/dist/tree/children/tree-children.svelte +3 -3
  475. package/dist/tree/children/tree-children.svelte.d.ts +1 -1
  476. package/dist/tree/header/tree-header.svelte +3 -3
  477. package/dist/tree/header/tree-header.svelte.d.ts +1 -1
  478. package/dist/tree/item/context.d.ts +1 -1
  479. package/dist/tree/item/tree-item-renderer.svelte +5 -5
  480. package/dist/tree/item/tree-item-renderer.svelte.d.ts +2 -2
  481. package/dist/tree/item/tree-item.svelte +4 -4
  482. package/dist/tree/item/tree-item.svelte.d.ts +1 -1
  483. package/dist/tree/label/tree-label.svelte +3 -3
  484. package/dist/tree/label/tree-label.svelte.d.ts +1 -1
  485. package/dist/tree/root/tree-root.svelte +4 -4
  486. package/dist/tree/root/tree-root.svelte.d.ts +1 -1
  487. package/dist/tree/section/tree-section.svelte +3 -3
  488. package/dist/tree/section/tree-section.svelte.d.ts +1 -1
  489. package/dist/tree/trigger/tree-trigger.svelte +5 -5
  490. package/dist/tree/trigger/tree-trigger.svelte.d.ts +1 -1
  491. package/package.json +24 -3
@@ -0,0 +1,200 @@
1
+ <script lang="ts">
2
+ import { untrack } from 'svelte';
3
+ import { useChartContext } from '../root/context.js';
4
+ import type { ChartTooltipProps } from '../types.js';
5
+
6
+ let {
7
+ children,
8
+ offset = 8,
9
+ follow = false,
10
+ class: className = '',
11
+ ...restProps
12
+ }: ChartTooltipProps = $props();
13
+
14
+ const ctx = useChartContext('Chart.Tooltip');
15
+
16
+ let hoveredId: string | null = $state(null);
17
+ // Where the pointer is in the plot, for a tooltip that follows it.
18
+ let pointer: [number, number] | null = $state(null);
19
+ // Escape closes the tooltip until the user moves to another point.
20
+ let dismissed = $state(false);
21
+
22
+ // The tooltip shows the point under the pointer, or the point that has the keyboard focus.
23
+ const id = $derived(dismissed ? null : (hoveredId ?? (ctx.focus.visible ? ctx.focus.id : null)));
24
+
25
+ const tip = $derived.by(() => {
26
+ const found = ctx.locate(id);
27
+ if (!found) return null;
28
+ const { entry, index } = found;
29
+ const point = entry.points[index];
30
+ const anchor = ctx.anchor(entry.mark, entry.series, index);
31
+ if (!anchor) return null;
32
+ // A tooltip that follows the pointer goes along with it, at the height of the point under it.
33
+ // The point that has the keyboard focus has no pointer, thus its tooltip stays at the point.
34
+ const x = follow && pointer && id === hoveredId ? pointer[0] : anchor[0];
35
+ const y = anchor[1];
36
+ return {
37
+ point,
38
+ x,
39
+ y,
40
+ xText: ctx.formatX(ctx.toX(point.x)),
41
+ yText: ctx.formatY(ctx.toY(point.y)),
42
+ horizontal: entry.horizontal
43
+ };
44
+ });
45
+
46
+ // A move of the focus to another point opens the tooltip again.
47
+ $effect(() => {
48
+ void ctx.focus.id;
49
+ untrack(() => (dismissed = false));
50
+ });
51
+
52
+ $effect(() => {
53
+ const plot = ctx.plotElement;
54
+ if (!plot) return;
55
+ const onPointerMove = (event: PointerEvent) => {
56
+ const next = ctx.nearest(event.clientX, event.clientY);
57
+ if (next !== hoveredId) dismissed = false;
58
+ hoveredId = next;
59
+ const box = plot.getBoundingClientRect();
60
+ pointer = [event.clientX - box.left, event.clientY - box.top];
61
+ };
62
+ // A finger leaves the plot when it lifts. The tooltip of a tap stays until the next tap.
63
+ const onPointerLeave = (event: PointerEvent) => {
64
+ if (event.pointerType !== 'touch') hoveredId = null;
65
+ };
66
+ // A finger that scrolls the page cancels its pointer: that is not a tap.
67
+ const onPointerCancel = () => (hoveredId = null);
68
+ // A tap out of the plot closes the tooltip of a tap.
69
+ const onOutside = (event: PointerEvent) => {
70
+ if (!plot.contains(event.target as Node)) hoveredId = null;
71
+ };
72
+ const onKeyDown = (event: KeyboardEvent) => {
73
+ // Only a visible tooltip uses the key; otherwise a dialog around the chart gets it.
74
+ if (event.key !== 'Escape' || !tip) return;
75
+ event.preventDefault();
76
+ dismissed = true;
77
+ hoveredId = null;
78
+ };
79
+ plot.addEventListener('pointermove', onPointerMove);
80
+ plot.addEventListener('pointerdown', onPointerMove);
81
+ plot.addEventListener('pointerleave', onPointerLeave);
82
+ plot.addEventListener('pointercancel', onPointerCancel);
83
+ plot.addEventListener('keydown', onKeyDown);
84
+ document.addEventListener('pointerdown', onOutside);
85
+ return () => {
86
+ document.removeEventListener('pointerdown', onOutside);
87
+ plot.removeEventListener('pointerdown', onPointerMove);
88
+ plot.removeEventListener('pointermove', onPointerMove);
89
+ plot.removeEventListener('pointerleave', onPointerLeave);
90
+ plot.removeEventListener('pointercancel', onPointerCancel);
91
+ plot.removeEventListener('keydown', onKeyDown);
92
+ };
93
+ });
94
+
95
+ // The figure is the containing block of the tooltip, thus the position adds the distance from
96
+ // the padding edge of the figure to the plot. The tooltip shows only in a browser.
97
+ // `bounds` is the space the tooltip stays in, from the padding edge of the figure: the width of
98
+ // the figure, or for a tooltip that follows the pointer —which must go wherever the pointer goes
99
+ // on a figure narrower than itself— the width of the box that would cut it.
100
+ const placement = $derived.by(() => {
101
+ const plot = ctx.plotElement;
102
+ const figure = plot?.closest('figure');
103
+ if (!tip || !plot || !figure) return { offset: [0, 0], bounds: [0, 0] };
104
+ const a = plot.getBoundingClientRect();
105
+ const b = figure.getBoundingClientRect();
106
+ const start = b.left + figure.clientLeft;
107
+ return {
108
+ offset: [a.left - start, a.top - b.top - figure.clientTop],
109
+ bounds: follow ? clipBounds(figure).map((x) => x - start) : [0, figure.clientWidth]
110
+ };
111
+ });
112
+
113
+ /**
114
+ * The left and the right of the nearest ancestor that cuts what overflows it, on the screen,
115
+ * or of the page without one.
116
+ */
117
+ function clipBounds(figure: Element): [number, number] {
118
+ for (let node = figure.parentElement; node; node = node.parentElement) {
119
+ if (getComputedStyle(node).overflowX === 'visible') continue;
120
+ const box = node.getBoundingClientRect();
121
+ return [box.left + node.clientLeft, box.left + node.clientLeft + node.clientWidth];
122
+ }
123
+ return [0, document.documentElement.clientWidth];
124
+ }
125
+
126
+ // Near an edge of its bounds, the tooltip moves away from the point. Thus it does not make the
127
+ // page wider on a narrow screen.
128
+ let width = $state(0);
129
+ const left = $derived.by(() => {
130
+ const center = placement.offset[0] + (tip?.x ?? 0);
131
+ const half = width / 2;
132
+ const [min, max] = placement.bounds;
133
+ return Math.max(min + half, Math.min(center, max - half));
134
+ });
135
+
136
+ /** The animations that CSS gives the tooltip, or none in a browser without the API. */
137
+ function animationsOf(node: HTMLElement): Animation[] {
138
+ return typeof node.getAnimations === 'function' ? node.getAnimations() : [];
139
+ }
140
+
141
+ /**
142
+ * `data-entering` while the tooltip opens, thus CSS can animate it in. The attribute goes when
143
+ * the animations that it starts end.
144
+ */
145
+ function entering(node: HTMLElement) {
146
+ node.setAttribute('data-entering', '');
147
+ Promise.all(animationsOf(node).map((animation) => animation.finished))
148
+ .catch(() => undefined)
149
+ .then(() => node.removeAttribute('data-entering'));
150
+ }
151
+
152
+ /**
153
+ * `data-exiting` while the tooltip closes. It stays for as long as the animations that the
154
+ * attribute starts, thus CSS can animate it out. Without an animation it goes at once.
155
+ */
156
+ function exiting(node: HTMLElement) {
157
+ node.removeAttribute('data-entering');
158
+ node.setAttribute('data-exiting', '');
159
+ const ends = animationsOf(node).map((animation) => {
160
+ const end = animation.effect?.getComputedTiming().endTime;
161
+ return typeof end === 'number' ? end : 0;
162
+ });
163
+ return { duration: Math.max(0, ...ends) };
164
+ }
165
+ </script>
166
+
167
+ <!--
168
+ The screen reader reads the name of the focused point, thus the tooltip does not say it again.
169
+ The tooltip never takes the focus and never contains a control.
170
+ -->
171
+ {#if tip}
172
+ <div
173
+ class={className}
174
+ {@attach entering}
175
+ out:exiting
176
+ aria-hidden="true"
177
+ data-tooltip=""
178
+ data-series={tip.point.series || undefined}
179
+ style:position="absolute"
180
+ bind:offsetWidth={width}
181
+ style:left="{left}px"
182
+ style:top="{placement.offset[1] + tip.y - offset}px"
183
+ style:translate="-50% -100%"
184
+ style:pointer-events="none"
185
+ {...restProps}
186
+ >
187
+ {#if children}
188
+ {@render children(tip)}
189
+ {:else}
190
+ {@const xText = ctx.xLabel ? `${ctx.xLabel} ${tip.xText}` : tip.xText}
191
+ {@const yText = ctx.yLabel ? `${ctx.yLabel} ${tip.yText}` : tip.yText}
192
+ <!-- The category or the x value first, then the series and the value. -->
193
+ <div data-tooltip-key="">{tip.horizontal ? yText : xText}</div>
194
+ <div data-tooltip-value="">
195
+ {#if tip.point.series}<span data-tooltip-series="">{tip.point.series}</span>{/if}
196
+ {tip.horizontal ? xText : yText}
197
+ </div>
198
+ {/if}
199
+ </div>
200
+ {/if}
@@ -0,0 +1,4 @@
1
+ import type { ChartTooltipProps } from '../types.js';
2
+ declare const ChartTooltip: import("svelte").Component<ChartTooltipProps, {}, "">;
3
+ type ChartTooltip = ReturnType<typeof ChartTooltip>;
4
+ export default ChartTooltip;
@@ -0,0 +1,309 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes, SVGAttributes } from 'svelte/elements';
3
+ import type { Channel } from './internal/channel.js';
4
+ import type { ChartContext, ChartMargin, ChartPoint, ChartTick, ChartTooltipState, ChartValue } from './root/context.js';
5
+ import type { ChartSymbol } from './internal/symbol.js';
6
+ import type { FormatOptions, Scale, ScaleType } from './scales/types.js';
7
+ export type { Channel, ChartSymbol, ChartContext, ChartMargin, ChartPoint, ChartTick, FormatOptions, Scale, ScaleType, ChartTooltipState, ChartValue };
8
+ /** The settings of the scale of an axis. */
9
+ export type ScaleOptions = {
10
+ /**
11
+ * The type of scale: `scaleLinear` (the default), `scaleTime` or `scaleBand`. Import the type
12
+ * from its subpath, thus a chart includes only the scales that it uses.
13
+ */
14
+ type?: ScaleType;
15
+ /** The values at the two ends. Without it, the root uses the smallest and the largest value. */
16
+ domain?: [number | Date, number | Date];
17
+ /** Extends the domain to round values. The default is the same as for `zero`. */
18
+ nice?: boolean;
19
+ /**
20
+ * Extends the domain to include zero. A bar starts at zero, thus a bar chart needs it. The
21
+ * default is `true` for the value axis of a chart with categories on the other axis, and for y
22
+ * when no axis has categories.
23
+ */
24
+ zero?: boolean;
25
+ /** The space between two bands of a band scale, as a fraction of a step. The default is 0.2. */
26
+ padding?: number;
27
+ };
28
+ /**
29
+ * The format of the values of a channel: the options of `Intl.NumberFormat` or
30
+ * `Intl.DateTimeFormat`, or a function that writes the text.
31
+ */
32
+ export type ValueFormat = FormatOptions | ((value: ChartValue) => string);
33
+ export type ChartRootProps<T> = {
34
+ /** A stable id, from which the component makes its internal ids. Give one on a server. */
35
+ id?: string;
36
+ /** The rows. Each mark uses them when it has no `data` of its own. */
37
+ data?: readonly T[];
38
+ /** The x channel: a field name of the row, or a function of the row. */
39
+ x?: Channel<T, ChartValue>;
40
+ /** The y channel: a field name of the row, or a function of the row. */
41
+ y?: Channel<T, ChartValue>;
42
+ /** The channel that divides the rows into series. Without it, the chart has one series. */
43
+ series?: Channel<T, string>;
44
+ /**
45
+ * The channel that identifies a row in its series across data updates, for example a date or
46
+ * an id. Then the focus and the selection stay on the same row when the rows move. Without it,
47
+ * the key is the row index. When two rows of a series have the same key, that series uses the
48
+ * row index.
49
+ */
50
+ key?: Channel<T, ChartValue>;
51
+ /** The x scale. */
52
+ xScale?: ScaleOptions;
53
+ /** The y scale. */
54
+ yScale?: ScaleOptions;
55
+ /** The width of the SVG, in pixels. Without it, the chart follows the width of its container. */
56
+ width?: number;
57
+ /** The height of the SVG, in pixels. The default is 300. */
58
+ height?: number;
59
+ /** The space around the plot, in pixels. */
60
+ margin?: Partial<ChartMargin>;
61
+ /**
62
+ * The point that has the focus, or `null`. You can bind it with `bind:focused`. The component
63
+ * writes it; it does not read it.
64
+ */
65
+ focused?: ChartPoint<T> | null;
66
+ /**
67
+ * The selected point, or `null`. You can bind it with `bind:selected`. `Enter`, `Space` or a
68
+ * click selects a point, and a second time clears the selection. The selected point has
69
+ * `aria-current="true"` and `data-selected`, and so has its cell in `Chart.DataTable`. The
70
+ * selection follows the key and the series of the point.
71
+ */
72
+ selected?: ChartPoint<T> | null;
73
+ /** The component calls it when the user activates a point with `Enter`, `Space` or a click. */
74
+ onSelect?: (point: ChartPoint<T>) => void;
75
+ /** The locale of the values in the names and the ticks. The default is the locale of the page. */
76
+ locale?: string;
77
+ /**
78
+ * The format of the x values in the accessible names and the ticks. Without it, a time scale
79
+ * shows dates as precise as the data.
80
+ */
81
+ xFormat?: ValueFormat;
82
+ /** The format of the y values in the accessible names and the ticks. */
83
+ yFormat?: ValueFormat;
84
+ /**
85
+ * The name of the x channel for a user, for example "Weight (lb)". The name of a point puts it
86
+ * before the x value. An x axis without a `label` shows it, and the data table uses it as a
87
+ * column header. Give it when the x values are measures and not positions, as on a scatter plot.
88
+ */
89
+ xLabel?: string;
90
+ /** The name of the y channel for a user, for example "Fuel economy (mpg)". See `xLabel`. */
91
+ yLabel?: string;
92
+ /** The accessible name of the chart, for when there is no `Chart.Title`. */
93
+ 'aria-label'?: string;
94
+ /** The id of the element that gives the chart its name. */
95
+ 'aria-labelledby'?: string;
96
+ /** The id of the element that describes the chart, for example a summary of the trend. */
97
+ 'aria-describedby'?: string;
98
+ /** The content: the title, the plot and the other parts. */
99
+ children?: Snippet;
100
+ /** The CSS class names of the root element. */
101
+ class?: string;
102
+ /** A bindable reference to the root element. */
103
+ element?: HTMLElement | null;
104
+ /** A bindable reference to the context, for a composition of your own. */
105
+ context?: ChartContext;
106
+ } & Omit<HTMLAttributes<HTMLElement>, 'class' | 'children' | 'id' | 'aria-label' | 'aria-labelledby' | 'aria-describedby'>;
107
+ export type ChartTitleProps = Omit<HTMLAttributes<HTMLElement>, 'class'> & {
108
+ /** The CSS class names of the title. */
109
+ class?: string;
110
+ };
111
+ export type ChartPlotProps = Omit<SVGAttributes<SVGSVGElement>, 'class' | 'role'> & {
112
+ /** The marks and the guides. */
113
+ children?: Snippet;
114
+ /** The CSS class names of the SVG element. */
115
+ class?: string;
116
+ /** A bindable reference to the SVG element. */
117
+ element?: SVGSVGElement | null;
118
+ };
119
+ /**
120
+ * The data and the channels of a mark. A mark uses the data and the channels of the root, or it
121
+ * has its own `data`. Only a mark with its own `data` can have its own channels: a child cannot
122
+ * get the row type of the root, thus the types can check a field name only against the data of
123
+ * the same component.
124
+ */
125
+ export type ChartMarkData<T> = {
126
+ /** The rows of this mark. Without it, the mark uses the data of the root. */
127
+ data: readonly T[];
128
+ /** The x channel of this mark. It needs `data`. Without it, the mark uses the channel of the root. */
129
+ x?: Channel<T, ChartValue>;
130
+ /** The y channel of this mark. It needs `data`. Without it, the mark uses the channel of the root. */
131
+ y?: Channel<T, ChartValue>;
132
+ /** The series channel of this mark. It needs `data`. Without it, the mark uses the channel of the root. */
133
+ series?: Channel<T, string>;
134
+ /** The key channel of this mark. It needs `data`. Without it, the mark uses the channel of the root. */
135
+ key?: Channel<T, ChartValue>;
136
+ } | {
137
+ data?: undefined;
138
+ x?: undefined;
139
+ y?: undefined;
140
+ series?: undefined;
141
+ key?: undefined;
142
+ };
143
+ export type ChartLineProps<T> = ChartMarkData<T> & {
144
+ /**
145
+ * The name of the series of this mark, when it has no series channel. The legend, the names of
146
+ * the points and the data table show it. Give a name to each mark when two marks show two
147
+ * fields, for example the revenue and the cost.
148
+ */
149
+ name?: string;
150
+ /** The radius of the point of each row, in pixels. The default is 3. */
151
+ r?: number;
152
+ /** The CSS class names of the group of the mark. */
153
+ class?: string;
154
+ };
155
+ export type ChartDotProps<T> = ChartMarkData<T> & {
156
+ /**
157
+ * The name of the series of this mark, when it has no series channel. The legend, the names of
158
+ * the points and the data table show it.
159
+ */
160
+ name?: string;
161
+ /**
162
+ * The radius of a circle, in pixels. The other shapes have the same area as that circle. The
163
+ * default is 4.
164
+ */
165
+ r?: number;
166
+ /**
167
+ * The shape of the dots. `auto` gives each series the next shape of `circle`, `square`,
168
+ * `triangle`, `diamond`, `cross` and `triangle-down`, thus color does not identify a series
169
+ * alone. A shape name gives all of the series that shape. The default is `auto`.
170
+ */
171
+ symbol?: 'auto' | ChartSymbol;
172
+ /** The CSS class names of the group of the mark. */
173
+ class?: string;
174
+ };
175
+ export type ChartArcProps<T> = ChartMarkData<T> & {
176
+ /**
177
+ * The name of the series of this mark, when it has no series channel. The names of the slices
178
+ * and the data table show it. The mark draws only the first series.
179
+ */
180
+ name?: string;
181
+ /**
182
+ * The radius of the hole, as a fraction of the radius of the circle. The default is 0: a pie
183
+ * chart. A value of 0.6 makes a donut chart.
184
+ */
185
+ inner?: number;
186
+ /**
187
+ * Shows a text in the middle of each slice. `true` writes the value in the format of the y
188
+ * channel; a function writes the text of each point. A text that is wider than its slice does
189
+ * not show. The labels are hidden from assistive technology: the name of each slice already
190
+ * has the value. The default is `false`.
191
+ */
192
+ labels?: boolean | ((point: ChartPoint<T>) => string);
193
+ /** The CSS class names of the group of the mark. */
194
+ class?: string;
195
+ };
196
+ export type ChartAxisProps = {
197
+ /** The side of the plot. The default is `bottom`. `top` and `bottom` show the x scale. */
198
+ position?: 'top' | 'right' | 'bottom' | 'left';
199
+ /** The text of the axis, for example the name and the unit of the values. */
200
+ label?: string;
201
+ /** The length of a tick line, in pixels. The default is 6. */
202
+ tickSize?: number;
203
+ /** The distance between a tick line and its label, in pixels. The default is 3. */
204
+ tickPadding?: number;
205
+ /** The CSS class names of the group of the axis. */
206
+ class?: string;
207
+ };
208
+ export type ChartGridProps = {
209
+ /** The axis whose ticks give the lines. The default is `y`: horizontal lines. */
210
+ axis?: 'x' | 'y';
211
+ /** The CSS class names of the group of the grid. */
212
+ class?: string;
213
+ };
214
+ export type ChartBarProps<T> = ChartMarkData<T> & {
215
+ /**
216
+ * The name of the series of this mark, when it has no series channel. The legend, the names of
217
+ * the points and the data table show it. Give a name to each mark when two marks show two
218
+ * fields, for example the revenue and the cost.
219
+ */
220
+ name?: string;
221
+ /** The CSS class names of the group of the mark. */
222
+ class?: string;
223
+ /**
224
+ * How the bars of two series share a category. `grouped` puts them side by side, and
225
+ * `stacked` puts them one on the other. The default is `grouped`.
226
+ */
227
+ layout?: 'grouped' | 'stacked';
228
+ /** The space between the bars of a group, as a fraction of a bar. The default is 0.1. */
229
+ groupPadding?: number;
230
+ /**
231
+ * The radius of the corners at the end of each bar, in pixels. The corners at zero stay
232
+ * square. The default is 0. A stacked layout ignores it.
233
+ */
234
+ radius?: number;
235
+ /**
236
+ * Shows the value of each bar after its end. `true` writes the value in the format of the
237
+ * value axis; a function writes the text of each point. The chart makes space for the labels.
238
+ * The labels are hidden from assistive technology: the name of each bar already has the
239
+ * value. The default is `false`. A stacked layout ignores it.
240
+ */
241
+ labels?: boolean | ((point: ChartPoint<T>) => string);
242
+ };
243
+ export type ChartAreaProps<T> = ChartMarkData<T> & {
244
+ /**
245
+ * The name of the series of this mark, when it has no series channel. The legend, the names of
246
+ * the points and the data table show it. Give a name to each mark when two marks show two
247
+ * fields, for example the revenue and the cost.
248
+ */
249
+ name?: string;
250
+ /** The CSS class names of the group of the mark. */
251
+ class?: string;
252
+ /** Puts the series one on the other. The default is `false`: each area starts at zero. */
253
+ stacked?: boolean;
254
+ /** The radius of the point of each row, in pixels. The default is 0: the points are hidden. */
255
+ r?: number;
256
+ /** The radius of the point that has the focus, in pixels. The default is 4. */
257
+ focusRadius?: number;
258
+ };
259
+ export type ChartLegendProps = Omit<HTMLAttributes<HTMLUListElement>, 'class' | 'children'> & {
260
+ /**
261
+ * The content of an item. It receives the name and the index of the series, and the shape of its
262
+ * dots when a dot mark shows the series. Without it, an item shows a `data-swatch` element and
263
+ * the name. For a series with a shape, the swatch holds an SVG of the shape.
264
+ */
265
+ children?: Snippet<[{
266
+ name: string;
267
+ index: number;
268
+ symbol: ChartSymbol | undefined;
269
+ }]>;
270
+ /** The CSS class names of the list. */
271
+ class?: string;
272
+ };
273
+ export type ChartDataTableProps = Omit<HTMLAttributes<HTMLTableElement>, 'class' | 'children'> & {
274
+ /**
275
+ * `visible` shows the table. `screen-reader` keeps it only in the accessibility tree. The
276
+ * default is `screen-reader`.
277
+ */
278
+ visibility?: 'visible' | 'screen-reader';
279
+ /** The caption of the table. Without it, the `Chart.Title` names the table. */
280
+ caption?: string;
281
+ /**
282
+ * The header of the first column. It is the column of the categories or of the x values. In a
283
+ * table with a row per point, it is the column of the series. The default is the label or the
284
+ * name of the field.
285
+ */
286
+ rowHeader?: string;
287
+ /** The CSS class names of the table. */
288
+ class?: string;
289
+ };
290
+ export type ChartTooltipProps = Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children'> & {
291
+ /**
292
+ * The content. It receives the point, and the x and y values as text. Without it, the tooltip
293
+ * shows the x value, the series and the y value.
294
+ */
295
+ children?: Snippet<[ChartTooltipState]>;
296
+ /** The distance between the point and the tooltip, in pixels. The default is 8. */
297
+ offset?: number;
298
+ /**
299
+ * Moves the tooltip along with the pointer, at the height of the point under it. For a large
300
+ * mark, as a long bar, whose anchor can be far from the pointer. The point that has the
301
+ * keyboard focus keeps its tooltip at the point. The default is `false`.
302
+ */
303
+ follow?: boolean;
304
+ /**
305
+ * The CSS class names of the tooltip. It has `data-entering` while it opens and `data-exiting`
306
+ * while it closes, for CSS animations: it closes after the animations end.
307
+ */
308
+ class?: string;
309
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import type { HTMLAttributes } from 'svelte/elements';
3
3
  import type { Snippet } from 'svelte';
4
- import { useCheckboxContext } from '../root/context';
4
+ import { useCheckboxContext } from '../root/context.js';
5
5
 
6
6
  type CheckboxIndicatorProps = Omit<HTMLAttributes<HTMLSpanElement>, 'children' | 'class'> & {
7
7
  /** Keeps the indicator in the DOM even while the checkbox is unchecked. */
@@ -4,10 +4,10 @@
4
4
  import {
5
5
  shouldShowFocusVisible,
6
6
  trackInteractionModality
7
- } from '../../primitives/input-modality';
8
- import { watchFocusVisible } from '../../primitives/focus-visible.svelte';
9
- import { getCheckboxGroupContext } from '../../checkbox-group/root/context.svelte';
10
- import { setCheckboxContext, type CheckboxContext, type CheckboxState } from './context';
7
+ } from '../../primitives/input-modality.js';
8
+ import { watchFocusVisible } from '../../primitives/focus-visible.svelte.js';
9
+ import { getCheckboxGroupContext } from '../../checkbox-group/root/context.svelte.js';
10
+ import { setCheckboxContext, type CheckboxContext, type CheckboxState } from './context.js';
11
11
 
12
12
  type CheckboxRootProps = Omit<
13
13
  HTMLAttributes<HTMLSpanElement>,
@@ -10,6 +10,6 @@ export type CheckboxGroupRootProps = ComponentProps<typeof CheckboxGroupRootComp
10
10
  export type CheckboxGroupLabelProps = ComponentProps<typeof CheckboxGroupLabelComponent>;
11
11
  export type CheckboxGroupItemProps = ComponentProps<typeof CheckboxRootComponent>;
12
12
  export type CheckboxGroupIndicatorProps = ComponentProps<typeof CheckboxIndicatorComponent>;
13
- export { createCheckboxGroupContext, getCheckboxGroupContext, setCheckboxGroupContext, type CheckboxGroupContext, type CheckboxGroupOrientation, type CheckboxGroupValue, type CreateCheckboxGroupContextOptions } from './root/context.svelte';
13
+ export { createCheckboxGroupContext, getCheckboxGroupContext, setCheckboxGroupContext, type CheckboxGroupContext, type CheckboxGroupOrientation, type CheckboxGroupValue, type CreateCheckboxGroupContextOptions } from './root/context.svelte.js';
14
14
  import * as CheckboxGroupParts from './index.parts.js';
15
15
  export default CheckboxGroupParts;
@@ -1,6 +1,6 @@
1
1
  export * as CheckboxGroup from './index.parts.js';
2
2
  export { default as CheckboxGroupRoot } from './root/checkbox-group-root.svelte';
3
3
  export { default as CheckboxGroupLabel } from './label/checkbox-group-label.svelte';
4
- export { createCheckboxGroupContext, getCheckboxGroupContext, setCheckboxGroupContext } from './root/context.svelte';
4
+ export { createCheckboxGroupContext, getCheckboxGroupContext, setCheckboxGroupContext } from './root/context.svelte.js';
5
5
  import * as CheckboxGroupParts from './index.parts.js';
6
6
  export default CheckboxGroupParts;
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import type { CheckboxGroupLabelProps } from '../types.js';
3
- import { getCheckboxGroupContext } from '../root/context.svelte';
3
+ import { getCheckboxGroupContext } from '../root/context.svelte.js';
4
4
 
5
5
  /**
6
6
  * CheckboxGroup.Label — the accessible name of the group.
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { untrack } from 'svelte';
3
3
  import type { CheckboxGroupRootProps } from '../types.js';
4
- import { createCheckboxGroupContext, setCheckboxGroupContext } from './context.svelte';
4
+ import { createCheckboxGroupContext, setCheckboxGroupContext } from './context.svelte.js';
5
5
 
6
6
  const generatedId = $props.id();
7
7
 
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import type { HTMLAttributes } from 'svelte/elements';
3
- import { useClockContext } from '../root/context';
3
+ import { useClockContext } from '../root/context.js';
4
4
 
5
5
  type ClockAxisProps = Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children'> & {
6
6
  class?: string;
@@ -1,15 +1,15 @@
1
1
  <script lang="ts">
2
2
  import { untrack, type Snippet } from 'svelte';
3
3
  import type { HTMLAttributes } from 'svelte/elements';
4
- import { setClockContext, type ClockContext } from './context';
5
- import { resolveVisibleColumns, type ClockColumnInfo } from './resolve-visible-columns';
6
- import { createTimeSelectionState } from './create-time-selection-state.svelte';
4
+ import { setClockContext, type ClockContext } from './context.js';
5
+ import { resolveVisibleColumns, type ClockColumnInfo } from './resolve-visible-columns.js';
6
+ import { createTimeSelectionState } from './create-time-selection-state.svelte.js';
7
7
  import ClockWheelColumn from '../wheel-column/clock-wheel-column.svelte';
8
8
  import type {
9
9
  TimePickerGranularity,
10
10
  TimePickerHourCycle,
11
11
  TimePickerTimeValue
12
- } from './time-utils';
12
+ } from './time-utils.js';
13
13
 
14
14
  type ClockRootProps = Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children'> & {
15
15
  id?: string;
@@ -1,7 +1,7 @@
1
1
  import { type Snippet } from 'svelte';
2
2
  import type { HTMLAttributes } from 'svelte/elements';
3
- import { type ClockColumnInfo } from './resolve-visible-columns';
4
- import type { TimePickerGranularity, TimePickerHourCycle, TimePickerTimeValue } from './time-utils';
3
+ import { type ClockColumnInfo } from './resolve-visible-columns.js';
4
+ import type { TimePickerGranularity, TimePickerHourCycle, TimePickerTimeValue } from './time-utils.js';
5
5
  type ClockRootProps = Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children'> & {
6
6
  id?: string;
7
7
  value?: TimePickerTimeValue | null;
@@ -1,4 +1,4 @@
1
- import type { TimePickerEditableSegmentType, TimePickerGranularity, TimePickerHourCycle } from './time-utils';
1
+ import type { TimePickerEditableSegmentType, TimePickerGranularity, TimePickerHourCycle } from './time-utils.js';
2
2
  export type ClockContext = {
3
3
  id: string;
4
4
  locale: string;
@@ -1,4 +1,4 @@
1
- import { type TimePickerDraft, type TimePickerEditableSegmentType, type TimePickerGranularity, type TimePickerHourCycle, type TimePickerTimeValue } from './time-utils';
1
+ import { type TimePickerDraft, type TimePickerEditableSegmentType, type TimePickerGranularity, type TimePickerHourCycle, type TimePickerTimeValue } from './time-utils.js';
2
2
  export type TimeSelectionWheelOption = {
3
3
  value: string;
4
4
  label: string;
@@ -1,8 +1,8 @@
1
1
  import { untrack } from 'svelte';
2
2
  import { fromStore } from 'svelte/store';
3
- import { useLocaleContextOptional } from '../../locale-provider/context';
4
- import { buildWheelOptions } from './wheel-options';
5
- import { buildTimePartsFromDraft, clampToStep, createEmptyTimePickerDraft, formatTimePickerValue, getRequiredSegments, getSegmentLabel, isSegmentValueEmpty, isTimeOutOfRange, isValidTimePickerValue, normalizeSegmentNumberInput, normalizeTimePickerValue, parseTimePickerValue, toDraftFromTimeValue } from './time-utils';
3
+ import { useLocaleContextOptional } from '../../locale-provider/context.js';
4
+ import { buildWheelOptions } from './wheel-options.js';
5
+ import { buildTimePartsFromDraft, clampToStep, createEmptyTimePickerDraft, formatTimePickerValue, getRequiredSegments, getSegmentLabel, isSegmentValueEmpty, isTimeOutOfRange, isValidTimePickerValue, normalizeSegmentNumberInput, normalizeTimePickerValue, parseTimePickerValue, toDraftFromTimeValue } from './time-utils.js';
6
6
  /**
7
7
  * Editable segments ordered from most to least significant. Range checks and
8
8
  * boundary clamping both need to know which segments a given column is free to
@@ -1,5 +1,5 @@
1
- import type { ClockEditableSegmentType } from './context';
2
- import type { TimePickerGranularity, TimePickerHourCycle } from './time-utils';
1
+ import type { ClockEditableSegmentType } from './context.js';
2
+ import type { TimePickerGranularity, TimePickerHourCycle } from './time-utils.js';
3
3
  export type ClockColumnInfo = {
4
4
  type: ClockEditableSegmentType;
5
5
  label?: string;