@cdx-ui/components 0.3.5 → 0.3.7

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 (416) 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 +10 -1
  5. package/docs/components/country-flag/content.md +232 -0
  6. package/docs/components/data-grid/content.md +3 -1
  7. package/docs/components/icon/content.md +1 -1
  8. package/docs/components/input/content.md +1 -0
  9. package/docs/components/line-chart/content.md +567 -0
  10. package/docs/components/pie-chart/content.md +493 -0
  11. package/docs/components/progress-bar/content.md +164 -3
  12. package/docs/components/progress-segmented/content.md +1 -1
  13. package/docs/components/select/content.md +1 -0
  14. package/docs/components/stepper/content.md +599 -0
  15. package/docs/components/system-alert/content.md +533 -0
  16. package/docs/foundations/expressions/icons/content.md +2 -1
  17. package/docs/foundations/styles/tokens/all-tokens/content.md +2 -1
  18. package/docs/getting-started/developers/content.md +1 -1
  19. package/docs/llms.txt +12 -0
  20. package/docs/patterns/content.md +1 -0
  21. package/docs/patterns/dashboard/content.md +423 -19
  22. package/docs/patterns/insights/content.md +659 -0
  23. package/docs/resources/content.md +1 -0
  24. package/docs/resources/release-notes/0.3.5/content.md +7 -0
  25. package/docs/resources/release-notes/0.3.6/content.md +29 -0
  26. package/docs/resources/release-notes/content.md +2 -0
  27. package/docs/resources/skills/content.md +66 -0
  28. package/lib/commonjs/components/BarChart/geometry.js +1130 -0
  29. package/lib/commonjs/components/BarChart/geometry.js.map +1 -0
  30. package/lib/commonjs/components/BarChart/index.js +935 -0
  31. package/lib/commonjs/components/BarChart/index.js.map +1 -0
  32. package/lib/commonjs/components/BarChart/styles.js +26 -0
  33. package/lib/commonjs/components/BarChart/styles.js.map +1 -0
  34. package/lib/commonjs/components/Button/index.js +2 -2
  35. package/lib/commonjs/components/Button/index.js.map +1 -1
  36. package/lib/commonjs/components/CountryFlag/index.js +56 -0
  37. package/lib/commonjs/components/CountryFlag/index.js.map +1 -0
  38. package/lib/commonjs/components/Input/index.js.map +1 -1
  39. package/lib/commonjs/components/LineChart/geometry.js +698 -0
  40. package/lib/commonjs/components/LineChart/geometry.js.map +1 -0
  41. package/lib/commonjs/components/LineChart/index.js +744 -0
  42. package/lib/commonjs/components/LineChart/index.js.map +1 -0
  43. package/lib/commonjs/components/LineChart/styles.js +25 -0
  44. package/lib/commonjs/components/LineChart/styles.js.map +1 -0
  45. package/lib/commonjs/components/PieChart/geometry.js +216 -0
  46. package/lib/commonjs/components/PieChart/geometry.js.map +1 -0
  47. package/lib/commonjs/components/PieChart/index.js +476 -0
  48. package/lib/commonjs/components/PieChart/index.js.map +1 -0
  49. package/lib/commonjs/components/PieChart/styles.js +88 -0
  50. package/lib/commonjs/components/PieChart/styles.js.map +1 -0
  51. package/lib/commonjs/components/ProgressBar/index.js +44 -12
  52. package/lib/commonjs/components/ProgressBar/index.js.map +1 -1
  53. package/lib/commonjs/components/ProgressBar/styles.js +31 -2
  54. package/lib/commonjs/components/ProgressBar/styles.js.map +1 -1
  55. package/lib/commonjs/components/ProgressCircle/ProgressCircleRing.js +9 -31
  56. package/lib/commonjs/components/ProgressCircle/ProgressCircleRing.js.map +1 -1
  57. package/lib/commonjs/components/ProgressCircle/ProgressRing.js +52 -0
  58. package/lib/commonjs/components/ProgressCircle/ProgressRing.js.map +1 -0
  59. package/lib/commonjs/components/ScrollShadow/useScrollShadow.js +8 -7
  60. package/lib/commonjs/components/ScrollShadow/useScrollShadow.js.map +1 -1
  61. package/lib/commonjs/components/Select/index.js.map +1 -1
  62. package/lib/commonjs/components/Stepper/index.js +369 -0
  63. package/lib/commonjs/components/Stepper/index.js.map +1 -0
  64. package/lib/commonjs/components/Stepper/styles.js +211 -0
  65. package/lib/commonjs/components/Stepper/styles.js.map +1 -0
  66. package/lib/commonjs/components/Stepper/useStepperLabelFit.js +22 -0
  67. package/lib/commonjs/components/Stepper/useStepperLabelFit.js.map +1 -0
  68. package/lib/commonjs/components/Stepper/useStepperLabelFit.web.js +52 -0
  69. package/lib/commonjs/components/Stepper/useStepperLabelFit.web.js.map +1 -0
  70. package/lib/commonjs/components/Stepper/useStepperRingColors.js +31 -0
  71. package/lib/commonjs/components/Stepper/useStepperRingColors.js.map +1 -0
  72. package/lib/commonjs/components/SystemAlert/animation.js +218 -0
  73. package/lib/commonjs/components/SystemAlert/animation.js.map +1 -0
  74. package/lib/commonjs/components/SystemAlert/index.js +525 -0
  75. package/lib/commonjs/components/SystemAlert/index.js.map +1 -0
  76. package/lib/commonjs/components/SystemAlert/styles.js +178 -0
  77. package/lib/commonjs/components/SystemAlert/styles.js.map +1 -0
  78. package/lib/commonjs/components/SystemAlert/useSystemAlertStatusBarStyle.js +53 -0
  79. package/lib/commonjs/components/SystemAlert/useSystemAlertStatusBarStyle.js.map +1 -0
  80. package/lib/commonjs/components/Tabs/index.js +4 -0
  81. package/lib/commonjs/components/Tabs/index.js.map +1 -1
  82. package/lib/commonjs/components/Tabs/styles.js +1 -1
  83. package/lib/commonjs/components/Tabs/styles.js.map +1 -1
  84. package/lib/commonjs/components/chart/ChartInspector.js +610 -0
  85. package/lib/commonjs/components/chart/ChartInspector.js.map +1 -0
  86. package/lib/commonjs/components/chart/format.js +93 -0
  87. package/lib/commonjs/components/chart/format.js.map +1 -0
  88. package/lib/commonjs/components/chart/hiddenSvgProps.js +23 -0
  89. package/lib/commonjs/components/chart/hiddenSvgProps.js.map +1 -0
  90. package/lib/commonjs/components/chart/index.js +2 -0
  91. package/lib/commonjs/components/chart/index.js.map +1 -0
  92. package/lib/commonjs/components/chart/motion.js +97 -0
  93. package/lib/commonjs/components/chart/motion.js.map +1 -0
  94. package/lib/commonjs/components/chart/palette.js +178 -0
  95. package/lib/commonjs/components/chart/palette.js.map +1 -0
  96. package/lib/commonjs/components/chart/size.js +34 -0
  97. package/lib/commonjs/components/chart/size.js.map +1 -0
  98. package/lib/commonjs/components/chart/ticks.js +59 -0
  99. package/lib/commonjs/components/chart/ticks.js.map +1 -0
  100. package/lib/commonjs/components/chart/types.js +6 -0
  101. package/lib/commonjs/components/chart/types.js.map +1 -0
  102. package/lib/commonjs/components/chart/useChartHostWidth.js +27 -0
  103. package/lib/commonjs/components/chart/useChartHostWidth.js.map +1 -0
  104. package/lib/commonjs/components/index.js +72 -0
  105. package/lib/commonjs/components/index.js.map +1 -1
  106. package/lib/commonjs/figma/Accordion.figma.js +2 -2
  107. package/lib/commonjs/figma/Accordion.figma.js.map +1 -1
  108. package/lib/commonjs/figma/Alert.figma.js +7 -7
  109. package/lib/commonjs/figma/Alert.figma.js.map +1 -1
  110. package/lib/commonjs/figma/Badge.Indicator.figma.js +6 -5
  111. package/lib/commonjs/figma/Badge.Indicator.figma.js.map +1 -1
  112. package/lib/commonjs/figma/Badge.figma.js +22 -22
  113. package/lib/commonjs/figma/Badge.figma.js.map +1 -1
  114. package/lib/commonjs/figma/Button.figma.js +5 -2
  115. package/lib/commonjs/figma/Button.figma.js.map +1 -1
  116. package/lib/commonjs/figma/CLAUDE.md +1 -0
  117. package/lib/commonjs/figma/Card.Header.figma.js +8 -4
  118. package/lib/commonjs/figma/Card.Header.figma.js.map +1 -1
  119. package/lib/commonjs/figma/Card.figma.js +2 -1
  120. package/lib/commonjs/figma/Card.figma.js.map +1 -1
  121. package/lib/commonjs/figma/Chip.figma.js +2 -2
  122. package/lib/commonjs/figma/Chip.figma.js.map +1 -1
  123. package/lib/commonjs/figma/CurrencyInput.figma.js +1 -1
  124. package/lib/commonjs/figma/CurrencyInput.figma.js.map +1 -1
  125. package/lib/commonjs/figma/Dialog.figma.js +5 -2
  126. package/lib/commonjs/figma/Dialog.figma.js.map +1 -1
  127. package/lib/commonjs/figma/Divider.figma.js +1 -1
  128. package/lib/commonjs/figma/Divider.figma.js.map +1 -1
  129. package/lib/commonjs/figma/Drawer.figma.js +3 -3
  130. package/lib/commonjs/figma/Drawer.figma.js.map +1 -1
  131. package/lib/commonjs/figma/IconButton.figma.js +10 -4
  132. package/lib/commonjs/figma/IconButton.figma.js.map +1 -1
  133. package/lib/commonjs/figma/Input.figma.js +2 -1
  134. package/lib/commonjs/figma/Input.figma.js.map +1 -1
  135. package/lib/commonjs/figma/Insight.figma.js +3 -3
  136. package/lib/commonjs/figma/Insight.figma.js.map +1 -1
  137. package/lib/commonjs/figma/ProgressBar.figma.js +11 -2
  138. package/lib/commonjs/figma/ProgressBar.figma.js.map +1 -1
  139. package/lib/commonjs/figma/ProgressSegmented.figma.js +9 -1
  140. package/lib/commonjs/figma/ProgressSegmented.figma.js.map +1 -1
  141. package/lib/commonjs/figma/Select.figma.js +2 -1
  142. package/lib/commonjs/figma/Select.figma.js.map +1 -1
  143. package/lib/commonjs/figma/SystemAlert.Button.figma.js +28 -0
  144. package/lib/commonjs/figma/SystemAlert.Button.figma.js.map +1 -0
  145. package/lib/commonjs/figma/SystemAlert.Close.figma.js +22 -0
  146. package/lib/commonjs/figma/SystemAlert.Close.figma.js.map +1 -0
  147. package/lib/commonjs/figma/SystemAlert.Description.figma.js +20 -0
  148. package/lib/commonjs/figma/SystemAlert.Description.figma.js.map +1 -0
  149. package/lib/commonjs/figma/SystemAlert.IconButton.figma.js +31 -0
  150. package/lib/commonjs/figma/SystemAlert.IconButton.figma.js.map +1 -0
  151. package/lib/commonjs/figma/SystemAlert.figma.js +47 -0
  152. package/lib/commonjs/figma/SystemAlert.figma.js.map +1 -0
  153. package/lib/commonjs/styles.css +0 -1
  154. package/lib/module/components/BarChart/geometry.js +1110 -0
  155. package/lib/module/components/BarChart/geometry.js.map +1 -0
  156. package/lib/module/components/BarChart/index.js +929 -0
  157. package/lib/module/components/BarChart/index.js.map +1 -0
  158. package/lib/module/components/BarChart/styles.js +22 -0
  159. package/lib/module/components/BarChart/styles.js.map +1 -0
  160. package/lib/module/components/Button/index.js +2 -2
  161. package/lib/module/components/Button/index.js.map +1 -1
  162. package/lib/module/components/CountryFlag/index.js +52 -0
  163. package/lib/module/components/CountryFlag/index.js.map +1 -0
  164. package/lib/module/components/Input/index.js.map +1 -1
  165. package/lib/module/components/LineChart/geometry.js +685 -0
  166. package/lib/module/components/LineChart/geometry.js.map +1 -0
  167. package/lib/module/components/LineChart/index.js +738 -0
  168. package/lib/module/components/LineChart/index.js.map +1 -0
  169. package/lib/module/components/LineChart/styles.js +21 -0
  170. package/lib/module/components/LineChart/styles.js.map +1 -0
  171. package/lib/module/components/PieChart/geometry.js +209 -0
  172. package/lib/module/components/PieChart/geometry.js.map +1 -0
  173. package/lib/module/components/PieChart/index.js +471 -0
  174. package/lib/module/components/PieChart/index.js.map +1 -0
  175. package/lib/module/components/PieChart/styles.js +84 -0
  176. package/lib/module/components/PieChart/styles.js.map +1 -0
  177. package/lib/module/components/ProgressBar/index.js +47 -15
  178. package/lib/module/components/ProgressBar/index.js.map +1 -1
  179. package/lib/module/components/ProgressBar/styles.js +31 -2
  180. package/lib/module/components/ProgressBar/styles.js.map +1 -1
  181. package/lib/module/components/ProgressCircle/ProgressCircleRing.js +10 -32
  182. package/lib/module/components/ProgressCircle/ProgressCircleRing.js.map +1 -1
  183. package/lib/module/components/ProgressCircle/ProgressRing.js +48 -0
  184. package/lib/module/components/ProgressCircle/ProgressRing.js.map +1 -0
  185. package/lib/module/components/ScrollShadow/useScrollShadow.js +8 -7
  186. package/lib/module/components/ScrollShadow/useScrollShadow.js.map +1 -1
  187. package/lib/module/components/Select/index.js.map +1 -1
  188. package/lib/module/components/Stepper/index.js +360 -0
  189. package/lib/module/components/Stepper/index.js.map +1 -0
  190. package/lib/module/components/Stepper/styles.js +206 -0
  191. package/lib/module/components/Stepper/styles.js.map +1 -0
  192. package/lib/module/components/Stepper/useStepperLabelFit.js +18 -0
  193. package/lib/module/components/Stepper/useStepperLabelFit.js.map +1 -0
  194. package/lib/module/components/Stepper/useStepperLabelFit.web.js +48 -0
  195. package/lib/module/components/Stepper/useStepperLabelFit.web.js.map +1 -0
  196. package/lib/module/components/Stepper/useStepperRingColors.js +28 -0
  197. package/lib/module/components/Stepper/useStepperRingColors.js.map +1 -0
  198. package/lib/module/components/SystemAlert/animation.js +213 -0
  199. package/lib/module/components/SystemAlert/animation.js.map +1 -0
  200. package/lib/module/components/SystemAlert/index.js +515 -0
  201. package/lib/module/components/SystemAlert/index.js.map +1 -0
  202. package/lib/module/components/SystemAlert/styles.js +174 -0
  203. package/lib/module/components/SystemAlert/styles.js.map +1 -0
  204. package/lib/module/components/SystemAlert/useSystemAlertStatusBarStyle.js +49 -0
  205. package/lib/module/components/SystemAlert/useSystemAlertStatusBarStyle.js.map +1 -0
  206. package/lib/module/components/Tabs/index.js +4 -0
  207. package/lib/module/components/Tabs/index.js.map +1 -1
  208. package/lib/module/components/Tabs/styles.js +1 -1
  209. package/lib/module/components/Tabs/styles.js.map +1 -1
  210. package/lib/module/components/chart/ChartInspector.js +600 -0
  211. package/lib/module/components/chart/ChartInspector.js.map +1 -0
  212. package/lib/module/components/chart/format.js +84 -0
  213. package/lib/module/components/chart/format.js.map +1 -0
  214. package/lib/module/components/chart/hiddenSvgProps.js +20 -0
  215. package/lib/module/components/chart/hiddenSvgProps.js.map +1 -0
  216. package/lib/module/components/chart/index.js +2 -0
  217. package/lib/module/components/chart/index.js.map +1 -0
  218. package/lib/module/components/chart/motion.js +89 -0
  219. package/lib/module/components/chart/motion.js.map +1 -0
  220. package/lib/module/components/chart/palette.js +168 -0
  221. package/lib/module/components/chart/palette.js.map +1 -0
  222. package/lib/module/components/chart/size.js +29 -0
  223. package/lib/module/components/chart/size.js.map +1 -0
  224. package/lib/module/components/chart/ticks.js +55 -0
  225. package/lib/module/components/chart/ticks.js.map +1 -0
  226. package/lib/module/components/chart/types.js +4 -0
  227. package/lib/module/components/chart/types.js.map +1 -0
  228. package/lib/module/components/chart/useChartHostWidth.js +23 -0
  229. package/lib/module/components/chart/useChartHostWidth.js.map +1 -0
  230. package/lib/module/components/index.js +6 -0
  231. package/lib/module/components/index.js.map +1 -1
  232. package/lib/module/figma/Accordion.figma.js +2 -2
  233. package/lib/module/figma/Accordion.figma.js.map +1 -1
  234. package/lib/module/figma/Alert.figma.js +7 -7
  235. package/lib/module/figma/Alert.figma.js.map +1 -1
  236. package/lib/module/figma/Badge.Indicator.figma.js +6 -5
  237. package/lib/module/figma/Badge.Indicator.figma.js.map +1 -1
  238. package/lib/module/figma/Badge.figma.js +22 -22
  239. package/lib/module/figma/Badge.figma.js.map +1 -1
  240. package/lib/module/figma/Button.figma.js +5 -2
  241. package/lib/module/figma/Button.figma.js.map +1 -1
  242. package/lib/module/figma/CLAUDE.md +1 -0
  243. package/lib/module/figma/Card.Header.figma.js +8 -4
  244. package/lib/module/figma/Card.Header.figma.js.map +1 -1
  245. package/lib/module/figma/Card.figma.js +2 -1
  246. package/lib/module/figma/Card.figma.js.map +1 -1
  247. package/lib/module/figma/Chip.figma.js +2 -2
  248. package/lib/module/figma/Chip.figma.js.map +1 -1
  249. package/lib/module/figma/CurrencyInput.figma.js +1 -1
  250. package/lib/module/figma/CurrencyInput.figma.js.map +1 -1
  251. package/lib/module/figma/Dialog.figma.js +5 -2
  252. package/lib/module/figma/Dialog.figma.js.map +1 -1
  253. package/lib/module/figma/Divider.figma.js +1 -1
  254. package/lib/module/figma/Divider.figma.js.map +1 -1
  255. package/lib/module/figma/Drawer.figma.js +3 -3
  256. package/lib/module/figma/Drawer.figma.js.map +1 -1
  257. package/lib/module/figma/IconButton.figma.js +10 -4
  258. package/lib/module/figma/IconButton.figma.js.map +1 -1
  259. package/lib/module/figma/Input.figma.js +2 -1
  260. package/lib/module/figma/Input.figma.js.map +1 -1
  261. package/lib/module/figma/Insight.figma.js +3 -3
  262. package/lib/module/figma/Insight.figma.js.map +1 -1
  263. package/lib/module/figma/ProgressBar.figma.js +12 -2
  264. package/lib/module/figma/ProgressBar.figma.js.map +1 -1
  265. package/lib/module/figma/ProgressSegmented.figma.js +9 -1
  266. package/lib/module/figma/ProgressSegmented.figma.js.map +1 -1
  267. package/lib/module/figma/Select.figma.js +2 -1
  268. package/lib/module/figma/Select.figma.js.map +1 -1
  269. package/lib/module/figma/SystemAlert.Button.figma.js +22 -0
  270. package/lib/module/figma/SystemAlert.Button.figma.js.map +1 -0
  271. package/lib/module/figma/SystemAlert.Close.figma.js +18 -0
  272. package/lib/module/figma/SystemAlert.Close.figma.js.map +1 -0
  273. package/lib/module/figma/SystemAlert.Description.figma.js +14 -0
  274. package/lib/module/figma/SystemAlert.Description.figma.js.map +1 -0
  275. package/lib/module/figma/SystemAlert.IconButton.figma.js +25 -0
  276. package/lib/module/figma/SystemAlert.IconButton.figma.js.map +1 -0
  277. package/lib/module/figma/SystemAlert.figma.js +41 -0
  278. package/lib/module/figma/SystemAlert.figma.js.map +1 -0
  279. package/lib/module/styles.css +0 -1
  280. package/lib/typescript/components/BarChart/geometry.d.ts +236 -0
  281. package/lib/typescript/components/BarChart/geometry.d.ts.map +1 -0
  282. package/lib/typescript/components/BarChart/index.d.ts +193 -0
  283. package/lib/typescript/components/BarChart/index.d.ts.map +1 -0
  284. package/lib/typescript/components/BarChart/styles.d.ts +32 -0
  285. package/lib/typescript/components/BarChart/styles.d.ts.map +1 -0
  286. package/lib/typescript/components/CountryFlag/index.d.ts +35 -0
  287. package/lib/typescript/components/CountryFlag/index.d.ts.map +1 -0
  288. package/lib/typescript/components/Input/index.d.ts +2 -0
  289. package/lib/typescript/components/Input/index.d.ts.map +1 -1
  290. package/lib/typescript/components/LineChart/geometry.d.ts +248 -0
  291. package/lib/typescript/components/LineChart/geometry.d.ts.map +1 -0
  292. package/lib/typescript/components/LineChart/index.d.ts +105 -0
  293. package/lib/typescript/components/LineChart/index.d.ts.map +1 -0
  294. package/lib/typescript/components/LineChart/styles.d.ts +12 -0
  295. package/lib/typescript/components/LineChart/styles.d.ts.map +1 -0
  296. package/lib/typescript/components/PieChart/geometry.d.ts +43 -0
  297. package/lib/typescript/components/PieChart/geometry.d.ts.map +1 -0
  298. package/lib/typescript/components/PieChart/index.d.ts +147 -0
  299. package/lib/typescript/components/PieChart/index.d.ts.map +1 -0
  300. package/lib/typescript/components/PieChart/styles.d.ts +27 -0
  301. package/lib/typescript/components/PieChart/styles.d.ts.map +1 -0
  302. package/lib/typescript/components/ProgressBar/index.d.ts +16 -1
  303. package/lib/typescript/components/ProgressBar/index.d.ts.map +1 -1
  304. package/lib/typescript/components/ProgressBar/styles.d.ts +7 -2
  305. package/lib/typescript/components/ProgressBar/styles.d.ts.map +1 -1
  306. package/lib/typescript/components/ProgressCircle/ProgressCircleRing.d.ts.map +1 -1
  307. package/lib/typescript/components/ProgressCircle/ProgressRing.d.ts +17 -0
  308. package/lib/typescript/components/ProgressCircle/ProgressRing.d.ts.map +1 -0
  309. package/lib/typescript/components/ScrollShadow/useScrollShadow.d.ts.map +1 -1
  310. package/lib/typescript/components/Select/index.d.ts +2 -0
  311. package/lib/typescript/components/Select/index.d.ts.map +1 -1
  312. package/lib/typescript/components/Stepper/index.d.ts +68 -0
  313. package/lib/typescript/components/Stepper/index.d.ts.map +1 -0
  314. package/lib/typescript/components/Stepper/styles.d.ts +46 -0
  315. package/lib/typescript/components/Stepper/styles.d.ts.map +1 -0
  316. package/lib/typescript/components/Stepper/useStepperLabelFit.d.ts +15 -0
  317. package/lib/typescript/components/Stepper/useStepperLabelFit.d.ts.map +1 -0
  318. package/lib/typescript/components/Stepper/useStepperLabelFit.web.d.ts +10 -0
  319. package/lib/typescript/components/Stepper/useStepperLabelFit.web.d.ts.map +1 -0
  320. package/lib/typescript/components/Stepper/useStepperRingColors.d.ts +6 -0
  321. package/lib/typescript/components/Stepper/useStepperRingColors.d.ts.map +1 -0
  322. package/lib/typescript/components/SystemAlert/animation.d.ts +56 -0
  323. package/lib/typescript/components/SystemAlert/animation.d.ts.map +1 -0
  324. package/lib/typescript/components/SystemAlert/index.d.ts +110 -0
  325. package/lib/typescript/components/SystemAlert/index.d.ts.map +1 -0
  326. package/lib/typescript/components/SystemAlert/styles.d.ts +38 -0
  327. package/lib/typescript/components/SystemAlert/styles.d.ts.map +1 -0
  328. package/lib/typescript/components/SystemAlert/useSystemAlertStatusBarStyle.d.ts +14 -0
  329. package/lib/typescript/components/SystemAlert/useSystemAlertStatusBarStyle.d.ts.map +1 -0
  330. package/lib/typescript/components/Tabs/index.d.ts.map +1 -1
  331. package/lib/typescript/components/chart/ChartInspector.d.ts +101 -0
  332. package/lib/typescript/components/chart/ChartInspector.d.ts.map +1 -0
  333. package/lib/typescript/components/chart/format.d.ts +16 -0
  334. package/lib/typescript/components/chart/format.d.ts.map +1 -0
  335. package/lib/typescript/components/chart/hiddenSvgProps.d.ts +17 -0
  336. package/lib/typescript/components/chart/hiddenSvgProps.d.ts.map +1 -0
  337. package/lib/typescript/components/chart/index.d.ts +3 -0
  338. package/lib/typescript/components/chart/index.d.ts.map +1 -0
  339. package/lib/typescript/components/chart/motion.d.ts +27 -0
  340. package/lib/typescript/components/chart/motion.d.ts.map +1 -0
  341. package/lib/typescript/components/chart/palette.d.ts +44 -0
  342. package/lib/typescript/components/chart/palette.d.ts.map +1 -0
  343. package/lib/typescript/components/chart/size.d.ts +25 -0
  344. package/lib/typescript/components/chart/size.d.ts.map +1 -0
  345. package/lib/typescript/components/chart/ticks.d.ts +3 -0
  346. package/lib/typescript/components/chart/ticks.d.ts.map +1 -0
  347. package/lib/typescript/components/chart/types.d.ts +163 -0
  348. package/lib/typescript/components/chart/types.d.ts.map +1 -0
  349. package/lib/typescript/components/chart/useChartHostWidth.d.ts +9 -0
  350. package/lib/typescript/components/chart/useChartHostWidth.d.ts.map +1 -0
  351. package/lib/typescript/components/index.d.ts +6 -0
  352. package/lib/typescript/components/index.d.ts.map +1 -1
  353. package/lib/typescript/figma/Alert.figma.d.ts.map +1 -1
  354. package/lib/typescript/figma/Badge.Indicator.figma.d.ts.map +1 -1
  355. package/lib/typescript/figma/Badge.figma.d.ts.map +1 -1
  356. package/lib/typescript/figma/Button.figma.d.ts.map +1 -1
  357. package/lib/typescript/figma/Card.Header.figma.d.ts.map +1 -1
  358. package/lib/typescript/figma/Card.figma.d.ts.map +1 -1
  359. package/lib/typescript/figma/Dialog.figma.d.ts.map +1 -1
  360. package/lib/typescript/figma/IconButton.figma.d.ts.map +1 -1
  361. package/lib/typescript/figma/Input.figma.d.ts.map +1 -1
  362. package/lib/typescript/figma/ProgressBar.figma.d.ts.map +1 -1
  363. package/lib/typescript/figma/ProgressSegmented.figma.d.ts.map +1 -1
  364. package/lib/typescript/figma/Select.figma.d.ts.map +1 -1
  365. package/lib/typescript/figma/SystemAlert.Button.figma.d.ts +11 -0
  366. package/lib/typescript/figma/SystemAlert.Button.figma.d.ts.map +1 -0
  367. package/lib/typescript/figma/SystemAlert.Close.figma.d.ts +11 -0
  368. package/lib/typescript/figma/SystemAlert.Close.figma.d.ts.map +1 -0
  369. package/lib/typescript/figma/SystemAlert.Description.figma.d.ts +8 -0
  370. package/lib/typescript/figma/SystemAlert.Description.figma.d.ts.map +1 -0
  371. package/lib/typescript/figma/SystemAlert.IconButton.figma.d.ts +11 -0
  372. package/lib/typescript/figma/SystemAlert.IconButton.figma.d.ts.map +1 -0
  373. package/lib/typescript/figma/SystemAlert.figma.d.ts +8 -0
  374. package/lib/typescript/figma/SystemAlert.figma.d.ts.map +1 -0
  375. package/package.json +5 -5
  376. package/src/components/BarChart/geometry.ts +1469 -0
  377. package/src/components/BarChart/index.tsx +1417 -0
  378. package/src/components/BarChart/styles.ts +31 -0
  379. package/src/components/Button/index.tsx +1 -1
  380. package/src/components/CountryFlag/index.tsx +53 -0
  381. package/src/components/Input/index.tsx +2 -0
  382. package/src/components/LineChart/geometry.ts +957 -0
  383. package/src/components/LineChart/index.tsx +1106 -0
  384. package/src/components/LineChart/styles.ts +26 -0
  385. package/src/components/PieChart/geometry.ts +295 -0
  386. package/src/components/PieChart/index.tsx +715 -0
  387. package/src/components/PieChart/styles.ts +101 -0
  388. package/src/components/ProgressBar/index.tsx +66 -14
  389. package/src/components/ProgressBar/styles.ts +35 -4
  390. package/src/components/ProgressCircle/ProgressCircleRing.tsx +10 -39
  391. package/src/components/ProgressCircle/ProgressRing.tsx +60 -0
  392. package/src/components/ScrollShadow/useScrollShadow.ts +12 -11
  393. package/src/components/Select/index.tsx +2 -0
  394. package/src/components/Stepper/index.tsx +452 -0
  395. package/src/components/Stepper/styles.ts +234 -0
  396. package/src/components/Stepper/useStepperLabelFit.ts +21 -0
  397. package/src/components/Stepper/useStepperLabelFit.web.ts +53 -0
  398. package/src/components/Stepper/useStepperRingColors.ts +29 -0
  399. package/src/components/SystemAlert/animation.ts +252 -0
  400. package/src/components/SystemAlert/index.tsx +684 -0
  401. package/src/components/SystemAlert/styles.ts +212 -0
  402. package/src/components/SystemAlert/useSystemAlertStatusBarStyle.ts +57 -0
  403. package/src/components/Tabs/index.tsx +4 -0
  404. package/src/components/Tabs/styles.ts +1 -1
  405. package/src/components/chart/ChartInspector.tsx +726 -0
  406. package/src/components/chart/format.ts +95 -0
  407. package/src/components/chart/hiddenSvgProps.ts +15 -0
  408. package/src/components/chart/index.ts +24 -0
  409. package/src/components/chart/motion.ts +98 -0
  410. package/src/components/chart/palette.tsx +247 -0
  411. package/src/components/chart/size.ts +21 -0
  412. package/src/components/chart/ticks.ts +53 -0
  413. package/src/components/chart/types.ts +183 -0
  414. package/src/components/chart/useChartHostWidth.ts +26 -0
  415. package/src/components/index.ts +6 -0
  416. package/src/styles.css +0 -1
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultChartLocaleText = void 0;
7
+ exports.defaultChartValueFormatter = defaultChartValueFormatter;
8
+ exports.formatChartNumber = formatChartNumber;
9
+ exports.formatChartPercent = formatChartPercent;
10
+ exports.resolveChartLocaleText = resolveChartLocaleText;
11
+ exports.resolveValueFormatter = resolveValueFormatter;
12
+ var _formatters = require("@cdx-ui/formatters");
13
+ function namedValue(value) {
14
+ return value.label.length > 0 ? `${value.label} ${value.formattedValue}` : value.formattedValue;
15
+ }
16
+ function categoryText(category) {
17
+ return `${category.label} ${category.values.map(namedValue).join(', ')}`;
18
+ }
19
+ const defaultChartLocaleText = exports.defaultChartLocaleText = {
20
+ noData: 'No data',
21
+ noValue: 'No value',
22
+ defaultSeriesLabel: 'Value',
23
+ waterfallIncrease: 'Increase',
24
+ waterfallDecrease: 'Decrease',
25
+ trend: ({
26
+ direction,
27
+ formattedDelta,
28
+ comparisonLabel
29
+ }) => {
30
+ const from = comparisonLabel.length > 0 ? ` from ${comparisonLabel}` : '';
31
+ return direction === 'none' ? `no change${from}` : `${direction} ${formattedDelta}${from}`;
32
+ },
33
+ barChartSummary: categories => categories.length === 0 ? 'Bar chart. No data.' : `Bar chart. ${categories.map(categoryText).join('; ')}.`,
34
+ lineChartSummary: latest => latest === null ? 'Line chart. No data.' : `Line chart. ${categoryText(latest)}.`,
35
+ pieChartSummary: slices => slices.length === 0 ? 'Pie chart. No data.' : `Pie chart. ${slices.map(namedValue).join(', ')}.`
36
+ };
37
+
38
+ /** Consumer strings over the English defaults. `undefined` entries keep the default. */
39
+ function resolveChartLocaleText(localeText) {
40
+ if (localeText === undefined) {
41
+ return defaultChartLocaleText;
42
+ }
43
+ const overrides = Object.entries(localeText).filter(([, value]) => value !== undefined);
44
+ return {
45
+ ...defaultChartLocaleText,
46
+ ...Object.fromEntries(overrides)
47
+ };
48
+ }
49
+
50
+ /** Up to two fraction digits, without trailing zeros: `3`, `2.5`, `1,234.56`. */
51
+ function formatChartNumber(value, locale) {
52
+ if (value === null || !Number.isFinite(value)) {
53
+ return '';
54
+ }
55
+ const hundredths = Math.round(Math.abs(value) * 100);
56
+ const decimalPlaces = hundredths % 100 === 0 ? 0 : hundredths % 10 === 0 ? 1 : 2;
57
+ return (0, _formatters.formatNumber)(value, {
58
+ locale,
59
+ decimalPlaces
60
+ });
61
+ }
62
+ const percentFormatters = new Map();
63
+
64
+ /** A 0–1 share as a whole percent for `locale`: `0.46` → `46%`. */
65
+ function formatChartPercent(share, locale) {
66
+ if (!Number.isFinite(share)) {
67
+ return '';
68
+ }
69
+ // Without a locale, match the `@cdx-ui/formatters` default that numbers use, not the device locale.
70
+ if (locale === undefined) {
71
+ return `${(0, _formatters.formatNumber)(Math.round(share * 100), {
72
+ decimalPlaces: 0
73
+ })}%`;
74
+ }
75
+ let formatter = percentFormatters.get(locale);
76
+ if (formatter === undefined) {
77
+ formatter = new Intl.NumberFormat(locale, {
78
+ style: 'percent',
79
+ maximumFractionDigits: 0
80
+ });
81
+ percentFormatters.set(locale, formatter);
82
+ }
83
+ return formatter.format(share);
84
+ }
85
+ function defaultChartValueFormatter(locale) {
86
+ return value => formatChartNumber(value, locale);
87
+ }
88
+
89
+ /** Series formatter, then axis formatter, then the `locale` default. */
90
+ function resolveValueFormatter(series, axis, locale) {
91
+ return series?.valueFormatter ?? axis?.valueFormatter ?? defaultChartValueFormatter(locale);
92
+ }
93
+ //# sourceMappingURL=format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_formatters","require","namedValue","value","label","length","formattedValue","categoryText","category","values","map","join","defaultChartLocaleText","exports","noData","noValue","defaultSeriesLabel","waterfallIncrease","waterfallDecrease","trend","direction","formattedDelta","comparisonLabel","from","barChartSummary","categories","lineChartSummary","latest","pieChartSummary","slices","resolveChartLocaleText","localeText","undefined","overrides","Object","entries","filter","fromEntries","formatChartNumber","locale","Number","isFinite","hundredths","Math","round","abs","decimalPlaces","formatNumber","percentFormatters","Map","formatChartPercent","share","formatter","get","Intl","NumberFormat","style","maximumFractionDigits","set","format","defaultChartValueFormatter","resolveValueFormatter","series","axis","valueFormatter"],"sourceRoot":"../../../../src","sources":["components/chart/format.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAaA,SAASC,UAAUA,CAACC,KAAwB,EAAU;EACpD,OAAOA,KAAK,CAACC,KAAK,CAACC,MAAM,GAAG,CAAC,GAAG,GAAGF,KAAK,CAACC,KAAK,IAAID,KAAK,CAACG,cAAc,EAAE,GAAGH,KAAK,CAACG,cAAc;AACjG;AAEA,SAASC,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,EAAE;IAC3BoB,SAAS,GAAG,IAAIE,IAAI,CAACC,YAAY,CAAChB,MAAM,EAAE;MAAEiB,KAAK,EAAE,SAAS;MAAEC,qBAAqB,EAAE;IAAE,CAAC,CAAC;IACzFT,iBAAiB,CAACU,GAAG,CAACnB,MAAM,EAAEa,SAAS,CAAC;EAC1C;EACA,OAAOA,SAAS,CAACO,MAAM,CAACR,KAAK,CAAC;AAChC;AAEO,SAASS,0BAA0BA,CAACrB,MAAe,EAAuB;EAC/E,OAAQpC,KAAK,IAAKmC,iBAAiB,CAACnC,KAAK,EAAEoC,MAAM,CAAC;AACpD;;AAEA;AACO,SAASsB,qBAAqBA,CACnCC,MAA4C,EAC5CC,IAA0C,EAC1CxB,MAAe,EACM;EACrB,OAAOuB,MAAM,EAAEE,cAAc,IAAID,IAAI,EAAEC,cAAc,IAAIJ,0BAA0B,CAACrB,MAAM,CAAC;AAC7F","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.HIDDEN_SVG_PROPS = void 0;
7
+ var _reactNative = require("react-native");
8
+ /**
9
+ * Hides a decorative `Svg` from assistive technology. On web, react-native-svg renders a raw
10
+ * `<svg>` without react-native-web's prop filtering, so RN-only accessibility props would reach
11
+ * the DOM as unknown attributes and log React warnings.
12
+ */
13
+ const HIDDEN_SVG_PROPS = exports.HIDDEN_SVG_PROPS = _reactNative.Platform.select({
14
+ web: {
15
+ 'aria-hidden': true
16
+ },
17
+ default: {
18
+ accessible: false,
19
+ accessibilityElementsHidden: true,
20
+ importantForAccessibility: 'no-hide-descendants'
21
+ }
22
+ });
23
+ //# sourceMappingURL=hiddenSvgProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","HIDDEN_SVG_PROPS","exports","Platform","select","web","default","accessible","accessibilityElementsHidden","importantForAccessibility"],"sourceRoot":"../../../../src","sources":["components/chart/hiddenSvgProps.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGE,qBAAQ,CAACC,MAAM,CAAC;EAC9CC,GAAG,EAAE;IAAE,aAAa,EAAE;EAAK,CAAC;EAC5BC,OAAO,EAAE;IACPC,UAAU,EAAE,KAAK;IACjBC,2BAA2B,EAAE,IAAI;IACjCC,yBAAyB,EAAE;EAC7B;AACF,CAAU,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/chart/index.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CHART_MOTION_DURATION = void 0;
7
+ exports.lerpVector = lerpVector;
8
+ exports.useChartEntrance = useChartEntrance;
9
+ exports.useChartMorph = useChartMorph;
10
+ exports.useChartMotionEnabled = useChartMotionEnabled;
11
+ var _react = require("react");
12
+ var _reactNativeReanimated = require("react-native-reanimated");
13
+ var _animation = require("../../animation");
14
+ const CHART_MOTION_DURATION = exports.CHART_MOTION_DURATION = 600;
15
+ const CHART_MOTION_EASING = _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.cubic);
16
+ /** Off for `'disable-all'`, an ancestor or global `disable-all`, and Reduce Motion. */
17
+ function useChartMotionEnabled(animation) {
18
+ const disabled = (0, _animation.useCombinedAnimationDisabledState)(animation);
19
+ const reducedMotion = (0, _reactNativeReanimated.useReducedMotion)();
20
+ return !disabled && !reducedMotion;
21
+ }
22
+
23
+ /**
24
+ * Non-finite entries mark gaps: they snap to the target instead of tweening.
25
+ * Vectors of different lengths cannot be paired, so the target wins outright.
26
+ */
27
+ function lerpVector(from, to, t) {
28
+ 'worklet';
29
+
30
+ const out = [];
31
+ const paired = from.length === to.length;
32
+ for (let index = 0; index < to.length; index += 1) {
33
+ const end = to[index];
34
+ const start = paired ? from[index] : end;
35
+ out.push(Number.isFinite(start) && Number.isFinite(end) ? start + (end - start) * t : end);
36
+ }
37
+ return out;
38
+ }
39
+ function parseSignature(signature) {
40
+ return signature.length === 0 ? [] : signature.split(',').map(Number);
41
+ }
42
+
43
+ /**
44
+ * Tweens a numeric geometry vector on the UI thread. Mounts at `initial` and runs to
45
+ * `target`; later targets start from wherever the previous tween currently is. When the
46
+ * vector changes length (points or slices added/removed) the entry replays from `initial`.
47
+ */
48
+ function useChartMorph(target, initial, enabled) {
49
+ const from = (0, _reactNativeReanimated.useSharedValue)(enabled ? [...initial] : [...target]);
50
+ const to = (0, _reactNativeReanimated.useSharedValue)([...target]);
51
+ const progress = (0, _reactNativeReanimated.useSharedValue)(enabled ? 0 : 1);
52
+ const signature = target.join(',');
53
+ const initialSignature = initial.join(',');
54
+ (0, _react.useEffect)(() => {
55
+ const next = parseSignature(signature);
56
+ if (!enabled) {
57
+ from.set(next);
58
+ to.set(next);
59
+ progress.set(1);
60
+ return;
61
+ }
62
+ const current = lerpVector(from.get(), to.get(), progress.get());
63
+ from.set(current.length === next.length ? current : parseSignature(initialSignature));
64
+ to.set(next);
65
+ progress.set(0);
66
+ progress.set((0, _reactNativeReanimated.withTiming)(1, {
67
+ duration: CHART_MOTION_DURATION,
68
+ easing: CHART_MOTION_EASING
69
+ }));
70
+ }, [signature, initialSignature, enabled, from, to, progress]);
71
+ return {
72
+ from,
73
+ to,
74
+ progress
75
+ };
76
+ }
77
+
78
+ /**
79
+ * 0 → 1 on mount and whenever `replayKey` changes. Labels sit on animated geometry, so they
80
+ * stay hidden until the morph is mostly done, then fade in at the final position.
81
+ */
82
+ function useChartEntrance(enabled, replayKey = '') {
83
+ const progress = (0, _reactNativeReanimated.useSharedValue)(enabled ? 0 : 1);
84
+ (0, _react.useEffect)(() => {
85
+ if (!enabled) {
86
+ progress.set(1);
87
+ return;
88
+ }
89
+ progress.set(0);
90
+ progress.set((0, _reactNativeReanimated.withTiming)(1, {
91
+ duration: CHART_MOTION_DURATION,
92
+ easing: CHART_MOTION_EASING
93
+ }));
94
+ }, [enabled, replayKey, progress]);
95
+ return progress;
96
+ }
97
+ //# sourceMappingURL=motion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNativeReanimated","_animation","CHART_MOTION_DURATION","exports","CHART_MOTION_EASING","Easing","out","cubic","useChartMotionEnabled","animation","disabled","useCombinedAnimationDisabledState","reducedMotion","useReducedMotion","lerpVector","from","to","t","paired","length","index","end","start","push","Number","isFinite","parseSignature","signature","split","map","useChartMorph","target","initial","enabled","useSharedValue","progress","join","initialSignature","useEffect","next","set","current","get","withTiming","duration","easing","useChartEntrance","replayKey"],"sourceRoot":"../../../../src","sources":["components/chart/motion.ts"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAOA,IAAAE,UAAA,GAAAF,OAAA;AAEO,MAAMG,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,GAAG;AACxC,MAAME,mBAAmB,GAAGC,6BAAM,CAACC,GAAG,CAACD,6BAAM,CAACE,KAAK,CAAC;AAQpD;AACO,SAASC,qBAAqBA,CAACC,SAA8C,EAAW;EAC7F,MAAMC,QAAQ,GAAG,IAAAC,4CAAiC,EAACF,SAAS,CAAC;EAC7D,MAAMG,aAAa,GAAG,IAAAC,uCAAgB,EAAC,CAAC;EACxC,OAAO,CAACH,QAAQ,IAAI,CAACE,aAAa;AACpC;;AAEA;AACA;AACA;AACA;AACO,SAASE,UAAUA,CAACC,IAAuB,EAAEC,EAAqB,EAAEC,CAAS,EAAY;EAC9F,SAAS;;EACT,MAAMX,GAAa,GAAG,EAAE;EACxB,MAAMY,MAAM,GAAGH,IAAI,CAACI,MAAM,KAAKH,EAAE,CAACG,MAAM;EACxC,KAAK,IAAIC,KAAK,G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AC,CAAC,EAAE;MAAEC,QAAQ,EAAE1C,qBAAqB;MAAE2C,MAAM,EAAEzC;IAAoB,CAAC,CAAC,CAAC;EAC/F,CAAC,EAAE,CAAC6B,OAAO,EAAEc,SAAS,EAAEZ,QAAQ,CAAC,CAAC;EAElC,OAAOA,QAAQ;AACjB","ignoreList":[]}
@@ -0,0 +1,178 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ChartLinearFills = ChartLinearFills;
7
+ exports.chartFillUrl = chartFillUrl;
8
+ exports.chartSeriesColor = chartSeriesColor;
9
+ exports.resolveChartColor = resolveChartColor;
10
+ exports.useChartChrome = useChartChrome;
11
+ exports.useChartColorPaints = useChartColorPaints;
12
+ exports.useChartGradientId = useChartGradientId;
13
+ exports.useChartPalette = useChartPalette;
14
+ exports.useChartSimpleColor = useChartSimpleColor;
15
+ var _react = require("react");
16
+ var _reactNativeSvg = require("react-native-svg");
17
+ var _uniwind = require("uniwind");
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
+ /** Light-theme chart tokens, used when Uniwind has no CSS context (Jest). */const CHART_FALLBACKS = {
20
+ simple: '#5b91de',
21
+ simpleSecondary: '#162e49',
22
+ simpleTertiary: '#3b6399',
23
+ categorical: ['#155dfc', '#f54900', '#009689', '#e60076', '#9810fa', '#525252'],
24
+ danger: '#c10007',
25
+ warning: '#ffb900',
26
+ success: '#00a63e',
27
+ info: '#0069a8'
28
+ };
29
+ function toColor(value, fallback) {
30
+ if (typeof value === 'string' && value.length > 0) {
31
+ return value;
32
+ }
33
+ return fallback;
34
+ }
35
+ function useChartSimpleColor() {
36
+ const value = (0, _uniwind.useCSSVariable)('--color-chart-simple-primary');
37
+ return toColor(value, CHART_FALLBACKS.simple);
38
+ }
39
+
40
+ /**
41
+ * A Forge color token by name: `simple-*` and `categorical-*` resolve
42
+ * `--color-chart-<name>`, severity names resolve `--color-surface-<name>-strong`.
43
+ * Overrides take a name, not a CSS color, so FI themes and dark mode recolor every chart.
44
+ */
45
+
46
+ const warnedChartColors = new Set();
47
+ function resolveChartColor(color, paints) {
48
+ if (color === undefined) return undefined;
49
+ const paint = paints[color];
50
+ if (paint === undefined && __DEV__ && !warnedChartColors.has(color)) {
51
+ warnedChartColors.add(color);
52
+ console.warn(`[Chart] Unknown color "${String(color)}". Pass a ChartColor token name, not a CSS ` + 'color; the default series color is used instead.');
53
+ }
54
+ return paint;
55
+ }
56
+ function useChartColorPaints() {
57
+ const simple = useChartSimpleColor();
58
+ const secondary = toColor((0, _uniwind.useCSSVariable)('--color-chart-simple-secondary'), CHART_FALLBACKS.simpleSecondary);
59
+ const tertiary = toColor((0, _uniwind.useCSSVariable)('--color-chart-simple-tertiary'), CHART_FALLBACKS.simpleTertiary);
60
+ const danger = toColor((0, _uniwind.useCSSVariable)('--color-surface-danger-strong'), CHART_FALLBACKS.danger);
61
+ const warning = toColor((0, _uniwind.useCSSVariable)('--color-surface-warning-strong'), CHART_FALLBACKS.warning);
62
+ const success = toColor((0, _uniwind.useCSSVariable)('--color-surface-success-strong'), CHART_FALLBACKS.success);
63
+ const info = toColor((0, _uniwind.useCSSVariable)('--color-surface-info-strong'), CHART_FALLBACKS.info);
64
+ const palette = useChartPalette();
65
+ return {
66
+ danger,
67
+ warning,
68
+ success,
69
+ info,
70
+ 'simple-primary': simple,
71
+ 'simple-secondary': secondary,
72
+ 'simple-tertiary': tertiary,
73
+ 'categorical-1': palette[0] ?? CHART_FALLBACKS.categorical[0],
74
+ 'categorical-2': palette[1] ?? CHART_FALLBACKS.categorical[1],
75
+ 'categorical-3': palette[2] ?? CHART_FALLBACKS.categorical[2],
76
+ 'categorical-4': palette[3] ?? CHART_FALLBACKS.categorical[3],
77
+ 'categorical-5': palette[4] ?? CHART_FALLBACKS.categorical[4],
78
+ 'categorical-6': palette[5] ?? CHART_FALLBACKS.categorical[5]
79
+ };
80
+ }
81
+
82
+ /**
83
+ * SVG text cannot take `className`, so typography tokens are resolved here.
84
+ * `useResolveClassNames` converts rem to px with the consumer's rem base; web
85
+ * may return rem strings, which fall back to the light-theme pixel size.
86
+ */
87
+ function toPx(value, fallbackPx) {
88
+ if (typeof value === 'number') {
89
+ return Number.isFinite(value) ? value : fallbackPx;
90
+ }
91
+ if (typeof value !== 'string') return fallbackPx;
92
+ const trimmed = value.trim();
93
+ if (!/^-?\d*\.?\d+(px)?$/.test(trimmed)) return fallbackPx;
94
+ return parseFloat(trimmed);
95
+ }
96
+ function useChartChrome() {
97
+ const grid = (0, _uniwind.useCSSVariable)('--color-stroke-secondary');
98
+ const label = (0, _uniwind.useCSSVariable)('--color-content-primary');
99
+ const surface = (0, _uniwind.useCSSVariable)('--color-surface-primary');
100
+ const fontFamily = (0, _uniwind.useCSSVariable)('--font-body');
101
+ const labelText = (0, _uniwind.useResolveClassNames)('text-xs');
102
+ const captionText = (0, _uniwind.useResolveClassNames)('text-2xs');
103
+ return {
104
+ grid: toColor(grid, '#e9e9e9'),
105
+ label: toColor(label, '#1b1c1d'),
106
+ surface: toColor(surface, '#ffffff'),
107
+ fontFamily: toColor(fontFamily, 'Inter'),
108
+ labelSize: toPx(labelText.fontSize, 12),
109
+ captionSize: toPx(captionText.fontSize, 10)
110
+ };
111
+ }
112
+
113
+ /**
114
+ * Resolved `categorical-1`…`6` paints, in slot order. Pie slices and charts past
115
+ * three series cycle them.
116
+ */
117
+ function useChartPalette() {
118
+ const slot1 = (0, _uniwind.useCSSVariable)('--color-chart-categorical-1');
119
+ const slot2 = (0, _uniwind.useCSSVariable)('--color-chart-categorical-2');
120
+ const slot3 = (0, _uniwind.useCSSVariable)('--color-chart-categorical-3');
121
+ const slot4 = (0, _uniwind.useCSSVariable)('--color-chart-categorical-4');
122
+ const slot5 = (0, _uniwind.useCSSVariable)('--color-chart-categorical-5');
123
+ const slot6 = (0, _uniwind.useCSSVariable)('--color-chart-categorical-6');
124
+ return [toColor(slot1, CHART_FALLBACKS.categorical[0]), toColor(slot2, CHART_FALLBACKS.categorical[1]), toColor(slot3, CHART_FALLBACKS.categorical[2]), toColor(slot4, CHART_FALLBACKS.categorical[3]), toColor(slot5, CHART_FALLBACKS.categorical[4]), toColor(slot6, CHART_FALLBACKS.categorical[5])];
125
+ }
126
+
127
+ /**
128
+ * `auto` keeps up to three series in the FI brand family and moves the whole chart to
129
+ * `categorical-1`…`6` past that, so one chart never mixes the two families.
130
+ * `categorical` always uses them.
131
+ */
132
+
133
+ /**
134
+ * Bars alternate light, dark, mid so adjacent bars don't read as a ramp. Lines step
135
+ * primary → tertiary → secondary so a two-line chart pairs neighboring brand steps.
136
+ */
137
+ const SIMPLE_SERIES = {
138
+ bar: ['simple-primary', 'simple-secondary', 'simple-tertiary'],
139
+ line: ['simple-primary', 'simple-tertiary', 'simple-secondary']
140
+ };
141
+ const CATEGORICAL_SERIES = ['categorical-1', 'categorical-2', 'categorical-3', 'categorical-4', 'categorical-5', 'categorical-6'];
142
+
143
+ /** Default color for a series. A series `color` still wins. */
144
+ function chartSeriesColor(seriesIndex, seriesCount, palette, kind) {
145
+ const simple = SIMPLE_SERIES[kind];
146
+ const ramp = palette === 'auto' && seriesCount <= simple.length ? simple : CATEGORICAL_SERIES;
147
+ return ramp[seriesIndex % ramp.length] ?? 'simple-primary';
148
+ }
149
+ function useChartGradientId(prefix) {
150
+ return `${prefix}-${(0, _react.useId)().replace(/[^a-zA-Z0-9_-]/g, '')}`;
151
+ }
152
+ function chartFillUrl(idPrefix, index) {
153
+ return `url(#${idPrefix}-${String(index)})`;
154
+ }
155
+ function ChartLinearFills({
156
+ idPrefix,
157
+ colors,
158
+ x2,
159
+ y2
160
+ }) {
161
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Defs, {
162
+ children: colors.map((color, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.LinearGradient, {
163
+ id: `${idPrefix}-${String(index)}`,
164
+ x1: "0%",
165
+ y1: "0%",
166
+ x2: x2,
167
+ y2: y2,
168
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
169
+ offset: "0%",
170
+ stopColor: color
171
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
172
+ offset: "100%",
173
+ stopColor: color
174
+ })]
175
+ }, `${idPrefix}-${String(index)}`))
176
+ });
177
+ }
178
+ //# sourceMappingURL=palette.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNativeSvg","_uniwind","_jsxRuntime","CHART_FALLBACKS","simple","simpleSecondary","simpleTertiary","categorical","danger","warning","success","info","toColor","value","fallback","length","useChartSimpleColor","useCSSVariable","warnedChartColors","Set","resolveChartColor","color","paints","undefined","paint","__DEV__","has","add","console","warn","String","useChartColorPaints","secondary","tertiary","palette","useChartPalette","toPx","fallbackPx","Number","isFinite","trimmed","trim","test","parseFloat","useChartChrome","grid","label","surface","fontFamily","labelText","useResolveClassNames","captionText","labelSize","fontSize","captionSize","slot1","slot2","slot3","slot4","slot5","slot6","SIMPLE_SERIES","bar","line","CATEGORICAL_SERIES","chartSeriesColor","seriesIndex","seriesCount","kind","ramp","useChartGradientId","prefix","useId","replace","chartFillUrl","idPrefix","index","ChartLinearFills","colors","x2","y2","jsx","Defs","children","map","jsxs","LinearGradient","id","x1","y1","Stop","offset","stopColor"],"sourceRoot":"../../../../src","sources":["components/chart/palette.tsx"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAA+D,IAAAG,WAAA,GAAAH,OAAA;AAE/D,6EACA,MAAMI,eAAe,GAAG;EACtBC,MAAM,EAAE,SAAS;EACjBC,eAAe,EAAE,SAAS;EAC1BC,cAAc,EAAE,SAAS;EACzBC,WAAW,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAU;EACxFC,MAAM,EA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CAAC,eACtC,IAAAnB,WAAA,CAAA+E,GAAA,EAACjF,eAAA,CAAA0F,IAAI;QAACC,MAAM,EAAC,MAAM;QAACC,SAAS,EAAEvE;MAAM,CAAE,CAAC;IAAA,GARnC,GAAGsD,QAAQ,IAAI7C,MAAM,CAAC8C,KAAK,CAAC,EASnB,CACjB;EAAC,CACE,CAAC;AAEX","ignoreList":[]}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CHART_DIMENSIONS = void 0;
7
+ exports.resolveChartBox = resolveChartBox;
8
+ /** Plot boxes. Heights match the spacing scale (`size-40`…`size-64`). */
9
+ const CHART_DIMENSIONS = exports.CHART_DIMENSIONS = {
10
+ sm: {
11
+ width: 256,
12
+ height: 160
13
+ },
14
+ md: {
15
+ width: 308,
16
+ height: 192
17
+ },
18
+ lg: {
19
+ width: 360,
20
+ height: 224
21
+ },
22
+ xl: {
23
+ width: 410,
24
+ height: 256
25
+ }
26
+ };
27
+ function resolveChartBox(size, width, height) {
28
+ const preset = CHART_DIMENSIONS[size ?? 'lg'];
29
+ return {
30
+ width: width ?? preset.width,
31
+ height: height ?? preset.height
32
+ };
33
+ }
34
+ //# sourceMappingURL=size.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CHART_DIMENSIONS","exports","sm","width","height","md","lg","xl","resolveChartBox","size","preset"],"sourceRoot":"../../../../src","sources":["components/chart/size.ts"],"mappings":";;;;;;;AAEA;AACO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG;EAC9BE,EAAE,EAAE;IAAEC,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAI,CAAC;EAC/BC,EAAE,EAAE;IAAEF,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAI,CAAC;EAC/BE,EAAE,EAAE;IAAEH,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAI,CAAC;EAC/BG,EAAE,EAAE;IAAEJ,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAI;AAChC,CAA2F;AAEpF,SAASI,eAAeA,CAC7BC,IAA2B,EAC3BN,KAAc,EACdC,MAAe,EACsC;EACrD,MAAMM,MAAM,GAAGV,gBAAgB,CAACS,IAAI,IAAI,IAAI,CAAC;EAC7C,OAAO;IACLN,KAAK,EAAEA,KAAK,IAAIO,MAAM,CAACP,KAAK;IAC5BC,MAAM,EAAEA,MAAM,IAAIM,MAAM,CAACN;EAC3B,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.niceTicks = niceTicks;
7
+ /** Rounds away float drift at the step's precision, so steps below 0.01 stay distinct. */
8
+ function roundToStep(value, step) {
9
+ const decimals = Math.min(20, Math.max(2, -Math.floor(Math.log10(step)) + 1));
10
+ const rounded = Number(value.toFixed(decimals));
11
+ return Object.is(rounded, -0) ? 0 : rounded;
12
+ }
13
+ function niceNumber(span, round) {
14
+ if (span <= 0 || !Number.isFinite(span)) {
15
+ return 1;
16
+ }
17
+ const exponent = Math.floor(Math.log10(span));
18
+ const fraction = span / 10 ** exponent;
19
+ let niceFraction;
20
+ if (round) {
21
+ if (fraction < 1.5) {
22
+ niceFraction = 1;
23
+ } else if (fraction < 3) {
24
+ niceFraction = 2;
25
+ } else if (fraction < 7) {
26
+ niceFraction = 5;
27
+ } else {
28
+ niceFraction = 10;
29
+ }
30
+ } else if (fraction <= 1) {
31
+ niceFraction = 1;
32
+ } else if (fraction <= 2) {
33
+ niceFraction = 2;
34
+ } else if (fraction <= 5) {
35
+ niceFraction = 5;
36
+ } else {
37
+ niceFraction = 10;
38
+ }
39
+ return niceFraction * 10 ** exponent;
40
+ }
41
+
42
+ /** Evenly spaced, readable ticks that cover `min`–`max` in about `count` steps. */
43
+ function niceTicks(min, max, count) {
44
+ if (!Number.isFinite(min) || !Number.isFinite(max)) {
45
+ return [];
46
+ }
47
+ const tickCount = Math.max(2, count);
48
+ const span = niceNumber(max - min, false);
49
+ const step = niceNumber(span / (tickCount - 1), true);
50
+ const niceMin = Math.floor(min / step) * step;
51
+ const niceMax = Math.ceil(max / step) * step;
52
+ const ticks = [];
53
+ const last = niceMax + step / 2;
54
+ for (let value = niceMin; value <= last; value += step) {
55
+ ticks.push(roundToStep(value, step));
56
+ }
57
+ return ticks;
58
+ }
59
+ //# sourceMappingURL=ticks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["roundToStep","value","step","decimals","Math","min","max","floor","log10","rounded","Number","toFixed","Object","is","niceNumber","span","round","isFinite","exponent","fraction","niceFraction","niceTicks","count","tickCount","niceMin","niceMax","ceil","ticks","last","push"],"sourceRoot":"../../../../src","sources":["components/chart/ticks.ts"],"mappings":";;;;;;AAAA;AACA,SAASA,WAAWA,CAACC,KAAa,EAAEC,IAAY,EAAU;EACxD,MAAMC,QAAQ,GAAGC,IAAI,CAACC,GAAG,CAAC,EAAE,EAAED,IAAI,CAACE,GAAG,CAAC,CAAC,EAAE,CAACF,IAAI,CAACG,KAAK,CAACH,IAAI,CAACI,KAAK,CAACN,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;EAC7E,MAAMO,OAAO,GAAGC,MAAM,CAACT,KAAK,CAACU,OAAO,CAACR,QAAQ,CAAC,CAAC;EAC/C,OAAOS,MAAM,CAACC,EAAE,CAACJ,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAGA,OAAO;AAC7C;AAEA,SAASK,UAAUA,CAACC,IAAY,EAAEC,KAAc,EAAU;EACxD,IAAID,IAAI,IAAI,CAAC,IAAI,CAACL,MAAM,CAACO,QAAQ,CAACF,IAAI,CAAC,EAAE;IACvC,OAAO,CAAC;EACV;EACA,MAAMG,QAAQ,GAAGd,IAAI,CAACG,KAAK,CAACH,IAAI,CAACI,KAAK,CAACO,IAAI,CAAC,CAAC;EAC7C,MAAMI,QAAQ,GA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AO,GAAGrB,IAAI,CAACsB,IAAI,CAACpB,GAAG,GAAGJ,IAAI,CAAC,GAAGA,IAAI;EAC5C,MAAMyB,KAAe,GAAG,EAAE;EAC1B,MAAMC,IAAI,GAAGH,OAAO,GAAGvB,IAAI,GAAG,CAAC;EAC/B,KAAK,IAAID,KAAK,GAAGuB,OAAO,EAAEvB,KAAK,IAAI2B,IAAI,EAAE3B,KAAK,IAAIC,IAAI,EAAE;IACtDyB,KAAK,CAACE,IAAI,CAAC7B,WAAW,CAACC,KAAK,EAAEC,IAAI,CAAC,CAAC;EACtC;EACA,OAAOyB,KAAK;AACd","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/chart/types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.composeChartLayout = composeChartLayout;
7
+ exports.useChartHostWidth = useChartHostWidth;
8
+ var _react = require("react");
9
+ var _utils = require("@cdx-ui/utils");
10
+ /** Runs the chart's own handler first, then the consumer's. */
11
+ function composeChartLayout(own, consumer) {
12
+ return (0, _utils.composeEventHandlers)(own, consumer);
13
+ }
14
+
15
+ /**
16
+ * Measured width of the chart root (`0` before the first layout) and the `onLayout` to put on
17
+ * it. The consumer's `onLayout` still fires.
18
+ */
19
+ function useChartHostWidth(onLayout) {
20
+ const [width, setWidth] = (0, _react.useState)(0);
21
+ const handleLayout = composeChartLayout(event => {
22
+ const next = event.nativeEvent.layout.width;
23
+ setWidth(prev => prev === next ? prev : next);
24
+ }, onLayout);
25
+ return [width, handleLayout];
26
+ }
27
+ //# sourceMappingURL=useChartHostWidth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_utils","composeChartLayout","own","consumer","composeEventHandlers","useChartHostWidth","onLayout","width","setWidth","useState","handleLayout","event","next","nativeEvent","layout","prev"],"sourceRoot":"../../../../src","sources":["components/chart/useChartHostWidth.ts"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEA;AACO,SAASE,kBAAkBA,CAChCC,GAAuC,EACvCC,QAAiE,EAC7B;EACpC,OAAO,IAAAC,2BAAoB,EAAoBF,GAAG,EAAEC,QAAQ,CAAC;AAC/D;;AAEA;AACA;AACA;AACA;AACO,SAASE,iBAAiBA,CAC/BC,QAAiE,EACV;EACvD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAC,eAAQ,EAAC,CAAC,CAAC;EACrC,MAAMC,YAAY,GAAGT,kBAAkB,CAAEU,KAAK,IAAK;IACjD,MAAMC,IAAI,GAAGD,KAAK,CAACE,WAAW,CAACC,MAAM,CAACP,KAAK;IAC3CC,QAAQ,CAAEO,IAAI,IAAMA,IAAI,KAAKH,IAAI,GAAGG,IAAI,GAAGH,IAAK,CAAC;EACnD,CAAC,EAAEN,QAAQ,CAAC;EACZ,OAAO,CAACC,KAAK,EAAEG,YAAY,CAAC;AAC9B","ignoreList":[]}