@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,25 @@
1
+ "use strict";
2
+
3
+ // url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=8228-5930
4
+ // source=packages/components/src/components/SystemAlert/index.tsx
5
+ // component=SystemAlert.IconAction
6
+ import figma from 'figma';
7
+ const instance = figma.selectedInstance;
8
+
9
+ // Only the icon carries over from the nested IconButton: SystemAlert.IconAction fixes the ghost
10
+ // small variant and restyles it for the strong surface, and the IconButton template would emit
11
+ // `color=""`.
12
+ const iconButton = instance.findInstance('IconButton');
13
+ const iconResult = iconButton.type === 'INSTANCE' ? iconButton.getInstanceSwap('icon')?.executeTemplate() : undefined;
14
+ const iconName = iconResult?.metadata?.props?.componentName;
15
+ const iconSnippet = iconName ?? iconResult?.example;
16
+ const iconImports = iconName ? [`import { ${iconName} } from '@cdx-ui/icons'`] : [];
17
+ export default {
18
+ id: 'system-alert-icon-button',
19
+ imports: ["import { SystemAlert } from '@cdx-ui/components'", ...iconImports],
20
+ example: figma.code`<SystemAlert.IconAction as={${iconSnippet}} accessibilityLabel="Action" onPress={() => {}} />`,
21
+ metadata: {
22
+ nestable: true
23
+ }
24
+ };
25
+ //# sourceMappingURL=SystemAlert.IconButton.figma.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["figma","instance","selectedInstance","iconButton","findInstance","iconResult","type","getInstanceSwap","executeTemplate","undefined","iconName","metadata","props","componentName","iconSnippet","example","iconImports","id","imports","code","nestable"],"sourceRoot":"../../../src","sources":["figma/SystemAlert.IconButton.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;;AAEvC;AACA;AACA;AACA,MAAMC,UAAU,GAAGF,QAAQ,CAACG,YAAY,CAAC,YAAY,CAAC;AACtD,MAAMC,UAAU,GACdF,UAAU,CAACG,IAAI,KAAK,UAAU,GAC1BH,UAAU,CAACI,eAAe,CAAC,MAAM,CAAC,EAAEC,eAAe,CAAC,CAAC,GACrDC,SAAS;AACf,MAAMC,QAAQ,GAAGL,UAAU,EAAEM,QAAQ,EAAEC,KAAK,EAAEC,aAAmC;AACjF,MAAMC,WAAW,GAAGJ,QAAQ,IAAIL,UAAU,EAAEU,OAAO;AAEnD,MAAMC,WAAW,GAAGN,QAAQ,GAAG,CAAC,YAAYA,QAAQ,yBAAyB,CAAC,GAAG,EAAE;AAEnF,eAAe;EACbO,EAAE,EAAE,0BAA0B;EAC9BC,OAAO,EAAE,CAAC,kDAAkD,EAAE,GAAGF,WAAW,CAAC;EAC7ED,OAAO,EAAEf,KAAK,CAACmB,IAAI,+BAA+BL,WAAW,qDAAqD;EAClHH,QAAQ,EAAE;IAAES,QAAQ,EAAE;EAAK;AAC7B,CAAC","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ // url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=8228-5936
4
+ // source=packages/components/src/components/SystemAlert/index.tsx
5
+ // component=SystemAlert
6
+ import figma from 'figma';
7
+ const instance = figma.selectedInstance;
8
+
9
+ // Figma `severity` is `color` in code: `brand` is a colour treatment with no urgency, so it is
10
+ // not a severity value. `Viewport` is excluded: Narrow and Wide differ only by frame width and the
11
+ // drawn status bar, which `hasSafeAreaInset` (default `true`) covers at runtime.
12
+ const color = instance.getEnum('severity', {
13
+ danger: 'danger',
14
+ warning: 'warning',
15
+ success: 'success',
16
+ info: undefined,
17
+ brand: 'brand'
18
+ });
19
+ const colorProp = figma.helpers.react.renderProp('color', color);
20
+ const descriptionInstance = instance.findInstance('SystemAlert.Description');
21
+ const descriptionSnippet = descriptionInstance.type === 'INSTANCE' ? descriptionInstance.executeTemplate().example : null;
22
+ const showTrailingSlot = instance.getBoolean('Show TrailingSlot?');
23
+ const trailingIds = ['system-alert-button', 'system-alert-icon-button', 'system-alert-close'];
24
+ const trailingInstances = showTrailingSlot ? instance.findConnectedInstances(node => trailingIds.includes(node.codeConnectId() ?? '')).filter(node => node.type === 'INSTANCE') : [];
25
+
26
+ // SystemAlert.Close is the root's `onClose`, not a child of SystemAlert.Actions.
27
+ const hasClose = trailingInstances.some(node => node.codeConnectId() === 'system-alert-close');
28
+ const onCloseProp = hasClose ? figma.helpers.react.renderProp('onClose', figma.helpers.react.function('() => {}')) : '';
29
+ const actionSnippets = trailingInstances.filter(node => node.codeConnectId() !== 'system-alert-close').flatMap(node => node.executeTemplate().example);
30
+ export default {
31
+ id: 'system-alert',
32
+ imports: ["import { SystemAlert } from '@cdx-ui/components'"],
33
+ example: figma.code`
34
+ <SystemAlert${colorProp}${onCloseProp}>
35
+ <SystemAlert.Icon />
36
+ ${descriptionSnippet}
37
+ ${actionSnippets.length > 0 ? figma.code`<SystemAlert.Actions>
38
+ ${actionSnippets}
39
+ </SystemAlert.Actions>` : null}
40
+ </SystemAlert>`
41
+ };
42
+ //# sourceMappingURL=SystemAlert.figma.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["figma","instance","selectedInstance","color","getEnum","danger","warning","success","info","undefined","brand","colorProp","helpers","react","renderProp","descriptionInstance","findInstance","descriptionSnippet","type","executeTemplate","example","showTrailingSlot","getBoolean","trailingIds","trailingInstances","findConnectedInstances","node","includes","codeConnectId","filter","hasClose","some","onCloseProp","function","actionSnippets","flatMap","id","imports","code","length"],"sourceRoot":"../../../src","sources":["figma/SystemAlert.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;;AAEvC;AACA;AACA;AACA,MAAMC,KAAK,GAAGF,QAAQ,CAACG,OAAO,CAAC,UAAU,EAAE;EACzCC,MAAM,EAAE,QAAQ;EAChBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,IAAI,EAAEC,SAAS;EACfC,KAAK,EAAE;AACT,CAAC,CAAC;AACF,MAAMC,SAAS,GAAGX,KAAK,CAACY,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,OAAO,EAAEX,KAAK,CAAC;AAEhE,MAAMY,mBAAmB,GAAGd,QAAQ,CAACe,YAAY,CAAC,yBAAyB,CAAC;AAC5E,MAAMC,kBAAkB,GACtBF,mBAAmB,CAACG,IAAI,KAAK,UAAU,GAAGH,mBAAmB,CAACI,eAAe,CAAC,CAAC,CAACC,OAAO,GAAG,IAAI;AAEhG,MAAMC,gBAAgB,GAAGpB,QAAQ,CAACqB,UAAU,CAAC,oBAAoB,CAAC;AAClE,MAAMC,WAAW,GAAG,CAAC,qBAAqB,EAAE,0BAA0B,EAAE,oBAAoB,CAAC;AAC7F,MAAMC,iBAAiB,GAAGH,gBAAgB,GACtCpB,QAAQ,CACLwB,sBAAsB,CAAEC,IAAI,IAAKH,WAAW,CAACI,QAAQ,CAACD,IAAI,CAACE,aAAa,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAClFC,MAAM,CAAEH,IAAI,IAA6CA,IAAI,CAACR,IAAI,KAAK,UAAU,CAAC,GACrF,EAAE;;AAEN;AACA,MAAMY,QAAQ,GAAGN,iBAAiB,CAACO,IAAI,CAAEL,IAAI,IAAKA,IAAI,CAACE,aAAa,CAAC,CAAC,KAAK,oBAAoB,CAAC;AAChG,MAAMI,WAAW,GAAGF,QAAQ,GACxB9B,KAAK,CAACY,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,SAAS,EAAEd,KAAK,CAACY,OAAO,CAACC,KAAK,CAACoB,QAAQ,CAAC,UAAU,CAAC,CAAC,GACnF,EAAE;AAEN,MAAMC,cAAc,GAAGV,iBAAiB,CACrCK,MAAM,CAAEH,IAAI,IAAKA,IAAI,CAACE,aAAa,CAAC,CAAC,KAAK,oBAAoB,CAAC,CAC/DO,OAAO,CAAET,IAAI,IAAKA,IAAI,CAACP,eAAe,CAAC,CAAC,CAACC,OAAO,CAAC;AAEpD,eAAe;EACbgB,EAAE,EAAE,cAAc;EAClBC,OAAO,EAAE,CAAC,kDAAkD,CAAC;EAC7DjB,OAAO,EAAEpB,KAAK,CAACsC,IAAI;AACrB,cAAc3B,SAAS,GAAGqB,WAAW;AACrC;AACA,IAAIf,kBAAkB;AACtB,IACIiB,cAAc,CAACK,MAAM,GAAG,CAAC,GACrBvC,KAAK,CAACsC,IAAI;AAClB,MAAMJ,cAAc;AACpB,yBAAyB,GACjB,IAAI;AACZ;AAEA,CAAC","ignoreList":[]}
@@ -0,0 +1,236 @@
1
+ export type BarChartOrientation = 'vertical' | 'horizontal';
2
+ /**
3
+ * Where category names sit around the plot. `top` / `bottom` apply to vertical
4
+ * bars; `left` / `right` apply to horizontal bars. Other combinations fall back
5
+ * to `bottom` or `left`. `none` draws no category names.
6
+ */
7
+ export type BarChartCategoryLabelPosition = 'top' | 'bottom' | 'left' | 'right' | 'none';
8
+ /**
9
+ * How a stack group piles its series. `diverging` stacks positive values up and negative values
10
+ * down from zero. `none` adds every value to one running total. `expand` scales each category to
11
+ * the same length, so segments show their share.
12
+ */
13
+ export type BarStackOffset = 'diverging' | 'none' | 'expand';
14
+ /** How the chart draws its series: side by side or stacked, a comparison overlay, or a waterfall. */
15
+ export type BarChartKind = 'bars' | 'overlay' | 'waterfall';
16
+ export type BarWaterfallRole = 'total' | 'increase' | 'decrease';
17
+ /** A series resolved for layout. `id` is the public series id. */
18
+ export interface BarGeometrySeries {
19
+ readonly id: string;
20
+ readonly dataKey: string;
21
+ readonly label: string;
22
+ /** Stack group id. Series with the same id share one bar per category. */
23
+ readonly stack?: string;
24
+ readonly stackOffset?: BarStackOffset;
25
+ }
26
+ export interface BarChartReferenceLine {
27
+ readonly value: number;
28
+ readonly label?: string;
29
+ }
30
+ export interface BarValueAxisConfig {
31
+ readonly min?: number;
32
+ readonly max?: number;
33
+ readonly tickNumber?: number;
34
+ }
35
+ export interface BarRect {
36
+ /** Row in the dataset. */
37
+ readonly index: number;
38
+ readonly seriesId: string;
39
+ /** Position in the resolved series list (or the category, for waterfall). Picks the fill. */
40
+ readonly seriesIndex: number;
41
+ readonly label: string;
42
+ readonly seriesLabel: string;
43
+ readonly value: number;
44
+ readonly plotValue: number;
45
+ readonly x: number;
46
+ readonly y: number;
47
+ readonly width: number;
48
+ readonly height: number;
49
+ /** Round the end away from the baseline (the outer cap). */
50
+ readonly rounded: boolean;
51
+ /** Round every corner (floating waterfall steps and inner stacked segments with a gap). */
52
+ readonly roundAll?: boolean;
53
+ /** Set on stacked segments. */
54
+ readonly stackId?: string;
55
+ /** Set on `expand` segments: `plotValue` is a 0–100 share. */
56
+ readonly expand?: boolean;
57
+ /** Set on waterfall bars. */
58
+ readonly waterfallRole?: BarWaterfallRole;
59
+ }
60
+ export interface BarLabelAnchor {
61
+ readonly label: string;
62
+ readonly x: number;
63
+ readonly y: number;
64
+ readonly textAnchor: 'start' | 'middle' | 'end';
65
+ }
66
+ export interface BarValueTick {
67
+ readonly value: number;
68
+ readonly x: number;
69
+ readonly y: number;
70
+ readonly text: string;
71
+ }
72
+ export interface BarGridLine {
73
+ readonly x1: number;
74
+ readonly y1: number;
75
+ readonly x2: number;
76
+ readonly y2: number;
77
+ }
78
+ export interface BarReferenceLineLayout extends BarGridLine {
79
+ readonly label?: string;
80
+ }
81
+ export interface BarChartLayout {
82
+ readonly bars: BarRect[];
83
+ readonly categoryLabels: BarLabelAnchor[];
84
+ readonly valueTicks: BarValueTick[];
85
+ readonly gridLines: BarGridLine[];
86
+ readonly referenceLines: readonly BarReferenceLineLayout[];
87
+ /** Dashed bridges from one waterfall step to the next, at the running total. */
88
+ readonly connectors: readonly BarGridLine[];
89
+ /** Value-axis coordinate of zero (y when vertical, x when horizontal). Bars grow from here. */
90
+ readonly baseline: number;
91
+ readonly plot: {
92
+ readonly x: number;
93
+ readonly y: number;
94
+ readonly width: number;
95
+ readonly height: number;
96
+ };
97
+ }
98
+ /** Share of each category slot left empty around the bars. MUI X `categoryGapRatio`. */
99
+ export declare const CATEGORY_GAP_RATIO = 0.36;
100
+ /** Gap between bars in one category, as a share of one bar's thickness. MUI X `barGapRatio`. */
101
+ export declare const BAR_GAP_RATIO = 0.5;
102
+ /** Primary bar share of the overlay slot. Comparison series are thinner and peek out. */
103
+ export declare const OVERLAY_PRIMARY_RATIO = 0.7;
104
+ export declare const OVERLAY_COMPARE_RATIO = 0.16;
105
+ export declare const OVERLAY_SPACING_RATIO = 0.08;
106
+ /** Pixel gap between stacked segments. `0` joins them with only the outer cap rounded. */
107
+ export declare const DEFAULT_STACK_GAP = 3;
108
+ export declare const DEFAULT_TICK_COUNT = 4;
109
+ /** Minimum pixels per category when scrolling. Keeps labels and bars readable. */
110
+ export declare const MIN_CATEGORY_BAND = 48;
111
+ export interface BarChartGutters {
112
+ readonly paddingLeft: number;
113
+ readonly paddingRight: number;
114
+ readonly paddingTop: number;
115
+ readonly paddingBottom: number;
116
+ }
117
+ /** Reads a finite number from `row[key]`. Anything else is a missing value. */
118
+ export declare function readBarValue(row: object, key: string): number | null;
119
+ interface BarGroupMember {
120
+ readonly item: BarGeometrySeries;
121
+ readonly seriesIndex: number;
122
+ }
123
+ export interface BarGroup {
124
+ /** `undefined` for a series drawn on its own (not stacked). */
125
+ readonly stackId: string | undefined;
126
+ readonly offset: BarStackOffset | null;
127
+ readonly members: readonly BarGroupMember[];
128
+ }
129
+ /**
130
+ * One slot per stack group, in first-appearance order. A series without `stack` gets its own
131
+ * slot. The first `stackOffset` set in a group applies to the whole group.
132
+ */
133
+ export declare function resolveBarGroups(series: readonly BarGeometrySeries[]): readonly BarGroup[];
134
+ /**
135
+ * Value-axis domain and ticks. `min` / `max` pin the domain exactly; otherwise it rounds out to
136
+ * readable ticks. On an `expand` axis, `min` / `max` are 0–1 shares.
137
+ */
138
+ export declare function resolveBarValueScale(values: readonly number[], axis: BarValueAxisConfig | undefined, expand: boolean): {
139
+ readonly min: number;
140
+ readonly max: number;
141
+ readonly ticks: readonly number[];
142
+ };
143
+ /** Default tick formatter when the chart passes no `formatTick`. */
144
+ export declare function formatBarValue(value: number): string;
145
+ export declare function resolveCategoryLabelPosition(orientation: BarChartOrientation, position: BarChartCategoryLabelPosition | undefined): BarChartCategoryLabelPosition;
146
+ export declare function resolveBarChartGutters({ categories, hasNegative, orientation, barLabel, categoryLabelPosition, showTicks, overlay, }: {
147
+ readonly categories: readonly string[];
148
+ readonly hasNegative: boolean;
149
+ readonly orientation: BarChartOrientation;
150
+ readonly barLabel: boolean;
151
+ readonly categoryLabelPosition?: BarChartCategoryLabelPosition;
152
+ readonly showTicks?: boolean;
153
+ readonly overlay?: boolean;
154
+ }): BarChartGutters;
155
+ /**
156
+ * Gutters from rows with a string `label` field. `LineChart` lays out with the same gutters.
157
+ */
158
+ export declare function barChartGutters(data: readonly object[], orientation: BarChartOrientation, barLabel: boolean, categoryLabelPosition?: BarChartCategoryLabelPosition, showTicks?: boolean, overlay?: boolean): BarChartGutters;
159
+ /**
160
+ * Viewport is the visible box (screen or parent). Content grows when there are
161
+ * too many categories to keep a readable band (`scrollable` / `visiblePoints`).
162
+ */
163
+ export declare function resolveBarChartContentSize({ viewportWidth, viewportHeight, categoryCount, orientation, gutters, scrollable, visiblePoints, }: {
164
+ readonly viewportWidth: number;
165
+ readonly viewportHeight: number;
166
+ readonly categoryCount: number;
167
+ readonly orientation: BarChartOrientation;
168
+ readonly gutters: BarChartGutters;
169
+ readonly scrollable: boolean;
170
+ readonly visiblePoints?: number;
171
+ }): {
172
+ readonly width: number;
173
+ readonly height: number;
174
+ };
175
+ export type BarShape = Pick<BarRect, 'x' | 'y' | 'width' | 'height' | 'rounded' | 'value' | 'roundAll'>;
176
+ export declare function barPath(bar: BarShape, orientation: BarChartOrientation, radius: number): string;
177
+ /** True when every stack group uses `expand`, so the value axis is a 0–1 share axis. */
178
+ export declare function isExpandAxis(kind: BarChartKind, groups: readonly BarGroup[]): boolean;
179
+ export declare function layoutBarChart({ dataset, categories, series, kind, waterfallTotalKey, width, height, orientation, barLabel, categoryLabelPosition, showTicks, referenceLines, valueAxis, formatTick, stackGap, categoryGapRatio, barGapRatio, showCategoryLabel, }: {
180
+ readonly dataset: readonly object[];
181
+ /** One name per row, from the category axis. Defaults to the row index. */
182
+ readonly categories?: readonly string[];
183
+ readonly series: readonly BarGeometrySeries[];
184
+ readonly kind?: BarChartKind;
185
+ /** Waterfall: row key whose `true` value marks a total bar. */
186
+ readonly waterfallTotalKey?: string;
187
+ readonly width: number;
188
+ readonly height: number;
189
+ readonly orientation: BarChartOrientation;
190
+ readonly barLabel: boolean;
191
+ readonly categoryLabelPosition?: BarChartCategoryLabelPosition;
192
+ readonly showTicks?: boolean;
193
+ readonly referenceLines?: readonly BarChartReferenceLine[];
194
+ readonly valueAxis?: BarValueAxisConfig;
195
+ /** Tick text. Receives a 0–1 share on an `expand` axis. */
196
+ readonly formatTick?: (value: number) => string;
197
+ readonly stackGap?: number;
198
+ readonly categoryGapRatio?: number;
199
+ readonly barGapRatio?: number;
200
+ /** Keeps the category name at `index` when it returns `true`. Others draw no text. */
201
+ readonly showCategoryLabel?: (index: number) => boolean;
202
+ }): BarChartLayout;
203
+ export declare function overlayDelta(bars: readonly BarRect[], index: number): number | null;
204
+ /** Waterfall steps read as signed changes; totals read as the running total. */
205
+ export declare function formatWaterfallBarValue(bar: Pick<BarRect, 'value' | 'waterfallRole'>, formatValue: (value: number) => string): string;
206
+ export declare function waterfallValueAnchor(bar: BarRect, orientation: BarChartOrientation): {
207
+ readonly x: number;
208
+ readonly y: number;
209
+ readonly textAnchor: 'start' | 'middle' | 'end';
210
+ };
211
+ export declare function barValueAnchor(bar: BarRect, orientation: BarChartOrientation): {
212
+ readonly x: number;
213
+ readonly y: number;
214
+ readonly textAnchor: 'start' | 'middle' | 'end';
215
+ };
216
+ export interface BarStackTotalAnchor {
217
+ readonly key: string;
218
+ readonly index: number;
219
+ readonly x: number;
220
+ readonly y: number;
221
+ readonly textAnchor: 'start' | 'middle' | 'end';
222
+ /** Sum of the stack's plotted values (a 0–100 share total when `expand`). */
223
+ readonly total: number;
224
+ readonly expand: boolean;
225
+ /** Series of the outer segment. Its formatter labels the total. */
226
+ readonly seriesId: string;
227
+ }
228
+ /** One total label per stack in each category. */
229
+ export declare function stackedTotalAnchors(bars: readonly BarRect[], orientation: BarChartOrientation): readonly BarStackTotalAnchor[];
230
+ /**
231
+ * Next bar for keyboard movement. Along the category axis keeps the same series; along the
232
+ * value axis steps series inside the category. Home / End jump the category axis.
233
+ */
234
+ export declare function barKeyboardNeighbor(bars: readonly Pick<BarRect, 'index' | 'seriesIndex'>[], from: number, key: string, orientation: BarChartOrientation): number | null;
235
+ export {};
236
+ //# sourceMappingURL=geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../../src/components/BarChart/geometry.ts"],"names":[],"mappings":"AAEA,MAAM,MA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,WAAW,mBAAmB;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAChD,6EAA6E;IAC7E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,kDAAkD;AAClD,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,SAAS,OAAO,EAAE,EACxB,WAAW,EAAE,mBAAmB,GAC/B,SAAS,mBAAmB,EAAE,CA8BhC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,SAAS,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,CAAC,EAAE,EACvD,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,mBAAmB,GAC/B,MAAM,GAAG,IAAI,CAoEf"}
@@ -0,0 +1,193 @@
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, ChartSeriesBase, ChartSizeProps, ChartTooltipProps } from '../chart/types';
5
+ import { type ChartPalette } from '../chart/palette';
6
+ import { type BarChartOrientation, type BarStackOffset } from './geometry';
7
+ import { type BarChartSize } from './styles';
8
+ export type * from '../chart';
9
+ export type { BarChartSize, BarStackOffset };
10
+ /** Keys of `TRow` whose value is a boolean. */
11
+ export type BarChartBooleanKey<TRow> = {
12
+ [K in keyof TRow]-?: TRow[K] extends boolean | undefined ? K : never;
13
+ }[keyof TRow] & string;
14
+ /** Running-total series. Each row is a change, except rows flagged as totals. */
15
+ export interface BarChartWaterfall<TRow> {
16
+ /**
17
+ * Row key whose `true` value marks a total bar, drawn from zero to the running total. A total
18
+ * row with a value on the first row sets the starting total; otherwise its value is ignored.
19
+ */
20
+ totalKey: BarChartBooleanKey<TRow>;
21
+ }
22
+ /** Draws this series as a thinner comparison bar beside another series' bar. */
23
+ export interface BarChartOverlay {
24
+ /** `id` of the series this one is compared against. */
25
+ seriesId: string;
26
+ }
27
+ export interface BarChartSeries<TRow> extends ChartSeriesBase<TRow> {
28
+ /** Series type. Reserved for mixed charts; bar is the only type today. */
29
+ type?: 'bar';
30
+ /**
31
+ * Stack group id. Series with the same `stack` draw as one bar per category; different ids
32
+ * draw side by side. Omit to draw the series on its own.
33
+ */
34
+ stack?: string;
35
+ /**
36
+ * How the stack group piles its values. Set it on any one series in the group.
37
+ * `expand` scales each category to 100%.
38
+ * @default 'diverging'
39
+ */
40
+ stackOffset?: BarStackOffset;
41
+ /**
42
+ * Draws the series as a waterfall (running total). A waterfall series draws alone: other
43
+ * series are not plotted.
44
+ */
45
+ waterfall?: BarChartWaterfall<TRow>;
46
+ /**
47
+ * Draws the series as a thin comparison bar beside the series it names (this month versus last
48
+ * month). The pair draws alone, and the named series is announced with the change.
49
+ */
50
+ overlay?: BarChartOverlay;
51
+ }
52
+ export interface BarChartProps<TRow extends object = object> extends ViewProps, ChartSizeProps {
53
+ /** One object per category. Series and axes read it through `dataKey`. */
54
+ dataset: readonly TRow[];
55
+ /** Bars to draw. Each reads one numeric column through `dataKey`. */
56
+ series: readonly BarChartSeries<TRow>[];
57
+ /**
58
+ * Horizontal axis. In `vertical` layout it is the category (band) axis: `dataKey` names the
59
+ * category column, `position` (`'bottom'`, `'top'`, `'none'`) places its labels, and
60
+ * `tickLabelInterval` picks which labels draw. In `horizontal` layout it is the value axis.
61
+ * Only the first axis is used.
62
+ */
63
+ xAxis?: readonly ChartAxis<TRow>[];
64
+ /**
65
+ * Vertical axis. In `vertical` layout it is the value axis (`min`, `max`, `tickNumber`,
66
+ * `valueFormatter`; `position: 'none'` hides its ticks). In `horizontal` layout it is the
67
+ * category axis (`position` `'left'`, `'right'`, or `'none'`). Only the first axis is used.
68
+ */
69
+ yAxis?: readonly ChartAxis<TRow>[];
70
+ /**
71
+ * `vertical` grows bars up from the baseline. `horizontal` grows them to the right.
72
+ * @default 'vertical'
73
+ */
74
+ layout?: BarChartOrientation;
75
+ /**
76
+ * Hides the series legend under the chart. Waterfall charts never show one.
77
+ * @default false
78
+ */
79
+ hideLegend?: boolean;
80
+ /**
81
+ * Grid lines along the value axis: `horizontal` in `vertical` layout, `vertical` in
82
+ * `horizontal` layout. The other direction is not drawn. Omit to draw the value-axis lines;
83
+ * pass an object without that key set to `true` to hide them and keep only the baseline.
84
+ * @default { horizontal: true } (vertical layout), { vertical: true } (horizontal layout)
85
+ */
86
+ grid?: ChartGrid;
87
+ /**
88
+ * Default series colors. `auto` uses the FI brand family (`simple-primary`, `-secondary`,
89
+ * `-tertiary`) for up to three series and switches the whole chart to `categorical-1`…`6`
90
+ * past that. `categorical` always uses the categorical slots. A series `color` wins.
91
+ * @default 'auto'
92
+ */
93
+ palette?: ChartPalette;
94
+ /**
95
+ * Dashed guides at a value: horizontal on a vertical chart, vertical on a horizontal chart.
96
+ */
97
+ referenceLines?: readonly ChartReferenceLine[];
98
+ /**
99
+ * Keeps this `dataset` row full color and mutes the rest. Use with `barLabel` to label only
100
+ * that bar, like "this week" in a spending insight.
101
+ */
102
+ emphasizedIndex?: number;
103
+ /**
104
+ * Draws formatted values at the end of each bar (each stack's total when stacked).
105
+ * @default false
106
+ */
107
+ barLabel?: boolean;
108
+ /**
109
+ * Corner radius in pixels. `0` draws square bars.
110
+ * @default 6
111
+ */
112
+ borderRadius?: number;
113
+ /**
114
+ * Pixel gap between stacked segments. With a gap every segment is rounded; `0` joins them and
115
+ * rounds only the outer cap.
116
+ * @default 3
117
+ */
118
+ stackGap?: number;
119
+ /**
120
+ * Share of each category slot left empty around its bars, from `0` to `0.95`. Higher is
121
+ * thinner bars with more space between categories.
122
+ * @default 0.36
123
+ */
124
+ categoryGapRatio?: number;
125
+ /**
126
+ * Gap between side-by-side bars in one category, as a share of one bar's thickness.
127
+ * @default 0.5
128
+ */
129
+ barGapRatio?: number;
130
+ /**
131
+ * When the categories need more room than the visible box, scroll instead of
132
+ * squeezing bars. Vertical charts scroll sideways; horizontal charts scroll vertically.
133
+ * The value axis stays pinned. Turn off to pack every category into `width` / `height`.
134
+ * @default true
135
+ */
136
+ scrollable?: boolean;
137
+ /**
138
+ * How many categories fit in the viewport when `scrollable` is on. Omit to use a
139
+ * readable minimum band (~48px).
140
+ */
141
+ visiblePoints?: number;
142
+ /**
143
+ * Controlled selected bar: `seriesId` and the `dataset` row. `null` clears the selection while
144
+ * staying controlled.
145
+ */
146
+ selectedItem?: ChartSelectedItem;
147
+ /**
148
+ * Initial selected bar when `selectedItem` is omitted.
149
+ */
150
+ defaultSelectedItem?: ChartSelectedItem;
151
+ /**
152
+ * Called when a bar is pressed, with that bar, or with `null` when the selected bar is pressed
153
+ * again. Providing this, `selectedItem`, or `defaultSelectedItem` makes the chart selectable.
154
+ */
155
+ onSelectedItemChange?: (item: ChartSelectedItem) => void;
156
+ /**
157
+ * Tooltip on hover, keyboard focus, or tap. `axis` lists every series in the category, `item`
158
+ * only the bar under the pointer, `none` hides it. On web the plot is one tab stop. Tab /
159
+ * Shift+Tab move between categories and leave the chart after the last (or before the first)
160
+ * group. Arrow keys move along the category axis (and between series). Home and End jump to
161
+ * the first or last category. Enter or Space selects. Escape hides the tooltip. Each bar is
162
+ * announced to screen readers.
163
+ * @default { trigger: 'axis' }
164
+ */
165
+ tooltip?: ChartTooltipProps;
166
+ /** BCP 47 locale for default number and percent formatting. */
167
+ locale?: string;
168
+ /**
169
+ * Overrides for generated strings: summary, trend, waterfall step names, legend fallback, and
170
+ * no-value text. Keys you omit keep the English defaults.
171
+ */
172
+ localeText?: Partial<ChartLocaleText>;
173
+ /**
174
+ * Bars grow from the baseline on mount and tween to new values when `dataset` changes. Pass
175
+ * `'disable-all'` to draw the final state. Reduce Motion and `GlobalAnimationSettingsProvider`
176
+ * `disable-all` also turn it off.
177
+ */
178
+ animation?: AnimationRootDisableAll;
179
+ /**
180
+ * Accessible summary. Defaults to `localeText.barChartSummary` over every category.
181
+ */
182
+ accessibilityLabel?: string;
183
+ /** Additional Uniwind/Tailwind classes, merged after the root's own styles. */
184
+ className?: string;
185
+ }
186
+ /**
187
+ * Category bars from `dataset` rows. MUI X Charts–shaped: `series[].dataKey`, axis arrays,
188
+ * `layout`, `stack` groups, and `selectedItem`.
189
+ */
190
+ export declare const BarChart: <TRow extends object>(props: BarChartProps<TRow> & {
191
+ ref?: ForwardedRef<View>;
192
+ }) => ReactElement | null;
193
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/BarChart/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,YAAY,EACjB,KAAK,YAAY,EAElB,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,IAAI,EAGJ,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAa/D,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,cAAc,EAGd,iBAAiB,EAGlB,MAAM,gBAAgB,CAAC;AAQxB,OAAO,EAWL,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAmBL,KAAK,mBAAmB,EAGxB,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAOL,KAAK,YAAY,EAClB,MAAM,UAAU,CAAC;AASlB,mBAAmB,UAAU,CAAC;AAC9B,YAAY,EAA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AC,IAAI,SAAS,MAAM,EACvE,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;CAAE,KACtD,YAAY,GAAG,IAAI,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { type VariantProps } from '@cdx-ui/utils';
2
+ import { resolveChartBox } from '../chart/size';
3
+ import type { ChartSize } from '../chart/types';
4
+ export declare const barChartRootVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
5
+ export declare const barChartLegendVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
6
+ export declare const barChartLegendItemVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
7
+ export declare const barChartLegendLabelVariants: (props?: ({
8
+ selected?: boolean | null | undefined;
9
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
+ export type BarChartLegendLabelVariantProps = VariantProps<typeof barChartLegendLabelVariants>;
11
+ export declare const BAR_CHART_DIMENSIONS: {
12
+ readonly sm: {
13
+ readonly width: 256;
14
+ readonly height: 160;
15
+ };
16
+ readonly md: {
17
+ readonly width: 308;
18
+ readonly height: 192;
19
+ };
20
+ readonly lg: {
21
+ readonly width: 360;
22
+ readonly height: 224;
23
+ };
24
+ readonly xl: {
25
+ readonly width: 410;
26
+ readonly height: 256;
27
+ };
28
+ };
29
+ export type BarChartSize = ChartSize;
30
+ export declare const resolveBarChartBox: typeof resolveChartBox;
31
+ export declare const BAR_RADIUS = 6;
32
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/BarChart/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAoB,eAAe,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,eAAO,MAAM,oBAAoB,oFAA8C,CAAC;AAEhF,eAAO,MAAM,sBAAsB,oFAElC,CAAC;AAEF,eAAO,MAAM,0BAA0B,oFAAuC,CAAC;AAE/E,eAAO,MAAM,2BAA2B;;8EAUtC,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,YAAY,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAE/F,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;CAAmB,CAAC;AACrD,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC;AACrC,eAAO,MAAM,kBAAkB,wBAAkB,CAAC;AAElD,eAAO,MAAM,UAAU,IAAI,CAAC"}