@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,744 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LineChart = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
10
+ var _reactNativeSvg = require("react-native-svg");
11
+ var _primitives = require("@cdx-ui/primitives");
12
+ var _utils = require("@cdx-ui/utils");
13
+ var _ChartInspector = require("../chart/ChartInspector");
14
+ var _format = require("../chart/format");
15
+ var _hiddenSvgProps = require("../chart/hiddenSvgProps");
16
+ var _size = require("../chart/size");
17
+ var _useChartHostWidth = require("../chart/useChartHostWidth");
18
+ var _palette = require("../chart/palette");
19
+ var _motion = require("../chart/motion");
20
+ var _geometry = require("./geometry");
21
+ var _styles = require("./styles");
22
+ var _jsxRuntime = require("react/jsx-runtime");
23
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
24
+ /* SVG `x`/`y` are paint coordinates. RN View `x`/`y` layout props are deprecated and share the name. */
25
+ /* eslint-disable @typescript-eslint/no-deprecated */
26
+
27
+ const INACTIVE_OPACITY = 0.4;
28
+ const DASH = '6 4';
29
+ /** Within this many px of a plot edge, callouts anchor inward so they are not clipped. */
30
+ const EDGE_LABEL_ROOM = 32;
31
+ /** Paint slack around the plot so dots and strokes on its edges are not cut in half. */
32
+ const CLIP_BLEED = _styles.LINE_ACTIVE_DOT_RADIUS + _styles.LINE_STROKE_WIDTH;
33
+ const AnimatedPath = _reactNativeReanimated.default.createAnimatedComponent(_reactNativeSvg.Path);
34
+ const AnimatedCircle = _reactNativeReanimated.default.createAnimatedComponent(_reactNativeSvg.Circle);
35
+ function LineChartInner({
36
+ dataset,
37
+ series: seriesProp,
38
+ xAxis: xAxisProp,
39
+ yAxis: yAxisProp,
40
+ size = 'lg',
41
+ width: widthProp,
42
+ height: heightProp,
43
+ grid,
44
+ palette = 'auto',
45
+ hideLegend = false,
46
+ tooltip: tooltipProp,
47
+ scrollable = true,
48
+ visiblePoints,
49
+ selectedItem: selectedItemProp,
50
+ defaultSelectedItem,
51
+ onSelectedItemChange,
52
+ referenceLines,
53
+ markers,
54
+ locale,
55
+ localeText: localeTextProp,
56
+ animation,
57
+ accessibilityLabel,
58
+ className,
59
+ style,
60
+ onLayout,
61
+ ...props
62
+ }, ref) {
63
+ const animated = (0, _motion.useChartMotionEnabled)(animation);
64
+ const gradientId = (0, _palette.useChartGradientId)('line-fill');
65
+ const chrome = (0, _palette.useChartChrome)();
66
+ const paints = (0, _palette.useChartColorPaints)();
67
+ const localeText = (0, _react.useMemo)(() => (0, _format.resolveChartLocaleText)(localeTextProp), [localeTextProp]);
68
+ const xAxis = xAxisProp?.[0];
69
+ const yAxis = yAxisProp?.[0];
70
+ const showValueTicks = yAxis?.position !== 'none';
71
+ const showCategoryLabels = xAxis?.position !== 'none';
72
+ const resolved = (0, _react.useMemo)(() => (0, _geometry.resolveLineChartData)({
73
+ dataset,
74
+ series: seriesProp,
75
+ xAxis
76
+ }), [dataset, seriesProp, xAxis]);
77
+ const formatters = (0, _react.useMemo)(() => seriesProp.map(item => (0, _format.resolveValueFormatter)(item, yAxis, locale)), [seriesProp, yAxis, locale]);
78
+ const formatTick = (0, _react.useMemo)(() => {
79
+ const format = (0, _format.resolveValueFormatter)(null, yAxis, locale);
80
+ return value => format(value, {
81
+ location: 'tick'
82
+ });
83
+ }, [yAxis, locale]);
84
+ const box = (0, _size.resolveChartBox)(size, widthProp, heightProp);
85
+ const [hostWidth, handleHostLayout] = (0, _useChartHostWidth.useChartHostWidth)(onLayout);
86
+ const viewportWidth = hostWidth > 0 ? Math.min(hostWidth, box.width) : box.width;
87
+ const viewportHeight = box.height;
88
+ const gutters = (0, _react.useMemo)(() => (0, _geometry.lineChartMarkerGutters)(dataset.length, markers, (0, _geometry.lineChartGutters)({
89
+ showValueTicks,
90
+ showCategoryLabels
91
+ })), [dataset.length, markers, showValueTicks, showCategoryLabels]);
92
+ const content = (0, _react.useMemo)(() => (0, _geometry.resolveLineChartContentSize)({
93
+ viewportWidth,
94
+ viewportHeight,
95
+ categoryCount: dataset.length,
96
+ gutters,
97
+ scrollable,
98
+ visiblePoints
99
+ }), [viewportWidth, viewportHeight, dataset.length, gutters, scrollable, visiblePoints]);
100
+ const layout = (0, _react.useMemo)(() => (0, _geometry.layoutLineChart)({
101
+ categories: resolved.categories,
102
+ series: resolved.series,
103
+ width: content.width,
104
+ height: content.height,
105
+ referenceLines,
106
+ yAxis,
107
+ formatTick,
108
+ gutters
109
+ }), [resolved, content.width, content.height, referenceLines, yAxis, formatTick, gutters]);
110
+ const markerLayout = (0, _react.useMemo)(() => (0, _geometry.layoutLineChartMarkers)(markers ?? [], layout.series), [markers, layout.series]);
111
+ const overflowsX = content.width > viewportWidth + 0.5;
112
+ const morph = (0, _motion.useChartMorph)(layout.series.flatMap(item => item.points.map(point => point.y ?? Number.NaN)), layout.series.flatMap(item => item.points.map(point => point.y === null ? Number.NaN : layout.baselineY)), animated);
113
+ const fills = seriesProp.map((item, seriesIndex) => (0, _palette.resolveChartColor)(item.color, paints) ?? paints[(0, _palette.chartSeriesColor)(seriesIndex, seriesProp.length, palette, 'line')]);
114
+ const marks = seriesProp.map(item => item.showMark ?? false);
115
+ const summary = accessibilityLabel ?? lineSummary(layout, formatters, localeText);
116
+ const interactive = onSelectedItemChange !== undefined || selectedItemProp !== undefined || defaultSelectedItem !== undefined;
117
+ const [selectedItemState, setSelectedItem] = (0, _utils.useControllableState)({
118
+ prop: selectedItemProp,
119
+ defaultProp: defaultSelectedItem ?? null,
120
+ onChange: next => {
121
+ onSelectedItemChange?.(next ?? null);
122
+ }
123
+ });
124
+ const selectedIndex = selectedItemState?.dataIndex ?? null;
125
+ const showTooltip = (tooltipProp?.trigger ?? 'axis') !== 'none';
126
+ const inspectable = (interactive || showTooltip) && dataset.length > 0;
127
+ const [activeIndex, setActiveIndex] = (0, _react.useState)(null);
128
+ const [dismissed, setDismissed] = (0, _react.useState)(false);
129
+ const [scrubbing, setScrubbing] = (0, _react.useState)(false);
130
+ const scrollX = (0, _react.useRef)(0);
131
+ const highlightIndex = activeIndex ?? selectedIndex;
132
+ const tooltipIndex = showTooltip && !dismissed && activeIndex !== null ? activeIndex : null;
133
+ const activate = index => {
134
+ setDismissed(false);
135
+ setActiveIndex(prev => prev === index ? prev : index);
136
+ };
137
+ const deactivate = index => {
138
+ setActiveIndex(prev => prev === index ? null : prev);
139
+ };
140
+ const selectIndex = index => {
141
+ if (selectedIndex === index) {
142
+ setSelectedItem(null);
143
+ return;
144
+ }
145
+ const owner = layout.series.find(item => item.points[index]?.value != null) ?? layout.series[0];
146
+ setSelectedItem(owner === undefined ? null : {
147
+ seriesId: owner.key,
148
+ dataIndex: index
149
+ });
150
+ };
151
+ const markerLegend = markerLayout.filter(item => item.legend !== undefined && item.legend.length > 0);
152
+ const showLegend = !hideLegend && (seriesProp.length > 0 || markerLegend.length > 0);
153
+ const plot = /*#__PURE__*/(0, _jsxRuntime.jsx)(LinePlot, {
154
+ layout: layout,
155
+ morph: morph,
156
+ fills: fills,
157
+ gradientId: gradientId,
158
+ chrome: chrome,
159
+ marks: marks,
160
+ showGrid: grid?.horizontal !== false,
161
+ highlightIndex: highlightIndex,
162
+ formatters: formatters,
163
+ markers: markerLayout,
164
+ paints: paints
165
+ });
166
+ const plotWidth = content.width - layout.plot.x;
167
+ const bleed = Math.min(CLIP_BLEED, layout.plot.x);
168
+ const axisWidth = layout.plot.x - bleed;
169
+ const targets = inspectable ? lineInspectorTargets({
170
+ layout,
171
+ width: plotWidth,
172
+ height: viewportHeight,
173
+ fills,
174
+ formatters,
175
+ localeText,
176
+ selectedIndex,
177
+ markers: markerLayout
178
+ }) : [];
179
+ const tip = tooltipIndex === null ? undefined : targets.at(tooltipIndex);
180
+ const ticks = showValueTicks ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
181
+ children: layout.valueTicks.map(tick => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Text, {
182
+ x: tick.x,
183
+ y: tick.y,
184
+ fill: chrome.label,
185
+ fontFamily: chrome.fontFamily,
186
+ fontSize: chrome.labelSize,
187
+ textAnchor: "end",
188
+ alignmentBaseline: "middle",
189
+ children: tick.text
190
+ }, `tick-${String(tick.value)}`))
191
+ }) : null;
192
+ const chart = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
193
+ className: "flex-row",
194
+ style: {
195
+ width: viewportWidth,
196
+ height: viewportHeight
197
+ },
198
+ ...(0, _primitives.dataAttributes)({
199
+ slot: 'line-chart-plot'
200
+ }),
201
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Svg, {
202
+ width: axisWidth,
203
+ height: viewportHeight,
204
+ viewBox: `0 0 ${String(axisWidth)} ${String(content.height)}`,
205
+ ..._hiddenSvgProps.HIDDEN_SVG_PROPS,
206
+ children: ticks
207
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
208
+ horizontal: true,
209
+ nestedScrollEnabled: true,
210
+ scrollEnabled: overflowsX && !scrubbing,
211
+ showsHorizontalScrollIndicator: overflowsX,
212
+ scrollEventThrottle: 16,
213
+ onScroll: event => {
214
+ scrollX.current = event.nativeEvent.contentOffset.x;
215
+ if (tooltipIndex !== null) {
216
+ setDismissed(true);
217
+ }
218
+ },
219
+ className: "flex-1",
220
+ style: {
221
+ height: viewportHeight
222
+ },
223
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
224
+ style: {
225
+ width: plotWidth + bleed,
226
+ height: viewportHeight
227
+ },
228
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Svg, {
229
+ width: plotWidth + bleed,
230
+ height: viewportHeight,
231
+ viewBox: `0 0 ${String(plotWidth + bleed)} ${String(content.height)}`,
232
+ pointerEvents: "none",
233
+ ..._hiddenSvgProps.HIDDEN_SVG_PROPS,
234
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.G, {
235
+ transform: `translate(${String(-axisWidth)}, 0)`,
236
+ children: plot
237
+ })
238
+ }), inspectable ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
239
+ className: "absolute top-0 bottom-0",
240
+ style: {
241
+ left: bleed,
242
+ width: plotWidth
243
+ },
244
+ pointerEvents: "box-none",
245
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(LineInspector, {
246
+ layout: layout,
247
+ targets: targets,
248
+ summary: summary,
249
+ selectable: interactive,
250
+ selectedIndex: selectedIndex,
251
+ activeIndex: activeIndex,
252
+ holdToScrub: overflowsX,
253
+ onScrubLockChange: setScrubbing,
254
+ onActivate: activate,
255
+ onDeactivate: deactivate,
256
+ onDismiss: () => {
257
+ setDismissed(true);
258
+ },
259
+ onSelectIndex: selectIndex
260
+ })
261
+ }) : null]
262
+ })
263
+ }), tip !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartInspector.ChartTooltipLayer, {
264
+ content: tip.tooltip,
265
+ noValueText: localeText.noValue,
266
+ slot: "line-chart",
267
+ anchorX: layout.plot.x + tip.anchorX - scrollX.current,
268
+ anchorY: tip.anchorY,
269
+ anchorRadius: tip.anchorRadius,
270
+ width: viewportWidth,
271
+ height: viewportHeight
272
+ }) : null]
273
+ });
274
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
275
+ ref: ref,
276
+ className: (0, _utils.cn)((0, _styles.lineChartRootVariants)(), className),
277
+ style: style,
278
+ accessible: !inspectable && !showLegend,
279
+ accessibilityRole: !inspectable && !showLegend ? 'image' : undefined,
280
+ accessibilityLabel: !inspectable && !showLegend ? summary : undefined,
281
+ ...props,
282
+ onLayout: handleHostLayout,
283
+ ...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
284
+ slot: 'line-chart'
285
+ })),
286
+ children: [chart, showLegend ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
287
+ className: (0, _styles.lineChartLegendVariants)(),
288
+ ...(0, _primitives.dataAttributes)({
289
+ slot: 'line-chart-legend'
290
+ }),
291
+ children: [seriesProp.map((item, seriesIndex) => {
292
+ const selectedPoint = highlightIndex === null ? undefined : layout.series[seriesIndex]?.points.at(highlightIndex);
293
+ const isSelected = selectedPoint !== undefined && selectedPoint.value !== null;
294
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
295
+ className: (0, _styles.lineChartLegendItemVariants)(),
296
+ ...(0, _primitives.dataAttributes)({
297
+ slot: 'line-chart-legend-item'
298
+ }),
299
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
300
+ className: "h-0.5 w-3 rounded-full",
301
+ style: {
302
+ backgroundColor: fills[seriesIndex]
303
+ }
304
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
305
+ className: (0, _styles.lineChartLegendLabelVariants)({
306
+ selected: isSelected
307
+ }),
308
+ children: seriesLegendLabel(item, seriesProp.length, localeText)
309
+ })]
310
+ }, item.id);
311
+ }), markerLegend.map(item => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
312
+ className: (0, _styles.lineChartLegendItemVariants)(),
313
+ ...(0, _primitives.dataAttributes)({
314
+ slot: 'line-chart-legend-item'
315
+ }),
316
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
317
+ className: "size-2.5 rounded-full",
318
+ style: {
319
+ backgroundColor: (0, _palette.resolveChartColor)(item.color, paints) ?? fills[item.seriesIndex] ?? fills[0]
320
+ }
321
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
322
+ className: (0, _styles.lineChartLegendLabelVariants)(),
323
+ children: item.legend
324
+ })]
325
+ }, `legend-${item.key}`))]
326
+ }) : null]
327
+ });
328
+ }
329
+ const LineChart = exports.LineChart = /*#__PURE__*/(0, _react.forwardRef)(LineChartInner);
330
+ LineChart.displayName = 'LineChart';
331
+ function lineSummary(layout, formatters, localeText) {
332
+ const lastIndex = layout.categoryLabels.length - 1;
333
+ const last = layout.categoryLabels[lastIndex];
334
+ if (last === undefined) {
335
+ return localeText.lineChartSummary(null);
336
+ }
337
+ const latest = {
338
+ label: last.title,
339
+ values: layout.series.flatMap((item, seriesIndex) => {
340
+ const value = item.points[lastIndex]?.value;
341
+ if (value == null) {
342
+ return [];
343
+ }
344
+ const format = formatters[seriesIndex];
345
+ return [{
346
+ label: item.label,
347
+ formattedValue: format?.(value, {
348
+ location: 'a11y',
349
+ seriesId: item.key,
350
+ dataIndex: lastIndex
351
+ }) ?? ''
352
+ }];
353
+ })
354
+ };
355
+ return localeText.lineChartSummary(latest);
356
+ }
357
+ function showsMark(mark, index) {
358
+ return typeof mark === 'function' ? mark({
359
+ index
360
+ }) : mark === true;
361
+ }
362
+ function LinePlot({
363
+ layout,
364
+ morph,
365
+ fills,
366
+ gradientId,
367
+ chrome,
368
+ marks,
369
+ showGrid,
370
+ highlightIndex,
371
+ formatters,
372
+ markers,
373
+ paints
374
+ }) {
375
+ const xs = layout.categoryLabels.map(item => item.x);
376
+ const clipId = `${gradientId}-clip`;
377
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
378
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_palette.ChartLinearFills, {
379
+ idPrefix: gradientId,
380
+ colors: fills,
381
+ x2: "100%",
382
+ y2: "0%"
383
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.Defs, {
384
+ children: [fills.map((color, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.LinearGradient, {
385
+ id: `${gradientId}-area-${String(index)}`,
386
+ x1: "0%",
387
+ y1: "0%",
388
+ x2: "0%",
389
+ y2: "100%",
390
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
391
+ offset: "0%",
392
+ stopColor: color,
393
+ stopOpacity: 0.32
394
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
395
+ offset: "100%",
396
+ stopColor: color,
397
+ stopOpacity: 0
398
+ })]
399
+ }, `area-${String(index)}`)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.ClipPath, {
400
+ id: clipId,
401
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Rect, {
402
+ x: layout.plot.x - CLIP_BLEED,
403
+ y: layout.plot.y - CLIP_BLEED,
404
+ width: layout.plot.width + CLIP_BLEED * 2,
405
+ height: layout.plot.height + CLIP_BLEED * 2
406
+ })
407
+ })]
408
+ }), showGrid ? layout.gridLines.map(line => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Line, {
409
+ x1: line.x1,
410
+ y1: line.y1,
411
+ x2: line.x2,
412
+ y2: line.y2,
413
+ stroke: chrome.grid,
414
+ strokeWidth: 1
415
+ }, `grid-${String(line.x1)}-${String(line.y1)}`)) : null, layout.referenceLines.map((line, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.G, {
416
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Line, {
417
+ x1: line.x1,
418
+ y1: line.y1,
419
+ x2: line.x2,
420
+ y2: line.y2,
421
+ stroke: chrome.label,
422
+ strokeWidth: 1,
423
+ strokeDasharray: DASH
424
+ }), line.label !== undefined && line.label.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Text, {
425
+ x: line.x1 + 4,
426
+ y: line.y1 - 4,
427
+ fill: chrome.label,
428
+ fontFamily: chrome.fontFamily,
429
+ fontSize: chrome.captionSize,
430
+ textAnchor: "start",
431
+ children: line.label
432
+ }) : null]
433
+ }, `ref-${String(line.y1)}-${String(index)}`)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.G, {
434
+ clipPath: `url(#${clipId})`,
435
+ children: [layout.series.map((item, seriesIndex) => /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedSeries, {
436
+ item: item,
437
+ seriesIndex: seriesIndex,
438
+ xs: xs,
439
+ baselineY: layout.baselineY,
440
+ morph: morph,
441
+ areaFill: `url(#${gradientId}-area-${String(seriesIndex)})`,
442
+ stroke: (0, _palette.chartFillUrl)(gradientId, seriesIndex),
443
+ opacity: highlightIndex !== null ? INACTIVE_OPACITY + 0.35 : 1
444
+ }, item.key)), layout.series.flatMap((item, seriesIndex) => item.points.map(point => point.y === null || !showsMark(marks[seriesIndex], point.index) ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedDot, {
445
+ cx: point.x,
446
+ slot: seriesIndex * xs.length + point.index,
447
+ morph: morph,
448
+ fill: chrome.surface,
449
+ stroke: fills[seriesIndex] ?? chrome.label
450
+ }, `dot-${item.key}-${String(point.index)}`)))]
451
+ }), highlightIndex !== null ? (() => {
452
+ const label = layout.categoryLabels.at(highlightIndex);
453
+ if (label === undefined) {
454
+ return null;
455
+ }
456
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Line, {
457
+ x1: label.x,
458
+ x2: label.x,
459
+ y1: layout.plot.y,
460
+ y2: layout.plot.y + layout.plot.height,
461
+ stroke: chrome.label,
462
+ strokeWidth: 1,
463
+ strokeDasharray: "3 4"
464
+ });
465
+ })() : null, markers.map(marker => marker.guide ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Line, {
466
+ x1: marker.x,
467
+ x2: marker.x,
468
+ y1: layout.plot.y,
469
+ y2: layout.plot.y + layout.plot.height,
470
+ stroke: chrome.grid,
471
+ strokeWidth: 1,
472
+ strokeDasharray: "3 4",
473
+ opacity: highlightIndex !== null && highlightIndex !== marker.index ? INACTIVE_OPACITY : 1
474
+ }, `marker-guide-${marker.key}`) : null), highlightIndex !== null ? layout.series.flatMap((item, seriesIndex) => {
475
+ const point = item.points.at(highlightIndex);
476
+ if (point?.y == null) {
477
+ return [];
478
+ }
479
+ return [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Circle, {
480
+ cx: point.x,
481
+ cy: point.y,
482
+ r: _styles.LINE_ACTIVE_DOT_RADIUS,
483
+ fill: chrome.surface,
484
+ stroke: fills[seriesIndex],
485
+ strokeWidth: _styles.LINE_STROKE_WIDTH
486
+ }, `active-${item.key}`)];
487
+ }) : null, markers.map(marker => {
488
+ const color = (0, _palette.resolveChartColor)(marker.color, paints) ?? fills[marker.seriesIndex] ?? fills.at(0) ?? chrome.label;
489
+ const nearEnd = marker.x > layout.plot.x + layout.plot.width - EDGE_LABEL_ROOM;
490
+ const nearStart = marker.x < layout.plot.x + EDGE_LABEL_ROOM;
491
+ const captionAnchor = nearEnd ? 'end' : nearStart ? 'start' : 'middle';
492
+ const dimmed = highlightIndex !== null && highlightIndex !== marker.index;
493
+ const markerOpacity = dimmed ? INACTIVE_OPACITY : 1;
494
+ const format = formatters[marker.seriesIndex];
495
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.G, {
496
+ children: [marker.dot ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Circle, {
497
+ cx: marker.x,
498
+ cy: marker.y,
499
+ r: _styles.LINE_ACTIVE_DOT_RADIUS,
500
+ fill: color,
501
+ stroke: chrome.surface,
502
+ strokeWidth: _styles.LINE_STROKE_WIDTH,
503
+ opacity: markerOpacity
504
+ }) : null, marker.label !== undefined && marker.label.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Text, {
505
+ x: marker.x,
506
+ y: marker.y - 16,
507
+ fill: chrome.label,
508
+ fontFamily: chrome.fontFamily,
509
+ fontSize: chrome.captionSize,
510
+ textAnchor: captionAnchor,
511
+ opacity: markerOpacity,
512
+ children: marker.label
513
+ }) : null, marker.showValue ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Text, {
514
+ x: nearEnd ? marker.x - 10 : marker.x + 10,
515
+ y: marker.y + 4,
516
+ fill: chrome.label,
517
+ fontFamily: chrome.fontFamily,
518
+ fontSize: chrome.captionSize,
519
+ textAnchor: nearEnd ? 'end' : 'start',
520
+ opacity: markerOpacity,
521
+ children: format?.(marker.value, {
522
+ location: 'label',
523
+ seriesId: marker.seriesId,
524
+ dataIndex: marker.index
525
+ }) ?? ''
526
+ }) : null]
527
+ }, `marker-${marker.key}`);
528
+ }), layout.categoryLabels.map((item, index) => item.tick ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Text, {
529
+ x: item.x,
530
+ y: item.y,
531
+ fill: chrome.label,
532
+ fontFamily: chrome.fontFamily,
533
+ fontSize: chrome.labelSize,
534
+ textAnchor: layout.categoryLabels.length < 2 ? 'middle' : index === 0 ? 'start' : index === layout.categoryLabels.length - 1 ? 'end' : 'middle',
535
+ alignmentBaseline: "middle",
536
+ children: item.label
537
+ }, `cat-${item.label}-${String(index)}`) : null)]
538
+ });
539
+ }
540
+ function categoryValues(layout, index, fills, formatters, location) {
541
+ return layout.series.flatMap((item, seriesIndex) => {
542
+ const point = item.points.at(index);
543
+ if (point?.value == null) {
544
+ return [];
545
+ }
546
+ const format = formatters[seriesIndex];
547
+ return [{
548
+ seriesId: item.key,
549
+ label: item.label,
550
+ color: fills[seriesIndex] ?? '',
551
+ formattedValue: format?.(point.value, {
552
+ location,
553
+ seriesId: item.key,
554
+ dataIndex: index
555
+ }) ?? ''
556
+ }];
557
+ });
558
+ }
559
+ function seriesLegendLabel(item, seriesCount, localeText) {
560
+ if (item.label !== undefined && item.label.length > 0) {
561
+ return item.label;
562
+ }
563
+ return seriesCount === 1 ? localeText.defaultSeriesLabel : item.id;
564
+ }
565
+ function categoryAnnouncement(label, values, noValue, notes = []) {
566
+ const parts = values.map(_ChartInspector.chartValueText);
567
+ const base = parts.length > 0 ? `${label}, ${parts.join(', ')}` : `${label}, ${noValue}`;
568
+ return notes.length > 0 ? `${base}, ${notes.join(', ')}` : base;
569
+ }
570
+ function markerNotes(markers, index) {
571
+ return markers.filter(marker => marker.index === index).flatMap(marker => [marker.legend, marker.label].filter(text => text !== undefined && text.length > 0));
572
+ }
573
+ function lineKeyboardNeighbor(index, key, count) {
574
+ if (key === 'Tab') {
575
+ return index + 1 < count ? index + 1 : null;
576
+ }
577
+ if (key === 'Shift+Tab') {
578
+ return index > 0 ? index - 1 : null;
579
+ }
580
+ return null;
581
+ }
582
+
583
+ /** Targets in scroll-content coordinates, which start at `layout.plot.x`. */
584
+ function lineInspectorTargets({
585
+ layout,
586
+ width,
587
+ height,
588
+ fills,
589
+ formatters,
590
+ localeText,
591
+ selectedIndex,
592
+ markers
593
+ }) {
594
+ const count = layout.categoryLabels.length;
595
+ const band = layout.plot.width / Math.max(count - 1, 1);
596
+ const offset = layout.plot.x;
597
+ return layout.categoryLabels.map((item, index) => {
598
+ const x = item.x - offset;
599
+ const left = index === 0 ? 0 : x - band / 2;
600
+ const right = index === count - 1 ? width : x + band / 2;
601
+ const pointYs = layout.series.flatMap(series => {
602
+ const y = series.points.at(index)?.y;
603
+ return y == null ? [] : [y];
604
+ });
605
+ return {
606
+ key: `hit-${String(index)}`,
607
+ left,
608
+ top: 0,
609
+ width: Math.max(right - left, 1),
610
+ height,
611
+ anchorX: x,
612
+ anchorY: pointYs.length > 0 ? Math.min(...pointYs) : layout.plot.y,
613
+ tooltip: {
614
+ title: item.title,
615
+ items: categoryValues(layout, index, fills, formatters, 'tooltip')
616
+ },
617
+ accessibilityLabel: categoryAnnouncement(item.title, categoryValues(layout, index, fills, formatters, 'a11y'), localeText.noValue, markerNotes(markers, index)),
618
+ selected: selectedIndex === index
619
+ };
620
+ });
621
+ }
622
+ function LineInspector({
623
+ layout,
624
+ targets,
625
+ summary,
626
+ selectable,
627
+ selectedIndex,
628
+ activeIndex,
629
+ onActivate,
630
+ onDeactivate,
631
+ onDismiss,
632
+ onSelectIndex,
633
+ holdToScrub,
634
+ onScrubLockChange
635
+ }) {
636
+ const count = layout.categoryLabels.length;
637
+ const offset = layout.plot.x;
638
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartInspector.ChartInspector, {
639
+ targets: targets,
640
+ summary: summary,
641
+ selectable: selectable,
642
+ activeIndex: activeIndex,
643
+ selectedIndex: selectedIndex,
644
+ slot: "line-chart",
645
+ holdToScrub: holdToScrub,
646
+ onActivate: onActivate,
647
+ onDeactivate: onDeactivate,
648
+ onDismiss: onDismiss,
649
+ onSelectIndex: onSelectIndex,
650
+ hitTest: (x, y) => (0, _geometry.nearestCategoryInPlot)(layout.categoryLabels, layout.plot, x, y, offset),
651
+ neighborIndex: (index, key) => lineKeyboardNeighbor(index, key, count),
652
+ onScrubLockChange: onScrubLockChange
653
+ });
654
+ }
655
+ function AnimatedSeries({
656
+ item,
657
+ seriesIndex,
658
+ xs,
659
+ baselineY,
660
+ morph,
661
+ areaFill,
662
+ stroke,
663
+ opacity
664
+ }) {
665
+ const {
666
+ from,
667
+ to,
668
+ progress
669
+ } = morph;
670
+ const start = seriesIndex * xs.length;
671
+ const end = start + xs.length;
672
+ const dashAt = item.dashAt;
673
+ const curve = item.curve;
674
+ const lineProps = (0, _reactNativeReanimated.useAnimatedProps)(() => {
675
+ const ys = (0, _motion.lerpVector)(from.get(), to.get(), progress.get()).slice(start, end);
676
+ return {
677
+ d: (0, _geometry.lineSeriesPaths)(xs, ys, curve, baselineY, dashAt).path
678
+ };
679
+ }, [from, to, progress, start, end, xs, curve, baselineY, dashAt]);
680
+ const dashProps = (0, _reactNativeReanimated.useAnimatedProps)(() => {
681
+ const ys = (0, _motion.lerpVector)(from.get(), to.get(), progress.get()).slice(start, end);
682
+ return {
683
+ d: (0, _geometry.lineSeriesPaths)(xs, ys, curve, baselineY, dashAt).dashedPath
684
+ };
685
+ }, [from, to, progress, start, end, xs, curve, baselineY, dashAt]);
686
+ const areaProps = (0, _reactNativeReanimated.useAnimatedProps)(() => {
687
+ const ys = (0, _motion.lerpVector)(from.get(), to.get(), progress.get()).slice(start, end);
688
+ return {
689
+ d: (0, _geometry.lineSeriesPaths)(xs, ys, curve, baselineY, dashAt).areaPath
690
+ };
691
+ }, [from, to, progress, start, end, xs, curve, baselineY, dashAt]);
692
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.G, {
693
+ children: [item.area && item.areaPath.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedPath, {
694
+ animatedProps: areaProps,
695
+ fill: areaFill
696
+ }) : null, item.path.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedPath, {
697
+ animatedProps: lineProps,
698
+ fill: "none",
699
+ stroke: stroke,
700
+ strokeWidth: _styles.LINE_STROKE_WIDTH,
701
+ strokeLinecap: "round",
702
+ strokeLinejoin: "round",
703
+ strokeDasharray: item.dashed ? DASH : undefined,
704
+ opacity: opacity
705
+ }) : null, item.dashedPath.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedPath, {
706
+ animatedProps: dashProps,
707
+ fill: "none",
708
+ stroke: stroke,
709
+ strokeWidth: _styles.LINE_STROKE_WIDTH,
710
+ strokeLinecap: "round",
711
+ strokeLinejoin: "round",
712
+ strokeDasharray: DASH,
713
+ opacity: opacity
714
+ }) : null]
715
+ });
716
+ }
717
+ function AnimatedDot({
718
+ cx,
719
+ slot,
720
+ morph,
721
+ fill,
722
+ stroke
723
+ }) {
724
+ const {
725
+ from,
726
+ to,
727
+ progress
728
+ } = morph;
729
+ const animatedProps = (0, _reactNativeReanimated.useAnimatedProps)(() => {
730
+ const ys = (0, _motion.lerpVector)(from.get(), to.get(), progress.get());
731
+ return {
732
+ cy: ys[slot] ?? 0
733
+ };
734
+ }, [from, to, progress, slot]);
735
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedCircle, {
736
+ animatedProps: animatedProps,
737
+ cx: cx,
738
+ r: _styles.LINE_DOT_RADIUS,
739
+ fill: fill,
740
+ stroke: stroke,
741
+ strokeWidth: _styles.LINE_STROKE_WIDTH
742
+ });
743
+ }
744
+ //# sourceMappingURL=index.js.map