@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,360 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Children, createContext, forwardRef, isValidElement, useContext, useMemo } from 'react';
|
|
4
|
+
import { Text, View } from 'react-native';
|
|
5
|
+
import { Slot, StepperRoot, StepperStep, StepperStepTrigger, dataAttributes, mergeDataAttributes, useStepperContext, useStepperIndex, useStepperStep } from '@cdx-ui/primitives';
|
|
6
|
+
import { CheckCircle } from '@cdx-ui/icons';
|
|
7
|
+
import { cn, flattenChildren, mergeRefs } from '@cdx-ui/utils';
|
|
8
|
+
import { Icon } from '../Icon';
|
|
9
|
+
import { ProgressRing } from '../ProgressCircle/ProgressRing';
|
|
10
|
+
import { getStepperLayout, STEPPER_INDICATOR_SIZE, STEPPER_RING_STROKE_WIDTH, stepperContentVariants, stepperDescriptionVariants, stepperIndicatorCheckVariants, stepperIndicatorDiscVariants, stepperIndicatorNumeralVariants, stepperIndicatorRingVariants, stepperIndicatorVariants, stepperSeparatorVariants, stepperStepBodyVariants, stepperStepLabelVariants, stepperStepMainVariants, stepperStepTriggerVariants, stepperStepVariants, stepperTitleVariants, stepperVariants } from './styles';
|
|
11
|
+
import { useStepperLabelFit } from './useStepperLabelFit';
|
|
12
|
+
import { useStepperRingColors } from './useStepperRingColors';
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
export { useStepperStep } from '@cdx-ui/primitives';
|
|
15
|
+
const StepperLabelFitContext = /*#__PURE__*/createContext('shrink');
|
|
16
|
+
|
|
17
|
+
/** Counts steps the way `StepperRoot` numbers them, so the label-fit decision resets with them. */
|
|
18
|
+
function countSteps(children, asChild) {
|
|
19
|
+
const source = asChild && /*#__PURE__*/isValidElement(children) ? children.props.children : children;
|
|
20
|
+
return flattenChildren(source).filter(child => /*#__PURE__*/isValidElement(child)).length;
|
|
21
|
+
}
|
|
22
|
+
const HIDDEN_FROM_AT = {
|
|
23
|
+
'aria-hidden': true,
|
|
24
|
+
accessibilityElementsHidden: true,
|
|
25
|
+
importantForAccessibility: 'no-hide-descendants'
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// =============================================================================
|
|
29
|
+
// ROOT
|
|
30
|
+
// =============================================================================
|
|
31
|
+
|
|
32
|
+
const StepperRootComponent = /*#__PURE__*/forwardRef(({
|
|
33
|
+
className,
|
|
34
|
+
style,
|
|
35
|
+
orientation = 'vertical',
|
|
36
|
+
labelPlacement = 'end',
|
|
37
|
+
children,
|
|
38
|
+
...props
|
|
39
|
+
}, ref) => {
|
|
40
|
+
const layout = getStepperLayout(orientation, labelPlacement);
|
|
41
|
+
const {
|
|
42
|
+
fit,
|
|
43
|
+
measureRef
|
|
44
|
+
} = useStepperLabelFit(layout === 'horizontal-end', countSteps(children, props.asChild));
|
|
45
|
+
const rootRef = useMemo(() => measureRef === undefined ? ref : mergeRefs(ref, measureRef), [ref, measureRef]);
|
|
46
|
+
return /*#__PURE__*/_jsx(StepperLabelFitContext.Provider, {
|
|
47
|
+
value: fit,
|
|
48
|
+
children: /*#__PURE__*/_jsx(StepperRoot, {
|
|
49
|
+
ref: rootRef,
|
|
50
|
+
className: cn(stepperVariants({
|
|
51
|
+
layout
|
|
52
|
+
}), className),
|
|
53
|
+
style: style,
|
|
54
|
+
orientation: orientation,
|
|
55
|
+
labelPlacement: labelPlacement,
|
|
56
|
+
...props,
|
|
57
|
+
...mergeDataAttributes(props, dataAttributes({
|
|
58
|
+
slot: 'stepper'
|
|
59
|
+
})),
|
|
60
|
+
children: children
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
StepperRootComponent.displayName = 'Stepper';
|
|
65
|
+
|
|
66
|
+
// =============================================================================
|
|
67
|
+
// STEP
|
|
68
|
+
// =============================================================================
|
|
69
|
+
|
|
70
|
+
function isSlot(child, type) {
|
|
71
|
+
return /*#__PURE__*/isValidElement(child) && child.type === type;
|
|
72
|
+
}
|
|
73
|
+
const StepperStepComponent = /*#__PURE__*/forwardRef(({
|
|
74
|
+
asChild,
|
|
75
|
+
className,
|
|
76
|
+
style,
|
|
77
|
+
children,
|
|
78
|
+
...props
|
|
79
|
+
}, ref) => {
|
|
80
|
+
const {
|
|
81
|
+
orientation,
|
|
82
|
+
labelPlacement,
|
|
83
|
+
count
|
|
84
|
+
} = useStepperContext();
|
|
85
|
+
const layout = getStepperLayout(orientation, labelPlacement);
|
|
86
|
+
const labelFit = useContext(StepperLabelFitContext);
|
|
87
|
+
const isLast = useStepperIndex() === count - 1;
|
|
88
|
+
const stepClass = cn(stepperStepVariants({
|
|
89
|
+
layout,
|
|
90
|
+
isLast,
|
|
91
|
+
labelFit
|
|
92
|
+
}), className);
|
|
93
|
+
const slotAttributes = mergeDataAttributes(props, dataAttributes({
|
|
94
|
+
slot: 'stepper-step'
|
|
95
|
+
}));
|
|
96
|
+
if (asChild) {
|
|
97
|
+
return /*#__PURE__*/_jsx(StepperStep, {
|
|
98
|
+
ref: ref,
|
|
99
|
+
asChild: true,
|
|
100
|
+
className: stepClass,
|
|
101
|
+
style: style,
|
|
102
|
+
...props,
|
|
103
|
+
...slotAttributes,
|
|
104
|
+
children: children
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Indicator, Title and Description form the step trigger, which carries the accessible
|
|
109
|
+
// name; everything else is the body below the title. The Separator sits in the indicator
|
|
110
|
+
// track: before the main column when vertical, after it when horizontal.
|
|
111
|
+
const childArray = Children.toArray(children);
|
|
112
|
+
const indicator = childArray.find(child => isSlot(child, StepperIndicatorComponent));
|
|
113
|
+
const title = childArray.find(child => isSlot(child, StepperTitleComponent));
|
|
114
|
+
const description = childArray.find(child => isSlot(child, StepperDescriptionComponent));
|
|
115
|
+
const separator = childArray.find(child => isSlot(child, StepperSeparatorComponent));
|
|
116
|
+
const body = childArray.filter(child => !isSlot(child, StepperIndicatorComponent) && !isSlot(child, StepperTitleComponent) && !isSlot(child, StepperDescriptionComponent) && !isSlot(child, StepperSeparatorComponent));
|
|
117
|
+
const hasLabel = title !== undefined || description !== undefined;
|
|
118
|
+
return /*#__PURE__*/_jsxs(StepperStep, {
|
|
119
|
+
ref: ref,
|
|
120
|
+
className: stepClass,
|
|
121
|
+
style: style,
|
|
122
|
+
...props,
|
|
123
|
+
...slotAttributes,
|
|
124
|
+
children: [layout === 'vertical' ? separator : null, /*#__PURE__*/_jsxs(View, {
|
|
125
|
+
className: cn(stepperStepMainVariants({
|
|
126
|
+
layout,
|
|
127
|
+
labelFit
|
|
128
|
+
})),
|
|
129
|
+
children: [/*#__PURE__*/_jsxs(StepperStepTrigger, {
|
|
130
|
+
className: stepperStepTriggerVariants({
|
|
131
|
+
layout
|
|
132
|
+
}),
|
|
133
|
+
...dataAttributes({
|
|
134
|
+
slot: 'stepper-step-trigger'
|
|
135
|
+
}),
|
|
136
|
+
children: [indicator, hasLabel ? /*#__PURE__*/_jsxs(View, {
|
|
137
|
+
className: cn(stepperStepLabelVariants({
|
|
138
|
+
layout,
|
|
139
|
+
labelFit
|
|
140
|
+
})),
|
|
141
|
+
children: [title, description]
|
|
142
|
+
}) : null]
|
|
143
|
+
}), body.length > 0 ? /*#__PURE__*/_jsx(View, {
|
|
144
|
+
className: stepperStepBodyVariants({
|
|
145
|
+
layout
|
|
146
|
+
}),
|
|
147
|
+
children: body
|
|
148
|
+
}) : null]
|
|
149
|
+
}), layout === 'vertical' ? null : separator]
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
StepperStepComponent.displayName = 'Stepper.Step';
|
|
153
|
+
|
|
154
|
+
// =============================================================================
|
|
155
|
+
// INDICATOR
|
|
156
|
+
// =============================================================================
|
|
157
|
+
|
|
158
|
+
const StepperIndicatorComponent = /*#__PURE__*/forwardRef(({
|
|
159
|
+
asChild,
|
|
160
|
+
className,
|
|
161
|
+
style,
|
|
162
|
+
children,
|
|
163
|
+
...props
|
|
164
|
+
}, ref) => {
|
|
165
|
+
const {
|
|
166
|
+
index,
|
|
167
|
+
isCurrent,
|
|
168
|
+
isComplete,
|
|
169
|
+
hasProgress,
|
|
170
|
+
progress
|
|
171
|
+
} = useStepperStep();
|
|
172
|
+
const ringColors = useStepperRingColors(isCurrent);
|
|
173
|
+
const currentAttribute = dataAttributes({
|
|
174
|
+
current: isCurrent
|
|
175
|
+
});
|
|
176
|
+
const indicatorClass = cn(stepperIndicatorVariants(), className);
|
|
177
|
+
const indicatorAttributes = mergeDataAttributes(props, dataAttributes({
|
|
178
|
+
slot: 'stepper-indicator',
|
|
179
|
+
current: isCurrent,
|
|
180
|
+
complete: isComplete,
|
|
181
|
+
progress: hasProgress
|
|
182
|
+
}));
|
|
183
|
+
if (asChild) {
|
|
184
|
+
return /*#__PURE__*/_jsx(Slot, {
|
|
185
|
+
ref: ref,
|
|
186
|
+
className: indicatorClass,
|
|
187
|
+
style: style,
|
|
188
|
+
...props,
|
|
189
|
+
...HIDDEN_FROM_AT,
|
|
190
|
+
...indicatorAttributes,
|
|
191
|
+
children: children
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
const hasCustomGlyph = children !== undefined && children !== null;
|
|
195
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
196
|
+
ref: ref,
|
|
197
|
+
className: indicatorClass,
|
|
198
|
+
style: style,
|
|
199
|
+
...props,
|
|
200
|
+
...HIDDEN_FROM_AT,
|
|
201
|
+
...indicatorAttributes,
|
|
202
|
+
children: [hasProgress ? /*#__PURE__*/_jsx(View, {
|
|
203
|
+
className: stepperIndicatorRingVariants(),
|
|
204
|
+
children: /*#__PURE__*/_jsx(ProgressRing, {
|
|
205
|
+
size: STEPPER_INDICATOR_SIZE,
|
|
206
|
+
strokeWidth: STEPPER_RING_STROKE_WIDTH,
|
|
207
|
+
value: progress,
|
|
208
|
+
trackColor: ringColors.track,
|
|
209
|
+
indicatorColor: ringColors.indicator
|
|
210
|
+
})
|
|
211
|
+
}) : null, isComplete && !hasCustomGlyph ? /*#__PURE__*/_jsx(Icon, {
|
|
212
|
+
as: CheckCircle,
|
|
213
|
+
filled: true,
|
|
214
|
+
className: stepperIndicatorCheckVariants(),
|
|
215
|
+
...currentAttribute
|
|
216
|
+
}) : /*#__PURE__*/_jsx(View, {
|
|
217
|
+
className: stepperIndicatorDiscVariants(),
|
|
218
|
+
...currentAttribute,
|
|
219
|
+
children: hasCustomGlyph ? children : /*#__PURE__*/_jsx(Text, {
|
|
220
|
+
className: stepperIndicatorNumeralVariants(),
|
|
221
|
+
...currentAttribute,
|
|
222
|
+
children: String(index + 1)
|
|
223
|
+
})
|
|
224
|
+
})]
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
StepperIndicatorComponent.displayName = 'Stepper.Indicator';
|
|
228
|
+
|
|
229
|
+
// =============================================================================
|
|
230
|
+
// TITLE
|
|
231
|
+
// =============================================================================
|
|
232
|
+
|
|
233
|
+
const StepperTitleComponent = /*#__PURE__*/forwardRef(({
|
|
234
|
+
asChild,
|
|
235
|
+
className,
|
|
236
|
+
style,
|
|
237
|
+
...props
|
|
238
|
+
}, ref) => {
|
|
239
|
+
const {
|
|
240
|
+
isCurrent,
|
|
241
|
+
orientation,
|
|
242
|
+
labelPlacement
|
|
243
|
+
} = useStepperStep();
|
|
244
|
+
const isCentered = getStepperLayout(orientation, labelPlacement) === 'horizontal-bottom';
|
|
245
|
+
const Comp = asChild ? Slot : Text;
|
|
246
|
+
return /*#__PURE__*/_jsx(Comp, {
|
|
247
|
+
ref: ref,
|
|
248
|
+
className: cn(stepperTitleVariants({
|
|
249
|
+
isCentered
|
|
250
|
+
}), className),
|
|
251
|
+
style: style,
|
|
252
|
+
...props,
|
|
253
|
+
...mergeDataAttributes(props, dataAttributes({
|
|
254
|
+
slot: 'stepper-title',
|
|
255
|
+
current: isCurrent
|
|
256
|
+
}))
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
StepperTitleComponent.displayName = 'Stepper.Title';
|
|
260
|
+
|
|
261
|
+
// =============================================================================
|
|
262
|
+
// DESCRIPTION
|
|
263
|
+
// =============================================================================
|
|
264
|
+
|
|
265
|
+
const StepperDescriptionComponent = /*#__PURE__*/forwardRef(({
|
|
266
|
+
asChild,
|
|
267
|
+
className,
|
|
268
|
+
style,
|
|
269
|
+
...props
|
|
270
|
+
}, ref) => {
|
|
271
|
+
const {
|
|
272
|
+
orientation,
|
|
273
|
+
labelPlacement
|
|
274
|
+
} = useStepperStep();
|
|
275
|
+
const isCentered = getStepperLayout(orientation, labelPlacement) === 'horizontal-bottom';
|
|
276
|
+
const Comp = asChild ? Slot : Text;
|
|
277
|
+
return /*#__PURE__*/_jsx(Comp, {
|
|
278
|
+
ref: ref,
|
|
279
|
+
className: cn(stepperDescriptionVariants({
|
|
280
|
+
isCentered
|
|
281
|
+
}), className),
|
|
282
|
+
style: style,
|
|
283
|
+
...props,
|
|
284
|
+
...mergeDataAttributes(props, dataAttributes({
|
|
285
|
+
slot: 'stepper-description'
|
|
286
|
+
}))
|
|
287
|
+
});
|
|
288
|
+
});
|
|
289
|
+
StepperDescriptionComponent.displayName = 'Stepper.Description';
|
|
290
|
+
|
|
291
|
+
// =============================================================================
|
|
292
|
+
// CONTENT
|
|
293
|
+
// =============================================================================
|
|
294
|
+
|
|
295
|
+
const StepperContentComponent = /*#__PURE__*/forwardRef(({
|
|
296
|
+
asChild,
|
|
297
|
+
className,
|
|
298
|
+
style,
|
|
299
|
+
...props
|
|
300
|
+
}, ref) => {
|
|
301
|
+
const Comp = asChild ? Slot : View;
|
|
302
|
+
return /*#__PURE__*/_jsx(Comp, {
|
|
303
|
+
ref: ref,
|
|
304
|
+
className: cn(stepperContentVariants(), className),
|
|
305
|
+
style: style,
|
|
306
|
+
...props,
|
|
307
|
+
...mergeDataAttributes(props, dataAttributes({
|
|
308
|
+
slot: 'stepper-content'
|
|
309
|
+
}))
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
StepperContentComponent.displayName = 'Stepper.Content';
|
|
313
|
+
|
|
314
|
+
// =============================================================================
|
|
315
|
+
// SEPARATOR
|
|
316
|
+
// =============================================================================
|
|
317
|
+
|
|
318
|
+
const StepperSeparatorComponent = /*#__PURE__*/forwardRef(({
|
|
319
|
+
asChild,
|
|
320
|
+
className,
|
|
321
|
+
style,
|
|
322
|
+
...props
|
|
323
|
+
}, ref) => {
|
|
324
|
+
const {
|
|
325
|
+
isLast,
|
|
326
|
+
orientation,
|
|
327
|
+
labelPlacement
|
|
328
|
+
} = useStepperStep();
|
|
329
|
+
if (isLast) {
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
const Comp = asChild ? Slot : View;
|
|
333
|
+
return /*#__PURE__*/_jsx(Comp, {
|
|
334
|
+
ref: ref,
|
|
335
|
+
className: cn(stepperSeparatorVariants({
|
|
336
|
+
layout: getStepperLayout(orientation, labelPlacement)
|
|
337
|
+
}), className),
|
|
338
|
+
style: style,
|
|
339
|
+
...props,
|
|
340
|
+
...HIDDEN_FROM_AT,
|
|
341
|
+
...mergeDataAttributes(props, dataAttributes({
|
|
342
|
+
slot: 'stepper-separator'
|
|
343
|
+
}))
|
|
344
|
+
});
|
|
345
|
+
});
|
|
346
|
+
StepperSeparatorComponent.displayName = 'Stepper.Separator';
|
|
347
|
+
|
|
348
|
+
// =============================================================================
|
|
349
|
+
// COMPOUND EXPORT
|
|
350
|
+
// =============================================================================
|
|
351
|
+
|
|
352
|
+
export const Stepper = Object.assign(StepperRootComponent, {
|
|
353
|
+
Step: StepperStepComponent,
|
|
354
|
+
Indicator: StepperIndicatorComponent,
|
|
355
|
+
Title: StepperTitleComponent,
|
|
356
|
+
Description: StepperDescriptionComponent,
|
|
357
|
+
Content: StepperContentComponent,
|
|
358
|
+
Separator: StepperSeparatorComponent
|
|
359
|
+
});
|
|
360
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Children","createContext","forwardRef","isValidElement","useContext","useMemo","Text","View","Slot","StepperRoot","StepperStep","StepperStepTrigger","dataAttributes","mergeDataAttributes","useStepperContext","useStepperIndex","useStepperStep","CheckCircle","cn","flattenChildren","mergeRefs","Icon","ProgressRing","getStepperLayout","STEPPER_INDICATOR_SIZE","STEPPER_RING_STROKE_WIDTH","stepperContentVariants","stepperDescriptionVariants","stepperIndicatorCheckVariants","stepperIndicatorDiscVariants","stepperIndicatorNumeralVariants","stepperIndicatorRingVariants","stepperIndicatorVariants","stepperSeparatorVariants","stepperStepBodyVariants","stepperStepLabelVariants","stepperStepMainVariants","stepperStepTriggerVariants","stepperStepVariants","stepperTitleVariants","stepperVariants","useStepperLabelFit","useStepperRingColors","jsx","_jsx","jsxs","_jsxs","StepperLabelFitContext","countSteps","children","asChild","source","props","filter","child","length","HIDDEN_FROM_AT","accessibilityElementsHidden","importantForAccessibility","StepperRootComponent","className","style","orientation","labelPlacement","ref","layout","fit","measureRef","rootRef","undefined","Provider","value","slot","displayName","isSlot","type","StepperStepComponent","count","labelFit","isLast","stepClass","slotAttributes","childArray","toArray","indicator","find","StepperIndicatorComponent","title","StepperTitleComponent","description","StepperDescriptionComponent","separator","StepperSeparatorComponent","body","hasLabel","index","isCurrent","isComplete","hasProgress","progress","ringColors","currentAttribute","current","indicatorClass","indicatorAttributes","complete","hasCustomGlyph","size","strokeWidth","trackColor","track","indicatorColor","as","filled","String","isCentered","Comp","StepperContentComponent","Stepper","Object","assign","Step","Indicator","Title","Description","Content","Separator"],"sourceRoot":"../../../../src","sources":["components/Stepper/index.tsx"],"mappings":";;AAAA,SACEA,QAAQ,EACRC,aAAa,EACbC,UAAU,EACVC,cAAc,EACdC,UAAU,EACVC,OAAO,QAGF,OAAO;AACd,SAASC,IAAI,EAAEC,IAAI,QAAwC,cAAc;AACzE,SACEC,IAAI,EACJC,WAAW,EACXC,WAAW,EACXC,kBAAkB,EAClBC,cAAc,EACdC,mBAAmB,EACnBC,iBAAiB,EACjBC,eAAe,EACfC,cAAc,QAGT,oBAAoB;AAC3B,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,EAAE,EAAEC,eAAe,EAAEC,SAAS,QAAQ,eAAe;AAC9D,SAASC,IAAI,QAAQ,SAAS;AAC9B,SAASC,YAAY,QAAQ,gCAAgC;AAC7D,SACEC,gBAAgB,EAChBC,sBAAsB,EACtBC,yBAAyB,EACzBC,sBAAsB,EACtBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,4BAA4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,EAAEA,KAAM;IAAA,GACTT,KAAK;IAAA,GACLI,cAAc;IAAA,GACd3C,mBAAmB,CAACuC,KAAK,EAAExC,cAAc,CAAC;MAAE4D,IAAI,EAAE;IAAoB,CAAC,CAAC;EAAC,CAC9E,CAAC;AAEN,CACF,CAAC;AAEDoB,yBAAyB,CAACnB,WAAW,GAAG,mBAAmB;;AAE3D;AACA;AACA;;AAWA,OAAO,MAAM6C,OAAO,GAAGC,MAAM,CAACC,MAAM,CAAC7D,oBAAoB,EAAE;EACzD8D,IAAI,EAAE7C,oBAAoB;EAC1B8C,SAAS,EAAEpC,yBAAyB;EACpCqC,KAAK,EAAEnC,qBAAqB;EAC5BoC,WAAW,EAAElC,2BAA2B;EACxCmC,OAAO,EAAER,uBAAuB;EAChCS,SAAS,EAAElC;AACb,CAAC,CAA6B","ignoreList":[]}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
|
+
import { cva } from '@cdx-ui/utils';
|
|
5
|
+
import { TRANSITION_COLORS } from '../../styles/constants';
|
|
6
|
+
|
|
7
|
+
/** Indicator frame in px. The ring is drawn at this size around the 24px disc. */
|
|
8
|
+
export const STEPPER_INDICATOR_SIZE = 34;
|
|
9
|
+
export const STEPPER_RING_STROKE_WIDTH = 3;
|
|
10
|
+
export function getStepperLayout(orientation, labelPlacement) {
|
|
11
|
+
if (orientation === 'vertical') {
|
|
12
|
+
return 'vertical';
|
|
13
|
+
}
|
|
14
|
+
return labelPlacement === 'bottom' ? 'horizontal-bottom' : 'horizontal-end';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Horizontal layouts:
|
|
18
|
+
// - `horizontal-end` (label after the indicator): steps start at their content width and every
|
|
19
|
+
// step but the last grows; that growth goes to its in-flow separator. With `labelFit: 'words'`
|
|
20
|
+
// (web, while the row fits) steps keep their min-content width so labels wrap between words;
|
|
21
|
+
// with `'shrink'` RN Web's `min-width: 0` lets them shrink further so the row never overflows.
|
|
22
|
+
// - `horizontal-bottom` (label centered below): equal columns; the separator is absolute, so it
|
|
23
|
+
// never affects column layout.
|
|
24
|
+
export const stepperVariants = cva([], {
|
|
25
|
+
variants: {
|
|
26
|
+
layout: {
|
|
27
|
+
vertical: 'flex-col',
|
|
28
|
+
'horizontal-end': 'w-full flex-row items-start',
|
|
29
|
+
'horizontal-bottom': 'w-full flex-row items-start'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
layout: 'vertical'
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export const stepperStepVariants = cva([], {
|
|
37
|
+
variants: {
|
|
38
|
+
layout: {
|
|
39
|
+
vertical: 'flex-row',
|
|
40
|
+
'horizontal-end': 'min-w-0 flex-row items-start',
|
|
41
|
+
'horizontal-bottom': 'relative min-w-0 flex-1 basis-0 items-center'
|
|
42
|
+
},
|
|
43
|
+
isLast: {
|
|
44
|
+
true: '',
|
|
45
|
+
false: ''
|
|
46
|
+
},
|
|
47
|
+
labelFit: {
|
|
48
|
+
words: '',
|
|
49
|
+
shrink: ''
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
compoundVariants: [{
|
|
53
|
+
layout: 'horizontal-end',
|
|
54
|
+
isLast: false,
|
|
55
|
+
className: 'grow shrink basis-auto pe-2'
|
|
56
|
+
}, {
|
|
57
|
+
layout: 'horizontal-end',
|
|
58
|
+
isLast: true,
|
|
59
|
+
className: 'shrink'
|
|
60
|
+
}, {
|
|
61
|
+
layout: 'horizontal-end',
|
|
62
|
+
labelFit: 'words',
|
|
63
|
+
className: 'min-w-auto'
|
|
64
|
+
}],
|
|
65
|
+
defaultVariants: {
|
|
66
|
+
layout: 'vertical',
|
|
67
|
+
isLast: false,
|
|
68
|
+
labelFit: 'shrink'
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// Unexported layout wrappers inside `Stepper.Step` (no `data-slot`).
|
|
73
|
+
export const stepperStepMainVariants = cva(['min-w-0'], {
|
|
74
|
+
variants: {
|
|
75
|
+
layout: {
|
|
76
|
+
vertical: 'flex-1',
|
|
77
|
+
'horizontal-end': 'shrink',
|
|
78
|
+
'horizontal-bottom': 'items-center self-stretch px-2'
|
|
79
|
+
},
|
|
80
|
+
labelFit: {
|
|
81
|
+
words: '',
|
|
82
|
+
shrink: ''
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
compoundVariants: [{
|
|
86
|
+
layout: 'horizontal-end',
|
|
87
|
+
labelFit: 'words',
|
|
88
|
+
className: 'min-w-auto'
|
|
89
|
+
}],
|
|
90
|
+
defaultVariants: {
|
|
91
|
+
layout: 'vertical',
|
|
92
|
+
labelFit: 'shrink'
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// Each layout pads the hover and press fill and cancels it with an equal negative margin, so a
|
|
97
|
+
// step keeps its geometry when it becomes clickable. The 24px disc sits 5px inside its 34px
|
|
98
|
+
// frame, so sides bounded by the disc get 4px and sides bounded by text get 9px; the fill then
|
|
99
|
+
// looks evenly padded. Each layout aligns the trigger to its content (`self-start`, or
|
|
100
|
+
// `self-center` under a centered label) so the fill hugs the indicator and label instead of
|
|
101
|
+
// spanning the step. Hover, press and focus-visible use the `Tabs` hover tokens and the Forge
|
|
102
|
+
// focus ring until the designer specifies clickable-step states.
|
|
103
|
+
export const stepperStepTriggerVariants = cva(['rounded-md', TRANSITION_COLORS, Platform.select({
|
|
104
|
+
default: 'data-[active=true]:bg-surface-secondary-active',
|
|
105
|
+
web: ['outline-none data-[clickable=true]:cursor-pointer', 'data-[hover=true]:bg-surface-secondary-hover data-[active=true]:data-[hover=true]:bg-surface-secondary-active', 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-stroke-focus web:data-[focus-visible=true]:ring-offset-2'].join(' ')
|
|
106
|
+
})], {
|
|
107
|
+
variants: {
|
|
108
|
+
layout: {
|
|
109
|
+
vertical: 'flex-row items-start self-start gap-2 -my-1 -ms-1 -me-[9px] py-1 ps-1 pe-[9px]',
|
|
110
|
+
'horizontal-end': 'flex-row items-start self-start gap-2 -my-1 -ms-1 -me-[9px] py-1 ps-1 pe-[9px]',
|
|
111
|
+
'horizontal-bottom': 'min-w-0 items-center self-center gap-1 -mx-[9px] -mt-1 -mb-[9px] px-[9px] pt-1 pb-[9px]'
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
defaultVariants: {
|
|
115
|
+
layout: 'vertical'
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
export const stepperStepLabelVariants = cva(['min-w-0'], {
|
|
119
|
+
variants: {
|
|
120
|
+
layout: {
|
|
121
|
+
vertical: 'shrink py-[7px]',
|
|
122
|
+
'horizontal-end': 'shrink py-[7px]',
|
|
123
|
+
'horizontal-bottom': 'self-stretch'
|
|
124
|
+
},
|
|
125
|
+
labelFit: {
|
|
126
|
+
words: '',
|
|
127
|
+
shrink: ''
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
compoundVariants: [{
|
|
131
|
+
layout: 'horizontal-end',
|
|
132
|
+
labelFit: 'words',
|
|
133
|
+
className: 'min-w-auto'
|
|
134
|
+
}],
|
|
135
|
+
defaultVariants: {
|
|
136
|
+
layout: 'vertical',
|
|
137
|
+
labelFit: 'shrink'
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
export const stepperStepBodyVariants = cva([], {
|
|
141
|
+
variants: {
|
|
142
|
+
layout: {
|
|
143
|
+
vertical: 'ps-[42px]',
|
|
144
|
+
'horizontal-end': 'ps-[42px]',
|
|
145
|
+
'horizontal-bottom': 'self-stretch'
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
defaultVariants: {
|
|
149
|
+
layout: 'vertical'
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// Indicator, disc, numeral and check each emit their own `data-current` because native
|
|
154
|
+
// Uniwind cannot style a child from its parent's data attributes.
|
|
155
|
+
export const stepperIndicatorVariants = cva(['relative size-[34px] shrink-0 items-center justify-center']);
|
|
156
|
+
export const stepperIndicatorRingVariants = cva(['pointer-events-none absolute inset-0']);
|
|
157
|
+
export const stepperIndicatorDiscVariants = cva(['size-6 items-center justify-center rounded-full', 'bg-surface-neutral-strong data-[current=true]:bg-surface-brand-strong']);
|
|
158
|
+
export const stepperIndicatorNumeralVariants = cva(['body-sm font-medium', 'text-content-neutral-on-strong data-[current=true]:text-content-brand-on-strong']);
|
|
159
|
+
export const stepperIndicatorCheckVariants = cva(['size-7 text-content-neutral data-[current=true]:text-content-brand']);
|
|
160
|
+
|
|
161
|
+
// Native text alignment does not inherit from a parent `View`, so centered labels set it on
|
|
162
|
+
// each text part.
|
|
163
|
+
export const stepperTitleVariants = cva(['body-md text-content-secondary', 'data-[current=true]:font-medium data-[current=true]:text-content-primary'], {
|
|
164
|
+
variants: {
|
|
165
|
+
isCentered: {
|
|
166
|
+
true: 'text-center',
|
|
167
|
+
false: ''
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
defaultVariants: {
|
|
171
|
+
isCentered: false
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
export const stepperDescriptionVariants = cva(['body-sm text-content-secondary'], {
|
|
175
|
+
variants: {
|
|
176
|
+
isCentered: {
|
|
177
|
+
true: 'text-center',
|
|
178
|
+
false: ''
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
defaultVariants: {
|
|
182
|
+
isCentered: false
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
export const stepperContentVariants = cva(['gap-2 py-2']);
|
|
186
|
+
|
|
187
|
+
// Vertical: rendered before the step's main column with zero net width, centered under the
|
|
188
|
+
// 34px frame; `self-stretch` follows the title and content.
|
|
189
|
+
// `horizontal-end`: in flow after the label, centered on the frame's height; it takes the
|
|
190
|
+
// step's growth, and the step's `pe-2` leaves 8px before the next indicator.
|
|
191
|
+
// `horizontal-bottom`: absolute from this column's center to the next one's (columns are equal
|
|
192
|
+
// and have no gap), inset 25px at each end: half the 34px frame plus 8px.
|
|
193
|
+
// `z-10` keeps the line above a clickable trigger's hover and press fill.
|
|
194
|
+
export const stepperSeparatorVariants = cva(['z-10 bg-stroke-secondary'], {
|
|
195
|
+
variants: {
|
|
196
|
+
layout: {
|
|
197
|
+
vertical: 'relative mt-[34px] min-h-6 w-px self-stretch ms-[16.5px] -me-[17.5px]',
|
|
198
|
+
'horizontal-end': 'relative mt-[16.5px] h-px min-w-6 flex-1 ms-2',
|
|
199
|
+
'horizontal-bottom': 'absolute top-[16.5px] start-[50%] end-[-50%] h-px ms-[25px] me-[25px]'
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
defaultVariants: {
|
|
203
|
+
layout: 'vertical'
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","cva","TRANSITION_COLORS","STEPPER_INDICATOR_SIZE","STEPPER_RING_STROKE_WIDTH","getStepperLayout","orientation","labelPlacement","stepperVariants","variants","layout","vertical","defaultVariants","stepperStepVariants","isLast","true","false","labelFit","words","shrink","compoundVariants","className","stepperStepMainVariants","stepperStepTriggerVariants","select","default","web","join","stepperStepLabelVariants","stepperStepBodyVariants","stepperIndicatorVariants","stepperIndicatorRingVariants","stepperIndicatorDiscVariants","stepperIndicatorNumeralVariants","stepperIndicatorCheckVariants","stepperTitleVariants","isCentered","stepperDescriptionVariants","stepperContentVariants","stepperSeparatorVariants"],"sourceRoot":"../../../../src","sources":["components/Stepper/styles.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,SAASC,GAAG,QAA2B,eAAe;AACtD,SAASC,iBAAiB,QAAQ,wBAAwB;;AAE1D;AACA,OAAO,MAAMC,sBAAsB,GAAG,EAAE;AACxC,OAAO,MAAMC,yBAAyB,GAAG,CAAC;AAI1C,OAAO,SAASC,gBAAgBA,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IAAI,EAAE,aAAa;MACnBC,KAAK,EAAE;IACT;EACF,CAAC;EACDJ,eAAe,EAAE;IACfwB,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,OAAO,MAAME,sBAAsB,GAAGrC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMsC,wBAAwB,GAAGtC,GAAG,CAAC,CAAC,0BAA0B,CAAC,EAAE;EACxEQ,QAAQ,EAAE;IACRC,MAAM,EAAE;MACNC,QAAQ,EAAE,uEAAuE;MACjF,gBAAgB,EAAE,+CAA+C;MACjE,mBAAmB,EAAE;IACvB;EACF,CAAC;EACDC,eAAe,EAAE;IACfF,MAAM,EAAE;EACV;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* How `horizontal-end` labels give way when the row runs out of room. `'words'` keeps each
|
|
5
|
+
* step at least as wide as its longest word, so labels wrap only between words; `'shrink'` lets
|
|
6
|
+
* steps shrink below that so the row never overflows.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const NATIVE_RESULT = {
|
|
10
|
+
fit: 'shrink',
|
|
11
|
+
measureRef: undefined
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** Native layout has no min-content sizing, so steps always shrink to fit. */
|
|
15
|
+
export function useStepperLabelFit(_enabled, _count) {
|
|
16
|
+
return NATIVE_RESULT;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=useStepperLabelFit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NATIVE_RESULT","fit","measureRef","undefined","useStepperLabelFit","_enabled","_count"],"sourceRoot":"../../../../src","sources":["components/Stepper/useStepperLabelFit.ts"],"mappings":";;AAGA;AACA;AACA;AACA;AACA;;AAQA,MAAMA,aAAoC,GAAG;EAAEC,GAAG,EAAE,QAAQ;EAAEC,UAAU,EAAEC;AAAU,CAAC;;AAErF;AACA,OAAO,SAASC,kBAAkBA,CAACC,QAAiB,EAAEC,MAAc,EAAyB;EAC3F,OAAON,aAAa;AACtB","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useLayoutEffect, useState } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* CSS flex cannot keep min-content minimums only while they fit: `min-width: auto` overflows a
|
|
6
|
+
* tight row and `min-width: 0` breaks words even when there is room. So labels start at
|
|
7
|
+
* `'words'`, and if the root then overflows they switch to `'shrink'` before paint. The decision
|
|
8
|
+
* is kept until the root's width or the step count changes.
|
|
9
|
+
*/
|
|
10
|
+
export function useStepperLabelFit(enabled, count) {
|
|
11
|
+
const [node, setNode] = useState(null);
|
|
12
|
+
const [width, setWidth] = useState(0);
|
|
13
|
+
const [decision, setDecision] = useState(null);
|
|
14
|
+
const key = `${String(width)}:${String(count)}`;
|
|
15
|
+
const fit = decision?.key === key ? decision.fit : 'words';
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (!enabled || node === null || typeof ResizeObserver === 'undefined') {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
const observer = new ResizeObserver(() => {
|
|
21
|
+
setWidth(node.clientWidth);
|
|
22
|
+
});
|
|
23
|
+
observer.observe(node);
|
|
24
|
+
return () => observer.disconnect();
|
|
25
|
+
}, [enabled, node]);
|
|
26
|
+
|
|
27
|
+
// No deps: label text can change without resizing the root, and the measurement is cheap.
|
|
28
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
|
+
useLayoutEffect(() => {
|
|
30
|
+
if (!enabled || node === null || fit !== 'words') {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (node.scrollWidth > node.clientWidth + 1) {
|
|
34
|
+
setDecision({
|
|
35
|
+
key,
|
|
36
|
+
fit: 'shrink'
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const measureRef = useCallback(value => {
|
|
41
|
+
setNode(value);
|
|
42
|
+
}, []);
|
|
43
|
+
return {
|
|
44
|
+
fit: enabled ? fit : 'shrink',
|
|
45
|
+
measureRef: enabled ? measureRef : undefined
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=useStepperLabelFit.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useEffect","useLayoutEffect","useState","useStepperLabelFit","enabled","count","node","setNode","width","setWidth","decision","setDecision","key","String","fit","ResizeObserver","undefined","observer","clientWidth","observe","disconnect","scrollWidth","measureRef","value"],"sourceRoot":"../../../../src","sources":["components/Stepper/useStepperLabelFit.web.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,eAAe,EAAEC,QAAQ,QAA0B,OAAO;AAW3F;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAACC,OAAgB,EAAEC,KAAa,EAAyB;EACzF,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGL,QAAQ,CAAqB,IAAI,CAAC;EAC1D,MAAM,CAACM,KAAK,EAAEC,QAAQ,CAAC,GAAGP,QAAQ,CAAC,CAAC,CAAC;EACrC,MAAM,CAACQ,QAAQ,EAAEC,WAAW,CAAC,GAAGT,QAAQ,CAAqB,IAAI,CAAC;EAElE,MAAMU,GAAG,GAAG,GAAGC,MAAM,CAACL,KAAK,CAAC,IAAIK,MAAM,CAACR,KAAK,CAAC,EAAE;EAC/C,MAAMS,GAAoB,GAAGJ,QAAQ,EAAEE,GAAG,KAAKA,GAAG,GAAGF,QAAQ,CAACI,GAAG,GAAG,OAAO;EAE3Ed,SAAS,CAAC,MAAM;IACd,IAAI,CAACI,OAAO,IAAIE,IAAI,KAAK,IAAI,IAAI,OAAOS,cAAc,KAAK,WAAW,EAAE;MACtE,OAAOC,SAAS;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