@galaxy-io/dls 1.2.7 → 1.3.1

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 (305) hide show
  1. package/README.md +2 -0
  2. package/dist/avatar/Avatar.d.ts +2 -1
  3. package/dist/avatar/Avatar.js +103 -14
  4. package/dist/buttons/Button.d.ts +6 -1
  5. package/dist/buttons/Button.js +8 -4
  6. package/dist/charts/BarChart.d.ts +30 -20
  7. package/dist/charts/BarChart.js +183 -253
  8. package/dist/charts/ChartAxis.d.ts +47 -22
  9. package/dist/charts/ChartAxis.js +81 -60
  10. package/dist/charts/ChartCategoryTargets.d.ts +27 -0
  11. package/dist/charts/ChartCategoryTargets.js +75 -0
  12. package/dist/charts/ChartEmptyState.d.ts +17 -0
  13. package/dist/charts/ChartEmptyState.js +29 -0
  14. package/dist/charts/ChartFrame.d.ts +110 -0
  15. package/dist/charts/ChartFrame.js +143 -0
  16. package/dist/charts/ChartLegend.d.ts +27 -4
  17. package/dist/charts/ChartLegend.js +46 -23
  18. package/dist/charts/ChartPrimitives.d.ts +230 -0
  19. package/dist/charts/ChartPrimitives.js +305 -0
  20. package/dist/charts/ChartTooltip.d.ts +25 -4
  21. package/dist/charts/ChartTooltip.js +55 -49
  22. package/dist/charts/LineChart.d.ts +42 -20
  23. package/dist/charts/LineChart.js +175 -241
  24. package/dist/charts/PieChart.d.ts +48 -32
  25. package/dist/charts/PieChart.js +180 -170
  26. package/dist/charts/barChartGeometry.d.ts +120 -0
  27. package/dist/charts/barChartGeometry.js +210 -0
  28. package/dist/charts/barChartLegend.d.ts +25 -0
  29. package/dist/charts/barChartLegend.js +23 -0
  30. package/dist/charts/chartFormat.d.ts +27 -0
  31. package/dist/charts/chartFormat.js +71 -0
  32. package/dist/charts/chartScales.d.ts +120 -0
  33. package/dist/charts/chartScales.js +165 -0
  34. package/dist/charts/chartTheme.d.ts +18 -0
  35. package/dist/charts/chartTheme.js +26 -0
  36. package/dist/charts/constants.d.ts +241 -18
  37. package/dist/charts/constants.js +261 -32
  38. package/dist/charts/lineChartGeometry.d.ts +92 -0
  39. package/dist/charts/lineChartGeometry.js +134 -0
  40. package/dist/charts/pieChartGeometry.d.ts +60 -0
  41. package/dist/charts/pieChartGeometry.js +79 -0
  42. package/dist/charts/types.d.ts +428 -54
  43. package/dist/charts/types.js +155 -0
  44. package/dist/charts/useCartesianChartLayout.d.ts +70 -0
  45. package/dist/charts/useCartesianChartLayout.js +56 -0
  46. package/dist/charts/useChartDimensions.d.ts +47 -0
  47. package/dist/charts/useChartDimensions.js +63 -0
  48. package/dist/charts/useChartFormatters.d.ts +19 -0
  49. package/dist/charts/useChartFormatters.js +20 -0
  50. package/dist/charts/useChartInteraction.d.ts +76 -0
  51. package/dist/charts/useChartInteraction.js +126 -0
  52. package/dist/charts/useChartTooltipPosition.d.ts +53 -0
  53. package/dist/charts/useChartTooltipPosition.js +39 -0
  54. package/dist/charts/useSeriesColorResolver.d.ts +37 -0
  55. package/dist/charts/useSeriesColorResolver.js +27 -0
  56. package/dist/hooks/useElementClientSize.d.ts +20 -0
  57. package/dist/hooks/useElementClientSize.js +43 -0
  58. package/dist/inputs/CheckboxInput.d.ts +7 -2
  59. package/dist/inputs/CheckboxInput.js +30 -14
  60. package/dist/inputs/Input.d.ts +1 -1
  61. package/dist/inputs/Input.js +6 -2
  62. package/dist/inputs/MultiSelectInput.js +1 -1
  63. package/dist/inputs/RadioInput.js +7 -2
  64. package/dist/styles.css +69 -74
  65. package/dist/table/InfiniteSpreadsheet.d.ts +6 -0
  66. package/dist/table/InfiniteSpreadsheet.js +235 -0
  67. package/dist/table/InfiniteTable.d.ts +7 -88
  68. package/dist/table/InfiniteTable.js +366 -577
  69. package/dist/{spreadsheet → table}/SpreadsheetCell.d.ts +6 -4
  70. package/dist/table/SpreadsheetCell.js +71 -0
  71. package/dist/{spreadsheet → table}/SpreadsheetCellEditor.js +27 -21
  72. package/dist/table/SpreadsheetHeaderCell.d.ts +23 -0
  73. package/dist/table/SpreadsheetHeaderCell.js +91 -0
  74. package/dist/table/SpreadsheetMenuItem.d.ts +14 -0
  75. package/dist/table/SpreadsheetMenuItem.js +33 -0
  76. package/dist/table/SpreadsheetPrimitives.d.ts +172 -0
  77. package/dist/table/SpreadsheetPrimitives.js +105 -0
  78. package/dist/table/SpreadsheetRow.d.ts +33 -0
  79. package/dist/table/SpreadsheetRow.js +73 -0
  80. package/dist/{spreadsheet → table}/SpreadsheetRowActionCell.d.ts +5 -7
  81. package/dist/table/SpreadsheetRowActionCell.js +51 -0
  82. package/dist/table/TableExpandCell.d.ts +11 -0
  83. package/dist/table/TableExpandCell.js +24 -0
  84. package/dist/table/TableExpandedRow.d.ts +16 -0
  85. package/dist/table/TableExpandedRow.js +77 -0
  86. package/dist/table/TableHeaderCellContent.d.ts +30 -0
  87. package/dist/table/TableHeaderCellContent.js +48 -0
  88. package/dist/table/TablePrimitives.d.ts +307 -0
  89. package/dist/table/TablePrimitives.js +298 -0
  90. package/dist/table/TableSelectCell.d.ts +18 -0
  91. package/dist/table/TableSelectCell.js +26 -0
  92. package/dist/table/TableStatusRow.d.ts +18 -0
  93. package/dist/table/TableStatusRow.js +50 -0
  94. package/dist/table/VirtualizedInfiniteTable.d.ts +11 -27
  95. package/dist/table/VirtualizedInfiniteTable.js +182 -317
  96. package/dist/table/types.d.ts +249 -0
  97. package/dist/table/types.js +51 -0
  98. package/dist/table/useInfiniteScrollSentinel.d.ts +24 -0
  99. package/dist/table/useInfiniteScrollSentinel.js +53 -0
  100. package/dist/{spreadsheet/hooks → table}/useSpreadsheetEditing.d.ts +1 -1
  101. package/dist/{spreadsheet/hooks → table}/useSpreadsheetEditing.js +1 -1
  102. package/dist/table/useTableColumnLayout.d.ts +28 -0
  103. package/dist/table/useTableColumnLayout.js +63 -0
  104. package/dist/table/useTableColumnResize.d.ts +38 -0
  105. package/dist/table/useTableColumnResize.js +155 -0
  106. package/dist/table/useTableKeyboardNavigation.d.ts +25 -0
  107. package/dist/table/useTableKeyboardNavigation.js +83 -0
  108. package/dist/table/useTableRowExpansion.d.ts +24 -0
  109. package/dist/table/useTableRowExpansion.js +62 -0
  110. package/dist/table/useTableRowSelection.d.ts +27 -0
  111. package/dist/table/useTableRowSelection.js +94 -0
  112. package/dist/table/utils.d.ts +50 -0
  113. package/dist/table/utils.js +78 -0
  114. package/dist/text/MarkdownText.js +45 -27
  115. package/dist/theme/variants/dark.js +1 -1
  116. package/dist/widget/Widget.d.ts +2 -0
  117. package/dist/widget/Widget.js +14 -7
  118. package/package.json +1 -5
  119. package/dist/assets/components/enrichment/PerplexityIcon.d.ts +0 -3
  120. package/dist/assets/components/enrichment/PerplexityIcon.js +0 -35
  121. package/dist/assets/components/enrichment/TavilyIcon.d.ts +0 -3
  122. package/dist/assets/components/enrichment/TavilyIcon.js +0 -15
  123. package/dist/assets/components/onboarding/TenantSetupDark.d.ts +0 -3
  124. package/dist/assets/components/onboarding/TenantSetupDark.js +0 -498
  125. package/dist/assets/components/onboarding/TenantSetupLight.d.ts +0 -3
  126. package/dist/assets/components/onboarding/TenantSetupLight.js +0 -482
  127. package/dist/assets/components/onboarding/UserSetupDark.d.ts +0 -3
  128. package/dist/assets/components/onboarding/UserSetupDark.js +0 -1086
  129. package/dist/assets/components/onboarding/UserSetupLight.d.ts +0 -3
  130. package/dist/assets/components/onboarding/UserSetupLight.js +0 -1024
  131. package/dist/assets/components/onboarding/WorkspaceSetupBuildDark.d.ts +0 -3
  132. package/dist/assets/components/onboarding/WorkspaceSetupBuildDark.js +0 -466
  133. package/dist/assets/components/onboarding/WorkspaceSetupBuildLight.d.ts +0 -3
  134. package/dist/assets/components/onboarding/WorkspaceSetupBuildLight.js +0 -460
  135. package/dist/assets/components/onboarding/WorkspaceSetupConnectDark.d.ts +0 -3
  136. package/dist/assets/components/onboarding/WorkspaceSetupConnectDark.js +0 -336
  137. package/dist/assets/components/onboarding/WorkspaceSetupConnectLight.d.ts +0 -3
  138. package/dist/assets/components/onboarding/WorkspaceSetupConnectLight.js +0 -336
  139. package/dist/assets/components/onboarding/WorkspaceSetupIntegrateDark.d.ts +0 -3
  140. package/dist/assets/components/onboarding/WorkspaceSetupIntegrateDark.js +0 -153
  141. package/dist/assets/components/onboarding/WorkspaceSetupIntegrateLight.d.ts +0 -3
  142. package/dist/assets/components/onboarding/WorkspaceSetupIntegrateLight.js +0 -153
  143. package/dist/assets/components/projects/MappingMethodAutoIntrospectDark.d.ts +0 -3
  144. package/dist/assets/components/projects/MappingMethodAutoIntrospectDark.js +0 -117
  145. package/dist/assets/components/projects/MappingMethodAutoIntrospectLight.d.ts +0 -3
  146. package/dist/assets/components/projects/MappingMethodAutoIntrospectLight.js +0 -117
  147. package/dist/assets/components/projects/MappingMethodBlankDark.d.ts +0 -3
  148. package/dist/assets/components/projects/MappingMethodBlankDark.js +0 -150
  149. package/dist/assets/components/projects/MappingMethodBlankDarkHovered.d.ts +0 -3
  150. package/dist/assets/components/projects/MappingMethodBlankDarkHovered.js +0 -150
  151. package/dist/assets/components/projects/MappingMethodBlankLight.d.ts +0 -3
  152. package/dist/assets/components/projects/MappingMethodBlankLight.js +0 -150
  153. package/dist/assets/components/projects/MappingMethodBlankLightHovered.d.ts +0 -3
  154. package/dist/assets/components/projects/MappingMethodBlankLightHovered.js +0 -150
  155. package/dist/assets/components/projects/MappingMethodJsonDark.d.ts +0 -3
  156. package/dist/assets/components/projects/MappingMethodJsonDark.js +0 -90
  157. package/dist/assets/components/projects/MappingMethodJsonDarkHovered.d.ts +0 -3
  158. package/dist/assets/components/projects/MappingMethodJsonDarkHovered.js +0 -90
  159. package/dist/assets/components/projects/MappingMethodJsonLight.d.ts +0 -3
  160. package/dist/assets/components/projects/MappingMethodJsonLight.js +0 -90
  161. package/dist/assets/components/projects/MappingMethodJsonLightHovered.d.ts +0 -3
  162. package/dist/assets/components/projects/MappingMethodJsonLightHovered.js +0 -90
  163. package/dist/assets/components/projects/ProjectsEmptyStateDark.d.ts +0 -3
  164. package/dist/assets/components/projects/ProjectsEmptyStateDark.js +0 -454
  165. package/dist/assets/components/projects/ProjectsEmptyStateLight.d.ts +0 -3
  166. package/dist/assets/components/projects/ProjectsEmptyStateLight.js +0 -456
  167. package/dist/assets/components/root/CreateProjectActionCardDark.d.ts +0 -3
  168. package/dist/assets/components/root/CreateProjectActionCardDark.js +0 -1796
  169. package/dist/assets/components/root/CreateProjectActionCardDarkHovered.d.ts +0 -3
  170. package/dist/assets/components/root/CreateProjectActionCardDarkHovered.js +0 -1796
  171. package/dist/assets/components/root/CreateProjectActionCardLight.d.ts +0 -3
  172. package/dist/assets/components/root/CreateProjectActionCardLight.js +0 -1786
  173. package/dist/assets/components/root/CreateProjectActionCardLightHovered.d.ts +0 -3
  174. package/dist/assets/components/root/CreateProjectActionCardLightHovered.js +0 -1786
  175. package/dist/assets/components/root/CreateSourceActionCardDark.d.ts +0 -3
  176. package/dist/assets/components/root/CreateSourceActionCardDark.js +0 -879
  177. package/dist/assets/components/root/CreateSourceActionCardDarkHovered.d.ts +0 -3
  178. package/dist/assets/components/root/CreateSourceActionCardDarkHovered.js +0 -879
  179. package/dist/assets/components/root/CreateSourceActionCardLight.d.ts +0 -3
  180. package/dist/assets/components/root/CreateSourceActionCardLight.js +0 -889
  181. package/dist/assets/components/root/CreateSourceActionCardLightHovered.d.ts +0 -3
  182. package/dist/assets/components/root/CreateSourceActionCardLightHovered.js +0 -889
  183. package/dist/assets/components/sources/AttioIcon.d.ts +0 -3
  184. package/dist/assets/components/sources/AttioIcon.js +0 -11
  185. package/dist/assets/components/sources/BigquerySourceIcon.d.ts +0 -3
  186. package/dist/assets/components/sources/BigquerySourceIcon.js +0 -39
  187. package/dist/assets/components/sources/BrowserbaseSourceIcon.d.ts +0 -3
  188. package/dist/assets/components/sources/BrowserbaseSourceIcon.js +0 -35
  189. package/dist/assets/components/sources/ClickhouseLogoSourceIconDark.d.ts +0 -3
  190. package/dist/assets/components/sources/ClickhouseLogoSourceIconDark.js +0 -13
  191. package/dist/assets/components/sources/ClickhouseLogoSourceIconLight.d.ts +0 -3
  192. package/dist/assets/components/sources/ClickhouseLogoSourceIconLight.js +0 -13
  193. package/dist/assets/components/sources/ConfluenceSourceIcon.d.ts +0 -3
  194. package/dist/assets/components/sources/ConfluenceSourceIcon.js +0 -30
  195. package/dist/assets/components/sources/GithubSourceIcon.d.ts +0 -3
  196. package/dist/assets/components/sources/GithubSourceIcon.js +0 -27
  197. package/dist/assets/components/sources/GoogleDriveIcon.d.ts +0 -3
  198. package/dist/assets/components/sources/GoogleDriveIcon.js +0 -45
  199. package/dist/assets/components/sources/HubspotSourceIcon.d.ts +0 -3
  200. package/dist/assets/components/sources/HubspotSourceIcon.js +0 -14
  201. package/dist/assets/components/sources/JiraSourceIcon.d.ts +0 -3
  202. package/dist/assets/components/sources/JiraSourceIcon.js +0 -54
  203. package/dist/assets/components/sources/LinearSourceIcon.d.ts +0 -3
  204. package/dist/assets/components/sources/LinearSourceIcon.js +0 -14
  205. package/dist/assets/components/sources/MysqlLogoSourceIconDark.d.ts +0 -3
  206. package/dist/assets/components/sources/MysqlLogoSourceIconDark.js +0 -17
  207. package/dist/assets/components/sources/NetsuiteSourceIcon.d.ts +0 -3
  208. package/dist/assets/components/sources/NetsuiteSourceIcon.js +0 -32
  209. package/dist/assets/components/sources/NotionIcon.d.ts +0 -3
  210. package/dist/assets/components/sources/NotionIcon.js +0 -20
  211. package/dist/assets/components/sources/PostgresqlIcon.d.ts +0 -3
  212. package/dist/assets/components/sources/PostgresqlIcon.js +0 -61
  213. package/dist/assets/components/sources/S3Icon.d.ts +0 -3
  214. package/dist/assets/components/sources/S3Icon.js +0 -76
  215. package/dist/assets/components/sources/SalesforceSourceIcon.d.ts +0 -3
  216. package/dist/assets/components/sources/SalesforceSourceIcon.js +0 -23
  217. package/dist/assets/components/sources/SlackIcon.d.ts +0 -3
  218. package/dist/assets/components/sources/SlackIcon.js +0 -32
  219. package/dist/assets/components/sources/SnowflakeLogoSourceIconDark.d.ts +0 -3
  220. package/dist/assets/components/sources/SnowflakeLogoSourceIconDark.js +0 -14
  221. package/dist/assets/components/sources/SnowflakeLogoSourceIconLight.d.ts +0 -3
  222. package/dist/assets/components/sources/SnowflakeLogoSourceIconLight.js +0 -14
  223. package/dist/assets/components/sources/WikipediaSourceIcon.d.ts +0 -3
  224. package/dist/assets/components/sources/WikipediaSourceIcon.js +0 -1490
  225. package/dist/avatar/AvatarEmpty.d.ts +0 -7
  226. package/dist/avatar/AvatarEmpty.js +0 -99
  227. package/dist/avatar/types.d.ts +0 -5
  228. package/dist/avatar/types.js +0 -9
  229. package/dist/charts/utils.d.ts +0 -29
  230. package/dist/charts/utils.js +0 -62
  231. package/dist/icons/BackIcon.d.ts +0 -3
  232. package/dist/icons/BackIcon.js +0 -13
  233. package/dist/icons/CloseIcon.d.ts +0 -3
  234. package/dist/icons/CloseIcon.js +0 -13
  235. package/dist/icons/CreateIcon.d.ts +0 -3
  236. package/dist/icons/CreateIcon.js +0 -13
  237. package/dist/icons/ForwardIcon.d.ts +0 -3
  238. package/dist/icons/ForwardIcon.js +0 -13
  239. package/dist/icons/HelpIcon.d.ts +0 -3
  240. package/dist/icons/HelpIcon.js +0 -14
  241. package/dist/icons/ProjectsIcon.d.ts +0 -3
  242. package/dist/icons/ProjectsIcon.js +0 -12
  243. package/dist/icons/SearchIcon.d.ts +0 -3
  244. package/dist/icons/SearchIcon.js +0 -12
  245. package/dist/icons/SourcesIcon.d.ts +0 -3
  246. package/dist/icons/SourcesIcon.js +0 -12
  247. package/dist/icons/TextIcon.d.ts +0 -4
  248. package/dist/icons/TextIcon.js +0 -22
  249. package/dist/icons/WebScrapeIcon.d.ts +0 -4
  250. package/dist/icons/WebScrapeIcon.js +0 -22
  251. package/dist/icons/WebhookIcon.d.ts +0 -4
  252. package/dist/icons/WebhookIcon.js +0 -22
  253. package/dist/icons/sources/AttioLogomark.d.ts +0 -4
  254. package/dist/icons/sources/AttioLogomark.js +0 -8
  255. package/dist/icons/sources/BrowserbaseLogomark.d.ts +0 -4
  256. package/dist/icons/sources/BrowserbaseLogomark.js +0 -8
  257. package/dist/icons/sources/ClickhouseLogomark.d.ts +0 -4
  258. package/dist/icons/sources/ClickhouseLogomark.js +0 -16
  259. package/dist/icons/sources/ConfluenceLogomark.d.ts +0 -4
  260. package/dist/icons/sources/ConfluenceLogomark.js +0 -8
  261. package/dist/icons/sources/GithubLogomark.d.ts +0 -4
  262. package/dist/icons/sources/GithubLogomark.js +0 -8
  263. package/dist/icons/sources/GoogleBigqueryLogomark.d.ts +0 -4
  264. package/dist/icons/sources/GoogleBigqueryLogomark.js +0 -8
  265. package/dist/icons/sources/GoogleDriveLogomark.d.ts +0 -4
  266. package/dist/icons/sources/GoogleDriveLogomark.js +0 -8
  267. package/dist/icons/sources/HubspotLogomark.d.ts +0 -4
  268. package/dist/icons/sources/HubspotLogomark.js +0 -8
  269. package/dist/icons/sources/JiraLogomark.d.ts +0 -4
  270. package/dist/icons/sources/JiraLogomark.js +0 -8
  271. package/dist/icons/sources/LinearLogomark.d.ts +0 -4
  272. package/dist/icons/sources/LinearLogomark.js +0 -8
  273. package/dist/icons/sources/MySQLLogomark.d.ts +0 -4
  274. package/dist/icons/sources/MySQLLogomark.js +0 -8
  275. package/dist/icons/sources/NetsuiteLogomark.d.ts +0 -4
  276. package/dist/icons/sources/NetsuiteLogomark.js +0 -8
  277. package/dist/icons/sources/NotionLogomark.d.ts +0 -4
  278. package/dist/icons/sources/NotionLogomark.js +0 -8
  279. package/dist/icons/sources/PostgresLogomark.d.ts +0 -4
  280. package/dist/icons/sources/PostgresLogomark.js +0 -8
  281. package/dist/icons/sources/S3Logomark.d.ts +0 -4
  282. package/dist/icons/sources/S3Logomark.js +0 -8
  283. package/dist/icons/sources/SalesforceLogomark.d.ts +0 -4
  284. package/dist/icons/sources/SalesforceLogomark.js +0 -8
  285. package/dist/icons/sources/SlackLogoIconmark.d.ts +0 -4
  286. package/dist/icons/sources/SlackLogoIconmark.js +0 -8
  287. package/dist/icons/sources/SnowflakeLogomark.d.ts +0 -4
  288. package/dist/icons/sources/SnowflakeLogomark.js +0 -16
  289. package/dist/icons/sources/WikipediaLogomark.d.ts +0 -4
  290. package/dist/icons/sources/WikipediaLogomark.js +0 -8
  291. package/dist/spreadsheet/InfiniteSpreadsheet.d.ts +0 -3
  292. package/dist/spreadsheet/InfiniteSpreadsheet.js +0 -265
  293. package/dist/spreadsheet/SpreadsheetAddColumnButton.d.ts +0 -6
  294. package/dist/spreadsheet/SpreadsheetAddColumnButton.js +0 -32
  295. package/dist/spreadsheet/SpreadsheetCell.js +0 -115
  296. package/dist/spreadsheet/SpreadsheetHeaderCell.d.ts +0 -18
  297. package/dist/spreadsheet/SpreadsheetHeaderCell.js +0 -141
  298. package/dist/spreadsheet/SpreadsheetRow.d.ts +0 -21
  299. package/dist/spreadsheet/SpreadsheetRow.js +0 -68
  300. package/dist/spreadsheet/SpreadsheetRowActionCell.js +0 -78
  301. package/dist/spreadsheet/hooks/useColumnResize.d.ts +0 -6
  302. package/dist/spreadsheet/hooks/useColumnResize.js +0 -46
  303. package/dist/spreadsheet/types.d.ts +0 -92
  304. package/dist/spreadsheet/types.js +0 -21
  305. /package/dist/{spreadsheet → table}/SpreadsheetCellEditor.d.ts +0 -0
@@ -1,80 +1,454 @@
1
1
  import type { ReactNode } from "react";
2
- /** A single data point with a category label and series values */
3
- export interface ChartDatum {
4
- /** Category label (x-axis for bar/line, slice label for pie) */
5
- label: string;
6
- /** Numeric values keyed by series key. e.g. { revenue: 150, cost: 80 } */
7
- values: Record<string, number>;
2
+ /**
3
+ * Shared types for the chart components (`BarChart`, `LineChart`, `PieChart`).
4
+ *
5
+ * Every data type is generic over its key unions, and the inference is
6
+ * deliberately one-directional: `TMetric` comes from the keys of the `series`
7
+ * record and from nowhere else, with {@link NoInfer} applied to every
8
+ * data-shaped prop.
9
+ *
10
+ * That asymmetry is what makes the guarantees real. Were `TMetric` also
11
+ * inferred from the data, an inline `{ metric: "revenue" }` would widen to
12
+ * `string`, TypeScript would pick the supertype, and every check below would
13
+ * quietly become a no-op — type safety that looks present but is not.
14
+ *
15
+ * ```ts
16
+ * <BarChart
17
+ * series={{
18
+ * revenue: { label: "Revenue" },
19
+ * cost: { label: "Cost" },
20
+ * }}
21
+ * groups={[
22
+ * { label: "Q1", bars: [{ metric: "revenu", components: [] }] },
23
+ * // ^ Type '"revenu"' is not assignable to
24
+ * // type '"revenue" | "cost"'.
25
+ * ]}
26
+ * />
27
+ * ```
28
+ *
29
+ * The same union then makes aggregates exhaustive, spell-checks legend and
30
+ * ordering props, and narrows callback parameters for `ts-pattern`.
31
+ */
32
+ /**
33
+ * Semantic color slot for a series, resolved against the active theme at render
34
+ * time by `resolveChartPaletteColor` in `chartTheme.ts`.
35
+ *
36
+ * Deliberately an enum of slots rather than a hex string: consumer data should
37
+ * never carry raw color, and every rendered color has to come from
38
+ * `theme.color.*` so both themes stay correct.
39
+ */
40
+ export declare enum ChartPalette {
41
+ PURPLE = "PURPLE",
42
+ PINK = "PINK",
43
+ BLUE = "BLUE",
44
+ TEAL = "TEAL",
45
+ LIME = "LIME",
46
+ ORANGE = "ORANGE",
47
+ YELLOW = "YELLOW",
48
+ GREEN = "GREEN",
49
+ RED = "RED"
8
50
  }
9
- /** Describes one series in the chart */
10
- export interface ChartSeriesConfig {
11
- /** Unique key matching a key in ChartDatum.values */
12
- key: string;
13
- /** Human-readable name shown in legend/tooltip */
14
- name: string;
15
- /** Override color (hex). Falls back to palette order. */
16
- color?: string;
17
- }
18
- /** A single slice in a pie/donut chart */
19
- export interface PieSlice {
20
- /** Slice label shown in legend/tooltip */
51
+ /**
52
+ * Built-in value formats. Supplies an `Intl`-based default for axis ticks,
53
+ * value labels and tooltip rows so callers don't have to write the same
54
+ * formatter three times.
55
+ *
56
+ * A `valueFormatter` prop always wins over this when both are given.
57
+ */
58
+ export declare enum ChartValueUnit {
59
+ /** Locale-grouped integer, e.g. `1,250`. */
60
+ PLAIN = "PLAIN",
61
+ /** Locale currency with no decimals, e.g. `$1,250`. */
62
+ CURRENCY = "CURRENCY",
63
+ /** Percentage of a 0–100 value, e.g. `42%`. */
64
+ PERCENT = "PERCENT",
65
+ /** Abbreviated magnitude, e.g. `1.3K`, `4.2M`. */
66
+ COMPACT = "COMPACT"
67
+ }
68
+ export type ChartValueFormatter = (value: number) => string;
69
+ export type ChartLabelFormatter = (label: string) => string;
70
+ /**
71
+ * How one series is presented: what to call it and which palette slot it owns.
72
+ *
73
+ * Holds no data and no key — the key is the record key in
74
+ * {@link ChartSeriesStyles}, which is exactly what makes that record
75
+ * exhaustive.
76
+ */
77
+ export interface ChartSeriesStyle {
78
+ /** Name shown in the legend, tooltip and accessible labels. */
21
79
  label: string;
22
- /** Numeric value determining slice size */
23
- value: number;
24
- /** Override color (hex). Falls back to palette order. */
25
- color?: string;
80
+ /**
81
+ * Palette slot. Defaults to the series' position in the record, walked
82
+ * through `CHART_PALETTE_ORDER`.
83
+ */
84
+ color?: ChartPalette;
26
85
  }
86
+ /**
87
+ * Presentation for every series, keyed by series key.
88
+ *
89
+ * A `Record` over the key union rather than an array of `{ key, name }` is the
90
+ * single most load-bearing decision in this model. An array can be wrong in
91
+ * four independent ways — missing entry, extra entry, duplicate key, misspelt
92
+ * key — and TypeScript catches none of them. A record catches all four, because
93
+ * its *keys are the type*.
94
+ */
95
+ export type ChartSeriesStyles<TKey extends string> = Record<TKey, ChartSeriesStyle>;
27
96
  export interface ChartMargin {
28
97
  top: number;
29
98
  right: number;
30
99
  bottom: number;
31
100
  left: number;
32
101
  }
33
- export type ChartValueFormatter = (value: number) => string;
34
- export type ChartLabelFormatter = (label: string) => string;
35
- export interface ChartTooltipItem {
36
- seriesKey: string;
37
- seriesName: string;
102
+ /** Override for the computed value axis domain. */
103
+ export interface ChartValueDomain {
104
+ /** Lower bound. Defaults to `min(0, smallest value)`. */
105
+ min: number;
106
+ /** Upper bound. Defaults to `max(0, largest value)`. */
107
+ max: number;
108
+ /** Approximate tick count passed to d3's `scale.ticks()`. */
109
+ tickCount: number;
110
+ }
111
+ /**
112
+ * Which chart is being rendered.
113
+ *
114
+ * Exists so the frame can phrase a default accessible name — a pie has slices
115
+ * where the cartesian charts have categories. Deliberately not a styling hook:
116
+ * nothing else branches on it.
117
+ */
118
+ export declare enum ChartKind {
119
+ BAR = "BAR",
120
+ LINE = "LINE",
121
+ PIE = "PIE"
122
+ }
123
+ /** How the category axis copes when labels outgrow their slots. */
124
+ export declare enum ChartCategoryLabelMode {
125
+ /** Render every label that fits; otherwise show every nth. The default. */
126
+ AUTO = "AUTO",
127
+ /** Render every label, ellipsizing any that overflow its slot. */
128
+ TRUNCATE = "TRUNCATE",
129
+ /** Render every label unconditionally, overlap included. */
130
+ ALL = "ALL"
131
+ }
132
+ /**
133
+ * Emphasis level of a rendered mark.
134
+ *
135
+ * Travels to the DOM as a `data-state` attribute rather than a styled-component
136
+ * prop: `@linaria/react` skips prop filtering entirely for SVG tags (its
137
+ * `allTagsSet` is built with a missing spread, so `has('rect')` is false and
138
+ * `propsAsIs` turns on), which would forward a `$`-prefixed prop straight to the
139
+ * DOM and trigger a React warning.
140
+ */
141
+ export declare enum ChartMarkState {
142
+ /** Full strength — the default, and the hovered or pinned category. */
143
+ ACTIVE = "active",
144
+ /** Softened, for categories other than the hovered one. */
145
+ MUTED = "muted",
146
+ /** Furthest back, for categories outside a pinned one. */
147
+ FADED = "faded"
148
+ }
149
+ /** Which pair of a rectangle's corners carries the radius. */
150
+ export declare enum BarCorners {
151
+ /** Cap for a bar growing up from the baseline. */
152
+ TOP = "TOP",
153
+ /** Cap for a bar growing down from the baseline. */
154
+ BOTTOM = "BOTTOM",
155
+ /** Interior stack segment — square on both ends. */
156
+ NONE = "NONE"
157
+ }
158
+ /**
159
+ * How bar values are scaled before rendering.
160
+ *
161
+ * Note there is no grouped-vs-stacked mode: with the group → bar → component
162
+ * hierarchy, several `bars` in a group render side by side and several
163
+ * `components` in a bar render on top of each other, so a chart can be grouped
164
+ * and stacked at the same time.
165
+ */
166
+ export declare enum BarChartNormalization {
167
+ /** Plot raw values. */
168
+ NONE = "NONE",
169
+ /** Scale each bar's components to fill the axis — a 100% stacked chart. */
170
+ PERCENT = "PERCENT"
171
+ }
172
+ /**
173
+ * One stacked segment of a bar.
174
+ *
175
+ * A bar with a single component is just a plain unstacked bar.
176
+ */
177
+ export interface BarChartComponentDatum<TComponentKey extends string = string> {
178
+ /** Identifies this segment; must be unique within its bar. */
179
+ key: TComponentKey;
180
+ /** Human-readable name, shown in the tooltip and legend. */
181
+ label: string;
182
+ /** Segment magnitude. Negative values stack below the zero baseline. */
183
+ value: number;
184
+ /** Palette slot override. Defaults to the segment's position in the palette. */
185
+ color?: ChartPalette;
186
+ }
187
+ /**
188
+ * One bar within a group: a stack of components for a single metric.
189
+ */
190
+ export interface BarChartBarDatum<TMetric extends string, TComponentKey extends string = string> {
191
+ /** Which metric this bar represents, e.g. `"prospected"`. */
192
+ metric: TMetric;
193
+ /** Segments of the bar, stacked in array order outward from the baseline. */
194
+ components: BarChartComponentDatum<TComponentKey>[];
195
+ }
196
+ /**
197
+ * One category on the x-axis, holding one bar per metric.
198
+ */
199
+ export interface BarChartGroupDatum<TMetric extends string, TComponentKey extends string = string> {
200
+ /** Label rendered beneath this group on the category axis. */
201
+ label: string;
202
+ /** Bars in this group, rendered left to right in array order. */
203
+ bars: BarChartBarDatum<TMetric, TComponentKey>[];
204
+ }
205
+ /** How the segments between points are interpolated. */
206
+ export declare enum LineChartCurve {
207
+ /** Straight segments. */
208
+ LINEAR = "LINEAR",
209
+ /** Monotone cubic — smooth without overshooting the data. */
210
+ SMOOTH = "SMOOTH",
211
+ /** Right-angled steps. */
212
+ STEP = "STEP"
213
+ }
214
+ /** One point on a line. */
215
+ export interface LineChartPointDatum {
216
+ /** Category this point sits on; must match a category on the axis. */
217
+ x: string;
218
+ /**
219
+ * Value on the value axis.
220
+ *
221
+ * `null` breaks the line into separate segments. That is deliberately not the
222
+ * same as `0`: a missing reading and a reading of zero are different claims,
223
+ * and plotting a gap as zero draws a spike to the baseline that never
224
+ * happened.
225
+ */
226
+ y: number | null;
227
+ }
228
+ /**
229
+ * One line in a line chart.
230
+ *
231
+ * Carries no label or colour — those come from the chart's `series` record,
232
+ * keyed by `metric`, so the legend, tooltip and stroke cannot disagree.
233
+ */
234
+ export interface LineChartLineDatum<TMetric extends string> {
235
+ /** Which metric this line represents. Must be a key of the `series` record. */
236
+ metric: TMetric;
237
+ /**
238
+ * Points in category order.
239
+ *
240
+ * Sparse series are fine — categories absent here are treated as gaps, and
241
+ * the category axis is the union across every line.
242
+ */
243
+ points: LineChartPointDatum[];
244
+ /** Stroke width in px. Defaults to the shared line width. */
245
+ strokeWidth?: number;
246
+ /** Dash length in px. Solid when omitted. */
247
+ dashSize?: number;
248
+ /** Fill the area between the line and the baseline. */
249
+ showArea?: boolean;
250
+ }
251
+ /**
252
+ * One slice of a pie or donut.
253
+ *
254
+ * Carries no label or colour — those come from the chart's `series` record,
255
+ * keyed by `key`, so the legend, tooltip and arc cannot disagree.
256
+ */
257
+ export interface PieChartSliceDatum<TSlice extends string> {
258
+ /** Which slice this is. Must be a key of the `series` record. */
259
+ key: TSlice;
260
+ /**
261
+ * Slice magnitude.
262
+ *
263
+ * A pie shows parts of a whole, so negative values have no meaning here and
264
+ * are coerced to zero rather than silently inverting an arc.
265
+ */
266
+ value: number;
267
+ }
268
+ /** One label/value row in the tooltip. */
269
+ export interface ChartTooltipRow {
270
+ /** React key, unique within the tooltip. */
271
+ key: string;
272
+ /** Row label — a component label, line label or slice label. */
273
+ label: string;
38
274
  value: number;
275
+ /** Already run through the resolved formatter. */
276
+ formattedValue: string;
39
277
  color: string;
40
278
  }
41
- export interface ChartTooltipData {
42
- /** The category label */
279
+ /** Everything the tooltip needs to render, independent of chart type. */
280
+ export interface ChartTooltipModel {
281
+ /** Heading — the hovered category, or the slice label for a pie. */
43
282
  label: string;
44
- /** Series values for this datum */
45
- items: ChartTooltipItem[];
46
- /** Pixel position for tooltip anchor */
283
+ rows: ChartTooltipRow[];
284
+ /** Anchor in container coordinates, margins already applied. */
285
+ anchorX: number;
286
+ anchorY: number;
287
+ }
288
+ /**
289
+ * A tooltip model whose anchor is still in plot coordinates.
290
+ *
291
+ * Structurally identical to {@link ChartTooltipModel} — the difference is the
292
+ * coordinate space, which TypeScript cannot enforce. It carries its own name
293
+ * anyway, because `ChartFrame` accepting "container coordinates" and then adding
294
+ * a margin to them is exactly the sort of thing a reader has to be able to see
295
+ * from the signature.
296
+ *
297
+ * Charts build this; `ChartFrame` applies the margin translate once, in the
298
+ * component that already owns the `<g transform>`.
299
+ */
300
+ export interface ChartPlotTooltipModel {
301
+ label: string;
302
+ rows: ChartTooltipRow[];
303
+ /** Anchor in plot coordinates. */
304
+ anchorX: number;
305
+ anchorY: number;
306
+ }
307
+ /** Render prop for replacing the tooltip body. Positioning stays with the chart. */
308
+ export type ChartTooltipRenderer = (model: ChartTooltipModel) => ReactNode;
309
+ /** Which shape a category's hit target is drawn as. */
310
+ export declare enum ChartTargetShape {
311
+ /** Cartesian charts: a full-height band over the category. */
312
+ RECT = "RECT",
313
+ /** Radial charts: the arc's own outline, redrawn transparent. */
314
+ PATH = "PATH"
315
+ }
316
+ /**
317
+ * One category's interactive target, in plot coordinates.
318
+ *
319
+ * Array position *is* the category index — already true of every geometry
320
+ * builder's output — so there is no index field that could fall out of step.
321
+ * `key` is carried separately because a pie's arcs reorder, where bar and line
322
+ * indices do not.
323
+ */
324
+ export type ChartCategoryTarget = {
325
+ key: string;
326
+ shape: ChartTargetShape.RECT;
47
327
  x: number;
48
328
  y: number;
329
+ width: number;
330
+ height: number;
331
+ } | {
332
+ key: string;
333
+ shape: ChartTargetShape.PATH;
334
+ d: string;
335
+ };
336
+ /** One legend entry. */
337
+ export interface ChartLegendItem {
338
+ key: string;
339
+ label: string;
340
+ color: string;
341
+ }
342
+ /** Fixed-size chart: both dimensions given in px. */
343
+ export interface ChartFixedSize {
344
+ fillWidth?: false;
345
+ fillHeight?: false;
346
+ width: number;
347
+ height: number;
348
+ aspectRatio?: never;
49
349
  }
50
- /** Custom render function for tooltip body */
51
- export type ChartTooltipRenderer = (data: ChartTooltipData) => ReactNode;
52
- /** Base props shared by all chart components */
350
+ /** Container-width chart with an explicit height. */
351
+ export interface ChartFluidFixedHeight {
352
+ fillWidth: true;
353
+ fillHeight?: false;
354
+ width?: never;
355
+ height: number;
356
+ aspectRatio?: never;
357
+ }
358
+ /** Container-width chart whose height follows its width. */
359
+ export interface ChartFluidRatioHeight {
360
+ fillWidth: true;
361
+ fillHeight?: false;
362
+ width?: never;
363
+ height?: never;
364
+ /** Width ÷ height. `2` is a 2:1 landscape plot. */
365
+ aspectRatio: number;
366
+ }
367
+ /** Fixed-width chart that takes its height from the container. */
368
+ export interface ChartFixedWidthFluidHeight {
369
+ fillWidth?: false;
370
+ fillHeight: true;
371
+ width: number;
372
+ height?: never;
373
+ aspectRatio?: never;
374
+ }
375
+ /** Chart that fills its container on both axes — a dashboard tile. */
376
+ export interface ChartFluidBothAxes {
377
+ fillWidth: true;
378
+ fillHeight: true;
379
+ width?: never;
380
+ height?: never;
381
+ aspectRatio?: never;
382
+ }
383
+ /**
384
+ * The five legal ways to size a chart.
385
+ *
386
+ * A union rather than independent optional props, because the failure mode of
387
+ * the optional version is a chart that resolves to 0×0 and renders as nothing at
388
+ * all, with no error anywhere. Here `<BarChart fillWidth />` with neither
389
+ * `height` nor `aspectRatio` simply does not compile, and neither does
390
+ * `fillHeight` alongside a `height` that would contradict it.
391
+ *
392
+ * **`fillHeight` is not the mirror of `fillWidth`, and carries a requirement the
393
+ * type system cannot check.** Width flows down from the parent, so `fillWidth`
394
+ * is satisfied by any block container. Height flows *up* from content, so
395
+ * `fillHeight` needs an ancestor with a definite height — an explicit size, a
396
+ * flex or grid track, or absolute positioning. Given one, the chart fills it;
397
+ * given a content-sized parent there is nothing to fill and the chart collapses,
398
+ * which `useChartDimensions` warns about in development.
399
+ */
400
+ export type ChartSize = ChartFixedSize | ChartFluidFixedHeight | ChartFluidRatioHeight | ChartFixedWidthFluidHeight | ChartFluidBothAxes;
401
+ /**
402
+ * Props common to every chart.
403
+ *
404
+ * Data props are declared per chart, since their shapes and generics differ.
405
+ */
53
406
  export interface BaseChartProps {
54
- /** The data to render */
55
- data: ChartDatum[];
56
- /** Series configuration (order determines stacking/legend order) */
57
- series: ChartSeriesConfig[];
58
- /** Chart width in pixels. Optional when fillWidth is true. */
59
- width?: number;
60
- /** Chart height in pixels. Optional when aspectRatio is provided. */
61
- height?: number;
62
- /** Margins around the plot area */
407
+ /** Space around the plot area. Merged over the defaults. */
63
408
  margin?: Partial<ChartMargin>;
64
- /** When true, chart fills container width */
65
- fillWidth?: boolean;
66
- /** Aspect ratio (width/height). Used to auto-calculate height when fillWidth is true. */
67
- aspectRatio?: number;
68
- /** Format y-axis / value labels. Default: toLocaleString() */
409
+ /** Built-in value format. Ignored when `valueFormatter` is given. */
410
+ valueUnit?: ChartValueUnit;
411
+ /** Full control over value rendering. Wins over `valueUnit`. */
69
412
  valueFormatter?: ChartValueFormatter;
70
- /** Format x-axis / category labels. Default: identity */
413
+ /**
414
+ * Format category labels, wherever a category is named.
415
+ *
416
+ * That is the axis and the tooltip heading on the cartesian charts, and
417
+ * additionally the legend on a pie — whose legend lists *slices*, which are
418
+ * its categories. Bar and line legends name series, which come from the
419
+ * `series` record and are not categories, so this does not reach them.
420
+ */
71
421
  labelFormatter?: ChartLabelFormatter;
72
- /** Custom tooltip renderer. If omitted, uses default ChartTooltip */
422
+ /** Replace the tooltip body. Collision handling stays with the chart. */
73
423
  tooltipRenderer?: ChartTooltipRenderer;
74
- /** Disable tooltip entirely */
424
+ /** Suppress the tooltip and its hit targets entirely. */
75
425
  noTooltip?: boolean;
76
- /** Show legend */
426
+ /** Show the legend beneath the plot. */
77
427
  showLegend?: boolean;
78
- /** Accessible label for the chart SVG */
428
+ /** Render the loading treatment instead of the data. */
429
+ isLoading?: boolean;
430
+ /** Shown when there is nothing to plot. Defaults to a centred "No data". */
431
+ contentWhenEmpty?: ReactNode;
432
+ /** Accessible name for the chart. */
79
433
  ariaLabel?: string;
434
+ /** Longer description, associated via `aria-describedby`. */
435
+ ariaDescription?: string;
436
+ }
437
+ /**
438
+ * Props shared by the two cartesian charts (bar and line).
439
+ *
440
+ * Composed into each chart's props with `&` rather than `extends`, since
441
+ * {@link ChartSize} is a union and an interface cannot extend one.
442
+ */
443
+ export interface BaseCartesianChartProps extends BaseChartProps {
444
+ /** Draw horizontal grid lines at each value tick. */
445
+ showGrid?: boolean;
446
+ /** Override the computed value axis domain and tick count. */
447
+ valueDomain?: Partial<ChartValueDomain>;
448
+ /** How the category axis handles labels too long or too many to fit. */
449
+ categoryLabelMode?: ChartCategoryLabelMode;
450
+ /** Title rendered alongside the category axis. */
451
+ categoryAxisTitle?: string;
452
+ /** Title rendered alongside the value axis. */
453
+ valueAxisTitle?: string;
80
454
  }
@@ -0,0 +1,155 @@
1
+ //#region src/charts/types.ts
2
+ /**
3
+ * Shared types for the chart components (`BarChart`, `LineChart`, `PieChart`).
4
+ *
5
+ * Every data type is generic over its key unions, and the inference is
6
+ * deliberately one-directional: `TMetric` comes from the keys of the `series`
7
+ * record and from nowhere else, with {@link NoInfer} applied to every
8
+ * data-shaped prop.
9
+ *
10
+ * That asymmetry is what makes the guarantees real. Were `TMetric` also
11
+ * inferred from the data, an inline `{ metric: "revenue" }` would widen to
12
+ * `string`, TypeScript would pick the supertype, and every check below would
13
+ * quietly become a no-op — type safety that looks present but is not.
14
+ *
15
+ * ```ts
16
+ * <BarChart
17
+ * series={{
18
+ * revenue: { label: "Revenue" },
19
+ * cost: { label: "Cost" },
20
+ * }}
21
+ * groups={[
22
+ * { label: "Q1", bars: [{ metric: "revenu", components: [] }] },
23
+ * // ^ Type '"revenu"' is not assignable to
24
+ * // type '"revenue" | "cost"'.
25
+ * ]}
26
+ * />
27
+ * ```
28
+ *
29
+ * The same union then makes aggregates exhaustive, spell-checks legend and
30
+ * ordering props, and narrows callback parameters for `ts-pattern`.
31
+ */
32
+ /**
33
+ * Semantic color slot for a series, resolved against the active theme at render
34
+ * time by `resolveChartPaletteColor` in `chartTheme.ts`.
35
+ *
36
+ * Deliberately an enum of slots rather than a hex string: consumer data should
37
+ * never carry raw color, and every rendered color has to come from
38
+ * `theme.color.*` so both themes stay correct.
39
+ */
40
+ var ChartPalette = /* @__PURE__ */ function(ChartPalette) {
41
+ ChartPalette["PURPLE"] = "PURPLE";
42
+ ChartPalette["PINK"] = "PINK";
43
+ ChartPalette["BLUE"] = "BLUE";
44
+ ChartPalette["TEAL"] = "TEAL";
45
+ ChartPalette["LIME"] = "LIME";
46
+ ChartPalette["ORANGE"] = "ORANGE";
47
+ ChartPalette["YELLOW"] = "YELLOW";
48
+ ChartPalette["GREEN"] = "GREEN";
49
+ ChartPalette["RED"] = "RED";
50
+ return ChartPalette;
51
+ }({});
52
+ /**
53
+ * Built-in value formats. Supplies an `Intl`-based default for axis ticks,
54
+ * value labels and tooltip rows so callers don't have to write the same
55
+ * formatter three times.
56
+ *
57
+ * A `valueFormatter` prop always wins over this when both are given.
58
+ */
59
+ var ChartValueUnit = /* @__PURE__ */ function(ChartValueUnit) {
60
+ /** Locale-grouped integer, e.g. `1,250`. */
61
+ ChartValueUnit["PLAIN"] = "PLAIN";
62
+ /** Locale currency with no decimals, e.g. `$1,250`. */
63
+ ChartValueUnit["CURRENCY"] = "CURRENCY";
64
+ /** Percentage of a 0–100 value, e.g. `42%`. */
65
+ ChartValueUnit["PERCENT"] = "PERCENT";
66
+ /** Abbreviated magnitude, e.g. `1.3K`, `4.2M`. */
67
+ ChartValueUnit["COMPACT"] = "COMPACT";
68
+ return ChartValueUnit;
69
+ }({});
70
+ /**
71
+ * Which chart is being rendered.
72
+ *
73
+ * Exists so the frame can phrase a default accessible name — a pie has slices
74
+ * where the cartesian charts have categories. Deliberately not a styling hook:
75
+ * nothing else branches on it.
76
+ */
77
+ var ChartKind = /* @__PURE__ */ function(ChartKind) {
78
+ ChartKind["BAR"] = "BAR";
79
+ ChartKind["LINE"] = "LINE";
80
+ ChartKind["PIE"] = "PIE";
81
+ return ChartKind;
82
+ }({});
83
+ /** How the category axis copes when labels outgrow their slots. */
84
+ var ChartCategoryLabelMode = /* @__PURE__ */ function(ChartCategoryLabelMode) {
85
+ /** Render every label that fits; otherwise show every nth. The default. */
86
+ ChartCategoryLabelMode["AUTO"] = "AUTO";
87
+ /** Render every label, ellipsizing any that overflow its slot. */
88
+ ChartCategoryLabelMode["TRUNCATE"] = "TRUNCATE";
89
+ /** Render every label unconditionally, overlap included. */
90
+ ChartCategoryLabelMode["ALL"] = "ALL";
91
+ return ChartCategoryLabelMode;
92
+ }({});
93
+ /**
94
+ * Emphasis level of a rendered mark.
95
+ *
96
+ * Travels to the DOM as a `data-state` attribute rather than a styled-component
97
+ * prop: `@linaria/react` skips prop filtering entirely for SVG tags (its
98
+ * `allTagsSet` is built with a missing spread, so `has('rect')` is false and
99
+ * `propsAsIs` turns on), which would forward a `$`-prefixed prop straight to the
100
+ * DOM and trigger a React warning.
101
+ */
102
+ var ChartMarkState = /* @__PURE__ */ function(ChartMarkState) {
103
+ /** Full strength — the default, and the hovered or pinned category. */
104
+ ChartMarkState["ACTIVE"] = "active";
105
+ /** Softened, for categories other than the hovered one. */
106
+ ChartMarkState["MUTED"] = "muted";
107
+ /** Furthest back, for categories outside a pinned one. */
108
+ ChartMarkState["FADED"] = "faded";
109
+ return ChartMarkState;
110
+ }({});
111
+ /** Which pair of a rectangle's corners carries the radius. */
112
+ var BarCorners = /* @__PURE__ */ function(BarCorners) {
113
+ /** Cap for a bar growing up from the baseline. */
114
+ BarCorners["TOP"] = "TOP";
115
+ /** Cap for a bar growing down from the baseline. */
116
+ BarCorners["BOTTOM"] = "BOTTOM";
117
+ /** Interior stack segment — square on both ends. */
118
+ BarCorners["NONE"] = "NONE";
119
+ return BarCorners;
120
+ }({});
121
+ /**
122
+ * How bar values are scaled before rendering.
123
+ *
124
+ * Note there is no grouped-vs-stacked mode: with the group → bar → component
125
+ * hierarchy, several `bars` in a group render side by side and several
126
+ * `components` in a bar render on top of each other, so a chart can be grouped
127
+ * and stacked at the same time.
128
+ */
129
+ var BarChartNormalization = /* @__PURE__ */ function(BarChartNormalization) {
130
+ /** Plot raw values. */
131
+ BarChartNormalization["NONE"] = "NONE";
132
+ /** Scale each bar's components to fill the axis — a 100% stacked chart. */
133
+ BarChartNormalization["PERCENT"] = "PERCENT";
134
+ return BarChartNormalization;
135
+ }({});
136
+ /** How the segments between points are interpolated. */
137
+ var LineChartCurve = /* @__PURE__ */ function(LineChartCurve) {
138
+ /** Straight segments. */
139
+ LineChartCurve["LINEAR"] = "LINEAR";
140
+ /** Monotone cubic — smooth without overshooting the data. */
141
+ LineChartCurve["SMOOTH"] = "SMOOTH";
142
+ /** Right-angled steps. */
143
+ LineChartCurve["STEP"] = "STEP";
144
+ return LineChartCurve;
145
+ }({});
146
+ /** Which shape a category's hit target is drawn as. */
147
+ var ChartTargetShape = /* @__PURE__ */ function(ChartTargetShape) {
148
+ /** Cartesian charts: a full-height band over the category. */
149
+ ChartTargetShape["RECT"] = "RECT";
150
+ /** Radial charts: the arc's own outline, redrawn transparent. */
151
+ ChartTargetShape["PATH"] = "PATH";
152
+ return ChartTargetShape;
153
+ }({});
154
+ //#endregion
155
+ export { BarChartNormalization, BarCorners, ChartCategoryLabelMode, ChartKind, ChartMarkState, ChartPalette, ChartTargetShape, ChartValueUnit, LineChartCurve };