@cdx-ui/components 0.3.5 → 0.3.6

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 (278) hide show
  1. package/README.md +1 -1
  2. package/coverage.svg +1 -1
  3. package/docs/components/bar-chart/content.md +703 -0
  4. package/docs/components/content.md +9 -1
  5. package/docs/components/line-chart/content.md +567 -0
  6. package/docs/components/pie-chart/content.md +493 -0
  7. package/docs/components/progress-segmented/content.md +1 -1
  8. package/docs/components/stepper/content.md +599 -0
  9. package/docs/components/system-alert/content.md +533 -0
  10. package/docs/foundations/styles/tokens/all-tokens/content.md +2 -1
  11. package/docs/llms.txt +9 -0
  12. package/docs/patterns/content.md +1 -0
  13. package/docs/patterns/dashboard/content.md +423 -19
  14. package/docs/patterns/insights/content.md +590 -0
  15. package/docs/resources/release-notes/0.3.5/content.md +7 -0
  16. package/docs/resources/release-notes/content.md +1 -0
  17. package/lib/commonjs/components/BarChart/geometry.js +1130 -0
  18. package/lib/commonjs/components/BarChart/geometry.js.map +1 -0
  19. package/lib/commonjs/components/BarChart/index.js +942 -0
  20. package/lib/commonjs/components/BarChart/index.js.map +1 -0
  21. package/lib/commonjs/components/BarChart/styles.js +26 -0
  22. package/lib/commonjs/components/BarChart/styles.js.map +1 -0
  23. package/lib/commonjs/components/Button/index.js +2 -2
  24. package/lib/commonjs/components/Button/index.js.map +1 -1
  25. package/lib/commonjs/components/LineChart/geometry.js +698 -0
  26. package/lib/commonjs/components/LineChart/geometry.js.map +1 -0
  27. package/lib/commonjs/components/LineChart/index.js +747 -0
  28. package/lib/commonjs/components/LineChart/index.js.map +1 -0
  29. package/lib/commonjs/components/LineChart/styles.js +25 -0
  30. package/lib/commonjs/components/LineChart/styles.js.map +1 -0
  31. package/lib/commonjs/components/PieChart/geometry.js +216 -0
  32. package/lib/commonjs/components/PieChart/geometry.js.map +1 -0
  33. package/lib/commonjs/components/PieChart/index.js +476 -0
  34. package/lib/commonjs/components/PieChart/index.js.map +1 -0
  35. package/lib/commonjs/components/PieChart/styles.js +88 -0
  36. package/lib/commonjs/components/PieChart/styles.js.map +1 -0
  37. package/lib/commonjs/components/ProgressCircle/ProgressCircleRing.js +9 -31
  38. package/lib/commonjs/components/ProgressCircle/ProgressCircleRing.js.map +1 -1
  39. package/lib/commonjs/components/ProgressCircle/ProgressRing.js +52 -0
  40. package/lib/commonjs/components/ProgressCircle/ProgressRing.js.map +1 -0
  41. package/lib/commonjs/components/ScrollShadow/useScrollShadow.js +8 -7
  42. package/lib/commonjs/components/ScrollShadow/useScrollShadow.js.map +1 -1
  43. package/lib/commonjs/components/Stepper/index.js +369 -0
  44. package/lib/commonjs/components/Stepper/index.js.map +1 -0
  45. package/lib/commonjs/components/Stepper/styles.js +211 -0
  46. package/lib/commonjs/components/Stepper/styles.js.map +1 -0
  47. package/lib/commonjs/components/Stepper/useStepperLabelFit.js +22 -0
  48. package/lib/commonjs/components/Stepper/useStepperLabelFit.js.map +1 -0
  49. package/lib/commonjs/components/Stepper/useStepperLabelFit.web.js +52 -0
  50. package/lib/commonjs/components/Stepper/useStepperLabelFit.web.js.map +1 -0
  51. package/lib/commonjs/components/Stepper/useStepperRingColors.js +31 -0
  52. package/lib/commonjs/components/Stepper/useStepperRingColors.js.map +1 -0
  53. package/lib/commonjs/components/SystemAlert/animation.js +218 -0
  54. package/lib/commonjs/components/SystemAlert/animation.js.map +1 -0
  55. package/lib/commonjs/components/SystemAlert/index.js +525 -0
  56. package/lib/commonjs/components/SystemAlert/index.js.map +1 -0
  57. package/lib/commonjs/components/SystemAlert/styles.js +178 -0
  58. package/lib/commonjs/components/SystemAlert/styles.js.map +1 -0
  59. package/lib/commonjs/components/SystemAlert/useSystemAlertStatusBarStyle.js +53 -0
  60. package/lib/commonjs/components/SystemAlert/useSystemAlertStatusBarStyle.js.map +1 -0
  61. package/lib/commonjs/components/Tabs/index.js +4 -0
  62. package/lib/commonjs/components/Tabs/index.js.map +1 -1
  63. package/lib/commonjs/components/Tabs/styles.js +1 -1
  64. package/lib/commonjs/components/Tabs/styles.js.map +1 -1
  65. package/lib/commonjs/components/chart/ChartInspector.js +610 -0
  66. package/lib/commonjs/components/chart/ChartInspector.js.map +1 -0
  67. package/lib/commonjs/components/chart/format.js +93 -0
  68. package/lib/commonjs/components/chart/format.js.map +1 -0
  69. package/lib/commonjs/components/chart/index.js +2 -0
  70. package/lib/commonjs/components/chart/index.js.map +1 -0
  71. package/lib/commonjs/components/chart/motion.js +97 -0
  72. package/lib/commonjs/components/chart/motion.js.map +1 -0
  73. package/lib/commonjs/components/chart/palette.js +178 -0
  74. package/lib/commonjs/components/chart/palette.js.map +1 -0
  75. package/lib/commonjs/components/chart/size.js +34 -0
  76. package/lib/commonjs/components/chart/size.js.map +1 -0
  77. package/lib/commonjs/components/chart/ticks.js +59 -0
  78. package/lib/commonjs/components/chart/ticks.js.map +1 -0
  79. package/lib/commonjs/components/chart/types.js +6 -0
  80. package/lib/commonjs/components/chart/types.js.map +1 -0
  81. package/lib/commonjs/components/chart/useChartHostWidth.js +27 -0
  82. package/lib/commonjs/components/chart/useChartHostWidth.js.map +1 -0
  83. package/lib/commonjs/components/index.js +60 -0
  84. package/lib/commonjs/components/index.js.map +1 -1
  85. package/lib/commonjs/figma/SystemAlert.Button.figma.js +28 -0
  86. package/lib/commonjs/figma/SystemAlert.Button.figma.js.map +1 -0
  87. package/lib/commonjs/figma/SystemAlert.Close.figma.js +22 -0
  88. package/lib/commonjs/figma/SystemAlert.Close.figma.js.map +1 -0
  89. package/lib/commonjs/figma/SystemAlert.Description.figma.js +20 -0
  90. package/lib/commonjs/figma/SystemAlert.Description.figma.js.map +1 -0
  91. package/lib/commonjs/figma/SystemAlert.IconButton.figma.js +31 -0
  92. package/lib/commonjs/figma/SystemAlert.IconButton.figma.js.map +1 -0
  93. package/lib/commonjs/figma/SystemAlert.figma.js +48 -0
  94. package/lib/commonjs/figma/SystemAlert.figma.js.map +1 -0
  95. package/lib/module/components/BarChart/geometry.js +1110 -0
  96. package/lib/module/components/BarChart/geometry.js.map +1 -0
  97. package/lib/module/components/BarChart/index.js +936 -0
  98. package/lib/module/components/BarChart/index.js.map +1 -0
  99. package/lib/module/components/BarChart/styles.js +22 -0
  100. package/lib/module/components/BarChart/styles.js.map +1 -0
  101. package/lib/module/components/Button/index.js +2 -2
  102. package/lib/module/components/Button/index.js.map +1 -1
  103. package/lib/module/components/LineChart/geometry.js +685 -0
  104. package/lib/module/components/LineChart/geometry.js.map +1 -0
  105. package/lib/module/components/LineChart/index.js +741 -0
  106. package/lib/module/components/LineChart/index.js.map +1 -0
  107. package/lib/module/components/LineChart/styles.js +21 -0
  108. package/lib/module/components/LineChart/styles.js.map +1 -0
  109. package/lib/module/components/PieChart/geometry.js +209 -0
  110. package/lib/module/components/PieChart/geometry.js.map +1 -0
  111. package/lib/module/components/PieChart/index.js +471 -0
  112. package/lib/module/components/PieChart/index.js.map +1 -0
  113. package/lib/module/components/PieChart/styles.js +84 -0
  114. package/lib/module/components/PieChart/styles.js.map +1 -0
  115. package/lib/module/components/ProgressCircle/ProgressCircleRing.js +10 -32
  116. package/lib/module/components/ProgressCircle/ProgressCircleRing.js.map +1 -1
  117. package/lib/module/components/ProgressCircle/ProgressRing.js +48 -0
  118. package/lib/module/components/ProgressCircle/ProgressRing.js.map +1 -0
  119. package/lib/module/components/ScrollShadow/useScrollShadow.js +8 -7
  120. package/lib/module/components/ScrollShadow/useScrollShadow.js.map +1 -1
  121. package/lib/module/components/Stepper/index.js +360 -0
  122. package/lib/module/components/Stepper/index.js.map +1 -0
  123. package/lib/module/components/Stepper/styles.js +206 -0
  124. package/lib/module/components/Stepper/styles.js.map +1 -0
  125. package/lib/module/components/Stepper/useStepperLabelFit.js +18 -0
  126. package/lib/module/components/Stepper/useStepperLabelFit.js.map +1 -0
  127. package/lib/module/components/Stepper/useStepperLabelFit.web.js +48 -0
  128. package/lib/module/components/Stepper/useStepperLabelFit.web.js.map +1 -0
  129. package/lib/module/components/Stepper/useStepperRingColors.js +28 -0
  130. package/lib/module/components/Stepper/useStepperRingColors.js.map +1 -0
  131. package/lib/module/components/SystemAlert/animation.js +213 -0
  132. package/lib/module/components/SystemAlert/animation.js.map +1 -0
  133. package/lib/module/components/SystemAlert/index.js +515 -0
  134. package/lib/module/components/SystemAlert/index.js.map +1 -0
  135. package/lib/module/components/SystemAlert/styles.js +174 -0
  136. package/lib/module/components/SystemAlert/styles.js.map +1 -0
  137. package/lib/module/components/SystemAlert/useSystemAlertStatusBarStyle.js +49 -0
  138. package/lib/module/components/SystemAlert/useSystemAlertStatusBarStyle.js.map +1 -0
  139. package/lib/module/components/Tabs/index.js +4 -0
  140. package/lib/module/components/Tabs/index.js.map +1 -1
  141. package/lib/module/components/Tabs/styles.js +1 -1
  142. package/lib/module/components/Tabs/styles.js.map +1 -1
  143. package/lib/module/components/chart/ChartInspector.js +600 -0
  144. package/lib/module/components/chart/ChartInspector.js.map +1 -0
  145. package/lib/module/components/chart/format.js +84 -0
  146. package/lib/module/components/chart/format.js.map +1 -0
  147. package/lib/module/components/chart/index.js +2 -0
  148. package/lib/module/components/chart/index.js.map +1 -0
  149. package/lib/module/components/chart/motion.js +89 -0
  150. package/lib/module/components/chart/motion.js.map +1 -0
  151. package/lib/module/components/chart/palette.js +168 -0
  152. package/lib/module/components/chart/palette.js.map +1 -0
  153. package/lib/module/components/chart/size.js +29 -0
  154. package/lib/module/components/chart/size.js.map +1 -0
  155. package/lib/module/components/chart/ticks.js +55 -0
  156. package/lib/module/components/chart/ticks.js.map +1 -0
  157. package/lib/module/components/chart/types.js +4 -0
  158. package/lib/module/components/chart/types.js.map +1 -0
  159. package/lib/module/components/chart/useChartHostWidth.js +23 -0
  160. package/lib/module/components/chart/useChartHostWidth.js.map +1 -0
  161. package/lib/module/components/index.js +5 -0
  162. package/lib/module/components/index.js.map +1 -1
  163. package/lib/module/figma/SystemAlert.Button.figma.js +22 -0
  164. package/lib/module/figma/SystemAlert.Button.figma.js.map +1 -0
  165. package/lib/module/figma/SystemAlert.Close.figma.js +18 -0
  166. package/lib/module/figma/SystemAlert.Close.figma.js.map +1 -0
  167. package/lib/module/figma/SystemAlert.Description.figma.js +14 -0
  168. package/lib/module/figma/SystemAlert.Description.figma.js.map +1 -0
  169. package/lib/module/figma/SystemAlert.IconButton.figma.js +25 -0
  170. package/lib/module/figma/SystemAlert.IconButton.figma.js.map +1 -0
  171. package/lib/module/figma/SystemAlert.figma.js +42 -0
  172. package/lib/module/figma/SystemAlert.figma.js.map +1 -0
  173. package/lib/typescript/components/BarChart/geometry.d.ts +236 -0
  174. package/lib/typescript/components/BarChart/geometry.d.ts.map +1 -0
  175. package/lib/typescript/components/BarChart/index.d.ts +193 -0
  176. package/lib/typescript/components/BarChart/index.d.ts.map +1 -0
  177. package/lib/typescript/components/BarChart/styles.d.ts +32 -0
  178. package/lib/typescript/components/BarChart/styles.d.ts.map +1 -0
  179. package/lib/typescript/components/LineChart/geometry.d.ts +248 -0
  180. package/lib/typescript/components/LineChart/geometry.d.ts.map +1 -0
  181. package/lib/typescript/components/LineChart/index.d.ts +105 -0
  182. package/lib/typescript/components/LineChart/index.d.ts.map +1 -0
  183. package/lib/typescript/components/LineChart/styles.d.ts +12 -0
  184. package/lib/typescript/components/LineChart/styles.d.ts.map +1 -0
  185. package/lib/typescript/components/PieChart/geometry.d.ts +43 -0
  186. package/lib/typescript/components/PieChart/geometry.d.ts.map +1 -0
  187. package/lib/typescript/components/PieChart/index.d.ts +147 -0
  188. package/lib/typescript/components/PieChart/index.d.ts.map +1 -0
  189. package/lib/typescript/components/PieChart/styles.d.ts +27 -0
  190. package/lib/typescript/components/PieChart/styles.d.ts.map +1 -0
  191. package/lib/typescript/components/ProgressCircle/ProgressCircleRing.d.ts.map +1 -1
  192. package/lib/typescript/components/ProgressCircle/ProgressRing.d.ts +17 -0
  193. package/lib/typescript/components/ProgressCircle/ProgressRing.d.ts.map +1 -0
  194. package/lib/typescript/components/ScrollShadow/useScrollShadow.d.ts.map +1 -1
  195. package/lib/typescript/components/Stepper/index.d.ts +68 -0
  196. package/lib/typescript/components/Stepper/index.d.ts.map +1 -0
  197. package/lib/typescript/components/Stepper/styles.d.ts +46 -0
  198. package/lib/typescript/components/Stepper/styles.d.ts.map +1 -0
  199. package/lib/typescript/components/Stepper/useStepperLabelFit.d.ts +15 -0
  200. package/lib/typescript/components/Stepper/useStepperLabelFit.d.ts.map +1 -0
  201. package/lib/typescript/components/Stepper/useStepperLabelFit.web.d.ts +10 -0
  202. package/lib/typescript/components/Stepper/useStepperLabelFit.web.d.ts.map +1 -0
  203. package/lib/typescript/components/Stepper/useStepperRingColors.d.ts +6 -0
  204. package/lib/typescript/components/Stepper/useStepperRingColors.d.ts.map +1 -0
  205. package/lib/typescript/components/SystemAlert/animation.d.ts +56 -0
  206. package/lib/typescript/components/SystemAlert/animation.d.ts.map +1 -0
  207. package/lib/typescript/components/SystemAlert/index.d.ts +110 -0
  208. package/lib/typescript/components/SystemAlert/index.d.ts.map +1 -0
  209. package/lib/typescript/components/SystemAlert/styles.d.ts +38 -0
  210. package/lib/typescript/components/SystemAlert/styles.d.ts.map +1 -0
  211. package/lib/typescript/components/SystemAlert/useSystemAlertStatusBarStyle.d.ts +14 -0
  212. package/lib/typescript/components/SystemAlert/useSystemAlertStatusBarStyle.d.ts.map +1 -0
  213. package/lib/typescript/components/Tabs/index.d.ts.map +1 -1
  214. package/lib/typescript/components/chart/ChartInspector.d.ts +101 -0
  215. package/lib/typescript/components/chart/ChartInspector.d.ts.map +1 -0
  216. package/lib/typescript/components/chart/format.d.ts +16 -0
  217. package/lib/typescript/components/chart/format.d.ts.map +1 -0
  218. package/lib/typescript/components/chart/index.d.ts +3 -0
  219. package/lib/typescript/components/chart/index.d.ts.map +1 -0
  220. package/lib/typescript/components/chart/motion.d.ts +27 -0
  221. package/lib/typescript/components/chart/motion.d.ts.map +1 -0
  222. package/lib/typescript/components/chart/palette.d.ts +44 -0
  223. package/lib/typescript/components/chart/palette.d.ts.map +1 -0
  224. package/lib/typescript/components/chart/size.d.ts +25 -0
  225. package/lib/typescript/components/chart/size.d.ts.map +1 -0
  226. package/lib/typescript/components/chart/ticks.d.ts +3 -0
  227. package/lib/typescript/components/chart/ticks.d.ts.map +1 -0
  228. package/lib/typescript/components/chart/types.d.ts +163 -0
  229. package/lib/typescript/components/chart/types.d.ts.map +1 -0
  230. package/lib/typescript/components/chart/useChartHostWidth.d.ts +9 -0
  231. package/lib/typescript/components/chart/useChartHostWidth.d.ts.map +1 -0
  232. package/lib/typescript/components/index.d.ts +5 -0
  233. package/lib/typescript/components/index.d.ts.map +1 -1
  234. package/lib/typescript/figma/SystemAlert.Button.figma.d.ts +11 -0
  235. package/lib/typescript/figma/SystemAlert.Button.figma.d.ts.map +1 -0
  236. package/lib/typescript/figma/SystemAlert.Close.figma.d.ts +11 -0
  237. package/lib/typescript/figma/SystemAlert.Close.figma.d.ts.map +1 -0
  238. package/lib/typescript/figma/SystemAlert.Description.figma.d.ts +8 -0
  239. package/lib/typescript/figma/SystemAlert.Description.figma.d.ts.map +1 -0
  240. package/lib/typescript/figma/SystemAlert.IconButton.figma.d.ts +11 -0
  241. package/lib/typescript/figma/SystemAlert.IconButton.figma.d.ts.map +1 -0
  242. package/lib/typescript/figma/SystemAlert.figma.d.ts +8 -0
  243. package/lib/typescript/figma/SystemAlert.figma.d.ts.map +1 -0
  244. package/package.json +5 -5
  245. package/src/components/BarChart/geometry.ts +1469 -0
  246. package/src/components/BarChart/index.tsx +1424 -0
  247. package/src/components/BarChart/styles.ts +31 -0
  248. package/src/components/Button/index.tsx +1 -1
  249. package/src/components/LineChart/geometry.ts +957 -0
  250. package/src/components/LineChart/index.tsx +1109 -0
  251. package/src/components/LineChart/styles.ts +26 -0
  252. package/src/components/PieChart/geometry.ts +295 -0
  253. package/src/components/PieChart/index.tsx +715 -0
  254. package/src/components/PieChart/styles.ts +101 -0
  255. package/src/components/ProgressCircle/ProgressCircleRing.tsx +10 -39
  256. package/src/components/ProgressCircle/ProgressRing.tsx +60 -0
  257. package/src/components/ScrollShadow/useScrollShadow.ts +12 -11
  258. package/src/components/Stepper/index.tsx +452 -0
  259. package/src/components/Stepper/styles.ts +234 -0
  260. package/src/components/Stepper/useStepperLabelFit.ts +21 -0
  261. package/src/components/Stepper/useStepperLabelFit.web.ts +53 -0
  262. package/src/components/Stepper/useStepperRingColors.ts +29 -0
  263. package/src/components/SystemAlert/animation.ts +252 -0
  264. package/src/components/SystemAlert/index.tsx +684 -0
  265. package/src/components/SystemAlert/styles.ts +212 -0
  266. package/src/components/SystemAlert/useSystemAlertStatusBarStyle.ts +57 -0
  267. package/src/components/Tabs/index.tsx +4 -0
  268. package/src/components/Tabs/styles.ts +1 -1
  269. package/src/components/chart/ChartInspector.tsx +726 -0
  270. package/src/components/chart/format.ts +95 -0
  271. package/src/components/chart/index.ts +24 -0
  272. package/src/components/chart/motion.ts +98 -0
  273. package/src/components/chart/palette.tsx +247 -0
  274. package/src/components/chart/size.ts +21 -0
  275. package/src/components/chart/ticks.ts +53 -0
  276. package/src/components/chart/types.ts +183 -0
  277. package/src/components/chart/useChartHostWidth.ts +26 -0
  278. package/src/components/index.ts +5 -0
@@ -0,0 +1,248 @@
1
+ import type { ChartAxis, ChartReferenceLine, ChartSeriesBase } from '../chart/types';
2
+ import type { ChartColor } from '../chart/palette';
3
+ /** How points connect. Names match MUI X `curve`. */
4
+ export type LineChartCurve = 'linear' | 'monotoneX' | 'stepAfter';
5
+ export interface LineChartSeries<TRow extends object> extends ChartSeriesBase<TRow> {
6
+ /** Series type. Optional on `LineChart`; reserved for charts that mix bars and lines. */
7
+ type?: 'line';
8
+ /**
9
+ * How points connect. `stepAfter` holds each value until the next point.
10
+ * @default 'monotoneX'
11
+ */
12
+ curve?: LineChartCurve;
13
+ /**
14
+ * Fills under the line toward zero (or the domain edge nearest it) with a fade of the
15
+ * series color.
16
+ * @default false
17
+ */
18
+ area?: boolean;
19
+ /**
20
+ * Draws a mark on each defined point. A function picks points by `index` (the `dataset` row).
21
+ * @default false
22
+ */
23
+ showMark?: boolean | ((params: {
24
+ index: number;
25
+ }) => boolean);
26
+ /**
27
+ * Dashes the whole line.
28
+ * @default false
29
+ */
30
+ dashed?: boolean;
31
+ /**
32
+ * `dataset` row where the line switches from solid to dashed (e.g. actual → forecast). The
33
+ * curve still uses every point, so the join stays smooth.
34
+ */
35
+ dashedFrom?: number;
36
+ }
37
+ export interface LineChartMarker {
38
+ /** `dataset` row to pin to. Rows with the same category label resolve independently. */
39
+ dataIndex: number;
40
+ /** Series to pin to. Defaults to the first series with a value at `dataIndex`. */
41
+ seriesId?: string;
42
+ /** Caption above the point, e.g. "Rent". */
43
+ label?: string;
44
+ /**
45
+ * Draw the formatted value beside the point.
46
+ * @default false
47
+ */
48
+ showValue?: boolean;
49
+ /** Chart token for the dot. Defaults to that series' color. */
50
+ color?: ChartColor;
51
+ /** Extra legend row, e.g. "Today". */
52
+ legend?: string;
53
+ /**
54
+ * Vertical dashed guide through the point.
55
+ * @default true
56
+ */
57
+ guide?: boolean;
58
+ /**
59
+ * Filled dot on the line.
60
+ * @default true
61
+ */
62
+ dot?: boolean;
63
+ }
64
+ export interface LineCategory {
65
+ /** Axis label. */
66
+ readonly label: string;
67
+ /** Tooltip and screen reader name. */
68
+ readonly title: string;
69
+ readonly tick: boolean;
70
+ }
71
+ export interface LineSeriesInput {
72
+ readonly id: string;
73
+ readonly label: string;
74
+ readonly curve: LineChartCurve;
75
+ readonly area: boolean;
76
+ readonly dashed: boolean;
77
+ /** Row where the dash starts, or `-1`. */
78
+ readonly dashAt: number;
79
+ readonly values: readonly (number | null)[];
80
+ }
81
+ export interface LineDomainOptions {
82
+ readonly min?: number;
83
+ readonly max?: number;
84
+ readonly tickNumber?: number;
85
+ }
86
+ export interface LineChartGutters {
87
+ readonly paddingLeft: number;
88
+ readonly paddingRight: number;
89
+ readonly paddingTop: number;
90
+ readonly paddingBottom: number;
91
+ }
92
+ export interface LineChartMarkerLayout {
93
+ readonly key: string;
94
+ readonly index: number;
95
+ readonly seriesIndex: number;
96
+ readonly seriesId: string;
97
+ readonly x: number;
98
+ readonly y: number;
99
+ readonly value: number;
100
+ readonly label?: string;
101
+ readonly showValue: boolean;
102
+ readonly color?: ChartColor;
103
+ readonly legend?: string;
104
+ readonly guide: boolean;
105
+ readonly dot: boolean;
106
+ }
107
+ export interface LinePoint {
108
+ readonly index: number;
109
+ readonly value: number | null;
110
+ readonly x: number;
111
+ readonly y: number | null;
112
+ }
113
+ export interface LineSeriesLayout {
114
+ readonly key: string;
115
+ readonly label: string;
116
+ readonly curve: LineChartCurve;
117
+ readonly area: boolean;
118
+ readonly dashed: boolean;
119
+ readonly path: string;
120
+ readonly dashedPath: string;
121
+ readonly dashAt: number;
122
+ readonly areaPath: string;
123
+ readonly points: readonly LinePoint[];
124
+ }
125
+ export interface LineLabelAnchor {
126
+ readonly label: string;
127
+ readonly title: string;
128
+ readonly x: number;
129
+ readonly y: number;
130
+ readonly tick: boolean;
131
+ }
132
+ export interface LineValueTick {
133
+ readonly value: number;
134
+ readonly x: number;
135
+ readonly y: number;
136
+ readonly text: string;
137
+ }
138
+ export interface LineGridLine {
139
+ readonly x1: number;
140
+ readonly y1: number;
141
+ readonly x2: number;
142
+ readonly y2: number;
143
+ }
144
+ export interface LineChartLayout {
145
+ readonly series: readonly LineSeriesLayout[];
146
+ readonly categoryLabels: readonly LineLabelAnchor[];
147
+ readonly valueTicks: readonly LineValueTick[];
148
+ readonly gridLines: readonly LineGridLine[];
149
+ readonly referenceLines: readonly (LineGridLine & {
150
+ readonly label?: string;
151
+ })[];
152
+ /** Where areas close: zero, or the domain edge nearest it. Lines rise from here on entry. */
153
+ readonly baselineY: number;
154
+ readonly plot: {
155
+ readonly x: number;
156
+ readonly y: number;
157
+ readonly width: number;
158
+ readonly height: number;
159
+ };
160
+ }
161
+ export declare const MIN_LINE_POINT_BAND = 32;
162
+ /** Max distance from a series stroke (overlay px) that still counts as hovering the line. */
163
+ export declare const LINE_POINTER_HIT_PX = 20;
164
+ /** Extra radius around a plotted point (dots / markers) so a valley like Lowest is easy to hit. */
165
+ export declare const LINE_POINT_HIT_PX = 28;
166
+ /** Extra plot padding when a marker draws a caption or value. */
167
+ export declare const LINE_MARKER_PADDING_TOP = 28;
168
+ export declare const LINE_MARKER_PADDING_RIGHT = 36;
169
+ export declare const DEFAULT_LINE_TICK_NUMBER = 4;
170
+ /**
171
+ * Maps the public `dataset` + `series` + `xAxis` props onto geometry inputs. Row keys are read
172
+ * only through `dataKey`, so no key is reserved.
173
+ */
174
+ export declare function resolveLineChartData<TRow extends object>({ dataset, series, xAxis, }: {
175
+ readonly dataset: readonly TRow[];
176
+ readonly series: readonly LineChartSeries<TRow>[];
177
+ readonly xAxis?: ChartAxis<TRow>;
178
+ }): {
179
+ readonly categories: LineCategory[];
180
+ readonly series: LineSeriesInput[];
181
+ };
182
+ export declare function lineChartGutters({ showValueTicks, showCategoryLabels, }?: {
183
+ readonly showValueTicks?: boolean;
184
+ readonly showCategoryLabels?: boolean;
185
+ }): LineChartGutters;
186
+ export declare function resolveLineChartContentSize({ viewportWidth, viewportHeight, categoryCount, gutters, scrollable, visiblePoints, }: {
187
+ readonly viewportWidth: number;
188
+ readonly viewportHeight: number;
189
+ readonly categoryCount: number;
190
+ readonly gutters: LineChartGutters;
191
+ readonly scrollable: boolean;
192
+ readonly visiblePoints?: number;
193
+ }): {
194
+ readonly width: number;
195
+ readonly height: number;
196
+ };
197
+ /**
198
+ * Value domain and ticks. `min` / `max` pin that end exactly; an open end rounds to a readable
199
+ * tick. `tickNumber` is approximate.
200
+ */
201
+ export declare function lineValueDomain(values: readonly number[], { min: minOption, max: maxOption, tickNumber }?: LineDomainOptions): {
202
+ readonly min: number;
203
+ readonly max: number;
204
+ readonly ticks: readonly number[];
205
+ };
206
+ /**
207
+ * Line and area paths for one series. `ys` uses `NaN` for missing values, which
208
+ * open a gap. Runs on the UI thread while a chart animates.
209
+ * `dashAt` is a category index; cubics before it stay solid, after it dashed,
210
+ * using the same monotone tangents so the join stays round.
211
+ */
212
+ export declare function lineSeriesPaths(xs: readonly number[], ys: readonly number[], curve: LineChartCurve, baselineY: number, dashAt?: number): {
213
+ readonly path: string;
214
+ readonly dashedPath: string;
215
+ readonly areaPath: string;
216
+ };
217
+ /** Pins each marker to its `dataIndex` row; markers that cannot resolve are dropped. */
218
+ export declare function layoutLineChartMarkers(markers: readonly LineChartMarker[], series: readonly LineSeriesLayout[]): readonly LineChartMarkerLayout[];
219
+ /**
220
+ * Category index of the closest point on any series stroke, or `null` when the pointer is
221
+ * farther than `maxDistance` from every line. Overlay coordinates (`plot.x` already subtracted).
222
+ * Uses the same monotone cubics as the painted path so a valley (Lowest) still hits.
223
+ */
224
+ export declare function nearestCategoryOnLines(series: readonly LineSeriesLayout[], overlayX: number, overlayY: number, plotOffsetX: number, maxDistance: number, pointDistance?: number): number | null;
225
+ /**
226
+ * Category under the pointer when it is inside the plot box. Snaps to the nearest category on X.
227
+ * Overlay coordinates (`plot.x` already subtracted).
228
+ */
229
+ export declare function nearestCategoryInPlot(labels: readonly {
230
+ readonly x: number;
231
+ }[], plot: {
232
+ readonly x: number;
233
+ readonly y: number;
234
+ readonly width: number;
235
+ readonly height: number;
236
+ }, overlayX: number, overlayY: number, plotOffsetX: number): number | null;
237
+ export declare function lineChartMarkerGutters(categoryCount: number, markers: readonly LineChartMarker[] | undefined, base?: LineChartGutters): LineChartGutters;
238
+ export declare function layoutLineChart({ categories, series, width, height, referenceLines, yAxis, formatTick, gutters: guttersProp, }: {
239
+ readonly categories: readonly LineCategory[];
240
+ readonly series: readonly LineSeriesInput[];
241
+ readonly width: number;
242
+ readonly height: number;
243
+ readonly referenceLines?: readonly ChartReferenceLine[];
244
+ readonly yAxis?: LineDomainOptions;
245
+ readonly formatTick?: (value: number) => string;
246
+ readonly gutters?: LineChartGutters;
247
+ }): LineChartLayout;
248
+ //# sourceMappingURL=geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.d.ts","sourceRo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,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EACjG,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CAoBf;AAED,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,SAAS,EAC/C,IAAI,GAAE,gBAAqC,GAC1C,gBAAgB,CAgBlB;AAED,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,MAAM,EACN,KAAK,EACL,MAAM,EACN,cAAmB,EACnB,KAAK,EACL,UAAmB,EACnB,OAAO,EAAE,WAAW,GACrB,EAAE;IACD,QAAQ,CAAC,UAAU,EAAE,SAAS,YAAY,EAAE,CAAC;IAC7C,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACxD,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAChD,QAAQ,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC;CACrC,GAAG,eAAe,CAgHlB"}
@@ -0,0 +1,105 @@
1
+ import { type ForwardedRef, type ReactElement } from 'react';
2
+ import { View, type ViewProps } from 'react-native';
3
+ import type { AnimationRootDisableAll } from '../../animation';
4
+ import type { ChartAxis, ChartGrid, ChartLocaleText, ChartReferenceLine, ChartSelectedItem, ChartSizeProps, ChartTooltipProps } from '../chart/types';
5
+ import { type ChartPalette } from '../chart/palette';
6
+ import { type LineChartCurve, type LineChartMarker, type LineChartSeries } from './geometry';
7
+ export type * from '../chart';
8
+ export type { LineChartCurve, LineChartMarker, LineChartSeries };
9
+ export interface LineChartProps<TRow extends object = object> extends ViewProps, ChartSizeProps {
10
+ /**
11
+ * One object per point, in x order. Columns are read only through `xAxis[0].dataKey` and
12
+ * `series[].dataKey`, so any key (including `label` or `tick`) is plain data. Non-finite
13
+ * values open a gap in that series.
14
+ */
15
+ dataset: readonly TRow[];
16
+ /** One line per entry. */
17
+ series: readonly LineChartSeries<TRow>[];
18
+ /**
19
+ * Category axis. Only the first entry is read; `dataKey` names the column with the category
20
+ * labels (defaults to the row index).
21
+ */
22
+ xAxis?: readonly ChartAxis<TRow>[];
23
+ /**
24
+ * Value axis. Only the first entry is read. `min` / `max` / `tickNumber` set the domain.
25
+ * `position: 'none'` hides the ticks; other sides draw on the left.
26
+ */
27
+ yAxis?: readonly ChartAxis<TRow>[];
28
+ /**
29
+ * Grid lines behind the plot. Only `horizontal` (at each value tick) is drawn; it stays on
30
+ * unless set to `false`.
31
+ * @default { horizontal: true }
32
+ */
33
+ grid?: ChartGrid;
34
+ /**
35
+ * Default series colors. `auto` uses the FI brand family (`simple-primary`, `-secondary`,
36
+ * `-tertiary`) for up to three series and switches the whole chart to `categorical-1`…`6`
37
+ * past that. `categorical` always uses the categorical slots. A series `color` wins.
38
+ * @default 'auto'
39
+ */
40
+ palette?: ChartPalette;
41
+ /**
42
+ * Hides the series legend under the chart.
43
+ * @default false
44
+ */
45
+ hideLegend?: boolean;
46
+ /**
47
+ * Shows every series at a category on hover, keyboard focus, or tap. On web, Tab / Shift+Tab
48
+ * and arrow keys move between categories, Tab past the last one leaves the chart, Home / End
49
+ * jump to the ends, and Escape hides the tooltip. `'item'` behaves like `'axis'` in v1.
50
+ * `'none'` hides it.
51
+ * @default { trigger: 'axis' }
52
+ */
53
+ tooltip?: ChartTooltipProps;
54
+ /**
55
+ * Controlled selection. `dataIndex` is the category; `seriesId` is the first series with a
56
+ * value there. `null` clears it. Omit to let the chart track selection itself.
57
+ */
58
+ selectedItem?: ChartSelectedItem;
59
+ /**
60
+ * Initial selection when `selectedItem` is omitted. Also makes the chart selectable.
61
+ */
62
+ defaultSelectedItem?: ChartSelectedItem;
63
+ /**
64
+ * Called when a category is pressed, with `null` when the selected category is pressed again.
65
+ * Providing this, `selectedItem`, or `defaultSelectedItem` makes the chart selectable and draws a crosshair.
66
+ */
67
+ onSelectedItemChange?: (item: ChartSelectedItem) => void;
68
+ /**
69
+ * When points need more room than the visible box, scroll instead of squeezing.
70
+ * The value axis stays pinned.
71
+ * @default true
72
+ */
73
+ scrollable?: boolean;
74
+ /**
75
+ * How many points fit in the viewport when `scrollable` is on. Omit to use a
76
+ * readable minimum band (~32px).
77
+ */
78
+ visiblePoints?: number;
79
+ /** Dashed horizontal lines across the plot at a value, with an optional caption. */
80
+ referenceLines?: readonly ChartReferenceLine[];
81
+ /** Point callouts (event name, value, extra legend row), pinned by `dataIndex`. */
82
+ markers?: readonly LineChartMarker[];
83
+ /**
84
+ * BCP 47 locale for default number formatting. Defaults to the `@cdx-ui/formatters` locale.
85
+ */
86
+ locale?: string;
87
+ /** Overrides for generated strings (summary, no-value text, default series name). */
88
+ localeText?: Partial<ChartLocaleText>;
89
+ /**
90
+ * Lines rise from the baseline on mount and tween to new values when `dataset` changes. Pass
91
+ * `'disable-all'` to draw the final state. Reduce Motion and `GlobalAnimationSettingsProvider`
92
+ * `disable-all` also turn it off.
93
+ */
94
+ animation?: AnimationRootDisableAll;
95
+ /** Accessible summary. Defaults to `localeText.lineChartSummary` of the last category. */
96
+ accessibilityLabel?: string;
97
+ /** Additional Uniwind/Tailwind classes, merged after the root's own styles. */
98
+ className?: string;
99
+ }
100
+ export declare const LineChart: (<TRow extends object>(props: LineChartProps<TRow> & {
101
+ ref?: ForwardedRef<View>;
102
+ }) => ReactElement | null) & {
103
+ displayName?: string;
104
+ };
105
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+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B,CAAC;IAC5B;;;OAGG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC;;OAEG;IACH,mBAAmB,CAAC,EAAE,iBAAiB,CAAC;IACxC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACzD;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oFAAoF;IACpF,cAAc,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC/C,mFAAmF;IACnF,OAAO,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACrC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,UAAU,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACtC;;;;OAIG;IACH,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC,0FAA0F;IAC1F,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAgWD,eAAO,MAAM,SAAS,EAAiC,CAAC,CAAC,IAAI,SAAS,MAAM,EAC1E,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;CAAE,KACvD,YAAY,GAAG,IAAI,CAAC,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type VariantProps } from '@cdx-ui/utils';
2
+ export declare const lineChartRootVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
3
+ export declare const lineChartLegendVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
4
+ export declare const lineChartLegendItemVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
5
+ export declare const lineChartLegendLabelVariants: (props?: ({
6
+ selected?: boolean | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ export type LineChartLegendLabelVariantProps = VariantProps<typeof lineChartLegendLabelVariants>;
9
+ export declare const LINE_STROKE_WIDTH = 2;
10
+ export declare const LINE_DOT_RADIUS = 3;
11
+ export declare const LINE_ACTIVE_DOT_RADIUS = 5;
12
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/LineChart/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAEvD,eAAO,MAAM,qBAAqB,oFAA8C,CAAC;AAEjF,eAAO,MAAM,uBAAuB,oFAEnC,CAAC;AAEF,eAAO,MAAM,2BAA2B,oFAAuC,CAAC;AAEhF,eAAO,MAAM,4BAA4B;;8EAUvC,CAAC;AAEH,MAAM,MAAM,gCAAgC,GAAG,YAAY,CAAC,OAAO,4BAA4B,CAAC,CAAC;AACjG,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,sBAAsB,IAAI,CAAC"}
@@ -0,0 +1,43 @@
1
+ export interface PieSliceInput {
2
+ readonly id: string;
3
+ readonly label: string;
4
+ readonly value: number;
5
+ }
6
+ export interface PieSliceLayout {
7
+ readonly id: string;
8
+ readonly index: number;
9
+ readonly label: string;
10
+ readonly value: number;
11
+ readonly percentage: number;
12
+ readonly startAngle: number;
13
+ readonly endAngle: number;
14
+ readonly path: string;
15
+ }
16
+ export interface PieRadii {
17
+ readonly cx: number;
18
+ readonly cy: number;
19
+ readonly outerRadius: number;
20
+ readonly innerRadius: number;
21
+ }
22
+ export interface SlicePathOptions extends PieRadii {
23
+ readonly startAngle: number;
24
+ readonly endAngle: number;
25
+ readonly cornerRadius?: number;
26
+ }
27
+ /**
28
+ * SVG arc commands cannot draw a 360° sweep in one segment, so a full ring is
29
+ * two semicircles.
30
+ */
31
+ export declare function slicePath({ cx, cy, outerRadius, innerRadius, startAngle, endAngle, cornerRadius, }: SlicePathOptions): string;
32
+ export declare function pieRadii(size: number, innerRadiusRatio: number): PieRadii;
33
+ /** `innerRadius` in pixels or as a percent of the outer radius, as a 0–1 ratio. */
34
+ export declare function resolveInnerRadiusRatio(innerRadius: number | string, size: number): number;
35
+ export declare function layoutPieSlices({ data, size, innerRadiusRatio, paddingAngle, cornerRadius, }: {
36
+ readonly data: readonly PieSliceInput[];
37
+ readonly size: number;
38
+ readonly innerRadiusRatio: number;
39
+ /** Degrees between neighboring slices. */
40
+ readonly paddingAngle?: number;
41
+ readonly cornerRadius?: number;
42
+ }): PieSliceLayout[];
43
+ //# sourceMappingURL=geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../../src/components/PieChart/geometry.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IAChD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AA4CD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACxB,EAAE,EACF,EAAE,EACF,WAAW,EACX,WAAW,EACX,UAAU,EACV,QAAQ,EACR,YAAgB,GACjB,EAAE,gBAAgB,GAAG,MAAM,CAmI3B;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,QAAQ,CAQzE;AAED,mFAAmF;AACnF,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAU1F;AAED,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,IAAI,EACJ,gBAAgB,EAChB,YAAgB,EAChB,YAAY,GACb,EAAE;IACD,QAAQ,CAAC,IAAI,EAAE,SAAS,aAAa,EAAE,CAAC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,0CAA0C;IAC1C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC,GAAG,cAAc,EAAE,CAyCnB"}
@@ -0,0 +1,147 @@
1
+ import { type ReactNode } from 'react';
2
+ import { View, type ViewProps } from 'react-native';
3
+ import type { AnimationRootDisableAll } from '../../animation';
4
+ import type { ChartLocaleText, ChartSelectedItem, ChartSeriesCommon, ChartSizeProps, ChartTooltipProps, ChartValueFormatterContext } from '../chart/types';
5
+ import { type ChartColor } from '../chart/palette';
6
+ import { type PieChartLegendLayout, type PieChartLegendPlacement } from './styles';
7
+ export type * from '../chart';
8
+ export type { PieChartLegendLayout, PieChartLegendPlacement };
9
+ /** One slice. Same shape as MUI X `PieValueType`. */
10
+ export interface PieChartValue {
11
+ /**
12
+ * Stable slice id. React keys and animation follow it, so a reordered slice moves to its new
13
+ * position instead of the slices morphing by index.
14
+ */
15
+ id: string;
16
+ /**
17
+ * Must be a positive finite number. Zero, negative, and `NaN` slices are skipped so they cannot
18
+ * break an arc; `dataIndex` still counts them.
19
+ */
20
+ value: number;
21
+ /** Legend, tooltip, and screen reader name. Defaults to `id`. */
22
+ label?: string;
23
+ /** Chart token for this slice. Defaults to the next `categorical-1`…`6` slot. */
24
+ color?: ChartColor;
25
+ }
26
+ /**
27
+ * Turns a slice's 0–1 share of the visible total into text. `location` is `label` for the
28
+ * legend and `a11y` for screen reader labels and the summary.
29
+ */
30
+ export type PieShareFormatter = (share: number, context: ChartValueFormatterContext) => string;
31
+ /** One ring of slices. Same shape as MUI X `PieSeriesType`; slices carry their own `color`. */
32
+ export interface PieChartSeries extends Omit<ChartSeriesCommon, 'color'> {
33
+ /** Series kind. Optional while `PieChart` only draws pies. */
34
+ type?: 'pie';
35
+ /** Slices, drawn clockwise from 12 o'clock in array order. */
36
+ data: readonly PieChartValue[];
37
+ /**
38
+ * Hole radius. A number is pixels; a string such as `'68%'` is a percent of the outer radius.
39
+ * `0` is a full pie. Clamped to 85% of the outer radius.
40
+ * @default 0
41
+ */
42
+ innerRadius?: number | `${number}%`;
43
+ /**
44
+ * Degrees between neighboring slices. Skipped on slices too thin to fit it.
45
+ * @default 0
46
+ */
47
+ paddingAngle?: number;
48
+ /**
49
+ * Rounds slice corners in pixels. Donuts round all four corners; pies round the outer edge.
50
+ * Clamped so thin slices stay valid.
51
+ * @default 0
52
+ */
53
+ cornerRadius?: number;
54
+ /**
55
+ * Formats the legend share column and the share in screen reader text. MUI X has no share
56
+ * column, so there is no MUI name. Defaults to a whole percent for `locale`.
57
+ */
58
+ shareFormatter?: PieShareFormatter;
59
+ }
60
+ /** The slice under the pointer or keyboard focus, falling back to the selected slice. */
61
+ export interface PieChartActiveSlice {
62
+ /** The slice `id`. */
63
+ id: string;
64
+ /** Index into the series `data`, including slices that were skipped. */
65
+ dataIndex: number;
66
+ /** The slice `label`, or its `id` when it has none. */
67
+ label: string;
68
+ /** The raw slice `value`, unformatted. */
69
+ value: number;
70
+ /** Share of the visible total, from 0 to 1. */
71
+ percentage: number;
72
+ }
73
+ export interface PieChartProps extends ViewProps, ChartSizeProps {
74
+ /**
75
+ * Pie series. Only the first renders; more than one logs a development warning. The pie
76
+ * diameter is the shorter side of the `size` / `width` / `height` box.
77
+ */
78
+ series: readonly PieChartSeries[];
79
+ /**
80
+ * Hides the category legend. With the legend hidden, a selectable chart makes each slice a
81
+ * button; otherwise the plot is one image with a generated summary.
82
+ * @default false
83
+ */
84
+ hideLegend?: boolean;
85
+ /**
86
+ * How legend items are laid out when `legendPlacement` is `top` or `bottom`.
87
+ * `wrap` is centered chips (`Housing 46%`). `list` is full-width rows: name
88
+ * on the left, formatted value and share on the right, with a hairline between
89
+ * rows. Ignored when the legend is on the left or right.
90
+ * @default 'wrap'
91
+ */
92
+ legendLayout?: PieChartLegendLayout;
93
+ /**
94
+ * Where the legend sits relative to the plot, matching Drawer `placement`.
95
+ * `top` / `bottom` use `legendLayout`. `left` / `right` are swatch + name only
96
+ * (no amount, no percent).
97
+ * @default 'bottom'
98
+ */
99
+ legendPlacement?: PieChartLegendPlacement;
100
+ /**
101
+ * `item` shows the slice under the pointer or keyboard focus (on touch, the slice under the finger until it lifts).
102
+ * `axis` behaves like `item` because a pie has no axis. `none` hides the tooltip.
103
+ * @default { trigger: 'item' }
104
+ */
105
+ tooltip?: ChartTooltipProps;
106
+ /**
107
+ * Content in the donut hole. A string becomes styled `Text`. Pass a `View` for
108
+ * stacked copy such as “Total” over an amount.
109
+ * Pass a function to follow the active slice: it receives the hovered or focused
110
+ * slice, else the selected one, else `null` — return the total for `null`.
111
+ */
112
+ centerLabel?: ReactNode | ((slice: PieChartActiveSlice | null) => ReactNode);
113
+ /**
114
+ * Controlled selected slice: `{ seriesId, dataIndex }`, where `dataIndex` counts skipped
115
+ * slices. Pass `null` to clear the selection while staying controlled.
116
+ */
117
+ selectedItem?: ChartSelectedItem;
118
+ /** Initial selected slice when `selectedItem` is omitted. */
119
+ defaultSelectedItem?: ChartSelectedItem;
120
+ /**
121
+ * Called when a slice or legend row is pressed. Pressing the selected slice again reports
122
+ * `null`. Providing this, `selectedItem`, or `defaultSelectedItem` makes the chart selectable.
123
+ */
124
+ onSelectedItemChange?: (item: ChartSelectedItem) => void;
125
+ /**
126
+ * BCP 47 locale for default value and share formatting. Defaults to the `@cdx-ui/formatters`
127
+ * locale.
128
+ */
129
+ locale?: string;
130
+ /** Overrides for generated strings such as the screen reader summary. */
131
+ localeText?: Partial<ChartLocaleText>;
132
+ /**
133
+ * Slices sweep in clockwise on mount and tween to new shares when `data` changes. Pass
134
+ * `'disable-all'` to draw the final state. Reduce Motion and `GlobalAnimationSettingsProvider`
135
+ * `disable-all` also turn it off.
136
+ */
137
+ animation?: AnimationRootDisableAll;
138
+ /**
139
+ * Names the plot image. Defaults to `localeText.pieChartSummary` over labels and shares. Not
140
+ * applied when `hideLegend` on a selectable chart makes each slice a button.
141
+ */
142
+ accessibilityLabel?: string;
143
+ /** Additional Uniwind/Tailwind classes, merged after the root's own styles. */
144
+ className?: string;
145
+ }
146
+ export declare const PieChart: import("react").ForwardRefExoticComponent<PieChartProps & import("react").RefAttributes<View>>;
147
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/PieChart/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzF,OAAO,EAA6B,IAAI,EA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{ type VariantProps } from '@cdx-ui/utils';
2
+ export type PieChartLegendPlacement = 'top' | 'bottom' | 'left' | 'right';
3
+ export declare const pieChartRootVariants: (props?: ({
4
+ placement?: "bottom" | "left" | "right" | "top" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ export declare const pieChartCanvasVariants: (props?: ({
7
+ size?: "sm" | "md" | "lg" | "xl" | null | undefined;
8
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
+ export type PieChartLegendLayout = 'wrap' | 'list';
10
+ export declare const pieChartLegendVariants: (props?: ({
11
+ layout?: "list" | "wrap" | "names" | null | undefined;
12
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
13
+ export declare const pieChartLegendItemVariants: (props?: ({
14
+ layout?: "list" | "wrap" | "names" | null | undefined;
15
+ divided?: boolean | null | undefined;
16
+ interactive?: boolean | null | undefined;
17
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
18
+ export declare const pieChartLegendLabelVariants: (props?: ({
19
+ selected?: boolean | null | undefined;
20
+ layout?: "list" | "wrap" | "names" | null | undefined;
21
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
22
+ export declare const pieChartLegendMetaVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
23
+ export declare const pieChartLegendShareVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
24
+ export declare const pieChartCenterLabelVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
25
+ export type PieChartRootVariantProps = VariantProps<typeof pieChartCanvasVariants>;
26
+ export type PieChartLegendLabelVariantProps = VariantProps<typeof pieChartLegendLabelVariants>;
27
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/PieChart/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1E,eAAO,MAAM,oBAAoB;;8EAY/B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;8EAelC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnD,eAAO,MAAM,sBAAsB;;8EAWjC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;8EAqBrC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;8EAgBtC,CAAC;AAEH,eAAO,MAAM,0BAA0B,oFAAkD,CAAC;AAE1F,eAAO,MAAM,2BAA2B,oFAAsD,CAAC;AAE/F,eAAO,MAAM,2BAA2B,oFAEvC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,YAAY,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACnF,MAAM,MAAM,+BAA+B,GAAG,YAAY,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressCircleRing.d.ts","sourceRoot":"","sources":["../../../../src/components/ProgressCircle/ProgressCircleRing.tsx"],"names":[],"mappings":"AAWA,OAAO,EAA8B,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAM/E,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACxC;AAED,wBAAgB,kBAAkB,CAAC,EAAE,IAAc,EAAE,KAAiB,EAAE,EAAE,uBAAuB,2CAkFhG"}
1
+ {"version":3,"file":"ProgressCircleRing.d.ts","sourceRoot":"","sources":["../../../../src/components/ProgressCircle/ProgressCircleRing.tsx"],"names":[],"mappings":"AAWA,OAAO,EAA8B,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAM/E,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACxC;AAED,wBAAgB,kBAAkB,CAAC,EAAE,IAAc,EAAE,KAAiB,EAAE,EAAE,uBAAuB,2CAqDhG"}
@@ -0,0 +1,17 @@
1
+ export interface ProgressRingProps {
2
+ /** Outer diameter in px. */
3
+ readonly size: number;
4
+ readonly strokeWidth: number;
5
+ /** Arc length as a percentage of the circumference, 0–100. */
6
+ readonly value: number;
7
+ readonly trackColor: string;
8
+ readonly indicatorColor: string;
9
+ /** @default 1 */
10
+ readonly trackOpacity?: number;
11
+ }
12
+ /**
13
+ * Size-agnostic determinate ring: a full track plus a round-capped arc starting at 12 o'clock.
14
+ * Internal to `@cdx-ui/components`; shared by `ProgressCircle` and `Stepper.Indicator`.
15
+ */
16
+ export declare function ProgressRing({ size, strokeWidth, value, trackColor, indicatorColor, trackOpacity, }: ProgressRingProps): import("react/jsx-runtime").JSX.Element;
17
+ //# sourceMappingURL=ProgressRing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProgressRing.d.ts","sourceRoot":"","sources":["../../../../src/components/ProgressCircle/ProgressRing.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,iBAAiB;IACjB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,WAAW,EACX,KAAK,EACL,UAAU,EACV,cAAc,EACd,YAAgB,GACjB,EAAE,iBAAiB,2CAkCnB"}