@galaxy-io/dls 1.2.6 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) 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 +216 -250
  8. package/dist/charts/ChartAxis.d.ts +47 -22
  9. package/dist/charts/ChartAxis.js +81 -60
  10. package/dist/charts/ChartEmptyState.d.ts +17 -0
  11. package/dist/charts/ChartEmptyState.js +29 -0
  12. package/dist/charts/ChartFrame.d.ts +82 -0
  13. package/dist/charts/ChartFrame.js +86 -0
  14. package/dist/charts/ChartLegend.d.ts +27 -4
  15. package/dist/charts/ChartLegend.js +46 -23
  16. package/dist/charts/ChartPrimitives.d.ts +195 -0
  17. package/dist/charts/ChartPrimitives.js +268 -0
  18. package/dist/charts/ChartTooltip.d.ts +27 -6
  19. package/dist/charts/ChartTooltip.js +56 -50
  20. package/dist/charts/LineChart.d.ts +42 -20
  21. package/dist/charts/LineChart.js +186 -237
  22. package/dist/charts/PieChart.d.ts +48 -32
  23. package/dist/charts/PieChart.js +159 -171
  24. package/dist/charts/barChartGeometry.d.ts +87 -0
  25. package/dist/charts/barChartGeometry.js +218 -0
  26. package/dist/charts/chartFormat.d.ts +19 -0
  27. package/dist/charts/chartFormat.js +59 -0
  28. package/dist/charts/chartScales.d.ts +84 -0
  29. package/dist/charts/chartScales.js +111 -0
  30. package/dist/charts/chartTheme.d.ts +18 -0
  31. package/dist/charts/chartTheme.js +26 -0
  32. package/dist/charts/constants.d.ts +225 -18
  33. package/dist/charts/constants.js +240 -32
  34. package/dist/charts/lineChartGeometry.d.ts +54 -0
  35. package/dist/charts/lineChartGeometry.js +143 -0
  36. package/dist/charts/pieChartGeometry.d.ts +48 -0
  37. package/dist/charts/pieChartGeometry.js +89 -0
  38. package/dist/charts/types.d.ts +522 -54
  39. package/dist/charts/types.js +136 -0
  40. package/dist/charts/useChartDimensions.d.ts +40 -0
  41. package/dist/charts/useChartDimensions.js +53 -0
  42. package/dist/charts/useChartFormatters.d.ts +19 -0
  43. package/dist/charts/useChartFormatters.js +20 -0
  44. package/dist/charts/useChartInteraction.d.ts +71 -0
  45. package/dist/charts/useChartInteraction.js +130 -0
  46. package/dist/charts/useChartTooltipPosition.d.ts +53 -0
  47. package/dist/charts/useChartTooltipPosition.js +39 -0
  48. package/dist/hooks/useElementClientSize.d.ts +20 -0
  49. package/dist/hooks/useElementClientSize.js +43 -0
  50. package/dist/inputs/CheckboxInput.d.ts +7 -2
  51. package/dist/inputs/CheckboxInput.js +30 -14
  52. package/dist/inputs/Input.d.ts +5 -2
  53. package/dist/inputs/Input.js +20 -17
  54. package/dist/inputs/MultiSelectInput.js +1 -1
  55. package/dist/inputs/RadioInput.js +7 -2
  56. package/dist/styles.css +68 -75
  57. package/dist/table/InfiniteSpreadsheet.d.ts +6 -0
  58. package/dist/table/InfiniteSpreadsheet.js +235 -0
  59. package/dist/table/InfiniteTable.d.ts +7 -88
  60. package/dist/table/InfiniteTable.js +366 -577
  61. package/dist/{spreadsheet → table}/SpreadsheetCell.d.ts +6 -4
  62. package/dist/table/SpreadsheetCell.js +71 -0
  63. package/dist/{spreadsheet → table}/SpreadsheetCellEditor.js +27 -21
  64. package/dist/table/SpreadsheetHeaderCell.d.ts +23 -0
  65. package/dist/table/SpreadsheetHeaderCell.js +91 -0
  66. package/dist/table/SpreadsheetMenuItem.d.ts +14 -0
  67. package/dist/table/SpreadsheetMenuItem.js +33 -0
  68. package/dist/table/SpreadsheetPrimitives.d.ts +172 -0
  69. package/dist/table/SpreadsheetPrimitives.js +105 -0
  70. package/dist/table/SpreadsheetRow.d.ts +33 -0
  71. package/dist/table/SpreadsheetRow.js +73 -0
  72. package/dist/{spreadsheet → table}/SpreadsheetRowActionCell.d.ts +5 -7
  73. package/dist/table/SpreadsheetRowActionCell.js +51 -0
  74. package/dist/table/TableExpandCell.d.ts +11 -0
  75. package/dist/table/TableExpandCell.js +24 -0
  76. package/dist/table/TableExpandedRow.d.ts +16 -0
  77. package/dist/table/TableExpandedRow.js +77 -0
  78. package/dist/table/TableHeaderCellContent.d.ts +30 -0
  79. package/dist/table/TableHeaderCellContent.js +48 -0
  80. package/dist/table/TablePrimitives.d.ts +307 -0
  81. package/dist/table/TablePrimitives.js +298 -0
  82. package/dist/table/TableSelectCell.d.ts +18 -0
  83. package/dist/table/TableSelectCell.js +26 -0
  84. package/dist/table/TableStatusRow.d.ts +18 -0
  85. package/dist/table/TableStatusRow.js +50 -0
  86. package/dist/table/VirtualizedInfiniteTable.d.ts +11 -27
  87. package/dist/table/VirtualizedInfiniteTable.js +182 -317
  88. package/dist/table/types.d.ts +249 -0
  89. package/dist/table/types.js +51 -0
  90. package/dist/table/useInfiniteScrollSentinel.d.ts +24 -0
  91. package/dist/table/useInfiniteScrollSentinel.js +53 -0
  92. package/dist/{spreadsheet/hooks → table}/useSpreadsheetEditing.d.ts +1 -1
  93. package/dist/{spreadsheet/hooks → table}/useSpreadsheetEditing.js +1 -1
  94. package/dist/table/useTableColumnLayout.d.ts +28 -0
  95. package/dist/table/useTableColumnLayout.js +63 -0
  96. package/dist/table/useTableColumnResize.d.ts +38 -0
  97. package/dist/table/useTableColumnResize.js +155 -0
  98. package/dist/table/useTableKeyboardNavigation.d.ts +25 -0
  99. package/dist/table/useTableKeyboardNavigation.js +83 -0
  100. package/dist/table/useTableRowExpansion.d.ts +24 -0
  101. package/dist/table/useTableRowExpansion.js +62 -0
  102. package/dist/table/useTableRowSelection.d.ts +27 -0
  103. package/dist/table/useTableRowSelection.js +94 -0
  104. package/dist/table/utils.d.ts +50 -0
  105. package/dist/table/utils.js +78 -0
  106. package/dist/text/MarkdownText.js +45 -27
  107. package/dist/theme/variants/dark.js +1 -1
  108. package/dist/widget/Widget.d.ts +2 -0
  109. package/dist/widget/Widget.js +14 -7
  110. package/package.json +1 -5
  111. package/dist/assets/components/enrichment/PerplexityIcon.d.ts +0 -3
  112. package/dist/assets/components/enrichment/PerplexityIcon.js +0 -35
  113. package/dist/assets/components/enrichment/TavilyIcon.d.ts +0 -3
  114. package/dist/assets/components/enrichment/TavilyIcon.js +0 -15
  115. package/dist/assets/components/onboarding/TenantSetupDark.d.ts +0 -3
  116. package/dist/assets/components/onboarding/TenantSetupDark.js +0 -498
  117. package/dist/assets/components/onboarding/TenantSetupLight.d.ts +0 -3
  118. package/dist/assets/components/onboarding/TenantSetupLight.js +0 -482
  119. package/dist/assets/components/onboarding/UserSetupDark.d.ts +0 -3
  120. package/dist/assets/components/onboarding/UserSetupDark.js +0 -1086
  121. package/dist/assets/components/onboarding/UserSetupLight.d.ts +0 -3
  122. package/dist/assets/components/onboarding/UserSetupLight.js +0 -1024
  123. package/dist/assets/components/onboarding/WorkspaceSetupBuildDark.d.ts +0 -3
  124. package/dist/assets/components/onboarding/WorkspaceSetupBuildDark.js +0 -466
  125. package/dist/assets/components/onboarding/WorkspaceSetupBuildLight.d.ts +0 -3
  126. package/dist/assets/components/onboarding/WorkspaceSetupBuildLight.js +0 -460
  127. package/dist/assets/components/onboarding/WorkspaceSetupConnectDark.d.ts +0 -3
  128. package/dist/assets/components/onboarding/WorkspaceSetupConnectDark.js +0 -336
  129. package/dist/assets/components/onboarding/WorkspaceSetupConnectLight.d.ts +0 -3
  130. package/dist/assets/components/onboarding/WorkspaceSetupConnectLight.js +0 -336
  131. package/dist/assets/components/onboarding/WorkspaceSetupIntegrateDark.d.ts +0 -3
  132. package/dist/assets/components/onboarding/WorkspaceSetupIntegrateDark.js +0 -153
  133. package/dist/assets/components/onboarding/WorkspaceSetupIntegrateLight.d.ts +0 -3
  134. package/dist/assets/components/onboarding/WorkspaceSetupIntegrateLight.js +0 -153
  135. package/dist/assets/components/projects/MappingMethodAutoIntrospectDark.d.ts +0 -3
  136. package/dist/assets/components/projects/MappingMethodAutoIntrospectDark.js +0 -117
  137. package/dist/assets/components/projects/MappingMethodAutoIntrospectLight.d.ts +0 -3
  138. package/dist/assets/components/projects/MappingMethodAutoIntrospectLight.js +0 -117
  139. package/dist/assets/components/projects/MappingMethodBlankDark.d.ts +0 -3
  140. package/dist/assets/components/projects/MappingMethodBlankDark.js +0 -150
  141. package/dist/assets/components/projects/MappingMethodBlankDarkHovered.d.ts +0 -3
  142. package/dist/assets/components/projects/MappingMethodBlankDarkHovered.js +0 -150
  143. package/dist/assets/components/projects/MappingMethodBlankLight.d.ts +0 -3
  144. package/dist/assets/components/projects/MappingMethodBlankLight.js +0 -150
  145. package/dist/assets/components/projects/MappingMethodBlankLightHovered.d.ts +0 -3
  146. package/dist/assets/components/projects/MappingMethodBlankLightHovered.js +0 -150
  147. package/dist/assets/components/projects/MappingMethodJsonDark.d.ts +0 -3
  148. package/dist/assets/components/projects/MappingMethodJsonDark.js +0 -90
  149. package/dist/assets/components/projects/MappingMethodJsonDarkHovered.d.ts +0 -3
  150. package/dist/assets/components/projects/MappingMethodJsonDarkHovered.js +0 -90
  151. package/dist/assets/components/projects/MappingMethodJsonLight.d.ts +0 -3
  152. package/dist/assets/components/projects/MappingMethodJsonLight.js +0 -90
  153. package/dist/assets/components/projects/MappingMethodJsonLightHovered.d.ts +0 -3
  154. package/dist/assets/components/projects/MappingMethodJsonLightHovered.js +0 -90
  155. package/dist/assets/components/projects/ProjectsEmptyStateDark.d.ts +0 -3
  156. package/dist/assets/components/projects/ProjectsEmptyStateDark.js +0 -454
  157. package/dist/assets/components/projects/ProjectsEmptyStateLight.d.ts +0 -3
  158. package/dist/assets/components/projects/ProjectsEmptyStateLight.js +0 -456
  159. package/dist/assets/components/root/CreateProjectActionCardDark.d.ts +0 -3
  160. package/dist/assets/components/root/CreateProjectActionCardDark.js +0 -1796
  161. package/dist/assets/components/root/CreateProjectActionCardDarkHovered.d.ts +0 -3
  162. package/dist/assets/components/root/CreateProjectActionCardDarkHovered.js +0 -1796
  163. package/dist/assets/components/root/CreateProjectActionCardLight.d.ts +0 -3
  164. package/dist/assets/components/root/CreateProjectActionCardLight.js +0 -1786
  165. package/dist/assets/components/root/CreateProjectActionCardLightHovered.d.ts +0 -3
  166. package/dist/assets/components/root/CreateProjectActionCardLightHovered.js +0 -1786
  167. package/dist/assets/components/root/CreateSourceActionCardDark.d.ts +0 -3
  168. package/dist/assets/components/root/CreateSourceActionCardDark.js +0 -879
  169. package/dist/assets/components/root/CreateSourceActionCardDarkHovered.d.ts +0 -3
  170. package/dist/assets/components/root/CreateSourceActionCardDarkHovered.js +0 -879
  171. package/dist/assets/components/root/CreateSourceActionCardLight.d.ts +0 -3
  172. package/dist/assets/components/root/CreateSourceActionCardLight.js +0 -889
  173. package/dist/assets/components/root/CreateSourceActionCardLightHovered.d.ts +0 -3
  174. package/dist/assets/components/root/CreateSourceActionCardLightHovered.js +0 -889
  175. package/dist/assets/components/sources/AttioIcon.d.ts +0 -3
  176. package/dist/assets/components/sources/AttioIcon.js +0 -11
  177. package/dist/assets/components/sources/BigquerySourceIcon.d.ts +0 -3
  178. package/dist/assets/components/sources/BigquerySourceIcon.js +0 -39
  179. package/dist/assets/components/sources/BrowserbaseSourceIcon.d.ts +0 -3
  180. package/dist/assets/components/sources/BrowserbaseSourceIcon.js +0 -35
  181. package/dist/assets/components/sources/ClickhouseLogoSourceIconDark.d.ts +0 -3
  182. package/dist/assets/components/sources/ClickhouseLogoSourceIconDark.js +0 -13
  183. package/dist/assets/components/sources/ClickhouseLogoSourceIconLight.d.ts +0 -3
  184. package/dist/assets/components/sources/ClickhouseLogoSourceIconLight.js +0 -13
  185. package/dist/assets/components/sources/ConfluenceSourceIcon.d.ts +0 -3
  186. package/dist/assets/components/sources/ConfluenceSourceIcon.js +0 -30
  187. package/dist/assets/components/sources/GithubSourceIcon.d.ts +0 -3
  188. package/dist/assets/components/sources/GithubSourceIcon.js +0 -27
  189. package/dist/assets/components/sources/GoogleDriveIcon.d.ts +0 -3
  190. package/dist/assets/components/sources/GoogleDriveIcon.js +0 -45
  191. package/dist/assets/components/sources/HubspotSourceIcon.d.ts +0 -3
  192. package/dist/assets/components/sources/HubspotSourceIcon.js +0 -14
  193. package/dist/assets/components/sources/JiraSourceIcon.d.ts +0 -3
  194. package/dist/assets/components/sources/JiraSourceIcon.js +0 -54
  195. package/dist/assets/components/sources/LinearSourceIcon.d.ts +0 -3
  196. package/dist/assets/components/sources/LinearSourceIcon.js +0 -14
  197. package/dist/assets/components/sources/MysqlLogoSourceIconDark.d.ts +0 -3
  198. package/dist/assets/components/sources/MysqlLogoSourceIconDark.js +0 -17
  199. package/dist/assets/components/sources/NetsuiteSourceIcon.d.ts +0 -3
  200. package/dist/assets/components/sources/NetsuiteSourceIcon.js +0 -32
  201. package/dist/assets/components/sources/NotionIcon.d.ts +0 -3
  202. package/dist/assets/components/sources/NotionIcon.js +0 -20
  203. package/dist/assets/components/sources/PostgresqlIcon.d.ts +0 -3
  204. package/dist/assets/components/sources/PostgresqlIcon.js +0 -61
  205. package/dist/assets/components/sources/S3Icon.d.ts +0 -3
  206. package/dist/assets/components/sources/S3Icon.js +0 -76
  207. package/dist/assets/components/sources/SalesforceSourceIcon.d.ts +0 -3
  208. package/dist/assets/components/sources/SalesforceSourceIcon.js +0 -23
  209. package/dist/assets/components/sources/SlackIcon.d.ts +0 -3
  210. package/dist/assets/components/sources/SlackIcon.js +0 -32
  211. package/dist/assets/components/sources/SnowflakeLogoSourceIconDark.d.ts +0 -3
  212. package/dist/assets/components/sources/SnowflakeLogoSourceIconDark.js +0 -14
  213. package/dist/assets/components/sources/SnowflakeLogoSourceIconLight.d.ts +0 -3
  214. package/dist/assets/components/sources/SnowflakeLogoSourceIconLight.js +0 -14
  215. package/dist/assets/components/sources/WikipediaSourceIcon.d.ts +0 -3
  216. package/dist/assets/components/sources/WikipediaSourceIcon.js +0 -1490
  217. package/dist/avatar/AvatarEmpty.d.ts +0 -7
  218. package/dist/avatar/AvatarEmpty.js +0 -99
  219. package/dist/avatar/types.d.ts +0 -5
  220. package/dist/avatar/types.js +0 -9
  221. package/dist/charts/utils.d.ts +0 -29
  222. package/dist/charts/utils.js +0 -62
  223. package/dist/icons/BackIcon.d.ts +0 -3
  224. package/dist/icons/BackIcon.js +0 -13
  225. package/dist/icons/CloseIcon.d.ts +0 -3
  226. package/dist/icons/CloseIcon.js +0 -13
  227. package/dist/icons/CreateIcon.d.ts +0 -3
  228. package/dist/icons/CreateIcon.js +0 -13
  229. package/dist/icons/ForwardIcon.d.ts +0 -3
  230. package/dist/icons/ForwardIcon.js +0 -13
  231. package/dist/icons/HelpIcon.d.ts +0 -3
  232. package/dist/icons/HelpIcon.js +0 -14
  233. package/dist/icons/ProjectsIcon.d.ts +0 -3
  234. package/dist/icons/ProjectsIcon.js +0 -12
  235. package/dist/icons/SearchIcon.d.ts +0 -3
  236. package/dist/icons/SearchIcon.js +0 -12
  237. package/dist/icons/SourcesIcon.d.ts +0 -3
  238. package/dist/icons/SourcesIcon.js +0 -12
  239. package/dist/icons/TextIcon.d.ts +0 -4
  240. package/dist/icons/TextIcon.js +0 -22
  241. package/dist/icons/WebScrapeIcon.d.ts +0 -4
  242. package/dist/icons/WebScrapeIcon.js +0 -22
  243. package/dist/icons/WebhookIcon.d.ts +0 -4
  244. package/dist/icons/WebhookIcon.js +0 -22
  245. package/dist/icons/sources/AttioLogomark.d.ts +0 -4
  246. package/dist/icons/sources/AttioLogomark.js +0 -8
  247. package/dist/icons/sources/BrowserbaseLogomark.d.ts +0 -4
  248. package/dist/icons/sources/BrowserbaseLogomark.js +0 -8
  249. package/dist/icons/sources/ClickhouseLogomark.d.ts +0 -4
  250. package/dist/icons/sources/ClickhouseLogomark.js +0 -16
  251. package/dist/icons/sources/ConfluenceLogomark.d.ts +0 -4
  252. package/dist/icons/sources/ConfluenceLogomark.js +0 -8
  253. package/dist/icons/sources/GithubLogomark.d.ts +0 -4
  254. package/dist/icons/sources/GithubLogomark.js +0 -8
  255. package/dist/icons/sources/GoogleBigqueryLogomark.d.ts +0 -4
  256. package/dist/icons/sources/GoogleBigqueryLogomark.js +0 -8
  257. package/dist/icons/sources/GoogleDriveLogomark.d.ts +0 -4
  258. package/dist/icons/sources/GoogleDriveLogomark.js +0 -8
  259. package/dist/icons/sources/HubspotLogomark.d.ts +0 -4
  260. package/dist/icons/sources/HubspotLogomark.js +0 -8
  261. package/dist/icons/sources/JiraLogomark.d.ts +0 -4
  262. package/dist/icons/sources/JiraLogomark.js +0 -8
  263. package/dist/icons/sources/LinearLogomark.d.ts +0 -4
  264. package/dist/icons/sources/LinearLogomark.js +0 -8
  265. package/dist/icons/sources/MySQLLogomark.d.ts +0 -4
  266. package/dist/icons/sources/MySQLLogomark.js +0 -8
  267. package/dist/icons/sources/NetsuiteLogomark.d.ts +0 -4
  268. package/dist/icons/sources/NetsuiteLogomark.js +0 -8
  269. package/dist/icons/sources/NotionLogomark.d.ts +0 -4
  270. package/dist/icons/sources/NotionLogomark.js +0 -8
  271. package/dist/icons/sources/PostgresLogomark.d.ts +0 -4
  272. package/dist/icons/sources/PostgresLogomark.js +0 -8
  273. package/dist/icons/sources/S3Logomark.d.ts +0 -4
  274. package/dist/icons/sources/S3Logomark.js +0 -8
  275. package/dist/icons/sources/SalesforceLogomark.d.ts +0 -4
  276. package/dist/icons/sources/SalesforceLogomark.js +0 -8
  277. package/dist/icons/sources/SlackLogoIconmark.d.ts +0 -4
  278. package/dist/icons/sources/SlackLogoIconmark.js +0 -8
  279. package/dist/icons/sources/SnowflakeLogomark.d.ts +0 -4
  280. package/dist/icons/sources/SnowflakeLogomark.js +0 -16
  281. package/dist/icons/sources/WikipediaLogomark.d.ts +0 -4
  282. package/dist/icons/sources/WikipediaLogomark.js +0 -8
  283. package/dist/spreadsheet/InfiniteSpreadsheet.d.ts +0 -3
  284. package/dist/spreadsheet/InfiniteSpreadsheet.js +0 -265
  285. package/dist/spreadsheet/SpreadsheetAddColumnButton.d.ts +0 -6
  286. package/dist/spreadsheet/SpreadsheetAddColumnButton.js +0 -32
  287. package/dist/spreadsheet/SpreadsheetCell.js +0 -115
  288. package/dist/spreadsheet/SpreadsheetHeaderCell.d.ts +0 -18
  289. package/dist/spreadsheet/SpreadsheetHeaderCell.js +0 -141
  290. package/dist/spreadsheet/SpreadsheetRow.d.ts +0 -21
  291. package/dist/spreadsheet/SpreadsheetRow.js +0 -68
  292. package/dist/spreadsheet/SpreadsheetRowActionCell.js +0 -78
  293. package/dist/spreadsheet/hooks/useColumnResize.d.ts +0 -6
  294. package/dist/spreadsheet/hooks/useColumnResize.js +0 -46
  295. package/dist/spreadsheet/types.d.ts +0 -92
  296. package/dist/spreadsheet/types.js +0 -21
  297. /package/dist/{spreadsheet → table}/SpreadsheetCellEditor.d.ts +0 -0
@@ -0,0 +1,195 @@
1
+ /**
2
+ * Outer container. Receives the measurement ref.
3
+ *
4
+ * `min-width: 0` is load-bearing rather than cosmetic — without it a chart in a
5
+ * flex row feeds its min-content width back into the ResizeObserver and the
6
+ * measurement can oscillate.
7
+ */
8
+ export declare const ChartRoot: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
9
+ $fillWidth?: boolean;
10
+ $fillHeight?: boolean;
11
+ }>;
12
+ /**
13
+ * Holds the plot, anchors the tooltip, and is the element that gets measured.
14
+ *
15
+ * Reserving the box from `aspect-ratio` or an explicit height means a
16
+ * `fillWidth` chart is the right size on its very first paint, instead of
17
+ * rendering at zero height and jumping once the observer reports.
18
+ *
19
+ * **`$fillHeight` is what makes "fill the container" tractable.** The chart root
20
+ * is a flex column of this box plus the legend, and the legend wraps, so its
21
+ * height is not known until after layout. Claiming the remaining track with
22
+ * `flex: 1` lets the browser do that subtraction during its own layout pass —
23
+ * measuring the root and subtracting a measured legend would instead be a
24
+ * second, dependent pass, and one that can oscillate under a ResizeObserver.
25
+ * `min-height: 0` is required with it: a flex item's automatic minimum size is
26
+ * its content, which would let the SVG hold the box open above its track.
27
+ */
28
+ export declare const ChartPlotBox: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
29
+ $reservedHeight?: number;
30
+ $reservedAspectRatio?: number;
31
+ $fillHeight?: boolean;
32
+ }>;
33
+ /**
34
+ * `overflow: visible` lets a value label above a full-height bar paint outside
35
+ * the plot rather than being clipped by the root SVG.
36
+ */
37
+ export declare const ChartSvg: import("@linaria/react").StyledComponent<import("react").SVGProps<SVGSVGElement> & Record<never, unknown>>;
38
+ /**
39
+ * Cancels the restore delay for every mark beneath it while a category is
40
+ * engaged. See {@link markState}.
41
+ */
42
+ export declare const ChartPlotGroup: import("@linaria/react").StyledComponent<import("react").SVGProps<SVGGElement> & Record<never, unknown>>;
43
+ export declare const ChartBarPath: import("@linaria/react").StyledComponent<import("react").SVGProps<SVGPathElement> & Record<never, unknown>>;
44
+ export declare const ChartLinePath: import("@linaria/react").StyledComponent<import("react").SVGProps<SVGPathElement> & Record<never, unknown>>;
45
+ export declare const ChartAreaPath: import("@linaria/react").StyledComponent<import("react").SVGProps<SVGPathElement> & Record<never, unknown>>;
46
+ export declare const ChartPointCircle: import("@linaria/react").StyledComponent<import("react").SVGProps<SVGCircleElement> & Record<never, unknown>>;
47
+ export declare const ChartArcPath: import("@linaria/react").StyledComponent<import("react").SVGProps<SVGPathElement> & Record<never, unknown>>;
48
+ /**
49
+ * Per-category hit target, rendered above the marks.
50
+ *
51
+ * Hit testing the full column rather than the bars themselves means a two-pixel
52
+ * bar is as easy to hover as a two-hundred-pixel one, and crossing between
53
+ * segments inside a category fires no events at all — so the tooltip holds
54
+ * still instead of chasing each segment.
55
+ */
56
+ export declare const ChartHitTarget: import("@linaria/react").StyledComponent<import("react").SVGProps<SVGRectElement> & Record<never, unknown>>;
57
+ /** Full-plot backdrop; clicking it clears a pinned category. */
58
+ export declare const ChartBackdrop: import("@linaria/react").StyledComponent<import("react").SVGProps<SVGRectElement> & Record<never, unknown>>;
59
+ /**
60
+ * Solid hairline rather than a dashed rule, and drawn at every tick including
61
+ * zero — the line under the bars is what makes them read as resting on a
62
+ * baseline.
63
+ */
64
+ export declare const ChartGridLine: import("react").ComponentType<Pick<import("react").SVGLineElementAttributes<SVGLineElement> & {
65
+ theme: import("../theme").Theme;
66
+ } & {
67
+ as?: React.ElementType;
68
+ }, "as" | keyof import("react").SVGLineElementAttributes<SVGLineElement>> & {
69
+ theme?: import("@callstack/react-theme-provider").$DeepPartial<import("../theme").Theme> | undefined;
70
+ }> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<import("react").ComponentType<import("react").SVGLineElementAttributes<SVGLineElement> & {
71
+ theme: import("../theme").Theme;
72
+ } & {
73
+ as?: React.ElementType;
74
+ }> & {
75
+ __wyw_meta: unknown;
76
+ } & import("react").FunctionComponent<import("react").SVGLineElementAttributes<SVGLineElement> & {
77
+ theme: import("../theme").Theme;
78
+ } & {
79
+ as?: React.ElementType;
80
+ }>, {}>;
81
+ /** Vertical rule marking the hovered category on a line chart. */
82
+ export declare const ChartCursorLine: import("react").ComponentType<Pick<import("react").SVGLineElementAttributes<SVGLineElement> & {
83
+ theme: import("../theme").Theme;
84
+ } & {
85
+ as?: React.ElementType;
86
+ }, "as" | keyof import("react").SVGLineElementAttributes<SVGLineElement>> & {
87
+ theme?: import("@callstack/react-theme-provider").$DeepPartial<import("../theme").Theme> | undefined;
88
+ }> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<import("react").ComponentType<import("react").SVGLineElementAttributes<SVGLineElement> & {
89
+ theme: import("../theme").Theme;
90
+ } & {
91
+ as?: React.ElementType;
92
+ }> & {
93
+ __wyw_meta: unknown;
94
+ } & import("react").FunctionComponent<import("react").SVGLineElementAttributes<SVGLineElement> & {
95
+ theme: import("../theme").Theme;
96
+ } & {
97
+ as?: React.ElementType;
98
+ }>, {}>;
99
+ export declare const ChartAxisLabelBox: import("@linaria/react").StyledComponent<import("react").SVGProps<SVGForeignObjectElement> & Record<never, unknown>>;
100
+ /**
101
+ * Positioned from coordinates already clamped to the chart box.
102
+ *
103
+ * `left`/`top` are transitioned so the tooltip slides between categories rather
104
+ * than teleporting, and it stays mounted while hidden so the fade can actually
105
+ * run — unmounting on hide is why a fade-out never appears.
106
+ */
107
+ export declare const ChartTooltipPositioner: import("react").ComponentType<Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
108
+ $x: number;
109
+ $y: number;
110
+ $isVisible: boolean;
111
+ } & {
112
+ theme: import("../theme").Theme;
113
+ } & {
114
+ as?: React.ElementType;
115
+ }, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement> | "as" | "$x" | "$y" | "$isVisible"> & {
116
+ theme?: import("@callstack/react-theme-provider").$DeepPartial<import("../theme").Theme> | undefined;
117
+ }> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<import("react").ComponentType<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
118
+ $x: number;
119
+ $y: number;
120
+ $isVisible: boolean;
121
+ } & {
122
+ theme: import("../theme").Theme;
123
+ } & {
124
+ as?: React.ElementType;
125
+ }> & {
126
+ __wyw_meta: unknown;
127
+ } & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
128
+ $x: number;
129
+ $y: number;
130
+ $isVisible: boolean;
131
+ } & {
132
+ theme: import("../theme").Theme;
133
+ } & {
134
+ as?: React.ElementType;
135
+ }>, {}>;
136
+ /**
137
+ * Content well inside a donut hole.
138
+ *
139
+ * Rendered as HTML positioned over the SVG rather than as `<text>`, so the
140
+ * caller can compose it from the same `Text` and layout primitives as the rest
141
+ * of the DLS. `pointer-events: none` keeps it from stealing hover from the arc
142
+ * behind it.
143
+ */
144
+ export declare const ChartCenterBox: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
145
+ $centerX: number;
146
+ $centerY: number;
147
+ $diameter: number;
148
+ }>;
149
+ /**
150
+ * Sits slightly above centre, over where the bars would be, so the axes stay
151
+ * legible underneath.
152
+ */
153
+ export declare const ChartEmptyOverlay: import("react").ComponentType<Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
154
+ theme: import("../theme").Theme;
155
+ } & {
156
+ as?: React.ElementType;
157
+ }, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement> | "as"> & {
158
+ theme?: import("@callstack/react-theme-provider").$DeepPartial<import("../theme").Theme> | undefined;
159
+ }> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<import("react").ComponentType<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
160
+ theme: import("../theme").Theme;
161
+ } & {
162
+ as?: React.ElementType;
163
+ }> & {
164
+ __wyw_meta: unknown;
165
+ } & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
166
+ theme: import("../theme").Theme;
167
+ } & {
168
+ as?: React.ElementType;
169
+ }>, {}>;
170
+ /**
171
+ * Aligns the legend under the plot rather than the value-axis gutter.
172
+ *
173
+ * Also cancels the restore delay for its entries while the legend is dimming,
174
+ * exactly as {@link ChartPlotGroup} does for the marks. The legend renders
175
+ * *outside* the SVG, so the plot group's selector cannot reach it — without this
176
+ * the marks dim instantly while their legend entries sit through the full
177
+ * {@link CHART_RESTORE_DELAY_MS}, and the two visibly fall out of step.
178
+ */
179
+ export declare const ChartLegendRow: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
180
+ $inset: number;
181
+ }>;
182
+ /**
183
+ * One legend entry, when the legend is interactive.
184
+ *
185
+ * A real `<button>` rather than a styled div: it is clickable, so it has to be
186
+ * reachable and operable by keyboard. `aria-pressed` carries the pinned state —
187
+ * the only thing here a screen reader can truthfully announce, since the plot
188
+ * itself is `role="img"` and its marks are not in the accessibility tree.
189
+ *
190
+ * Shares the mark opacity ramp via `data-state`, so an entry recedes in step
191
+ * with the series it names.
192
+ */
193
+ export declare const ChartLegendItemButton: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
194
+ /** The same row, when the legend is inert — no button semantics to announce. */
195
+ export declare const ChartLegendItemStatic: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -0,0 +1,268 @@
1
+ import { withTheme } from "../theme/GalaxyTheme.js";
2
+ /* empty css */
3
+ import { styled } from "@linaria/react";
4
+ //#region src/charts/ChartPrimitives.tsx
5
+ /**
6
+ * Styled leaves shared by the chart components.
7
+ *
8
+ * Linaria evaluates this module at build time, so it may import from
9
+ * `constants.ts` only — a component, framer-motion or Phosphor import here
10
+ * would be dragged into build-time evaluation.
11
+ *
12
+ * **SVG marks carry state as `data-*` attributes, never as `$`-prefixed props.**
13
+ * `@linaria/react` builds its tag allow-list as
14
+ * `new Set([...elements.html, elements.svg])` — the spread is missing on the
15
+ * second array, so `has('rect')` is false, `propsAsIs` turns on, and every prop
16
+ * is forwarded verbatim to the DOM. A `$isDimmed` prop reaches the element and
17
+ * React warns. Attribute selectors sidestep this entirely and keep the CSS
18
+ * static, which suits a zero-runtime setup better anyway.
19
+ *
20
+ * Leaves that receive a ref use plain `styled.x` rather than `withTheme`: the
21
+ * HOC's return type erases the element type, so a mismatched ref would compile.
22
+ */
23
+ /**
24
+ * Shared emphasis ramp.
25
+ *
26
+ * The delay asymmetry is deliberate and load-bearing: highlighting is instant,
27
+ * but restoring waits, so sweeping the pointer across categories reads as one
28
+ * gesture instead of a strobe. The plot sets `data-active` while any category is
29
+ * engaged, which cancels the delay for the whole subtree.
30
+ */
31
+ /**
32
+ * Outer container. Receives the measurement ref.
33
+ *
34
+ * `min-width: 0` is load-bearing rather than cosmetic — without it a chart in a
35
+ * flex row feeds its min-content width back into the ResizeObserver and the
36
+ * measurement can oscillate.
37
+ */
38
+ var _exp = () => ({ $fillWidth }) => $fillWidth ? "flex" : "inline-flex";
39
+ var _exp2 = () => ({ $fillWidth }) => $fillWidth ? "100%" : "auto";
40
+ var _exp3 = () => ({ $fillHeight }) => $fillHeight ? "100%" : "auto";
41
+ var ChartRoot = /*#__PURE__*/ styled("div")({
42
+ name: "ChartRoot",
43
+ class: "c1hcga6s",
44
+ propsAsIs: false,
45
+ vars: {
46
+ "c1hcga6s-0": [_exp()],
47
+ "c1hcga6s-1": [_exp2()],
48
+ "c1hcga6s-2": [_exp3()]
49
+ }
50
+ });
51
+ /**
52
+ * Holds the plot, anchors the tooltip, and is the element that gets measured.
53
+ *
54
+ * Reserving the box from `aspect-ratio` or an explicit height means a
55
+ * `fillWidth` chart is the right size on its very first paint, instead of
56
+ * rendering at zero height and jumping once the observer reports.
57
+ *
58
+ * **`$fillHeight` is what makes "fill the container" tractable.** The chart root
59
+ * is a flex column of this box plus the legend, and the legend wraps, so its
60
+ * height is not known until after layout. Claiming the remaining track with
61
+ * `flex: 1` lets the browser do that subtraction during its own layout pass —
62
+ * measuring the root and subtracting a measured legend would instead be a
63
+ * second, dependent pass, and one that can oscillate under a ResizeObserver.
64
+ * `min-height: 0` is required with it: a flex item's automatic minimum size is
65
+ * its content, which would let the SVG hold the box open above its track.
66
+ */
67
+ var _exp4 = () => ({ $reservedAspectRatio }) => $reservedAspectRatio ?? "auto";
68
+ var _exp5 = () => ({ $reservedHeight }) => $reservedHeight ? `${$reservedHeight}px` : "auto";
69
+ var _exp6 = () => ({ $fillHeight }) => $fillHeight ? "1 1 0%" : "0 1 auto";
70
+ var _exp7 = () => ({ $fillHeight }) => $fillHeight ? "0" : "auto";
71
+ var ChartPlotBox = /*#__PURE__*/ styled("div")({
72
+ name: "ChartPlotBox",
73
+ class: "c1fvbgkp",
74
+ propsAsIs: false,
75
+ vars: {
76
+ "c1fvbgkp-0": [_exp4()],
77
+ "c1fvbgkp-1": [_exp5()],
78
+ "c1fvbgkp-2": [_exp6()],
79
+ "c1fvbgkp-3": [_exp7()]
80
+ }
81
+ });
82
+ /**
83
+ * `overflow: visible` lets a value label above a full-height bar paint outside
84
+ * the plot rather than being clipped by the root SVG.
85
+ */
86
+ var ChartSvg = /*#__PURE__*/ styled("svg")({
87
+ name: "ChartSvg",
88
+ class: "c10uj5yt",
89
+ propsAsIs: false
90
+ });
91
+ /**
92
+ * Cancels the restore delay for every mark beneath it while a category is
93
+ * engaged. See {@link markState}.
94
+ */
95
+ var ChartPlotGroup = /*#__PURE__*/ styled("g")({
96
+ name: "ChartPlotGroup",
97
+ class: "cyuty3o",
98
+ propsAsIs: true
99
+ });
100
+ var ChartBarPath = /*#__PURE__*/ styled("path")({
101
+ name: "ChartBarPath",
102
+ class: "c1ob2op2",
103
+ propsAsIs: true
104
+ });
105
+ var ChartLinePath = /*#__PURE__*/ styled("path")({
106
+ name: "ChartLinePath",
107
+ class: "c8c506o",
108
+ propsAsIs: true
109
+ });
110
+ var ChartAreaPath = /*#__PURE__*/ styled("path")({
111
+ name: "ChartAreaPath",
112
+ class: "ceqlpek",
113
+ propsAsIs: true
114
+ });
115
+ var ChartPointCircle = /*#__PURE__*/ styled("circle")({
116
+ name: "ChartPointCircle",
117
+ class: "c1fcbddl",
118
+ propsAsIs: true
119
+ });
120
+ var ChartArcPath = /*#__PURE__*/ styled("path")({
121
+ name: "ChartArcPath",
122
+ class: "cpcxr59",
123
+ propsAsIs: true
124
+ });
125
+ /**
126
+ * Per-category hit target, rendered above the marks.
127
+ *
128
+ * Hit testing the full column rather than the bars themselves means a two-pixel
129
+ * bar is as easy to hover as a two-hundred-pixel one, and crossing between
130
+ * segments inside a category fires no events at all — so the tooltip holds
131
+ * still instead of chasing each segment.
132
+ */
133
+ var ChartHitTarget = /*#__PURE__*/ styled("rect")({
134
+ name: "ChartHitTarget",
135
+ class: "c1wvzvu4",
136
+ propsAsIs: true
137
+ });
138
+ /** Full-plot backdrop; clicking it clears a pinned category. */
139
+ var ChartBackdrop = /*#__PURE__*/ styled("rect")({
140
+ name: "ChartBackdrop",
141
+ class: "c17guewt",
142
+ propsAsIs: true
143
+ });
144
+ /**
145
+ * Solid hairline rather than a dashed rule, and drawn at every tick including
146
+ * zero — the line under the bars is what makes them read as resting on a
147
+ * baseline.
148
+ */
149
+ var _exp11 = () => ({ theme }) => theme.color.border.primary;
150
+ var ChartGridLine = withTheme(/*#__PURE__*/ styled("line")({
151
+ name: "ChartGridLine",
152
+ class: "cblgiyf",
153
+ propsAsIs: true,
154
+ vars: { "cblgiyf-0": [_exp11()] }
155
+ }));
156
+ /** Vertical rule marking the hovered category on a line chart. */
157
+ var _exp12 = () => ({ theme }) => theme.color.border.secondary;
158
+ var ChartCursorLine = withTheme(/*#__PURE__*/ styled("line")({
159
+ name: "ChartCursorLine",
160
+ class: "c1lr03cc",
161
+ propsAsIs: true,
162
+ vars: { "c1lr03cc-0": [_exp12()] }
163
+ }));
164
+ var ChartAxisLabelBox = /*#__PURE__*/ styled("foreignObject")({
165
+ name: "ChartAxisLabelBox",
166
+ class: "cizy1s8",
167
+ propsAsIs: true
168
+ });
169
+ /**
170
+ * Positioned from coordinates already clamped to the chart box.
171
+ *
172
+ * `left`/`top` are transitioned so the tooltip slides between categories rather
173
+ * than teleporting, and it stays mounted while hidden so the fade can actually
174
+ * run — unmounting on hide is why a fade-out never appears.
175
+ */
176
+ var _exp13 = () => ({ $x }) => `${$x}px`;
177
+ var _exp14 = () => ({ $y }) => `${$y}px`;
178
+ var _exp17 = () => ({ theme }) => theme.color.border.primary;
179
+ var _exp18 = () => ({ theme }) => theme.color.background.primary;
180
+ var _exp19 = () => ({ $isVisible }) => $isVisible ? 1 : 0;
181
+ var ChartTooltipPositioner = withTheme(/*#__PURE__*/ styled("div")({
182
+ name: "ChartTooltipPositioner",
183
+ class: "c1ukq11d",
184
+ propsAsIs: false,
185
+ vars: {
186
+ "c1ukq11d-0": [_exp13()],
187
+ "c1ukq11d-1": [_exp14()],
188
+ "c1ukq11d-2": [_exp17()],
189
+ "c1ukq11d-3": [_exp18()],
190
+ "c1ukq11d-4": [_exp19()]
191
+ }
192
+ }));
193
+ /**
194
+ * Content well inside a donut hole.
195
+ *
196
+ * Rendered as HTML positioned over the SVG rather than as `<text>`, so the
197
+ * caller can compose it from the same `Text` and layout primitives as the rest
198
+ * of the DLS. `pointer-events: none` keeps it from stealing hover from the arc
199
+ * behind it.
200
+ */
201
+ var _exp23 = () => ({ $centerX }) => `${$centerX}px`;
202
+ var _exp24 = () => ({ $centerY }) => `${$centerY}px`;
203
+ var _exp26 = () => ({ $diameter }) => `${$diameter}px`;
204
+ var ChartCenterBox = /*#__PURE__*/ styled("div")({
205
+ name: "ChartCenterBox",
206
+ class: "cwcko2m",
207
+ propsAsIs: false,
208
+ vars: {
209
+ "cwcko2m-0": [_exp23()],
210
+ "cwcko2m-1": [_exp24()],
211
+ "cwcko2m-2": [_exp26()]
212
+ }
213
+ });
214
+ /**
215
+ * Sits slightly above centre, over where the bars would be, so the axes stay
216
+ * legible underneath.
217
+ */
218
+ var _exp27 = () => ({ theme }) => theme.color.border.primary;
219
+ var _exp28 = () => ({ theme }) => theme.color.background.tertiary;
220
+ var ChartEmptyOverlay = withTheme(/*#__PURE__*/ styled("div")({
221
+ name: "ChartEmptyOverlay",
222
+ class: "cqwhvyz",
223
+ propsAsIs: false,
224
+ vars: {
225
+ "cqwhvyz-0": [_exp27()],
226
+ "cqwhvyz-1": [_exp28()]
227
+ }
228
+ }));
229
+ /**
230
+ * Aligns the legend under the plot rather than the value-axis gutter.
231
+ *
232
+ * Also cancels the restore delay for its entries while the legend is dimming,
233
+ * exactly as {@link ChartPlotGroup} does for the marks. The legend renders
234
+ * *outside* the SVG, so the plot group's selector cannot reach it — without this
235
+ * the marks dim instantly while their legend entries sit through the full
236
+ * {@link CHART_RESTORE_DELAY_MS}, and the two visibly fall out of step.
237
+ */
238
+ var _exp29 = () => ({ $inset }) => `${$inset}px`;
239
+ var ChartLegendRow = /*#__PURE__*/ styled("div")({
240
+ name: "ChartLegendRow",
241
+ class: "c1iaray",
242
+ propsAsIs: false,
243
+ vars: { "c1iaray-0": [_exp29()] }
244
+ });
245
+ /**
246
+ * One legend entry, when the legend is interactive.
247
+ *
248
+ * A real `<button>` rather than a styled div: it is clickable, so it has to be
249
+ * reachable and operable by keyboard. `aria-pressed` carries the pinned state —
250
+ * the only thing here a screen reader can truthfully announce, since the plot
251
+ * itself is `role="img"` and its marks are not in the accessibility tree.
252
+ *
253
+ * Shares the mark opacity ramp via `data-state`, so an entry recedes in step
254
+ * with the series it names.
255
+ */
256
+ var ChartLegendItemButton = /*#__PURE__*/ styled("button")({
257
+ name: "ChartLegendItemButton",
258
+ class: "cz6jod1",
259
+ propsAsIs: false
260
+ });
261
+ /** The same row, when the legend is inert — no button semantics to announce. */
262
+ var ChartLegendItemStatic = /*#__PURE__*/ styled("div")({
263
+ name: "ChartLegendItemStatic",
264
+ class: "c1de5mqk",
265
+ propsAsIs: false
266
+ });
267
+ //#endregion
268
+ export { ChartArcPath, ChartAreaPath, ChartAxisLabelBox, ChartBackdrop, ChartBarPath, ChartCenterBox, ChartCursorLine, ChartEmptyOverlay, ChartGridLine, ChartHitTarget, ChartLegendItemButton, ChartLegendItemStatic, ChartLegendRow, ChartLinePath, ChartPlotBox, ChartPlotGroup, ChartPointCircle, ChartRoot, ChartSvg, ChartTooltipPositioner };
@@ -1,7 +1,28 @@
1
- import type { ChartTooltipData, ChartValueFormatter } from "./types";
2
- interface ChartTooltipProps {
3
- data: ChartTooltipData | null;
4
- valueFormatter?: ChartValueFormatter;
1
+ import type { ChartTooltipModel, ChartTooltipRenderer } from "./types";
2
+ import { ChartTooltipVerticalAlign } from "./useChartTooltipPosition";
3
+ /**
4
+ * Positioned tooltip shared by the chart components.
5
+ *
6
+ * The positioner wraps a custom `renderer` too, so a caller replacing the body
7
+ * still gets collision handling — in V1 the custom path received no positioning
8
+ * at all and had to reimplement it.
9
+ */
10
+ interface ChartHoverTooltipProps {
11
+ /**
12
+ * The model to display, or `null` when nothing is active.
13
+ *
14
+ * The element stays mounted while hidden so the fade can run; unmounting on
15
+ * hide is why a fade-out never appears.
16
+ */
17
+ model: ChartTooltipModel | null;
18
+ containerWidth: number;
19
+ containerHeight: number;
20
+ /** Half a category's width, so the tooltip sits beside the bars, not over them. */
21
+ anchorHalfWidth?: number;
22
+ /** Radial charts pass their centre so the tooltip is pushed outward. */
23
+ placeAwayFromX?: number;
24
+ verticalAlign?: ChartTooltipVerticalAlign;
25
+ renderer?: ChartTooltipRenderer;
5
26
  }
6
- declare const ChartTooltip: ({ data, valueFormatter }: ChartTooltipProps) => import("react").JSX.Element | null;
7
- export default ChartTooltip;
27
+ declare const ChartHoverTooltip: ({ model, containerWidth, containerHeight, anchorHalfWidth, placeAwayFromX, verticalAlign, renderer, }: ChartHoverTooltipProps) => import("react").JSX.Element;
28
+ export default ChartHoverTooltip;
@@ -1,66 +1,72 @@
1
- import { withTheme } from "../theme/GalaxyTheme.js";
2
1
  import Text, { TextSize, TextVariant, TextWeight } from "../text/Text.js";
2
+ import FlexItem from "../containers/FlexItem.js";
3
3
  import FlexWrapper, { AlignItems, FlexDirection, JustifyContent } from "../containers/FlexWrapper.js";
4
4
  import Circle from "../shapes/Circle.js";
5
- import { defaultValueFormatter } from "./utils.js";
6
- /* empty css */
7
- import { styled } from "@linaria/react";
5
+ import { useChartTooltipPosition } from "./useChartTooltipPosition.js";
6
+ import { ChartTooltipPositioner } from "./ChartPrimitives.js";
7
+ import { useState } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  //#region src/charts/ChartTooltip.tsx
10
- var _exp = () => ({ $x }) => $x;
11
- var _exp2 = () => ({ $y }) => $y;
12
- var _exp3 = () => ({ theme }) => theme.color.background.secondary;
13
- var _exp4 = () => ({ theme }) => theme.color.border.secondary;
14
- var _exp5 = () => ({ $visible }) => $visible ? 1 : 0;
15
- var TooltipContainer = withTheme(/*#__PURE__*/ styled("div")({
16
- name: "TooltipContainer",
17
- class: "ttysfji",
18
- propsAsIs: false,
19
- vars: {
20
- "ttysfji-0": [_exp(), "px"],
21
- "ttysfji-1": [_exp2(), "px"],
22
- "ttysfji-2": [_exp3()],
23
- "ttysfji-3": [_exp4()],
24
- "ttysfji-4": [_exp5()]
25
- }
26
- }));
27
- var ChartTooltip = ({ data, valueFormatter = defaultValueFormatter }) => {
28
- if (!data) return null;
29
- return /* @__PURE__ */ jsx(TooltipContainer, {
30
- $x: data.x,
31
- $y: data.y,
32
- $visible: true,
33
- children: /* @__PURE__ */ jsxs(FlexWrapper, {
10
+ var ChartHoverTooltip = ({ model, containerWidth, containerHeight, anchorHalfWidth, placeAwayFromX, verticalAlign, renderer }) => {
11
+ const [retained, setRetained] = useState(model);
12
+ if (model !== null && model !== retained) setRetained(model);
13
+ const { tooltipRef, x, y, isMeasured } = useChartTooltipPosition({
14
+ anchorX: model?.anchorX ?? retained?.anchorX ?? 0,
15
+ anchorY: model?.anchorY ?? retained?.anchorY ?? 0,
16
+ containerWidth,
17
+ containerHeight,
18
+ anchorHalfWidth,
19
+ placeAwayFromX,
20
+ verticalAlign
21
+ });
22
+ const displayed = model ?? retained;
23
+ return /* @__PURE__ */ jsx(ChartTooltipPositioner, {
24
+ ref: tooltipRef,
25
+ $x: x,
26
+ $y: y,
27
+ $isVisible: model !== null && isMeasured,
28
+ role: "tooltip",
29
+ "aria-hidden": model === null,
30
+ children: !displayed ? null : renderer ? renderer(displayed) : /* @__PURE__ */ jsxs(FlexWrapper, {
34
31
  direction: FlexDirection.COLUMN,
35
- gap: 6,
32
+ gap: 8,
33
+ fillWidth: true,
36
34
  children: [/* @__PURE__ */ jsx(Text, {
37
35
  size: TextSize.BODY_SM,
38
- weight: TextWeight.MEDIUM,
39
- children: data.label
40
- }), data.items.map((item) => /* @__PURE__ */ jsxs(FlexWrapper, {
41
- alignItems: AlignItems.CENTER,
42
- justifyContent: JustifyContent.SPACE_BETWEEN,
43
- gap: 32,
36
+ variant: TextVariant.TERTIARY,
37
+ children: displayed.label
38
+ }), /* @__PURE__ */ jsx(FlexWrapper, {
39
+ direction: FlexDirection.COLUMN,
40
+ gap: 6,
44
41
  fillWidth: true,
45
- children: [/* @__PURE__ */ jsxs(FlexWrapper, {
42
+ children: displayed.rows.map((row) => /* @__PURE__ */ jsxs(FlexWrapper, {
46
43
  alignItems: AlignItems.CENTER,
47
- gap: 6,
48
- children: [/* @__PURE__ */ jsx(Circle, {
49
- size: 8,
50
- hex: item.color
44
+ justifyContent: JustifyContent.SPACE_BETWEEN,
45
+ gap: 16,
46
+ fillWidth: true,
47
+ children: [/* @__PURE__ */ jsxs(FlexWrapper, {
48
+ alignItems: AlignItems.CENTER,
49
+ gap: 6,
50
+ children: [/* @__PURE__ */ jsx(FlexItem, {
51
+ shrink: 0,
52
+ children: /* @__PURE__ */ jsx(Circle, {
53
+ size: 8,
54
+ hex: row.color
55
+ })
56
+ }), /* @__PURE__ */ jsx(Text, {
57
+ size: TextSize.BODY_SM,
58
+ isEllipsis: true,
59
+ children: row.label
60
+ })]
51
61
  }), /* @__PURE__ */ jsx(Text, {
52
- size: TextSize.CAPTION,
53
- variant: TextVariant.PRIMARY,
54
- children: item.seriesName
62
+ size: TextSize.BODY_SM,
63
+ weight: TextWeight.MEDIUM,
64
+ children: row.formattedValue
55
65
  })]
56
- }), /* @__PURE__ */ jsx(Text, {
57
- size: TextSize.CAPTION,
58
- weight: TextWeight.MEDIUM,
59
- children: valueFormatter(item.value)
60
- })]
61
- }, item.seriesKey))]
66
+ }, row.key))
67
+ })]
62
68
  })
63
69
  });
64
70
  };
65
71
  //#endregion
66
- export { ChartTooltip as default };
72
+ export { ChartHoverTooltip as default };