@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 @@
1
+ {"version":3,"file":"Input.js","names":[],"sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\nimport { forwardRef, useEffect, useId, useRef, useState } from 'react';\n\nimport { useDebouncedCallback } from 'use-debounce';\n\nimport { CalendarBlankIcon } from '@phosphor-icons/react/dist/ssr/CalendarBlank';\nimport { EyeIcon } from '@phosphor-icons/react/dist/ssr/Eye';\nimport { EyeSlashIcon } from '@phosphor-icons/react/dist/ssr/EyeSlash';\nimport { PaperclipIcon } from '@phosphor-icons/react/dist/ssr/Paperclip';\n\nimport { cn } from '../../utils/cn';\nimport { CONTROL_ICON_SIZES } from '../../utils/controlIconSizes';\nimport type { IconComponent } from '../../utils/icon-types';\nimport { mergeRefs } from '../../utils/merge-refs';\nimport { Icon } from '../Icon';\nimport { IconButton } from '../IconButton';\nimport { Text } from '../Text';\nimport {\n DECORATOR_CLASSES,\n getInputContainerClasses,\n getInputElementClasses,\n INPUT_TEXT_CLASSES,\n} from './inputStyles';\nimport type { InputSize } from './inputStyles';\n\nexport type InputIconAction = Pick<\n ComponentProps<typeof IconButton>,\n 'icon' | 'label' | 'disabled' | 'tooltipProps'\n> & {\n onClick: NonNullable<ComponentProps<typeof IconButton>['onClick']>;\n};\n\nexport interface InputProps {\n /** Exact outer height. The default lg tier preserves the legacy 40px field. */\n size?: InputSize;\n variant?: 'outlined' | 'plain';\n /** Decorative icon. Input owns its size and color. */\n leftIcon?: IconComponent;\n /** Decorative icon. Input owns its size and color. */\n rightIcon?: IconComponent;\n /** Plain icon button. Takes precedence over leftIcon. */\n leftAction?: InputIconAction;\n /** Plain icon button. Takes precedence over rightIcon; precedes the password toggle. */\n rightAction?: InputIconAction;\n /** Custom content; overrides leftIcon/leftAction and the default file icon. */\n leftDecorator?: ReactNode;\n /** Custom content; overrides rightIcon/rightAction. The password toggle remains last. */\n rightDecorator?: ReactNode;\n /** Whether the input is disabled */\n disabled?: boolean;\n /** Whether the input has an error state */\n isError?: boolean;\n /** Label text displayed above the input */\n label?: string | ReactNode;\n /** Hint text displayed below the input */\n hintText?: string;\n /** Current input value */\n value?: string | null;\n /** Change handler that will be debounced */\n onChange: (\n value: string,\n event?: React.ChangeEvent<HTMLInputElement>\n ) => void;\n /** Placeholder text */\n placeholder?: string;\n /**\n * Input type. Limited to the \"text-like\" native types that share this\n * component's styled-text rendering and string value contract. `password`\n * renders a masked secret field with a show/hide toggle. `date` uses the\n * browser's native date picker; its value is a `YYYY-MM-DD` string.\n * `datetime-local` uses the native date+time picker; its value is a\n * `YYYY-MM-DDTHH:mm` string in the viewer's local time. `file` is\n * uncontrolled: read the selection from `event.target.files` on the change\n * event, and scope it with `accept`/`multiple`.\n */\n type?:\n | 'text'\n | 'email'\n | 'password'\n | 'number'\n | 'url'\n | 'date'\n | 'datetime-local'\n | 'file';\n /** Debounce delay in milliseconds (default: 300). Ignored for `type=\"file\"`. */\n debounceMs?: number;\n /** Additional CSS classes */\n className?: string;\n /** Input ID for accessibility */\n id?: string;\n /** Input name for forms */\n name?: string;\n /** Whether the field is required */\n required?: boolean;\n /** Auto focus on mount */\n autoFocus?: boolean;\n /** CSS class for the input container */\n inputContainerClassName?: string;\n /**\n * Which files the picker offers, as a comma-separated list of extensions or\n * MIME types (`'.csv,.json'`, `'image/*'`). `type=\"file\"` only. The browser\n * treats this as a filter, not a guarantee — validate the selection too.\n */\n accept?: string;\n /** Whether more than one file can be picked. `type=\"file\"` only. */\n multiple?: boolean;\n}\n\nfunction InputIconSlot({\n icon,\n action,\n size,\n disabled,\n}: {\n icon?: IconComponent;\n action?: InputIconAction;\n size: InputSize;\n disabled: boolean;\n}) {\n const isDisabled = disabled || action?.disabled;\n const colorClassName = isDisabled\n ? 'text-icon-disabled'\n : 'text-icon-secondary';\n\n return action ? (\n <IconButton\n {...action}\n color=\"secondary\"\n variant=\"plain\"\n size={CONTROL_ICON_SIZES[size].buttonSize}\n className={colorClassName}\n iconWeight=\"regular\"\n disabled={isDisabled}\n onMouseDown={(event) => event.preventDefault()}\n />\n ) : icon ? (\n <Icon\n aria-hidden\n icon={icon}\n iconClassName={CONTROL_ICON_SIZES[size].iconClassName}\n className={colorClassName}\n weight=\"regular\"\n />\n ) : null;\n}\n\nfunction FileSelection({\n size,\n fileNames,\n placeholder,\n}: {\n size: InputSize;\n fileNames: string[];\n placeholder?: string;\n}) {\n const summary =\n fileNames.length > 1 ? `${fileNames.length} files selected` : fileNames[0];\n const textClasses = INPUT_TEXT_CLASSES[size];\n\n return (\n <>\n <Text\n aria-hidden\n as=\"span\"\n className={cn(\n textClasses,\n 'min-w-0 flex-1 truncate',\n summary ? 'text-primary' : 'text-placeholder'\n )}\n >\n {summary ?? placeholder ?? 'No file selected'}\n </Text>\n <Text\n aria-hidden\n as=\"span\"\n weight=\"medium\"\n className={cn(textClasses, 'shrink-0 text-secondary')}\n >\n Browse\n </Text>\n </>\n );\n}\n\nexport const Input = forwardRef<\n HTMLInputElement,\n InputProps &\n Omit<React.InputHTMLAttributes<HTMLInputElement>, keyof InputProps>\n>(\n (\n {\n size = 'lg',\n variant = 'outlined',\n leftIcon,\n rightIcon,\n leftAction,\n rightAction,\n leftDecorator,\n rightDecorator,\n disabled = false,\n isError = false,\n label,\n hintText,\n value,\n onChange,\n placeholder,\n type = 'text',\n debounceMs = 0,\n className,\n inputContainerClassName,\n id,\n name,\n required = false,\n autoFocus = false,\n accept,\n multiple,\n 'aria-describedby': ariaDescribedBy,\n ...rest\n },\n ref\n ) => {\n const generatedId = useId();\n const inputId = id || generatedId;\n const hintTextId = `${inputId}-hint`;\n const describedBy =\n [hintText ? hintTextId : undefined, ariaDescribedBy]\n .filter(Boolean)\n .join(' ') || undefined;\n const shouldDebounce = debounceMs > 0;\n const isFileInput = type === 'file';\n const isPasswordInput = type === 'password';\n const isDateInput = type === 'date' || type === 'datetime-local';\n const [internalValue, setInternalValue] = useState(value);\n const [isPasswordVisible, setIsPasswordVisible] = useState(false);\n const [selectedFileNames, setSelectedFileNames] = useState<string[]>([]);\n const debouncedOnChange = useDebouncedCallback(onChange, debounceMs);\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (!shouldDebounce) return;\n return () => debouncedOnChange.flush();\n }, [shouldDebounce, debouncedOnChange]);\n\n // Skip the click forwarded below, which would otherwise re-enter here.\n const openFilePicker = (event: React.MouseEvent<HTMLDivElement>) => {\n const target = event.target;\n if (\n disabled ||\n (target instanceof Element &&\n target.closest(\n 'button, a, input, select, textarea, summary, [role=\"button\"], [role=\"link\"], [contenteditable=\"true\"]'\n ))\n ) {\n return;\n }\n fileInputRef.current?.click();\n };\n\n useEffect(() => {\n if (shouldDebounce) setInternalValue(value);\n }, [shouldDebounce, value]);\n\n useEffect(() => {\n if (!isPasswordInput) {\n setIsPasswordVisible(false);\n }\n }, [isPasswordInput]);\n\n useEffect(() => {\n const form = isFileInput ? fileInputRef.current?.form : null;\n if (!form) return;\n\n const clearFileSelection = () => setSelectedFileNames([]);\n form.addEventListener('reset', clearFileSelection);\n return () => form.removeEventListener('reset', clearFileSelection);\n }, [isFileInput]);\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n if (isFileInput) {\n onChange(newValue, e);\n setSelectedFileNames(\n Array.from(e.target.files ?? []).map((file) => file.name)\n );\n return;\n }\n\n if (shouldDebounce) {\n setInternalValue(newValue);\n debouncedOnChange(newValue);\n } else {\n onChange(newValue, e);\n }\n };\n\n const inputContainerClasses = getInputContainerClasses({\n size,\n variant,\n isError,\n disabled,\n className: inputContainerClassName,\n });\n\n const inputClasses = isFileInput\n ? 'sr-only'\n : getInputElementClasses({\n size,\n disabled,\n className: cn(\n isPasswordInput && !isPasswordVisible && 'text-security',\n isDateInput && [\n 'supports-[selector(input::-webkit-calendar-picker-indicator)]:[&::-webkit-calendar-picker-indicator]:size-[var(--control-icon-size)]',\n 'supports-[selector(input::-webkit-calendar-picker-indicator)]:[&::-webkit-calendar-picker-indicator]:m-0',\n 'supports-[selector(input::-webkit-calendar-picker-indicator)]:[&::-webkit-calendar-picker-indicator]:p-0',\n 'supports-[selector(input::-webkit-calendar-picker-indicator)]:[&::-webkit-calendar-picker-indicator]:opacity-0',\n ]\n ),\n });\n\n const effectiveLeftIcon =\n leftIcon ?? (isFileInput ? PaperclipIcon : undefined);\n const hasCustomLeftDecorator = leftDecorator != null;\n const hasCustomRightDecorator = rightDecorator != null;\n const effectiveLeftDecorator =\n leftDecorator ??\n (effectiveLeftIcon || leftAction ? (\n <InputIconSlot\n icon={effectiveLeftIcon}\n action={leftAction}\n size={size}\n disabled={disabled}\n />\n ) : null);\n const rightContent =\n rightDecorator ??\n (rightIcon || rightAction ? (\n <InputIconSlot\n icon={rightIcon}\n action={rightAction}\n size={size}\n disabled={disabled}\n />\n ) : null);\n // Offset only known edge buttons by their glyph inset, including the border.\n const leftActionOffset =\n !hasCustomLeftDecorator && leftAction\n ? CONTROL_ICON_SIZES[size].actionOffset\n : undefined;\n const rightActionOffset =\n isPasswordInput || (!hasCustomRightDecorator && rightAction)\n ? CONTROL_ICON_SIZES[size].actionOffset\n : undefined;\n const effectiveRightDecorator =\n rightContent || isPasswordInput ? (\n <>\n {rightContent}\n {isPasswordInput && (\n <InputIconSlot\n size={size}\n disabled={disabled}\n action={{\n icon: isPasswordVisible ? EyeSlashIcon : EyeIcon,\n label: 'toggle password visibility',\n tooltipProps: { disabled: true },\n onClick: () => setIsPasswordVisible((show) => !show),\n }}\n />\n )}\n </>\n ) : null;\n\n const nativeInput = (\n // eslint-disable-next-line react/forbid-elements\n <input\n ref={isFileInput ? mergeRefs([fileInputRef, ref]) : ref}\n id={inputId}\n name={name ?? (typeof label === 'string' ? label : undefined)}\n type={\n isPasswordInput ? (isPasswordVisible ? 'text' : 'password') : type\n }\n value={\n isFileInput\n ? undefined\n : shouldDebounce\n ? (internalValue ?? '')\n : value === null\n ? ''\n : value\n }\n onChange={handleInputChange}\n placeholder={placeholder}\n disabled={disabled}\n required={required}\n autoFocus={autoFocus}\n accept={accept}\n multiple={multiple}\n aria-describedby={describedBy}\n aria-invalid={isError || undefined}\n className={inputClasses}\n {...rest}\n />\n );\n\n return (\n <div className={cn('w-full', className)}>\n {label && (\n <Text\n as=\"label\"\n htmlFor={inputId}\n className={cn(\n 'mb-space-1 block text-sm font-medium text-primary',\n disabled && 'text-disabled'\n )}\n variant=\"xs\"\n >\n {label}\n {required && (\n <span className=\"ml-space-1 text-error-secondary\">*</span>\n )}\n </Text>\n )}\n\n <div\n className={cn(\n inputContainerClasses,\n isFileInput && !disabled && 'cursor-pointer'\n )}\n onClick={isFileInput ? openFilePicker : undefined}\n >\n {effectiveLeftDecorator && (\n <div\n className={DECORATOR_CLASSES}\n style={{ marginInlineStart: leftActionOffset }}\n >\n {effectiveLeftDecorator}\n </div>\n )}\n\n {isFileInput && (\n <FileSelection\n size={size}\n fileNames={selectedFileNames}\n placeholder={placeholder}\n />\n )}\n\n {isDateInput ? (\n <div\n className={cn(\n 'relative flex min-w-0 flex-1 items-center',\n CONTROL_ICON_SIZES[size].sizeVariableClassName\n )}\n >\n {nativeInput}\n {/* The native picker target stays interactive beneath this glyph. */}\n <span className=\"pointer-events-none absolute inset-y-0 end-0 hidden items-center supports-[selector(input::-webkit-calendar-picker-indicator)]:flex\">\n <InputIconSlot\n icon={CalendarBlankIcon}\n size={size}\n disabled={disabled}\n />\n </span>\n </div>\n ) : (\n nativeInput\n )}\n\n {effectiveRightDecorator && (\n <div\n className={cn(DECORATOR_CLASSES, 'gap-space-1')}\n style={{ marginInlineEnd: rightActionOffset }}\n >\n {effectiveRightDecorator}\n </div>\n )}\n </div>\n\n {hintText && (\n <Text\n id={hintTextId}\n className={cn(\n 'mt-space-1 text-xs',\n isError ? 'text-error-secondary' : 'text-tertiary'\n )}\n variant=\"xs\"\n weight=\"normal\"\n >\n {hintText}\n </Text>\n )}\n </div>\n );\n }\n);\n\nInput.displayName = 'Input';\n"],"mappings":";;;;;;;;;;;;;;;AA4GA,SAAS,cAAc,EACrB,MACA,QACA,MACA,YAMC;CACD,MAAM,aAAa,YAAY,QA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AAc,WAAW,KAAA;EACzB,WAAW;EACX,GAAI;CACL,CAAA;CAGH,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,UAAU,SAAS;EAAtC,UAAA;GACG,SACC,qBAAC,MAAD;IACE,IAAG;IACH,SAAS;IACT,WAAW,GACT,qDACA,YAAY,eACd;IACA,SAAQ;IAPV,UAAA,CASG,OACA,YACC,oBAAC,QAAD;KAAM,WAAU;KAAkC,UAAA;IAAO,CAAA,CAEvD;;GAGR,qBAAC,OAAD;IACE,WAAW,GACT,uBACA,eAAe,CAAC,YAAY,gBAC9B;IACA,SAAS,cAAc,iBAAiB,KAAA;IAL1C,UAAA;KAOG,0BACC,oBAAC,OAAD;MACE,WAAA;MACA,OAAO,EAAE,mBAAmB,iBAAiB;MAE5C,UAAA;KACE,CAAA;KAGN,eACC,oBAAC,eAAD;MACQ;MACN,WAAW;MACE;KACd,CAAA;KAGF,cACC,qBAAC,OAAD;MACE,WAAW,GACT,6CACA,mBAAmB,KAAK,CAAC,qBAC3B;MAJF,UAAA,CAMG,aAED,oBAAC,QAAD;OAAM,WAAU;OACd,UAAA,oBAAC,eAAD;QACE,MAAM;QACA;QACI;OACX,CAAA;MACG,CAAA,CACH;KAEL,CAAA,IAAA;KAGD,2BACC,oBAAC,OAAD;MACE,WAAW,GAAA,mCAAsB,aAAa;MAC9C,OAAO,EAAE,iBAAiB,kBAAkB;MAE3C,UAAA;KACE,CAAA;IAEJ;;GAEJ,YACC,oBAAC,MAAD;IACE,IAAI;IACJ,WAAW,GACT,sBACA,UAAU,yBAAyB,eACrC;IACA,SAAQ;IACR,QAAO;IAEN,UAAA;GACG,CAAA;EAEL;;AAET,CACF;AAEA,MAAM,cAAc"}
@@ -0,0 +1,2 @@
1
+ export { Input } from './Input.js';
2
+ export type { InputIconAction, InputProps } from './Input.js';
@@ -0,0 +1,2 @@
1
+ import { Input } from "./Input.js";
2
+ export { Input };
@@ -0,0 +1,28 @@
1
+ import { type ControlSize } from '../../utils/componentSizes.js';
2
+ export type InputSize = ControlSize;
3
+ export type InputVariant = 'outlined' | 'plain';
4
+ export declare const INPUT_HORIZONTAL_PADDING_CLASSES: Record<InputSize, string>;
5
+ export declare const INPUT_RADIUS_CLASSES: Record<InputSize, string>;
6
+ export declare const INPUT_TEXT_CLASSES: Record<InputSize, string>;
7
+ /**
8
+ * Shared styling for input containers (border, padding, rounding, variant).
9
+ * Used by both the design system Input and CommandInput.
10
+ */
11
+ export declare function getInputContainerClasses({ size, variant, isError, disabled, className, }: {
12
+ size: InputSize;
13
+ variant: InputVariant;
14
+ isError?: boolean;
15
+ disabled?: boolean;
16
+ className?: string;
17
+ }): string;
18
+ /**
19
+ * Shared styling for the inner input element (unstyled, fills container).
20
+ * Used by both the design system Input and CommandInput.
21
+ */
22
+ export declare function getInputElementClasses({ size, disabled, className, }: {
23
+ size: InputSize;
24
+ disabled?: boolean;
25
+ className?: string;
26
+ }): string;
27
+ /** Shared styling for decorator wrappers. */
28
+ export declare const DECORATOR_CLASSES = "flex items-center text-tertiary";
@@ -0,0 +1,45 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ import { CONTROL_SIZES } from "../../utils/componentSizes.js";
3
+ //#region packages/components/src/components/Input/inputStyles.ts
4
+ var INPUT_HORIZONTAL_PADDING_CLASSES = {
5
+ xs: "px-space-1",
6
+ sm: "px-space-2",
7
+ md: "px-space-3",
8
+ lg: "px-space-3"
9
+ };
10
+ var INPUT_RADIUS_CLASSES = {
11
+ xs: "rounded-xs",
12
+ sm: "rounded-sm",
13
+ md: "rounded-md",
14
+ lg: "rounded-md"
15
+ };
16
+ var INPUT_TEXT_CLASSES = {
17
+ xs: "text-xxs leading-[1.15]",
18
+ sm: "text-xs",
19
+ md: "text-sm leading-normal",
20
+ lg: "text-sm leading-normal"
21
+ };
22
+ /**
23
+ * Shared styling for input containers (border, padding, rounding, variant).
24
+ * Used by both the design system Input and CommandInput.
25
+ */
26
+ function getInputContainerClasses({ size, variant, isError = false, disabled = false, className }) {
27
+ const outlined = variant === "outlined";
28
+ return cn("box-border flex w-full items-center gap-space-2 transition-[border-color,box-shadow,background-color]", CONTROL_SIZES[size].heightClassName, INPUT_HORIZONTAL_PADDING_CLASSES[size], INPUT_RADIUS_CLASSES[size], "focus-within:outline-none", {
29
+ "border border-subtle bg-transparent": variant === "outlined",
30
+ "border border-transparent bg-surface-level-3": variant === "plain"
31
+ }, outlined && !disabled && !isError && "[&:hover:not(:focus-within)]:border-default", !isError && (outlined ? "focus-within:border-focus focus-within:shadow-[0_0_0_1px_var(--border-focus)]" : "focus-within:border-focus"), isError && (outlined ? "border-error-strong focus-within:border-error-strong focus-within:shadow-[0_0_0_1px_var(--border-error-strong)]" : "border-error-strong focus-within:border-error-strong"), disabled && "cursor-not-allowed bg-disabled opacity-50", className);
32
+ }
33
+ /**
34
+ * Shared styling for the inner input element (unstyled, fills container).
35
+ * Used by both the design system Input and CommandInput.
36
+ */
37
+ function getInputElementClasses({ size, disabled = false, className }) {
38
+ return cn("min-w-0 max-w-full flex-1 border-none bg-transparent p-0 outline-none", INPUT_TEXT_CLASSES[size], "placeholder:text-placeholder", disabled && "cursor-not-allowed", className);
39
+ }
40
+ /** Shared styling for decorator wrappers. */
41
+ var DECORATOR_CLASSES = "flex items-center text-tertiary";
42
+ //#endregion
43
+ export { DECORATOR_CLASSES, INPUT_HORIZONTAL_PADDING_CLASSES, INPUT_RADIUS_CLASSES, INPUT_TEXT_CLASSES, getInputContainerClasses, getInputElementClasses };
44
+
45
+ //# sourceMappingURL=inputStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inputStyles.js","names":[],"sources":["../../../src/components/Input/inputStyles.ts"],"sourcesContent":["import { cn } from '../../utils/cn';\nimport { CONTROL_SIZES, type ControlSize } from '../../utils/componentSizes';\n\nexport type InputSize = ControlSize;\nexport type InputVariant = 'outlined' | 'plain';\n\nexport const INPUT_HORIZONTAL_PADDING_CLASSES: Record<InputSize, string> = {\n xs: 'px-space-1',\n sm: 'px-space-2',\n md: 'px-space-3',\n lg: 'px-space-3',\n};\n\nexport const INPUT_RADIUS_CLASSES: Record<InputSize, string> = {\n xs: 'rounded-xs',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-md',\n};\n\nexport const INPUT_TEXT_CLASSES: Record<InputSize, string> = {\n xs: 'text-xxs leading-[1.15]',\n sm: 'text-xs',\n md: 'text-sm leading-normal',\n lg: 'text-sm leading-normal',\n};\n\n/**\n * Shared styling for input containers (border, padding, rounding, variant).\n * Used by both the design system Input and CommandInput.\n */\nexport function getInputContainerClasses({\n size,\n variant,\n isError = false,\n disabled = false,\n className,\n}: {\n size: InputSize;\n variant: InputVariant;\n isError?: boolean;\n disabled?: boolean;\n className?: string;\n}) {\n const outlined = variant === 'outlined';\n return cn(\n 'box-border flex w-full items-center gap-space-2 transition-[border-color,box-shadow,background-color]',\n CONTROL_SIZES[size].heightClassName,\n INPUT_HORIZONTAL_PADDING_CLASSES[size],\n INPUT_RADIUS_CLASSES[size],\n 'focus-within:outline-none',\n {\n 'border border-subtle bg-transparent': variant === 'outlined',\n 'border border-transparent bg-surface-level-3': variant === 'plain',\n },\n outlined &&\n !disabled &&\n !isError &&\n '[&:hover:not(:focus-within)]:border-default',\n !isError &&\n (outlined\n ? 'focus-within:border-focus focus-within:shadow-[0_0_0_1px_var(--border-focus)]'\n : 'focus-within:border-focus'),\n isError &&\n (outlined\n ? 'border-error-strong focus-within:border-error-strong focus-within:shadow-[0_0_0_1px_var(--border-error-strong)]'\n : 'border-error-strong focus-within:border-error-strong'),\n disabled && 'cursor-not-allowed bg-disabled opacity-50',\n className\n );\n}\n\n/**\n * Shared styling for the inner input element (unstyled, fills container).\n * Used by both the design system Input and CommandInput.\n */\nexport function getInputElementClasses({\n size,\n disabled = false,\n className,\n}: {\n size: InputSize;\n disabled?: boolean;\n className?: string;\n}) {\n return cn(\n 'min-w-0 max-w-full flex-1 border-none bg-transparent p-0 outline-none',\n INPUT_TEXT_CLASSES[size],\n 'placeholder:text-placeholder',\n disabled && 'cursor-not-allowed',\n className\n );\n}\n\n/** Shared styling for decorator wrappers. */\nexport const DECORATOR_CLASSES = 'flex items-center text-tertiary';\n"],"mappings":";;;AAMA,IAAa,mCAA8D;CACzE,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAEA,IAAa,uBAAkD;CAC7D,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAEA,IAAa,qBAAgD;CAC3D,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;;;;;AAMA,SAAgB,yBAAyB,EACvC,MACA,SACA,UAAU,OACV,WAAW,OACX,aAOC;CACD,MAAM,WAAW,YAAY;CAC7B,OAAO,GACL,yGACA,cAAc,KAAK,CAAC,iBACpB,iCAAiC,OACjC,qBAAqB,OACrB,6BACA;EACE,uCAAuC,YAAY;EACnD,gDAAgD,YAAY;CAC9D,GACA,YACE,CAAC,YACD,CAAC,WACD,+CACF,CAAC,YACE,WACG,kFACA,8BACN,YACG,WACG,oHACA,yDACN,YAAY,6CACZ,SACF;AACF;;;;;AAMA,SAAgB,uBAAuB,EACrC,MACA,WAAW,OACX,aAKC;CACD,OAAO,GACL,yEACA,mBAAmB,OACnB,gCACA,YAAY,sBACZ,SACF;AACF;;AAGA,IAAa,oBAAoB"}
@@ -0,0 +1,15 @@
1
+ interface KbdProps extends React.HTMLAttributes<HTMLElement> {
2
+ /** Color scheme. `inherit` adopts the ambient text color, for chips on colored/dark surfaces. */
3
+ variant?: 'default' | 'inherit';
4
+ /** Key content — a label string or an icon element. */
5
+ children?: React.ReactNode;
6
+ }
7
+ declare const Kbd: import("react").ForwardRefExoticComponent<KbdProps & import("react").RefAttributes<HTMLElement>>;
8
+ interface KbdGroupProps extends React.HTMLAttributes<HTMLElement> {
9
+ /** The `Kbd` chips making up the shortcut, in order. */
10
+ children?: React.ReactNode;
11
+ }
12
+ /** Groups multiple `Kbd` chips into a single keyboard shortcut, e.g. `⌘ K`. */
13
+ declare const KbdGroup: import("react").ForwardRefExoticComponent<KbdGroupProps & import("react").RefAttributes<HTMLElement>>;
14
+ export { Kbd, KbdGroup };
15
+ export type { KbdProps, KbdGroupProps };
@@ -0,0 +1,30 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ import { forwardRef, isValidElement } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region packages/components/src/components/Kbd/Kbd.tsx
5
+ var VARIANT_CLASSES = {
6
+ default: "border-subtle text-tertiary",
7
+ inherit: "border-current bg-transparent text-current"
8
+ };
9
+ var Kbd = forwardRef(({ variant = "default", className, children, ...props }, ref) => {
10
+ const isSingleGlyph = isValidElement(children) || typeof children === "string" && Array.from(children).length === 1;
11
+ return /* @__PURE__ */ jsx("kbd", {
12
+ ref,
13
+ className: cn("box-border inline-flex items-center justify-center rounded-xs border font-sans text-[0.625rem] font-medium leading-none", isSingleGlyph ? "size-4 px-0" : "h-4 min-w-4 px-space-1", VARIANT_CLASSES[variant], className),
14
+ ...props,
15
+ children
16
+ });
17
+ });
18
+ Kbd.displayName = "Kbd";
19
+ /** Groups multiple `Kbd` chips into a single keyboard shortcut, e.g. `⌘ K`. */
20
+ var KbdGroup = forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("kbd", {
21
+ ref,
22
+ className: cn("inline-flex items-center gap-space-1", className),
23
+ ...props,
24
+ children
25
+ }));
26
+ KbdGroup.displayName = "KbdGroup";
27
+ //#endregion
28
+ export { Kbd, KbdGroup };
29
+
30
+ //# sourceMappingURL=Kbd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Kbd.js","names":[],"sources":["../../../src/components/Kbd/Kbd.tsx"],"sourcesContent":["import { forwardRef, isValidElement } from 'react';\n\nimport { cn } from '../../utils/cn';\n\ninterface KbdProps extends React.HTMLAttributes<HTMLElement> {\n /** Color scheme. `inherit` adopts the ambient text color, for chips on colored/dark surfaces. */\n variant?: 'default' | 'inherit';\n /** Key content — a label string or an icon element. */\n children?: React.ReactNode;\n}\n\nconst VARIANT_CLASSES: Record<NonNullable<KbdProps['variant']>, string> = {\n default: 'border-subtle text-tertiary',\n inherit: 'border-current bg-transparent text-current',\n};\n\nconst Kbd = forwardRef<HTMLElement, KbdProps>(\n ({ variant = 'default', className, children, ...props }, ref) => {\n const isSingleGlyph =\n isValidElement(children) ||\n (typeof children === 'string' && Array.from(children).length === 1);\n\n return (\n <kbd\n ref={ref}\n className={cn(\n 'box-border inline-flex items-center justify-center rounded-xs border font-sans text-[0.625rem] font-medium leading-none',\n isSingleGlyph ? 'size-4 px-0' : 'h-4 min-w-4 px-space-1',\n VARIANT_CLASSES[variant],\n className\n )}\n {...props}\n >\n {children}\n </kbd>\n );\n }\n);\n\nKbd.displayName = 'Kbd';\n\ninterface KbdGroupProps extends React.HTMLAttributes<HTMLElement> {\n /** The `Kbd` chips making up the shortcut, in order. */\n children?: React.ReactNode;\n}\n\n/** Groups multiple `Kbd` chips into a single keyboard shortcut, e.g. `⌘ K`. */\nconst KbdGroup = forwardRef<HTMLElement, KbdGroupProps>(\n ({ className, children, ...props }, ref) => (\n <kbd\n ref={ref}\n className={cn('inline-flex items-center gap-space-1', className)}\n {...props}\n >\n {children}\n </kbd>\n )\n);\n\nKbdGroup.displayName = 'KbdGroup';\n\nexport { Kbd, KbdGroup };\nexport type { KbdProps, KbdGroupProps };\n"],"mappings":";;;;AAWA,IAAM,kBAAoE;CACxE,SAAS;CACT,SAAS;AACX;AAEA,IAAM,MAAM,YACT,EAAE,UAAU,WAAW,WAAW,UAAU,GAAG,SAAS,QAAQ;CAC/D,MAAM,gBACJ,eAAe,QAAQ,KACtB,OAAO,aAAa,YAAY,MAAM,KAAK,QAAQ,CAAC,CAAC,WAAW;CAEnE,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GACT,2HACA,gBAAgB,gBAAgB,0BAChC,gBAAgB,UAChB,SACF;EACA,GAAI;EAEH;CACE,CAAA;AAET,CACF;AAEA,IAAI,cAAc;;AAQlB,IAAM,WAAW,YACd,EAAE,WAAW,UAAU,GAAG,SAAS,QAClC,oBAAC,OAAD;CACO;CACL,WAAW,GAAG,wCAAwC,SAAS;CAC/D,GAAI;CAEH;AACE,CAAA,CAET;AAEA,SAAS,cAAc"}
@@ -0,0 +1,2 @@
1
+ export { Kbd, KbdGroup } from './Kbd.js';
2
+ export type { KbdProps, KbdGroupProps } from './Kbd.js';
@@ -0,0 +1,2 @@
1
+ import { Kbd, KbdGroup } from "./Kbd.js";
2
+ export { Kbd, KbdGroup };
@@ -0,0 +1,8 @@
1
+ import type { LineChartProps } from './LineChart.types.js';
2
+ export type { LineChartDisplayAxis, LineChartDisplaySeries, LineChartGrid, LineChartInteractionDatum, LineChartInteractionPoint, LineChartPoint, LineChartProps, LineChartSelectionRange, LineChartSeries, LineChartXScale, LineChartYBand, LineChartYAxis, } from './LineChart.types.js';
3
+ /**
4
+ * Responsive numeric line chart with nullable observations, multiple axes,
5
+ * legend filtering, configurable grids and x scales, brushing, and
6
+ * consumer-owned tooltip interactions.
7
+ */
8
+ export declare const LineChart: ({ series, yAxes, xDomain, formatXValue, xScale: xScaleType, xTickCount, xTickValues, selectedIds, showPoints, connectNulls, grid, activeX, activeLegendItemId, selectionRange, yBands, renderActiveOverlay, shouldAnimate, isRendering, showLegend, legendProps, onDatumPointerDown, onDatumPointerMove, onDatumPointerOut, onDatumPointerUp, className, ...rest }: LineChartProps) => import("react").JSX.Element;
@@ -0,0 +1,194 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ import "../../utils/chartConstants.js";
3
+ import { getCategoricalLineChartColor } from "../../utils/chartColors.js";
4
+ import { getYAxisLeftMargin } from "../../utils/getYAxisLeftMargin.js";
5
+ import { ChartLegend } from "../ChartLegend/ChartLegend.js";
6
+ import "./constants.js";
7
+ import { createLineChartXScaleAdapter, getLineChartYDomainValues, getLineSegments, getNumericDomain, normalizeLineChartSeries } from "./LineChart.utils.js";
8
+ import { LineChartPlot } from "./LineChartPlot.js";
9
+ import { useState } from "react";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { useResizeObserver } from "@mantine/hooks";
12
+ import { scaleLinear } from "@visx/scale";
13
+ //#region packages/components/src/components/LineChart/LineChart.tsx
14
+ var DEFAULT_AXIS_ID = "line-chart-default-axis";
15
+ var CHART_MARGIN_TOP = 8;
16
+ var CHART_MARGIN_BOTTOM = 28;
17
+ var CHART_MARGIN_RIGHT = 8;
18
+ var DEFAULT_STROKE_WIDTH = 2;
19
+ var NUMBER_FORMATTER = new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 });
20
+ var defaultFormatValue = (value) => NUMBER_FORMATTER.format(value);
21
+ var resolveAxisLayouts = (series, configuredAxes, xDomain, connectNulls) => {
22
+ const axisConfigs = new Map(configuredAxes?.map((axis) => [axis.id, axis]) ?? []);
23
+ const axisIds = Array.from(new Set(configuredAxes?.map((axis) => axis.id) ?? []));
24
+ for (const item of series) if (!axisIds.includes(item.yAxisId)) axisIds.push(item.yAxisId);
25
+ if (axisIds.length === 0) axisIds.push(DEFAULT_AXIS_ID);
26
+ return axisIds.map((axisId) => {
27
+ const config = axisConfigs.get(axisId) ?? { id: axisId };
28
+ const values = series.filter((item) => item.yAxisId === axisId).flatMap((item) => getLineChartYDomainValues(item.points, xDomain, connectNulls));
29
+ const domain = getNumericDomain(values, config.domain);
30
+ const nice = config.domain == null;
31
+ const tickLabelThickness = getYAxisLeftMargin({
32
+ yDomain: domain,
33
+ formatTick: config.formatValue ?? defaultFormatValue,
34
+ fontSize: 12,
35
+ numTicks: config.tickCount ?? 4,
36
+ tickValues: config.tickValues,
37
+ tickLength: 8,
38
+ nice
39
+ });
40
+ return {
41
+ config,
42
+ domain,
43
+ nice,
44
+ thickness: Math.max(64, tickLabelThickness) + (config.label == null ? 0 : 20)
45
+ };
46
+ });
47
+ };
48
+ var resolveAxes = (layouts, innerHeight) => layouts.map(({ config, domain, nice, thickness }) => ({
49
+ ...config,
50
+ thickness,
51
+ scale: scaleLinear({
52
+ domain,
53
+ range: [innerHeight, 0],
54
+ nice
55
+ })
56
+ }));
57
+ /**
58
+ * Responsive numeric line chart with nullable observations, multiple axes,
59
+ * legend filtering, configurable grids and x scales, brushing, and
60
+ * consumer-owned tooltip interactions.
61
+ */
62
+ var LineChart = ({ series, yAxes, xDomain, formatXValue = defaultFormatValue, xScale: xScaleType = "linear", xTickCount, xTickValues, selectedIds, showPoints = false, connectNulls = true, grid, activeX, activeLegendItemId, selectionRange, yBands = [], renderActiveOverlay, shouldAnimate = true, isRendering = true, showLegend, legendProps, onDatumPointerDown, onDatumPointerMove, onDatumPointerOut, onDatumPointerUp, className, ...rest }) => {
63
+ const [activeBuiltInLegendItemId, setActiveBuiltInLegendItemId] = useState(null);
64
+ const ariaProps = {
65
+ "aria-describedby": rest["aria-describedby"],
66
+ "aria-label": rest["aria-label"]
67
+ };
68
+ const rootProps = { ...rest };
69
+ delete rootProps["aria-describedby"];
70
+ delete rootProps["aria-label"];
71
+ const [containerRef, dimensions] = useResizeObserver();
72
+ const normalizedSeries = normalizeLineChartSeries(series);
73
+ const defaultAxisId = yAxes?.[0]?.id ?? DEFAULT_AXIS_ID;
74
+ const displaySeries = normalizedSeries.map((item, index) => ({
75
+ ...item,
76
+ color: item.color ?? getCategoricalLineChartColor(index),
77
+ yAxisId: item.yAxisId ?? defaultAxisId,
78
+ strokeWidth: item.strokeWidth == null || !Number.isFinite(item.strokeWidth) ? DEFAULT_STROKE_WIDTH : Math.max(0, item.strokeWidth),
79
+ opacity: item.opacity == null || !Number.isFinite(item.opacity) ? 1 : Math.min(1, Math.max(0, item.opacity)),
80
+ showActiveMarker: item.showActiveMarker ?? true
81
+ }));
82
+ const visibleSeries = selectedIds == null || selectedIds.size === 0 ? displaySeries : displaySeries.filter((item) => selectedIds.has(item.id));
83
+ const xValues = visibleSeries.flatMap((item) => item.points.map((point) => point.x));
84
+ const resolvedXDomain = getNumericDomain(xValues, xDomain);
85
+ const uniqueXValues = Array.from(new Set(xValues.filter((value) => value >= resolvedXDomain[0] && value <= resolvedXDomain[1]))).sort((left, right) => left - right);
86
+ const renderedSeries = xScaleType === "band" ? visibleSeries.map((item) => ({
87
+ ...item,
88
+ points: item.points.filter((point) => point.x >= resolvedXDomain[0] && point.x <= resolvedXDomain[1])
89
+ })) : visibleSeries;
90
+ const renderedActiveX = xScaleType !== "band" || activeX != null && activeX >= resolvedXDomain[0] && activeX <= resolvedXDomain[1] ? activeX : void 0;
91
+ const axisLayouts = resolveAxisLayouts(renderedSeries, yAxes, resolvedXDomain, connectNulls);
92
+ const chartMargin = {
93
+ top: CHART_MARGIN_TOP,
94
+ right: CHART_MARGIN_RIGHT + axisLayouts.slice(1).reduce((total, axis) => total + axis.thickness, 0),
95
+ bottom: CHART_MARGIN_BOTTOM,
96
+ left: axisLayouts[0]?.thickness ?? 64
97
+ };
98
+ const innerWidth = Math.max(0, dimensions.width - chartMargin.left - chartMargin.right);
99
+ const innerHeight = Math.max(0, dimensions.height - chartMargin.top - chartMargin.bottom);
100
+ const xScaleAdapter = createLineChartXScaleAdapter({
101
+ type: xScaleType,
102
+ domain: resolvedXDomain,
103
+ values: uniqueXValues,
104
+ width: innerWidth,
105
+ nice: xDomain == null
106
+ });
107
+ const axes = resolveAxes(axisLayouts, innerHeight);
108
+ const activeXPos = renderedActiveX == null ? null : xScaleAdapter.getPosition(renderedActiveX);
109
+ const overlayX = activeXPos != null && activeXPos >= 0 && activeXPos <= innerWidth ? chartMargin.left + activeXPos : null;
110
+ const legendItems = displaySeries.map((item) => ({
111
+ id: item.id,
112
+ label: item.label,
113
+ markerColor: item.color,
114
+ selected: selectedIds?.has(item.id) ?? false
115
+ }));
116
+ const hasLegend = (showLegend ?? legendItems.length > 1) && legendItems.length > 0;
117
+ const legendLayout = legendProps?.layout ?? "inline";
118
+ const requestedActiveLegendItemId = (hasLegend ? activeBuiltInLegendItemId : null) ?? activeLegendItemId;
119
+ const renderedActiveLegendItemId = renderedSeries.some((item) => {
120
+ if (item.id !== requestedActiveLegendItemId) return false;
121
+ const [domainMinimum, domainMaximum] = resolvedXDomain;
122
+ if (showPoints && item.points.some((point) => point.y != null && point.x >= domainMinimum && point.x <= domainMaximum)) return true;
123
+ return getLineSegments(item.points, connectNulls).some((segment) => segment.some((point, index) => {
124
+ const nextPoint = segment[index + 1];
125
+ return nextPoint != null && point.x <= domainMaximum && nextPoint.x >= domainMinimum;
126
+ }));
127
+ }) ? requestedActiveLegendItemId : null;
128
+ const showGridRows = grid === false ? false : grid?.rows ?? true;
129
+ const showGridColumns = grid === false ? false : grid?.columns ?? true;
130
+ const plot = /* @__PURE__ */ jsxs("div", {
131
+ ref: containerRef,
132
+ className: "relative size-full min-h-0 min-w-0",
133
+ children: [/* @__PURE__ */ jsx(LineChartPlot, {
134
+ width: dimensions.width,
135
+ height: dimensions.height,
136
+ innerWidth,
137
+ innerHeight,
138
+ chartMargin,
139
+ xScale: xScaleAdapter.scale,
140
+ getXPosition: xScaleAdapter.getPosition,
141
+ getXValue: xScaleAdapter.getValue,
142
+ getXRangePosition: xScaleAdapter.getRangePosition,
143
+ uniqueXValues,
144
+ axes,
145
+ series: renderedSeries,
146
+ formatXValue,
147
+ xTickCount,
148
+ xTickValues,
149
+ showPoints,
150
+ connectNulls,
151
+ showGridRows,
152
+ showGridColumns,
153
+ activeX: renderedActiveX,
154
+ activeLegendItemId: renderedActiveLegendItemId,
155
+ selectionRange,
156
+ yBands,
157
+ shouldAnimate,
158
+ isRendering,
159
+ ...ariaProps,
160
+ onDatumPointerDown,
161
+ onDatumPointerMove,
162
+ onDatumPointerOut,
163
+ onDatumPointerUp
164
+ }), renderActiveOverlay != null && overlayX != null && renderedActiveX != null && renderActiveOverlay({
165
+ xPosition: overlayX,
166
+ activeX: renderedActiveX
167
+ })]
168
+ });
169
+ const legend = /* @__PURE__ */ jsx(ChartLegend, {
170
+ "aria-label": `${ariaProps["aria-label"]} legend`,
171
+ ...legendProps,
172
+ layout: legendLayout,
173
+ items: legendItems,
174
+ onItemActiveChange: (item) => {
175
+ setActiveBuiltInLegendItemId(item?.id ?? null);
176
+ legendProps?.onItemActiveChange?.(item);
177
+ }
178
+ });
179
+ return /* @__PURE__ */ jsx("div", {
180
+ className: cn("size-full min-h-0 min-w-0 @container", className),
181
+ ...rootProps,
182
+ children: hasLegend ? /* @__PURE__ */ jsxs("div", {
183
+ 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-[minmax(0,1fr)_auto] gap-space-2"),
184
+ children: [plot, legendLayout === "list" ? /* @__PURE__ */ jsx("div", {
185
+ className: "scroll-mask-t scroll-mask-b min-h-0 min-w-0 overflow-y-auto overflow-x-hidden",
186
+ children: legend
187
+ }) : legend]
188
+ }) : plot
189
+ });
190
+ };
191
+ //#endregion
192
+ export { LineChart };
193
+
194
+ //# sourceMappingURL=LineChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LineChart.js","names":[],"sources":["../../../src/components/LineChart/LineChart.tsx"],"sourcesContent":["import { useState, type HTMLAttributes } from 'react';\n\nimport { useResizeObserver } from '@mantine/hooks';\nimport { scaleLinear } from '@visx/scale';\n\nimport { getCategoricalLineChartColor } 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 { cn } from '../../utils/cn';\nimport { getYAxisLeftMargin } from '../../utils/getYAxisLeftMargin';\nimport { ChartLegend, type ChartLegendItem } from '../ChartLegend';\nimport {\n LINE_CHART_DEFAULT_TICK_COUNT,\n LINE_CHART_VALUE_AXIS_THICKNESS,\n} from './constants';\nimport type {\n LineChartDisplayAxis,\n LineChartDisplaySeries,\n LineChartProps,\n LineChartYAxis,\n} from './LineChart.types';\nimport {\n createLineChartXScaleAdapter,\n getLineChartYDomainValues,\n getLineSegments,\n getNumericDomain,\n normalizeLineChartSeries,\n} from './LineChart.utils';\nimport { LineChartPlot } from './LineChartPlot';\n\nexport type {\n LineChartDisplayAxis,\n LineChartDisplaySeries,\n LineChartGrid,\n LineChartInteractionDatum,\n LineChartInteractionPoint,\n LineChartPoint,\n LineChartProps,\n LineChartSelectionRange,\n LineChartSeries,\n LineChartXScale,\n LineChartYBand,\n LineChartYAxis,\n} from './LineChart.types';\n\ntype LineChartAxisLayout = {\n config: LineChartYAxis;\n domain: [number, number];\n nice: boolean;\n thickness: number;\n};\n\nconst DEFAULT_AXIS_ID = 'line-chart-default-axis';\nconst CHART_MARGIN_TOP = 8;\nconst CHART_MARGIN_BOTTOM = 28;\nconst CHART_MARGIN_RIGHT = 8;\nconst DEFAULT_STROKE_WIDTH = 2;\nconst NUMBER_FORMATTER = new Intl.NumberFormat('en-US', {\n maximumFractionDigits: 2,\n});\n\nconst defaultFormatValue = (value: number) => NUMBER_FORMATTER.format(value);\n\nconst resolveAxisLayouts = (\n series: readonly LineChartDisplaySeries[],\n configuredAxes: readonly LineChartYAxis[] | undefined,\n xDomain: readonly [number, number],\n connectNulls: boolean\n): readonly LineChartAxisLayout[] => {\n const axisConfigs = new Map(\n configuredAxes?.map((axis) => [axis.id, axis]) ?? []\n );\n const axisIds = Array.from(\n new Set(configuredAxes?.map((axis) => axis.id) ?? [])\n );\n\n for (const item of series) {\n if (!axisIds.includes(item.yAxisId)) axisIds.push(item.yAxisId);\n }\n if (axisIds.length === 0) axisIds.push(DEFAULT_AXIS_ID);\n\n return axisIds.map((axisId): LineChartAxisLayout => {\n const config = axisConfigs.get(axisId) ?? { id: axisId };\n const values = series\n .filter((item) => item.yAxisId === axisId)\n .flatMap((item) =>\n getLineChartYDomainValues(item.points, xDomain, connectNulls)\n );\n const domain = getNumericDomain(values, config.domain);\n const nice = config.domain == null;\n const tickLabelThickness = getYAxisLeftMargin({\n yDomain: domain,\n formatTick: config.formatValue ?? defaultFormatValue,\n fontSize: CHART_TICK_FONT_SIZE,\n numTicks: config.tickCount ?? LINE_CHART_DEFAULT_TICK_COUNT,\n tickValues: config.tickValues,\n tickLength: CHART_VALUE_AXIS_TICK_LENGTH,\n nice,\n });\n return {\n config,\n domain,\n nice,\n thickness:\n Math.max(LINE_CHART_VALUE_AXIS_THICKNESS, tickLabelThickness) +\n (config.label == null ? 0 : CHART_AXIS_LABEL_THICKNESS),\n };\n });\n};\n\nconst resolveAxes = (\n layouts: readonly LineChartAxisLayout[],\n innerHeight: number\n): readonly LineChartDisplayAxis[] =>\n layouts.map(({ config, domain, nice, thickness }) => ({\n ...config,\n thickness,\n scale: scaleLinear<number>({\n domain,\n range: [innerHeight, 0],\n nice,\n }),\n }));\n\n/**\n * Responsive numeric line chart with nullable observations, multiple axes,\n * legend filtering, configurable grids and x scales, brushing, and\n * consumer-owned tooltip interactions.\n */\nexport const LineChart = ({\n series,\n yAxes,\n xDomain,\n formatXValue = defaultFormatValue,\n xScale: xScaleType = 'linear',\n xTickCount,\n xTickValues,\n selectedIds,\n showPoints = false,\n connectNulls = true,\n grid,\n activeX,\n activeLegendItemId,\n selectionRange,\n yBands = [],\n renderActiveOverlay,\n shouldAnimate = true,\n isRendering = true,\n showLegend,\n legendProps,\n onDatumPointerDown,\n onDatumPointerMove,\n onDatumPointerOut,\n onDatumPointerUp,\n className,\n ...rest\n}: LineChartProps) => {\n const [activeBuiltInLegendItemId, setActiveBuiltInLegendItemId] = useState<\n string | null\n >(null);\n const ariaProps = {\n 'aria-describedby': rest['aria-describedby'],\n 'aria-label': rest['aria-label'],\n };\n const rootProps: HTMLAttributes<HTMLDivElement> = { ...rest };\n delete rootProps['aria-describedby'];\n delete rootProps['aria-label'];\n\n const [containerRef, dimensions] = useResizeObserver();\n const normalizedSeries = normalizeLineChartSeries(series);\n const defaultAxisId = yAxes?.[0]?.id ?? DEFAULT_AXIS_ID;\n const displaySeries: readonly LineChartDisplaySeries[] = normalizedSeries.map(\n (item, index) => ({\n ...item,\n color: item.color ?? getCategoricalLineChartColor(index),\n yAxisId: item.yAxisId ?? defaultAxisId,\n strokeWidth:\n item.strokeWidth == null || !Number.isFinite(item.strokeWidth)\n ? DEFAULT_STROKE_WIDTH\n : Math.max(0, item.strokeWidth),\n opacity:\n item.opacity == null || !Number.isFinite(item.opacity)\n ? 1\n : Math.min(1, Math.max(0, item.opacity)),\n showActiveMarker: item.showActiveMarker ?? true,\n })\n );\n const visibleSeries =\n selectedIds == null || selectedIds.size === 0\n ? displaySeries\n : displaySeries.filter((item) => selectedIds.has(item.id));\n const xValues = visibleSeries.flatMap((item) =>\n item.points.map((point) => point.x)\n );\n const resolvedXDomain = getNumericDomain(xValues, xDomain);\n const uniqueXValues = Array.from(\n new Set(\n xValues.filter(\n (value) => value >= resolvedXDomain[0] && value <= resolvedXDomain[1]\n )\n )\n ).sort((left, right) => left - right);\n const renderedSeries =\n xScaleType === 'band'\n ? visibleSeries.map((item) => ({\n ...item,\n points: item.points.filter(\n (point) =>\n point.x >= resolvedXDomain[0] && point.x <= resolvedXDomain[1]\n ),\n }))\n : visibleSeries;\n const renderedActiveX =\n xScaleType !== 'band' ||\n (activeX != null &&\n activeX >= resolvedXDomain[0] &&\n activeX <= resolvedXDomain[1])\n ? activeX\n : undefined;\n const axisLayouts = resolveAxisLayouts(\n renderedSeries,\n yAxes,\n resolvedXDomain,\n connectNulls\n );\n const chartMargin = {\n top: CHART_MARGIN_TOP,\n right:\n CHART_MARGIN_RIGHT +\n axisLayouts.slice(1).reduce((total, axis) => total + axis.thickness, 0),\n bottom: CHART_MARGIN_BOTTOM,\n left: axisLayouts[0]?.thickness ?? LINE_CHART_VALUE_AXIS_THICKNESS,\n };\n const innerWidth = Math.max(\n 0,\n dimensions.width - chartMargin.left - chartMargin.right\n );\n const innerHeight = Math.max(\n 0,\n dimensions.height - chartMargin.top - chartMargin.bottom\n );\n const xScaleAdapter = createLineChartXScaleAdapter({\n type: xScaleType,\n domain: resolvedXDomain,\n values: uniqueXValues,\n width: innerWidth,\n nice: xDomain == null,\n });\n const axes = resolveAxes(axisLayouts, innerHeight);\n\n const activeXPos =\n renderedActiveX == null ? null : xScaleAdapter.getPosition(renderedActiveX);\n const overlayX =\n activeXPos != null && activeXPos >= 0 && activeXPos <= innerWidth\n ? chartMargin.left + activeXPos\n : null;\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 const requestedActiveLegendItemId =\n (hasLegend ? activeBuiltInLegendItemId : null) ?? activeLegendItemId;\n const renderedActiveLegendItemId = renderedSeries.some((item) => {\n if (item.id !== requestedActiveLegendItemId) return false;\n\n const [domainMinimum, domainMaximum] = resolvedXDomain;\n const hasVisiblePoint =\n showPoints &&\n item.points.some(\n (point) =>\n point.y != null &&\n point.x >= domainMinimum &&\n point.x <= domainMaximum\n );\n if (hasVisiblePoint) return true;\n\n return getLineSegments(item.points, connectNulls).some((segment) =>\n segment.some((point, index) => {\n const nextPoint = segment[index + 1];\n return (\n nextPoint != null &&\n point.x <= domainMaximum &&\n nextPoint.x >= domainMinimum\n );\n })\n );\n })\n ? requestedActiveLegendItemId\n : null;\n const showGridRows = grid === false ? false : (grid?.rows ?? true);\n const showGridColumns = grid === false ? false : (grid?.columns ?? true);\n\n const plot = (\n <div ref={containerRef} className=\"relative size-full min-h-0 min-w-0\">\n <LineChartPlot\n width={dimensions.width}\n height={dimensions.height}\n innerWidth={innerWidth}\n innerHeight={innerHeight}\n chartMargin={chartMargin}\n xScale={xScaleAdapter.scale}\n getXPosition={xScaleAdapter.getPosition}\n getXValue={xScaleAdapter.getValue}\n getXRangePosition={xScaleAdapter.getRangePosition}\n uniqueXValues={uniqueXValues}\n axes={axes}\n series={renderedSeries}\n formatXValue={formatXValue}\n xTickCount={xTickCount}\n xTickValues={xTickValues}\n showPoints={showPoints}\n connectNulls={connectNulls}\n showGridRows={showGridRows}\n showGridColumns={showGridColumns}\n activeX={renderedActiveX}\n activeLegendItemId={renderedActiveLegendItemId}\n selectionRange={selectionRange}\n yBands={yBands}\n shouldAnimate={shouldAnimate}\n isRendering={isRendering}\n {...ariaProps}\n onDatumPointerDown={onDatumPointerDown}\n onDatumPointerMove={onDatumPointerMove}\n onDatumPointerOut={onDatumPointerOut}\n onDatumPointerUp={onDatumPointerUp}\n />\n {renderActiveOverlay != null &&\n overlayX != null &&\n renderedActiveX != null &&\n renderActiveOverlay({ xPosition: overlayX, activeX: renderedActiveX })}\n </div>\n );\n\n const legend = (\n <ChartLegend\n aria-label={`${ariaProps['aria-label']} 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 {...rootProps}\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-[minmax(0,1fr)_auto] gap-space-2'\n )}\n >\n {plot}\n {legendLayout === 'list' ? (\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 legend\n )}\n </div>\n ) : (\n plot\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAuDA,IAAM,kBAAkB;AACxB,IAAM,mBAAmB;AACzB,IAAM,sBAAsB;AAC5B,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB;AAC7B,IAAM,mBAAmB,IAAI,KAAK,aAAa,SAAS,E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OAAD;GACE,WAAW,GACT,8CACA,iBAAiB,SACb,uJACA,4CACN;GANF,UAAA,CAQG,MACA,iBAAiB,SAChB,oBAAC,OAAD;IAAK,WAAU;IACZ,UAAA;GACE,CAAA,IAEL,MAEC;EAEL,CAAA,IAAA;CAEC,CAAA;AAET"}
@@ -0,0 +1,138 @@
1
+ import type { AriaAttributes, HTMLAttributes, PointerEvent, ReactNode } from 'react';
2
+ import type { scaleLinear } from '@visx/scale';
3
+ import type { ChartLegendProps } from '../ChartLegend/index.js';
4
+ export type LineChartPoint = {
5
+ x: number;
6
+ y: number | null;
7
+ };
8
+ export type LineChartSeries = {
9
+ id: string;
10
+ label: ReactNode;
11
+ /** Plain-text series name used by assistive technology. Defaults to `id`. */
12
+ 'aria-label'?: AriaAttributes['aria-label'];
13
+ points: readonly LineChartPoint[];
14
+ color?: string;
15
+ yAxisId?: string;
16
+ /** Defaults to 2. */
17
+ strokeWidth?: number;
18
+ /** SVG dash pattern such as `5 4`. */
19
+ strokeDasharray?: string;
20
+ /** Series opacity from 0 to 1. Defaults to 1. */
21
+ opacity?: number;
22
+ /** Whether the controlled crosshair draws this series' marker. Defaults to true. */
23
+ showActiveMarker?: boolean;
24
+ };
25
+ export type LineChartYAxis = {
26
+ id: string;
27
+ label?: string;
28
+ domain?: readonly [number, number];
29
+ formatValue?: (value: number) => string;
30
+ tickCount?: number;
31
+ /** Fixed y-axis and horizontal-grid tick values. */
32
+ tickValues?: readonly number[];
33
+ };
34
+ export type LineChartInteractionPoint = {
35
+ seriesId: string;
36
+ seriesLabel: ReactNode;
37
+ color: string;
38
+ value: number | null;
39
+ };
40
+ export type LineChartInteractionDatum = {
41
+ /** Nearest rendered data bucket. */
42
+ x: number;
43
+ /** Unsnapped x-domain value directly beneath the pointer. */
44
+ pointerX: number;
45
+ /** Horizontal SVG coordinate for positioning consumer-owned overlays. */
46
+ xPosition: number;
47
+ points: readonly LineChartInteractionPoint[];
48
+ };
49
+ export type LineChartXScale = 'linear' | 'band';
50
+ export type LineChartSelectionRange = {
51
+ from: number;
52
+ to: number;
53
+ };
54
+ export type LineChartGrid = {
55
+ /** Defaults to true. Grid guides are dashed. */
56
+ rows?: boolean;
57
+ /** Defaults to true. Grid guides are dashed. */
58
+ columns?: boolean;
59
+ };
60
+ export type LineChartYBand = {
61
+ id: string;
62
+ /** Defaults to the primary y axis. */
63
+ yAxisId?: string;
64
+ /** Defaults to the lower edge of the axis domain. */
65
+ from?: number;
66
+ /** Defaults to the upper edge of the axis domain. */
67
+ to?: number;
68
+ /** Use a design-system CSS color token. */
69
+ color: string;
70
+ opacity?: number;
71
+ };
72
+ export type LineChartDisplaySeries = {
73
+ id: string;
74
+ label: ReactNode;
75
+ 'aria-label'?: AriaAttributes['aria-label'];
76
+ points: readonly LineChartPoint[];
77
+ color: string;
78
+ yAxisId: string;
79
+ strokeWidth: number;
80
+ strokeDasharray?: string;
81
+ opacity: number;
82
+ showActiveMarker: boolean;
83
+ };
84
+ export type LineChartDisplayAxis = LineChartYAxis & {
85
+ thickness: number;
86
+ scale: ReturnType<typeof scaleLinear<number>>;
87
+ };
88
+ type LineChartLegendProps = Omit<ChartLegendProps, 'items'>;
89
+ type LineChartLegendConfig = {
90
+ showLegend?: true;
91
+ legendProps?: LineChartLegendProps;
92
+ } | {
93
+ showLegend: false;
94
+ legendProps?: never;
95
+ };
96
+ export type LineChartProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onPointerLeave' | 'onPointerMove' | 'onPointerOut' | 'onPointerUp' | 'aria-describedby' | 'aria-label'> & LineChartLegendConfig & {
97
+ series: readonly LineChartSeries[];
98
+ yAxes?: readonly LineChartYAxis[];
99
+ xDomain?: readonly [number, number];
100
+ formatXValue?: (value: number) => string;
101
+ /** Linear preserves elapsed distance; band spaces buckets evenly. Defaults to linear. */
102
+ xScale?: LineChartXScale;
103
+ xTickCount?: number;
104
+ xTickValues?: readonly number[];
105
+ selectedIds?: ReadonlySet<string>;
106
+ showPoints?: boolean;
107
+ /** Connects valid observations across null values. Defaults to true. */
108
+ connectNulls?: boolean;
109
+ /** Visible horizontal and vertical grid lines. Pass false to hide both. */
110
+ grid?: LineChartGrid | false;
111
+ /** Draws a crosshair and point markers at this x value. */
112
+ activeX?: number;
113
+ /** Emphasizes the series represented by one external legend item. Built-in legends set this automatically. */
114
+ activeLegendItemId?: string | null;
115
+ /** Controlled x-domain range drawn over the plot for brush selection. */
116
+ selectionRange?: LineChartSelectionRange;
117
+ /** Background ranges such as warning or threshold regions. */
118
+ yBands?: readonly LineChartYBand[];
119
+ /**
120
+ * Rendered inside the plot's relative container at the resolved activeX
121
+ * position (SVG-container-relative pixels). Only invoked when activeX is
122
+ * inside the plot bounds.
123
+ */
124
+ renderActiveOverlay?: (info: {
125
+ xPosition: number;
126
+ activeX: number;
127
+ }) => ReactNode;
128
+ /** Animates the chart unless reduced motion is preferred. Defaults to true. */
129
+ shouldAnimate?: boolean;
130
+ isRendering?: boolean;
131
+ 'aria-describedby'?: AriaAttributes['aria-describedby'];
132
+ 'aria-label': string;
133
+ onDatumPointerMove?: (datum: LineChartInteractionDatum, event: PointerEvent<SVGSVGElement>) => void;
134
+ onDatumPointerDown?: (datum: LineChartInteractionDatum, event: PointerEvent<SVGSVGElement>) => void;
135
+ onDatumPointerOut?: () => void;
136
+ onDatumPointerUp?: (datum: LineChartInteractionDatum, event: PointerEvent<SVGSVGElement>) => void;
137
+ };
138
+ export {};
File without changes
@@ -0,0 +1,29 @@
1
+ import { scaleBand, scaleLinear } from '@visx/scale';
2
+ import type { LineChartPoint, LineChartSeries, LineChartXScale } from './LineChart.types.js';
3
+ export type NormalizedLineChartSeries = Omit<LineChartSeries, 'points'> & {
4
+ points: readonly LineChartPoint[];
5
+ };
6
+ type CreateLineChartXScaleAdapterArgs = {
7
+ type: LineChartXScale;
8
+ domain: readonly [number, number];
9
+ values: readonly number[];
10
+ width: number;
11
+ nice: boolean;
12
+ };
13
+ export type LineChartScale = ReturnType<typeof scaleBand<number>> | ReturnType<typeof scaleLinear<number>>;
14
+ export type LineChartXScaleAdapter = {
15
+ scale: LineChartScale;
16
+ getPosition: (value: number) => number;
17
+ getValue: (position: number) => number;
18
+ getRangePosition: (value: number) => number;
19
+ };
20
+ export declare const getSelectionBounds: (start: number | null, end: number | null, maximum: number) => {
21
+ x: number;
22
+ width: number;
23
+ } | null;
24
+ export declare const createLineChartXScaleAdapter: ({ type, domain, values, width, nice, }: CreateLineChartXScaleAdapterArgs) => LineChartXScaleAdapter;
25
+ export declare const getNumericDomain: (values: readonly number[], configuredDomain?: readonly [number, number]) => [number, number];
26
+ export declare const normalizeLineChartSeries: (series: readonly LineChartSeries[]) => readonly NormalizedLineChartSeries[];
27
+ export declare const getLineSegments: (points: readonly LineChartPoint[], connectNulls?: boolean) => readonly LineChartPoint[][];
28
+ export declare const getLineChartYDomainValues: (points: readonly LineChartPoint[], domain: readonly [number, number], connectNulls?: boolean) => number[];
29
+ export {};