@cdx-ui/components 0.3.4 → 0.3.6
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 +9 -1
- package/docs/components/line-chart/content.md +567 -0
- package/docs/components/pie-chart/content.md +493 -0
- package/docs/components/progress-segmented/content.md +1 -1
- package/docs/components/select/content.md +144 -2
- package/docs/components/stepper/content.md +599 -0
- package/docs/components/system-alert/content.md +533 -0
- package/docs/foundations/expressions/icons/content.md +1 -1
- package/docs/foundations/styles/tokens/all-tokens/content.md +2 -1
- package/docs/llms.txt +10 -0
- package/docs/patterns/content.md +1 -0
- package/docs/patterns/dashboard/content.md +423 -19
- package/docs/patterns/insights/content.md +590 -0
- package/docs/resources/release-notes/0.3.4/content.md +27 -0
- package/docs/resources/release-notes/0.3.5/content.md +7 -0
- package/docs/resources/release-notes/content.md +2 -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 +942 -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/Chip/styles.js +3 -1
- package/lib/commonjs/components/Chip/styles.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 +747 -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/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/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/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 +60 -0
- package/lib/commonjs/components/index.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 +48 -0
- package/lib/commonjs/figma/SystemAlert.figma.js.map +1 -0
- 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 +936 -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/Chip/styles.js +3 -1
- package/lib/module/components/Chip/styles.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 +741 -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/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/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/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 +5 -0
- package/lib/module/components/index.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 +42 -0
- package/lib/module/figma/SystemAlert.figma.js.map +1 -0
- 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/Chip/styles.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/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/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/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 +5 -0
- package/lib/typescript/components/index.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 +1424 -0
- package/src/components/BarChart/styles.ts +31 -0
- package/src/components/Button/index.tsx +1 -1
- package/src/components/Chip/styles.ts +3 -1
- package/src/components/LineChart/geometry.ts +957 -0
- package/src/components/LineChart/index.tsx +1109 -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/ProgressCircle/ProgressCircleRing.tsx +10 -39
- package/src/components/ProgressCircle/ProgressRing.tsx +60 -0
- package/src/components/ScrollShadow/useScrollShadow.ts +12 -11
- 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/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 +5 -0
|
@@ -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,CAC9BC,WAA+B,EAC/BC,cAAqC,EACtB;EACf,IAAID,WAAW,KAAK,UAAU,EAAE;IAC9B,OAAO,UAAU;EACnB;EACA,OAAOC,cAAc,KAAK,QAAQ,GAAG,mBAAmB,GAAG,gBAAgB;AAC7E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,M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ACA;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;IAClB;IACA,MAAMC,QAAQ,GAAG,IAAIF,cAAc,CAAC,MAAM;MACxCN,QAAQ,CAACH,IAAI,CAACY,WAAW,CAAC;IAC5B,CAAC,CAAC;IACFD,QAAQ,CAACE,OAAO,CAACb,IAAI,CAAC;IACtB,OAAO,MAAMW,QAAQ,CAACG,UAAU,CAAC,CAAC;EACpC,CAAC,EAAE,CAAChB,OAAO,EAAEE,IAAI,CAAC,CAAC;;EAEnB;EACA;EACAL,eAAe,CAAC,MAAM;IACpB,IAAI,CAACG,OAAO,IAAIE,IAAI,KAAK,IAAI,IAAIQ,GAAG,KAAK,OAAO,EAAE;MAChD;IACF;IACA,IAAIR,IAAI,CAACe,WAAW,GAAGf,IAAI,CAACY,WAAW,GAAG,CAAC,EAAE;MAC3CP,WAAW,CAAC;QAAEC,GAAG;QAAEE,GAAG,EAAE;MAAS,CAAC,CAAC;IACrC;EACF,CAAC,CAAC;EAEF,MAAMQ,UAAU,GAAGvB,WAAW,CAAqBwB,KAAK,IAAK;IAC3DhB,OAAO,CAACgB,KAAsC,CAAC;EACjD,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IAAET,GAAG,EAAEV,OAAO,GAAGU,GAAG,GAAG,QAAQ;IAAEQ,UAAU,EAAElB,OAAO,GAAGkB,UAAU,GAAGN;EAAU,CAAC;AACxF","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useCSSVariable } from 'uniwind';
|
|
4
|
+
|
|
5
|
+
/** Light-theme fallbacks when Uniwind CSS context is unavailable (e.g. Jest). */
|
|
6
|
+
const FALLBACKS = {
|
|
7
|
+
track: '#e9e9e9',
|
|
8
|
+
brand: '#346099',
|
|
9
|
+
neutral: '#616263'
|
|
10
|
+
};
|
|
11
|
+
function toColor(value, fallback) {
|
|
12
|
+
if (typeof value === 'string' && value.length > 0) {
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
return fallback;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Ring stroke colors for `Stepper.Indicator`: brand on the current step, neutral otherwise. */
|
|
19
|
+
export function useStepperRingColors(isCurrent) {
|
|
20
|
+
const trackToken = useCSSVariable('--color-stroke-secondary');
|
|
21
|
+
const brandToken = useCSSVariable('--color-surface-brand-strong');
|
|
22
|
+
const neutralToken = useCSSVariable('--color-surface-neutral-strong');
|
|
23
|
+
return {
|
|
24
|
+
track: toColor(trackToken, FALLBACKS.track),
|
|
25
|
+
indicator: isCurrent ? toColor(brandToken, FALLBACKS.brand) : toColor(neutralToken, FALLBACKS.neutral)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=useStepperRingColors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCSSVariable","FALLBACKS","track","brand","neutral","toColor","value","fallback","length","useStepperRingColors","isCurrent","trackToken","brandToken","neutralToken","indicator"],"sourceRoot":"../../../../src","sources":["components/Stepper/useStepperRingColors.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,SAAS;;AAExC;AACA,MAAMC,SAAS,GAAG;EAChBC,KAAK,EAAE,SAAS;EAChBC,KAAK,EAAE,SAAS;EAChBC,OAAO,EAAE;AACX,CAAU;AAEV,SAASC,OAAOA,CAACC,KAAkC,EAAEC,QAAgB,EAAU;EAC7E,IAAI,OAAOD,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACE,MAAM,GAAG,CAAC,EAAE;IACjD,OAAOF,KAAK;EACd;EACA,OAAOC,QAAQ;AACjB;;AAEA;AACA,OAAO,SAASE,oBAAoBA,CAACC,SAAkB,EAAE;EACvD,MAAMC,UAAU,GAAGX,cAAc,CAAC,0BAA0B,CAAC;EAC7D,MAAMY,UAAU,GAAGZ,cAAc,CAAC,8BAA8B,CAAC;EACjE,MAAMa,YAAY,GAAGb,cAAc,CAAC,gCAAgC,CAAC;EAErE,OAAO;IACLE,KAAK,EAAEG,OAAO,CAACM,UAAU,EAAEV,SAAS,CAACC,KAAK,CAAC;IAC3CY,SAAS,EAAEJ,SAAS,GAChBL,OAAO,CAACO,UAAU,EAAEX,SAAS,CAACE,KAAK,CAAC,GACpCE,OAAO,CAACQ,YAAY,EAAEZ,SAAS,CAACG,OAAO;EAC7C,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
4
|
+
import { Platform, useWindowDimensions } from 'react-native';
|
|
5
|
+
import { Easing, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
6
|
+
import { scheduleOnRN } from 'react-native-worklets';
|
|
7
|
+
import { useCombinedAnimationDisabledState } from '../../animation';
|
|
8
|
+
|
|
9
|
+
// No motion spec exists for SystemAlert; these mirror FullScreenDialog's surface motion.
|
|
10
|
+
export const SYSTEM_ALERT_ENTER_MS = 300;
|
|
11
|
+
export const SYSTEM_ALERT_EXIT_MS = 220;
|
|
12
|
+
/** Unmounts an exiting web surface when `transitionend` never fires (reduced motion, hidden tab). */
|
|
13
|
+
export const SYSTEM_ALERT_WEB_SAFETY_MS = SYSTEM_ALERT_EXIT_MS + 100;
|
|
14
|
+
const ENTER_TIMING = {
|
|
15
|
+
duration: SYSTEM_ALERT_ENTER_MS,
|
|
16
|
+
easing: Easing.bezier(0.32, 0.72, 0, 1)
|
|
17
|
+
};
|
|
18
|
+
const EXIT_TIMING = {
|
|
19
|
+
duration: SYSTEM_ALERT_EXIT_MS,
|
|
20
|
+
easing: Easing.bezier(0.4, 0, 1, 1)
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* `entering` and `exiting` exist only while motion runs. With motion off, `isOpen`
|
|
25
|
+
* moves straight between `open` and `closed`.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/** Web `data-state`. `exiting` maps to `closed`, as in Dialog and FullScreenDialog. */
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Presence lifecycle and contact-push motion for an in-flow SystemAlert. One value, the
|
|
32
|
+
* surface's bottom edge `b`, is driven; the wrapper's height is `max(collapsedHeight, b)`,
|
|
33
|
+
* so content below only moves once the surface leaves the reserved strip.
|
|
34
|
+
*
|
|
35
|
+
* Web runs the same lifecycle on CSS transitions keyed on `data-state` instead of Reanimated:
|
|
36
|
+
* `entering` → (rAF) → `open`, and `closed` → `transitionend` on the wrapper's `height`, or a
|
|
37
|
+
* safety timer → unmount. The inset is 0 there, so the wrapper's height is `b`, and the surface,
|
|
38
|
+
* aligned to the wrapper's bottom edge, follows the same transition.
|
|
39
|
+
*/
|
|
40
|
+
export function useSystemAlertPresence({
|
|
41
|
+
isOpen,
|
|
42
|
+
animation,
|
|
43
|
+
collapsedHeight
|
|
44
|
+
}) {
|
|
45
|
+
const isWeb = Platform.OS === 'web';
|
|
46
|
+
const isAllAnimationsDisabled = useCombinedAnimationDisabledState(animation);
|
|
47
|
+
const hasMotion = !isAllAnimationsDisabled;
|
|
48
|
+
const [phase, setPhase] = useState(isOpen ? 'open' : 'closed');
|
|
49
|
+
const [prevIsOpen, setPrevIsOpen] = useState(isOpen);
|
|
50
|
+
if (isOpen !== prevIsOpen) {
|
|
51
|
+
setPrevIsOpen(isOpen);
|
|
52
|
+
if (isOpen) {
|
|
53
|
+
setPhase(hasMotion ? 'entering' : 'open');
|
|
54
|
+
} else {
|
|
55
|
+
setPhase(hasMotion ? 'exiting' : 'closed');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const edge = useSharedValue(0);
|
|
59
|
+
const surfaceHeight = useSharedValue(0);
|
|
60
|
+
const isSettled = useSharedValue(isOpen);
|
|
61
|
+
const [webSurfaceHeight, setWebSurfaceHeight] = useState(0);
|
|
62
|
+
const wrapperRef = useRef(null);
|
|
63
|
+
|
|
64
|
+
// Read by the surface's layout callbacks, which run before this hook's own effects.
|
|
65
|
+
const phaseRef = useRef(phase);
|
|
66
|
+
phaseRef.current = phase;
|
|
67
|
+
// The JS-side copy of `surfaceHeight`. A shared value read on the JS thread right after a
|
|
68
|
+
// JS write can still return the old value, which would start the first enter toward 0.
|
|
69
|
+
const surfaceHeightRef = useRef(0);
|
|
70
|
+
const settle = useCallback((from, to) => {
|
|
71
|
+
setPhase(current => current === from ? to : current);
|
|
72
|
+
}, []);
|
|
73
|
+
|
|
74
|
+
// `withTiming` starts from the current edge, so a reversal continues from where it is.
|
|
75
|
+
const startEnter = useCallback(() => {
|
|
76
|
+
edge.set(withTiming(surfaceHeightRef.current, ENTER_TIMING, finished => {
|
|
77
|
+
'worklet';
|
|
78
|
+
|
|
79
|
+
if (finished) scheduleOnRN(settle, 'entering', 'open');
|
|
80
|
+
}));
|
|
81
|
+
}, [edge, settle]);
|
|
82
|
+
const setSurfaceHeight = useCallback(height => {
|
|
83
|
+
if (height <= 0) return;
|
|
84
|
+
if (isWeb) {
|
|
85
|
+
setWebSurfaceHeight(height);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (height === surfaceHeightRef.current) return;
|
|
89
|
+
surfaceHeightRef.current = height;
|
|
90
|
+
surfaceHeight.set(height);
|
|
91
|
+
if (phaseRef.current === 'open') {
|
|
92
|
+
edge.set(height);
|
|
93
|
+
} else if (phaseRef.current === 'entering') {
|
|
94
|
+
startEnter();
|
|
95
|
+
}
|
|
96
|
+
}, [isWeb, edge, surfaceHeight, startEnter]);
|
|
97
|
+
|
|
98
|
+
// A layout effect so the surface's synchronous measurement (a child effect) has already
|
|
99
|
+
// run and the first animated frame targets the measured height. Without one, `onLayout`
|
|
100
|
+
// starts the enter through `setSurfaceHeight`.
|
|
101
|
+
useLayoutEffect(() => {
|
|
102
|
+
if (isWeb) return;
|
|
103
|
+
switch (phase) {
|
|
104
|
+
case 'open':
|
|
105
|
+
edge.set(surfaceHeightRef.current);
|
|
106
|
+
isSettled.set(true);
|
|
107
|
+
break;
|
|
108
|
+
case 'closed':
|
|
109
|
+
isSettled.set(false);
|
|
110
|
+
edge.set(0);
|
|
111
|
+
break;
|
|
112
|
+
case 'entering':
|
|
113
|
+
isSettled.set(false);
|
|
114
|
+
if (surfaceHeightRef.current > 0) startEnter();
|
|
115
|
+
break;
|
|
116
|
+
case 'exiting':
|
|
117
|
+
isSettled.set(false);
|
|
118
|
+
edge.set(withTiming(0, EXIT_TIMING, finished => {
|
|
119
|
+
'worklet';
|
|
120
|
+
|
|
121
|
+
if (finished) scheduleOnRN(settle, 'exiting', 'closed');
|
|
122
|
+
}));
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}, [isWeb, phase, edge, isSettled, startEnter, settle]);
|
|
126
|
+
|
|
127
|
+
// One frame at `entering` (height 0, surface above the clip) so the browser has a start
|
|
128
|
+
// value to transition from.
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
if (!isWeb || phase !== 'entering') return;
|
|
131
|
+
const frame = requestAnimationFrame(() => {
|
|
132
|
+
settle('entering', 'open');
|
|
133
|
+
});
|
|
134
|
+
return () => cancelAnimationFrame(frame);
|
|
135
|
+
}, [isWeb, phase, settle]);
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
if (!isWeb || phase !== 'exiting') return;
|
|
138
|
+
const node = wrapperRef.current;
|
|
139
|
+
const finish = () => {
|
|
140
|
+
settle('exiting', 'closed');
|
|
141
|
+
};
|
|
142
|
+
const safetyTimer = setTimeout(finish, SYSTEM_ALERT_WEB_SAFETY_MS);
|
|
143
|
+
if (typeof node?.addEventListener !== 'function') {
|
|
144
|
+
return () => clearTimeout(safetyTimer);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// The surface's own `transform` transition bubbles here too.
|
|
148
|
+
const handleTransitionEnd = event => {
|
|
149
|
+
if (event.target !== node) return;
|
|
150
|
+
if (event.propertyName === 'height') finish();
|
|
151
|
+
};
|
|
152
|
+
node.addEventListener('transitionend', handleTransitionEnd);
|
|
153
|
+
return () => {
|
|
154
|
+
clearTimeout(safetyTimer);
|
|
155
|
+
node.removeEventListener('transitionend', handleTransitionEnd);
|
|
156
|
+
};
|
|
157
|
+
}, [isWeb, phase, settle]);
|
|
158
|
+
|
|
159
|
+
// CSS cannot transition to `auto`, so a moving wrapper gets the measured px height.
|
|
160
|
+
// Before the first measurement (or with motion off) it sizes to its content; `auto` → px
|
|
161
|
+
// does not transition, so a banner shown on first render does not animate.
|
|
162
|
+
let webWrapperHeight;
|
|
163
|
+
if (isWeb && hasMotion) {
|
|
164
|
+
webWrapperHeight = phase === 'open' ? webSurfaceHeight || undefined : 0;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Explicit deps for Vite/web without the Reanimated Babel plugin.
|
|
168
|
+
const wrapperStyle = useAnimatedStyle(() => ({
|
|
169
|
+
height: isSettled.get() ? 'auto' : Math.max(collapsedHeight, edge.get())
|
|
170
|
+
}), [isSettled, edge, collapsedHeight]);
|
|
171
|
+
return {
|
|
172
|
+
phase,
|
|
173
|
+
isSurfaceMounted: phase !== 'closed',
|
|
174
|
+
wrapperStyle,
|
|
175
|
+
setSurfaceHeight,
|
|
176
|
+
edge,
|
|
177
|
+
surfaceHeight,
|
|
178
|
+
isSettled,
|
|
179
|
+
webState: isWeb ? phase === 'exiting' ? 'closed' : phase : undefined,
|
|
180
|
+
webWrapperHeight,
|
|
181
|
+
wrapperRef
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* The surface's slide, `translateY = b − H`. Call it from a component that mounts with the
|
|
187
|
+
* surface: Reanimated computes the initial style once, on the hook's first render.
|
|
188
|
+
*/
|
|
189
|
+
export function useSystemAlertSurfaceStyle({
|
|
190
|
+
edge,
|
|
191
|
+
surfaceHeight,
|
|
192
|
+
isSettled
|
|
193
|
+
}) {
|
|
194
|
+
const {
|
|
195
|
+
height: windowHeight
|
|
196
|
+
} = useWindowDimensions();
|
|
197
|
+
|
|
198
|
+
// Explicit deps for Vite/web without the Reanimated Babel plugin.
|
|
199
|
+
return useAnimatedStyle(() => {
|
|
200
|
+
const height = surfaceHeight.get();
|
|
201
|
+
let translateY = 0;
|
|
202
|
+
if (!isSettled.get()) {
|
|
203
|
+
// Before the first measurement, park the surface above the clip.
|
|
204
|
+
translateY = height > 0 ? edge.get() - height : -windowHeight;
|
|
205
|
+
}
|
|
206
|
+
return {
|
|
207
|
+
transform: [{
|
|
208
|
+
translateY
|
|
209
|
+
}]
|
|
210
|
+
};
|
|
211
|
+
}, [edge, surfaceHeight, isSettled, windowHeight]);
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=animation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useEffect","useLayoutEffect","useRef","useState","Platform","useWindowDimensions","Easing","useAnimatedStyle","useSharedValue","withTiming","scheduleOnRN","useCombinedAnimationDisabledState","SYSTEM_ALERT_ENTER_MS","SYSTEM_ALERT_EXIT_MS","SYSTEM_ALERT_WEB_SAFETY_MS","ENTER_TIMING","duration","easing","bezier","EXIT_TIMING","useSystemAlertPresence","isOpen","animation","collapsedHeight","isWeb","OS","isAllAnimationsDisabled","hasMotion","phase","setPhase","prevIsOpen","setPrevIsOpen","edge","surfaceHeight","isSettled","webSurfaceHeight","setWebSurfaceHeight","wrapperRef","phaseRef","current","surfaceHeightRef","settle","from","to","startEnter","set","finished","setSurfaceHeight","height","frame","requestAnimationFrame","cancelAnimationFrame","node","finish","safetyTimer","setTimeout","addEventListener","clearTimeout","handleTransitionEnd","event","target","propertyName","removeEventListener","webWrapperHeight","undefined","wrapperStyle","get","Math","max","isSurfaceMounted","webState","useSystemAlertSurfaceStyle","windowHeight","translateY","transform"],"sourceRoot":"../../../../src","sources":["components/SystemAlert/animation.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,eAAe,EAAEC,MAAM,EAAEC,QAAQ,QAAwB,OAAO;AACjG,SAASC,QAAQ,EAAEC,mBAAmB,QAAmB,cAAc;AACvE,SACEC,MAAM,EACNC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,QAEL,yBAAyB;AAChC,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,iCAAiC,QAAsC,iBAAiB;;AAEjG;AACA,OAAO,MAAMC,qBAAqB,GAAG,GAAG;AACxC,OAAO,MAAMC,oBAAoB,GAAG,GAAG;AAC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