@langchain/macaw-components 1.0.0-beta.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 (566) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +27 -0
  3. package/dist/_chunks/ErrorState-CmPX01HV.js +13361 -0
  4. package/dist/_chunks/ErrorState-CmPX01HV.js.map +1 -0
  5. package/dist/_chunks/LoadingIndicator-DgtU9aqD.js +80 -0
  6. package/dist/_chunks/LoadingIndicator-DgtU9aqD.js.map +1 -0
  7. package/dist/base.css +305 -0
  8. package/dist/catalog.json +1675 -0
  9. package/dist/components/Avatar/Avatar.d.ts +28 -0
  10. package/dist/components/Avatar/Avatar.js +47 -0
  11. package/dist/components/Avatar/Avatar.js.map +1 -0
  12. package/dist/components/Avatar/index.d.ts +2 -0
  13. package/dist/components/Avatar/index.js +2 -0
  14. package/dist/components/Badge/Badge.d.ts +25 -0
  15. package/dist/components/Badge/Badge.js +82 -0
  16. package/dist/components/Badge/Badge.js.map +1 -0
  17. package/dist/components/Badge/index.d.ts +2 -0
  18. package/dist/components/Badge/index.js +2 -0
  19. package/dist/components/Banner/Banner.d.ts +15 -0
  20. package/dist/components/Banner/Banner.js +102 -0
  21. package/dist/components/Banner/Banner.js.map +1 -0
  22. package/dist/components/Banner/index.d.ts +2 -0
  23. package/dist/components/Banner/index.js +2 -0
  24. package/dist/components/BarChart/AnimatedBar.d.ts +20 -0
  25. package/dist/components/BarChart/AnimatedBar.js +65 -0
  26. package/dist/components/BarChart/AnimatedBar.js.map +1 -0
  27. package/dist/components/BarChart/BarChart.d.ts +25 -0
  28. package/dist/components/BarChart/BarChart.js +248 -0
  29. package/dist/components/BarChart/BarChart.js.map +1 -0
  30. package/dist/components/BarChart/BarChart.types.d.ts +239 -0
  31. package/dist/components/BarChart/BarChart.types.js +0 -0
  32. package/dist/components/BarChart/BarChart.utils.d.ts +51 -0
  33. package/dist/components/BarChart/BarChart.utils.js +215 -0
  34. package/dist/components/BarChart/BarChart.utils.js.map +1 -0
  35. package/dist/components/BarChart/BarChartAxes.d.ts +22 -0
  36. package/dist/components/BarChart/BarChartAxes.js +144 -0
  37. package/dist/components/BarChart/BarChartAxes.js.map +1 -0
  38. package/dist/components/BarChart/BarChartGuides.d.ts +22 -0
  39. package/dist/components/BarChart/BarChartGuides.js +83 -0
  40. package/dist/components/BarChart/BarChartGuides.js.map +1 -0
  41. package/dist/components/BarChart/BarChartPlot.d.ts +40 -0
  42. package/dist/components/BarChart/BarChartPlot.js +262 -0
  43. package/dist/components/BarChart/BarChartPlot.js.map +1 -0
  44. package/dist/components/BarChart/constants.d.ts +21 -0
  45. package/dist/components/BarChart/constants.js +26 -0
  46. package/dist/components/BarChart/constants.js.map +1 -0
  47. package/dist/components/BarChart/index.d.ts +3 -0
  48. package/dist/components/BarChart/index.js +3 -0
  49. package/dist/components/Button/Button.d.ts +36 -0
  50. package/dist/components/Button/Button.js +99 -0
  51. package/dist/components/Button/Button.js.map +1 -0
  52. package/dist/components/Button/constants.d.ts +26 -0
  53. package/dist/components/Button/constants.js +31 -0
  54. package/dist/components/Button/constants.js.map +1 -0
  55. package/dist/components/Button/index.d.ts +2 -0
  56. package/dist/components/Button/index.js +2 -0
  57. package/dist/components/ButtonGroup/ButtonGroup.d.ts +30 -0
  58. package/dist/components/ButtonGroup/ButtonGroup.js +26 -0
  59. package/dist/components/ButtonGroup/ButtonGroup.js.map +1 -0
  60. package/dist/components/ButtonGroup/index.d.ts +2 -0
  61. package/dist/components/ButtonGroup/index.js +2 -0
  62. package/dist/components/Card/Card.d.ts +10 -0
  63. package/dist/components/Card/Card.js +23 -0
  64. package/dist/components/Card/Card.js.map +1 -0
  65. package/dist/components/Card/index.d.ts +2 -0
  66. package/dist/components/Card/index.js +2 -0
  67. package/dist/components/ChartCard/ChartCard.d.ts +53 -0
  68. package/dist/components/ChartCard/ChartCard.js +172 -0
  69. package/dist/components/ChartCard/ChartCard.js.map +1 -0
  70. package/dist/components/ChartCard/ChartCardSkeleton.d.ts +7 -0
  71. package/dist/components/ChartCard/ChartCardSkeleton.js +61 -0
  72. package/dist/components/ChartCard/ChartCardSkeleton.js.map +1 -0
  73. package/dist/components/ChartCard/index.d.ts +4 -0
  74. package/dist/components/ChartCard/index.js +3 -0
  75. package/dist/components/ChartLegend/ChartLegend.d.ts +19 -0
  76. package/dist/components/ChartLegend/ChartLegend.js +195 -0
  77. package/dist/components/ChartLegend/ChartLegend.js.map +1 -0
  78. package/dist/components/ChartLegend/ChartLegendItemRenderer.d.ts +14 -0
  79. package/dist/components/ChartLegend/ChartLegendItemRenderer.js +90 -0
  80. package/dist/components/ChartLegend/ChartLegendItemRenderer.js.map +1 -0
  81. package/dist/components/ChartLegend/index.d.ts +3 -0
  82. package/dist/components/ChartLegend/index.js +3 -0
  83. package/dist/components/ChartLegend/useChartLegendActiveItem.d.ts +7 -0
  84. package/dist/components/ChartLegend/useChartLegendActiveItem.js +35 -0
  85. package/dist/components/ChartLegend/useChartLegendActiveItem.js.map +1 -0
  86. package/dist/components/ChartLegend/utils.d.ts +20 -0
  87. package/dist/components/ChartLegend/utils.js +33 -0
  88. package/dist/components/ChartLegend/utils.js.map +1 -0
  89. package/dist/components/ChartTooltip/ChartTooltip.d.ts +23 -0
  90. package/dist/components/ChartTooltip/ChartTooltip.js +83 -0
  91. package/dist/components/ChartTooltip/ChartTooltip.js.map +1 -0
  92. package/dist/components/ChartTooltip/index.d.ts +2 -0
  93. package/dist/components/ChartTooltip/index.js +2 -0
  94. package/dist/components/Checkbox/Checkbox.d.ts +58 -0
  95. package/dist/components/Checkbox/Checkbox.js +50 -0
  96. package/dist/components/Checkbox/Checkbox.js.map +1 -0
  97. package/dist/components/Checkbox/constants.d.ts +28 -0
  98. package/dist/components/Checkbox/constants.js +57 -0
  99. package/dist/components/Checkbox/constants.js.map +1 -0
  100. package/dist/components/Checkbox/getCheckedState.d.ts +6 -0
  101. package/dist/components/Checkbox/getCheckedState.js +14 -0
  102. package/dist/components/Checkbox/getCheckedState.js.map +1 -0
  103. package/dist/components/Checkbox/index.d.ts +3 -0
  104. package/dist/components/Checkbox/index.js +3 -0
  105. package/dist/components/CircularProgress/CircularProgress.d.ts +54 -0
  106. package/dist/components/CircularProgress/CircularProgress.js +85 -0
  107. package/dist/components/CircularProgress/CircularProgress.js.map +1 -0
  108. package/dist/components/CircularProgress/index.d.ts +2 -0
  109. package/dist/components/CircularProgress/index.js +2 -0
  110. package/dist/components/Code/Code.utils.d.ts +24 -0
  111. package/dist/components/Code/Code.utils.js +160 -0
  112. package/dist/components/Code/Code.utils.js.map +1 -0
  113. package/dist/components/Code/CodeLite.d.ts +19 -0
  114. package/dist/components/Code/CodeLite.js +146 -0
  115. package/dist/components/Code/CodeLite.js.map +1 -0
  116. package/dist/components/Code/CodeLite.utils.d.ts +24 -0
  117. package/dist/components/Code/CodeLite.utils.js +273 -0
  118. package/dist/components/Code/CodeLite.utils.js.map +1 -0
  119. package/dist/components/Code/ImageReplacerExtension.d.ts +9 -0
  120. package/dist/components/Code/ImageReplacerExtension.js +227 -0
  121. package/dist/components/Code/ImageReplacerExtension.js.map +1 -0
  122. package/dist/components/Code/JsonHighlighterExtension.d.ts +4 -0
  123. package/dist/components/Code/JsonHighlighterExtension.js +172 -0
  124. package/dist/components/Code/JsonHighlighterExtension.js.map +1 -0
  125. package/dist/components/Code/constants.d.ts +6 -0
  126. package/dist/components/Code/constants.js +11 -0
  127. package/dist/components/Code/constants.js.map +1 -0
  128. package/dist/components/Code/index.d.ts +30 -0
  129. package/dist/components/Code/index.js +140 -0
  130. package/dist/components/Code/index.js.map +1 -0
  131. package/dist/components/Code/languages/json.d.ts +1 -0
  132. package/dist/components/Code/languages/json.js +7 -0
  133. package/dist/components/Code/languages/json.js.map +1 -0
  134. package/dist/components/Code/languages/languages.d.ts +7 -0
  135. package/dist/components/Code/languages/languages.js +12 -0
  136. package/dist/components/Code/languages/languages.js.map +1 -0
  137. package/dist/components/Code/languages/python.d.ts +1 -0
  138. package/dist/components/Code/languages/python.js +7 -0
  139. package/dist/components/Code/languages/python.js.map +1 -0
  140. package/dist/components/Code/languages/shell.d.ts +7 -0
  141. package/dist/components/Code/languages/shell.js +241 -0
  142. package/dist/components/Code/languages/shell.js.map +1 -0
  143. package/dist/components/Code/languages/typescript.d.ts +1 -0
  144. package/dist/components/Code/languages/typescript.js +7 -0
  145. package/dist/components/Code/languages/typescript.js.map +1 -0
  146. package/dist/components/Code/languages/yaml.d.ts +2 -0
  147. package/dist/components/Code/languages/yaml.js +44 -0
  148. package/dist/components/Code/languages/yaml.js.map +1 -0
  149. package/dist/components/Code/types.d.ts +8 -0
  150. package/dist/components/Code/types.js +0 -0
  151. package/dist/components/Code/utils.d.ts +4 -0
  152. package/dist/components/Code/utils.js +27 -0
  153. package/dist/components/Code/utils.js.map +1 -0
  154. package/dist/components/Command/Command.d.ts +78 -0
  155. package/dist/components/Command/Command.js +78 -0
  156. package/dist/components/Command/Command.js.map +1 -0
  157. package/dist/components/Command/CommandMenu.d.ts +65 -0
  158. package/dist/components/Command/CommandMenu.js +101 -0
  159. package/dist/components/Command/CommandMenu.js.map +1 -0
  160. package/dist/components/Command/index.d.ts +4 -0
  161. package/dist/components/Command/index.js +3 -0
  162. package/dist/components/ContextMenu/ContextMenu.d.ts +9 -0
  163. package/dist/components/ContextMenu/ContextMenu.js +43 -0
  164. package/dist/components/ContextMenu/ContextMenu.js.map +1 -0
  165. package/dist/components/ContextMenu/index.d.ts +1 -0
  166. package/dist/components/ContextMenu/index.js +2 -0
  167. package/dist/components/CopyButton/CopyButton.d.ts +24 -0
  168. package/dist/components/CopyButton/CopyButton.js +121 -0
  169. package/dist/components/CopyButton/CopyButton.js.map +1 -0
  170. package/dist/components/CopyButton/copyToClipboard.d.ts +1 -0
  171. package/dist/components/CopyButton/copyToClipboard.js +29 -0
  172. package/dist/components/CopyButton/copyToClipboard.js.map +1 -0
  173. package/dist/components/CopyButton/index.d.ts +4 -0
  174. package/dist/components/CopyButton/index.js +4 -0
  175. package/dist/components/CopyButton/useCopy.d.ts +10 -0
  176. package/dist/components/CopyButton/useCopy.js +46 -0
  177. package/dist/components/CopyButton/useCopy.js.map +1 -0
  178. package/dist/components/Dialog/index.d.ts +49 -0
  179. package/dist/components/Dialog/index.js +130 -0
  180. package/dist/components/Dialog/index.js.map +1 -0
  181. package/dist/components/Divider/Divider.d.ts +9 -0
  182. package/dist/components/Divider/Divider.js +27 -0
  183. package/dist/components/Divider/Divider.js.map +1 -0
  184. package/dist/components/Divider/index.d.ts +2 -0
  185. package/dist/components/Divider/index.js +2 -0
  186. package/dist/components/DonutChart/DonutChart.d.ts +101 -0
  187. package/dist/components/DonutChart/DonutChart.js +197 -0
  188. package/dist/components/DonutChart/DonutChart.js.map +1 -0
  189. package/dist/components/DonutChart/DonutChart.utils.d.ts +38 -0
  190. package/dist/components/DonutChart/DonutChart.utils.js +93 -0
  191. package/dist/components/DonutChart/DonutChart.utils.js.map +1 -0
  192. package/dist/components/DonutChart/constants.d.ts +7 -0
  193. package/dist/components/DonutChart/constants.js +12 -0
  194. package/dist/components/DonutChart/constants.js.map +1 -0
  195. package/dist/components/DonutChart/index.d.ts +4 -0
  196. package/dist/components/DonutChart/index.js +4 -0
  197. package/dist/components/DropdownMenu/DropdownMenu.d.ts +24 -0
  198. package/dist/components/DropdownMenu/DropdownMenu.js +149 -0
  199. package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -0
  200. package/dist/components/DropdownMenu/index.d.ts +1 -0
  201. package/dist/components/DropdownMenu/index.js +2 -0
  202. package/dist/components/EmptyState/EmptyState.d.ts +26 -0
  203. package/dist/components/EmptyState/EmptyState.js +85 -0
  204. package/dist/components/EmptyState/EmptyState.js.map +1 -0
  205. package/dist/components/EmptyState/index.d.ts +2 -0
  206. package/dist/components/EmptyState/index.js +2 -0
  207. package/dist/components/ErrorBoundary.d.ts +35 -0
  208. package/dist/components/ErrorBoundary.js +41 -0
  209. package/dist/components/ErrorBoundary.js.map +1 -0
  210. package/dist/components/ErrorMessage/ErrorMessage.d.ts +17 -0
  211. package/dist/components/ErrorMessage/ErrorMessage.js +146 -0
  212. package/dist/components/ErrorMessage/ErrorMessage.js.map +1 -0
  213. package/dist/components/ErrorMessage/index.d.ts +2 -0
  214. package/dist/components/ErrorMessage/index.js +2 -0
  215. package/dist/components/ErrorState/ErrorState.d.ts +23 -0
  216. package/dist/components/ErrorState/ErrorState.js +2 -0
  217. package/dist/components/ErrorState/index.d.ts +2 -0
  218. package/dist/components/ErrorState/index.js +2 -0
  219. package/dist/components/GroupedTabs/GroupedTabs.d.ts +31 -0
  220. package/dist/components/GroupedTabs/GroupedTabs.js +92 -0
  221. package/dist/components/GroupedTabs/GroupedTabs.js.map +1 -0
  222. package/dist/components/GroupedTabs/index.d.ts +2 -0
  223. package/dist/components/GroupedTabs/index.js +2 -0
  224. package/dist/components/HoverCard.d.ts +4 -0
  225. package/dist/components/HoverCard.js +34 -0
  226. package/dist/components/HoverCard.js.map +1 -0
  227. package/dist/components/Icon/Icon.d.ts +25 -0
  228. package/dist/components/Icon/Icon.js +57 -0
  229. package/dist/components/Icon/Icon.js.map +1 -0
  230. package/dist/components/Icon/index.d.ts +2 -0
  231. package/dist/components/Icon/index.js +2 -0
  232. package/dist/components/IconButton/IconButton.d.ts +35 -0
  233. package/dist/components/IconButton/IconButton.js +73 -0
  234. package/dist/components/IconButton/IconButton.js.map +1 -0
  235. package/dist/components/IconButton/index.d.ts +2 -0
  236. package/dist/components/IconButton/index.js +2 -0
  237. package/dist/components/Input/Input.d.ts +72 -0
  238. package/dist/components/Input/Input.js +221 -0
  239. package/dist/components/Input/Input.js.map +1 -0
  240. package/dist/components/Input/index.d.ts +2 -0
  241. package/dist/components/Input/index.js +2 -0
  242. package/dist/components/Input/inputStyles.d.ts +28 -0
  243. package/dist/components/Input/inputStyles.js +45 -0
  244. package/dist/components/Input/inputStyles.js.map +1 -0
  245. package/dist/components/Kbd/Kbd.d.ts +15 -0
  246. package/dist/components/Kbd/Kbd.js +30 -0
  247. package/dist/components/Kbd/Kbd.js.map +1 -0
  248. package/dist/components/Kbd/index.d.ts +2 -0
  249. package/dist/components/Kbd/index.js +2 -0
  250. package/dist/components/LineChart/LineChart.d.ts +8 -0
  251. package/dist/components/LineChart/LineChart.js +194 -0
  252. package/dist/components/LineChart/LineChart.js.map +1 -0
  253. package/dist/components/LineChart/LineChart.types.d.ts +138 -0
  254. package/dist/components/LineChart/LineChart.types.js +0 -0
  255. package/dist/components/LineChart/LineChart.utils.d.ts +29 -0
  256. package/dist/components/LineChart/LineChart.utils.js +123 -0
  257. package/dist/components/LineChart/LineChart.utils.js.map +1 -0
  258. package/dist/components/LineChart/LineChartPlot.d.ts +43 -0
  259. package/dist/components/LineChart/LineChartPlot.js +306 -0
  260. package/dist/components/LineChart/LineChartPlot.js.map +1 -0
  261. package/dist/components/LineChart/constants.d.ts +3 -0
  262. package/dist/components/LineChart/constants.js +8 -0
  263. package/dist/components/LineChart/constants.js.map +1 -0
  264. package/dist/components/LineChart/index.d.ts +2 -0
  265. package/dist/components/LineChart/index.js +2 -0
  266. package/dist/components/LinearProgress/LinearProgress.d.ts +16 -0
  267. package/dist/components/LinearProgress/LinearProgress.js +42 -0
  268. package/dist/components/LinearProgress/LinearProgress.js.map +1 -0
  269. package/dist/components/LinearProgress/index.d.ts +2 -0
  270. package/dist/components/LinearProgress/index.js +2 -0
  271. package/dist/components/Link/Link.d.ts +30 -0
  272. package/dist/components/Link/Link.js +51 -0
  273. package/dist/components/Link/Link.js.map +1 -0
  274. package/dist/components/Link/index.d.ts +2 -0
  275. package/dist/components/Link/index.js +2 -0
  276. package/dist/components/Logo/index.d.ts +17 -0
  277. package/dist/components/Logo/index.js +705 -0
  278. package/dist/components/Logo/index.js.map +1 -0
  279. package/dist/components/MetricChart/MetricChart.d.ts +9 -0
  280. package/dist/components/MetricChart/MetricChart.js +42 -0
  281. package/dist/components/MetricChart/MetricChart.js.map +1 -0
  282. package/dist/components/MetricChart/formatters.d.ts +18 -0
  283. package/dist/components/MetricChart/formatters.js +34 -0
  284. package/dist/components/MetricChart/formatters.js.map +1 -0
  285. package/dist/components/MetricChart/index.d.ts +4 -0
  286. package/dist/components/MetricChart/index.js +3 -0
  287. package/dist/components/Pane/Pane.d.ts +29 -0
  288. package/dist/components/Pane/Pane.js +171 -0
  289. package/dist/components/Pane/Pane.js.map +1 -0
  290. package/dist/components/Pane/Pane.utils.d.ts +10 -0
  291. package/dist/components/Pane/Pane.utils.js +7 -0
  292. package/dist/components/Pane/Pane.utils.js.map +1 -0
  293. package/dist/components/Pane/index.d.ts +3 -0
  294. package/dist/components/Pane/index.js +3 -0
  295. package/dist/components/PlainTextEditor/hooks/useResizeTextEditor.d.ts +9 -0
  296. package/dist/components/PlainTextEditor/hooks/useResizeTextEditor.js +76 -0
  297. package/dist/components/PlainTextEditor/hooks/useResizeTextEditor.js.map +1 -0
  298. package/dist/components/PlainTextEditor/index.d.ts +18 -0
  299. package/dist/components/PlainTextEditor/index.js +71 -0
  300. package/dist/components/PlainTextEditor/index.js.map +1 -0
  301. package/dist/components/Popover/Popover.d.ts +13 -0
  302. package/dist/components/Popover/Popover.js +48 -0
  303. package/dist/components/Popover/Popover.js.map +1 -0
  304. package/dist/components/Popover/constants.d.ts +1 -0
  305. package/dist/components/Popover/constants.js +6 -0
  306. package/dist/components/Popover/constants.js.map +1 -0
  307. package/dist/components/Popover/index.d.ts +1 -0
  308. package/dist/components/Popover/index.js +2 -0
  309. package/dist/components/PortalSlot.d.ts +11 -0
  310. package/dist/components/PortalSlot.js +41 -0
  311. package/dist/components/PortalSlot.js.map +1 -0
  312. package/dist/components/ProgressBar/ProgressBar.d.ts +38 -0
  313. package/dist/components/ProgressBar/ProgressBar.js +82 -0
  314. package/dist/components/ProgressBar/ProgressBar.js.map +1 -0
  315. package/dist/components/ProgressBar/index.d.ts +2 -0
  316. package/dist/components/ProgressBar/index.js +2 -0
  317. package/dist/components/RadioButton/RadioButton.d.ts +62 -0
  318. package/dist/components/RadioButton/RadioButton.js +38 -0
  319. package/dist/components/RadioButton/RadioButton.js.map +1 -0
  320. package/dist/components/RadioButton/constants.d.ts +30 -0
  321. package/dist/components/RadioButton/constants.js +55 -0
  322. package/dist/components/RadioButton/constants.js.map +1 -0
  323. package/dist/components/RadioButton/index.d.ts +2 -0
  324. package/dist/components/RadioButton/index.js +2 -0
  325. package/dist/components/RadioCard/RadioCard.d.ts +26 -0
  326. package/dist/components/RadioCard/RadioCard.js +43 -0
  327. package/dist/components/RadioCard/RadioCard.js.map +1 -0
  328. package/dist/components/RadioCard/index.d.ts +2 -0
  329. package/dist/components/RadioCard/index.js +2 -0
  330. package/dist/components/RadioGroup/RadioGroup.d.ts +5 -0
  331. package/dist/components/RadioGroup/RadioGroup.js +17 -0
  332. package/dist/components/RadioGroup/RadioGroup.js.map +1 -0
  333. package/dist/components/RadioGroup/RadioGroupItem.d.ts +5 -0
  334. package/dist/components/RadioGroup/RadioGroupItem.js +22 -0
  335. package/dist/components/RadioGroup/RadioGroupItem.js.map +1 -0
  336. package/dist/components/RadioGroup/index.d.ts +4 -0
  337. package/dist/components/RadioGroup/index.js +3 -0
  338. package/dist/components/Select/Select.d.ts +84 -0
  339. package/dist/components/Select/Select.js +120 -0
  340. package/dist/components/Select/Select.js.map +1 -0
  341. package/dist/components/Select/SelectPrimitive.d.ts +17 -0
  342. package/dist/components/Select/SelectPrimitive.js +126 -0
  343. package/dist/components/Select/SelectPrimitive.js.map +1 -0
  344. package/dist/components/Select/index.d.ts +4 -0
  345. package/dist/components/Select/index.js +3 -0
  346. package/dist/components/Skeleton/Skeleton.d.ts +13 -0
  347. package/dist/components/Skeleton/Skeleton.js +25 -0
  348. package/dist/components/Skeleton/Skeleton.js.map +1 -0
  349. package/dist/components/Skeleton/index.d.ts +1 -0
  350. package/dist/components/Skeleton/index.js +2 -0
  351. package/dist/components/Slider/Slider.d.ts +33 -0
  352. package/dist/components/Slider/Slider.js +64 -0
  353. package/dist/components/Slider/Slider.js.map +1 -0
  354. package/dist/components/Slider/index.d.ts +2 -0
  355. package/dist/components/Slider/index.js +2 -0
  356. package/dist/components/SparkLineChart/SparkLineChart.d.ts +14 -0
  357. package/dist/components/SparkLineChart/SparkLineChart.js +112 -0
  358. package/dist/components/SparkLineChart/SparkLineChart.js.map +1 -0
  359. package/dist/components/SparkLineChart/index.d.ts +2 -0
  360. package/dist/components/SparkLineChart/index.js +2 -0
  361. package/dist/components/Spinner/Spinner.d.ts +12 -0
  362. package/dist/components/Spinner/Spinner.js +33 -0
  363. package/dist/components/Spinner/Spinner.js.map +1 -0
  364. package/dist/components/Spinner/index.d.ts +1 -0
  365. package/dist/components/Spinner/index.js +2 -0
  366. package/dist/components/SplitViewPane/SplitViewPane.d.ts +41 -0
  367. package/dist/components/SplitViewPane/SplitViewPane.js +314 -0
  368. package/dist/components/SplitViewPane/SplitViewPane.js.map +1 -0
  369. package/dist/components/SplitViewPane/SplitViewPaneHeader.d.ts +22 -0
  370. package/dist/components/SplitViewPane/SplitViewPaneHeader.js +105 -0
  371. package/dist/components/SplitViewPane/SplitViewPaneHeader.js.map +1 -0
  372. package/dist/components/SplitViewPane/index.d.ts +2 -0
  373. package/dist/components/SplitViewPane/index.js +3 -0
  374. package/dist/components/SplitViewPane/openPaneRegistry.d.ts +2 -0
  375. package/dist/components/SplitViewPane/openPaneRegistry.js +49 -0
  376. package/dist/components/SplitViewPane/openPaneRegistry.js.map +1 -0
  377. package/dist/components/Switch/Switch.d.ts +35 -0
  378. package/dist/components/Switch/Switch.js +65 -0
  379. package/dist/components/Switch/Switch.js.map +1 -0
  380. package/dist/components/Switch/index.d.ts +2 -0
  381. package/dist/components/Switch/index.js +2 -0
  382. package/dist/components/Tabs/index.d.ts +27 -0
  383. package/dist/components/Tabs/index.js +45 -0
  384. package/dist/components/Tabs/index.js.map +1 -0
  385. package/dist/components/Text/Text.d.ts +13 -0
  386. package/dist/components/Text/Text.js +58 -0
  387. package/dist/components/Text/Text.js.map +1 -0
  388. package/dist/components/Text/index.d.ts +2 -0
  389. package/dist/components/Text/index.js +2 -0
  390. package/dist/components/TextVirtualizer.d.ts +8 -0
  391. package/dist/components/TextVirtualizer.js +53 -0
  392. package/dist/components/TextVirtualizer.js.map +1 -0
  393. package/dist/components/TextWithLinks.d.ts +6 -0
  394. package/dist/components/TextWithLinks.js +61 -0
  395. package/dist/components/TextWithLinks.js.map +1 -0
  396. package/dist/components/Textarea/Textarea.d.ts +47 -0
  397. package/dist/components/Textarea/Textarea.js +150 -0
  398. package/dist/components/Textarea/Textarea.js.map +1 -0
  399. package/dist/components/Textarea/index.d.ts +2 -0
  400. package/dist/components/Textarea/index.js +2 -0
  401. package/dist/components/ThinkingState/LoadingIndicator.d.ts +19 -0
  402. package/dist/components/ThinkingState/LoadingIndicator.js +2 -0
  403. package/dist/components/ThinkingState/NOTICE +25 -0
  404. package/dist/components/ThinkingState/ThinkingState.d.ts +21 -0
  405. package/dist/components/ThinkingState/ThinkingState.js +42 -0
  406. package/dist/components/ThinkingState/ThinkingState.js.map +1 -0
  407. package/dist/components/ThinkingState/ThinkingStateTimer.d.ts +9 -0
  408. package/dist/components/ThinkingState/ThinkingStateTimer.js +43 -0
  409. package/dist/components/ThinkingState/ThinkingStateTimer.js.map +1 -0
  410. package/dist/components/ThinkingState/index.d.ts +4 -0
  411. package/dist/components/ThinkingState/index.js +3 -0
  412. package/dist/components/Toast/ToastContext.d.ts +5 -0
  413. package/dist/components/Toast/ToastContext.js +9 -0
  414. package/dist/components/Toast/ToastContext.js.map +1 -0
  415. package/dist/components/Toast/index.d.ts +13 -0
  416. package/dist/components/Toast/index.js +166 -0
  417. package/dist/components/Toast/index.js.map +1 -0
  418. package/dist/components/Toast/useToast.d.ts +3 -0
  419. package/dist/components/Toast/useToast.js +11 -0
  420. package/dist/components/Toast/useToast.js.map +1 -0
  421. package/dist/components/Tooltip/Tooltip.d.ts +19 -0
  422. package/dist/components/Tooltip/Tooltip.js +57 -0
  423. package/dist/components/Tooltip/Tooltip.js.map +1 -0
  424. package/dist/components/Tooltip/index.d.ts +3 -0
  425. package/dist/components/Tooltip/index.js +3 -0
  426. package/dist/components/TopList/TopList.d.ts +3 -0
  427. package/dist/components/TopList/TopList.js +186 -0
  428. package/dist/components/TopList/TopList.js.map +1 -0
  429. package/dist/components/TopList/TopList.types.d.ts +34 -0
  430. package/dist/components/TopList/TopList.types.js +0 -0
  431. package/dist/components/TopList/TopList.utils.d.ts +3 -0
  432. package/dist/components/TopList/TopList.utils.js +16 -0
  433. package/dist/components/TopList/TopList.utils.js.map +1 -0
  434. package/dist/components/TopList/index.d.ts +2 -0
  435. package/dist/components/TopList/index.js +2 -0
  436. package/dist/components/Typeahead/Typeahead.d.ts +5 -0
  437. package/dist/components/Typeahead/Typeahead.js +305 -0
  438. package/dist/components/Typeahead/Typeahead.js.map +1 -0
  439. package/dist/components/Typeahead/Typeahead.types.d.ts +99 -0
  440. package/dist/components/Typeahead/Typeahead.types.js +0 -0
  441. package/dist/components/Typeahead/Typeahead.utils.d.ts +25 -0
  442. package/dist/components/Typeahead/Typeahead.utils.js +73 -0
  443. package/dist/components/Typeahead/Typeahead.utils.js.map +1 -0
  444. package/dist/components/Typeahead/TypeaheadParts.d.ts +25 -0
  445. package/dist/components/Typeahead/TypeaheadParts.js +109 -0
  446. package/dist/components/Typeahead/TypeaheadParts.js.map +1 -0
  447. package/dist/components/Typeahead/TypeaheadView.d.ts +81 -0
  448. package/dist/components/Typeahead/TypeaheadView.js +228 -0
  449. package/dist/components/Typeahead/TypeaheadView.js.map +1 -0
  450. package/dist/components/Typeahead/index.d.ts +2 -0
  451. package/dist/components/Typeahead/index.js +2 -0
  452. package/dist/components/Typeahead/useTypeaheadDomSync.d.ts +15 -0
  453. package/dist/components/Typeahead/useTypeaheadDomSync.js +43 -0
  454. package/dist/components/Typeahead/useTypeaheadDomSync.js.map +1 -0
  455. package/dist/components/Typeahead/useTypeaheadUncontrolledInput.d.ts +11 -0
  456. package/dist/components/Typeahead/useTypeaheadUncontrolledInput.js +32 -0
  457. package/dist/components/Typeahead/useTypeaheadUncontrolledInput.js.map +1 -0
  458. package/dist/components/UnsavedChangesDialog.d.ts +14 -0
  459. package/dist/components/UnsavedChangesDialog.js +67 -0
  460. package/dist/components/UnsavedChangesDialog.js.map +1 -0
  461. package/dist/components/index.d.ts +58 -0
  462. package/dist/components/index.js +35 -0
  463. package/dist/components.css +102 -0
  464. package/dist/contexts/ErrorReporterContext.d.ts +6 -0
  465. package/dist/contexts/ErrorReporterContext.js +7 -0
  466. package/dist/contexts/ErrorReporterContext.js.map +1 -0
  467. package/dist/hooks/AppThemeProvider.d.ts +8 -0
  468. package/dist/hooks/AppThemeProvider.js +52 -0
  469. package/dist/hooks/AppThemeProvider.js.map +1 -0
  470. package/dist/hooks/useColorScheme.d.ts +20 -0
  471. package/dist/hooks/useColorScheme.js +50 -0
  472. package/dist/hooks/useColorScheme.js.map +1 -0
  473. package/dist/icons/LongTailPhosphorIcons.d.ts +51 -0
  474. package/dist/icons/LongTailPhosphorIcons.js +102 -0
  475. package/dist/icons/LongTailPhosphorIcons.js.map +1 -0
  476. package/dist/icons/PaddedPhosphorIcons.d.ts +17 -0
  477. package/dist/icons/PaddedPhosphorIcons.js +55 -0
  478. package/dist/icons/PaddedPhosphorIcons.js.map +1 -0
  479. package/dist/icons/WeightedPhosphorIcons.d.ts +45 -0
  480. package/dist/icons/WeightedPhosphorIcons.js +96 -0
  481. package/dist/icons/WeightedPhosphorIcons.js.map +1 -0
  482. package/dist/icons/index.d.ts +2 -0
  483. package/dist/icons/index.js +4 -0
  484. package/dist/index.d.ts +1 -0
  485. package/dist/index.js +36 -0
  486. package/dist/styles.css +10 -0
  487. package/dist/utilities.css +2 -0
  488. package/dist/utils/VirtuosoCustomScrollParentContext/index.d.ts +7 -0
  489. package/dist/utils/VirtuosoCustomScrollParentContext/index.js +15 -0
  490. package/dist/utils/VirtuosoCustomScrollParentContext/index.js.map +1 -0
  491. package/dist/utils/VirtuosoCustomScrollParentContext/useScrollParent.d.ts +4 -0
  492. package/dist/utils/VirtuosoCustomScrollParentContext/useScrollParent.js +10 -0
  493. package/dist/utils/VirtuosoCustomScrollParentContext/useScrollParent.js.map +1 -0
  494. package/dist/utils/ZIndexContext.d.ts +5 -0
  495. package/dist/utils/ZIndexContext.js +13 -0
  496. package/dist/utils/ZIndexContext.js.map +1 -0
  497. package/dist/utils/animation.d.ts +37 -0
  498. package/dist/utils/animation.js +42 -0
  499. package/dist/utils/animation.js.map +1 -0
  500. package/dist/utils/chartAxisLayout.d.ts +6 -0
  501. package/dist/utils/chartAxisLayout.js +8 -0
  502. package/dist/utils/chartAxisLayout.js.map +1 -0
  503. package/dist/utils/chartColors.d.ts +38 -0
  504. package/dist/utils/chartColors.js +78 -0
  505. package/dist/utils/chartColors.js.map +1 -0
  506. package/dist/utils/chartConstants.d.ts +10 -0
  507. package/dist/utils/chartConstants.js +15 -0
  508. package/dist/utils/chartConstants.js.map +1 -0
  509. package/dist/utils/chartValues.d.ts +2 -0
  510. package/dist/utils/chartValues.js +36 -0
  511. package/dist/utils/chartValues.js.map +1 -0
  512. package/dist/utils/clamp.d.ts +2 -0
  513. package/dist/utils/clamp.js +7 -0
  514. package/dist/utils/clamp.js.map +1 -0
  515. package/dist/utils/cn.d.ts +2 -0
  516. package/dist/utils/cn.js +191 -0
  517. package/dist/utils/cn.js.map +1 -0
  518. package/dist/utils/componentSizes.d.ts +104 -0
  519. package/dist/utils/componentSizes.js +104 -0
  520. package/dist/utils/componentSizes.js.map +1 -0
  521. package/dist/utils/controlIconSizes.d.ts +10 -0
  522. package/dist/utils/controlIconSizes.js +32 -0
  523. package/dist/utils/controlIconSizes.js.map +1 -0
  524. package/dist/utils/csp-nonce.d.ts +11 -0
  525. package/dist/utils/csp-nonce.js +17 -0
  526. package/dist/utils/csp-nonce.js.map +1 -0
  527. package/dist/utils/get-closest-scroll-parent.d.ts +1 -0
  528. package/dist/utils/get-closest-scroll-parent.js +16 -0
  529. package/dist/utils/get-closest-scroll-parent.js.map +1 -0
  530. package/dist/utils/get-color-by-string.d.ts +1 -0
  531. package/dist/utils/get-color-by-string.js +10 -0
  532. package/dist/utils/get-color-by-string.js.map +1 -0
  533. package/dist/utils/getYAxisLeftMargin.d.ts +10 -0
  534. package/dist/utils/getYAxisLeftMargin.js +20 -0
  535. package/dist/utils/getYAxisLeftMargin.js.map +1 -0
  536. package/dist/utils/icon-types.d.ts +8 -0
  537. package/dist/utils/icon-types.js +0 -0
  538. package/dist/utils/lazy-codemirror-loader.d.ts +70 -0
  539. package/dist/utils/lazy-codemirror-loader.js +79 -0
  540. package/dist/utils/lazy-codemirror-loader.js.map +1 -0
  541. package/dist/utils/merge-refs.d.ts +2 -0
  542. package/dist/utils/merge-refs.js +13 -0
  543. package/dist/utils/merge-refs.js.map +1 -0
  544. package/dist/utils/parseTextLinks.d.ts +7 -0
  545. package/dist/utils/parseTextLinks.js +46 -0
  546. package/dist/utils/parseTextLinks.js.map +1 -0
  547. package/dist/utils/prettify-error-payload.d.ts +7 -0
  548. package/dist/utils/prettify-error-payload.js +188 -0
  549. package/dist/utils/prettify-error-payload.js.map +1 -0
  550. package/dist/utils/spacing.d.ts +30 -0
  551. package/dist/utils/spacing.js +34 -0
  552. package/dist/utils/spacing.js.map +1 -0
  553. package/dist/utils/useCodeMirror.d.ts +7 -0
  554. package/dist/utils/useCodeMirror.js +28 -0
  555. package/dist/utils/useCodeMirror.js.map +1 -0
  556. package/dist/utils/useZIndex.d.ts +52 -0
  557. package/dist/utils/useZIndex.js +62 -0
  558. package/dist/utils/useZIndex.js.map +1 -0
  559. package/dist/utils/zIndices.d.ts +42 -0
  560. package/dist/utils/zIndices.js +46 -0
  561. package/dist/utils/zIndices.js.map +1 -0
  562. package/docs/DESIGN.md +134 -0
  563. package/docs/STYLES.md +568 -0
  564. package/package.json +619 -0
  565. package/tailwind.preset.cjs +738 -0
  566. package/tailwind.preset.d.cts +5 -0
@@ -0,0 +1,248 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ import "../../utils/chartConstants.js";
3
+ import { clamp } from "../../utils/clamp.js";
4
+ import { formatBarChartValue, getBarChartCategories, getBarChartLayout, getBarChartValueDomain, normalizeBarChartSeries } from "./BarChart.utils.js";
5
+ import { getCategoricalFillChartColor } from "../../utils/chartColors.js";
6
+ import { getYAxisLeftMargin } from "../../utils/getYAxisLeftMargin.js";
7
+ import { ChartLegend } from "../ChartLegend/ChartLegend.js";
8
+ import { BAR_CHART_DEFAULT_AXIS_ID, BAR_CHART_DEFAULT_GROUP_PADDING } from "./constants.js";
9
+ import { BarChartPlot } from "./BarChartPlot.js";
10
+ import { useMemo, useState } from "react";
11
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
+ import { useResizeObserver } from "@mantine/hooks";
13
+ import { scaleLinear } from "@visx/scale";
14
+ import { getStringWidth } from "@visx/text";
15
+ //#region packages/components/src/components/BarChart/BarChart.tsx
16
+ var HORIZONTAL_VALUE_TICK_LABEL_GAP = 8;
17
+ var getAxisIds = (configuredAxes, series) => {
18
+ const axisIds = Array.from(new Set(configuredAxes?.map((axis) => axis.id) ?? []));
19
+ for (const item of series) if (!axisIds.includes(item.valueAxisId)) axisIds.push(item.valueAxisId);
20
+ return axisIds.length === 0 ? [BAR_CHART_DEFAULT_AXIS_ID] : axisIds;
21
+ };
22
+ var getHorizontalValueAxisEdgeMargin = (config, bars) => {
23
+ const scale = scaleLinear({
24
+ domain: getBarChartValueDomain(bars, config.id, config.domain),
25
+ range: [0, 1],
26
+ nice: config.nice ?? config.domain == null
27
+ });
28
+ const tickValues = config.tickValues ?? scale.ticks(config.tickCount ?? 4);
29
+ const formatValue = config.formatValue ?? formatBarChartValue;
30
+ const tickLabelStyle = { fontSize: `12px` };
31
+ const maximumTickLabelWidth = Math.max(0, ...tickValues.map((value) => getStringWidth(formatValue(value), tickLabelStyle) ?? 0));
32
+ return Math.ceil(maximumTickLabelWidth / 2);
33
+ };
34
+ var getAutomaticHorizontalValueAxisTickCount = (config, bars, innerWidth) => {
35
+ const scale = scaleLinear({
36
+ domain: getBarChartValueDomain(bars, config.id, config.domain),
37
+ range: [0, innerWidth],
38
+ nice: config.nice ?? config.domain == null
39
+ });
40
+ const formatValue = config.formatValue ?? formatBarChartValue;
41
+ const tickLabelStyle = { fontSize: `12px` };
42
+ const minimumTickSpacing = Math.max(0, ...scale.ticks(4).map((value) => getStringWidth(formatValue(value), tickLabelStyle) ?? formatValue(value).length * 12)) + HORIZONTAL_VALUE_TICK_LABEL_GAP;
43
+ return Math.max(1, Math.min(4, Math.floor(innerWidth / minimumTickSpacing)));
44
+ };
45
+ var resolveAxes = (configuredAxes, bars, orientation, innerWidth, innerHeight) => {
46
+ return configuredAxes.map((config) => {
47
+ return {
48
+ ...config,
49
+ scale: scaleLinear({
50
+ domain: getBarChartValueDomain(bars, config.id, config.domain),
51
+ range: orientation === "vertical" ? [innerHeight, 0] : [0, innerWidth],
52
+ nice: config.nice ?? config.domain == null
53
+ })
54
+ };
55
+ });
56
+ };
57
+ /**
58
+ * Responsive, presentational bars for categorical and time-bucket data. Supports
59
+ * vertical or horizontal orientation, grouped or signed stacks, multiple value
60
+ * axes, threshold bands, controlled legend filtering, selection and active
61
+ * states, keyboard targets, and consumer-owned SVG slots. Bars always use
62
+ * square corners in every orientation and mode.
63
+ *
64
+ * The component is deliberately presentational: consumers retain fetching,
65
+ * sorting, Top-K/Other aggregation, formatting, tooltip content, links, frozen
66
+ * interaction state, and the loading and empty states — pair it with
67
+ * `ChartCard`, `ChartTooltip`, and `EmptyState`. Reach for `slots` before asking
68
+ * for a new prop; each slot receives the resolved scales and geometry.
69
+ *
70
+ * @example
71
+ * ```tsx
72
+ * <BarChart
73
+ * aria-label="Requests by environment"
74
+ * series={[{ id: 'prod', label: 'Production', data }]}
75
+ * selectedIds={selectedIds}
76
+ * legendProps={{ onItemClick: (item) => toggleId(item.id) }}
77
+ * />
78
+ * ```
79
+ */
80
+ var BarChart = ({ series, categoryAxis, valueAxes, mode = "grouped", orientation = "vertical", selectedIds, grid, valueBands = [], activeCategory, activeGuideBarId, activeBarId, activeLegendItemId, selectionRange, categoryPadding, plotPadding, minimumPlotWidth = 160, groupPadding = BAR_CHART_DEFAULT_GROUP_PADDING, minimumBarSize = 1, shouldAnimate = true, slots, isRendering = true, showLegend, legendProps, className, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, getBarAriaLabel, getCategoryAriaLabel, onDatumPointerDown, onDatumPointerMove, onDatumPointerOut, onDatumPointerUp, onDatumActivate, onDatumFocus, onDatumBlur, onBarPointerMove, onBarPointerOut, onBarActivate, onBarFocus, onBarBlur, ...rest }) => {
81
+ const [containerRef, dimensions] = useResizeObserver();
82
+ const [activeBuiltInLegendItemId, setActiveBuiltInLegendItemId] = useState(null);
83
+ const isVertical = orientation === "vertical";
84
+ const { displaySeries, visibleSeries, categories, bars, axisIds } = useMemo(() => {
85
+ const normalized = normalizeBarChartSeries(series);
86
+ const defaultAxisId = valueAxes?.[0]?.id ?? "bar-chart-default-axis";
87
+ const resolved = normalized.map((item, index) => ({
88
+ ...item,
89
+ color: item.color ?? (normalized.length === 1 ? "var(--chart-single-fill)" : getCategoricalFillChartColor(index)),
90
+ valueAxisId: item.valueAxisId ?? defaultAxisId,
91
+ opacity: item.opacity == null || !Number.isFinite(item.opacity) ? 1 : clamp(item.opacity, 0, 1)
92
+ }));
93
+ const visible = selectedIds == null || selectedIds.size === 0 ? resolved : resolved.filter((item) => selectedIds.has(item.id));
94
+ const allCategories = getBarChartCategories(resolved, categoryAxis?.domain);
95
+ return {
96
+ displaySeries: resolved,
97
+ visibleSeries: visible,
98
+ categories: allCategories,
99
+ bars: getBarChartLayout(visible, allCategories, mode),
100
+ axisIds: getAxisIds(valueAxes, visible)
101
+ };
102
+ }, [
103
+ series,
104
+ valueAxes,
105
+ selectedIds,
106
+ categoryAxis?.domain,
107
+ mode
108
+ ]);
109
+ const getValueAxisThickness = (config) => {
110
+ if (config?.thickness != null) return Math.max(0, config.thickness);
111
+ const labelThickness = config?.label == null ? 0 : 20;
112
+ if (!isVertical) return 32 + labelThickness;
113
+ return Math.max(48, getYAxisLeftMargin({
114
+ yDomain: getBarChartValueDomain(bars, config.id, config.domain),
115
+ formatTick: config?.formatValue ?? formatBarChartValue,
116
+ fontSize: 12,
117
+ numTicks: config?.tickCount ?? 4,
118
+ tickValues: config?.tickValues,
119
+ tickLength: 8,
120
+ nice: config?.nice ?? config?.domain == null
121
+ })) + labelThickness;
122
+ };
123
+ const configuredAxesById = new Map(valueAxes?.map((axis) => [axis.id, axis]) ?? []);
124
+ const resolvedValueAxes = axisIds.map((axisId) => {
125
+ const config = configuredAxesById.get(axisId) ?? { id: axisId };
126
+ return {
127
+ ...config,
128
+ thickness: getValueAxisThickness(config)
129
+ };
130
+ });
131
+ const primaryAxisThickness = resolvedValueAxes[0]?.thickness ?? 48;
132
+ const secondaryAxisThickness = resolvedValueAxes.slice(1).reduce((total, axis) => total + axis.thickness, 0);
133
+ const padding = {
134
+ top: Math.max(0, plotPadding?.top ?? 0),
135
+ right: Math.max(0, plotPadding?.right ?? 0),
136
+ bottom: Math.max(0, plotPadding?.bottom ?? 0),
137
+ left: Math.max(0, plotPadding?.left ?? 0)
138
+ };
139
+ const defaultCategoryAxisThickness = (isVertical ? 32 : 112) + (categoryAxis?.label == null ? 0 : 20);
140
+ const categoryAxisThickness = categoryAxis?.thickness ?? defaultCategoryAxisThickness;
141
+ const horizontalValueAxisEdgeMargin = isVertical ? 0 : Math.max(0, ...resolvedValueAxes.map((axis) => getHorizontalValueAxisEdgeMargin(axis, bars)));
142
+ const chartMargin = isVertical ? {
143
+ top: 8 + padding.top,
144
+ right: 8 + secondaryAxisThickness + padding.right,
145
+ bottom: categoryAxisThickness + padding.bottom,
146
+ left: primaryAxisThickness + padding.left
147
+ } : {
148
+ top: 8 + secondaryAxisThickness + padding.top,
149
+ right: Math.max(8, horizontalValueAxisEdgeMargin) + padding.right,
150
+ bottom: primaryAxisThickness + padding.bottom,
151
+ left: Math.max(categoryAxisThickness, horizontalValueAxisEdgeMargin) + padding.left
152
+ };
153
+ const chartWidth = dimensions.width === 0 ? 0 : Math.max(dimensions.width, chartMargin.left + chartMargin.right + Math.max(0, minimumPlotWidth));
154
+ const innerWidth = Math.max(0, chartWidth - chartMargin.left - chartMargin.right);
155
+ const innerHeight = Math.max(0, dimensions.height - chartMargin.top - chartMargin.bottom);
156
+ const axes = resolveAxes(isVertical ? resolvedValueAxes : resolvedValueAxes.map((axis) => axis.tickCount != null || axis.tickValues != null ? axis : {
157
+ ...axis,
158
+ tickCount: getAutomaticHorizontalValueAxisTickCount(axis, bars, innerWidth)
159
+ }), bars, orientation, innerWidth, innerHeight);
160
+ const legendItems = displaySeries.map((item) => ({
161
+ id: item.id,
162
+ label: item.label,
163
+ markerColor: item.color,
164
+ selected: selectedIds?.has(item.id) ?? false
165
+ }));
166
+ const hasLegend = (showLegend ?? legendItems.length > 1) && legendItems.length > 0;
167
+ const legendLayout = legendProps?.layout ?? "inline";
168
+ const plot = /* @__PURE__ */ jsx("div", {
169
+ ref: containerRef,
170
+ className: cn("relative size-full min-h-0 min-w-0 overflow-y-hidden", minimumPlotWidth <= 0 ? "overflow-x-hidden" : "overflow-x-auto"),
171
+ children: /* @__PURE__ */ jsx("div", {
172
+ className: "h-full min-h-0",
173
+ style: { width: chartWidth },
174
+ children: /* @__PURE__ */ jsx(BarChartPlot, {
175
+ width: chartWidth,
176
+ height: dimensions.height,
177
+ innerWidth,
178
+ innerHeight,
179
+ chartMargin,
180
+ categories,
181
+ series: visibleSeries,
182
+ bars,
183
+ axes,
184
+ orientation,
185
+ categoryAxis,
186
+ categoryAxisThickness,
187
+ categoryPadding: {
188
+ inner: clamp(categoryPadding?.inner ?? .2, 0, 1),
189
+ outer: clamp(categoryPadding?.outer ?? .1, 0, 1)
190
+ },
191
+ groupPadding: clamp(groupPadding, 0, .95),
192
+ minimumBarSize: Math.max(0, minimumBarSize),
193
+ shouldAnimate,
194
+ grid,
195
+ valueBands,
196
+ activeCategory,
197
+ activeGuideBarId,
198
+ activeBarId,
199
+ activeBuiltInLegendItemId: hasLegend ? activeBuiltInLegendItemId : null,
200
+ activeLegendItemId,
201
+ selectionRange,
202
+ slots,
203
+ isRendering,
204
+ "aria-label": ariaLabel,
205
+ "aria-describedby": ariaDescribedBy,
206
+ getBarAriaLabel,
207
+ getCategoryAriaLabel,
208
+ onDatumPointerDown,
209
+ onDatumPointerMove,
210
+ onDatumPointerOut,
211
+ onDatumPointerUp,
212
+ onDatumActivate,
213
+ onDatumFocus,
214
+ onDatumBlur,
215
+ onBarPointerMove,
216
+ onBarPointerOut,
217
+ onBarActivate,
218
+ onBarFocus,
219
+ onBarBlur
220
+ })
221
+ })
222
+ });
223
+ const legend = /* @__PURE__ */ jsx(ChartLegend, {
224
+ "aria-label": `${ariaLabel} legend`,
225
+ ...legendProps,
226
+ layout: legendLayout,
227
+ items: legendItems,
228
+ onItemActiveChange: (item) => {
229
+ setActiveBuiltInLegendItemId(item?.id ?? null);
230
+ legendProps?.onItemActiveChange?.(item);
231
+ }
232
+ });
233
+ return /* @__PURE__ */ jsx("div", {
234
+ className: cn("size-full min-h-0 min-w-0 @container", className),
235
+ ...rest,
236
+ children: hasLegend ? /* @__PURE__ */ jsx("div", {
237
+ className: cn("grid size-full min-h-0 min-w-0 grid-cols-1", legendLayout === "list" ? "grid-rows-[minmax(0,1fr)_minmax(0,35%)] gap-space-3 @[560px]:grid-cols-[minmax(0,1fr)_minmax(10rem,30%)] @[560px]:grid-rows-1 @[560px]:gap-space-5" : "grid-rows-[auto_minmax(0,1fr)] gap-space-2"),
238
+ children: legendLayout === "list" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [plot, /* @__PURE__ */ jsx("div", {
239
+ className: "scroll-mask-t scroll-mask-b min-h-0 min-w-0 overflow-y-auto overflow-x-hidden",
240
+ children: legend
241
+ })] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [legend, plot] })
242
+ }) : plot
243
+ });
244
+ };
245
+ //#endregion
246
+ export { BarChart };
247
+
248
+ //# sourceMappingURL=BarChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BarChart.js","names":[],"sources":["../../../src/components/BarChart/BarChart.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\n\nimport { useResizeObserver } from '@mantine/hooks';\nimport { scaleLinear } from '@visx/scale';\nimport { getStringWidth } from '@visx/text';\n\nimport {\n CHART_SINGLE_FILL_COLOR,\n getCategoricalFillChartColor,\n} from '../../utils/chartColors';\nimport {\n CHART_AXIS_LABEL_THICKNESS,\n CHART_TICK_FONT_SIZE,\n CHART_VALUE_AXIS_TICK_LENGTH,\n} from '../../utils/chartConstants';\nimport { clamp } from '../../utils/clamp';\nimport { cn } from '../../utils/cn';\nimport { getYAxisLeftMargin } from '../../utils/getYAxisLeftMargin';\nimport { ChartLegend, type ChartLegendItem } from '../ChartLegend';\nimport type {\n BarChartDisplayAxis,\n BarChartDisplaySeries,\n BarChartLayoutBar,\n BarChartOrientation,\n BarChartProps,\n BarChartValueAxis,\n} from './BarChart.types';\nimport {\n formatBarChartValue,\n getBarChartCategories,\n getBarChartLayout,\n getBarChartValueDomain,\n normalizeBarChartSeries,\n} from './BarChart.utils';\nimport { BarChartPlot } from './BarChartPlot';\nimport {\n BAR_CHART_AXIS_THICKNESS,\n BAR_CHART_DEFAULT_AXIS_ID,\n BAR_CHART_DEFAULT_CATEGORY_PADDING_INNER,\n BAR_CHART_DEFAULT_CATEGORY_PADDING_OUTER,\n BAR_CHART_DEFAULT_GROUP_PADDING,\n BAR_CHART_DEFAULT_MINIMUM_BAR_SIZE,\n BAR_CHART_DEFAULT_TICK_COUNT,\n BAR_CHART_HORIZONTAL_CATEGORY_AXIS_THICKNESS,\n BAR_CHART_MARGIN_RIGHT,\n BAR_CHART_MARGIN_TOP,\n BAR_CHART_MINIMUM_PLOT_WIDTH,\n BAR_CHART_VALUE_AXIS_THICKNESS,\n} from './constants';\n\nconst HORIZONTAL_VALUE_TICK_LABEL_GAP = 8;\n\nconst getAxisIds = (\n configuredAxes: readonly BarChartValueAxis[] | undefined,\n series: readonly BarChartDisplaySeries[]\n): readonly string[] => {\n const axisIds = Array.from(\n new Set(configuredAxes?.map((axis) => axis.id) ?? [])\n );\n for (const item of series) {\n if (!axisIds.includes(item.valueAxisId)) axisIds.push(item.valueAxisId);\n }\n return axisIds.length === 0 ? [BAR_CHART_DEFAULT_AXIS_ID] : axisIds;\n};\n\nconst getHorizontalValueAxisEdgeMargin = (\n config: BarChartValueAxis,\n bars: readonly BarChartLayoutBar[]\n) => {\n const scale = scaleLinear<number>({\n domain: getBarChartValueDomain(bars, config.id, config.domain),\n range: [0, 1],\n nice: config.nice ?? config.domain == null,\n });\n const tickValues =\n config.tickValues ??\n scale.ticks(config.tickCount ?? BAR_CHART_DEFAULT_TICK_COUNT);\n const formatValue = config.formatValue ?? formatBarChartValue;\n const tickLabelStyle = { fontSize: `${CHART_TICK_FONT_SIZE}px` };\n const maximumTickLabelWidth = Math.max(\n 0,\n ...tickValues.map(\n (value) => getStringWidth(formatValue(value), tickLabelStyle) ?? 0\n )\n );\n return Math.ceil(maximumTickLabelWidth / 2);\n};\n\nconst getAutomaticHorizontalValueAxisTickCount = (\n config: BarChartValueAxis,\n bars: readonly BarChartLayoutBar[],\n innerWidth: number\n) => {\n const scale = scaleLinear<number>({\n domain: getBarChartValueDomain(bars, config.id, config.domain),\n range: [0, innerWidth],\n nice: config.nice ?? config.domain == null,\n });\n const formatValue = config.formatValue ?? formatBarChartValue;\n const tickLabelStyle = { fontSize: `${CHART_TICK_FONT_SIZE}px` };\n const maximumTickLabelWidth = Math.max(\n 0,\n ...scale\n .ticks(BAR_CHART_DEFAULT_TICK_COUNT)\n .map(\n (value) =>\n getStringWidth(formatValue(value), tickLabelStyle) ??\n formatValue(value).length * CHART_TICK_FONT_SIZE\n )\n );\n const minimumTickSpacing =\n maximumTickLabelWidth + HORIZONTAL_VALUE_TICK_LABEL_GAP;\n\n return Math.max(\n 1,\n Math.min(\n BAR_CHART_DEFAULT_TICK_COUNT,\n Math.floor(innerWidth / minimumTickSpacing)\n )\n );\n};\n\nconst resolveAxes = (\n configuredAxes: readonly Omit<BarChartDisplayAxis, 'scale'>[],\n bars: readonly BarChartLayoutBar[],\n orientation: BarChartOrientation,\n innerWidth: number,\n innerHeight: number\n): readonly BarChartDisplayAxis[] => {\n return configuredAxes.map((config) => {\n return {\n ...config,\n scale: scaleLinear<number>({\n domain: getBarChartValueDomain(bars, config.id, config.domain),\n range: orientation === 'vertical' ? [innerHeight, 0] : [0, innerWidth],\n nice: config.nice ?? config.domain == null,\n }),\n };\n });\n};\n\n/**\n * Responsive, presentational bars for categorical and time-bucket data. Supports\n * vertical or horizontal orientation, grouped or signed stacks, multiple value\n * axes, threshold bands, controlled legend filtering, selection and active\n * states, keyboard targets, and consumer-owned SVG slots. Bars always use\n * square corners in every orientation and mode.\n *\n * The component is deliberately presentational: consumers retain fetching,\n * sorting, Top-K/Other aggregation, formatting, tooltip content, links, frozen\n * interaction state, and the loading and empty states — pair it with\n * `ChartCard`, `ChartTooltip`, and `EmptyState`. Reach for `slots` before asking\n * for a new prop; each slot receives the resolved scales and geometry.\n *\n * @example\n * ```tsx\n * <BarChart\n * aria-label=\"Requests by environment\"\n * series={[{ id: 'prod', label: 'Production', data }]}\n * selectedIds={selectedIds}\n * legendProps={{ onItemClick: (item) => toggleId(item.id) }}\n * />\n * ```\n */\nexport const BarChart = ({\n series,\n categoryAxis,\n valueAxes,\n mode = 'grouped',\n orientation = 'vertical',\n selectedIds,\n grid,\n valueBands = [],\n activeCategory,\n activeGuideBarId,\n activeBarId,\n activeLegendItemId,\n selectionRange,\n categoryPadding,\n plotPadding,\n minimumPlotWidth = BAR_CHART_MINIMUM_PLOT_WIDTH,\n groupPadding = BAR_CHART_DEFAULT_GROUP_PADDING,\n minimumBarSize = BAR_CHART_DEFAULT_MINIMUM_BAR_SIZE,\n shouldAnimate = true,\n slots,\n isRendering = true,\n showLegend,\n legendProps,\n className,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n getBarAriaLabel,\n getCategoryAriaLabel,\n onDatumPointerDown,\n onDatumPointerMove,\n onDatumPointerOut,\n onDatumPointerUp,\n onDatumActivate,\n onDatumFocus,\n onDatumBlur,\n onBarPointerMove,\n onBarPointerOut,\n onBarActivate,\n onBarFocus,\n onBarBlur,\n ...rest\n}: BarChartProps) => {\n const [containerRef, dimensions] = useResizeObserver();\n const [activeBuiltInLegendItemId, setActiveBuiltInLegendItemId] = useState<\n string | null\n >(null);\n const isVertical = orientation === 'vertical';\n\n // The data half of the pipeline is independent of the measured size, and the\n // documented tooltip pattern re-renders this component on every pointermove.\n const { displaySeries, visibleSeries, categories, bars, axisIds } =\n useMemo(() => {\n const normalized = normalizeBarChartSeries(series);\n const defaultAxisId = valueAxes?.[0]?.id ?? BAR_CHART_DEFAULT_AXIS_ID;\n const resolved: readonly BarChartDisplaySeries[] = normalized.map(\n (item, index) => ({\n ...item,\n color:\n item.color ??\n (normalized.length === 1\n ? CHART_SINGLE_FILL_COLOR\n : getCategoricalFillChartColor(index)),\n valueAxisId: item.valueAxisId ?? defaultAxisId,\n opacity:\n item.opacity == null || !Number.isFinite(item.opacity)\n ? 1\n : clamp(item.opacity, 0, 1),\n })\n );\n const visible =\n selectedIds == null || selectedIds.size === 0\n ? resolved\n : resolved.filter((item) => selectedIds.has(item.id));\n const allCategories = getBarChartCategories(\n resolved,\n categoryAxis?.domain\n );\n return {\n displaySeries: resolved,\n visibleSeries: visible,\n categories: allCategories,\n bars: getBarChartLayout(visible, allCategories, mode),\n axisIds: getAxisIds(valueAxes, visible),\n };\n }, [series, valueAxes, selectedIds, categoryAxis?.domain, mode]);\n\n // A vertical value axis is only as wide as its widest tick label needs, so\n // currency and large counts are not clipped by a fixed gutter.\n const getValueAxisThickness = (config: BarChartValueAxis) => {\n if (config?.thickness != null) return Math.max(0, config.thickness);\n const labelThickness =\n config?.label == null ? 0 : CHART_AXIS_LABEL_THICKNESS;\n if (!isVertical) return BAR_CHART_AXIS_THICKNESS + labelThickness;\n return (\n Math.max(\n BAR_CHART_VALUE_AXIS_THICKNESS,\n getYAxisLeftMargin({\n yDomain: getBarChartValueDomain(bars, config.id, config.domain),\n formatTick: config?.formatValue ?? formatBarChartValue,\n fontSize: CHART_TICK_FONT_SIZE,\n numTicks: config?.tickCount ?? BAR_CHART_DEFAULT_TICK_COUNT,\n tickValues: config?.tickValues,\n tickLength: CHART_VALUE_AXIS_TICK_LENGTH,\n nice: config?.nice ?? config?.domain == null,\n })\n ) + labelThickness\n );\n };\n const configuredAxesById = new Map(\n valueAxes?.map((axis) => [axis.id, axis]) ?? []\n );\n const resolvedValueAxes: readonly Omit<BarChartDisplayAxis, 'scale'>[] =\n axisIds.map((axisId) => {\n const config = configuredAxesById.get(axisId) ?? { id: axisId };\n return {\n ...config,\n thickness: getValueAxisThickness(config),\n };\n });\n const primaryAxisThickness =\n resolvedValueAxes[0]?.thickness ?? BAR_CHART_VALUE_AXIS_THICKNESS;\n const secondaryAxisThickness = resolvedValueAxes\n .slice(1)\n .reduce((total, axis) => total + axis.thickness, 0);\n const padding = {\n top: Math.max(0, plotPadding?.top ?? 0),\n right: Math.max(0, plotPadding?.right ?? 0),\n bottom: Math.max(0, plotPadding?.bottom ?? 0),\n left: Math.max(0, plotPadding?.left ?? 0),\n };\n const defaultCategoryAxisThickness =\n (isVertical\n ? BAR_CHART_AXIS_THICKNESS\n : BAR_CHART_HORIZONTAL_CATEGORY_AXIS_THICKNESS) +\n (categoryAxis?.label == null ? 0 : CHART_AXIS_LABEL_THICKNESS);\n const categoryAxisThickness =\n categoryAxis?.thickness ?? defaultCategoryAxisThickness;\n const horizontalValueAxisEdgeMargin = isVertical\n ? 0\n : Math.max(\n 0,\n ...resolvedValueAxes.map((axis) =>\n getHorizontalValueAxisEdgeMargin(axis, bars)\n )\n );\n const chartMargin = isVertical\n ? {\n top: BAR_CHART_MARGIN_TOP + padding.top,\n right: BAR_CHART_MARGIN_RIGHT + secondaryAxisThickness + padding.right,\n bottom: categoryAxisThickness + padding.bottom,\n left: primaryAxisThickness + padding.left,\n }\n : {\n top: BAR_CHART_MARGIN_TOP + secondaryAxisThickness + padding.top,\n right:\n Math.max(BAR_CHART_MARGIN_RIGHT, horizontalValueAxisEdgeMargin) +\n padding.right,\n bottom: primaryAxisThickness + padding.bottom,\n left:\n Math.max(categoryAxisThickness, horizontalValueAxisEdgeMargin) +\n padding.left,\n };\n const chartWidth =\n dimensions.width === 0\n ? 0\n : Math.max(\n dimensions.width,\n chartMargin.left + chartMargin.right + Math.max(0, minimumPlotWidth)\n );\n const innerWidth = Math.max(\n 0,\n chartWidth - chartMargin.left - chartMargin.right\n );\n const innerHeight = Math.max(\n 0,\n dimensions.height - chartMargin.top - chartMargin.bottom\n );\n const sizedValueAxes = isVertical\n ? resolvedValueAxes\n : resolvedValueAxes.map((axis) =>\n axis.tickCount != null || axis.tickValues != null\n ? axis\n : {\n ...axis,\n tickCount: getAutomaticHorizontalValueAxisTickCount(\n axis,\n bars,\n innerWidth\n ),\n }\n );\n const axes = resolveAxes(\n sizedValueAxes,\n bars,\n orientation,\n innerWidth,\n innerHeight\n );\n const legendItems: readonly ChartLegendItem[] = displaySeries.map((item) => ({\n id: item.id,\n label: item.label,\n markerColor: item.color,\n selected: selectedIds?.has(item.id) ?? false,\n }));\n const hasLegend =\n (showLegend ?? legendItems.length > 1) && legendItems.length > 0;\n const legendLayout = legendProps?.layout ?? 'inline';\n\n const plot = (\n <div\n ref={containerRef}\n className={cn(\n 'relative size-full min-h-0 min-w-0 overflow-y-hidden',\n minimumPlotWidth <= 0 ? 'overflow-x-hidden' : 'overflow-x-auto'\n )}\n >\n <div className=\"h-full min-h-0\" style={{ width: chartWidth }}>\n <BarChartPlot\n width={chartWidth}\n height={dimensions.height}\n innerWidth={innerWidth}\n innerHeight={innerHeight}\n chartMargin={chartMargin}\n categories={categories}\n series={visibleSeries}\n bars={bars}\n axes={axes}\n orientation={orientation}\n categoryAxis={categoryAxis}\n categoryAxisThickness={categoryAxisThickness}\n categoryPadding={{\n inner: clamp(\n categoryPadding?.inner ??\n BAR_CHART_DEFAULT_CATEGORY_PADDING_INNER,\n 0,\n 1\n ),\n outer: clamp(\n categoryPadding?.outer ??\n BAR_CHART_DEFAULT_CATEGORY_PADDING_OUTER,\n 0,\n 1\n ),\n }}\n groupPadding={clamp(groupPadding, 0, 0.95)}\n minimumBarSize={Math.max(0, minimumBarSize)}\n shouldAnimate={shouldAnimate}\n grid={grid}\n valueBands={valueBands}\n activeCategory={activeCategory}\n activeGuideBarId={activeGuideBarId}\n activeBarId={activeBarId}\n activeBuiltInLegendItemId={\n hasLegend ? activeBuiltInLegendItemId : null\n }\n activeLegendItemId={activeLegendItemId}\n selectionRange={selectionRange}\n slots={slots}\n isRendering={isRendering}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n getBarAriaLabel={getBarAriaLabel}\n getCategoryAriaLabel={getCategoryAriaLabel}\n onDatumPointerDown={onDatumPointerDown}\n onDatumPointerMove={onDatumPointerMove}\n onDatumPointerOut={onDatumPointerOut}\n onDatumPointerUp={onDatumPointerUp}\n onDatumActivate={onDatumActivate}\n onDatumFocus={onDatumFocus}\n onDatumBlur={onDatumBlur}\n onBarPointerMove={onBarPointerMove}\n onBarPointerOut={onBarPointerOut}\n onBarActivate={onBarActivate}\n onBarFocus={onBarFocus}\n onBarBlur={onBarBlur}\n />\n </div>\n </div>\n );\n\n const legend = (\n <ChartLegend\n aria-label={`${ariaLabel} legend`}\n {...legendProps}\n layout={legendLayout}\n items={legendItems}\n onItemActiveChange={(item) => {\n setActiveBuiltInLegendItemId(item?.id ?? null);\n legendProps?.onItemActiveChange?.(item);\n }}\n />\n );\n\n return (\n <div\n className={cn('size-full min-h-0 min-w-0 @container', className)}\n {...rest}\n >\n {hasLegend ? (\n <div\n className={cn(\n 'grid size-full min-h-0 min-w-0 grid-cols-1',\n legendLayout === 'list'\n ? 'grid-rows-[minmax(0,1fr)_minmax(0,35%)] gap-space-3 @[560px]:grid-cols-[minmax(0,1fr)_minmax(10rem,30%)] @[560px]:grid-rows-1 @[560px]:gap-space-5'\n : 'grid-rows-[auto_minmax(0,1fr)] gap-space-2'\n )}\n >\n {legendLayout === 'list' ? (\n <>\n {plot}\n <div className=\"scroll-mask-t scroll-mask-b min-h-0 min-w-0 overflow-y-auto overflow-x-hidden\">\n {legend}\n </div>\n </>\n ) : (\n <>\n {legend}\n {plot}\n </>\n )}\n </div>\n ) : (\n plot\n )}\n </div>\n );\n};\n"],"mappings":"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"}
@@ -0,0 +1,239 @@
1
+ import type { FocusEvent, HTMLAttributes, KeyboardEvent, PointerEvent, ReactNode } from 'react';
2
+ import type { scaleLinear } from '@visx/scale';
3
+ import type { ChartLegendProps } from '../ChartLegend/index.js';
4
+ export type BarChartCategory = string | number;
5
+ export type BarChartDataPoint = {
6
+ /** Stable ID for controlled active state and callbacks. Must be unique within the chart. */
7
+ id?: string;
8
+ category: BarChartCategory;
9
+ /** Null renders a gap rather than a zero-height bar. */
10
+ value: number | null;
11
+ /** Overrides the series color for this bar. Use a design-system CSS chart color token. */
12
+ color?: string;
13
+ /** Legend item that represents this bar. Defaults to the containing series ID. */
14
+ legendItemId?: string;
15
+ };
16
+ export type BarChartSeries = {
17
+ id: string;
18
+ label: ReactNode;
19
+ /** Plain-text series name for assistive technology. Defaults to `label` when it is text, then `id`. */
20
+ ariaLabel?: string;
21
+ data: readonly BarChartDataPoint[];
22
+ /** Use a design-system CSS chart color token. */
23
+ color?: string;
24
+ valueAxisId?: string;
25
+ /** Series opacity from 0 to 1. Defaults to 1. */
26
+ opacity?: number;
27
+ };
28
+ export type BarChartMode = 'grouped' | 'stacked';
29
+ export type BarChartOrientation = 'vertical' | 'horizontal';
30
+ export type BarChartGrid = {
31
+ /** Guides parallel to the category axis. Defaults to true. */
32
+ value?: boolean;
33
+ /** Guides through category buckets. Defaults to false. */
34
+ category?: boolean;
35
+ /** Value guides to draw. Defaults to the primary value axis tick count. */
36
+ tickCount?: number;
37
+ /** Exact value guides to draw. Overrides `tickCount`. */
38
+ tickValues?: readonly number[];
39
+ };
40
+ export type BarChartCategoryAxis = {
41
+ label?: string;
42
+ /** Explicit category order. By default, first appearance wins. */
43
+ domain?: readonly BarChartCategory[];
44
+ /** Defaults to `String(category)`. */
45
+ formatValue?: (value: BarChartCategory) => string;
46
+ tickCount?: number;
47
+ tickValues?: readonly BarChartCategory[];
48
+ /** Reserved width for horizontal charts or height for vertical charts, in pixels. */
49
+ thickness?: number;
50
+ };
51
+ export type BarChartValueAxis = {
52
+ id: string;
53
+ label?: string;
54
+ domain?: readonly [number, number];
55
+ /** Rounds the domain out to whole tick values. Defaults to true only when `domain` is omitted. */
56
+ nice?: boolean;
57
+ /** Defaults to a plain `en-US` number; pass a unit-aware formatter for cost or duration. */
58
+ formatValue?: (value: number) => string;
59
+ tickCount?: number;
60
+ tickValues?: readonly number[];
61
+ /** Reserved width for vertical charts or height for horizontal charts, in pixels. */
62
+ thickness?: number;
63
+ };
64
+ export type BarChartValueBand = {
65
+ id: string;
66
+ /** Defaults to the primary value axis. */
67
+ valueAxisId?: string;
68
+ /** Defaults to the lower edge of the axis domain. */
69
+ from?: number;
70
+ /** Defaults to the upper edge of the axis domain. */
71
+ to?: number;
72
+ /** Use a design-system CSS chart color token. */
73
+ color: string;
74
+ /** Defaults to 0.5. */
75
+ opacity?: number;
76
+ ariaLabel?: string;
77
+ };
78
+ export type BarChartSelectionRange = {
79
+ from: BarChartCategory;
80
+ to: BarChartCategory;
81
+ };
82
+ export type BarChartDisplaySeries = BarChartSeries & {
83
+ color: string;
84
+ valueAxisId: string;
85
+ opacity: number;
86
+ };
87
+ export type BarChartLayoutBar = {
88
+ id: string;
89
+ category: BarChartCategory;
90
+ value: number;
91
+ startValue: number;
92
+ endValue: number;
93
+ seriesId: string;
94
+ seriesLabel: ReactNode;
95
+ legendItemId: string;
96
+ color: string;
97
+ valueAxisId: string;
98
+ opacity: number;
99
+ groupIndex: number;
100
+ groupCount: number;
101
+ };
102
+ export type BarChartDisplayAxis = Omit<BarChartValueAxis, 'thickness'> & {
103
+ thickness: number;
104
+ scale: ReturnType<typeof scaleLinear<number>>;
105
+ };
106
+ export type BarChartInteractionBar = Pick<BarChartLayoutBar, 'id' | 'category' | 'value' | 'startValue' | 'endValue' | 'seriesId' | 'seriesLabel' | 'color' | 'valueAxisId'>;
107
+ export type BarChartInteractionDatum = {
108
+ category: BarChartCategory;
109
+ /** SVG position snapped to the category center on the category axis. */
110
+ categoryPosition: number;
111
+ /** SVG coordinates suitable for consumer-owned overlays. */
112
+ xPosition: number;
113
+ yPosition: number;
114
+ bars: readonly BarChartInteractionBar[];
115
+ };
116
+ export type BarChartRenderedBar = BarChartLayoutBar & {
117
+ x: number;
118
+ y: number;
119
+ width: number;
120
+ height: number;
121
+ baselinePosition: number;
122
+ };
123
+ export type BarChartCategoryAxisSlotProps = {
124
+ orientation: BarChartOrientation;
125
+ categories: readonly BarChartCategory[];
126
+ innerWidth: number;
127
+ innerHeight: number;
128
+ bandwidth: number;
129
+ getCategoryPosition: (category: BarChartCategory) => number | undefined;
130
+ formatValue: (category: BarChartCategory) => string;
131
+ };
132
+ export type BarChartValueAxisSlotProps = {
133
+ orientation: BarChartOrientation;
134
+ axis: BarChartValueAxis;
135
+ index: number;
136
+ innerWidth: number;
137
+ innerHeight: number;
138
+ getValuePosition: (value: number) => number;
139
+ };
140
+ export type BarChartPlotSlotProps = {
141
+ orientation: BarChartOrientation;
142
+ categories: readonly BarChartCategory[];
143
+ bars: readonly BarChartRenderedBar[];
144
+ innerWidth: number;
145
+ innerHeight: number;
146
+ bandwidth: number;
147
+ getCategoryPosition: (category: BarChartCategory) => number | undefined;
148
+ getValuePosition: (valueAxisId: string, value: number) => number | undefined;
149
+ };
150
+ export type BarChartSlots = {
151
+ /** Replaces the built-in category axis. Return SVG-compatible content. */
152
+ categoryAxis?: (props: BarChartCategoryAxisSlotProps) => ReactNode;
153
+ /** Replaces each built-in value axis. Return SVG-compatible content. */
154
+ valueAxis?: (props: BarChartValueAxisSlotProps) => ReactNode;
155
+ /** Renders SVG-compatible content beneath the bars, above the grid. */
156
+ background?: (props: BarChartPlotSlotProps) => ReactNode;
157
+ /** Renders SVG-compatible content after an individual bar. */
158
+ barLabel?: (bar: BarChartRenderedBar) => ReactNode;
159
+ /** Renders SVG-compatible content over the completed plot. */
160
+ overlay?: (props: BarChartPlotSlotProps) => ReactNode;
161
+ };
162
+ /**
163
+ * Naming and interaction hooks. Declared once so the public component and the
164
+ * plot renderer cannot drift apart.
165
+ */
166
+ export type BarChartInteractionProps = {
167
+ /** Naming a bar also makes it a keyboard target. */
168
+ getBarAriaLabel?: (bar: BarChartInteractionBar) => string | undefined;
169
+ /** Naming a category also makes its whole band a keyboard target. */
170
+ getCategoryAriaLabel?: (datum: BarChartInteractionDatum) => string | undefined;
171
+ onDatumPointerDown?: (datum: BarChartInteractionDatum, event: PointerEvent<SVGSVGElement>) => void;
172
+ onDatumPointerMove?: (datum: BarChartInteractionDatum, event: PointerEvent<SVGSVGElement>) => void;
173
+ /** Fires when the pointer leaves the plot area or the chart entirely. */
174
+ onDatumPointerOut?: () => void;
175
+ /** The raw pointer release. `onDatumActivate` is the semantic click. */
176
+ onDatumPointerUp?: (datum: BarChartInteractionDatum, event: PointerEvent<SVGSVGElement>) => void;
177
+ /** Fires for a primary pointer release or Enter/Space on a category target. */
178
+ onDatumActivate?: (datum: BarChartInteractionDatum, event: PointerEvent<SVGSVGElement> | KeyboardEvent<SVGRectElement>) => void;
179
+ onDatumFocus?: (datum: BarChartInteractionDatum, event: FocusEvent<SVGRectElement>) => void;
180
+ onDatumBlur?: (datum: BarChartInteractionDatum, event: FocusEvent<SVGRectElement>) => void;
181
+ /** Fires while the pointer is over a rendered bar. Track its ID and set `ChartTooltipRow.highlighted` on the matching tooltip row. */
182
+ onBarPointerMove?: (bar: BarChartInteractionBar, event: PointerEvent<SVGPathElement>) => void;
183
+ /** Fires when the pointer leaves a rendered bar. Clear the matching `ChartTooltipRow.highlighted` state here. */
184
+ onBarPointerOut?: () => void;
185
+ /** Fires for a primary pointer release or Enter/Space on a bar, and stops the datum-level activation. */
186
+ onBarActivate?: (bar: BarChartInteractionBar, event: PointerEvent<SVGPathElement> | KeyboardEvent<SVGPathElement>) => void;
187
+ onBarFocus?: (bar: BarChartInteractionBar, event: FocusEvent<SVGPathElement>) => void;
188
+ onBarBlur?: (bar: BarChartInteractionBar, event: FocusEvent<SVGPathElement>) => void;
189
+ };
190
+ export type BarChartProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'aria-label'> & BarChartInteractionProps & {
191
+ series: readonly BarChartSeries[];
192
+ /** Defaults to true when the chart has more than one series. */
193
+ showLegend?: boolean;
194
+ /** Forwarded to the rendered `ChartLegend`. Inert when there is no legend. */
195
+ legendProps?: Omit<ChartLegendProps, 'items'>;
196
+ categoryAxis?: BarChartCategoryAxis;
197
+ valueAxes?: readonly BarChartValueAxis[];
198
+ /** Defaults to grouped. */
199
+ mode?: BarChartMode;
200
+ /** Defaults to vertical. */
201
+ orientation?: BarChartOrientation;
202
+ /** Controlled legend filter. An empty set renders every series. */
203
+ selectedIds?: ReadonlySet<string>;
204
+ grid?: BarChartGrid;
205
+ valueBands?: readonly BarChartValueBand[];
206
+ /** Highlights one category band and draws a guide through its center. */
207
+ activeCategory?: BarChartCategory | null;
208
+ /** Draws a guide through the center of one bar. Takes precedence over `activeCategory`. */
209
+ activeGuideBarId?: string | null;
210
+ /** Emphasizes one bar and dims the rest. */
211
+ activeBarId?: string | null;
212
+ /** Emphasizes marks represented by one external legend item. Built-in legends set this automatically. */
213
+ activeLegendItemId?: string | null;
214
+ selectionRange?: BarChartSelectionRange;
215
+ /** Band-scale padding from 0 to 1. */
216
+ categoryPadding?: {
217
+ inner?: number;
218
+ outer?: number;
219
+ };
220
+ /** Additional room around the plot for consumer-owned SVG slots. */
221
+ plotPadding?: {
222
+ top?: number;
223
+ right?: number;
224
+ bottom?: number;
225
+ left?: number;
226
+ };
227
+ /** Narrowest the plot area gets before the chart scrolls. Defaults to 160; pass 0 to always fit. */
228
+ minimumPlotWidth?: number;
229
+ /** Fraction of each grouped slot reserved as a gap. Defaults to 0.08. */
230
+ groupPadding?: number;
231
+ /** Minimum visible bar length for zero or very small values. Defaults to 1. */
232
+ minimumBarSize?: number;
233
+ /** Animates the chart unless reduced motion is preferred. Defaults to true. */
234
+ shouldAnimate?: boolean;
235
+ slots?: BarChartSlots;
236
+ /** Set false to drop the marks while a parent is actively resizing. Defaults to true. */
237
+ isRendering?: boolean;
238
+ 'aria-label': string;
239
+ };
File without changes
@@ -0,0 +1,51 @@
1
+ import type { scaleBand } from '@visx/scale';
2
+ import type { BarChartCategory, BarChartDisplayAxis, BarChartDisplaySeries, BarChartInteractionBar, BarChartLayoutBar, BarChartMode, BarChartOrientation, BarChartRenderedBar, BarChartSeries } from './BarChart.types.js';
3
+ export declare const groupBarChartItemsBy: <Item>(items: readonly Item[], getKey: (item: Item) => string) => ReadonlyMap<string, Item[]>;
4
+ /** Default value-axis tick text. Consumers localize via `formatValue`. */
5
+ export declare const formatBarChartValue: (value: number) => string;
6
+ /** Categories are compared across types, so the key carries the type too. */
7
+ export declare const getCategoryKey: (category: BarChartCategory) => string;
8
+ export declare const normalizeBarChartSeries: (series: readonly BarChartSeries[]) => readonly BarChartSeries[];
9
+ export declare const getBarChartCategories: (series: readonly BarChartSeries[], configuredCategories?: readonly BarChartCategory[]) => readonly BarChartCategory[];
10
+ export declare const getBarChartLayout: (series: readonly BarChartDisplaySeries[], categories: readonly BarChartCategory[], mode: BarChartMode) => readonly BarChartLayoutBar[];
11
+ export declare const getBarChartValueDomain: (bars: readonly BarChartLayoutBar[], valueAxisId: string, configuredDomain?: readonly [number, number]) => [number, number];
12
+ /** Builds a square-cornered SVG bar outline. */
13
+ export declare const getBarPath: ({ x, y, width, height, }: {
14
+ x: number;
15
+ y: number;
16
+ width: number;
17
+ height: number;
18
+ }) => string;
19
+ export declare const toBarChartInteractionBar: (bar: BarChartLayoutBar) => BarChartInteractionBar;
20
+ /**
21
+ * Resolves each layout bar to SVG geometry.
22
+ *
23
+ * The two ends of a bar are clamped to the plot box independently, so a bar that
24
+ * runs past a configured axis domain is truncated at the edge rather than slid
25
+ * back inside it — sliding would redraw it at a value it does not have, and can
26
+ * even flip a negative bar to the positive side of the baseline. Bars therefore
27
+ * never overflow, which is also why they need no clip path and their focus rings
28
+ * stay visible.
29
+ */
30
+ export declare const getBarChartRenderedBars: ({ bars, orientation, categoryScale, axisById, groupPadding, minimumBarSize, innerWidth, innerHeight, }: {
31
+ bars: readonly BarChartLayoutBar[];
32
+ orientation: BarChartOrientation;
33
+ categoryScale: ReturnType<typeof scaleBand<BarChartCategory>>;
34
+ axisById: ReadonlyMap<string, BarChartDisplayAxis>;
35
+ groupPadding: number;
36
+ minimumBarSize: number;
37
+ innerWidth: number;
38
+ innerHeight: number;
39
+ }) => readonly BarChartRenderedBar[];
40
+ export declare const getBarChartIsBarDimmed: ({ bars, activeBuiltInLegendItemId, activeLegendItemId, activeBarId, }: {
41
+ bars: readonly BarChartRenderedBar[];
42
+ activeBuiltInLegendItemId?: string | null;
43
+ activeLegendItemId?: string | null;
44
+ activeBarId?: string | null;
45
+ }) => (bar: BarChartRenderedBar) => boolean;
46
+ type BarAnimationRange = {
47
+ start: number;
48
+ end: number;
49
+ };
50
+ export declare const getBarAnimationRanges: (bars: readonly BarChartRenderedBar[], orientation: BarChartOrientation) => ReadonlyMap<string, BarAnimationRange>;
51
+ export {};