@jcsoftdev/ui 0.2.2 → 0.3.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 (375) hide show
  1. package/CHANGELOG.md +292 -5
  2. package/README.md +2 -1
  3. package/bin/ui-theme.mjs +1151 -25
  4. package/dist/ai/attachment/attachment.js +1 -1
  5. package/dist/ai/chat-list/group.js +3 -1
  6. package/dist/ai/conversation/conversation.js +1 -1
  7. package/dist/ai/internal/use-copy.d.ts +1 -5
  8. package/dist/ai/internal/use-copy.js +1 -32
  9. package/dist/ai/markdown/parse.js +59 -17
  10. package/dist/ai/source/source.js +1 -1
  11. package/dist/atoms/avatar/avatar.d.ts +13 -3
  12. package/dist/atoms/avatar/avatar.js +40 -2
  13. package/dist/atoms/avatar/index.d.ts +1 -1
  14. package/dist/atoms/avatar/index.js +3 -1
  15. package/dist/atoms/button/button.d.ts +4 -1
  16. package/dist/atoms/button/button.js +4 -2
  17. package/dist/atoms/checkbox/checkbox.d.ts +8 -3
  18. package/dist/atoms/checkbox/checkbox.js +33 -6
  19. package/dist/atoms/chip/chip.d.ts +9 -3
  20. package/dist/atoms/chip/chip.js +26 -4
  21. package/dist/atoms/chip/index.d.ts +1 -1
  22. package/dist/atoms/chip/index.js +4 -1
  23. package/dist/atoms/status-dot/index.d.ts +1 -1
  24. package/dist/atoms/status-dot/status-dot.d.ts +4 -2
  25. package/dist/atoms/status-dot/status-dot.js +5 -1
  26. package/dist/charts/bar-chart/bar-race-chart.js +1 -0
  27. package/dist/charts/beeswarm-chart/beeswarm-chart.js +1 -1
  28. package/dist/charts/chord-chart/chord-chart.js +13 -5
  29. package/dist/charts/core/cartesian/cartesian-chart.d.ts +1 -1
  30. package/dist/charts/core/cartesian/cartesian-chart.js +48 -11
  31. package/dist/charts/core/cartesian/layout.d.ts +6 -1
  32. package/dist/charts/core/cartesian/layout.js +14 -5
  33. package/dist/charts/core/cartesian/marks.d.ts +2 -2
  34. package/dist/charts/core/cartesian/marks.js +1 -1
  35. package/dist/charts/core/cartesian/types.d.ts +28 -2
  36. package/dist/charts/core/category-explorer.d.ts +2 -2
  37. package/dist/charts/core/category-explorer.js +8 -4
  38. package/dist/charts/core/chart-dock.d.ts +26 -0
  39. package/dist/charts/core/chart-dock.js +45 -0
  40. package/dist/charts/core/chart-frame.d.ts +9 -2
  41. package/dist/charts/core/chart-frame.js +105 -25
  42. package/dist/charts/core/distribution/explorer.d.ts +5 -2
  43. package/dist/charts/core/distribution/explorer.js +12 -5
  44. package/dist/charts/core/distribution/xy-points.js +1 -1
  45. package/dist/charts/core/index.d.ts +3 -0
  46. package/dist/charts/core/index.js +3 -0
  47. package/dist/charts/core/leave-grace.d.ts +11 -0
  48. package/dist/charts/core/leave-grace.js +26 -0
  49. package/dist/charts/core/nearest.d.ts +14 -0
  50. package/dist/charts/core/nearest.js +22 -0
  51. package/dist/charts/core/plot-overlay.js +9 -3
  52. package/dist/charts/core/pointer.test-utils.d.ts +38 -0
  53. package/dist/charts/core/pointer.test-utils.js +123 -0
  54. package/dist/charts/core/tooltip.d.ts +25 -2
  55. package/dist/charts/core/tooltip.js +115 -40
  56. package/dist/charts/core/touch-select.d.ts +20 -0
  57. package/dist/charts/core/touch-select.js +184 -0
  58. package/dist/charts/core/types.d.ts +8 -4
  59. package/dist/charts/core/types.js +5 -0
  60. package/dist/charts/core/use-index-navigation.d.ts +17 -6
  61. package/dist/charts/core/use-index-navigation.js +47 -10
  62. package/dist/charts/donut-chart/donut-chart.d.ts +5 -1
  63. package/dist/charts/donut-chart/donut-chart.js +40 -1
  64. package/dist/charts/donut-chart/slice-labels.d.ts +20 -0
  65. package/dist/charts/donut-chart/slice-labels.js +20 -0
  66. package/dist/charts/dumbbell-chart/dumbbell-chart.js +6 -3
  67. package/dist/charts/fill-gauge-chart/fill-gauge-chart.js +1 -0
  68. package/dist/charts/funnel-chart/funnel-chart.js +2 -1
  69. package/dist/charts/gauge-chart/gauge-chart.js +2 -1
  70. package/dist/charts/heatmap-chart/heatmap-chart.d.ts +4 -1
  71. package/dist/charts/heatmap-chart/heatmap-chart.js +3 -1
  72. package/dist/charts/heatmap-chart/heatmap-grid.d.ts +4 -1
  73. package/dist/charts/heatmap-chart/heatmap-grid.js +3 -1
  74. package/dist/charts/hex-tile-map/hex-tile-map.js +124 -115
  75. package/dist/charts/hierarchy-morph/hierarchy-morph.js +2 -1
  76. package/dist/charts/icicle-chart/icicle-chart.js +7 -9
  77. package/dist/charts/lollipop-chart/lollipop-chart.js +6 -3
  78. package/dist/charts/maps/geo/map-viewport.js +1 -1
  79. package/dist/charts/polar-area-chart/polar-area-chart.js +42 -12
  80. package/dist/charts/progress-units/progress-units.js +1 -0
  81. package/dist/charts/radar-chart/radar-chart.js +1 -1
  82. package/dist/charts/radial-bar-chart/radial-bar-chart.js +2 -1
  83. package/dist/charts/range-area-chart/range-area-chart.js +3 -2
  84. package/dist/charts/sankey-chart/sankey-chart.js +12 -4
  85. package/dist/charts/tree-chart/tree-chart.js +1 -0
  86. package/dist/charts/treemap-chart/treemap-chart.js +2 -7
  87. package/dist/charts/waterfall-chart/waterfall-chart.js +6 -3
  88. package/dist/containers/action-bar/action-bar.d.ts +11 -2
  89. package/dist/containers/action-bar/action-bar.js +4 -1
  90. package/dist/containers/card/card.d.ts +21 -3
  91. package/dist/containers/card/card.js +20 -5
  92. package/dist/containers/grid/grid.d.ts +15 -0
  93. package/dist/containers/grid/grid.js +24 -0
  94. package/dist/containers/grid/index.d.ts +1 -0
  95. package/dist/containers/grid/index.js +4 -0
  96. package/dist/containers/index.d.ts +3 -0
  97. package/dist/containers/index.js +3 -0
  98. package/dist/containers/kpi/kpi.d.ts +13 -2
  99. package/dist/containers/kpi/kpi.js +86 -24
  100. package/dist/containers/kpi-group/index.d.ts +1 -1
  101. package/dist/containers/kpi-group/index.js +3 -1
  102. package/dist/containers/kpi-group/kpi-group.d.ts +9 -1
  103. package/dist/containers/kpi-group/kpi-group.js +11 -1
  104. package/dist/containers/page/index.d.ts +1 -0
  105. package/dist/containers/page/index.js +4 -0
  106. package/dist/containers/page/page.d.ts +7 -0
  107. package/dist/containers/page/page.js +14 -0
  108. package/dist/containers/page-header/page-header.d.ts +8 -3
  109. package/dist/containers/page-header/page-header.js +35 -8
  110. package/dist/containers/responsive-list/responsive-list.d.ts +1 -1
  111. package/dist/containers/responsive-list/responsive-list.js +6 -3
  112. package/dist/containers/stack/index.d.ts +1 -0
  113. package/dist/containers/stack/index.js +6 -0
  114. package/dist/containers/stack/stack.d.ts +15 -0
  115. package/dist/containers/stack/stack.js +43 -0
  116. package/dist/forms/copy-field/copy-field.d.ts +17 -0
  117. package/dist/forms/copy-field/copy-field.js +72 -0
  118. package/dist/forms/copy-field/index.d.ts +1 -0
  119. package/dist/forms/copy-field/index.js +4 -0
  120. package/dist/forms/emoji-picker/emoji-picker.js +1 -1
  121. package/dist/forms/form/form.d.ts +15 -0
  122. package/dist/forms/form/form.js +29 -0
  123. package/dist/forms/form/index.d.ts +1 -0
  124. package/dist/forms/form/index.js +10 -0
  125. package/dist/forms/index.d.ts +2 -0
  126. package/dist/forms/index.js +2 -0
  127. package/dist/forms/input/index.d.ts +1 -1
  128. package/dist/forms/input/index.js +3 -2
  129. package/dist/forms/input/input.d.ts +6 -2
  130. package/dist/forms/input/input.js +9 -3
  131. package/dist/glass/crystal-map.d.ts +70 -0
  132. package/dist/glass/crystal-map.js +88 -0
  133. package/dist/glass/displacement-map.d.ts +117 -0
  134. package/dist/glass/displacement-map.js +201 -0
  135. package/dist/glass/index.d.ts +8 -0
  136. package/dist/glass/index.js +63 -0
  137. package/dist/glass/lens-crystal.d.ts +29 -0
  138. package/dist/glass/lens-crystal.js +161 -0
  139. package/dist/glass/lens-dispersion.d.ts +11 -0
  140. package/dist/glass/lens-dispersion.js +19 -0
  141. package/dist/glass/liquid-glass.d.ts +41 -0
  142. package/dist/glass/liquid-glass.js +256 -0
  143. package/dist/glass/liquid-motion.d.ts +53 -0
  144. package/dist/glass/liquid-motion.js +302 -0
  145. package/dist/glass/liquid-options.d.ts +162 -0
  146. package/dist/glass/liquid-options.js +179 -0
  147. package/dist/glass/refraction.d.ts +100 -0
  148. package/dist/glass/refraction.js +714 -0
  149. package/dist/glass/specular-map.d.ts +26 -0
  150. package/dist/glass/specular-map.js +75 -0
  151. package/dist/glass/spring.d.ts +79 -0
  152. package/dist/glass/spring.js +58 -0
  153. package/dist/glass/support.d.ts +13 -0
  154. package/dist/glass/support.js +14 -0
  155. package/dist/glass/use-glass-refraction.d.ts +8 -0
  156. package/dist/glass/use-glass-refraction.js +16 -0
  157. package/dist/i18n/strings.d.ts +24 -0
  158. package/dist/i18n/strings.js +18 -2
  159. package/dist/icons/index.d.ts +2 -0
  160. package/dist/icons/index.js +4 -0
  161. package/dist/icons/key.d.ts +2 -0
  162. package/dist/icons/key.js +12 -0
  163. package/dist/icons/webhook.d.ts +2 -0
  164. package/dist/icons/webhook.js +12 -0
  165. package/dist/liquid/index.d.ts +3 -0
  166. package/dist/liquid/index.js +29 -0
  167. package/dist/navigation/breadcrumbs/breadcrumbs.d.ts +29 -0
  168. package/dist/navigation/breadcrumbs/breadcrumbs.js +70 -0
  169. package/dist/navigation/breadcrumbs/index.d.ts +1 -0
  170. package/dist/navigation/breadcrumbs/index.js +6 -0
  171. package/dist/navigation/index.d.ts +1 -0
  172. package/dist/navigation/index.js +1 -0
  173. package/dist/navigation/segmented/index.d.ts +1 -1
  174. package/dist/navigation/segmented/model.d.ts +5 -0
  175. package/dist/navigation/segmented/model.js +6 -0
  176. package/dist/navigation/segmented/segmented.d.ts +17 -3
  177. package/dist/navigation/segmented/segmented.js +20 -4
  178. package/dist/overlays/context-menu/context-menu.d.ts +9 -1
  179. package/dist/overlays/context-menu/context-menu.js +4 -1
  180. package/dist/overlays/dialog/dialog.d.ts +9 -1
  181. package/dist/overlays/dialog/dialog.js +3 -0
  182. package/dist/overlays/drawer/drawer.d.ts +9 -1
  183. package/dist/overlays/drawer/drawer.js +3 -0
  184. package/dist/overlays/dropdown-menu/dropdown-menu.d.ts +9 -1
  185. package/dist/overlays/dropdown-menu/dropdown-menu.js +3 -1
  186. package/dist/overlays/hover-card/hover-card.d.ts +10 -1
  187. package/dist/overlays/hover-card/hover-card.js +4 -1
  188. package/dist/overlays/popover/popover.d.ts +9 -1
  189. package/dist/overlays/popover/popover.js +3 -0
  190. package/dist/palette/command-palette/command-palette.d.ts +12 -2
  191. package/dist/palette/command-palette/command-palette.js +5 -0
  192. package/dist/primitives/command/command.d.ts +3 -2
  193. package/dist/primitives/command/command.js +2 -0
  194. package/dist/primitives/menu/menu.js +1 -1
  195. package/dist/primitives/popper/popper.js +5 -0
  196. package/dist/rich-text/rich-text-editor.js +94 -8
  197. package/dist/rich-text/sanitize.js +70 -20
  198. package/dist/shell/app-shell/app-shell.d.ts +17 -0
  199. package/dist/shell/app-shell/app-shell.js +44 -4
  200. package/dist/shell/bottom-nav/bottom-nav.d.ts +34 -0
  201. package/dist/shell/bottom-nav/bottom-nav.js +124 -0
  202. package/dist/shell/bottom-nav/index.d.ts +2 -0
  203. package/dist/shell/bottom-nav/index.js +9 -0
  204. package/dist/shell/bottom-nav/split.d.ts +11 -0
  205. package/dist/shell/bottom-nav/split.js +10 -0
  206. package/dist/shell/sidebar/sidebar.d.ts +16 -2
  207. package/dist/shell/sidebar/sidebar.js +46 -4
  208. package/dist/shell/topbar/topbar.d.ts +20 -9
  209. package/dist/shell/topbar/topbar.js +16 -9
  210. package/dist/states/empty-state/empty-state.d.ts +3 -1
  211. package/dist/states/empty-state/empty-state.js +9 -1
  212. package/dist/states/error-state/error-state.d.ts +3 -1
  213. package/dist/states/error-state/error-state.js +2 -0
  214. package/dist/states/index.d.ts +1 -0
  215. package/dist/states/index.js +1 -0
  216. package/dist/states/live-status-bar/index.d.ts +1 -0
  217. package/dist/states/live-status-bar/index.js +6 -0
  218. package/dist/states/live-status-bar/live-status-bar.d.ts +17 -0
  219. package/dist/states/live-status-bar/live-status-bar.js +49 -0
  220. package/dist/states/offline-banner/offline-banner.d.ts +3 -1
  221. package/dist/states/offline-banner/offline-banner.js +8 -4
  222. package/dist/utils/class-groups.js +17 -0
  223. package/dist/utils/index.d.ts +1 -0
  224. package/dist/utils/index.js +2 -0
  225. package/dist/utils/material.d.ts +13 -0
  226. package/dist/utils/material.js +6 -0
  227. package/dist/utils/tone.d.ts +8 -0
  228. package/dist/utils/tone.js +17 -0
  229. package/dist/utils/use-copy.d.ts +5 -0
  230. package/dist/utils/use-copy.js +35 -0
  231. package/icons/svg/key.svg +5 -0
  232. package/icons/svg/webhook.svg +5 -0
  233. package/package.json +31 -21
  234. package/scripts/build-theme.d.mts +22 -0
  235. package/scripts/build-theme.mjs +236 -4
  236. package/src/ai/attachment/attachment.tsx +1 -1
  237. package/src/ai/chat-list/group.ts +3 -1
  238. package/src/ai/conversation/conversation.tsx +1 -1
  239. package/src/ai/internal/use-copy.ts +1 -38
  240. package/src/ai/markdown/parse.ts +74 -17
  241. package/src/ai/source/source.tsx +1 -1
  242. package/src/atoms/avatar/avatar.tsx +57 -4
  243. package/src/atoms/avatar/index.ts +8 -1
  244. package/src/atoms/button/button.tsx +8 -3
  245. package/src/atoms/checkbox/checkbox.tsx +44 -10
  246. package/src/atoms/chip/chip.tsx +37 -5
  247. package/src/atoms/chip/index.ts +7 -1
  248. package/src/atoms/status-dot/index.ts +1 -0
  249. package/src/atoms/status-dot/status-dot.tsx +15 -3
  250. package/src/charts/README.md +21 -0
  251. package/src/charts/bar-chart/bar-race-chart.tsx +1 -0
  252. package/src/charts/beeswarm-chart/beeswarm-chart.tsx +1 -1
  253. package/src/charts/chord-chart/chord-chart.tsx +13 -5
  254. package/src/charts/core/cartesian/cartesian-chart.tsx +55 -10
  255. package/src/charts/core/cartesian/layout.ts +29 -10
  256. package/src/charts/core/cartesian/marks.tsx +3 -3
  257. package/src/charts/core/cartesian/types.ts +30 -2
  258. package/src/charts/core/category-explorer.tsx +12 -6
  259. package/src/charts/core/chart-dock.tsx +68 -0
  260. package/src/charts/core/chart-frame.tsx +116 -27
  261. package/src/charts/core/distribution/explorer.tsx +17 -7
  262. package/src/charts/core/distribution/xy-points.tsx +1 -1
  263. package/src/charts/core/index.ts +3 -0
  264. package/src/charts/core/leave-grace.ts +35 -0
  265. package/src/charts/core/nearest.ts +38 -0
  266. package/src/charts/core/plot-overlay.tsx +9 -3
  267. package/src/charts/core/pointer.test-utils.ts +146 -0
  268. package/src/charts/core/tooltip.tsx +129 -15
  269. package/src/charts/core/touch-select.ts +250 -0
  270. package/src/charts/core/types.ts +13 -4
  271. package/src/charts/core/use-index-navigation.ts +70 -11
  272. package/src/charts/donut-chart/donut-chart.tsx +53 -3
  273. package/src/charts/donut-chart/slice-labels.ts +39 -0
  274. package/src/charts/dumbbell-chart/dumbbell-chart.tsx +8 -3
  275. package/src/charts/fill-gauge-chart/fill-gauge-chart.tsx +1 -0
  276. package/src/charts/funnel-chart/funnel-chart.tsx +2 -1
  277. package/src/charts/gauge-chart/gauge-chart.tsx +2 -1
  278. package/src/charts/heatmap-chart/heatmap-chart.tsx +5 -0
  279. package/src/charts/heatmap-chart/heatmap-grid.tsx +5 -1
  280. package/src/charts/hex-tile-map/hex-tile-map.tsx +6 -1
  281. package/src/charts/hierarchy-morph/hierarchy-morph.tsx +2 -1
  282. package/src/charts/icicle-chart/icicle-chart.tsx +8 -9
  283. package/src/charts/lollipop-chart/lollipop-chart.tsx +8 -3
  284. package/src/charts/maps/geo/map-viewport.tsx +1 -1
  285. package/src/charts/polar-area-chart/polar-area-chart.tsx +37 -12
  286. package/src/charts/progress-units/progress-units.tsx +1 -0
  287. package/src/charts/radar-chart/radar-chart.tsx +1 -1
  288. package/src/charts/radial-bar-chart/radial-bar-chart.tsx +2 -1
  289. package/src/charts/range-area-chart/range-area-chart.tsx +3 -2
  290. package/src/charts/sankey-chart/sankey-chart.tsx +12 -4
  291. package/src/charts/tree-chart/tree-chart.tsx +1 -0
  292. package/src/charts/treemap-chart/treemap-chart.tsx +2 -7
  293. package/src/charts/waterfall-chart/waterfall-chart.tsx +8 -3
  294. package/src/containers/action-bar/action-bar.tsx +13 -2
  295. package/src/containers/card/card.tsx +43 -4
  296. package/src/containers/grid/grid.tsx +37 -0
  297. package/src/containers/grid/index.ts +1 -0
  298. package/src/containers/index.ts +3 -0
  299. package/src/containers/kpi/kpi.tsx +116 -22
  300. package/src/containers/kpi-group/index.ts +7 -1
  301. package/src/containers/kpi-group/kpi-group.tsx +26 -1
  302. package/src/containers/page/index.ts +1 -0
  303. package/src/containers/page/page.tsx +17 -0
  304. package/src/containers/page-header/page-header.tsx +38 -8
  305. package/src/containers/responsive-list/responsive-list.tsx +7 -4
  306. package/src/containers/stack/index.ts +7 -0
  307. package/src/containers/stack/stack.tsx +55 -0
  308. package/src/forms/copy-field/copy-field.tsx +88 -0
  309. package/src/forms/copy-field/index.ts +1 -0
  310. package/src/forms/emoji-picker/emoji-picker.tsx +1 -1
  311. package/src/forms/form/form.tsx +46 -0
  312. package/src/forms/form/index.ts +8 -0
  313. package/src/forms/index.ts +2 -0
  314. package/src/forms/input/index.ts +1 -1
  315. package/src/forms/input/input.tsx +14 -3
  316. package/src/glass/crystal-map.ts +150 -0
  317. package/src/glass/displacement-map.ts +317 -0
  318. package/src/glass/index.ts +43 -0
  319. package/src/glass/lens-crystal.ts +226 -0
  320. package/src/glass/lens-dispersion.ts +34 -0
  321. package/src/glass/liquid-glass.tsx +371 -0
  322. package/src/glass/liquid-motion.ts +395 -0
  323. package/src/glass/liquid-options.ts +306 -0
  324. package/src/glass/refraction.ts +1010 -0
  325. package/src/glass/specular-map.ts +95 -0
  326. package/src/glass/spring.ts +98 -0
  327. package/src/glass/support.ts +27 -0
  328. package/src/glass/use-glass-refraction.ts +21 -0
  329. package/src/i18n/strings.ts +24 -0
  330. package/src/icons/index.ts +2 -0
  331. package/src/icons/key.tsx +13 -0
  332. package/src/icons/webhook.tsx +13 -0
  333. package/src/liquid/index.ts +24 -0
  334. package/src/navigation/breadcrumbs/breadcrumbs.tsx +103 -0
  335. package/src/navigation/breadcrumbs/index.ts +8 -0
  336. package/src/navigation/index.ts +1 -0
  337. package/src/navigation/segmented/index.ts +1 -0
  338. package/src/navigation/segmented/model.ts +11 -0
  339. package/src/navigation/segmented/segmented.tsx +45 -6
  340. package/src/overlays/context-menu/context-menu.tsx +11 -1
  341. package/src/overlays/dialog/dialog.tsx +10 -0
  342. package/src/overlays/drawer/drawer.tsx +10 -0
  343. package/src/overlays/dropdown-menu/dropdown-menu.tsx +10 -1
  344. package/src/overlays/hover-card/hover-card.tsx +12 -1
  345. package/src/overlays/popover/popover.tsx +10 -0
  346. package/src/palette/command-palette/command-palette.tsx +15 -1
  347. package/src/primitives/command/command.tsx +4 -0
  348. package/src/primitives/menu/menu.tsx +1 -1
  349. package/src/primitives/popper/popper.tsx +10 -0
  350. package/src/rich-text/rich-text-editor.tsx +116 -13
  351. package/src/rich-text/sanitize.ts +94 -23
  352. package/src/shell/app-shell/app-shell.tsx +60 -4
  353. package/src/shell/bottom-nav/bottom-nav.tsx +187 -0
  354. package/src/shell/bottom-nav/index.ts +8 -0
  355. package/src/shell/bottom-nav/split.ts +20 -0
  356. package/src/shell/sidebar/sidebar.tsx +51 -5
  357. package/src/shell/topbar/topbar.tsx +81 -58
  358. package/src/states/empty-state/empty-state.tsx +11 -1
  359. package/src/states/error-state/error-state.tsx +4 -0
  360. package/src/states/index.ts +1 -0
  361. package/src/states/live-status-bar/index.ts +6 -0
  362. package/src/states/live-status-bar/live-status-bar.tsx +62 -0
  363. package/src/states/offline-banner/offline-banner.tsx +13 -5
  364. package/src/utils/class-groups.ts +17 -0
  365. package/src/utils/index.ts +1 -0
  366. package/src/utils/material.ts +16 -0
  367. package/src/utils/tone.ts +29 -0
  368. package/src/utils/use-copy.ts +38 -0
  369. package/styles/Theme.kt +64 -3
  370. package/styles/base.css +51 -0
  371. package/styles/tailwind.css +833 -0
  372. package/styles/theme.css +546 -4
  373. package/styles/tokens.css +788 -15
  374. package/tokens/default.json +918 -29
  375. package/scripts/build-theme.d.ts +0 -18
@@ -22,6 +22,7 @@ import { resolveLabels } from "../core/types.js";
22
22
  import { useIndexNavigation } from "../core/use-index-navigation.js";
23
23
  import { useSeriesState } from "../core/use-series-state.js";
24
24
  import { fitCenterText } from "./center-fit.js";
25
+ import { fitSliceLabel } from "./slice-labels.js";
25
26
  function labelMode(value) {
26
27
  if (!value) return null;
27
28
  return value === true ? "both" : value;
@@ -52,6 +53,7 @@ function DonutChart({
52
53
  centerLabel,
53
54
  centerValue,
54
55
  outsideLabels = false,
56
+ sliceLabels = false,
55
57
  legend,
56
58
  tooltip = true,
57
59
  loading = false,
@@ -175,6 +177,7 @@ function DonutChart({
175
177
  centerLabel: centerLabel ?? labels.total,
176
178
  centerValue,
177
179
  outside: labelMode(outsideLabels),
180
+ sliceLabels,
178
181
  tooltip,
179
182
  animate,
180
183
  labels,
@@ -210,6 +213,7 @@ function DonutPlot({
210
213
  centerLabel,
211
214
  centerValue,
212
215
  outside: outsideProp,
216
+ sliceLabels,
213
217
  tooltip,
214
218
  animate,
215
219
  labels,
@@ -335,6 +339,27 @@ function DonutPlot({
335
339
  }
336
340
  return out;
337
341
  }, [outside, visible, slices, items, cx, cy, radius, height]);
342
+ const insideLabels = useMemo(() => {
343
+ if (!sliceLabels) return [];
344
+ const fontSize = 11;
345
+ const out = [];
346
+ for (const index of visible) {
347
+ const slice = slices[index];
348
+ const item = items[index];
349
+ if (!slice || !item) continue;
350
+ const text = sliceLabels === "value" ? item.format(item.datum.value) : formatPercent(slice.fraction, { decimals: 0 });
351
+ const fit2 = fitSliceLabel({
352
+ inner,
353
+ radius,
354
+ start: slice.start,
355
+ end: slice.end,
356
+ chars: text.length,
357
+ fontSize
358
+ });
359
+ if (fit2) out.push({ id: item.datum.id, x: cx + fit2.x, y: cy + fit2.y, text });
360
+ }
361
+ return out;
362
+ }, [sliceLabels, visible, slices, items, inner, radius, cx, cy]);
338
363
  useEntryAnimation(
339
364
  svgRef,
340
365
  (root) => {
@@ -443,6 +468,19 @@ function DonutPlot({
443
468
  item.datum.id
444
469
  );
445
470
  }),
471
+ insideLabels.map((label) => /* @__PURE__ */ jsx(
472
+ "text",
473
+ {
474
+ x: label.x,
475
+ y: label.y,
476
+ textAnchor: "middle",
477
+ dominantBaseline: "central",
478
+ pointerEvents: "none",
479
+ className: "fill-surface font-bold text-fs-110 tabular-nums",
480
+ children: label.text
481
+ },
482
+ label.id
483
+ )),
446
484
  outsideLabels.map((label) => {
447
485
  const dimmed = focusIndex != null && items[focusIndex]?.datum.id !== label.id;
448
486
  const avail = Math.max(24, (label.side > 0 ? width - label.x : label.x) - 6);
@@ -504,7 +542,7 @@ function DonutPlot({
504
542
  d,
505
543
  clickable: onSliceClick != null,
506
544
  onEnter: (event) => nav.hover(position, event),
507
- onLeave: nav.leave,
545
+ onLeave: nav.pointerLeave,
508
546
  onClick: onSliceClick ? () => onSliceClick(item.datum) : void 0
509
547
  },
510
548
  item.datum.id
@@ -604,6 +642,7 @@ function SliceHitArea({ d, clickable, onEnter, onLeave, onClick }) {
604
642
  "path",
605
643
  {
606
644
  "data-slice-hit": "",
645
+ "data-chart-hit": "",
607
646
  d,
608
647
  fill: "transparent",
609
648
  onPointerEnter: onEnter,
@@ -0,0 +1,20 @@
1
+ export interface SliceLabelInput {
2
+ /** Radius of the hole (0 for a pie). */
3
+ inner: number;
4
+ radius: number;
5
+ /** Angles in radians from 12 o'clock, clockwise. */
6
+ start: number;
7
+ end: number;
8
+ chars: number;
9
+ fontSize: number;
10
+ }
11
+ export interface SliceLabelFit {
12
+ x: number;
13
+ y: number;
14
+ }
15
+ /**
16
+ * Where a horizontal label sits inside a ring slice, relative to the centre, or null when the text
17
+ * does not fit: the box is projected on the radial and the tangential direction of the slice and
18
+ * must stay within the ring thickness and the arc length at its middle radius.
19
+ */
20
+ export declare function fitSliceLabel(input: SliceLabelInput): SliceLabelFit | null;
@@ -0,0 +1,20 @@
1
+ const CHAR_WIDTH_EM = 0.6;
2
+ const FILL_RATIO = 0.92;
3
+ function fitSliceLabel(input) {
4
+ const { inner, radius, start, end, chars, fontSize } = input;
5
+ const mid = (start + end) / 2;
6
+ const at = inner <= 0 ? radius * 0.62 : (inner + radius) / 2;
7
+ const thickness = inner <= 0 ? radius * 0.7 : radius - inner;
8
+ const arc = (end - start) * at;
9
+ const width = chars * fontSize * CHAR_WIDTH_EM;
10
+ const height = fontSize * 1.1;
11
+ const rx = Math.sin(mid);
12
+ const ry = -Math.cos(mid);
13
+ const radial = width * Math.abs(rx) + height * Math.abs(ry);
14
+ const tangent = width * Math.abs(ry) + height * Math.abs(rx);
15
+ if (radial > thickness * FILL_RATIO || tangent > arc * FILL_RATIO) return null;
16
+ return { x: at * rx, y: at * ry };
17
+ }
18
+ export {
19
+ fitSliceLabel
20
+ };
@@ -15,7 +15,10 @@ import { DIRECTION_COLORS, directionOf, seriesColor } from "../core/palette.js";
15
15
  import { PlotOverlay } from "../core/plot-overlay.js";
16
16
  import { linearScale } from "../core/scales/linear.js";
17
17
  import { ChartTooltip } from "../core/tooltip.js";
18
- import { resolveLabels } from "../core/types.js";
18
+ import {
19
+ resolveAxisBound,
20
+ resolveLabels
21
+ } from "../core/types.js";
19
22
  const MARGIN = { top: 8, bottom: 30 };
20
23
  const DELTA_COLUMN = 64;
21
24
  const DOT_PAD = 40;
@@ -278,8 +281,8 @@ function DumbbellPlot({
278
281
  const lo = all.length ? Math.min(...all) : 0;
279
282
  const hi = all.length ? Math.max(...all) : 1;
280
283
  const domain = [
281
- xAxis?.min ?? (lo > 0 && lo < hi * 0.4 ? 0 : lo),
282
- xAxis?.max ?? hi
284
+ resolveAxisBound(xAxis?.min, lo > 0 && lo < hi * 0.4 ? 0 : lo),
285
+ resolveAxisBound(xAxis?.max, hi)
283
286
  ];
284
287
  const format = resolveAxisFormat(xAxis?.format ?? valueFormat);
285
288
  if (vertical) {
@@ -38,6 +38,7 @@ function FillGaugeChart({
38
38
  return /* @__PURE__ */ jsx(
39
39
  ChartFrame,
40
40
  {
41
+ dock: "never",
41
42
  height,
42
43
  aspectRatio,
43
44
  labels,
@@ -243,7 +243,7 @@ function FunnelPlot({
243
243
  opacity: shape.opacity,
244
244
  dimmed: active != null && active !== i,
245
245
  onEnter: (event) => nav.hover(i, event),
246
- onLeave: nav.leave
246
+ onLeave: nav.pointerLeave
247
247
  },
248
248
  stages[i]?.id ?? i
249
249
  )),
@@ -401,6 +401,7 @@ const StageMark = memo(function StageMark2({
401
401
  "polygon",
402
402
  {
403
403
  "data-stage": "",
404
+ "data-chart-hit": "",
404
405
  points,
405
406
  strokeWidth: 2,
406
407
  strokeLinejoin: "round",
@@ -304,7 +304,7 @@ function GaugePlot({
304
304
  opacity: needle ? 0.92 : focused === index ? 0.32 : 0,
305
305
  dimmed: needle && focused != null && focused !== index,
306
306
  onEnter: (event) => nav.hover(index, event),
307
- onLeave: nav.leave
307
+ onLeave: nav.pointerLeave
308
308
  },
309
309
  index
310
310
  );
@@ -474,6 +474,7 @@ const BandMark = memo(function BandMark2({
474
474
  "path",
475
475
  {
476
476
  "data-band": "",
477
+ "data-chart-hit": "",
477
478
  d,
478
479
  fill: "none",
479
480
  strokeWidth: width,
@@ -1,5 +1,6 @@
1
1
  import type { ColorRange, ScaleColors } from "../core/color-scale.js";
2
2
  import { type ValueFormat } from "../core/format.js";
3
+ import type { TooltipRow } from "../core/tooltip.js";
3
4
  import { type HeatmapCellInfo, type HeatmapLabels } from "./heatmap-grid.js";
4
5
  export interface HeatmapChartProps {
5
6
  /** Accessible name of the drawing and caption of the data table. */
@@ -48,6 +49,8 @@ export interface HeatmapChartProps {
48
49
  loading?: boolean;
49
50
  labels?: Partial<HeatmapLabels>;
50
51
  onCellClick?: (cell: HeatmapCellInfo) => void;
52
+ /** Extra tooltip rows for a cell, shown under its value, e.g. an amount next to a count. */
53
+ cellDetail?: (row: number, column: number, value: number | null) => readonly TooltipRow[];
51
54
  className?: string;
52
55
  }
53
56
  /**
@@ -56,4 +59,4 @@ export interface HeatmapChartProps {
56
59
  * `ranges` switches to stepped colors. Hover and keyboard focus light the
57
60
  * row and column of the cell.
58
61
  */
59
- export declare function HeatmapChart({ title, rows, columns, values, scale, domain, center, colors, ranges, valueFormat, cellLabels, gap, radius, shape, renderer, height, aspectRatio, legend, tooltip, animate, loading, labels: labelsProp, onCellClick, className, }: HeatmapChartProps): import("react").JSX.Element;
62
+ export declare function HeatmapChart({ title, rows, columns, values, scale, domain, center, colors, ranges, valueFormat, cellLabels, gap, radius, shape, renderer, height, aspectRatio, legend, tooltip, animate, loading, labels: labelsProp, onCellClick, cellDetail, className, }: HeatmapChartProps): import("react").JSX.Element;
@@ -36,6 +36,7 @@ function HeatmapChart({
36
36
  loading,
37
37
  labels: labelsProp,
38
38
  onCellClick,
39
+ cellDetail,
39
40
  className
40
41
  }) {
41
42
  const labels = resolveHeatmapLabels(labelsProp);
@@ -116,7 +117,8 @@ function HeatmapChart({
116
117
  renderer,
117
118
  tooltip,
118
119
  animate,
119
- onCellClick
120
+ onCellClick,
121
+ cellDetail
120
122
  }
121
123
  )
122
124
  }
@@ -1,5 +1,6 @@
1
1
  import { type ColorRange, type ScaleColors } from "../core/color-scale.js";
2
2
  import type { ValueFormatter } from "../core/format.js";
3
+ import { type TooltipRow } from "../core/tooltip.js";
3
4
  import { type ChartLabels } from "../core/types.js";
4
5
  import type { HeatmapScale } from "./heatmap-scale.js";
5
6
  /** Visible strings of the heatmaps. */
@@ -38,6 +39,8 @@ export interface HeatmapGridProps {
38
39
  tooltip: boolean;
39
40
  animate: boolean;
40
41
  onCellClick?: (cell: HeatmapCellInfo) => void;
42
+ /** Extra tooltip rows under the cell value, e.g. a second measure of the same cell. */
43
+ cellDetail?: (row: number, column: number, value: number | null) => readonly TooltipRow[];
41
44
  /** Name of the value in the tooltip; the row label by default. */
42
45
  valueName?: string;
43
46
  /** "hex" lays the cells out as a honeycomb (odd rows shifted half a cell). */
@@ -58,7 +61,7 @@ export declare function rowGutter(width: number, rowLabels: readonly string[]):
58
61
  * column like a crosshair and dims the rest. Column labels thin out when they
59
62
  * would collide; cell values only show where they fit.
60
63
  */
61
- export declare function HeatmapGrid({ width, height, title, rowLabels, columnLabels, values, colorScale, format, cellTitle, labels, cellLabels, gap, radius, square, tooltip, animate, onCellClick, valueName, shape, renderer, }: HeatmapGridProps): import("react").JSX.Element;
64
+ export declare function HeatmapGrid({ width, height, title, rowLabels, columnLabels, values, colorScale, format, cellTitle, labels, cellLabels, gap, radius, square, tooltip, animate, onCellClick, cellDetail, valueName, shape, renderer, }: HeatmapGridProps): import("react").JSX.Element;
62
65
  export interface HeatmapLegendProps {
63
66
  kind: "sequential" | "diverging";
64
67
  domain: readonly [number, number];
@@ -48,6 +48,7 @@ function HeatmapGrid({
48
48
  tooltip,
49
49
  animate,
50
50
  onCellClick,
51
+ cellDetail,
51
52
  valueName,
52
53
  shape = "rect",
53
54
  renderer = "svg"
@@ -426,7 +427,8 @@ function HeatmapGrid({
426
427
  name: valueName ?? rowLabels[shown.row] ?? "",
427
428
  value: shownValue == null ? labels.noData : format(shownValue),
428
429
  color: shownColor
429
- }
430
+ },
431
+ ...cellDetail?.(shown.row, shown.column, shownValue ?? null) ?? []
430
432
  ]
431
433
  }
432
434
  ) : null
@@ -181,126 +181,135 @@ function HexPlot({
181
181
  }
182
182
  };
183
183
  const anchor = current && active != null ? grid.centers[active] ?? null : null;
184
- return /* @__PURE__ */ jsxs("div", { ref: nav.ref, className: "relative", style: { width, height }, onPointerLeave: nav.leave, children: [
185
- /* @__PURE__ */ jsx(
186
- "svg",
187
- {
188
- ref: svgRef,
189
- role: "img",
190
- "aria-label": title,
191
- width,
192
- height,
193
- className: "block overflow-visible",
194
- children: cells.map((cell, index) => {
195
- const [cx, cy] = grid.centers[index];
196
- const isActive = index === active;
197
- const text = [
198
- showCode ? cell.tile.code : null,
199
- showValue && cell.value != null ? format(cell.value) : null
200
- ].filter(Boolean);
201
- return (
202
- // biome-ignore lint/a11y/noStaticElementInteractions: pointer mirror of the keyboard model on the slider below.
203
- /* @__PURE__ */ jsxs(
204
- "g",
205
- {
206
- "data-tile": "",
207
- style: {
208
- cursor: onTileClick ? "pointer" : "default",
209
- transformBox: "fill-box",
210
- transformOrigin: "center"
211
- },
212
- onPointerEnter: (event) => nav.hover(index, event),
213
- onPointerMove: (event) => nav.hover(index, event),
214
- onClick: () => click(index),
215
- children: [
216
- /* @__PURE__ */ jsx(
217
- "polygon",
218
- {
219
- points: hexPoints(cx, cy, grid.size, gap / 2),
220
- strokeLinejoin: "round",
221
- className: "motion-safe:transition-[fill] motion-safe:duration-150",
222
- style: {
223
- fill: cell.color,
224
- stroke: isActive ? "var(--ink)" : "var(--surface)",
225
- strokeWidth: isActive ? 2.5 : 1
226
- }
227
- }
228
- ),
229
- text.length > 0 ? /* @__PURE__ */ jsxs(
230
- "text",
231
- {
232
- ...DECORATIVE,
233
- x: cx,
234
- y: cy,
235
- textAnchor: "middle",
236
- className: "pointer-events-none font-bold tabular-nums",
237
- style: { fill: cell.ink },
238
- children: [
239
- /* @__PURE__ */ jsx(
240
- "tspan",
241
- {
242
- x: cx,
243
- dy: text.length > 1 ? "-0.15em" : "0.35em",
244
- fontSize: showCode ? codeSize : valueSize,
245
- children: text[0]
184
+ return /* @__PURE__ */ jsxs(
185
+ "div",
186
+ {
187
+ ref: nav.ref,
188
+ className: "relative",
189
+ style: { width, height },
190
+ onPointerLeave: nav.pointerLeave,
191
+ children: [
192
+ /* @__PURE__ */ jsx(
193
+ "svg",
194
+ {
195
+ ref: svgRef,
196
+ role: "img",
197
+ "aria-label": title,
198
+ width,
199
+ height,
200
+ className: "block overflow-visible",
201
+ children: cells.map((cell, index) => {
202
+ const [cx, cy] = grid.centers[index];
203
+ const isActive = index === active;
204
+ const text = [
205
+ showCode ? cell.tile.code : null,
206
+ showValue && cell.value != null ? format(cell.value) : null
207
+ ].filter(Boolean);
208
+ return (
209
+ // biome-ignore lint/a11y/noStaticElementInteractions: pointer mirror of the keyboard model on the slider below.
210
+ /* @__PURE__ */ jsxs(
211
+ "g",
212
+ {
213
+ "data-tile": "",
214
+ style: {
215
+ cursor: onTileClick ? "pointer" : "default",
216
+ transformBox: "fill-box",
217
+ transformOrigin: "center"
218
+ },
219
+ onPointerEnter: (event) => nav.hover(index, event),
220
+ onPointerMove: (event) => nav.hover(index, event),
221
+ onClick: () => click(index),
222
+ children: [
223
+ /* @__PURE__ */ jsx(
224
+ "polygon",
225
+ {
226
+ points: hexPoints(cx, cy, grid.size, gap / 2),
227
+ strokeLinejoin: "round",
228
+ className: "motion-safe:transition-[fill] motion-safe:duration-150",
229
+ style: {
230
+ fill: cell.color,
231
+ stroke: isActive ? "var(--ink)" : "var(--surface)",
232
+ strokeWidth: isActive ? 2.5 : 1
246
233
  }
247
- ),
248
- text.length > 1 ? /* @__PURE__ */ jsx("tspan", { x: cx, dy: "1.2em", fontSize: valueSize, className: "font-semibold", children: text[1] }) : null
249
- ]
250
- }
251
- ) : null
252
- ]
253
- },
254
- cell.tile.id
234
+ }
235
+ ),
236
+ text.length > 0 ? /* @__PURE__ */ jsxs(
237
+ "text",
238
+ {
239
+ ...DECORATIVE,
240
+ x: cx,
241
+ y: cy,
242
+ textAnchor: "middle",
243
+ className: "pointer-events-none font-bold tabular-nums",
244
+ style: { fill: cell.ink },
245
+ children: [
246
+ /* @__PURE__ */ jsx(
247
+ "tspan",
248
+ {
249
+ x: cx,
250
+ dy: text.length > 1 ? "-0.15em" : "0.35em",
251
+ fontSize: showCode ? codeSize : valueSize,
252
+ children: text[0]
253
+ }
254
+ ),
255
+ text.length > 1 ? /* @__PURE__ */ jsx("tspan", { x: cx, dy: "1.2em", fontSize: valueSize, className: "font-semibold", children: text[1] }) : null
256
+ ]
257
+ }
258
+ ) : null
259
+ ]
260
+ },
261
+ cell.tile.id
262
+ )
263
+ );
264
+ })
265
+ }
266
+ ),
267
+ /* @__PURE__ */ jsx(
268
+ "div",
269
+ {
270
+ role: "slider",
271
+ tabIndex: 0,
272
+ "aria-label": labels.explore,
273
+ "aria-valuemin": 1,
274
+ "aria-valuemax": Math.max(1, cells.length),
275
+ "aria-valuenow": (active ?? 0) + 1,
276
+ "aria-valuetext": valueText,
277
+ onKeyDown: (event) => {
278
+ if ((event.key === "Enter" || event.key === " ") && active != null) {
279
+ event.preventDefault();
280
+ click(active);
281
+ return;
282
+ }
283
+ nav.sliderProps.onKeyDown(event);
284
+ },
285
+ onFocus: nav.sliderProps.onFocus,
286
+ onBlur: nav.sliderProps.onBlur,
287
+ className: cn(
288
+ "pointer-events-none absolute inset-0 rounded-xs outline-none",
289
+ "focus-visible:outline-2 focus-visible:outline-accent-ink focus-visible:outline-offset-4"
255
290
  )
256
- );
257
- })
258
- }
259
- ),
260
- /* @__PURE__ */ jsx(
261
- "div",
262
- {
263
- role: "slider",
264
- tabIndex: 0,
265
- "aria-label": labels.explore,
266
- "aria-valuemin": 1,
267
- "aria-valuemax": Math.max(1, cells.length),
268
- "aria-valuenow": (active ?? 0) + 1,
269
- "aria-valuetext": valueText,
270
- onKeyDown: (event) => {
271
- if ((event.key === "Enter" || event.key === " ") && active != null) {
272
- event.preventDefault();
273
- click(active);
274
- return;
275
291
  }
276
- nav.sliderProps.onKeyDown(event);
277
- },
278
- onFocus: nav.sliderProps.onFocus,
279
- onBlur: nav.sliderProps.onBlur,
280
- className: cn(
281
- "pointer-events-none absolute inset-0 rounded-xs outline-none",
282
- "focus-visible:outline-2 focus-visible:outline-accent-ink focus-visible:outline-offset-4"
283
- )
284
- }
285
- ),
286
- tooltip && current ? /* @__PURE__ */ jsx(
287
- ChartTooltip,
288
- {
289
- x: nav.pointer?.x ?? anchor?.[0] ?? 0,
290
- y: nav.pointer?.y ?? anchor?.[1] ?? 0,
291
- containerWidth: width,
292
- title: current.tile.name,
293
- rows: [
292
+ ),
293
+ tooltip && current ? /* @__PURE__ */ jsx(
294
+ ChartTooltip,
294
295
  {
295
- id: "value",
296
- name: valueName,
297
- value: current.value == null ? labels.noData : format(current.value),
298
- color: current.color
296
+ x: nav.pointer?.x ?? anchor?.[0] ?? 0,
297
+ y: nav.pointer?.y ?? anchor?.[1] ?? 0,
298
+ containerWidth: width,
299
+ title: current.tile.name,
300
+ rows: [
301
+ {
302
+ id: "value",
303
+ name: valueName,
304
+ value: current.value == null ? labels.noData : format(current.value),
305
+ color: current.color
306
+ }
307
+ ]
299
308
  }
300
- ]
301
- }
302
- ) : null
303
- ] });
309
+ ) : null
310
+ ]
311
+ }
312
+ );
304
313
  }
305
314
  export {
306
315
  HexTileMap
@@ -254,9 +254,10 @@ function MorphPlot({
254
254
  "path",
255
255
  {
256
256
  d: path,
257
+ "data-chart-hit": "",
257
258
  onPointerEnter: (event) => nav.hover(index, event),
258
259
  onPointerMove: (event) => nav.hover(index, event),
259
- onPointerLeave: nav.leave,
260
+ onPointerLeave: nav.pointerLeave,
260
261
  style: {
261
262
  fill: tint(base, strength),
262
263
  opacity: faded * (dimmed ? 0.45 : 1),
@@ -26,6 +26,7 @@ import {
26
26
  resolveHierarchyLabels
27
27
  } from "../core/hierarchy-chart.js";
28
28
  import { EASE_OUT, useEntryAnimation } from "../core/motion.js";
29
+ import { boxAt } from "../core/nearest.js";
29
30
  import { ChartTooltip } from "../core/tooltip.js";
30
31
  import { useAnimatedView, useDrill } from "../core/use-drill.js";
31
32
  function IcicleChart({
@@ -156,15 +157,12 @@ function IciclePlot({
156
157
  { disabled: !animate }
157
158
  );
158
159
  const children = focus.children;
159
- const hit = (x, y) => {
160
- for (let i = cells.length - 1; i >= 0; i--) {
161
- const cell = cells[i];
162
- if (x >= cell.x && x <= cell.x + cell.width && y >= cell.y && y <= cell.y + cell.height) {
163
- return cell;
164
- }
165
- }
166
- return null;
167
- };
160
+ const hit = (x, y) => boxAt(cells, x, y, (cell) => ({
161
+ x0: cell.x,
162
+ y0: cell.y,
163
+ x1: cell.x + cell.width,
164
+ y1: cell.y + cell.height
165
+ }));
168
166
  const local = (event) => {
169
167
  const box = event.currentTarget.getBoundingClientRect();
170
168
  return { x: event.clientX - box.left, y: event.clientY - box.top };
@@ -11,7 +11,10 @@ import { PlotOverlay } from "../core/plot-overlay.js";
11
11
  import { bandScale } from "../core/scales/band.js";
12
12
  import { linearScale } from "../core/scales/linear.js";
13
13
  import { ChartTooltip } from "../core/tooltip.js";
14
- import { resolveLabels } from "../core/types.js";
14
+ import {
15
+ resolveAxisBound,
16
+ resolveLabels
17
+ } from "../core/types.js";
15
18
  const PAD = { top: 12, bottom: 28 };
16
19
  function fitLabel(text, room) {
17
20
  const max = Math.max(3, Math.floor(room / 6.6));
@@ -116,8 +119,8 @@ function LollipopPlot({
116
119
  const model = useMemo(() => {
117
120
  const values = rows.map((row) => row.value);
118
121
  const domain = [
119
- yAxis?.min ?? Math.min(0, ...values),
120
- yAxis?.max ?? Math.max(0, ...values)
122
+ resolveAxisBound(yAxis?.min, Math.min(0, ...values)),
123
+ resolveAxisBound(yAxis?.max, Math.max(0, ...values))
121
124
  ];
122
125
  const format = resolveAxisFormat(yAxis?.format ?? valueFormat);
123
126
  const top2 = PAD.top + (vertical && dataLabels ? 8 : 0);
@@ -116,7 +116,7 @@ function RegionLabels({
116
116
  index
117
117
  )) });
118
118
  }
119
- const BUTTON = "inline-flex size-8 cursor-pointer items-center justify-center border-0 bg-surface-overlay text-ink-2 outline-none transition-colors hover:bg-surface-2 hover:text-ink focus-visible:outline-2 focus-visible:outline-accent-ink focus-visible:-outline-offset-2 disabled:cursor-default disabled:opacity-40 disabled:hover:bg-float";
119
+ const BUTTON = "inline-flex size-8 cursor-pointer items-center justify-center border-0 surface-overlay text-ink-2 outline-none transition-colors hover:bg-surface-2 hover:text-ink focus-visible:outline-2 focus-visible:outline-accent-ink focus-visible:-outline-offset-2 disabled:cursor-default disabled:opacity-40 disabled:hover:bg-float";
120
120
  function Glyph({ d }) {
121
121
  return /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", viewBox: "0 0 16 16", width: "16", height: "16", fill: "none", children: /* @__PURE__ */ jsx(
122
122
  "path",