@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.
- package/README.md +1 -1
- package/coverage.svg +1 -1
- package/docs/components/bar-chart/content.md +703 -0
- package/docs/components/content.md +10 -1
- package/docs/components/country-flag/content.md +232 -0
- package/docs/components/data-grid/content.md +3 -1
- package/docs/components/icon/content.md +1 -1
- package/docs/components/input/content.md +1 -0
- package/docs/components/line-chart/content.md +567 -0
- package/docs/components/pie-chart/content.md +493 -0
- package/docs/components/progress-bar/content.md +164 -3
- package/docs/components/progress-segmented/content.md +1 -1
- package/docs/components/select/content.md +1 -0
- package/docs/components/stepper/content.md +599 -0
- package/docs/components/system-alert/content.md +533 -0
- package/docs/foundations/expressions/icons/content.md +2 -1
- package/docs/foundations/styles/tokens/all-tokens/content.md +2 -1
- package/docs/getting-started/developers/content.md +1 -1
- package/docs/llms.txt +12 -0
- package/docs/patterns/content.md +1 -0
- package/docs/patterns/dashboard/content.md +423 -19
- package/docs/patterns/insights/content.md +659 -0
- package/docs/resources/content.md +1 -0
- package/docs/resources/release-notes/0.3.5/content.md +7 -0
- package/docs/resources/release-notes/0.3.6/content.md +29 -0
- package/docs/resources/release-notes/content.md +2 -0
- package/docs/resources/skills/content.md +66 -0
- package/lib/commonjs/components/BarChart/geometry.js +1130 -0
- package/lib/commonjs/components/BarChart/geometry.js.map +1 -0
- package/lib/commonjs/components/BarChart/index.js +935 -0
- package/lib/commonjs/components/BarChart/index.js.map +1 -0
- package/lib/commonjs/components/BarChart/styles.js +26 -0
- package/lib/commonjs/components/BarChart/styles.js.map +1 -0
- package/lib/commonjs/components/Button/index.js +2 -2
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/CountryFlag/index.js +56 -0
- package/lib/commonjs/components/CountryFlag/index.js.map +1 -0
- package/lib/commonjs/components/Input/index.js.map +1 -1
- package/lib/commonjs/components/LineChart/geometry.js +698 -0
- package/lib/commonjs/components/LineChart/geometry.js.map +1 -0
- package/lib/commonjs/components/LineChart/index.js +744 -0
- package/lib/commonjs/components/LineChart/index.js.map +1 -0
- package/lib/commonjs/components/LineChart/styles.js +25 -0
- package/lib/commonjs/components/LineChart/styles.js.map +1 -0
- package/lib/commonjs/components/PieChart/geometry.js +216 -0
- package/lib/commonjs/components/PieChart/geometry.js.map +1 -0
- package/lib/commonjs/components/PieChart/index.js +476 -0
- package/lib/commonjs/components/PieChart/index.js.map +1 -0
- package/lib/commonjs/components/PieChart/styles.js +88 -0
- package/lib/commonjs/components/PieChart/styles.js.map +1 -0
- package/lib/commonjs/components/ProgressBar/index.js +44 -12
- package/lib/commonjs/components/ProgressBar/index.js.map +1 -1
- package/lib/commonjs/components/ProgressBar/styles.js +31 -2
- package/lib/commonjs/components/ProgressBar/styles.js.map +1 -1
- package/lib/commonjs/components/ProgressCircle/ProgressCircleRing.js +9 -31
- package/lib/commonjs/components/ProgressCircle/ProgressCircleRing.js.map +1 -1
- package/lib/commonjs/components/ProgressCircle/ProgressRing.js +52 -0
- package/lib/commonjs/components/ProgressCircle/ProgressRing.js.map +1 -0
- package/lib/commonjs/components/ScrollShadow/useScrollShadow.js +8 -7
- package/lib/commonjs/components/ScrollShadow/useScrollShadow.js.map +1 -1
- package/lib/commonjs/components/Select/index.js.map +1 -1
- package/lib/commonjs/components/Stepper/index.js +369 -0
- package/lib/commonjs/components/Stepper/index.js.map +1 -0
- package/lib/commonjs/components/Stepper/styles.js +211 -0
- package/lib/commonjs/components/Stepper/styles.js.map +1 -0
- package/lib/commonjs/components/Stepper/useStepperLabelFit.js +22 -0
- package/lib/commonjs/components/Stepper/useStepperLabelFit.js.map +1 -0
- package/lib/commonjs/components/Stepper/useStepperLabelFit.web.js +52 -0
- package/lib/commonjs/components/Stepper/useStepperLabelFit.web.js.map +1 -0
- package/lib/commonjs/components/Stepper/useStepperRingColors.js +31 -0
- package/lib/commonjs/components/Stepper/useStepperRingColors.js.map +1 -0
- package/lib/commonjs/components/SystemAlert/animation.js +218 -0
- package/lib/commonjs/components/SystemAlert/animation.js.map +1 -0
- package/lib/commonjs/components/SystemAlert/index.js +525 -0
- package/lib/commonjs/components/SystemAlert/index.js.map +1 -0
- package/lib/commonjs/components/SystemAlert/styles.js +178 -0
- package/lib/commonjs/components/SystemAlert/styles.js.map +1 -0
- package/lib/commonjs/components/SystemAlert/useSystemAlertStatusBarStyle.js +53 -0
- package/lib/commonjs/components/SystemAlert/useSystemAlertStatusBarStyle.js.map +1 -0
- package/lib/commonjs/components/Tabs/index.js +4 -0
- package/lib/commonjs/components/Tabs/index.js.map +1 -1
- package/lib/commonjs/components/Tabs/styles.js +1 -1
- package/lib/commonjs/components/Tabs/styles.js.map +1 -1
- package/lib/commonjs/components/chart/ChartInspector.js +610 -0
- package/lib/commonjs/components/chart/ChartInspector.js.map +1 -0
- package/lib/commonjs/components/chart/format.js +93 -0
- package/lib/commonjs/components/chart/format.js.map +1 -0
- package/lib/commonjs/components/chart/hiddenSvgProps.js +23 -0
- package/lib/commonjs/components/chart/hiddenSvgProps.js.map +1 -0
- package/lib/commonjs/components/chart/index.js +2 -0
- package/lib/commonjs/components/chart/index.js.map +1 -0
- package/lib/commonjs/components/chart/motion.js +97 -0
- package/lib/commonjs/components/chart/motion.js.map +1 -0
- package/lib/commonjs/components/chart/palette.js +178 -0
- package/lib/commonjs/components/chart/palette.js.map +1 -0
- package/lib/commonjs/components/chart/size.js +34 -0
- package/lib/commonjs/components/chart/size.js.map +1 -0
- package/lib/commonjs/components/chart/ticks.js +59 -0
- package/lib/commonjs/components/chart/ticks.js.map +1 -0
- package/lib/commonjs/components/chart/types.js +6 -0
- package/lib/commonjs/components/chart/types.js.map +1 -0
- package/lib/commonjs/components/chart/useChartHostWidth.js +27 -0
- package/lib/commonjs/components/chart/useChartHostWidth.js.map +1 -0
- package/lib/commonjs/components/index.js +72 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/figma/Accordion.figma.js +2 -2
- package/lib/commonjs/figma/Accordion.figma.js.map +1 -1
- package/lib/commonjs/figma/Alert.figma.js +7 -7
- package/lib/commonjs/figma/Alert.figma.js.map +1 -1
- package/lib/commonjs/figma/Badge.Indicator.figma.js +6 -5
- package/lib/commonjs/figma/Badge.Indicator.figma.js.map +1 -1
- package/lib/commonjs/figma/Badge.figma.js +22 -22
- package/lib/commonjs/figma/Badge.figma.js.map +1 -1
- package/lib/commonjs/figma/Button.figma.js +5 -2
- package/lib/commonjs/figma/Button.figma.js.map +1 -1
- package/lib/commonjs/figma/CLAUDE.md +1 -0
- package/lib/commonjs/figma/Card.Header.figma.js +8 -4
- package/lib/commonjs/figma/Card.Header.figma.js.map +1 -1
- package/lib/commonjs/figma/Card.figma.js +2 -1
- package/lib/commonjs/figma/Card.figma.js.map +1 -1
- package/lib/commonjs/figma/Chip.figma.js +2 -2
- package/lib/commonjs/figma/Chip.figma.js.map +1 -1
- package/lib/commonjs/figma/CurrencyInput.figma.js +1 -1
- package/lib/commonjs/figma/CurrencyInput.figma.js.map +1 -1
- package/lib/commonjs/figma/Dialog.figma.js +5 -2
- package/lib/commonjs/figma/Dialog.figma.js.map +1 -1
- package/lib/commonjs/figma/Divider.figma.js +1 -1
- package/lib/commonjs/figma/Divider.figma.js.map +1 -1
- package/lib/commonjs/figma/Drawer.figma.js +3 -3
- package/lib/commonjs/figma/Drawer.figma.js.map +1 -1
- package/lib/commonjs/figma/IconButton.figma.js +10 -4
- package/lib/commonjs/figma/IconButton.figma.js.map +1 -1
- package/lib/commonjs/figma/Input.figma.js +2 -1
- package/lib/commonjs/figma/Input.figma.js.map +1 -1
- package/lib/commonjs/figma/Insight.figma.js +3 -3
- package/lib/commonjs/figma/Insight.figma.js.map +1 -1
- package/lib/commonjs/figma/ProgressBar.figma.js +11 -2
- package/lib/commonjs/figma/ProgressBar.figma.js.map +1 -1
- package/lib/commonjs/figma/ProgressSegmented.figma.js +9 -1
- package/lib/commonjs/figma/ProgressSegmented.figma.js.map +1 -1
- package/lib/commonjs/figma/Select.figma.js +2 -1
- package/lib/commonjs/figma/Select.figma.js.map +1 -1
- package/lib/commonjs/figma/SystemAlert.Button.figma.js +28 -0
- package/lib/commonjs/figma/SystemAlert.Button.figma.js.map +1 -0
- package/lib/commonjs/figma/SystemAlert.Close.figma.js +22 -0
- package/lib/commonjs/figma/SystemAlert.Close.figma.js.map +1 -0
- package/lib/commonjs/figma/SystemAlert.Description.figma.js +20 -0
- package/lib/commonjs/figma/SystemAlert.Description.figma.js.map +1 -0
- package/lib/commonjs/figma/SystemAlert.IconButton.figma.js +31 -0
- package/lib/commonjs/figma/SystemAlert.IconButton.figma.js.map +1 -0
- package/lib/commonjs/figma/SystemAlert.figma.js +47 -0
- package/lib/commonjs/figma/SystemAlert.figma.js.map +1 -0
- package/lib/commonjs/styles.css +0 -1
- package/lib/module/components/BarChart/geometry.js +1110 -0
- package/lib/module/components/BarChart/geometry.js.map +1 -0
- package/lib/module/components/BarChart/index.js +929 -0
- package/lib/module/components/BarChart/index.js.map +1 -0
- package/lib/module/components/BarChart/styles.js +22 -0
- package/lib/module/components/BarChart/styles.js.map +1 -0
- package/lib/module/components/Button/index.js +2 -2
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/CountryFlag/index.js +52 -0
- package/lib/module/components/CountryFlag/index.js.map +1 -0
- package/lib/module/components/Input/index.js.map +1 -1
- package/lib/module/components/LineChart/geometry.js +685 -0
- package/lib/module/components/LineChart/geometry.js.map +1 -0
- package/lib/module/components/LineChart/index.js +738 -0
- package/lib/module/components/LineChart/index.js.map +1 -0
- package/lib/module/components/LineChart/styles.js +21 -0
- package/lib/module/components/LineChart/styles.js.map +1 -0
- package/lib/module/components/PieChart/geometry.js +209 -0
- package/lib/module/components/PieChart/geometry.js.map +1 -0
- package/lib/module/components/PieChart/index.js +471 -0
- package/lib/module/components/PieChart/index.js.map +1 -0
- package/lib/module/components/PieChart/styles.js +84 -0
- package/lib/module/components/PieChart/styles.js.map +1 -0
- package/lib/module/components/ProgressBar/index.js +47 -15
- package/lib/module/components/ProgressBar/index.js.map +1 -1
- package/lib/module/components/ProgressBar/styles.js +31 -2
- package/lib/module/components/ProgressBar/styles.js.map +1 -1
- package/lib/module/components/ProgressCircle/ProgressCircleRing.js +10 -32
- package/lib/module/components/ProgressCircle/ProgressCircleRing.js.map +1 -1
- package/lib/module/components/ProgressCircle/ProgressRing.js +48 -0
- package/lib/module/components/ProgressCircle/ProgressRing.js.map +1 -0
- package/lib/module/components/ScrollShadow/useScrollShadow.js +8 -7
- package/lib/module/components/ScrollShadow/useScrollShadow.js.map +1 -1
- package/lib/module/components/Select/index.js.map +1 -1
- package/lib/module/components/Stepper/index.js +360 -0
- package/lib/module/components/Stepper/index.js.map +1 -0
- package/lib/module/components/Stepper/styles.js +206 -0
- package/lib/module/components/Stepper/styles.js.map +1 -0
- package/lib/module/components/Stepper/useStepperLabelFit.js +18 -0
- package/lib/module/components/Stepper/useStepperLabelFit.js.map +1 -0
- package/lib/module/components/Stepper/useStepperLabelFit.web.js +48 -0
- package/lib/module/components/Stepper/useStepperLabelFit.web.js.map +1 -0
- package/lib/module/components/Stepper/useStepperRingColors.js +28 -0
- package/lib/module/components/Stepper/useStepperRingColors.js.map +1 -0
- package/lib/module/components/SystemAlert/animation.js +213 -0
- package/lib/module/components/SystemAlert/animation.js.map +1 -0
- package/lib/module/components/SystemAlert/index.js +515 -0
- package/lib/module/components/SystemAlert/index.js.map +1 -0
- package/lib/module/components/SystemAlert/styles.js +174 -0
- package/lib/module/components/SystemAlert/styles.js.map +1 -0
- package/lib/module/components/SystemAlert/useSystemAlertStatusBarStyle.js +49 -0
- package/lib/module/components/SystemAlert/useSystemAlertStatusBarStyle.js.map +1 -0
- package/lib/module/components/Tabs/index.js +4 -0
- package/lib/module/components/Tabs/index.js.map +1 -1
- package/lib/module/components/Tabs/styles.js +1 -1
- package/lib/module/components/Tabs/styles.js.map +1 -1
- package/lib/module/components/chart/ChartInspector.js +600 -0
- package/lib/module/components/chart/ChartInspector.js.map +1 -0
- package/lib/module/components/chart/format.js +84 -0
- package/lib/module/components/chart/format.js.map +1 -0
- package/lib/module/components/chart/hiddenSvgProps.js +20 -0
- package/lib/module/components/chart/hiddenSvgProps.js.map +1 -0
- package/lib/module/components/chart/index.js +2 -0
- package/lib/module/components/chart/index.js.map +1 -0
- package/lib/module/components/chart/motion.js +89 -0
- package/lib/module/components/chart/motion.js.map +1 -0
- package/lib/module/components/chart/palette.js +168 -0
- package/lib/module/components/chart/palette.js.map +1 -0
- package/lib/module/components/chart/size.js +29 -0
- package/lib/module/components/chart/size.js.map +1 -0
- package/lib/module/components/chart/ticks.js +55 -0
- package/lib/module/components/chart/ticks.js.map +1 -0
- package/lib/module/components/chart/types.js +4 -0
- package/lib/module/components/chart/types.js.map +1 -0
- package/lib/module/components/chart/useChartHostWidth.js +23 -0
- package/lib/module/components/chart/useChartHostWidth.js.map +1 -0
- package/lib/module/components/index.js +6 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/figma/Accordion.figma.js +2 -2
- package/lib/module/figma/Accordion.figma.js.map +1 -1
- package/lib/module/figma/Alert.figma.js +7 -7
- package/lib/module/figma/Alert.figma.js.map +1 -1
- package/lib/module/figma/Badge.Indicator.figma.js +6 -5
- package/lib/module/figma/Badge.Indicator.figma.js.map +1 -1
- package/lib/module/figma/Badge.figma.js +22 -22
- package/lib/module/figma/Badge.figma.js.map +1 -1
- package/lib/module/figma/Button.figma.js +5 -2
- package/lib/module/figma/Button.figma.js.map +1 -1
- package/lib/module/figma/CLAUDE.md +1 -0
- package/lib/module/figma/Card.Header.figma.js +8 -4
- package/lib/module/figma/Card.Header.figma.js.map +1 -1
- package/lib/module/figma/Card.figma.js +2 -1
- package/lib/module/figma/Card.figma.js.map +1 -1
- package/lib/module/figma/Chip.figma.js +2 -2
- package/lib/module/figma/Chip.figma.js.map +1 -1
- package/lib/module/figma/CurrencyInput.figma.js +1 -1
- package/lib/module/figma/CurrencyInput.figma.js.map +1 -1
- package/lib/module/figma/Dialog.figma.js +5 -2
- package/lib/module/figma/Dialog.figma.js.map +1 -1
- package/lib/module/figma/Divider.figma.js +1 -1
- package/lib/module/figma/Divider.figma.js.map +1 -1
- package/lib/module/figma/Drawer.figma.js +3 -3
- package/lib/module/figma/Drawer.figma.js.map +1 -1
- package/lib/module/figma/IconButton.figma.js +10 -4
- package/lib/module/figma/IconButton.figma.js.map +1 -1
- package/lib/module/figma/Input.figma.js +2 -1
- package/lib/module/figma/Input.figma.js.map +1 -1
- package/lib/module/figma/Insight.figma.js +3 -3
- package/lib/module/figma/Insight.figma.js.map +1 -1
- package/lib/module/figma/ProgressBar.figma.js +12 -2
- package/lib/module/figma/ProgressBar.figma.js.map +1 -1
- package/lib/module/figma/ProgressSegmented.figma.js +9 -1
- package/lib/module/figma/ProgressSegmented.figma.js.map +1 -1
- package/lib/module/figma/Select.figma.js +2 -1
- package/lib/module/figma/Select.figma.js.map +1 -1
- package/lib/module/figma/SystemAlert.Button.figma.js +22 -0
- package/lib/module/figma/SystemAlert.Button.figma.js.map +1 -0
- package/lib/module/figma/SystemAlert.Close.figma.js +18 -0
- package/lib/module/figma/SystemAlert.Close.figma.js.map +1 -0
- package/lib/module/figma/SystemAlert.Description.figma.js +14 -0
- package/lib/module/figma/SystemAlert.Description.figma.js.map +1 -0
- package/lib/module/figma/SystemAlert.IconButton.figma.js +25 -0
- package/lib/module/figma/SystemAlert.IconButton.figma.js.map +1 -0
- package/lib/module/figma/SystemAlert.figma.js +41 -0
- package/lib/module/figma/SystemAlert.figma.js.map +1 -0
- package/lib/module/styles.css +0 -1
- package/lib/typescript/components/BarChart/geometry.d.ts +236 -0
- package/lib/typescript/components/BarChart/geometry.d.ts.map +1 -0
- package/lib/typescript/components/BarChart/index.d.ts +193 -0
- package/lib/typescript/components/BarChart/index.d.ts.map +1 -0
- package/lib/typescript/components/BarChart/styles.d.ts +32 -0
- package/lib/typescript/components/BarChart/styles.d.ts.map +1 -0
- package/lib/typescript/components/CountryFlag/index.d.ts +35 -0
- package/lib/typescript/components/CountryFlag/index.d.ts.map +1 -0
- package/lib/typescript/components/Input/index.d.ts +2 -0
- package/lib/typescript/components/Input/index.d.ts.map +1 -1
- package/lib/typescript/components/LineChart/geometry.d.ts +248 -0
- package/lib/typescript/components/LineChart/geometry.d.ts.map +1 -0
- package/lib/typescript/components/LineChart/index.d.ts +105 -0
- package/lib/typescript/components/LineChart/index.d.ts.map +1 -0
- package/lib/typescript/components/LineChart/styles.d.ts +12 -0
- package/lib/typescript/components/LineChart/styles.d.ts.map +1 -0
- package/lib/typescript/components/PieChart/geometry.d.ts +43 -0
- package/lib/typescript/components/PieChart/geometry.d.ts.map +1 -0
- package/lib/typescript/components/PieChart/index.d.ts +147 -0
- package/lib/typescript/components/PieChart/index.d.ts.map +1 -0
- package/lib/typescript/components/PieChart/styles.d.ts +27 -0
- package/lib/typescript/components/PieChart/styles.d.ts.map +1 -0
- package/lib/typescript/components/ProgressBar/index.d.ts +16 -1
- package/lib/typescript/components/ProgressBar/index.d.ts.map +1 -1
- package/lib/typescript/components/ProgressBar/styles.d.ts +7 -2
- package/lib/typescript/components/ProgressBar/styles.d.ts.map +1 -1
- package/lib/typescript/components/ProgressCircle/ProgressCircleRing.d.ts.map +1 -1
- package/lib/typescript/components/ProgressCircle/ProgressRing.d.ts +17 -0
- package/lib/typescript/components/ProgressCircle/ProgressRing.d.ts.map +1 -0
- package/lib/typescript/components/ScrollShadow/useScrollShadow.d.ts.map +1 -1
- package/lib/typescript/components/Select/index.d.ts +2 -0
- package/lib/typescript/components/Select/index.d.ts.map +1 -1
- package/lib/typescript/components/Stepper/index.d.ts +68 -0
- package/lib/typescript/components/Stepper/index.d.ts.map +1 -0
- package/lib/typescript/components/Stepper/styles.d.ts +46 -0
- package/lib/typescript/components/Stepper/styles.d.ts.map +1 -0
- package/lib/typescript/components/Stepper/useStepperLabelFit.d.ts +15 -0
- package/lib/typescript/components/Stepper/useStepperLabelFit.d.ts.map +1 -0
- package/lib/typescript/components/Stepper/useStepperLabelFit.web.d.ts +10 -0
- package/lib/typescript/components/Stepper/useStepperLabelFit.web.d.ts.map +1 -0
- package/lib/typescript/components/Stepper/useStepperRingColors.d.ts +6 -0
- package/lib/typescript/components/Stepper/useStepperRingColors.d.ts.map +1 -0
- package/lib/typescript/components/SystemAlert/animation.d.ts +56 -0
- package/lib/typescript/components/SystemAlert/animation.d.ts.map +1 -0
- package/lib/typescript/components/SystemAlert/index.d.ts +110 -0
- package/lib/typescript/components/SystemAlert/index.d.ts.map +1 -0
- package/lib/typescript/components/SystemAlert/styles.d.ts +38 -0
- package/lib/typescript/components/SystemAlert/styles.d.ts.map +1 -0
- package/lib/typescript/components/SystemAlert/useSystemAlertStatusBarStyle.d.ts +14 -0
- package/lib/typescript/components/SystemAlert/useSystemAlertStatusBarStyle.d.ts.map +1 -0
- package/lib/typescript/components/Tabs/index.d.ts.map +1 -1
- package/lib/typescript/components/chart/ChartInspector.d.ts +101 -0
- package/lib/typescript/components/chart/ChartInspector.d.ts.map +1 -0
- package/lib/typescript/components/chart/format.d.ts +16 -0
- package/lib/typescript/components/chart/format.d.ts.map +1 -0
- package/lib/typescript/components/chart/hiddenSvgProps.d.ts +17 -0
- package/lib/typescript/components/chart/hiddenSvgProps.d.ts.map +1 -0
- package/lib/typescript/components/chart/index.d.ts +3 -0
- package/lib/typescript/components/chart/index.d.ts.map +1 -0
- package/lib/typescript/components/chart/motion.d.ts +27 -0
- package/lib/typescript/components/chart/motion.d.ts.map +1 -0
- package/lib/typescript/components/chart/palette.d.ts +44 -0
- package/lib/typescript/components/chart/palette.d.ts.map +1 -0
- package/lib/typescript/components/chart/size.d.ts +25 -0
- package/lib/typescript/components/chart/size.d.ts.map +1 -0
- package/lib/typescript/components/chart/ticks.d.ts +3 -0
- package/lib/typescript/components/chart/ticks.d.ts.map +1 -0
- package/lib/typescript/components/chart/types.d.ts +163 -0
- package/lib/typescript/components/chart/types.d.ts.map +1 -0
- package/lib/typescript/components/chart/useChartHostWidth.d.ts +9 -0
- package/lib/typescript/components/chart/useChartHostWidth.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +6 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/figma/Alert.figma.d.ts.map +1 -1
- package/lib/typescript/figma/Badge.Indicator.figma.d.ts.map +1 -1
- package/lib/typescript/figma/Badge.figma.d.ts.map +1 -1
- package/lib/typescript/figma/Button.figma.d.ts.map +1 -1
- package/lib/typescript/figma/Card.Header.figma.d.ts.map +1 -1
- package/lib/typescript/figma/Card.figma.d.ts.map +1 -1
- package/lib/typescript/figma/Dialog.figma.d.ts.map +1 -1
- package/lib/typescript/figma/IconButton.figma.d.ts.map +1 -1
- package/lib/typescript/figma/Input.figma.d.ts.map +1 -1
- package/lib/typescript/figma/ProgressBar.figma.d.ts.map +1 -1
- package/lib/typescript/figma/ProgressSegmented.figma.d.ts.map +1 -1
- package/lib/typescript/figma/Select.figma.d.ts.map +1 -1
- package/lib/typescript/figma/SystemAlert.Button.figma.d.ts +11 -0
- package/lib/typescript/figma/SystemAlert.Button.figma.d.ts.map +1 -0
- package/lib/typescript/figma/SystemAlert.Close.figma.d.ts +11 -0
- package/lib/typescript/figma/SystemAlert.Close.figma.d.ts.map +1 -0
- package/lib/typescript/figma/SystemAlert.Description.figma.d.ts +8 -0
- package/lib/typescript/figma/SystemAlert.Description.figma.d.ts.map +1 -0
- package/lib/typescript/figma/SystemAlert.IconButton.figma.d.ts +11 -0
- package/lib/typescript/figma/SystemAlert.IconButton.figma.d.ts.map +1 -0
- package/lib/typescript/figma/SystemAlert.figma.d.ts +8 -0
- package/lib/typescript/figma/SystemAlert.figma.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/components/BarChart/geometry.ts +1469 -0
- package/src/components/BarChart/index.tsx +1417 -0
- package/src/components/BarChart/styles.ts +31 -0
- package/src/components/Button/index.tsx +1 -1
- package/src/components/CountryFlag/index.tsx +53 -0
- package/src/components/Input/index.tsx +2 -0
- package/src/components/LineChart/geometry.ts +957 -0
- package/src/components/LineChart/index.tsx +1106 -0
- package/src/components/LineChart/styles.ts +26 -0
- package/src/components/PieChart/geometry.ts +295 -0
- package/src/components/PieChart/index.tsx +715 -0
- package/src/components/PieChart/styles.ts +101 -0
- package/src/components/ProgressBar/index.tsx +66 -14
- package/src/components/ProgressBar/styles.ts +35 -4
- package/src/components/ProgressCircle/ProgressCircleRing.tsx +10 -39
- package/src/components/ProgressCircle/ProgressRing.tsx +60 -0
- package/src/components/ScrollShadow/useScrollShadow.ts +12 -11
- package/src/components/Select/index.tsx +2 -0
- package/src/components/Stepper/index.tsx +452 -0
- package/src/components/Stepper/styles.ts +234 -0
- package/src/components/Stepper/useStepperLabelFit.ts +21 -0
- package/src/components/Stepper/useStepperLabelFit.web.ts +53 -0
- package/src/components/Stepper/useStepperRingColors.ts +29 -0
- package/src/components/SystemAlert/animation.ts +252 -0
- package/src/components/SystemAlert/index.tsx +684 -0
- package/src/components/SystemAlert/styles.ts +212 -0
- package/src/components/SystemAlert/useSystemAlertStatusBarStyle.ts +57 -0
- package/src/components/Tabs/index.tsx +4 -0
- package/src/components/Tabs/styles.ts +1 -1
- package/src/components/chart/ChartInspector.tsx +726 -0
- package/src/components/chart/format.ts +95 -0
- package/src/components/chart/hiddenSvgProps.ts +15 -0
- package/src/components/chart/index.ts +24 -0
- package/src/components/chart/motion.ts +98 -0
- package/src/components/chart/palette.tsx +247 -0
- package/src/components/chart/size.ts +21 -0
- package/src/components/chart/ticks.ts +53 -0
- package/src/components/chart/types.ts +183 -0
- package/src/components/chart/useChartHostWidth.ts +26 -0
- package/src/components/index.ts +6 -0
- package/src/styles.css +0 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { formatNumber } from '@cdx-ui/formatters';
|
|
4
|
+
function namedValue(value) {
|
|
5
|
+
return value.label.length > 0 ? `${value.label} ${value.formattedValue}` : value.formattedValue;
|
|
6
|
+
}
|
|
7
|
+
function categoryText(category) {
|
|
8
|
+
return `${category.label} ${category.values.map(namedValue).join(', ')}`;
|
|
9
|
+
}
|
|
10
|
+
export const defaultChartLocaleText = {
|
|
11
|
+
noData: 'No data',
|
|
12
|
+
noValue: 'No value',
|
|
13
|
+
defaultSeriesLabel: 'Value',
|
|
14
|
+
waterfallIncrease: 'Increase',
|
|
15
|
+
waterfallDecrease: 'Decrease',
|
|
16
|
+
trend: ({
|
|
17
|
+
direction,
|
|
18
|
+
formattedDelta,
|
|
19
|
+
comparisonLabel
|
|
20
|
+
}) => {
|
|
21
|
+
const from = comparisonLabel.length > 0 ? ` from ${comparisonLabel}` : '';
|
|
22
|
+
return direction === 'none' ? `no change${from}` : `${direction} ${formattedDelta}${from}`;
|
|
23
|
+
},
|
|
24
|
+
barChartSummary: categories => categories.length === 0 ? 'Bar chart. No data.' : `Bar chart. ${categories.map(categoryText).join('; ')}.`,
|
|
25
|
+
lineChartSummary: latest => latest === null ? 'Line chart. No data.' : `Line chart. ${categoryText(latest)}.`,
|
|
26
|
+
pieChartSummary: slices => slices.length === 0 ? 'Pie chart. No data.' : `Pie chart. ${slices.map(namedValue).join(', ')}.`
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** Consumer strings over the English defaults. `undefined` entries keep the default. */
|
|
30
|
+
export function resolveChartLocaleText(localeText) {
|
|
31
|
+
if (localeText === undefined) {
|
|
32
|
+
return defaultChartLocaleText;
|
|
33
|
+
}
|
|
34
|
+
const overrides = Object.entries(localeText).filter(([, value]) => value !== undefined);
|
|
35
|
+
return {
|
|
36
|
+
...defaultChartLocaleText,
|
|
37
|
+
...Object.fromEntries(overrides)
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Up to two fraction digits, without trailing zeros: `3`, `2.5`, `1,234.56`. */
|
|
42
|
+
export function formatChartNumber(value, locale) {
|
|
43
|
+
if (value === null || !Number.isFinite(value)) {
|
|
44
|
+
return '';
|
|
45
|
+
}
|
|
46
|
+
const hundredths = Math.round(Math.abs(value) * 100);
|
|
47
|
+
const decimalPlaces = hundredths % 100 === 0 ? 0 : hundredths % 10 === 0 ? 1 : 2;
|
|
48
|
+
return formatNumber(value, {
|
|
49
|
+
locale,
|
|
50
|
+
decimalPlaces
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
const percentFormatters = new Map();
|
|
54
|
+
|
|
55
|
+
/** A 0–1 share as a whole percent for `locale`: `0.46` → `46%`. */
|
|
56
|
+
export function formatChartPercent(share, locale) {
|
|
57
|
+
if (!Number.isFinite(share)) {
|
|
58
|
+
return '';
|
|
59
|
+
}
|
|
60
|
+
// Without a locale, match the `@cdx-ui/formatters` default that numbers use, not the device locale.
|
|
61
|
+
if (locale === undefined) {
|
|
62
|
+
return `${formatNumber(Math.round(share * 100), {
|
|
63
|
+
decimalPlaces: 0
|
|
64
|
+
})}%`;
|
|
65
|
+
}
|
|
66
|
+
let formatter = percentFormatters.get(locale);
|
|
67
|
+
if (formatter === undefined) {
|
|
68
|
+
formatter = new Intl.NumberFormat(locale, {
|
|
69
|
+
style: 'percent',
|
|
70
|
+
maximumFractionDigits: 0
|
|
71
|
+
});
|
|
72
|
+
percentFormatters.set(locale, formatter);
|
|
73
|
+
}
|
|
74
|
+
return formatter.format(share);
|
|
75
|
+
}
|
|
76
|
+
export function defaultChartValueFormatter(locale) {
|
|
77
|
+
return value => formatChartNumber(value, locale);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Series formatter, then axis formatter, then the `locale` default. */
|
|
81
|
+
export function resolveValueFormatter(series, axis, locale) {
|
|
82
|
+
return series?.valueFormatter ?? axis?.valueFormatter ?? defaultChartValueFormatter(locale);
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["formatNumber","namedValue","value","label","length","formattedValue","categoryText","category","values","map","join","defaultChartLocaleText","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","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,SAASA,YAAY,QAAQ,oBAAoB;AAajD,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,YAAYA,CAACC,QAA8B,EAAU;EAC5D,OAAO,GAAGA,QAAQ,CAACJ,KAAK,IAAII,QAAQ,CAACC,MAAM,CAACC,GAAG,CAACR,UAAU,CAAC,CAACS,IAAI,CAAC,IAAI,CAAC,EAAE;AAC1E;AAEA,OAAO,MAAMC,sBAAuC,GAAG;EACrDC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAE,UAAU;EACnBC,kBAAkB,EAAE,OAAO;EAC3BC,iBAAiB,EAAE,UAAU;EAC7BC,iBAAiB,EAAE,UAAU;EAC7BC,KAAK,EAAEA,CAAC;IAAEC,SAAS;IAAEC,cAAc;IAAEC;EAA4B,CAAC,KAAK;IACrE,MAAMC,IAAI,GAAGD,eAAe,CAAChB,MAAM,GAAG,CAAC,GAAG,SAASgB,eAAe,EAAE,GAAG,EAAE;IACzE,OAAOF,SAAS,KAAK,MAAM,GAAG,YAAYG,IAAI,EAAE,GAAG,GAAGH,SAAS,IAAIC,cAAc,GAAGE,IAAI,EAAE;EAC5F,CAAC;EACDC,eAAe,EAAGC,UAAU,IAC1BA,UAAU,CAACnB,M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
|
|
6
|
+
* Hides a decorative `Svg` from assistive technology. On web, react-native-svg renders a raw
|
|
7
|
+
* `<svg>` without react-native-web's prop filtering, so RN-only accessibility props would reach
|
|
8
|
+
* the DOM as unknown attributes and log React warnings.
|
|
9
|
+
*/
|
|
10
|
+
export const HIDDEN_SVG_PROPS = Platform.select({
|
|
11
|
+
web: {
|
|
12
|
+
'aria-hidden': true
|
|
13
|
+
},
|
|
14
|
+
default: {
|
|
15
|
+
accessible: false,
|
|
16
|
+
accessibilityElementsHidden: true,
|
|
17
|
+
importantForAccessibility: 'no-hide-descendants'
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=hiddenSvgProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","HIDDEN_SVG_PROPS","select","web","default","accessible","accessibilityElementsHidden","importantForAccessibility"],"sourceRoot":"../../../../src","sources":["components/chart/hiddenSvgProps.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;;AAEvC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAGD,QAAQ,CAACE,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 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/chart/index.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { Easing, useReducedMotion, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
5
|
+
import { useCombinedAnimationDisabledState } from '../../animation';
|
|
6
|
+
export const CHART_MOTION_DURATION = 600;
|
|
7
|
+
const CHART_MOTION_EASING = Easing.out(Easing.cubic);
|
|
8
|
+
/** Off for `'disable-all'`, an ancestor or global `disable-all`, and Reduce Motion. */
|
|
9
|
+
export function useChartMotionEnabled(animation) {
|
|
10
|
+
const disabled = useCombinedAnimationDisabledState(animation);
|
|
11
|
+
const reducedMotion = useReducedMotion();
|
|
12
|
+
return !disabled && !reducedMotion;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Non-finite entries mark gaps: they snap to the target instead of tweening.
|
|
17
|
+
* Vectors of different lengths cannot be paired, so the target wins outright.
|
|
18
|
+
*/
|
|
19
|
+
export function lerpVector(from, to, t) {
|
|
20
|
+
'worklet';
|
|
21
|
+
|
|
22
|
+
const out = [];
|
|
23
|
+
const paired = from.length === to.length;
|
|
24
|
+
for (let index = 0; index < to.length; index += 1) {
|
|
25
|
+
const end = to[index];
|
|
26
|
+
const start = paired ? from[index] : end;
|
|
27
|
+
out.push(Number.isFinite(start) && Number.isFinite(end) ? start + (end - start) * t : end);
|
|
28
|
+
}
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
function parseSignature(signature) {
|
|
32
|
+
return signature.length === 0 ? [] : signature.split(',').map(Number);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Tweens a numeric geometry vector on the UI thread. Mounts at `initial` and runs to
|
|
37
|
+
* `target`; later targets start from wherever the previous tween currently is. When the
|
|
38
|
+
* vector changes length (points or slices added/removed) the entry replays from `initial`.
|
|
39
|
+
*/
|
|
40
|
+
export function useChartMorph(target, initial, enabled) {
|
|
41
|
+
const from = useSharedValue(enabled ? [...initial] : [...target]);
|
|
42
|
+
const to = useSharedValue([...target]);
|
|
43
|
+
const progress = useSharedValue(enabled ? 0 : 1);
|
|
44
|
+
const signature = target.join(',');
|
|
45
|
+
const initialSignature = initial.join(',');
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
const next = parseSignature(signature);
|
|
48
|
+
if (!enabled) {
|
|
49
|
+
from.set(next);
|
|
50
|
+
to.set(next);
|
|
51
|
+
progress.set(1);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const current = lerpVector(from.get(), to.get(), progress.get());
|
|
55
|
+
from.set(current.length === next.length ? current : parseSignature(initialSignature));
|
|
56
|
+
to.set(next);
|
|
57
|
+
progress.set(0);
|
|
58
|
+
progress.set(withTiming(1, {
|
|
59
|
+
duration: CHART_MOTION_DURATION,
|
|
60
|
+
easing: CHART_MOTION_EASING
|
|
61
|
+
}));
|
|
62
|
+
}, [signature, initialSignature, enabled, from, to, progress]);
|
|
63
|
+
return {
|
|
64
|
+
from,
|
|
65
|
+
to,
|
|
66
|
+
progress
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* 0 → 1 on mount and whenever `replayKey` changes. Labels sit on animated geometry, so they
|
|
72
|
+
* stay hidden until the morph is mostly done, then fade in at the final position.
|
|
73
|
+
*/
|
|
74
|
+
export function useChartEntrance(enabled, replayKey = '') {
|
|
75
|
+
const progress = useSharedValue(enabled ? 0 : 1);
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (!enabled) {
|
|
78
|
+
progress.set(1);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
progress.set(0);
|
|
82
|
+
progress.set(withTiming(1, {
|
|
83
|
+
duration: CHART_MOTION_DURATION,
|
|
84
|
+
easing: CHART_MOTION_EASING
|
|
85
|
+
}));
|
|
86
|
+
}, [enabled, replayKey, progress]);
|
|
87
|
+
return progress;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=motion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","Easing","useReducedMotion","useSharedValue","withTiming","useCombinedAnimationDisabledState","CHART_MOTION_DURATION","CHART_MOTION_EASING","out","cubic","useChartMotionEnabled","animation","disabled","reducedMotion","lerpVector","from","to","t","paired","length","index","end","start","push","Number","isFinite","parseSignature","signature","split","map","useChartMorph","target","initial","enabled","progress","join","initialSignature","next","set","current","get","duration","easing","useChartEntrance","replayKey"],"sourceRoot":"../../../../src","sources":["components/chart/motion.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SACEC,MAAM,EACNC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,QAEL,yBAAyB;AAChC,SAASC,iCAAiC,QAAsC,iBAAiB;AAEjG,OAAO,MAAMC,qBAAqB,GAAG,GAAG;AACxC,MAAMC,mBAAmB,GAAGN,MAAM,CAACO,GAAG,CAACP,MAAM,CAACQ,KAAK,CAAC;AAQpD;AACA,OAAO,SAASC,qBAAqBA,CAACC,SAA8C,EAAW;EAC7F,MAAMC,QAAQ,GAAGP,iCAAiC,CAACM,SAAS,CAAC;EAC7D,MAAME,aAAa,GAAGX,gBAAgB,CAAC,CAAC;EACxC,OAAO,CAACU,QAAQ,IAAI,CAACC,aAAa;AACpC;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAACC,IAAuB,EAAEC,EAAqB,EAAEC,CAAS,EAAY;EAC9F,SAAS;;EACT,MAAMT,GAAa,GAAG,EAAE;EACxB,MAAMU,MAAM,GAAGH,IAAI,CAACI,MAAM,KAAKH,EAAE,CAACG,MAAM;EACxC,KAAK,IAAIC,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGJ,EAAE,CAACG,MAAM,EAAEC,KAAK,IAAI,CAAC,EAAE;IACjD,MAAMC,GAAG,GAAGL,EAAE,CAACI,KAAK,CAAC;IACrB,MAAME,KAAK,GAAGJ,MAAM,GAAGH,IAAI,CAACK,KAAK,CAAC,GAAGC,GAAG;IACxCb,GAAG,CAACe,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACH,KAAK,CAAC,IAAIE,MAAM,CAACC,QAAQ,CAACJ,GAAG,CAAC,GAAGC,KAAK,GAAG,CAACD,GAAG,GAAGC,KAAK,IAAIL,CAAC,GAAGI,GAAG,CAAC;EA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AAC,CAAC;IACrFpB,EAAE,CAACsB,GAAG,CAACD,IAAI,CAAC;IACZH,QAAQ,CAACI,GAAG,CAAC,CAAC,CAAC;IACfJ,QAAQ,CAACI,GAAG,CAAClC,UAAU,CAAC,CAAC,EAAE;MAAEqC,QAAQ,EAAEnC,qBAAqB;MAAEoC,MAAM,EAAEnC;IAAoB,CAAC,CAAC,CAAC;EAC/F,CAAC,EAAE,CAACoB,SAAS,EAAES,gBAAgB,EAAEH,OAAO,EAAElB,IAAI,EAAEC,EAAE,EAAEkB,QAAQ,CAAC,CAAC;EAE9D,OAAO;IAAEnB,IAAI;IAAEC,EAAE;IAAEkB;EAAS,CAAC;AAC/B;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASS,gBAAgBA,CAACV,OAAgB,EAAEW,SAAS,GAAG,EAAE,EAAuB;EACtF,MAAMV,QAAQ,GAAG/B,cAAc,CAAC8B,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;EAEhDjC,SAAS,CAAC,MAAM;IACd,IAAI,CAACiC,OAAO,EAAE;MACZC,QAAQ,CAACI,GAAG,CAAC,CAAC,CAAC;MACf;IACF;IACAJ,QAAQ,CAACI,GAAG,CAAC,CAAC,CAAC;IACfJ,QAAQ,CAACI,GAAG,CAAClC,UAAU,CAAC,CAAC,EAAE;MAAEqC,QAAQ,EAAEnC,qBAAqB;MAAEoC,MAAM,EAAEnC;IAAoB,CAAC,CAAC,CAAC;EAC/F,CAAC,EAAE,CAAC0B,OAAO,EAAEW,SAAS,EAAEV,QAAQ,CAAC,CAAC;EAElC,OAAOA,QAAQ;AACjB","ignoreList":[]}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useId } from 'react';
|
|
4
|
+
import { Defs, LinearGradient, Stop } from 'react-native-svg';
|
|
5
|
+
import { useCSSVariable, useResolveClassNames } from 'uniwind';
|
|
6
|
+
|
|
7
|
+
/** Light-theme chart tokens, used when Uniwind has no CSS context (Jest). */
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const CHART_FALLBACKS = {
|
|
10
|
+
simple: '#5b91de',
|
|
11
|
+
simpleSecondary: '#162e49',
|
|
12
|
+
simpleTertiary: '#3b6399',
|
|
13
|
+
categorical: ['#155dfc', '#f54900', '#009689', '#e60076', '#9810fa', '#525252'],
|
|
14
|
+
danger: '#c10007',
|
|
15
|
+
warning: '#ffb900',
|
|
16
|
+
success: '#00a63e',
|
|
17
|
+
info: '#0069a8'
|
|
18
|
+
};
|
|
19
|
+
function toColor(value, fallback) {
|
|
20
|
+
if (typeof value === 'string' && value.length > 0) {
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
return fallback;
|
|
24
|
+
}
|
|
25
|
+
export function useChartSimpleColor() {
|
|
26
|
+
const value = useCSSVariable('--color-chart-simple-primary');
|
|
27
|
+
return toColor(value, CHART_FALLBACKS.simple);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A Forge color token by name: `simple-*` and `categorical-*` resolve
|
|
32
|
+
* `--color-chart-<name>`, severity names resolve `--color-surface-<name>-strong`.
|
|
33
|
+
* Overrides take a name, not a CSS color, so FI themes and dark mode recolor every chart.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
const warnedChartColors = new Set();
|
|
37
|
+
export function resolveChartColor(color, paints) {
|
|
38
|
+
if (color === undefined) return undefined;
|
|
39
|
+
const paint = paints[color];
|
|
40
|
+
if (paint === undefined && __DEV__ && !warnedChartColors.has(color)) {
|
|
41
|
+
warnedChartColors.add(color);
|
|
42
|
+
console.warn(`[Chart] Unknown color "${String(color)}". Pass a ChartColor token name, not a CSS ` + 'color; the default series color is used instead.');
|
|
43
|
+
}
|
|
44
|
+
return paint;
|
|
45
|
+
}
|
|
46
|
+
export function useChartColorPaints() {
|
|
47
|
+
const simple = useChartSimpleColor();
|
|
48
|
+
const secondary = toColor(useCSSVariable('--color-chart-simple-secondary'), CHART_FALLBACKS.simpleSecondary);
|
|
49
|
+
const tertiary = toColor(useCSSVariable('--color-chart-simple-tertiary'), CHART_FALLBACKS.simpleTertiary);
|
|
50
|
+
const danger = toColor(useCSSVariable('--color-surface-danger-strong'), CHART_FALLBACKS.danger);
|
|
51
|
+
const warning = toColor(useCSSVariable('--color-surface-warning-strong'), CHART_FALLBACKS.warning);
|
|
52
|
+
const success = toColor(useCSSVariable('--color-surface-success-strong'), CHART_FALLBACKS.success);
|
|
53
|
+
const info = toColor(useCSSVariable('--color-surface-info-strong'), CHART_FALLBACKS.info);
|
|
54
|
+
const palette = useChartPalette();
|
|
55
|
+
return {
|
|
56
|
+
danger,
|
|
57
|
+
warning,
|
|
58
|
+
success,
|
|
59
|
+
info,
|
|
60
|
+
'simple-primary': simple,
|
|
61
|
+
'simple-secondary': secondary,
|
|
62
|
+
'simple-tertiary': tertiary,
|
|
63
|
+
'categorical-1': palette[0] ?? CHART_FALLBACKS.categorical[0],
|
|
64
|
+
'categorical-2': palette[1] ?? CHART_FALLBACKS.categorical[1],
|
|
65
|
+
'categorical-3': palette[2] ?? CHART_FALLBACKS.categorical[2],
|
|
66
|
+
'categorical-4': palette[3] ?? CHART_FALLBACKS.categorical[3],
|
|
67
|
+
'categorical-5': palette[4] ?? CHART_FALLBACKS.categorical[4],
|
|
68
|
+
'categorical-6': palette[5] ?? CHART_FALLBACKS.categorical[5]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* SVG text cannot take `className`, so typography tokens are resolved here.
|
|
74
|
+
* `useResolveClassNames` converts rem to px with the consumer's rem base; web
|
|
75
|
+
* may return rem strings, which fall back to the light-theme pixel size.
|
|
76
|
+
*/
|
|
77
|
+
function toPx(value, fallbackPx) {
|
|
78
|
+
if (typeof value === 'number') {
|
|
79
|
+
return Number.isFinite(value) ? value : fallbackPx;
|
|
80
|
+
}
|
|
81
|
+
if (typeof value !== 'string') return fallbackPx;
|
|
82
|
+
const trimmed = value.trim();
|
|
83
|
+
if (!/^-?\d*\.?\d+(px)?$/.test(trimmed)) return fallbackPx;
|
|
84
|
+
return parseFloat(trimmed);
|
|
85
|
+
}
|
|
86
|
+
export function useChartChrome() {
|
|
87
|
+
const grid = useCSSVariable('--color-stroke-secondary');
|
|
88
|
+
const label = useCSSVariable('--color-content-primary');
|
|
89
|
+
const surface = useCSSVariable('--color-surface-primary');
|
|
90
|
+
const fontFamily = useCSSVariable('--font-body');
|
|
91
|
+
const labelText = useResolveClassNames('text-xs');
|
|
92
|
+
const captionText = useResolveClassNames('text-2xs');
|
|
93
|
+
return {
|
|
94
|
+
grid: toColor(grid, '#e9e9e9'),
|
|
95
|
+
label: toColor(label, '#1b1c1d'),
|
|
96
|
+
surface: toColor(surface, '#ffffff'),
|
|
97
|
+
fontFamily: toColor(fontFamily, 'Inter'),
|
|
98
|
+
labelSize: toPx(labelText.fontSize, 12),
|
|
99
|
+
captionSize: toPx(captionText.fontSize, 10)
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Resolved `categorical-1`…`6` paints, in slot order. Pie slices and charts past
|
|
105
|
+
* three series cycle them.
|
|
106
|
+
*/
|
|
107
|
+
export function useChartPalette() {
|
|
108
|
+
const slot1 = useCSSVariable('--color-chart-categorical-1');
|
|
109
|
+
const slot2 = useCSSVariable('--color-chart-categorical-2');
|
|
110
|
+
const slot3 = useCSSVariable('--color-chart-categorical-3');
|
|
111
|
+
const slot4 = useCSSVariable('--color-chart-categorical-4');
|
|
112
|
+
const slot5 = useCSSVariable('--color-chart-categorical-5');
|
|
113
|
+
const slot6 = useCSSVariable('--color-chart-categorical-6');
|
|
114
|
+
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])];
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* `auto` keeps up to three series in the FI brand family and moves the whole chart to
|
|
119
|
+
* `categorical-1`…`6` past that, so one chart never mixes the two families.
|
|
120
|
+
* `categorical` always uses them.
|
|
121
|
+
*/
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Bars alternate light, dark, mid so adjacent bars don't read as a ramp. Lines step
|
|
125
|
+
* primary → tertiary → secondary so a two-line chart pairs neighboring brand steps.
|
|
126
|
+
*/
|
|
127
|
+
const SIMPLE_SERIES = {
|
|
128
|
+
bar: ['simple-primary', 'simple-secondary', 'simple-tertiary'],
|
|
129
|
+
line: ['simple-primary', 'simple-tertiary', 'simple-secondary']
|
|
130
|
+
};
|
|
131
|
+
const CATEGORICAL_SERIES = ['categorical-1', 'categorical-2', 'categorical-3', 'categorical-4', 'categorical-5', 'categorical-6'];
|
|
132
|
+
|
|
133
|
+
/** Default color for a series. A series `color` still wins. */
|
|
134
|
+
export function chartSeriesColor(seriesIndex, seriesCount, palette, kind) {
|
|
135
|
+
const simple = SIMPLE_SERIES[kind];
|
|
136
|
+
const ramp = palette === 'auto' && seriesCount <= simple.length ? simple : CATEGORICAL_SERIES;
|
|
137
|
+
return ramp[seriesIndex % ramp.length] ?? 'simple-primary';
|
|
138
|
+
}
|
|
139
|
+
export function useChartGradientId(prefix) {
|
|
140
|
+
return `${prefix}-${useId().replace(/[^a-zA-Z0-9_-]/g, '')}`;
|
|
141
|
+
}
|
|
142
|
+
export function chartFillUrl(idPrefix, index) {
|
|
143
|
+
return `url(#${idPrefix}-${String(index)})`;
|
|
144
|
+
}
|
|
145
|
+
export function ChartLinearFills({
|
|
146
|
+
idPrefix,
|
|
147
|
+
colors,
|
|
148
|
+
x2,
|
|
149
|
+
y2
|
|
150
|
+
}) {
|
|
151
|
+
return /*#__PURE__*/_jsx(Defs, {
|
|
152
|
+
children: colors.map((color, index) => /*#__PURE__*/_jsxs(LinearGradient, {
|
|
153
|
+
id: `${idPrefix}-${String(index)}`,
|
|
154
|
+
x1: "0%",
|
|
155
|
+
y1: "0%",
|
|
156
|
+
x2: x2,
|
|
157
|
+
y2: y2,
|
|
158
|
+
children: [/*#__PURE__*/_jsx(Stop, {
|
|
159
|
+
offset: "0%",
|
|
160
|
+
stopColor: color
|
|
161
|
+
}), /*#__PURE__*/_jsx(Stop, {
|
|
162
|
+
offset: "100%",
|
|
163
|
+
stopColor: color
|
|
164
|
+
})]
|
|
165
|
+
}, `${idPrefix}-${String(index)}`))
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=palette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useId","Defs","LinearGradient","Stop","useCSSVariable","useResolveClassNames","jsx","_jsx","jsxs","_jsxs","CHART_FALLBACKS","simple","simpleSecondary","simpleTertiary","categorical","danger","warning","success","info","toColor","value","fallback","length","useChartSimpleColor","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","captionText","labelSize","fontSize","captionSize","slot1","slot2","slot3","slot4","slot5","slot6","SIMPLE_SERIES","bar","line","CATEGORICAL_SERIES","chartSeriesColor","seriesIndex","seriesCount","kind","ramp","useChartGradientId","prefix","replace","chartFillUrl","idPrefix","index","ChartLinearFills","colors","x2","y2","children","map","id","x1","y1","offset","stopColor"],"sourceRoot":"../../../../src","sources":["components/chart/palette.tsx"],"mappings":";;AAAA,SAASA,KAAK,QAAQ,OAAO;AAC7B,SAASC,IAAI,EAAEC,cAAc,EAAEC,IAAI,QAAQ,kBAAkB;AAC7D,SAASC,cAAc,EAAEC,oBAAoB,QAAQ,SAAS;;AAE9D;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAA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MAAM,EAAC,IAAI;QAACC,SAAS,EAAEhE;MAAM,CAAE,CAAC,eACtCpB,IAAA,CAACJ,IAAI;QAACuF,MAAM,EAAC,MAAM;QAACC,SAAS,EAAEhE;MAAM,CAAE,CAAC;IAAA,GARnC,GAAGoD,QAAQ,IAAI3C,MAAM,CAAC4C,KAAK,CAAC,EASnB,CACjB;EAAC,CACE,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** Plot boxes. Heights match the spacing scale (`size-40`…`size-64`). */
|
|
4
|
+
export const CHART_DIMENSIONS = {
|
|
5
|
+
sm: {
|
|
6
|
+
width: 256,
|
|
7
|
+
height: 160
|
|
8
|
+
},
|
|
9
|
+
md: {
|
|
10
|
+
width: 308,
|
|
11
|
+
height: 192
|
|
12
|
+
},
|
|
13
|
+
lg: {
|
|
14
|
+
width: 360,
|
|
15
|
+
height: 224
|
|
16
|
+
},
|
|
17
|
+
xl: {
|
|
18
|
+
width: 410,
|
|
19
|
+
height: 256
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export function resolveChartBox(size, width, height) {
|
|
23
|
+
const preset = CHART_DIMENSIONS[size ?? 'lg'];
|
|
24
|
+
return {
|
|
25
|
+
width: width ?? preset.width,
|
|
26
|
+
height: height ?? preset.height
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=size.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CHART_DIMENSIONS","sm","width","height","md","lg","xl","resolveChartBox","size","preset"],"sourceRoot":"../../../../src","sources":["components/chart/size.ts"],"mappings":";;AAEA;AACA,OAAO,MAAMA,gBAAgB,GAAG;EAC9BC,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;AAE3F,OAAO,SAASI,eAAeA,CAC7BC,IAA2B,EAC3BN,KAAc,EACdC,MAAe,EACsC;EACrD,MAAMM,MAAM,GAAGT,gBAAgB,CAACQ,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,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** Rounds away float drift at the step's precision, so steps below 0.01 stay distinct. */
|
|
4
|
+
function roundToStep(value, step) {
|
|
5
|
+
const decimals = Math.min(20, Math.max(2, -Math.floor(Math.log10(step)) + 1));
|
|
6
|
+
const rounded = Number(value.toFixed(decimals));
|
|
7
|
+
return Object.is(rounded, -0) ? 0 : rounded;
|
|
8
|
+
}
|
|
9
|
+
function niceNumber(span, round) {
|
|
10
|
+
if (span <= 0 || !Number.isFinite(span)) {
|
|
11
|
+
return 1;
|
|
12
|
+
}
|
|
13
|
+
const exponent = Math.floor(Math.log10(span));
|
|
14
|
+
const fraction = span / 10 ** exponent;
|
|
15
|
+
let niceFraction;
|
|
16
|
+
if (round) {
|
|
17
|
+
if (fraction < 1.5) {
|
|
18
|
+
niceFraction = 1;
|
|
19
|
+
} else if (fraction < 3) {
|
|
20
|
+
niceFraction = 2;
|
|
21
|
+
} else if (fraction < 7) {
|
|
22
|
+
niceFraction = 5;
|
|
23
|
+
} else {
|
|
24
|
+
niceFraction = 10;
|
|
25
|
+
}
|
|
26
|
+
} else if (fraction <= 1) {
|
|
27
|
+
niceFraction = 1;
|
|
28
|
+
} else if (fraction <= 2) {
|
|
29
|
+
niceFraction = 2;
|
|
30
|
+
} else if (fraction <= 5) {
|
|
31
|
+
niceFraction = 5;
|
|
32
|
+
} else {
|
|
33
|
+
niceFraction = 10;
|
|
34
|
+
}
|
|
35
|
+
return niceFraction * 10 ** exponent;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Evenly spaced, readable ticks that cover `min`–`max` in about `count` steps. */
|
|
39
|
+
export function niceTicks(min, max, count) {
|
|
40
|
+
if (!Number.isFinite(min) || !Number.isFinite(max)) {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
const tickCount = Math.max(2, count);
|
|
44
|
+
const span = niceNumber(max - min, false);
|
|
45
|
+
const step = niceNumber(span / (tickCount - 1), true);
|
|
46
|
+
const niceMin = Math.floor(min / step) * step;
|
|
47
|
+
const niceMax = Math.ceil(max / step) * step;
|
|
48
|
+
const ticks = [];
|
|
49
|
+
const last = niceMax + step / 2;
|
|
50
|
+
for (let value = niceMin; value <= last; value += step) {
|
|
51
|
+
ticks.push(roundToStep(value, step));
|
|
52
|
+
}
|
|
53
|
+
return ticks;
|
|
54
|
+
}
|
|
55
|
+
//# 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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AACZ,GAAG,CAAC,IAAI,CAACK,MAAM,CAACO,QAAQ,CAACX,GAAG,CAAC,EAAE;IAClD,OAAO,EAAE;EACX;EACA,MAAMiB,SAAS,GAAGnB,IAAI,CAACE,GAAG,CAAC,CAAC,EAAEgB,KAAK,CAAC;EACpC,MAAMP,IAAI,GAAGD,UAAU,CAACR,GAAG,GAAGD,GAAG,EAAE,KAAK,CAAC;EACzC,MAAMH,IAAI,GAAGY,UAAU,CAACC,IAAI,IAAIQ,SAAS,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC;EACrD,MAAMC,OAAO,GAAGpB,IAAI,CAACG,KAAK,CAACF,GAAG,GAAGH,IAAI,CAAC,GAAGA,IAAI;EAC7C,MAAMuB,OAAO,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 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/chart/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { composeEventHandlers } from '@cdx-ui/utils';
|
|
5
|
+
|
|
6
|
+
/** Runs the chart's own handler first, then the consumer's. */
|
|
7
|
+
export function composeChartLayout(own, consumer) {
|
|
8
|
+
return composeEventHandlers(own, consumer);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Measured width of the chart root (`0` before the first layout) and the `onLayout` to put on
|
|
13
|
+
* it. The consumer's `onLayout` still fires.
|
|
14
|
+
*/
|
|
15
|
+
export function useChartHostWidth(onLayout) {
|
|
16
|
+
const [width, setWidth] = useState(0);
|
|
17
|
+
const handleLayout = composeChartLayout(event => {
|
|
18
|
+
const next = event.nativeEvent.layout.width;
|
|
19
|
+
setWidth(prev => prev === next ? prev : next);
|
|
20
|
+
}, onLayout);
|
|
21
|
+
return [width, handleLayout];
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=useChartHostWidth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","composeEventHandlers","composeChartLayout","own","consumer","useChartHostWidth","onLayout","width","setWidth","handleLayout","event","next","nativeEvent","layout","prev"],"sourceRoot":"../../../../src","sources":["components/chart/useChartHostWidth.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,OAAO;AAEhC,SAASC,oBAAoB,QAAQ,eAAe;;AAEpD;AACA,OAAO,SAASC,kBAAkBA,CAChCC,GAAuC,EACvCC,QAAiE,EAC7B;EACpC,OAAOH,oBAAoB,CAAoBE,GAAG,EAAEC,QAAQ,CAAC;AAC/D;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAC/BC,QAAiE,EACV;EACvD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGR,QAAQ,CAAC,CAAC,CAAC;EACrC,MAAMS,YAAY,GAAGP,kBAAkB,CAAEQ,KAAK,IAAK;IACjD,MAAMC,IAAI,GAAGD,KAAK,CAACE,WAAW,CAACC,MAAM,CAACN,KAAK;IAC3CC,QAAQ,CAAEM,IAAI,IAAMA,IAAI,KAAKH,IAAI,GAAGG,IAAI,GAAGH,IAAK,CAAC;EACnD,CAAC,EAAEL,QAAQ,CAAC;EACZ,OAAO,CAACC,KAAK,EAAEE,YAAY,CAAC;AAC9B","ignoreList":[]}
|
|
@@ -48,6 +48,9 @@ export * from './Accordion';
|
|
|
48
48
|
export * from './Menu';
|
|
49
49
|
export * from './ProgressBar';
|
|
50
50
|
export * from './ProgressCircle';
|
|
51
|
+
export * from './PieChart';
|
|
52
|
+
export * from './BarChart';
|
|
53
|
+
export * from './LineChart';
|
|
51
54
|
export * from './Skeleton';
|
|
52
55
|
export * from './ProgressSegmented';
|
|
53
56
|
export * from './Radio';
|
|
@@ -55,8 +58,10 @@ export * from './ScopedTheme';
|
|
|
55
58
|
export * from './ScrollShadow';
|
|
56
59
|
export * from './Select';
|
|
57
60
|
export * from './Slider';
|
|
61
|
+
export * from './Stepper';
|
|
58
62
|
export * from './VirtualizedList';
|
|
59
63
|
export * from './Switch';
|
|
64
|
+
export * from './SystemAlert';
|
|
60
65
|
export * from './Tabs';
|
|
61
66
|
export * from './Table';
|
|
62
67
|
export * from './Textarea';
|
|
@@ -68,6 +73,7 @@ export { HStack, VStack } from './Stack';
|
|
|
68
73
|
export * from './Heading';
|
|
69
74
|
export * from './Text';
|
|
70
75
|
export * from './Icon';
|
|
76
|
+
export * from './CountryFlag';
|
|
71
77
|
export * from './IconButton';
|
|
72
78
|
export * from './QuickActionButton';
|
|
73
79
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ColorSwatch","HStack","VStack"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,OAAO;AACrB,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,YAAY;AAC1B,cAAc,YAAY;AAC1B,cAAc,QAAQ;AACtB,cAAc,aAAa;AAC3B,cAAc,cAAc;AAC5B,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,SAASA,WAAW,QAA6D,eAAe;AAChG,cAAc,qBAAqB;AACnC,cAAc,iBAAiB;AAC/B,cAAc,aAAa;AAC3B,cAAc,YAAY;AAC1B,cAAc,iBAAiB;AAC/B,cAAc,iBAAiB;AAC/B,cAAc,cAAc;AAC5B,cAAc,mBAAmB;AACjC,cAAc,eAAe;AAC7B,cAAc,iBAAiB;AAC/B,cAAc,gBAAgB;AAC9B,cAAc,kBAAkB;AAChC,cAAc,UAAU;AACxB,cAAc,WAAW;AACzB,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,oBAAoB;AAClC,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,gBAAgB;AAC9B,cAAc,uBAAuB;AACrC,cAAc,SAAS;AACvB,cAAc,YAAY;AAC1B,cAAc,mBAAmB;AACjC,cAAc,QAAQ;AACtB,cAAc,YAAY;AAC1B,cAAc,aAAa;AAC3B,cAAc,QAAQ;AACtB,cAAc,eAAe;AAC7B,cAAc,kBAAkB;AAChC,cAAc,YAAY;AAC1B,cAAc,qBAAqB;AACnC,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,gBAAgB;AAC9B,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB,cAAc,mBAAmB;AAMjC,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,SAAS;AACvB,cAAc,YAAY;AAC1B,cAAc,QAAQ;AACtB,cAAc,gBAAgB;AAC9B,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,SAASC,MAAM,EAAEC,MAAM,QAAQ,SAAS;AACxC,cAAc,WAAW;AACzB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,cAAc;AAC5B,cAAc,qBAAqB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["ColorSwatch","HStack","VStack"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,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AAc,WAAW;AACzB,SAASC,MAAM,EAAEC,MAAM,QAAQ,SAAS;AACxC,cAAc,WAAW;AACzB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,cAAc,qBAAqB","ignoreList":[]}
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
// component=Accordion
|
|
6
6
|
import figma from 'figma';
|
|
7
7
|
const instance = figma.selectedInstance;
|
|
8
|
-
const fullBleed = instance.getEnum('
|
|
8
|
+
const fullBleed = instance.getEnum('fullBleed', {
|
|
9
9
|
true: true,
|
|
10
10
|
false: undefined
|
|
11
11
|
});
|
|
12
|
-
const defaultValue = instance.getEnum('
|
|
12
|
+
const defaultValue = instance.getEnum('isOpen', {
|
|
13
13
|
true: 'item-1',
|
|
14
14
|
false: undefined
|
|
15
15
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["figma","instance","selectedInstance","fullBleed","getEnum","true","false","undefined","defaultValue","isDisabled","showSeparator","getBoolean","showLeadingSlot","defaultValueProp","helpers","react","renderProp","fullBleedProp","disabledProp","showSeparatorProp","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Accordion.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;AAEvC,MAAMC,SAAS,GAAGF,QAAQ,CAACG,OAAO,CAAC,
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","fullBleed","getEnum","true","false","undefined","defaultValue","isDisabled","showSeparator","getBoolean","showLeadingSlot","defaultValueProp","helpers","react","renderProp","fullBleedProp","disabledProp","showSeparatorProp","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Accordion.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;AAEvC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A;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -11,11 +11,11 @@ const severity = instance.getEnum('severity', {
|
|
|
11
11
|
success: 'success',
|
|
12
12
|
info: 'info'
|
|
13
13
|
});
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
14
|
+
const showTitle = instance.getBoolean('Show Title?');
|
|
15
|
+
const titleInstance = instance.findInstance('Alert.Title');
|
|
16
|
+
const titleSnippet = showTitle && titleInstance?.type === 'INSTANCE' ? titleInstance.executeTemplate().example : null;
|
|
17
|
+
const descriptionInstance = instance.findInstance('Alert.Description');
|
|
18
|
+
const descriptionSnippet = descriptionInstance?.type === 'INSTANCE' ? descriptionInstance.executeTemplate().example : null;
|
|
19
19
|
const showTrailingSlot = instance.getBoolean('Show TrailingSlot?');
|
|
20
20
|
const trailingSlot = instance.getSlot('Alert.TrailingSlot');
|
|
21
21
|
const trailingChildren = showTrailingSlot && trailingSlot ? figma.helpers.react.renderChildren(trailingSlot) : null;
|
|
@@ -25,8 +25,8 @@ export default {
|
|
|
25
25
|
example: figma.code`
|
|
26
26
|
<Alert severity="${severity}">
|
|
27
27
|
<Alert.Icon />
|
|
28
|
-
${
|
|
29
|
-
${
|
|
28
|
+
${titleSnippet}
|
|
29
|
+
${descriptionSnippet}
|
|
30
30
|
${trailingChildren ? figma.code`
|
|
31
31
|
<Alert.Actions>
|
|
32
32
|
${trailingChildren}
|