@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,659 @@
|
|
|
1
|
+
# Insights (https://design.candescent.com/docs/patterns/insights)
|
|
2
|
+
|
|
3
|
+
## Insights Overview
|
|
4
|
+
|
|
5
|
+
A summary card over topic tabs of chart preview cards for budget, spending, daily spend, cash flow, and credit score.
|
|
6
|
+
|
|
7
|
+
**Platforms:** iOS, Android
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import {
|
|
11
|
+
BarChart,
|
|
12
|
+
Box,
|
|
13
|
+
Card,
|
|
14
|
+
Chip,
|
|
15
|
+
Divider,
|
|
16
|
+
Heading,
|
|
17
|
+
HStack,
|
|
18
|
+
Insight,
|
|
19
|
+
LineChart,
|
|
20
|
+
PieChart,
|
|
21
|
+
Tabs,
|
|
22
|
+
Text,
|
|
23
|
+
VStack,
|
|
24
|
+
} from '@cdx-ui/components';
|
|
25
|
+
import { FILL_WIDTH, formatUsd, formatUsdThousands } from '../_utils';
|
|
26
|
+
|
|
27
|
+
const SAFE_TO_SPEND = [
|
|
28
|
+
{ id: 'left', label: 'Left to spend', value: 462, color: 'simple-primary' },
|
|
29
|
+
// TODO(forge-ui): charts have no light neutral color for a progress track. `categorical-6` is
|
|
30
|
+
// the closest existing token but is much darker than the design's grey.
|
|
31
|
+
{ id: 'spent', label: 'Spent on bills', value: 738, color: 'categorical-6' },
|
|
32
|
+
] as const;
|
|
33
|
+
|
|
34
|
+
const SPENDING = [
|
|
35
|
+
{ id: 'housing', label: 'Housing', value: 2130 },
|
|
36
|
+
{ id: 'food', label: 'Food and dining', value: 1065 },
|
|
37
|
+
{ id: 'shopping', label: 'Shopping', value: 800 },
|
|
38
|
+
{ id: 'transport', label: 'Transport', value: 745 },
|
|
39
|
+
{ id: 'other', label: 'Other', value: 585, color: 'categorical-6' },
|
|
40
|
+
] as const;
|
|
41
|
+
|
|
42
|
+
// Today is its own series so it can take a darker color than the earlier days; both share one
|
|
43
|
+
// stack, so each day still draws a single bar.
|
|
44
|
+
// TODO(forge-ui): BarChart can't format band-axis labels, so the single-letter days are the data
|
|
45
|
+
// itself and tooltips and screen readers read "S" for both Saturday and Sunday.
|
|
46
|
+
const DAILY_SPENDING = [
|
|
47
|
+
{ day: 'S', earlier: 46, today: null },
|
|
48
|
+
{ day: 'S', earlier: 62, today: null },
|
|
49
|
+
{ day: 'M', earlier: 38, today: null },
|
|
50
|
+
{ day: 'T', earlier: 62, today: null },
|
|
51
|
+
{ day: 'W', earlier: 50, today: null },
|
|
52
|
+
{ day: 'T', earlier: 36, today: null },
|
|
53
|
+
{ day: 'F', earlier: null, today: 37 },
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
const CASH_FLOW = [
|
|
57
|
+
{ day: 'Mon', moneyIn: 6200, moneyOut: 2400 },
|
|
58
|
+
{ day: 'Tue', moneyIn: 1800, moneyOut: 3100 },
|
|
59
|
+
{ day: 'Wed', moneyIn: 2500, moneyOut: 1900 },
|
|
60
|
+
{ day: 'Thu', moneyIn: 7400, moneyOut: 4200 },
|
|
61
|
+
{ day: 'Fri', moneyIn: 3100, moneyOut: 2800 },
|
|
62
|
+
{ day: 'Sat', moneyIn: 900, moneyOut: 1600 },
|
|
63
|
+
{ day: 'Sun', moneyIn: 600, moneyOut: 1200 },
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
const CASH_FLOW_SUMMARY = [
|
|
67
|
+
{ label: 'Money in', value: '$22,500' },
|
|
68
|
+
{ label: 'Money out', value: '$17,200' },
|
|
69
|
+
{ label: 'Net', value: '+$5,300', color: 'success' as const },
|
|
70
|
+
];
|
|
71
|
+
|
|
72
|
+
const CREDIT_SCORE = [
|
|
73
|
+
{ month: 'May', score: 575 },
|
|
74
|
+
{ month: 'Jun', score: 572 },
|
|
75
|
+
{ month: 'Jul', score: 568 },
|
|
76
|
+
{ month: 'Aug', score: 571 },
|
|
77
|
+
{ month: 'Sep', score: 560 },
|
|
78
|
+
{ month: 'Oct', score: 547 },
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
function OnTrackChip() {
|
|
82
|
+
return (
|
|
83
|
+
<Chip color="action" size="small">
|
|
84
|
+
<Chip.Label>On track</Chip.Label>
|
|
85
|
+
</Chip>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function SafeToSpendCard() {
|
|
90
|
+
return (
|
|
91
|
+
<Card>
|
|
92
|
+
<Card.Stripe />
|
|
93
|
+
<Card.Header>
|
|
94
|
+
<Heading size="sm">Safe to spend</Heading>
|
|
95
|
+
<OnTrackChip />
|
|
96
|
+
</Card.Header>
|
|
97
|
+
<Card.Content>
|
|
98
|
+
<VStack space="md">
|
|
99
|
+
<HStack space="lg" className="items-center">
|
|
100
|
+
<Box className="size-24">
|
|
101
|
+
<PieChart
|
|
102
|
+
series={[
|
|
103
|
+
{
|
|
104
|
+
id: 'safe-to-spend',
|
|
105
|
+
data: SAFE_TO_SPEND,
|
|
106
|
+
innerRadius: '80%',
|
|
107
|
+
valueFormatter: formatUsd,
|
|
108
|
+
},
|
|
109
|
+
]}
|
|
110
|
+
width={96}
|
|
111
|
+
height={96}
|
|
112
|
+
hideLegend
|
|
113
|
+
accessibilityLabel="$462 of your $1,200 monthly budget is left after bills."
|
|
114
|
+
/>
|
|
115
|
+
</Box>
|
|
116
|
+
<VStack space="xs" className="flex-1">
|
|
117
|
+
<Heading size="xl">$462</Heading>
|
|
118
|
+
<Text size="sm" color="secondary">
|
|
119
|
+
left after bills
|
|
120
|
+
</Text>
|
|
121
|
+
</VStack>
|
|
122
|
+
</HStack>
|
|
123
|
+
<Text color="secondary">
|
|
124
|
+
You have <Text weight="semibold">$57/day</Text> for the next 8 days until your Jan 30
|
|
125
|
+
paycheck.
|
|
126
|
+
</Text>
|
|
127
|
+
</VStack>
|
|
128
|
+
</Card.Content>
|
|
129
|
+
</Card>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function SpendingCard() {
|
|
134
|
+
return (
|
|
135
|
+
<Card>
|
|
136
|
+
<Card.Header>
|
|
137
|
+
<Heading size="sm">Spending this month</Heading>
|
|
138
|
+
</Card.Header>
|
|
139
|
+
<Card.Content>
|
|
140
|
+
<VStack space="lg">
|
|
141
|
+
<PieChart
|
|
142
|
+
series={[
|
|
143
|
+
{
|
|
144
|
+
id: 'spending',
|
|
145
|
+
data: SPENDING,
|
|
146
|
+
innerRadius: '72%',
|
|
147
|
+
paddingAngle: 2,
|
|
148
|
+
cornerRadius: 4,
|
|
149
|
+
valueFormatter: formatUsd,
|
|
150
|
+
},
|
|
151
|
+
]}
|
|
152
|
+
width={192}
|
|
153
|
+
height={192}
|
|
154
|
+
legendLayout="list"
|
|
155
|
+
centerLabel={
|
|
156
|
+
<Box className="items-center">
|
|
157
|
+
<Heading size="md">$5,325</Heading>
|
|
158
|
+
<Text size="xs" color="secondary" className="uppercase">
|
|
159
|
+
Total
|
|
160
|
+
</Text>
|
|
161
|
+
</Box>
|
|
162
|
+
}
|
|
163
|
+
/>
|
|
164
|
+
<Insight aiGenerated>
|
|
165
|
+
<Insight.Description>
|
|
166
|
+
Food and dining is 18% higher than last month, mostly from weekend restaurant visits.
|
|
167
|
+
</Insight.Description>
|
|
168
|
+
</Insight>
|
|
169
|
+
</VStack>
|
|
170
|
+
</Card.Content>
|
|
171
|
+
</Card>
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function DailySpendingCard() {
|
|
176
|
+
return (
|
|
177
|
+
<Card>
|
|
178
|
+
<Card.Header>
|
|
179
|
+
<Heading size="sm">Daily spending</Heading>
|
|
180
|
+
<OnTrackChip />
|
|
181
|
+
</Card.Header>
|
|
182
|
+
<Card.Content>
|
|
183
|
+
<HStack space="lg" className="flex-wrap items-end">
|
|
184
|
+
<VStack space="sm">
|
|
185
|
+
<VStack space="xs">
|
|
186
|
+
<Heading size="xl">$37</Heading>
|
|
187
|
+
<Text weight="medium">spent so far today</Text>
|
|
188
|
+
</VStack>
|
|
189
|
+
<Text size="sm" color="secondary">
|
|
190
|
+
Daily average: $49
|
|
191
|
+
</Text>
|
|
192
|
+
</VStack>
|
|
193
|
+
<BarChart
|
|
194
|
+
className="min-w-32 flex-1"
|
|
195
|
+
dataset={DAILY_SPENDING}
|
|
196
|
+
xAxis={[{ id: 'day', dataKey: 'day', scaleType: 'band' }]}
|
|
197
|
+
yAxis={[{ id: 'spend', position: 'none', min: 0, max: 62 }]}
|
|
198
|
+
series={[
|
|
199
|
+
{
|
|
200
|
+
id: 'earlier',
|
|
201
|
+
dataKey: 'earlier',
|
|
202
|
+
label: 'Spent',
|
|
203
|
+
stack: 'day',
|
|
204
|
+
color: 'simple-primary',
|
|
205
|
+
valueFormatter: formatUsd,
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
id: 'today',
|
|
209
|
+
dataKey: 'today',
|
|
210
|
+
label: 'Spent so far today',
|
|
211
|
+
stack: 'day',
|
|
212
|
+
color: 'simple-secondary',
|
|
213
|
+
valueFormatter: formatUsd,
|
|
214
|
+
},
|
|
215
|
+
]}
|
|
216
|
+
grid={{ horizontal: false }}
|
|
217
|
+
tooltip={{ trigger: 'item' }}
|
|
218
|
+
categoryGapRatio={0.7}
|
|
219
|
+
borderRadius={999}
|
|
220
|
+
width={FILL_WIDTH}
|
|
221
|
+
height={112}
|
|
222
|
+
hideLegend
|
|
223
|
+
scrollable={false}
|
|
224
|
+
accessibilityLabel="Spending for the last seven days. $37 so far today, Friday, against a $49 daily average."
|
|
225
|
+
/>
|
|
226
|
+
</HStack>
|
|
227
|
+
</Card.Content>
|
|
228
|
+
</Card>
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function CashFlowCard() {
|
|
233
|
+
return (
|
|
234
|
+
<Card>
|
|
235
|
+
<Card.Header>
|
|
236
|
+
<Heading size="sm">Cash flow this week</Heading>
|
|
237
|
+
</Card.Header>
|
|
238
|
+
<Card.Content>
|
|
239
|
+
<VStack space="lg">
|
|
240
|
+
<BarChart
|
|
241
|
+
dataset={CASH_FLOW}
|
|
242
|
+
xAxis={[{ id: 'day', dataKey: 'day', scaleType: 'band' }]}
|
|
243
|
+
yAxis={[
|
|
244
|
+
{
|
|
245
|
+
id: 'amount',
|
|
246
|
+
min: 0,
|
|
247
|
+
max: 15000,
|
|
248
|
+
tickNumber: 4,
|
|
249
|
+
valueFormatter: formatUsdThousands,
|
|
250
|
+
},
|
|
251
|
+
]}
|
|
252
|
+
series={[
|
|
253
|
+
{
|
|
254
|
+
id: 'moneyIn',
|
|
255
|
+
dataKey: 'moneyIn',
|
|
256
|
+
label: 'In',
|
|
257
|
+
stack: 'flow',
|
|
258
|
+
valueFormatter: formatUsd,
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
id: 'moneyOut',
|
|
262
|
+
dataKey: 'moneyOut',
|
|
263
|
+
label: 'Out',
|
|
264
|
+
stack: 'flow',
|
|
265
|
+
valueFormatter: formatUsd,
|
|
266
|
+
},
|
|
267
|
+
]}
|
|
268
|
+
borderRadius={2}
|
|
269
|
+
width={FILL_WIDTH}
|
|
270
|
+
height={176}
|
|
271
|
+
scrollable={false}
|
|
272
|
+
accessibilityLabel="Money in and out each day this week."
|
|
273
|
+
/>
|
|
274
|
+
<VStack>
|
|
275
|
+
{CASH_FLOW_SUMMARY.map((row, index) => (
|
|
276
|
+
<VStack key={row.label}>
|
|
277
|
+
{index > 0 ? <Divider /> : null}
|
|
278
|
+
<HStack className="items-center justify-between py-2">
|
|
279
|
+
<Text size="sm" color="secondary">
|
|
280
|
+
{row.label}
|
|
281
|
+
</Text>
|
|
282
|
+
<Text size="sm" weight="medium" color={row.color}>
|
|
283
|
+
{row.value}
|
|
284
|
+
</Text>
|
|
285
|
+
</HStack>
|
|
286
|
+
</VStack>
|
|
287
|
+
))}
|
|
288
|
+
</VStack>
|
|
289
|
+
<Insight aiGenerated>
|
|
290
|
+
<Insight.Description>
|
|
291
|
+
More came in than went out this week. Moving $1,000 to savings would still leave a
|
|
292
|
+
cushion.
|
|
293
|
+
</Insight.Description>
|
|
294
|
+
</Insight>
|
|
295
|
+
</VStack>
|
|
296
|
+
</Card.Content>
|
|
297
|
+
</Card>
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function CreditScoreCard() {
|
|
302
|
+
return (
|
|
303
|
+
<Card>
|
|
304
|
+
<Card.Header>
|
|
305
|
+
<Heading size="sm">Credit score</Heading>
|
|
306
|
+
</Card.Header>
|
|
307
|
+
<Card.Content>
|
|
308
|
+
<VStack space="lg">
|
|
309
|
+
<HStack space="lg" className="items-center">
|
|
310
|
+
<LineChart
|
|
311
|
+
className="min-w-0 flex-1"
|
|
312
|
+
dataset={CREDIT_SCORE}
|
|
313
|
+
xAxis={[
|
|
314
|
+
{
|
|
315
|
+
id: 'month',
|
|
316
|
+
dataKey: 'month',
|
|
317
|
+
tickLabelInterval: (_, index) => (CREDIT_SCORE.length - 1 - index) % 2 === 0,
|
|
318
|
+
},
|
|
319
|
+
]}
|
|
320
|
+
yAxis={[{ id: 'score', min: 540, max: 580, tickNumber: 3 }]}
|
|
321
|
+
series={[{ id: 'score', dataKey: 'score', label: 'Credit score', color: 'danger' }]}
|
|
322
|
+
width={FILL_WIDTH}
|
|
323
|
+
height={128}
|
|
324
|
+
hideLegend
|
|
325
|
+
scrollable={false}
|
|
326
|
+
accessibilityLabel="Credit score from May to October, falling from 575 to 547."
|
|
327
|
+
/>
|
|
328
|
+
<VStack space="xs" className="items-end">
|
|
329
|
+
<Heading size="xl">547</Heading>
|
|
330
|
+
<Text size="sm" color="secondary">
|
|
331
|
+
Poor
|
|
332
|
+
</Text>
|
|
333
|
+
<Text size="sm" color="danger">
|
|
334
|
+
−13 since Sep
|
|
335
|
+
</Text>
|
|
336
|
+
</VStack>
|
|
337
|
+
</HStack>
|
|
338
|
+
<Insight aiGenerated color="danger">
|
|
339
|
+
{/* TODO(forge-ui): a summary Insight has no body-size title, and Insight.Title renders
|
|
340
|
+
as a heading. The emphasized first line is a semibold nested Text instead. */}
|
|
341
|
+
<Insight.Description>
|
|
342
|
+
<Text weight="semibold">
|
|
343
|
+
2 missed payments in the last 90 days are impacting your score
|
|
344
|
+
</Text>
|
|
345
|
+
{'\n'}
|
|
346
|
+
<Text color="secondary">
|
|
347
|
+
Set up autopay on all your cards and bills to prevent this.
|
|
348
|
+
</Text>
|
|
349
|
+
</Insight.Description>
|
|
350
|
+
</Insight>
|
|
351
|
+
</VStack>
|
|
352
|
+
</Card.Content>
|
|
353
|
+
</Card>
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export default function InsightsOverviewBlock() {
|
|
358
|
+
return (
|
|
359
|
+
<VStack space="lg" className="w-full">
|
|
360
|
+
<Heading size="md">Your money this month</Heading>
|
|
361
|
+
<SafeToSpendCard />
|
|
362
|
+
<Tabs defaultValue="spending">
|
|
363
|
+
<Tabs.List accessibilityLabel="Insight topics" scrollable={false} className="self-center">
|
|
364
|
+
<Tabs.Tab value="spending">
|
|
365
|
+
<Tabs.TabLabel>Spending</Tabs.TabLabel>
|
|
366
|
+
</Tabs.Tab>
|
|
367
|
+
<Tabs.Tab value="cash-flow">
|
|
368
|
+
<Tabs.TabLabel>Cash flow</Tabs.TabLabel>
|
|
369
|
+
</Tabs.Tab>
|
|
370
|
+
<Tabs.Tab value="credit">
|
|
371
|
+
<Tabs.TabLabel>Credit</Tabs.TabLabel>
|
|
372
|
+
</Tabs.Tab>
|
|
373
|
+
</Tabs.List>
|
|
374
|
+
<Tabs.Panel value="spending" className="mt-3">
|
|
375
|
+
<VStack space="lg">
|
|
376
|
+
<SpendingCard />
|
|
377
|
+
<DailySpendingCard />
|
|
378
|
+
</VStack>
|
|
379
|
+
</Tabs.Panel>
|
|
380
|
+
<Tabs.Panel value="cash-flow" className="mt-3">
|
|
381
|
+
<CashFlowCard />
|
|
382
|
+
</Tabs.Panel>
|
|
383
|
+
<Tabs.Panel value="credit" className="mt-3">
|
|
384
|
+
<CreditScoreCard />
|
|
385
|
+
</Tabs.Panel>
|
|
386
|
+
</Tabs>
|
|
387
|
+
</VStack>
|
|
388
|
+
);
|
|
389
|
+
}
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
## Insight with Chart
|
|
393
|
+
|
|
394
|
+
Dismissible insight cards that back their headline with a chart: a horizontal bar comparison with month-over-month change, a cash-flow waterfall, and budget progress bars.
|
|
395
|
+
|
|
396
|
+
**Platforms:** iOS, Android
|
|
397
|
+
|
|
398
|
+
```tsx
|
|
399
|
+
import {
|
|
400
|
+
BarChart,
|
|
401
|
+
Button,
|
|
402
|
+
HStack,
|
|
403
|
+
Icon,
|
|
404
|
+
Insight,
|
|
405
|
+
ProgressBar,
|
|
406
|
+
Text,
|
|
407
|
+
VStack,
|
|
408
|
+
type ChartValueFormatter,
|
|
409
|
+
} from '@cdx-ui/components';
|
|
410
|
+
import { CheckCircle, Error } from '@cdx-ui/icons';
|
|
411
|
+
import { FILL_WIDTH, formatUsd } from '../_utils';
|
|
412
|
+
|
|
413
|
+
const SPENDING = [
|
|
414
|
+
{ category: 'Housing', amount: 1800, change: 0 },
|
|
415
|
+
{ category: 'Dining', amount: 720, change: 195 },
|
|
416
|
+
{ category: 'Transport', amount: 510, change: -110 },
|
|
417
|
+
];
|
|
418
|
+
|
|
419
|
+
// TODO(forge-ui): bar labels are plain SVG text, so the change can't take the design's trend
|
|
420
|
+
// icon or tertiary color. It is written into the label as an arrow instead.
|
|
421
|
+
const formatSpending: ChartValueFormatter = (value, { dataIndex }) => {
|
|
422
|
+
const change = dataIndex === undefined ? 0 : SPENDING[dataIndex].change;
|
|
423
|
+
if (change === 0) return formatUsd(value);
|
|
424
|
+
return `${formatUsd(value)} ${change > 0 ? '↗' : '↘'} ${formatUsd(Math.abs(change))}`;
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
const CASH_FLOW = [
|
|
428
|
+
{ step: 'Starting', amount: 2300, isTotal: true },
|
|
429
|
+
{ step: 'Income', amount: 1850 },
|
|
430
|
+
{ step: 'Expenses', amount: -1430 },
|
|
431
|
+
{ step: 'Ending', isTotal: true },
|
|
432
|
+
];
|
|
433
|
+
|
|
434
|
+
function SpendingInsight() {
|
|
435
|
+
return (
|
|
436
|
+
<Insight layout="detail" onClose={() => {}}>
|
|
437
|
+
<Insight.Tag>Spending</Insight.Tag>
|
|
438
|
+
<Insight.Header>
|
|
439
|
+
<Insight.Title>
|
|
440
|
+
Housing made up 36% of your spending this month vs. last month
|
|
441
|
+
</Insight.Title>
|
|
442
|
+
</Insight.Header>
|
|
443
|
+
<Insight.Content>
|
|
444
|
+
<BarChart
|
|
445
|
+
dataset={SPENDING}
|
|
446
|
+
layout="horizontal"
|
|
447
|
+
yAxis={[{ id: 'category', dataKey: 'category', scaleType: 'band' }]}
|
|
448
|
+
xAxis={[{ id: 'amount', position: 'none', min: 0, max: 1800 }]}
|
|
449
|
+
series={[
|
|
450
|
+
{
|
|
451
|
+
id: 'amount',
|
|
452
|
+
dataKey: 'amount',
|
|
453
|
+
label: 'This month',
|
|
454
|
+
valueFormatter: formatSpending,
|
|
455
|
+
},
|
|
456
|
+
]}
|
|
457
|
+
barLabel
|
|
458
|
+
grid={{ vertical: false }}
|
|
459
|
+
borderRadius={4}
|
|
460
|
+
width={FILL_WIDTH}
|
|
461
|
+
height={112}
|
|
462
|
+
hideLegend
|
|
463
|
+
scrollable={false}
|
|
464
|
+
accessibilityLabel="Spending this month by category. Housing $1,800, unchanged. Dining $720, up $195. Transport $510, down $110."
|
|
465
|
+
/>
|
|
466
|
+
</Insight.Content>
|
|
467
|
+
<Insight.Footer>
|
|
468
|
+
<Button variant="outline" color="action" size="small" className="flex-1">
|
|
469
|
+
<Button.Label>Compare spending</Button.Label>
|
|
470
|
+
</Button>
|
|
471
|
+
</Insight.Footer>
|
|
472
|
+
</Insight>
|
|
473
|
+
);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
function CashFlowInsight() {
|
|
477
|
+
return (
|
|
478
|
+
<Insight layout="detail" onClose={() => {}}>
|
|
479
|
+
<Insight.Tag>Cashflow</Insight.Tag>
|
|
480
|
+
<Insight.Header>
|
|
481
|
+
<Insight.Title>You brought in $420 more than you spent this week</Insight.Title>
|
|
482
|
+
<Insight.Description>
|
|
483
|
+
You received <Text weight="bold">$1,850</Text> and spent{' '}
|
|
484
|
+
<Text weight="bold">$1,430 this week</Text>, so your checking balance grew from{' '}
|
|
485
|
+
<Text weight="bold">$2,300 to $2,720</Text>.
|
|
486
|
+
</Insight.Description>
|
|
487
|
+
</Insight.Header>
|
|
488
|
+
<Insight.Content>
|
|
489
|
+
<BarChart
|
|
490
|
+
dataset={CASH_FLOW}
|
|
491
|
+
xAxis={[{ id: 'step', dataKey: 'step', scaleType: 'band' }]}
|
|
492
|
+
yAxis={[{ id: 'amount', position: 'none', min: 0, max: 4150 }]}
|
|
493
|
+
series={[
|
|
494
|
+
{
|
|
495
|
+
id: 'balance',
|
|
496
|
+
dataKey: 'amount',
|
|
497
|
+
waterfall: { totalKey: 'isTotal' },
|
|
498
|
+
valueFormatter: formatUsd,
|
|
499
|
+
},
|
|
500
|
+
]}
|
|
501
|
+
barLabel
|
|
502
|
+
grid={{ horizontal: false }}
|
|
503
|
+
borderRadius={4}
|
|
504
|
+
width={FILL_WIDTH}
|
|
505
|
+
height={240}
|
|
506
|
+
hideLegend
|
|
507
|
+
scrollable={false}
|
|
508
|
+
accessibilityLabel="Checking balance this week: starting $2,300, income $1,850, expenses $1,430, ending $2,720."
|
|
509
|
+
/>
|
|
510
|
+
</Insight.Content>
|
|
511
|
+
<Insight.Footer>
|
|
512
|
+
<Button variant="outline" color="action" size="small" className="flex-1">
|
|
513
|
+
<Button.Label>Compare spending</Button.Label>
|
|
514
|
+
</Button>
|
|
515
|
+
<Button variant="outline" color="action" size="small" className="flex-1">
|
|
516
|
+
<Button.Label>View categories</Button.Label>
|
|
517
|
+
</Button>
|
|
518
|
+
</Insight.Footer>
|
|
519
|
+
</Insight>
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
function BudgetInsight() {
|
|
524
|
+
return (
|
|
525
|
+
<Insight layout="detail" onClose={() => {}}>
|
|
526
|
+
<Insight.Tag>Budget</Insight.Tag>
|
|
527
|
+
<Insight.Header>
|
|
528
|
+
<Insight.Title>You’ve gone over your Entertainment budget this month</Insight.Title>
|
|
529
|
+
<Insight.Description>
|
|
530
|
+
Dining Out is close to its limit · <Text weight="bold">8 days left</Text>
|
|
531
|
+
</Insight.Description>
|
|
532
|
+
</Insight.Header>
|
|
533
|
+
<Insight.Content className="gap-4">
|
|
534
|
+
<VStack space="xs">
|
|
535
|
+
<HStack className="items-center justify-between">
|
|
536
|
+
<Text weight="semibold">Entertainment</Text>
|
|
537
|
+
<HStack space="xs" className="items-center">
|
|
538
|
+
<Icon as={Error} className="size-4 text-chart-categorical-2" />
|
|
539
|
+
<Text size="sm" weight="semibold">
|
|
540
|
+
$65 over
|
|
541
|
+
</Text>
|
|
542
|
+
</HStack>
|
|
543
|
+
</HStack>
|
|
544
|
+
<ProgressBar
|
|
545
|
+
value={100}
|
|
546
|
+
max={100}
|
|
547
|
+
size="large"
|
|
548
|
+
color="categorical-2"
|
|
549
|
+
accessibilityLabel="Entertainment budget, $65 over"
|
|
550
|
+
>
|
|
551
|
+
<ProgressBar.Indicator />
|
|
552
|
+
</ProgressBar>
|
|
553
|
+
</VStack>
|
|
554
|
+
<VStack space="xs">
|
|
555
|
+
<HStack className="items-center justify-between">
|
|
556
|
+
<Text weight="semibold">Dining Out</Text>
|
|
557
|
+
<Text size="sm" weight="medium" color="secondary">
|
|
558
|
+
$120 left
|
|
559
|
+
</Text>
|
|
560
|
+
</HStack>
|
|
561
|
+
<ProgressBar
|
|
562
|
+
value={73}
|
|
563
|
+
max={100}
|
|
564
|
+
size="large"
|
|
565
|
+
color="categorical-1"
|
|
566
|
+
accessibilityLabel="Dining Out budget, $120 left"
|
|
567
|
+
>
|
|
568
|
+
<ProgressBar.Indicator />
|
|
569
|
+
</ProgressBar>
|
|
570
|
+
</VStack>
|
|
571
|
+
</Insight.Content>
|
|
572
|
+
<Insight.Footer className="justify-between">
|
|
573
|
+
<HStack space="xs" className="shrink items-center">
|
|
574
|
+
<Icon as={CheckCircle} color="success" className="size-4" />
|
|
575
|
+
<Text size="sm" color="secondary">
|
|
576
|
+
3 other budgets on track
|
|
577
|
+
</Text>
|
|
578
|
+
</HStack>
|
|
579
|
+
<Button variant="outline" color="action" size="small">
|
|
580
|
+
<Button.Label>View budgets</Button.Label>
|
|
581
|
+
</Button>
|
|
582
|
+
</Insight.Footer>
|
|
583
|
+
</Insight>
|
|
584
|
+
);
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
export default function InsightChartBlock() {
|
|
588
|
+
return (
|
|
589
|
+
<VStack space="lg" className="w-full">
|
|
590
|
+
<SpendingInsight />
|
|
591
|
+
<CashFlowInsight />
|
|
592
|
+
<BudgetInsight />
|
|
593
|
+
</VStack>
|
|
594
|
+
);
|
|
595
|
+
}
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
## Insight with Table
|
|
599
|
+
|
|
600
|
+
A dismissible insight card that lists upcoming bills in a compact table.
|
|
601
|
+
|
|
602
|
+
**Platforms:** iOS, Android
|
|
603
|
+
|
|
604
|
+
```tsx
|
|
605
|
+
import { Avatar, Button, HStack, Insight, Table, Text } from '@cdx-ui/components';
|
|
606
|
+
import { Call, DirectionsCar, HumidityLow, Wifi } from '@cdx-ui/icons';
|
|
607
|
+
|
|
608
|
+
const BILLS = [
|
|
609
|
+
{ name: 'Car insurance', icon: DirectionsCar, due: 'Oct 13', amount: '$460' },
|
|
610
|
+
{ name: 'Phone', icon: Call, due: 'Oct 14', amount: '$68' },
|
|
611
|
+
{ name: 'Internet', icon: Wifi, due: 'Oct 15', amount: '$96' },
|
|
612
|
+
{ name: 'Water', icon: HumidityLow, due: 'Oct 16', amount: '$111' },
|
|
613
|
+
];
|
|
614
|
+
|
|
615
|
+
export default function InsightTableBlock() {
|
|
616
|
+
return (
|
|
617
|
+
<Insight layout="detail" onClose={() => {}} className="w-full">
|
|
618
|
+
<Insight.Tag>Bills</Insight.Tag>
|
|
619
|
+
<Insight.Header>
|
|
620
|
+
<Insight.Title>We found 7 recurring bills</Insight.Title>
|
|
621
|
+
<Insight.Description>
|
|
622
|
+
4 due next week · about <Text weight="bold">$735</Text>
|
|
623
|
+
</Insight.Description>
|
|
624
|
+
</Insight.Header>
|
|
625
|
+
<Insight.Content>
|
|
626
|
+
<Table fullBleed accessibilityLabel="Bills due next week">
|
|
627
|
+
<Table.Body>
|
|
628
|
+
{BILLS.map((bill) => (
|
|
629
|
+
<Table.Row key={bill.name}>
|
|
630
|
+
<Table.Cell colSpan={2}>
|
|
631
|
+
<HStack space="sm" className="items-center">
|
|
632
|
+
<Avatar color="brand" variant="subtle" shape="circle" size="sm">
|
|
633
|
+
<Avatar.Icon as={bill.icon} />
|
|
634
|
+
</Avatar>
|
|
635
|
+
<Text numberOfLines={1}>{bill.name}</Text>
|
|
636
|
+
</HStack>
|
|
637
|
+
</Table.Cell>
|
|
638
|
+
<Table.Cell align="end">
|
|
639
|
+
<Text size="sm" color="secondary">
|
|
640
|
+
{bill.due}
|
|
641
|
+
</Text>
|
|
642
|
+
</Table.Cell>
|
|
643
|
+
<Table.Cell align="end">
|
|
644
|
+
<Text weight="medium">{bill.amount}</Text>
|
|
645
|
+
</Table.Cell>
|
|
646
|
+
</Table.Row>
|
|
647
|
+
))}
|
|
648
|
+
</Table.Body>
|
|
649
|
+
</Table>
|
|
650
|
+
</Insight.Content>
|
|
651
|
+
<Insight.Footer>
|
|
652
|
+
<Button variant="outline" color="action" size="small" className="flex-1">
|
|
653
|
+
<Button.Label>View bills</Button.Label>
|
|
654
|
+
</Button>
|
|
655
|
+
</Insight.Footer>
|
|
656
|
+
</Insight>
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
```
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
## Tools
|
|
4
4
|
|
|
5
5
|
- [Figma libraries](https://design.candescent.com/docs/resources/figma-libraries/content.md) — Access our official design system Figma libraries
|
|
6
|
+
- [Agent skills](https://design.candescent.com/docs/resources/skills/content.md) — Teach AI coding agents to build with Forge UI components as they ship, without restyling them.
|
|
6
7
|
|
|
7
8
|
## Changelogs
|
|
8
9
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# 0.3.5 (https://design.candescent.com/docs/resources/release-notes/0.3.5)
|
|
2
|
+
|
|
3
|
+
Selected subtle Chip labels stay visible on Android when the variant changes from outline to subtle.
|
|
4
|
+
|
|
5
|
+
## Bug fixes
|
|
6
|
+
|
|
7
|
+
**[Chip](https://design.candescent.com/docs/components/chip/content.md)** — A selected chip that switches from `outline` to `subtle` keeps its label painted on Android ([#872](https://github.com/dfh-candescent/forge-design-system/pull/872)).
|