@draftbit/core 43.4.19 → 43.4.20-dec262.0
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/lib/commonjs/components/Banner.js +182 -0
- package/lib/commonjs/components/Banner.js.map +1 -0
- package/lib/commonjs/components/DeprecatedCardWrapper.js +14 -2
- package/lib/commonjs/components/DeprecatedCardWrapper.js.map +1 -1
- package/lib/commonjs/components/DeprecatedFAB.js +20 -4
- package/lib/commonjs/components/DeprecatedFAB.js.map +1 -1
- package/lib/commonjs/components/Divider.js +3 -13
- package/lib/commonjs/components/Divider.js.map +1 -1
- package/lib/commonjs/components/Elevation.js +3 -14
- package/lib/commonjs/components/Elevation.js.map +1 -1
- package/lib/commonjs/index.js +8 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/Banner.js +39 -0
- package/lib/commonjs/mappings/Banner.js.map +1 -0
- package/lib/commonjs/mappings/RowHeadlineImageCaption.js.map +1 -1
- package/lib/module/components/Banner.js +159 -0
- package/lib/module/components/Banner.js.map +1 -0
- package/lib/module/components/StepIndicator.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mappings/Banner.js +30 -0
- package/lib/module/mappings/Banner.js.map +1 -0
- package/lib/typescript/src/components/Banner.d.ts +22 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/mappings/Banner.d.ts +48 -0
- package/package.json +2 -2
- package/src/components/Banner.js +109 -0
- package/src/components/Banner.tsx +204 -0
- package/src/index.js +1 -0
- package/src/index.tsx +1 -0
- package/src/mappings/Banner.js +29 -0
- package/src/mappings/Banner.ts +37 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Button, Text, View, StyleSheet, Animated } from "react-native";
|
|
5
|
+
import Surface from "./Surface";
|
|
6
|
+
import shadow from "../styles/shadow";
|
|
7
|
+
import { withTheme } from "../theming";
|
|
8
|
+
const ELEVATION = 1;
|
|
9
|
+
const DEFAULT_MAX_WIDTH = 960;
|
|
10
|
+
|
|
11
|
+
const Banner = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
initiallyVisible,
|
|
14
|
+
icon,
|
|
15
|
+
buttonColor,
|
|
16
|
+
content,
|
|
17
|
+
contentStyle,
|
|
18
|
+
dismissable,
|
|
19
|
+
style,
|
|
20
|
+
theme,
|
|
21
|
+
Icon,
|
|
22
|
+
...rest
|
|
23
|
+
} = _ref;
|
|
24
|
+
const [visible, setVisible] = React.useState(initiallyVisible);
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
if (initiallyVisible) {
|
|
27
|
+
setVisible(true);
|
|
28
|
+
}
|
|
29
|
+
}, [initiallyVisible]);
|
|
30
|
+
const {
|
|
31
|
+
current: position
|
|
32
|
+
} = React.useRef(new Animated.Value(visible ? 1 : 0));
|
|
33
|
+
const [layout, setLayout] = React.useState({
|
|
34
|
+
height: 0,
|
|
35
|
+
measured: false
|
|
36
|
+
});
|
|
37
|
+
React.useEffect(() => {
|
|
38
|
+
if (visible) {
|
|
39
|
+
// show
|
|
40
|
+
Animated.timing(position, {
|
|
41
|
+
duration: 250,
|
|
42
|
+
toValue: 1,
|
|
43
|
+
useNativeDriver: false
|
|
44
|
+
}).start();
|
|
45
|
+
} else {
|
|
46
|
+
// hide
|
|
47
|
+
Animated.timing(position, {
|
|
48
|
+
duration: 200,
|
|
49
|
+
toValue: 0,
|
|
50
|
+
useNativeDriver: false
|
|
51
|
+
}).start();
|
|
52
|
+
}
|
|
53
|
+
}, [visible, position]);
|
|
54
|
+
|
|
55
|
+
const handleLayout = _ref2 => {
|
|
56
|
+
let {
|
|
57
|
+
nativeEvent
|
|
58
|
+
} = _ref2;
|
|
59
|
+
const {
|
|
60
|
+
height
|
|
61
|
+
} = nativeEvent.layout;
|
|
62
|
+
setLayout({
|
|
63
|
+
height,
|
|
64
|
+
measured: true
|
|
65
|
+
});
|
|
66
|
+
}; // The banner animation has 2 parts:
|
|
67
|
+
// 1. Blank spacer element which animates its height to move the content
|
|
68
|
+
// 2. Actual banner which animates its translateY
|
|
69
|
+
// In initial render, we position everything normally and measure the height of the banner
|
|
70
|
+
// Once we have the height, we apply the height to the spacer and switch the banner to position: absolute
|
|
71
|
+
// We need this because we need to move the content below as if banner's height was being animated
|
|
72
|
+
// However we can't animated banner's height directly as it'll also resize the content inside
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
const height = Animated.multiply(position, layout.height);
|
|
76
|
+
const translateY = Animated.multiply(Animated.add(position, -1), layout.height);
|
|
77
|
+
return /*#__PURE__*/React.createElement(Surface, _extends({}, rest, {
|
|
78
|
+
style: [styles.container, shadow(ELEVATION), style]
|
|
79
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
80
|
+
style: [styles.wrapper, contentStyle]
|
|
81
|
+
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
82
|
+
style: {
|
|
83
|
+
height
|
|
84
|
+
}
|
|
85
|
+
}), /*#__PURE__*/React.createElement(Animated.View, {
|
|
86
|
+
onLayout: handleLayout,
|
|
87
|
+
style: [layout.measured || !visible ? // If we have measured banner's height or it's invisible,
|
|
88
|
+
// Position it absolutely, the layout will be taken care of the spacer
|
|
89
|
+
[styles.absolute, {
|
|
90
|
+
transform: [{
|
|
91
|
+
translateY
|
|
92
|
+
}]
|
|
93
|
+
}] : // Otherwise position it normally
|
|
94
|
+
null, !layout.measured && !visible ? // If we haven't measured banner's height yet and it's invisible,
|
|
95
|
+
// hide it with opacity: 0 so user doesn't see it
|
|
96
|
+
{
|
|
97
|
+
opacity: 0
|
|
98
|
+
} : null]
|
|
99
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
100
|
+
style: [styles.content, {
|
|
101
|
+
marginBottom: dismissable ? 0 : 16
|
|
102
|
+
}]
|
|
103
|
+
}, icon ? /*#__PURE__*/React.createElement(View, {
|
|
104
|
+
style: styles.icon
|
|
105
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
106
|
+
name: icon,
|
|
107
|
+
size: 40
|
|
108
|
+
})) : null, /*#__PURE__*/React.createElement(Text, {
|
|
109
|
+
style: [styles.message, {
|
|
110
|
+
color: theme.colors.text
|
|
111
|
+
}],
|
|
112
|
+
accessibilityLiveRegion: visible ? "polite" : "none",
|
|
113
|
+
accessibilityRole: "alert"
|
|
114
|
+
}, content)), dismissable ? /*#__PURE__*/React.createElement(View, {
|
|
115
|
+
style: styles.actions
|
|
116
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
117
|
+
color: buttonColor || theme.colors.primary,
|
|
118
|
+
title: "Close",
|
|
119
|
+
onPress: () => setVisible(false)
|
|
120
|
+
})) : null)));
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const styles = StyleSheet.create({
|
|
124
|
+
container: {
|
|
125
|
+
elevation: ELEVATION
|
|
126
|
+
},
|
|
127
|
+
wrapper: {
|
|
128
|
+
overflow: "hidden",
|
|
129
|
+
alignSelf: "center",
|
|
130
|
+
width: "100%",
|
|
131
|
+
maxWidth: DEFAULT_MAX_WIDTH
|
|
132
|
+
},
|
|
133
|
+
absolute: {
|
|
134
|
+
position: "absolute",
|
|
135
|
+
top: 0,
|
|
136
|
+
width: "100%"
|
|
137
|
+
},
|
|
138
|
+
content: {
|
|
139
|
+
flexDirection: "row",
|
|
140
|
+
justifyContent: "flex-start",
|
|
141
|
+
marginHorizontal: 8,
|
|
142
|
+
marginTop: 16,
|
|
143
|
+
marginBottom: 0
|
|
144
|
+
},
|
|
145
|
+
icon: {
|
|
146
|
+
margin: 8
|
|
147
|
+
},
|
|
148
|
+
message: {
|
|
149
|
+
flex: 1,
|
|
150
|
+
margin: 8
|
|
151
|
+
},
|
|
152
|
+
actions: {
|
|
153
|
+
flexDirection: "row",
|
|
154
|
+
justifyContent: "flex-end",
|
|
155
|
+
margin: 8
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
export default withTheme(Banner);
|
|
159
|
+
//# sourceMappingURL=Banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Banner.tsx"],"names":["React","Button","Text","View","StyleSheet","Animated","Surface","shadow","withTheme","ELEVATION","DEFAULT_MAX_WIDTH","Banner","initiallyVisible","icon","buttonColor","content","contentStyle","dismissable","style","theme","Icon","rest","visible","setVisible","useState","useEffect","current","position","useRef","Value","layout","setLayout","height","measured","timing","duration","toValue","useNativeDriver","start","handleLayout","nativeEvent","multiply","translateY","add","styles","container","wrapper","absolute","transform","opacity","marginBottom","message","color","colors","text","actions","primary","create","elevation","overflow","alignSelf","width","maxWidth","top","flexDirection","justifyContent","marginHorizontal","marginTop","margin","flex"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SACEC,MADF,EAEEC,IAFF,EAGEC,IAHF,EAKEC,UALF,EAOEC,QAPF,QAQO,cARP;AASA,OAAOC,OAAP,MAAoB,WAApB;AAEA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,SAASC,SAAT,QAA0B,YAA1B;AAGA,MAAMC,SAAS,GAAG,CAAlB;AACA,MAAMC,iBAAiB,GAAG,GAA1B;;AA4BA,MAAMC,MAAuB,GAAG,QAW1B;AAAA,MAX2B;AAC/BC,IAAAA,gBAD+B;AAE/BC,IAAAA,IAF+B;AAG/BC,IAAAA,WAH+B;AAI/BC,IAAAA,OAJ+B;AAK/BC,IAAAA,YAL+B;AAM/BC,IAAAA,WAN+B;AAO/BC,IAAAA,KAP+B;AAQ/BC,IAAAA,KAR+B;AAS/BC,IAAAA,IAT+B;AAU/B,OAAGC;AAV4B,GAW3B;AACJ,QAAM,CAACC,OAAD,EAAUC,UAAV,IAAwBvB,KAAK,CAACwB,QAAN,CA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YAFT;AAGPC,IAAAA,gBAAgB,EAAE,CAHX;AAIPC,IAAAA,SAAS,EAAE,EAJJ;AAKPjB,IAAAA,YAAY,EAAE;AALP,GAfsB;AAsB/BrC,EAAAA,IAAI,EAAE;AACJuD,IAAAA,MAAM,EAAE;AADJ,GAtByB;AAyB/BjB,EAAAA,OAAO,EAAE;AACPkB,IAAAA,IAAI,EAAE,CADC;AAEPD,IAAAA,MAAM,EAAE;AAFD,GAzBsB;AA6B/Bb,EAAAA,OAAO,EAAE;AACPS,IAAAA,aAAa,EAAE,KADR;AAEPC,IAAAA,cAAc,EAAE,UAFT;AAGPG,IAAAA,MAAM,EAAE;AAHD;AA7BsB,CAAlB,CAAf;AAoCA,eAAe5D,SAAS,CAACG,MAAD,CAAxB","sourcesContent":["import * as React from \"react\";\nimport {\n Button,\n Text,\n View,\n ViewStyle,\n StyleSheet,\n StyleProp,\n Animated,\n} from \"react-native\";\nimport Surface from \"./Surface\";\nimport type { IconSlot } from \"../interfaces/Icon\";\nimport shadow from \"../styles/shadow\";\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\n\nconst ELEVATION = 1;\nconst DEFAULT_MAX_WIDTH = 960;\n\ntype Props = {\n initiallyVisible: boolean;\n dismissable: boolean;\n buttonColor?: string;\n icon?: string;\n content: string;\n contentStyle?: StyleProp<ViewStyle>;\n style?: StyleProp<ViewStyle>;\n ref?: React.RefObject<View>;\n /**\n * @optional\n */\n theme: Theme;\n} & IconSlot;\n\ntype NativeEvent = {\n nativeEvent: {\n layout: {\n x: number;\n y: number;\n width: number;\n height: number;\n };\n };\n};\n\nconst Banner: React.FC<Props> = ({\n initiallyVisible,\n icon,\n buttonColor,\n content,\n contentStyle,\n dismissable,\n style,\n theme,\n Icon,\n ...rest\n}) => {\n const [visible, setVisible] = React.useState(initiallyVisible);\n\n React.useEffect(() => {\n if (initiallyVisible) {\n setVisible(true);\n }\n }, [initiallyVisible]);\n\n const { current: position } = React.useRef<Animated.Value>(\n new Animated.Value(visible ? 1 : 0)\n );\n const [layout, setLayout] = React.useState<{\n height: number;\n measured: boolean;\n }>({\n height: 0,\n measured: false,\n });\n\n React.useEffect(() => {\n if (visible) {\n // show\n Animated.timing(position, {\n duration: 250,\n toValue: 1,\n useNativeDriver: false,\n }).start();\n } else {\n // hide\n Animated.timing(position, {\n duration: 200,\n toValue: 0,\n useNativeDriver: false,\n }).start();\n }\n }, [visible, position]);\n\n const handleLayout = ({ nativeEvent }: NativeEvent) => {\n const { height } = nativeEvent.layout;\n setLayout({ height, measured: true });\n };\n\n // The banner animation has 2 parts:\n // 1. Blank spacer element which animates its height to move the content\n // 2. Actual banner which animates its translateY\n // In initial render, we position everything normally and measure the height of the banner\n // Once we have the height, we apply the height to the spacer and switch the banner to position: absolute\n // We need this because we need to move the content below as if banner's height was being animated\n // However we can't animated banner's height directly as it'll also resize the content inside\n const height = Animated.multiply(position, layout.height);\n\n const translateY = Animated.multiply(\n Animated.add(position, -1),\n layout.height\n );\n\n return (\n <Surface\n {...rest}\n style={[styles.container, shadow(ELEVATION) as ViewStyle, style]}\n >\n <View style={[styles.wrapper, contentStyle]}>\n <Animated.View style={{ height }} />\n <Animated.View\n onLayout={handleLayout}\n style={[\n layout.measured || !visible\n ? // If we have measured banner's height or it's invisible,\n // Position it absolutely, the layout will be taken care of the spacer\n [styles.absolute, { transform: [{ translateY }] }]\n : // Otherwise position it normally\n null,\n !layout.measured && !visible\n ? // If we haven't measured banner's height yet and it's invisible,\n // hide it with opacity: 0 so user doesn't see it\n { opacity: 0 }\n : null,\n ]}\n >\n <View\n style={[styles.content, { marginBottom: dismissable ? 0 : 16 }]}\n >\n {icon ? (\n <View style={styles.icon}>\n <Icon name={icon} size={40} />\n </View>\n ) : null}\n <Text\n style={[styles.message, { color: theme.colors.text }]}\n accessibilityLiveRegion={visible ? \"polite\" : \"none\"}\n accessibilityRole=\"alert\"\n >\n {content}\n </Text>\n </View>\n {dismissable ? (\n <View style={styles.actions}>\n <Button\n color={buttonColor || theme.colors.primary}\n title=\"Close\"\n onPress={() => setVisible(false)}\n />\n </View>\n ) : null}\n </Animated.View>\n </View>\n </Surface>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n elevation: ELEVATION,\n },\n wrapper: {\n overflow: \"hidden\",\n alignSelf: \"center\",\n width: \"100%\",\n maxWidth: DEFAULT_MAX_WIDTH,\n },\n absolute: {\n position: \"absolute\",\n top: 0,\n width: \"100%\",\n },\n content: {\n flexDirection: \"row\",\n justifyContent: \"flex-start\",\n marginHorizontal: 8,\n marginTop: 16,\n marginBottom: 0,\n },\n icon: {\n margin: 8,\n },\n message: {\n flex: 1,\n margin: 8,\n },\n actions: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n margin: 8,\n },\n});\n\nexport default withTheme(Banner);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["StepIndicator.tsx"],"names":["React","Component","View","Text","StyleSheet","Animated","TouchableWithoutFeedback","STEP_STATUS","CURRENT","FINISHED","UNFINISHED","StepIndicator","constructor","props","stepCount","direction","progressBarBackgroundStyle","backgroundColor","state","customStyles","separatorUnFinishedColor","position","left","width","separatorStrokeWidth","top","height","bottom","separatorStrokeUnfinishedWidth","right","event","setState","progressBarSize","nativeEvent","layout","onCurrentPositionChanged","currentPosition","progressBarStyle","separatorFinishedColor","separatorStrokeFinishedWidth","progressAnim","steps","push","stepPressed","styles","stepContainer","flexDirection","renderStep","stepIndicatorContainer","currentStepIndicatorSize","labels","renderLabel","labelViews","map","label","index","selectedStepLabelStyle","color","currentStepLabelColor","labelColor","stepLabelItem","stepStatus","getStepStatus","stepLabel","fontSize","labelSize","fontFamily","labelFontFamily","stepLabelsContainer","paddingHorizontal","paddingVertical","alignItems","labelAlign","renderStepIndicator","stepStyle","indicatorLabelStyle","stepIndicatorCurrentColor","borderWidth","currentStepStrokeWidth","borderColor","stepStrokeCurrentColor","sizeAnim","borderRadius","borderRadiusAnim","currentStepIndicatorLabelFontSize","stepIndicatorLabelCurrentColor","stepIndicatorFinishedColor","stepStrokeWidth","stepStrokeFinishedColor","stepIndicatorSize","stepIndicatorLabelFontSize","stepIndicatorLabelFinishedColor","stepIndicatorUnFinishedColor","stepStrokeUnFinishedColor","overflow","stepIndicatorLabelUnFinishedColor","step","stepPosition","animateToPosition","setValue","sequence","timing","toValue","duration","parallel","start","defaultStyles","Object","assign","Value","onPress","render","container","flex","renderProgressBarBackground","renderProgressBar","renderStepLabels","componentDidUpdate","prevProps","create","justifyContent","zIndex","textAlign","fontWeight","defaultProps"],"mappings":";;AAAA;AACA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SACEC,IADF,EAEEC,IAFF,EAGEC,UAHF,EAIEC,QAJF,EAKEC,wBALF,QAMO,cANP;AAQA,MAAMC,WAAW,GAAG;AAClBC,EAAAA,OAAO,EAAE,SADS;AAElBC,EAAAA,QAAQ,EAAE,UAFQ;AAGlBC,EAAAA,UAAU,EAAE;AAHM,CAApB;AA+CA,eAAe,MAAMC,aAAN,SAA4BV,SAA5B,CAAoD;AACjEW,EAAAA,WAAW,CAACC,KAAD,EAAe;AACxB,UAAMA,KAAN;;AADwB,yDAwFI,MAAM;AAClC,YAAM;AAAEC,QAAAA,SAAF;AAAaC,QAAAA;AAAb,UAA2B,KAAKF,KAAtC;AACA,UAAIG,0BAAJ;;AACA,UAAID,SAAS,KAAK,UAAlB,EAA8B;AAC5BC,QAAAA,0BAA0B,GAAG;AAC3BC,UAAAA,eAAe,EAAE,KAAKC,KAAL,CAAWC,YAAX,CAAwBC,wBADd;AAE3BC,UAAAA,QAAQ,EAAE,UAFiB;AAG3BC,UAAAA,IAAI,EACF,CAAC,KAAKJ,KAAL,CAAWK,KAAX,GAAmB,KAAKL,KAAL,CAAWC,YAAX,CAAwBK,oBAA5C,IAAoE,CAJ3C;AAK3BC,UAAAA,GAAG,EAAE,KAAKP,KAAL,CAAWQ,MAAX,IAAqB,IAAIZ,SAAzB,CALsB;AA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\n StyleSheet,\n Animated,\n TouchableWithoutFeedback,\n} from \"react-native\";\n\nconst STEP_STATUS = {\n CURRENT: \"current\",\n FINISHED: \"finished\",\n UNFINISHED: \"unfinished\",\n};\n\ninterface CustomStyles {\n stepIndicatorSize?: number;\n currentStepIndicatorSize?: number;\n separatorStrokeWidth?: number;\n separatorStrokeUnfinishedWidth?: number;\n separatorStrokeFinishedWidth?: number;\n currentStepStrokeWidth: number;\n stepStrokeWidth?: number;\n stepStrokeCurrentColor?: string;\n stepStrokeFinishedColor: string;\n stepStrokeUnFinishedColor: string;\n separatorFinishedColor: string;\n separatorUnFinishedColor: string;\n stepIndicatorFinishedColor: string;\n stepIndicatorUnFinishedColor: string;\n stepIndicatorCurrentColor: string;\n stepIndicatorLabelFontSize: number;\n currentStepIndicatorLabelFontSize?: number;\n stepIndicatorLabelCurrentColor: string;\n stepIndicatorLabelFinishedColor: string;\n stepIndicatorLabelUnFinishedColor: string;\n labelColor?: string;\n labelSize?: number;\n labelAlign?: string;\n currentStepLabelColor?: string;\n labelFontFamily?: string;\n}\n\ntype Props = {\n stepCount: number;\n currentPosition: number;\n customStyles: CustomStyles;\n};\n\ntype State = {\n width: number;\n height: number;\n progressBarSize: number;\n customStyles: CustomStyles;\n};\n\nexport default class StepIndicator extends Component<Props, State> {\n constructor(props: Props) {\n super(props);\n\n const defaultStyles = {\n stepIndicatorSize: 30,\n currentStepIndicatorSize: 40,\n separatorStrokeWidth: 3,\n separatorStrokeUnfinishedWidth: 0,\n separatorStrokeFinishedWidth: 0,\n currentStepStrokeWidth: 5,\n stepStrokeWidth: 0,\n stepStrokeCurrentColor: \"#4aae4f\",\n stepStrokeFinishedColor: \"#4aae4f\",\n stepStrokeUnFinishedColor: \"#4aae4f\",\n separatorFinishedColor: \"#4aae4f\",\n separatorUnFinishedColor: \"#a4d4a5\",\n stepIndicatorFinishedColor: \"#4aae4f\",\n stepIndicatorUnFinishedColor: \"#a4d4a5\",\n stepIndicatorCurrentColor: \"#ffffff\",\n stepIndicatorLabelFontSize: 15,\n currentStepIndicatorLabelFontSize: 15,\n stepIndicatorLabelCurrentColor: \"#000000\",\n stepIndicatorLabelFinishedColor: \"#ffffff\",\n stepIndicatorLabelUnFinishedColor: \"rgba(255,255,255,0.5)\",\n labelColor: \"#000000\",\n labelSize: 13,\n labelAlign: \"center\",\n currentStepLabelColor: \"#4aae4f\",\n };\n\n const customStyles = Object.assign(defaultStyles, props.customStyles);\n\n this.state = {\n width: 0,\n height: 1,\n progressBarSize: -2,\n customStyles,\n };\n\n this.progressAnim = new Animated.Value(0);\n this.sizeAnim = new Animated.Value(\n this.state.customStyles.stepIndicatorSize\n );\n this.borderRadiusAnim = new Animated.Value(\n this.state.customStyles.stepIndicatorSize / 2\n );\n }\n\n stepPressed(position) {\n if (this.props.onPress) {\n this.props.onPress(position);\n }\n }\n\n render() {\n const { labels, direction } = this.props;\n return (\n <View\n style={[\n styles.container,\n direction === \"vertical\"\n ? { flexDirection: \"row\", flex: 1 }\n : { flexDirection: \"column\" },\n ]}\n >\n {this.state.width !== 0 && this.renderProgressBarBackground()}\n {this.state.width !== 0 && this.renderProgressBar()}\n {this.renderStepIndicator()}\n {labels && this.renderStepLabels()}\n </View>\n );\n }\n\n componentDidUpdate(prevProps) {\n // if (prevProps.customStyles !== this.props.customStyles) {\n // this.setState((state) => ({\n // customStyles: Object.assign(\n // state.customStyles,\n // this.props.customStyles\n // ),\n // }));\n // }\n\n if (prevProps.currentPosition !== this.props.currentPosition) {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n }\n\n renderProgressBarBackground = () => {\n const { stepCount, direction } = this.props;\n let progressBarBackgroundStyle;\n if (direction === \"vertical\") {\n progressBarBackgroundStyle = {\n backgroundColor: this.state.customStyles.separatorUnFinishedColor,\n position: \"absolute\",\n left:\n (this.state.width - this.state.customStyles.separatorStrokeWidth) / 2,\n top: this.state.height / (2 * stepCount),\n bottom: this.state.height / (2 * stepCount),\n width:\n this.state.customStyles.separatorStrokeUnfinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeUnfinishedWidth,\n };\n } else {\n progressBarBackgroundStyle = {\n backgroundColor: this.state.customStyles.separatorUnFinishedColor,\n position: \"absolute\",\n top:\n (this.state.height - this.state.customStyles.separatorStrokeWidth) /\n 2,\n left: this.state.width / (2 * stepCount),\n right: this.state.width / (2 * stepCount),\n height:\n this.state.customStyles.separatorStrokeUnfinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeUnfinishedWidth,\n };\n }\n return (\n <View\n onLayout={(event) => {\n if (direction === \"vertical\") {\n this.setState(\n { progressBarSize: event.nativeEvent.layout.height },\n () => {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n );\n } else {\n this.setState(\n { progressBarSize: event.nativeEvent.layout.width },\n () => {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n );\n }\n }}\n style={progressBarBackgroundStyle}\n />\n );\n };\n\n renderProgressBar = () => {\n const { stepCount, direction } = this.props;\n let progressBarStyle;\n if (direction === \"vertical\") {\n progressBarStyle = {\n backgroundColor: this.state.customStyles.separatorFinishedColor,\n position: \"absolute\",\n left:\n (this.state.width - this.state.customStyles.separatorStrokeWidth) / 2,\n top: this.state.height / (2 * stepCount),\n bottom: this.state.height / (2 * stepCount),\n width:\n this.state.customStyles.separatorStrokeFinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeFinishedWidth,\n height: this.progressAnim,\n };\n } else {\n progressBarStyle = {\n backgroundColor: this.state.customStyles.separatorFinishedColor,\n position: \"absolute\",\n top:\n (this.state.height - this.state.customStyles.separatorStrokeWidth) /\n 2,\n left: this.state.width / (2 * stepCount),\n right: this.state.width / (2 * stepCount),\n height:\n this.state.customStyles.separatorStrokeFinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeFinishedWidth,\n width: this.progressAnim,\n };\n }\n return <Animated.View style={progressBarStyle} />;\n };\n\n renderStepIndicator = () => {\n let steps = [];\n const { stepCount, direction } = this.props;\n for (let position = 0; position < stepCount; position++) {\n steps.push(\n <TouchableWithoutFeedback\n key={position}\n onPress={() => this.stepPressed(position)}\n >\n <View\n style={[\n styles.stepContainer,\n direction === \"vertical\"\n ? { flexDirection: \"column\" }\n : { flexDirection: \"row\" },\n ]}\n >\n {this.renderStep(position)}\n </View>\n </TouchableWithoutFeedback>\n );\n }\n return (\n <View\n onLayout={(event) =>\n this.setState({\n width: event.nativeEvent.layout.width,\n height: event.nativeEvent.layout.height,\n })\n }\n style={[\n styles.stepIndicatorContainer,\n direction === \"vertical\"\n ? {\n flexDirection: \"column\",\n width: this.state.customStyles.currentStepIndicatorSize,\n }\n : {\n flexDirection: \"row\",\n height: this.state.customStyles.currentStepIndicatorSize,\n },\n ]}\n >\n {steps}\n </View>\n );\n };\n\n renderStepLabels = () => {\n const { labels, direction, currentPosition, renderLabel } = this.props;\n var labelViews = labels.map((label, index) => {\n const selectedStepLabelStyle =\n index === currentPosition\n ? { color: this.state.customStyles.currentStepLabelColor }\n : { color: this.state.customStyles.labelColor };\n return (\n <TouchableWithoutFeedback\n style={styles.stepLabelItem}\n key={index}\n onPress={() => this.stepPressed(index)}\n >\n <View style={styles.stepLabelItem}>\n {renderLabel ? (\n renderLabel({\n position: index,\n stepStatus: this.getStepStatus(index),\n label,\n currentPosition,\n })\n ) : (\n <Text\n style={[\n styles.stepLabel,\n selectedStepLabelStyle,\n {\n fontSize: this.state.customStyles.labelSize,\n fontFamily: this.state.customStyles.labelFontFamily,\n },\n ]}\n >\n {label}\n </Text>\n )}\n </View>\n </TouchableWithoutFeedback>\n );\n });\n\n return (\n <View\n style={[\n styles.stepLabelsContainer,\n direction === \"vertical\"\n ? { flexDirection: \"column\", paddingHorizontal: 4 }\n : { flexDirection: \"row\", paddingVertical: 4 },\n { alignItems: this.state.customStyles.labelAlign },\n ]}\n >\n {labelViews}\n </View>\n );\n };\n\n renderStep = (position) => {\n const { renderStepIndicator } = this.props;\n let stepStyle;\n let indicatorLabelStyle;\n\n switch (this.getStepStatus(position)) {\n case STEP_STATUS.CURRENT: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorCurrentColor,\n borderWidth: this.state.customStyles.currentStepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeCurrentColor,\n height: this.sizeAnim,\n width: this.sizeAnim,\n borderRadius: this.borderRadiusAnim,\n };\n indicatorLabelStyle = {\n fontSize: this.state.customStyles.currentStepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelCurrentColor,\n };\n\n break;\n }\n case STEP_STATUS.FINISHED: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorFinishedColor,\n borderWidth: this.state.customStyles.stepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeFinishedColor,\n height: this.state.customStyles.stepIndicatorSize,\n width: this.state.customStyles.stepIndicatorSize,\n borderRadius: this.state.customStyles.stepIndicatorSize / 2,\n };\n indicatorLabelStyle = {\n fontSize: this.state.customStyles.stepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelFinishedColor,\n };\n break;\n }\n\n case STEP_STATUS.UNFINISHED: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorUnFinishedColor,\n borderWidth: this.state.customStyles.stepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeUnFinishedColor,\n height: this.state.customStyles.stepIndicatorSize,\n width: this.state.customStyles.stepIndicatorSize,\n borderRadius: this.state.customStyles.stepIndicatorSize / 2,\n };\n indicatorLabelStyle = {\n overflow: \"hidden\",\n fontSize: this.state.customStyles.stepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelUnFinishedColor,\n };\n break;\n }\n default:\n }\n\n return (\n <Animated.View key={\"step-indicator\"} style={[styles.step, stepStyle]}>\n {renderStepIndicator ? (\n renderStepIndicator({\n position,\n stepStatus: this.getStepStatus(position),\n })\n ) : (\n <Text style={indicatorLabelStyle}>{`${position + 1}`}</Text>\n )}\n </Animated.View>\n );\n };\n\n getStepStatus = (stepPosition) => {\n const { currentPosition } = this.props;\n if (stepPosition === currentPosition) {\n return STEP_STATUS.CURRENT;\n } else if (stepPosition < currentPosition) {\n return STEP_STATUS.FINISHED;\n } else {\n return STEP_STATUS.UNFINISHED;\n }\n };\n\n onCurrentPositionChanged = (position) => {\n let { stepCount } = this.props;\n if (position > stepCount - 1) {\n position = stepCount - 1;\n }\n const animateToPosition =\n (this.state.progressBarSize / (stepCount - 1)) * position;\n this.sizeAnim.setValue(this.state.customStyles.stepIndicatorSize);\n this.borderRadiusAnim.setValue(\n this.state.customStyles.stepIndicatorSize / 2\n );\n Animated.sequence([\n Animated.timing(this.progressAnim, {\n toValue: animateToPosition,\n duration: 200,\n }),\n Animated.parallel([\n Animated.timing(this.sizeAnim, {\n toValue: this.state.customStyles.currentStepIndicatorSize,\n duration: 100,\n }),\n Animated.timing(this.borderRadiusAnim, {\n toValue: this.state.customStyles.currentStepIndicatorSize / 2,\n duration: 100,\n }),\n ]),\n ]).start();\n };\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: \"transparent\",\n },\n stepIndicatorContainer: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-around\",\n backgroundColor: \"transparent\",\n },\n stepLabelsContainer: {\n justifyContent: \"space-around\",\n },\n step: {\n alignItems: \"center\",\n justifyContent: \"center\",\n zIndex: 2,\n },\n stepContainer: {\n flex: 1,\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n stepLabel: {\n fontSize: 12,\n textAlign: \"center\",\n fontWeight: \"500\",\n },\n stepLabelItem: {\n flex: 1,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n});\n\nStepIndicator.defaultProps = {\n currentPosition: 0,\n stepCount: 5,\n customStyles: {},\n direction: \"horizontal\",\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["StepIndicator.js"],"names":["React","Component","View","Text","StyleSheet","Animated","TouchableWithoutFeedback","STEP_STATUS","CURRENT","FINISHED","UNFINISHED","StepIndicator","constructor","props","stepCount","direction","progressBarBackgroundStyle","backgroundColor","state","customStyles","separatorUnFinishedColor","position","left","width","separatorStrokeWidth","top","height","bottom","separatorStrokeUnfinishedWidth","right","createElement","onLayout","event","setState","progressBarSize","nativeEvent","layout","onCurrentPositionChanged","currentPosition","style","progressBarStyle","separatorFinishedColor","separatorStrokeFinishedWidth","progressAnim","steps","push","key","onPress","stepPressed","styles","stepContainer","flexDirection","renderStep","stepIndicatorContainer","currentStepIndicatorSize","labels","renderLabel","labelViews","map","label","index","selectedStepLabelStyle","color","currentStepLabelColor","labelColor","stepLabelItem","stepStatus","getStepStatus","stepLabel","fontSize","labelSize","fontFamily","labelFontFamily","stepLabelsContainer","paddingHorizontal","paddingVertical","alignItems","labelAlign","renderStepIndicator","stepStyle","indicatorLabelStyle","stepIndicatorCurrentColor","borderWidth","currentStepStrokeWidth","borderColor","stepStrokeCurrentColor","sizeAnim","borderRadius","borderRadiusAnim","currentStepIndicatorLabelFontSize","stepIndicatorLabelCurrentColor","stepIndicatorFinishedColor","stepStrokeWidth","stepStrokeFinishedColor","stepIndicatorSize","stepIndicatorLabelFontSize","stepIndicatorLabelFinishedColor","stepIndicatorUnFinishedColor","stepStrokeUnFinishedColor","overflow","stepIndicatorLabelUnFinishedColor","step","stepPosition","animateToPosition","setValue","sequence","timing","toValue","duration","parallel","start","defaultStyles","Object","assign","Value","render","container","flex","renderProgressBarBackground","renderProgressBar","renderStepLabels","componentDidUpdate","prevProps","create","justifyContent","zIndex","textAlign","fontWeight","defaultProps"],"mappings":";;AAAA;AACA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,IAAT,EAAeC,IAAf,EAAqBC,UAArB,EAAiCC,QAAjC,EAA2CC,wBAA3C,QAA4E,cAA5E;AACA,MAAMC,WAAW,GAAG;AAChBC,EAAAA,OAAO,EAAE,SADO;AAEhBC,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ts-nocheck\nimport React, { Component } from \"react\";\nimport { View, Text, StyleSheet, Animated, TouchableWithoutFeedback, } from \"react-native\";\nconst STEP_STATUS = {\n CURRENT: \"current\",\n FINISHED: \"finished\",\n UNFINISHED: \"unfinished\",\n};\nexport default class StepIndicator extends Component {\n constructor(props) {\n super(props);\n const defaultStyles = {\n stepIndicatorSize: 30,\n currentStepIndicatorSize: 40,\n separatorStrokeWidth: 3,\n separatorStrokeUnfinishedWidth: 0,\n separatorStrokeFinishedWidth: 0,\n currentStepStrokeWidth: 5,\n stepStrokeWidth: 0,\n stepStrokeCurrentColor: \"#4aae4f\",\n stepStrokeFinishedColor: \"#4aae4f\",\n stepStrokeUnFinishedColor: \"#4aae4f\",\n separatorFinishedColor: \"#4aae4f\",\n separatorUnFinishedColor: \"#a4d4a5\",\n stepIndicatorFinishedColor: \"#4aae4f\",\n stepIndicatorUnFinishedColor: \"#a4d4a5\",\n stepIndicatorCurrentColor: \"#ffffff\",\n stepIndicatorLabelFontSize: 15,\n currentStepIndicatorLabelFontSize: 15,\n stepIndicatorLabelCurrentColor: \"#000000\",\n stepIndicatorLabelFinishedColor: \"#ffffff\",\n stepIndicatorLabelUnFinishedColor: \"rgba(255,255,255,0.5)\",\n labelColor: \"#000000\",\n labelSize: 13,\n labelAlign: \"center\",\n currentStepLabelColor: \"#4aae4f\",\n };\n const customStyles = Object.assign(defaultStyles, props.customStyles);\n this.state = {\n width: 0,\n height: 1,\n progressBarSize: -2,\n customStyles,\n };\n this.progressAnim = new Animated.Value(0);\n this.sizeAnim = new Animated.Value(this.state.customStyles.stepIndicatorSize);\n this.borderRadiusAnim = new Animated.Value(this.state.customStyles.stepIndicatorSize / 2);\n }\n stepPressed(position) {\n if (this.props.onPress) {\n this.props.onPress(position);\n }\n }\n render() {\n const { labels, direction } = this.props;\n return (React.createElement(View, { style: [\n styles.container,\n direction === \"vertical\"\n ? { flexDirection: \"row\", flex: 1 }\n : { flexDirection: \"column\" },\n ] },\n this.state.width !== 0 && this.renderProgressBarBackground(),\n this.state.width !== 0 && this.renderProgressBar(),\n this.renderStepIndicator(),\n labels && this.renderStepLabels()));\n }\n componentDidUpdate(prevProps) {\n // if (prevProps.customStyles !== this.props.customStyles) {\n // this.setState((state) => ({\n // customStyles: Object.assign(\n // state.customStyles,\n // this.props.customStyles\n // ),\n // }));\n // }\n if (prevProps.currentPosition !== this.props.currentPosition) {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n }\n renderProgressBarBackground = () => {\n const { stepCount, direction } = this.props;\n let progressBarBackgroundStyle;\n if (direction === \"vertical\") {\n progressBarBackgroundStyle = {\n backgroundColor: this.state.customStyles.separatorUnFinishedColor,\n position: \"absolute\",\n left: (this.state.width - this.state.customStyles.separatorStrokeWidth) / 2,\n top: this.state.height / (2 * stepCount),\n bottom: this.state.height / (2 * stepCount),\n width: this.state.customStyles.separatorStrokeUnfinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeUnfinishedWidth,\n };\n }\n else {\n progressBarBackgroundStyle = {\n backgroundColor: this.state.customStyles.separatorUnFinishedColor,\n position: \"absolute\",\n top: (this.state.height - this.state.customStyles.separatorStrokeWidth) /\n 2,\n left: this.state.width / (2 * stepCount),\n right: this.state.width / (2 * stepCount),\n height: this.state.customStyles.separatorStrokeUnfinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeUnfinishedWidth,\n };\n }\n return (React.createElement(View, { onLayout: (event) => {\n if (direction === \"vertical\") {\n this.setState({ progressBarSize: event.nativeEvent.layout.height }, () => {\n this.onCurrentPositionChanged(this.props.currentPosition);\n });\n }\n else {\n this.setState({ progressBarSize: event.nativeEvent.layout.width }, () => {\n this.onCurrentPositionChanged(this.props.currentPosition);\n });\n }\n }, style: progressBarBackgroundStyle }));\n };\n renderProgressBar = () => {\n const { stepCount, direction } = this.props;\n let progressBarStyle;\n if (direction === \"vertical\") {\n progressBarStyle = {\n backgroundColor: this.state.customStyles.separatorFinishedColor,\n position: \"absolute\",\n left: (this.state.width - this.state.customStyles.separatorStrokeWidth) / 2,\n top: this.state.height / (2 * stepCount),\n bottom: this.state.height / (2 * stepCount),\n width: this.state.customStyles.separatorStrokeFinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeFinishedWidth,\n height: this.progressAnim,\n };\n }\n else {\n progressBarStyle = {\n backgroundColor: this.state.customStyles.separatorFinishedColor,\n position: \"absolute\",\n top: (this.state.height - this.state.customStyles.separatorStrokeWidth) /\n 2,\n left: this.state.width / (2 * stepCount),\n right: this.state.width / (2 * stepCount),\n height: this.state.customStyles.separatorStrokeFinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeFinishedWidth,\n width: this.progressAnim,\n };\n }\n return React.createElement(Animated.View, { style: progressBarStyle });\n };\n renderStepIndicator = () => {\n let steps = [];\n const { stepCount, direction } = this.props;\n for (let position = 0; position < stepCount; position++) {\n steps.push(React.createElement(TouchableWithoutFeedback, { key: position, onPress: () => this.stepPressed(position) },\n React.createElement(View, { style: [\n styles.stepContainer,\n direction === \"vertical\"\n ? { flexDirection: \"column\" }\n : { flexDirection: \"row\" },\n ] }, this.renderStep(position))));\n }\n return (React.createElement(View, { onLayout: (event) => this.setState({\n width: event.nativeEvent.layout.width,\n height: event.nativeEvent.layout.height,\n }), style: [\n styles.stepIndicatorContainer,\n direction === \"vertical\"\n ? {\n flexDirection: \"column\",\n width: this.state.customStyles.currentStepIndicatorSize,\n }\n : {\n flexDirection: \"row\",\n height: this.state.customStyles.currentStepIndicatorSize,\n },\n ] }, steps));\n };\n renderStepLabels = () => {\n const { labels, direction, currentPosition, renderLabel } = this.props;\n var labelViews = labels.map((label, index) => {\n const selectedStepLabelStyle = index === currentPosition\n ? { color: this.state.customStyles.currentStepLabelColor }\n : { color: this.state.customStyles.labelColor };\n return (React.createElement(TouchableWithoutFeedback, { style: styles.stepLabelItem, key: index, onPress: () => this.stepPressed(index) },\n React.createElement(View, { style: styles.stepLabelItem }, renderLabel ? (renderLabel({\n position: index,\n stepStatus: this.getStepStatus(index),\n label,\n currentPosition,\n })) : (React.createElement(Text, { style: [\n styles.stepLabel,\n selectedStepLabelStyle,\n {\n fontSize: this.state.customStyles.labelSize,\n fontFamily: this.state.customStyles.labelFontFamily,\n },\n ] }, label)))));\n });\n return (React.createElement(View, { style: [\n styles.stepLabelsContainer,\n direction === \"vertical\"\n ? { flexDirection: \"column\", paddingHorizontal: 4 }\n : { flexDirection: \"row\", paddingVertical: 4 },\n { alignItems: this.state.customStyles.labelAlign },\n ] }, labelViews));\n };\n renderStep = (position) => {\n const { renderStepIndicator } = this.props;\n let stepStyle;\n let indicatorLabelStyle;\n switch (this.getStepStatus(position)) {\n case STEP_STATUS.CURRENT: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorCurrentColor,\n borderWidth: this.state.customStyles.currentStepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeCurrentColor,\n height: this.sizeAnim,\n width: this.sizeAnim,\n borderRadius: this.borderRadiusAnim,\n };\n indicatorLabelStyle = {\n fontSize: this.state.customStyles.currentStepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelCurrentColor,\n };\n break;\n }\n case STEP_STATUS.FINISHED: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorFinishedColor,\n borderWidth: this.state.customStyles.stepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeFinishedColor,\n height: this.state.customStyles.stepIndicatorSize,\n width: this.state.customStyles.stepIndicatorSize,\n borderRadius: this.state.customStyles.stepIndicatorSize / 2,\n };\n indicatorLabelStyle = {\n fontSize: this.state.customStyles.stepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelFinishedColor,\n };\n break;\n }\n case STEP_STATUS.UNFINISHED: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorUnFinishedColor,\n borderWidth: this.state.customStyles.stepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeUnFinishedColor,\n height: this.state.customStyles.stepIndicatorSize,\n width: this.state.customStyles.stepIndicatorSize,\n borderRadius: this.state.customStyles.stepIndicatorSize / 2,\n };\n indicatorLabelStyle = {\n overflow: \"hidden\",\n fontSize: this.state.customStyles.stepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelUnFinishedColor,\n };\n break;\n }\n default:\n }\n return (React.createElement(Animated.View, { key: \"step-indicator\", style: [styles.step, stepStyle] }, renderStepIndicator ? (renderStepIndicator({\n position,\n stepStatus: this.getStepStatus(position),\n })) : (React.createElement(Text, { style: indicatorLabelStyle }, `${position + 1}`))));\n };\n getStepStatus = (stepPosition) => {\n const { currentPosition } = this.props;\n if (stepPosition === currentPosition) {\n return STEP_STATUS.CURRENT;\n }\n else if (stepPosition < currentPosition) {\n return STEP_STATUS.FINISHED;\n }\n else {\n return STEP_STATUS.UNFINISHED;\n }\n };\n onCurrentPositionChanged = (position) => {\n let { stepCount } = this.props;\n if (position > stepCount - 1) {\n position = stepCount - 1;\n }\n const animateToPosition = (this.state.progressBarSize / (stepCount - 1)) * position;\n this.sizeAnim.setValue(this.state.customStyles.stepIndicatorSize);\n this.borderRadiusAnim.setValue(this.state.customStyles.stepIndicatorSize / 2);\n Animated.sequence([\n Animated.timing(this.progressAnim, {\n toValue: animateToPosition,\n duration: 200,\n }),\n Animated.parallel([\n Animated.timing(this.sizeAnim, {\n toValue: this.state.customStyles.currentStepIndicatorSize,\n duration: 100,\n }),\n Animated.timing(this.borderRadiusAnim, {\n toValue: this.state.customStyles.currentStepIndicatorSize / 2,\n duration: 100,\n }),\n ]),\n ]).start();\n };\n}\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: \"transparent\",\n },\n stepIndicatorContainer: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-around\",\n backgroundColor: \"transparent\",\n },\n stepLabelsContainer: {\n justifyContent: \"space-around\",\n },\n step: {\n alignItems: \"center\",\n justifyContent: \"center\",\n zIndex: 2,\n },\n stepContainer: {\n flex: 1,\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n stepLabel: {\n fontSize: 12,\n textAlign: \"center\",\n fontWeight: \"500\",\n },\n stepLabelItem: {\n flex: 1,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n});\nStepIndicator.defaultProps = {\n currentPosition: 0,\n stepCount: 5,\n customStyles: {},\n direction: \"horizontal\",\n};\n"]}
|
package/lib/module/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { withTheme, ThemeProvider } from "./theming";
|
|
|
3
3
|
export { default as Provider } from "./Provider";
|
|
4
4
|
export { default as DefaultTheme } from "./styles/DefaultTheme";
|
|
5
5
|
export { Link } from "./components/Text";
|
|
6
|
+
export { default as Banner } from "./components/Banner";
|
|
6
7
|
export { ButtonSolid, ButtonOutline } from "./components/Button";
|
|
7
8
|
export { default as Avatar } from "./components/CircleImage";
|
|
8
9
|
export { default as AvatarEdit } from "./components/AvatarEdit";
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":["injectIcon","withTheme","ThemeProvider","default","Provider","DefaultTheme","Link","ButtonSolid","ButtonOutline","Avatar","AvatarEdit","Card","Carousel","Checkbox","CheckboxGroup","CheckboxRow","CircleImage","Container","Divider","FAB","FieldSearchBarFull","IconButton","Image","NumberInput","ScreenContainer","StarRating","Surface","Switch","SwitchRow","TextField","ToggleButton","Touchable","AccordionGroup","AccordionItem","ActionSheet","ActionSheetItem","ActionSheetCancel","Swiper","SwiperItem","Center","Circle","Square","Row","Stack","Spacer","RadioButton","RadioButtonGroup","RadioButtonRow","RadioButtonFieldGroup","Button","CardBlock","CardContainer","CardContainerRating","CardInline","DatePicker","HeaderLarge","HeaderMedium","HeaderOverline","Picker","ProgressBar","ProgressCircle","RowBodyIcon","RowHeadlineImageCaption","RowHeadlineImageIcon","Slider","Stepper","useAuthState"],"mappings":"AAAA,SAASA,UAAT,QAA2B,mBAA3B;AACA,SAASC,SAAT,EAAoBC,aAApB,QAAyC,WAAzC;AACA,SAASC,OAAO,IAAIC,QAApB,QAAoC,YAApC;AACA,SAASD,OAAO,IAAIE,YAApB,QAAwC,uBAAxC;AAEA,SAASC,IAAT,QAAqB,mBAArB;AACA,SAASC,WAAT,EAAsBC,aAAtB,QAA2C,qBAA3C;AACA,
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":["injectIcon","withTheme","ThemeProvider","default","Provider","DefaultTheme","Link","Banner","ButtonSolid","ButtonOutline","Avatar","AvatarEdit","Card","Carousel","Checkbox","CheckboxGroup","CheckboxRow","CircleImage","Container","Divider","FAB","FieldSearchBarFull","IconButton","Image","NumberInput","ScreenContainer","StarRating","Surface","Switch","SwitchRow","TextField","ToggleButton","Touchable","AccordionGroup","AccordionItem","ActionSheet","ActionSheetItem","ActionSheetCancel","Swiper","SwiperItem","Center","Circle","Square","Row","Stack","Spacer","RadioButton","RadioButtonGroup","RadioButtonRow","RadioButtonFieldGroup","Button","CardBlock","CardContainer","CardContainerRating","CardInline","DatePicker","HeaderLarge","HeaderMedium","HeaderOverline","Picker","ProgressBar","ProgressCircle","RowBodyIcon","RowHeadlineImageCaption","RowHeadlineImageIcon","Slider","Stepper","useAuthState"],"mappings":"AAAA,SAASA,UAAT,QAA2B,mBAA3B;AACA,SAASC,SAAT,EAAoBC,aAApB,QAAyC,WAAzC;AACA,SAASC,OAAO,IAAIC,QAApB,QAAoC,YAApC;AACA,SAASD,OAAO,IAAIE,YAApB,QAAwC,uBAAxC;AAEA,SAASC,IAAT,QAAqB,mBAArB;AACA,SAASH,OAAO,IAAII,MAApB,QAAkC,qBAAlC;AACA,SAASC,WAAT,EAAsBC,aAAtB,QAA2C,qBAA3C;AACA,SAASN,OAAO,IAAIO,MAApB,QAAkC,0BAAlC;AACA,SAASP,OAAO,IAAIQ,UAApB,QAAsC,yBAAtC;AACA,SAASR,OAAO,IAAIS,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C;AACA,SAAS/C,OAAO,IAAIgD,SAApB,QAAqC,wBAArC;AACA,SAAShD,OAAO,IAAIiD,aAApB,QAAyC,4BAAzC;AACA,SAASjD,OAAO,IAAIkD,mBAApB,QAA+C,kCAA/C;AACA,SAASlD,OAAO,IAAImD,UAApB,QAAsC,yBAAtC;AACA,SAASnD,OAAO,IAAIoD,UAApB,QAAsC,oCAAtC;AACA,SAASpD,OAAO,IAAIqD,WAApB,QAAuC,0BAAvC;AACA,SAASrD,OAAO,IAAIsD,YAApB,QAAwC,2BAAxC;AACA,SAAStD,OAAO,IAAIuD,cAApB,QAA0C,6BAA1C;AACA,SAASvD,OAAO,IAAIwD,MAApB,QAAkC,4BAAlC;AACA,SAASxD,OAAO,IAAIyD,WAApB,QAAuC,0BAAvC;AACA,SAASzD,OAAO,IAAI0D,cAApB,QAA0C,6BAA1C;AACA,SAAS1D,OAAO,IAAI2D,WAApB,QAAuC,0BAAvC;AACA,SAAS3D,OAAO,IAAI4D,uBAApB,QAAmD,sCAAnD;AACA,SAAS5D,OAAO,IAAI6D,oBAApB,QAAgD,mCAAhD;AACA,SAAS7D,OAAO,IAAI8D,MAApB,QAAkC,qBAAlC;AACA,SAAS9D,OAAO,IAAI+D,OAApB,QAAmC,sBAAnC;AACA,SAASC,YAAT,QAA6B,2BAA7B","sourcesContent":["export { injectIcon } from \"./interfaces/Icon\";\nexport { withTheme, ThemeProvider } from \"./theming\";\nexport { default as Provider } from \"./Provider\";\nexport { default as DefaultTheme } from \"./styles/DefaultTheme\";\n\nexport { Link } from \"./components/Text\";\nexport { default as Banner } from \"./components/Banner\";\nexport { ButtonSolid, ButtonOutline } from \"./components/Button\";\nexport { default as Avatar } from \"./components/CircleImage\";\nexport { default as AvatarEdit } from \"./components/AvatarEdit\";\nexport { default as Card } from \"./components/Card\";\nexport { default as Carousel } from \"./components/Carousel\";\nexport { Checkbox, CheckboxGroup, CheckboxRow } from \"./components/Checkbox\";\nexport { default as CircleImage } from \"./components/CircleImage\";\nexport { default as Container } from \"./components/Container\";\nexport { default as Divider } from \"./components/Divider\";\nexport { default as FAB } from \"./components/FAB\";\nexport { default as FieldSearchBarFull } from \"./components/FieldSearchBarFull\";\nexport { default as IconButton } from \"./components/IconButton\";\nexport { default as Image } from \"./components/Image\";\nexport { default as NumberInput } from \"./components/NumberInput\";\nexport { default as ScreenContainer } from \"./components/ScreenContainer\";\nexport { default as StarRating } from \"./components/StarRating\";\nexport { default as Surface } from \"./components/Surface\";\nexport { default as Switch, SwitchRow } from \"./components/Switch\";\nexport { default as TextField } from \"./components/TextField\";\nexport { default as ToggleButton } from \"./components/ToggleButton\";\nexport { default as Touchable } from \"./components/Touchable\";\nexport { AccordionGroup, AccordionItem } from \"./components/Accordion\";\nexport {\n ActionSheet,\n ActionSheetItem,\n ActionSheetCancel,\n} from \"./components/ActionSheet\";\nexport { Swiper, SwiperItem } from \"./components/Swiper\";\n\nexport {\n Center,\n Circle,\n Square,\n Row,\n Stack,\n Spacer,\n} from \"./components/Layout\";\n\nexport {\n RadioButton,\n RadioButtonGroup,\n RadioButtonRow,\n RadioButtonFieldGroup,\n} from \"./components/RadioButton/index\";\n\n/* Deprecated: Fix or Delete! */\nexport { default as Button } from \"./components/DeprecatedButton\";\nexport { default as CardBlock } from \"./components/CardBlock\";\nexport { default as CardContainer } from \"./components/CardContainer\";\nexport { default as CardContainerRating } from \"./components/CardContainerRating\";\nexport { default as CardInline } from \"./components/CardInline\";\nexport { default as DatePicker } from \"./components/DatePicker/DatePicker\";\nexport { default as HeaderLarge } from \"./components/HeaderLarge\";\nexport { default as HeaderMedium } from \"./components/HeaderMedium\";\nexport { default as HeaderOverline } from \"./components/HeaderOverline\";\nexport { default as Picker } from \"./components/Picker/Picker\";\nexport { default as ProgressBar } from \"./components/ProgressBar\";\nexport { default as ProgressCircle } from \"./components/ProgressCircle\";\nexport { default as RowBodyIcon } from \"./components/RowBodyIcon\";\nexport { default as RowHeadlineImageCaption } from \"./components/RowHeadlineImageCaption\";\nexport { default as RowHeadlineImageIcon } from \"./components/RowHeadlineImageIcon\";\nexport { default as Slider } from \"./components/Slider\";\nexport { default as Stepper } from \"./components/Stepper\";\nexport { useAuthState } from \"./components/useAuthState\";\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createIconProp, createBoolProp, createColorProp, createTextProp, GROUPS } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Banner",
|
|
4
|
+
tag: "Banner",
|
|
5
|
+
category: COMPONENT_TYPES.button,
|
|
6
|
+
props: {
|
|
7
|
+
icon: createIconProp({
|
|
8
|
+
defaultValue: null,
|
|
9
|
+
required: false
|
|
10
|
+
}),
|
|
11
|
+
content: createTextProp({
|
|
12
|
+
label: "Content",
|
|
13
|
+
description: "Banner text content"
|
|
14
|
+
}),
|
|
15
|
+
initiallyVisible: createBoolProp({
|
|
16
|
+
group: GROUPS.basic,
|
|
17
|
+
label: "Initially visible",
|
|
18
|
+
description: "Whether the banner should be visible"
|
|
19
|
+
}),
|
|
20
|
+
dismissable: createBoolProp({
|
|
21
|
+
group: GROUPS.basic,
|
|
22
|
+
label: "Dismissable",
|
|
23
|
+
description: "Whether the banner should be able to be closed"
|
|
24
|
+
}),
|
|
25
|
+
buttonColor: createColorProp({
|
|
26
|
+
label: "Button color"
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=Banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Banner.ts"],"names":["COMPONENT_TYPES","createIconProp","createBoolProp","createColorProp","createTextProp","GROUPS","SEED_DATA","name","tag","category","button","props","icon","defaultValue","required","content","label","description","initiallyVisible","group","basic","dismissable","buttonColor"],"mappings":"AAAA,SACEA,eADF,EAEEC,cAFF,EAGEC,cAHF,EAIEC,eAJF,EAKEC,cALF,EAMEC,MANF,QAOO,iBAPP;AASA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,QADiB;AAEvBC,EAAAA,GAAG,EAAE,QAFkB;AAGvBC,EAAAA,QAAQ,EAAET,eAAe,CAACU,MAHH;AAIvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAEX,cAAc,CAAC;AACnBY,MAAAA,YAAY,EAAE,IADK;AAEnBC,MAAAA,QAAQ,EAAE;AAFS,KAAD,CADf;AAKLC,IAAAA,OAAO,EAAEX,cAAc,CAAC;AACtBY,MAAAA,KAAK,EAAE,SADe;AAEtBC,MAAAA,WAAW,EAAE;AAFS,KAAD,CALlB;AASLC,IAAAA,gBAAgB,EAAEhB,cAAc,CAAC;AAC/BiB,MAAAA,KAAK,EAAEd,MAAM,CAACe,KADiB;AAE/BJ,MAAAA,KAAK,EAAE,mBAFwB;AAG/BC,MAAAA,WAAW,EAAE;AAHkB,KAAD,CAT3B;AAcLI,IAAAA,WAAW,EAAEnB,cAAc,CAAC;AAC1BiB,MAAAA,KAAK,EAAEd,MAAM,CAACe,KADY;AAE1BJ,MAAAA,KAAK,EAAE,aAFmB;AAG1BC,MAAAA,WAAW,EAAE;AAHa,KAAD,CAdtB;AAmBLK,IAAAA,WAAW,EAAEnB,eAAe,CAAC;AAC3Ba,MAAAA,KAAK,EAAE;AADoB,KAAD;AAnBvB;AAJgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createIconProp,\n createBoolProp,\n createColorProp,\n createTextProp,\n GROUPS,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Banner\",\n tag: \"Banner\",\n category: COMPONENT_TYPES.button,\n props: {\n icon: createIconProp({\n defaultValue: null,\n required: false,\n }),\n content: createTextProp({\n label: \"Content\",\n description: \"Banner text content\",\n }),\n initiallyVisible: createBoolProp({\n group: GROUPS.basic,\n label: \"Initially visible\",\n description: \"Whether the banner should be visible\",\n }),\n dismissable: createBoolProp({\n group: GROUPS.basic,\n label: \"Dismissable\",\n description: \"Whether the banner should be able to be closed\",\n }),\n buttonColor: createColorProp({\n label: \"Button color\",\n }),\n },\n};\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View, ViewStyle, StyleProp } from "react-native";
|
|
3
|
+
import type { IconSlot } from "../interfaces/Icon";
|
|
4
|
+
import type { Theme } from "../styles/DefaultTheme";
|
|
5
|
+
declare type Props = {
|
|
6
|
+
initiallyVisible: boolean;
|
|
7
|
+
dismissable: boolean;
|
|
8
|
+
buttonColor?: string;
|
|
9
|
+
icon?: string;
|
|
10
|
+
content: string;
|
|
11
|
+
contentStyle?: StyleProp<ViewStyle>;
|
|
12
|
+
style?: StyleProp<ViewStyle>;
|
|
13
|
+
ref?: React.RefObject<View>;
|
|
14
|
+
/**
|
|
15
|
+
* @optional
|
|
16
|
+
*/
|
|
17
|
+
theme: Theme;
|
|
18
|
+
} & IconSlot;
|
|
19
|
+
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<Props, "theme"> & {
|
|
20
|
+
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
21
|
+
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<Props> & React.FC<Props>, {}>;
|
|
22
|
+
export default _default;
|
|
@@ -3,6 +3,7 @@ export { withTheme, ThemeProvider } from "./theming";
|
|
|
3
3
|
export { default as Provider } from "./Provider";
|
|
4
4
|
export { default as DefaultTheme } from "./styles/DefaultTheme";
|
|
5
5
|
export { Link } from "./components/Text";
|
|
6
|
+
export { default as Banner } from "./components/Banner";
|
|
6
7
|
export { ButtonSolid, ButtonOutline } from "./components/Button";
|
|
7
8
|
export { default as Avatar } from "./components/CircleImage";
|
|
8
9
|
export { default as AvatarEdit } from "./components/AvatarEdit";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare const SEED_DATA: {
|
|
2
|
+
name: string;
|
|
3
|
+
tag: string;
|
|
4
|
+
category: string;
|
|
5
|
+
props: {
|
|
6
|
+
icon: {
|
|
7
|
+
label: string;
|
|
8
|
+
description: string;
|
|
9
|
+
formType: string;
|
|
10
|
+
propType: string;
|
|
11
|
+
defaultValue: string;
|
|
12
|
+
required: boolean;
|
|
13
|
+
editable: boolean;
|
|
14
|
+
group: string;
|
|
15
|
+
};
|
|
16
|
+
content: any;
|
|
17
|
+
initiallyVisible: {
|
|
18
|
+
label: string;
|
|
19
|
+
description: string;
|
|
20
|
+
formType: string;
|
|
21
|
+
propType: string;
|
|
22
|
+
defaultValue: boolean;
|
|
23
|
+
editable: boolean;
|
|
24
|
+
required: boolean;
|
|
25
|
+
group: string;
|
|
26
|
+
};
|
|
27
|
+
dismissable: {
|
|
28
|
+
label: string;
|
|
29
|
+
description: string;
|
|
30
|
+
formType: string;
|
|
31
|
+
propType: string;
|
|
32
|
+
defaultValue: boolean;
|
|
33
|
+
editable: boolean;
|
|
34
|
+
required: boolean;
|
|
35
|
+
group: string;
|
|
36
|
+
};
|
|
37
|
+
buttonColor: {
|
|
38
|
+
group: string;
|
|
39
|
+
label: string;
|
|
40
|
+
description: string;
|
|
41
|
+
editable: boolean;
|
|
42
|
+
required: boolean;
|
|
43
|
+
defaultValue: null;
|
|
44
|
+
formType: string;
|
|
45
|
+
propType: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "43.4.
|
|
3
|
+
"version": "43.4.20-dec262.0+dec262a5",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
]
|
|
81
81
|
]
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "dec262a527fe51b1c3d582ce918e88bca93e248a"
|
|
84
84
|
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Button, Text, View, StyleSheet, Animated, } from "react-native";
|
|
3
|
+
import Surface from "./Surface";
|
|
4
|
+
import shadow from "../styles/shadow";
|
|
5
|
+
import { withTheme } from "../theming";
|
|
6
|
+
const ELEVATION = 1;
|
|
7
|
+
const DEFAULT_MAX_WIDTH = 960;
|
|
8
|
+
const Banner = ({ initiallyVisible, icon, buttonColor, content, contentStyle, dismissable, style, theme, Icon, ...rest }) => {
|
|
9
|
+
const [visible, setVisible] = React.useState(initiallyVisible);
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
if (initiallyVisible) {
|
|
12
|
+
setVisible(true);
|
|
13
|
+
}
|
|
14
|
+
}, [initiallyVisible]);
|
|
15
|
+
const { current: position } = React.useRef(new Animated.Value(visible ? 1 : 0));
|
|
16
|
+
const [layout, setLayout] = React.useState({
|
|
17
|
+
height: 0,
|
|
18
|
+
measured: false,
|
|
19
|
+
});
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
if (visible) {
|
|
22
|
+
// show
|
|
23
|
+
Animated.timing(position, {
|
|
24
|
+
duration: 250,
|
|
25
|
+
toValue: 1,
|
|
26
|
+
useNativeDriver: false,
|
|
27
|
+
}).start();
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
// hide
|
|
31
|
+
Animated.timing(position, {
|
|
32
|
+
duration: 200,
|
|
33
|
+
toValue: 0,
|
|
34
|
+
useNativeDriver: false,
|
|
35
|
+
}).start();
|
|
36
|
+
}
|
|
37
|
+
}, [visible, position]);
|
|
38
|
+
const handleLayout = ({ nativeEvent }) => {
|
|
39
|
+
const { height } = nativeEvent.layout;
|
|
40
|
+
setLayout({ height, measured: true });
|
|
41
|
+
};
|
|
42
|
+
// The banner animation has 2 parts:
|
|
43
|
+
// 1. Blank spacer element which animates its height to move the content
|
|
44
|
+
// 2. Actual banner which animates its translateY
|
|
45
|
+
// In initial render, we position everything normally and measure the height of the banner
|
|
46
|
+
// Once we have the height, we apply the height to the spacer and switch the banner to position: absolute
|
|
47
|
+
// We need this because we need to move the content below as if banner's height was being animated
|
|
48
|
+
// However we can't animated banner's height directly as it'll also resize the content inside
|
|
49
|
+
const height = Animated.multiply(position, layout.height);
|
|
50
|
+
const translateY = Animated.multiply(Animated.add(position, -1), layout.height);
|
|
51
|
+
return (React.createElement(Surface, { ...rest, style: [styles.container, shadow(ELEVATION), style] },
|
|
52
|
+
React.createElement(View, { style: [styles.wrapper, contentStyle] },
|
|
53
|
+
React.createElement(Animated.View, { style: { height } }),
|
|
54
|
+
React.createElement(Animated.View, { onLayout: handleLayout, style: [
|
|
55
|
+
layout.measured || !visible
|
|
56
|
+
? // If we have measured banner's height or it's invisible,
|
|
57
|
+
// Position it absolutely, the layout will be taken care of the spacer
|
|
58
|
+
[styles.absolute, { transform: [{ translateY }] }]
|
|
59
|
+
: // Otherwise position it normally
|
|
60
|
+
null,
|
|
61
|
+
!layout.measured && !visible
|
|
62
|
+
? // If we haven't measured banner's height yet and it's invisible,
|
|
63
|
+
// hide it with opacity: 0 so user doesn't see it
|
|
64
|
+
{ opacity: 0 }
|
|
65
|
+
: null,
|
|
66
|
+
] },
|
|
67
|
+
React.createElement(View, { style: [styles.content, { marginBottom: dismissable ? 0 : 16 }] },
|
|
68
|
+
icon ? (React.createElement(View, { style: styles.icon },
|
|
69
|
+
React.createElement(Icon, { name: icon, size: 40 }))) : null,
|
|
70
|
+
React.createElement(Text, { style: [styles.message, { color: theme.colors.text }], accessibilityLiveRegion: visible ? "polite" : "none", accessibilityRole: "alert" }, content)),
|
|
71
|
+
dismissable ? (React.createElement(View, { style: styles.actions },
|
|
72
|
+
React.createElement(Button, { color: buttonColor || theme.colors.primary, title: "Close", onPress: () => setVisible(false) }))) : null))));
|
|
73
|
+
};
|
|
74
|
+
const styles = StyleSheet.create({
|
|
75
|
+
container: {
|
|
76
|
+
elevation: ELEVATION,
|
|
77
|
+
},
|
|
78
|
+
wrapper: {
|
|
79
|
+
overflow: "hidden",
|
|
80
|
+
alignSelf: "center",
|
|
81
|
+
width: "100%",
|
|
82
|
+
maxWidth: DEFAULT_MAX_WIDTH,
|
|
83
|
+
},
|
|
84
|
+
absolute: {
|
|
85
|
+
position: "absolute",
|
|
86
|
+
top: 0,
|
|
87
|
+
width: "100%",
|
|
88
|
+
},
|
|
89
|
+
content: {
|
|
90
|
+
flexDirection: "row",
|
|
91
|
+
justifyContent: "flex-start",
|
|
92
|
+
marginHorizontal: 8,
|
|
93
|
+
marginTop: 16,
|
|
94
|
+
marginBottom: 0,
|
|
95
|
+
},
|
|
96
|
+
icon: {
|
|
97
|
+
margin: 8,
|
|
98
|
+
},
|
|
99
|
+
message: {
|
|
100
|
+
flex: 1,
|
|
101
|
+
margin: 8,
|
|
102
|
+
},
|
|
103
|
+
actions: {
|
|
104
|
+
flexDirection: "row",
|
|
105
|
+
justifyContent: "flex-end",
|
|
106
|
+
margin: 8,
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
export default withTheme(Banner);
|