@0610studio/zs-ui 0.17.1 → 0.18.1
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/android/build.gradle +3 -3
- package/build/ZsUiModule.d.ts.map +1 -1
- package/build/ZsUiModule.js +0 -2
- package/build/ZsUiModule.js.map +1 -1
- package/build/ZsUiView.js +2 -2
- package/build/ZsUiView.js.map +1 -1
- package/build/ZsUiView.web.js +2 -4
- package/build/ZsUiView.web.js.map +1 -1
- package/build/assets/SvgCheck.js +2 -4
- package/build/assets/SvgCheck.js.map +1 -1
- package/build/assets/SvgExclamation.d.ts.map +1 -1
- package/build/assets/SvgExclamation.js +2 -9
- package/build/assets/SvgExclamation.js.map +1 -1
- package/build/assets/SvgX.js +3 -5
- package/build/assets/SvgX.js.map +1 -1
- package/build/context/OverlayContext.d.ts.map +1 -1
- package/build/context/OverlayContext.js +12 -42
- package/build/context/OverlayContext.js.map +1 -1
- package/build/context/ThemeContext.d.ts +9 -0
- package/build/context/ThemeContext.d.ts.map +1 -1
- package/build/context/ThemeContext.js +13 -19
- package/build/context/ThemeContext.js.map +1 -1
- package/build/index.d.ts +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -7
- package/build/index.js.map +1 -1
- package/build/model/globalOverlay.d.ts +0 -8
- package/build/model/globalOverlay.d.ts.map +1 -1
- package/build/model/globalOverlay.js +0 -9
- package/build/model/globalOverlay.js.map +1 -1
- package/build/model/types.d.ts +1 -1
- package/build/model/types.d.ts.map +1 -1
- package/build/model/types.js.map +1 -1
- package/build/model/useKeyboard.d.ts.map +1 -1
- package/build/model/useKeyboard.js +8 -4
- package/build/model/useKeyboard.js.map +1 -1
- package/build/model/utils.d.ts +1 -1
- package/build/model/utils.d.ts.map +1 -1
- package/build/model/utils.js +2 -1
- package/build/model/utils.js.map +1 -1
- package/build/overlay/AlertOverlay/index.d.ts.map +1 -1
- package/build/overlay/AlertOverlay/index.js +10 -27
- package/build/overlay/AlertOverlay/index.js.map +1 -1
- package/build/overlay/BottomSheetOverlay/index.d.ts.map +1 -1
- package/build/overlay/BottomSheetOverlay/index.js +21 -25
- package/build/overlay/BottomSheetOverlay/index.js.map +1 -1
- package/build/overlay/LoadingNotify/index.js +4 -5
- package/build/overlay/LoadingNotify/index.js.map +1 -1
- package/build/overlay/Modality/index.d.ts.map +1 -1
- package/build/overlay/Modality/index.js +21 -36
- package/build/overlay/Modality/index.js.map +1 -1
- package/build/overlay/PopOver/PopOverButton.js +3 -6
- package/build/overlay/PopOver/PopOverButton.js.map +1 -1
- package/build/overlay/PopOver/PopOverMenu.d.ts.map +1 -1
- package/build/overlay/PopOver/PopOverMenu.js +10 -18
- package/build/overlay/PopOver/PopOverMenu.js.map +1 -1
- package/build/overlay/SnackbarNotify/index.d.ts +3 -3
- package/build/overlay/SnackbarNotify/index.d.ts.map +1 -1
- package/build/overlay/SnackbarNotify/index.js +8 -9
- package/build/overlay/SnackbarNotify/index.js.map +1 -1
- package/build/overlay/SnackbarNotify/ui/SnackbarItem.d.ts +3 -3
- package/build/overlay/SnackbarNotify/ui/SnackbarItem.d.ts.map +1 -1
- package/build/overlay/SnackbarNotify/ui/SnackbarItem.js +9 -16
- package/build/overlay/SnackbarNotify/ui/SnackbarItem.js.map +1 -1
- package/build/overlay/ZSPortal/index.d.ts.map +1 -1
- package/build/overlay/ZSPortal/index.js +16 -9
- package/build/overlay/ZSPortal/index.js.map +1 -1
- package/build/overlay/ui/ModalBackground.js +5 -9
- package/build/overlay/ui/ModalBackground.js.map +1 -1
- package/build/theme/elevation.d.ts +94 -10
- package/build/theme/elevation.d.ts.map +1 -1
- package/build/theme/elevation.js +39 -35
- package/build/theme/elevation.js.map +1 -1
- package/build/theme/palette.d.ts +1 -5
- package/build/theme/palette.d.ts.map +1 -1
- package/build/theme/palette.js +3 -12
- package/build/theme/palette.js.map +1 -1
- package/build/theme/resolveColor.d.ts +4 -0
- package/build/theme/resolveColor.d.ts.map +1 -0
- package/build/theme/resolveColor.js +29 -0
- package/build/theme/resolveColor.js.map +1 -0
- package/build/ui/ZSAboveKeyboard/index.js +2 -5
- package/build/ui/ZSAboveKeyboard/index.js.map +1 -1
- package/build/ui/ZSBlockButton/index.d.ts +4 -2
- package/build/ui/ZSBlockButton/index.d.ts.map +1 -1
- package/build/ui/ZSBlockButton/index.js +44 -96
- package/build/ui/ZSBlockButton/index.js.map +1 -1
- package/build/ui/ZSContainer/index.d.ts +20 -0
- package/build/ui/ZSContainer/index.d.ts.map +1 -1
- package/build/ui/ZSContainer/index.js +30 -50
- package/build/ui/ZSContainer/index.js.map +1 -1
- package/build/ui/ZSPressable/index.d.ts.map +1 -1
- package/build/ui/ZSPressable/index.js +2 -11
- package/build/ui/ZSPressable/index.js.map +1 -1
- package/build/ui/ZSRadioGroup/index.d.ts +3 -2
- package/build/ui/ZSRadioGroup/index.d.ts.map +1 -1
- package/build/ui/ZSRadioGroup/index.js +67 -78
- package/build/ui/ZSRadioGroup/index.js.map +1 -1
- package/build/ui/ZSSkeleton/index.d.ts +2 -1
- package/build/ui/ZSSkeleton/index.d.ts.map +1 -1
- package/build/ui/ZSSkeleton/index.js +3 -12
- package/build/ui/ZSSkeleton/index.js.map +1 -1
- package/build/ui/ZSSkeletonBox/index.d.ts +2 -1
- package/build/ui/ZSSkeletonBox/index.d.ts.map +1 -1
- package/build/ui/ZSSkeletonBox/index.js +13 -18
- package/build/ui/ZSSkeletonBox/index.js.map +1 -1
- package/build/ui/ZSSwitch/index.d.ts +2 -1
- package/build/ui/ZSSwitch/index.d.ts.map +1 -1
- package/build/ui/ZSSwitch/index.js +3 -7
- package/build/ui/ZSSwitch/index.js.map +1 -1
- package/build/ui/ZSText/index.d.ts +3 -2
- package/build/ui/ZSText/index.d.ts.map +1 -1
- package/build/ui/ZSText/index.js +5 -16
- package/build/ui/ZSText/index.js.map +1 -1
- package/build/ui/ZSTextField/index.d.ts.map +1 -1
- package/build/ui/ZSTextField/index.js +42 -42
- package/build/ui/ZSTextField/index.js.map +1 -1
- package/build/ui/ZSTextField/ui/ButtonClose.js +2 -3
- package/build/ui/ZSTextField/ui/ButtonClose.js.map +1 -1
- package/build/ui/ZSTextField/ui/ErrorComponent.js +2 -7
- package/build/ui/ZSTextField/ui/ErrorComponent.js.map +1 -1
- package/build/ui/ZSView/index.d.ts +3 -2
- package/build/ui/ZSView/index.d.ts.map +1 -1
- package/build/ui/ZSView/index.js +9 -11
- package/build/ui/ZSView/index.js.map +1 -1
- package/build/ui/atoms/AnimatedWrapper.d.ts.map +1 -1
- package/build/ui/atoms/AnimatedWrapper.js +36 -44
- package/build/ui/atoms/AnimatedWrapper.js.map +1 -1
- package/build/ui/atoms/TextAtom.d.ts +1 -2
- package/build/ui/atoms/TextAtom.d.ts.map +1 -1
- package/build/ui/atoms/TextAtom.js +2 -4
- package/build/ui/atoms/TextAtom.js.map +1 -1
- package/build/ui/atoms/ViewAtom.d.ts +1 -2
- package/build/ui/atoms/ViewAtom.d.ts.map +1 -1
- package/build/ui/atoms/ViewAtom.js +2 -4
- package/build/ui/atoms/ViewAtom.js.map +1 -1
- package/ios/ZsUi.podspec +1 -1
- package/package.json +30 -28
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSSkeleton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,UAAU,EAAkB,UAAU,EAAE,IAAI,EAAkC,MAAM,cAAc,CAAC;AAC5G,OAAO,QAAQ,EAAE,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC9H,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;AASpD,SAAS,UAAU,CAAC,EA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,EAAE,UAAU;QACpB,aAAa,EAAE,KAAK;KACrB;IACD,UAAU,EAAE;QACV,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,GAAG;QACZ,KAAK,EAAE,YAAY,GAAG,GAAG;KAC1B;IACD,aAAa,EAAE;QACb,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,GAAG;QACZ,KAAK,EAAE,YAAY,GAAG,GAAG;KAC1B;CACF,CAAC,CAAC","sourcesContent":["import React, { useEffect } from \"react\";\nimport { Dimensions, type StyleProp, StyleSheet, View, type ViewStyle, type ViewProps } from \"react-native\";\nimport Animated, { useSharedValue, useAnimatedStyle, withRepeat, withTiming, cancelAnimation } from \"react-native-reanimated\";\nimport { useTheme } from \"../../context/ThemeContext\";\n\nconst DEVICE_WIDTH = Dimensions.get(\"window\").width;\n\ninterface ZSSkeletonProps extends ViewProps {\n isFetching?: boolean;\n style?: StyleProp<ViewStyle>;\n children?: React.ReactNode;\n overlayColor?: string;\n}\n\nfunction ZSSkeleton({ isFetching, style, children, overlayColor, ...props }: ZSSkeletonProps) {\n const translateX = useSharedValue(-DEVICE_WIDTH * 1.2);\n const { palette } = useTheme();\n const effectColor = overlayColor || palette.background.base;\n\n useEffect(() => {\n if (isFetching) {\n translateX.value = withRepeat(withTiming(DEVICE_WIDTH * 1.2, { duration: 800 }), -1, false);\n } else {\n cancelAnimation(translateX);\n translateX.value = -DEVICE_WIDTH * 1.2;\n }\n\n return () => {\n cancelAnimation(translateX);\n };\n }, [isFetching]);\n\n const animatedStyle = useAnimatedStyle(() => {\n return {\n transform: [{ translateX: translateX.value }],\n };\n });\n\n return isFetching ? (\n <View style={[style, { overflow: \"hidden\" }]} {...props}>\n <View style={styles.container}>\n {children}\n\n <Animated.View style={[styles.shimmer, animatedStyle]}>\n <View style={[styles.shimmerSub, { backgroundColor: effectColor }]} />\n <View style={[styles.shimmerCenter, { backgroundColor: effectColor }]} />\n <View style={[styles.shimmerSub, { backgroundColor: effectColor }]} />\n </Animated.View>\n </View>\n </View>\n ) : (\n children\n );\n}\n\nexport default React.memo(ZSSkeleton);\n\nconst styles = StyleSheet.create({\n container: {\n overflow: \"hidden\",\n opacity: 0.6,\n width: \"100%\",\n },\n shimmer: {\n width: \"100%\",\n height: \"100%\",\n position: \"absolute\",\n flexDirection: \"row\",\n },\n shimmerSub: {\n height: \"100%\",\n opacity: 0.3,\n width: DEVICE_WIDTH * 0.3,\n },\n shimmerCenter: {\n height: \"100%\",\n opacity: 0.6,\n width: DEVICE_WIDTH * 0.4,\n },\n});\n"]}
|
|
@@ -8,5 +8,6 @@ interface ZSSkeletonBoxProps extends ViewProps {
|
|
|
8
8
|
color?: ViewColorOptions;
|
|
9
9
|
}
|
|
10
10
|
declare function ZSSkeletonBox({ height, style, overlayColor, color, ...props }: ZSSkeletonBoxProps): React.JSX.Element;
|
|
11
|
-
|
|
11
|
+
declare const _default: React.MemoExoticComponent<typeof ZSSkeletonBox>;
|
|
12
|
+
export default _default;
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSSkeletonBox/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAc,KAAK,SAAS,EAAoB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSSkeletonBox/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAc,KAAK,SAAS,EAAoB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAG5G,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAKrD,UAAU,kBAAmB,SAAQ,SAAS;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAED,iBAAS,aAAa,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,KAAiB,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,qBAuCtG;;AAED,wBAAyC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import React, { useEffect } from "react";
|
|
2
3
|
import { Dimensions, StyleSheet, View } from "react-native";
|
|
3
4
|
import Animated, { useSharedValue, useAnimatedStyle, withRepeat, withTiming, cancelAnimation } from "react-native-reanimated";
|
|
4
|
-
import { useTheme } from "../../context/ThemeContext";
|
|
5
5
|
import ZSView from "../ZSView";
|
|
6
|
+
import { useTheme } from "../../context/ThemeContext";
|
|
6
7
|
const DEVICE_WIDTH = Dimensions.get("window").width;
|
|
7
8
|
function ZSSkeletonBox({ height, style, overlayColor, color = 'neutral', ...props }) {
|
|
8
9
|
const translateX = useSharedValue(-DEVICE_WIDTH * 1.2);
|
|
@@ -19,27 +20,21 @@ function ZSSkeletonBox({ height, style, overlayColor, color = 'neutral', ...prop
|
|
|
19
20
|
transform: [{ translateX: translateX.value }],
|
|
20
21
|
};
|
|
21
22
|
});
|
|
22
|
-
return (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
]} color={color}>
|
|
30
|
-
<Animated.View style={[styles.shimmer, animatedStyle]}>
|
|
31
|
-
<View style={[styles.shimmerSub, { backgroundColor: effectColor }]}/>
|
|
32
|
-
<View style={[styles.shimmerCenter, { backgroundColor: effectColor }]}/>
|
|
33
|
-
<View style={[styles.shimmerSub, { backgroundColor: effectColor }]}/>
|
|
34
|
-
</Animated.View>
|
|
35
|
-
</ZSView>
|
|
36
|
-
</View>);
|
|
23
|
+
return (_jsx(View, { style: [styles.fullWidth, style, { height, overflow: "hidden" }], ...props, children: _jsx(ZSView, { style: [
|
|
24
|
+
styles.container,
|
|
25
|
+
{
|
|
26
|
+
width: DEVICE_WIDTH,
|
|
27
|
+
height,
|
|
28
|
+
},
|
|
29
|
+
], color: color, children: _jsxs(Animated.View, { style: [styles.shimmer, animatedStyle], children: [_jsx(View, { style: [styles.shimmerSub, { backgroundColor: effectColor }] }), _jsx(View, { style: [styles.shimmerCenter, { backgroundColor: effectColor }] }), _jsx(View, { style: [styles.shimmerSub, { backgroundColor: effectColor }] })] }) }) }));
|
|
37
30
|
}
|
|
38
|
-
export default ZSSkeletonBox;
|
|
31
|
+
export default React.memo(ZSSkeletonBox);
|
|
39
32
|
const styles = StyleSheet.create({
|
|
33
|
+
fullWidth: {
|
|
34
|
+
width: '100%',
|
|
35
|
+
},
|
|
40
36
|
container: {
|
|
41
37
|
overflow: "hidden",
|
|
42
|
-
opacity: 0.4,
|
|
43
38
|
},
|
|
44
39
|
shimmer: {
|
|
45
40
|
width: "100%",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSSkeletonBox/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,UAAU,EAAkB,UAAU,EAAE,IAAI,EAAkC,MAAM,cAAc,CAAC;AAC5G,OAAO,QAAQ,EAAE,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC9H,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSSkeletonBox/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,UAAU,EAAk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ent":["import React, { useEffect } from \"react\";\nimport { Dimensions, type StyleProp, StyleSheet, View, type ViewStyle, type ViewProps } from \"react-native\";\nimport Animated, { useSharedValue, useAnimatedStyle, withRepeat, withTiming, cancelAnimation } from \"react-native-reanimated\";\nimport ZSView from \"../ZSView\";\nimport { ViewColorOptions } from \"../../theme/types\";\nimport { useTheme } from \"../../context/ThemeContext\";\n\nconst DEVICE_WIDTH = Dimensions.get(\"window\").width;\n\ninterface ZSSkeletonBoxProps extends ViewProps {\n height: number;\n style?: StyleProp<ViewStyle>;\n overlayColor?: string;\n color?: ViewColorOptions;\n}\n\nfunction ZSSkeletonBox({ height, style, overlayColor, color = 'neutral', ...props }: ZSSkeletonBoxProps) {\n const translateX = useSharedValue(-DEVICE_WIDTH * 1.2);\n const { palette } = useTheme();\n const effectColor = overlayColor || palette.background.layer1;\n\n useEffect(() => {\n translateX.value = withRepeat(withTiming(DEVICE_WIDTH * 1.2, { duration: 800 }), -1, false);\n\n return () => {\n cancelAnimation(translateX);\n };\n }, []);\n\n const animatedStyle = useAnimatedStyle(() => {\n return {\n transform: [{ translateX: translateX.value }],\n };\n });\n\n return (\n <View style={[styles.fullWidth, style, { height, overflow: \"hidden\" }]} {...props}>\n <ZSView\n style={[\n styles.container,\n {\n width: DEVICE_WIDTH,\n height,\n },\n ]}\n color={color}\n >\n <Animated.View style={[styles.shimmer, animatedStyle]}>\n <View style={[styles.shimmerSub, { backgroundColor: effectColor }]} />\n <View style={[styles.shimmerCenter, { backgroundColor: effectColor }]} />\n <View style={[styles.shimmerSub, { backgroundColor: effectColor }]} />\n </Animated.View>\n </ZSView>\n </View>\n );\n}\n\nexport default React.memo(ZSSkeletonBox);\n\nconst styles = StyleSheet.create({\n fullWidth: {\n width: '100%',\n },\n container: {\n overflow: \"hidden\",\n },\n shimmer: {\n width: \"100%\",\n height: \"100%\",\n position: \"absolute\",\n flexDirection: \"row\",\n },\n shimmerSub: {\n height: \"100%\",\n backgroundColor: \"#ebebeb\",\n opacity: 0.3,\n width: DEVICE_WIDTH * 0.3,\n },\n shimmerCenter: {\n height: \"100%\",\n backgroundColor: \"#f5f5f5\",\n opacity: 0.7,\n width: DEVICE_WIDTH * 0.4,\n },\n});\n"]}
|
|
@@ -10,5 +10,6 @@ interface ZSSwitchProps extends ViewProps {
|
|
|
10
10
|
thumbColor?: string;
|
|
11
11
|
}
|
|
12
12
|
declare function ZSSwitch({ isActive, onToggle, style, width, trackColorInactive, trackColorActive, thumbColor, ...props }: ZSSwitchProps): React.JSX.Element;
|
|
13
|
-
|
|
13
|
+
declare const _default: React.MemoExoticComponent<typeof ZSSwitch>;
|
|
14
|
+
export default _default;
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSSwitch/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAa,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAUzF,UAAU,aAAc,SAAQ,SAAS;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,iBAAS,QAAQ,CAAC,EAChB,QAAgB,EAChB,QAAQ,EACR,KAAK,EACL,KAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,UAAsB,EACtB,GAAG,KAAK,EACT,EAAE,aAAa,qBAyCf
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSSwitch/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAa,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAUzF,UAAU,aAAc,SAAQ,SAAS;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,iBAAS,QAAQ,CAAC,EAChB,QAAgB,EAChB,QAAQ,EACR,KAAK,EACL,KAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,UAAsB,EACtB,GAAG,KAAK,EACT,EAAE,aAAa,qBAyCf;;AAED,wBAAoC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { Pressable } from "react-native";
|
|
3
4
|
import Animated from "react-native-reanimated";
|
|
@@ -37,12 +38,7 @@ function ZSSwitch({ isActive = false, onToggle, style, width = 50, trackColorIna
|
|
|
37
38
|
transitionProperty: 'transform',
|
|
38
39
|
...SWITCH_TRANSITION,
|
|
39
40
|
};
|
|
40
|
-
return (
|
|
41
|
-
<Animated.View style={toggleStyle}>
|
|
42
|
-
<Animated.View style={thumbStyle}/>
|
|
43
|
-
</Animated.View>
|
|
44
|
-
</Pressable>);
|
|
41
|
+
return (_jsx(Pressable, { onPress: onToggle, style: style, ...props, children: _jsx(Animated.View, { style: toggleStyle, children: _jsx(Animated.View, { style: thumbStyle }) }) }));
|
|
45
42
|
}
|
|
46
|
-
;
|
|
47
|
-
export default ZSSwitch;
|
|
43
|
+
export default React.memo(ZSSwitch);
|
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AK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { type StyleProp, type ViewStyle, Pressable, type ViewProps } from \"react-native\";\nimport Animated from \"react-native-reanimated\";\nimport { useTheme } from \"../../context/ThemeContext\";\n\nconst SWITCH_TRANSITION_DURATION = 200;\nconst SWITCH_TRANSITION = {\n transitionDuration: SWITCH_TRANSITION_DURATION,\n transitionTimingFunction: 'ease-in-out',\n} as const;\n\ninterface ZSSwitchProps extends ViewProps {\n isActive: boolean;\n onToggle: () => void;\n style?: StyleProp<ViewStyle>;\n width?: number;\n trackColorInactive?: string;\n trackColorActive?: string;\n thumbColor?: string;\n}\n\nfunction ZSSwitch({\n isActive = false,\n onToggle,\n style,\n width = 50,\n trackColorInactive,\n trackColorActive,\n thumbColor = '#ffffff',\n ...props\n}: ZSSwitchProps) {\n const { palette } = useTheme();\n const height = width * 0.6;\n const padding = width * 0.04;\n const thumbSize = height - padding * 2;\n const toggleBorderRadius = height * 1.2;\n const thumbBorderRadius = thumbSize / 2;\n\n const inactiveColor = trackColorInactive ?? palette.grey[30];\n const activeColor = trackColorActive ?? palette.primary.main;\n const thumbTranslateX = isActive ? width - thumbSize - padding * 2 : 0;\n\n const toggleStyle = {\n width,\n height,\n borderRadius: toggleBorderRadius,\n padding,\n justifyContent: \"center\" as const,\n backgroundColor: isActive ? activeColor : inactiveColor,\n transitionProperty: 'backgroundColor' as const,\n ...SWITCH_TRANSITION,\n };\n\n const thumbStyle = {\n width: thumbSize,\n height: thumbSize,\n borderRadius: thumbBorderRadius,\n justifyContent: \"center\" as const,\n backgroundColor: thumbColor,\n transform: [{ translateX: thumbTranslateX }],\n transitionProperty: 'transform' as const,\n ...SWITCH_TRANSITION,\n };\n\n return (\n <Pressable onPress={onToggle} style={style} {...props}>\n <Animated.View style={toggleStyle}>\n <Animated.View style={thumbStyle} />\n </Animated.View>\n </Pressable>\n );\n}\n\nexport default React.memo(ZSSwitch);\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { TextProps } from "react-native";
|
|
3
|
-
import {
|
|
3
|
+
import { TypoColorOptions, TypoOptions } from "../../theme/types";
|
|
4
4
|
export interface ZSTextProps extends TextProps {
|
|
5
5
|
typo?: TypoOptions;
|
|
6
6
|
color?: TypoColorOptions;
|
|
7
7
|
}
|
|
8
8
|
declare function ZSText({ typo, color, ...props }: ZSTextProps): React.JSX.Element;
|
|
9
|
-
|
|
9
|
+
declare const _default: React.MemoExoticComponent<typeof ZSText>;
|
|
10
|
+
export default _default;
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSText/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSText/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAA2B,MAAM,mBAAmB,CAAC;AAI3F,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAED,iBAAS,MAAM,CAAC,EACd,IAAe,EACf,KAAc,EACd,GAAG,KAAK,EACT,EAAE,WAAW,qBAUb;;AAED,wBAAkC"}
|
package/build/ui/ZSText/index.js
CHANGED
|
@@ -1,24 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { useTheme } from "../../context/ThemeContext";
|
|
4
|
+
import { resolveTextColor } from "../../theme/resolveColor";
|
|
3
5
|
import TextAtom from "../atoms/TextAtom";
|
|
4
|
-
function isColorMap(value) {
|
|
5
|
-
return typeof value === 'object' && value !== null;
|
|
6
|
-
}
|
|
7
6
|
function ZSText({ typo = 'body.2', color = 'base', ...props }) {
|
|
8
7
|
const { palette, typography } = useTheme();
|
|
9
8
|
const [s01, s02] = typo.split('.');
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
if (!c02)
|
|
13
|
-
return palette.text[c01];
|
|
14
|
-
if (c01 === 'text')
|
|
15
|
-
return palette.text[c02];
|
|
16
|
-
if (c01 === 'background')
|
|
17
|
-
return palette.background[c02];
|
|
18
|
-
const semanticPalette = palette[c01];
|
|
19
|
-
return isColorMap(semanticPalette) ? semanticPalette[c02] : undefined;
|
|
20
|
-
})();
|
|
21
|
-
return <TextAtom {...props} style={[typography[s01][s02], { color: textColor }, props.style]}>{props.children}</TextAtom>;
|
|
9
|
+
const textColor = resolveTextColor(palette, color);
|
|
10
|
+
return (_jsx(TextAtom, { ...props, style: [typography[s01][s02], { color: textColor }, props.style], children: props.children }));
|
|
22
11
|
}
|
|
23
|
-
export default ZSText;
|
|
12
|
+
export default React.memo(ZSText);
|
|
24
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSText/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSText/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AAOzC,SAAS,MAAM,CAAC,EACd,IAAI,GAAG,QAAQ,EACf,KAAK,GAAG,MAAM,EACd,GAAG,KAAK,EACI;IACZ,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC3C,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA8B,CAAC;IAChE,MAAM,SAAS,GAAG,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAEnD,OAAO,CACL,KAAC,QAAQ,OAAK,KAAK,EAAE,KAAK,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,YAClF,KAAK,CAAC,QAAQ,GACN,CACZ,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { TextProps } from \"react-native\";\nimport { useTheme } from \"../../context/ThemeContext\";\nimport { TypoColorOptions, TypoOptions, TypoStyle, TypoSubStyle } from \"../../theme/types\";\nimport { resolveTextColor } from \"../../theme/resolveColor\";\nimport TextAtom from \"../atoms/TextAtom\";\n\nexport interface ZSTextProps extends TextProps {\n typo?: TypoOptions;\n color?: TypoColorOptions;\n}\n\nfunction ZSText({\n typo = 'body.2',\n color = 'base',\n ...props\n}: ZSTextProps) {\n const { palette, typography } = useTheme();\n const [s01, s02] = typo.split('.') as [TypoStyle, TypoSubStyle];\n const textColor = resolveTextColor(palette, color);\n\n return (\n <TextAtom {...props} style={[typography[s01][s02], { color: textColor }, props.style]}>\n {props.children}\n </TextAtom>\n );\n}\n\nexport default React.memo(ZSText);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSTextField/index.tsx"],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,sGA8Qf,CAAC;AAIH,eAAe,WAAW,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { useMemo, useCallback, useState, forwardRef, useEffect, useRef } from 'react';
|
|
2
3
|
import { Platform, TextInput } from 'react-native';
|
|
3
|
-
import Animated, { interpolate, useAnimatedStyle, useSharedValue, withTiming, ReduceMotion } from 'react-native-reanimated';
|
|
4
|
+
import Animated, { interpolate, interpolateColor, useAnimatedStyle, useSharedValue, withTiming, ReduceMotion } from 'react-native-reanimated';
|
|
4
5
|
import ButtonClose from './ui/ButtonClose';
|
|
5
6
|
import ErrorComponent from './ui/ErrorComponent';
|
|
6
7
|
import { extractStyle } from '../../model/utils';
|
|
@@ -15,11 +16,13 @@ const ZSTextField = forwardRef(({ typo = 'body.2', status = 'default', value, on
|
|
|
15
16
|
const fErrorColor = errorColor || palette.danger.main;
|
|
16
17
|
const fontSize = extractStyle(typography[primaryStyle][subStyle], 'fontSize') || 17;
|
|
17
18
|
const fontFamily = extractStyle(typography[primaryStyle][subStyle], 'fontFamily') || '';
|
|
18
|
-
const floatProgress = useSharedValue(value !== '' ? 1 : 0);
|
|
19
|
-
const [isFocusedForUI, setIsFocusedForUI] = useState(false);
|
|
20
|
-
const boxHeightValue = useSharedValue(0);
|
|
21
19
|
const isError = status === 'error';
|
|
22
20
|
const hasValue = value !== '';
|
|
21
|
+
const floatProgress = useSharedValue(hasValue ? 1 : 0);
|
|
22
|
+
const focusProgress = useSharedValue(0);
|
|
23
|
+
const errorProgress = useSharedValue(isError ? 1 : 0);
|
|
24
|
+
const boxHeightValue = useSharedValue(0);
|
|
25
|
+
const [isFocusedForUI, setIsFocusedForUI] = useState(false);
|
|
23
26
|
const isFocusedRef = useRef(false);
|
|
24
27
|
const hasValueRef = useRef(hasValue);
|
|
25
28
|
hasValueRef.current = hasValue;
|
|
@@ -29,12 +32,26 @@ const ZSTextField = forwardRef(({ typo = 'body.2', status = 'default', value, on
|
|
|
29
32
|
floatProgress.value = withTiming(target, TIMING_CONFIG);
|
|
30
33
|
}
|
|
31
34
|
}, [hasValue]);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const target = isError ? 1 : 0;
|
|
37
|
+
if (errorProgress.value !== target) {
|
|
38
|
+
errorProgress.value = withTiming(target, TIMING_CONFIG);
|
|
39
|
+
}
|
|
40
|
+
}, [isError]);
|
|
32
41
|
const animationConstants = useMemo(() => ({
|
|
33
42
|
baseFontSize: fontSize + (boxStyle === 'inbox' ? 1 : 0),
|
|
34
43
|
targetFontSize: boxStyle === 'inbox' ? 10 : 11,
|
|
35
44
|
baseTop: isTextArea ? 12 : 0,
|
|
36
45
|
targetTopOffset: boxStyle === 'inbox' ? 17 : 2,
|
|
37
46
|
}), [fontSize, boxStyle, isTextArea]);
|
|
47
|
+
const colorConfig = useMemo(() => ({
|
|
48
|
+
primaryColor: focusColor || palette.primary.main,
|
|
49
|
+
defaultBorderColor: borderColor || palette.grey[30],
|
|
50
|
+
defaultLabelColor: labelColor || palette.text.secondary,
|
|
51
|
+
placeholderColor: placeHolderColor || palette.grey[40],
|
|
52
|
+
errorColor: fErrorColor,
|
|
53
|
+
}), [focusColor, palette.primary.main, borderColor, palette.grey, labelColor, palette.text.secondary, placeHolderColor, fErrorColor]);
|
|
54
|
+
const nonFocusLabelColor = useMemo(() => (hasValue ? colorConfig.defaultLabelColor : colorConfig.placeholderColor), [hasValue, colorConfig.defaultLabelColor, colorConfig.placeholderColor]);
|
|
38
55
|
const animatedLabelStyle = useAnimatedStyle(() => {
|
|
39
56
|
const progress = floatProgress.value;
|
|
40
57
|
const labelTranslateY = interpolate(progress, [0, 1], [
|
|
@@ -42,22 +59,35 @@ const ZSTextField = forwardRef(({ typo = 'body.2', status = 'default', value, on
|
|
|
42
59
|
isTextArea ? -24 : -(boxHeightValue.value / 2) - 1 + animationConstants.targetTopOffset - animationConstants.baseTop,
|
|
43
60
|
], 'clamp');
|
|
44
61
|
const labelScale = interpolate(progress, [0, 1], [1, animationConstants.targetFontSize / animationConstants.baseFontSize], 'clamp');
|
|
62
|
+
const focusedColor = interpolateColor(focusProgress.value, [0, 1], [nonFocusLabelColor, colorConfig.primaryColor]);
|
|
63
|
+
const color = interpolateColor(errorProgress.value, [0, 1], [focusedColor, colorConfig.errorColor]);
|
|
45
64
|
return {
|
|
65
|
+
color,
|
|
46
66
|
transform: [
|
|
47
67
|
{ translateY: labelTranslateY },
|
|
48
68
|
{ scale: labelScale },
|
|
49
69
|
],
|
|
50
70
|
};
|
|
51
|
-
}, [animationConstants, isTextArea]);
|
|
71
|
+
}, [animationConstants, isTextArea, nonFocusLabelColor, colorConfig.primaryColor, colorConfig.errorColor]);
|
|
72
|
+
const animatedBorderStyle = useAnimatedStyle(() => {
|
|
73
|
+
const focusedColor = interpolateColor(focusProgress.value, [0, 1], [colorConfig.defaultBorderColor, colorConfig.primaryColor]);
|
|
74
|
+
const borderColor = interpolateColor(errorProgress.value, [0, 1], [focusedColor, colorConfig.errorColor]);
|
|
75
|
+
return { borderColor };
|
|
76
|
+
}, [colorConfig.defaultBorderColor, colorConfig.primaryColor, colorConfig.errorColor]);
|
|
52
77
|
const handleLayout = useCallback((event) => {
|
|
53
78
|
const { height } = event.nativeEvent.layout;
|
|
54
|
-
boxHeightValue.value
|
|
79
|
+
if (boxHeightValue.value !== height) {
|
|
80
|
+
boxHeightValue.value = height;
|
|
81
|
+
}
|
|
55
82
|
}, []);
|
|
56
83
|
const handleFocus = useCallback(() => {
|
|
57
84
|
isFocusedRef.current = true;
|
|
58
85
|
if (floatProgress.value !== 1) {
|
|
59
86
|
floatProgress.value = withTiming(1, TIMING_CONFIG);
|
|
60
87
|
}
|
|
88
|
+
if (focusProgress.value !== 1) {
|
|
89
|
+
focusProgress.value = withTiming(1, TIMING_CONFIG);
|
|
90
|
+
}
|
|
61
91
|
setIsFocusedForUI(true);
|
|
62
92
|
}, []);
|
|
63
93
|
const handleBlur = useCallback(() => {
|
|
@@ -66,27 +96,11 @@ const ZSTextField = forwardRef(({ typo = 'body.2', status = 'default', value, on
|
|
|
66
96
|
if (floatProgress.value !== target) {
|
|
67
97
|
floatProgress.value = withTiming(target, TIMING_CONFIG);
|
|
68
98
|
}
|
|
99
|
+
if (focusProgress.value !== 0) {
|
|
100
|
+
focusProgress.value = withTiming(0, TIMING_CONFIG);
|
|
101
|
+
}
|
|
69
102
|
setIsFocusedForUI(false);
|
|
70
103
|
}, []);
|
|
71
|
-
const colorConfig = useMemo(() => ({
|
|
72
|
-
primaryColor: focusColor || palette.primary.main,
|
|
73
|
-
defaultBorderColor: borderColor || palette.grey[30],
|
|
74
|
-
defaultLabelColor: labelColor || palette.text.secondary,
|
|
75
|
-
placeholderColor: placeHolderColor || palette.grey[40],
|
|
76
|
-
errorColor: fErrorColor,
|
|
77
|
-
}), [focusColor, palette.primary.main, borderColor, palette.grey, labelColor, palette.text.secondary, placeHolderColor, fErrorColor]);
|
|
78
|
-
const currentBorderColor = isError
|
|
79
|
-
? colorConfig.errorColor
|
|
80
|
-
: isFocusedForUI
|
|
81
|
-
? colorConfig.primaryColor
|
|
82
|
-
: colorConfig.defaultBorderColor;
|
|
83
|
-
const currentLabelColor = isError
|
|
84
|
-
? colorConfig.errorColor
|
|
85
|
-
: isFocusedForUI
|
|
86
|
-
? colorConfig.primaryColor
|
|
87
|
-
: hasValue
|
|
88
|
-
? colorConfig.defaultLabelColor
|
|
89
|
-
: colorConfig.placeholderColor;
|
|
90
104
|
const styleConfig = useMemo(() => {
|
|
91
105
|
const baseStyle = {
|
|
92
106
|
width: '100%',
|
|
@@ -96,7 +110,6 @@ const ZSTextField = forwardRef(({ typo = 'body.2', status = 'default', value, on
|
|
|
96
110
|
backgroundColor: inputBgColor || palette.background.base,
|
|
97
111
|
paddingTop: boxStyle === 'inbox' ? 13 : 0,
|
|
98
112
|
};
|
|
99
|
-
// 박스 스타일에 따른 테두리 설정
|
|
100
113
|
let borderStyle = {};
|
|
101
114
|
if (boxStyle === 'outline' || boxStyle === 'inbox') {
|
|
102
115
|
borderStyle = { borderWidth };
|
|
@@ -104,7 +117,6 @@ const ZSTextField = forwardRef(({ typo = 'body.2', status = 'default', value, on
|
|
|
104
117
|
else if (boxStyle === 'underline') {
|
|
105
118
|
borderStyle = { borderBottomWidth: borderWidth };
|
|
106
119
|
}
|
|
107
|
-
// innerBoxStyle에 따른 스타일 설정
|
|
108
120
|
let innerStyle = {};
|
|
109
121
|
if (innerBoxStyle === 'top') {
|
|
110
122
|
innerStyle = {
|
|
@@ -142,6 +154,8 @@ const ZSTextField = forwardRef(({ typo = 'body.2', status = 'default', value, on
|
|
|
142
154
|
borderRadius: boxStyle === 'outline' ? 5 : 0,
|
|
143
155
|
...(Platform.OS === 'android' ? { overflow: 'hidden' } : {}),
|
|
144
156
|
}), [fontSize, animationConstants.baseTop, paddingHorizontal, labelBgColor, palette.background.base, boxStyle, fontFamily]);
|
|
157
|
+
const boxStyleArray = useMemo(() => [styleConfig, animatedBorderStyle], [styleConfig, animatedBorderStyle]);
|
|
158
|
+
const labelStyleArray = useMemo(() => [labelTextStyle, animatedLabelStyle], [labelTextStyle, animatedLabelStyle]);
|
|
145
159
|
const handleTextChange = (text) => {
|
|
146
160
|
if (onChangeText)
|
|
147
161
|
onChangeText(text);
|
|
@@ -161,21 +175,7 @@ const ZSTextField = forwardRef(({ typo = 'body.2', status = 'default', value, on
|
|
|
161
175
|
], [palette.text.base, fontSize, fontFamily, textInputProps?.style]);
|
|
162
176
|
const shouldShowCloseButton = value && isFocusedForUI;
|
|
163
177
|
const shouldShowError = status === 'error' && errorMessage;
|
|
164
|
-
return (
|
|
165
|
-
<ViewAtom style={[styleConfig, { borderColor: currentBorderColor }]} onLayout={handleLayout} pointerEvents={disabled ? 'none' : 'auto'}>
|
|
166
|
-
<TextInput {...textInputProps} ref={ref} style={textInputStyle} value={value} onFocus={handleFocus} onBlur={handleBlur} onChangeText={handleTextChange} allowFontScaling={allowFontScaling} selectionColor={palette.grey[50]} autoCorrect={false} spellCheck={false}/>
|
|
167
|
-
|
|
168
|
-
<ViewAtom pointerEvents="none" style={{ position: 'absolute' }}>
|
|
169
|
-
<Animated.Text allowFontScaling={allowFontScaling} style={[labelTextStyle, { color: currentLabelColor }, animatedLabelStyle]}>
|
|
170
|
-
{label}
|
|
171
|
-
</Animated.Text>
|
|
172
|
-
</ViewAtom>
|
|
173
|
-
|
|
174
|
-
{shouldShowCloseButton && (<ButtonClose marginTop={isTextArea ? 13 : undefined} onChangeText={onChangeText}/>)}
|
|
175
|
-
</ViewAtom>
|
|
176
|
-
|
|
177
|
-
{shouldShowError && (<ErrorComponent errorMessage={errorMessage} errorColor={fErrorColor}/>)}
|
|
178
|
-
</ViewAtom>);
|
|
178
|
+
return (_jsxs(ViewAtom, { style: { alignSelf: 'stretch', width: '100%' }, children: [_jsxs(Animated.View, { style: boxStyleArray, onLayout: handleLayout, pointerEvents: disabled ? 'none' : 'auto', children: [_jsx(TextInput, { ...textInputProps, ref: ref, style: textInputStyle, value: value, onFocus: handleFocus, onBlur: handleBlur, onChangeText: handleTextChange, allowFontScaling: allowFontScaling, selectionColor: palette.grey[50], autoCorrect: false, spellCheck: false }), _jsx(ViewAtom, { pointerEvents: "none", style: { position: 'absolute' }, children: _jsx(Animated.Text, { allowFontScaling: allowFontScaling, style: labelStyleArray, children: label }) }), shouldShowCloseButton && (_jsx(ButtonClose, { marginTop: isTextArea ? 13 : undefined, onChangeText: onChangeText }))] }), shouldShowError && (_jsx(ErrorComponent, { errorMessage: errorMessage, errorColor: fErrorColor }))] }));
|
|
179
179
|
});
|
|
180
180
|
ZSTextField.displayName = 'ZSTextField';
|
|
181
181
|
export default ZSTextField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSTextField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,SA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AAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,EAAG,CACpF,CACH;MAAA,EAAE,QAAQ,CAEV;;MAAA,CAAC,eAAe,IAAI,CAClB,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,EAAG,CACxE,CACH;IAAA,EAAE,QAAQ,CAAC,CACZ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAExC,eAAe,WAAW,CAAC","sourcesContent":["import { useMemo, useCallback, useState, forwardRef, useEffect, useRef } from 'react';\nimport { LayoutChangeEvent, Platform, StyleProp, TextInput, TextInputProps, TextStyle } from 'react-native';\nimport Animated, { interpolate, useAnimatedStyle, useSharedValue, withTiming, ReduceMotion } from 'react-native-reanimated';\nimport ButtonClose from './ui/ButtonClose';\nimport ErrorComponent from './ui/ErrorComponent';\nimport { TypoOptions, TypoStyle, TypoSubStyle } from '../../theme/types';\nimport { extractStyle } from '../../model/utils';\nimport { useTheme } from '../../context/ThemeContext';\nimport ViewAtom from '../atoms/ViewAtom';\n\nexport type BoxStyle = 'outline' | 'underline' | 'inbox';\n\nconst iosOffset = Platform.OS === 'ios' ? 8 : 4;\nconst ANIM_DURATION = 150;\nconst TIMING_CONFIG = { duration: ANIM_DURATION, reduceMotion: ReduceMotion.System };\n\ninterface TextFieldProps {\n typo?: TypoOptions;\n status?: 'default' | 'error';\n value: string;\n onChangeText?: (text: string) => void;\n inputBgColor?: string;\n labelBgColor?: string;\n label?: string;\n labelColor?: string;\n placeHolderColor?: string;\n fontSize?: number;\n borderColor?: string;\n borderRadius?: number;\n focusColor?: string;\n errorColor?: string;\n paddingHorizontal?: number;\n borderWidth?: number;\n errorMessage?: string;\n textInputProps?: TextInputProps;\n boxStyle?: BoxStyle;\n innerBoxStyle?: 'top' | 'middle' | 'bottom';\n disabled?: boolean;\n allowFontScaling?: boolean;\n isTextArea?: boolean;\n}\n\nexport type ZSTextFieldRef = TextInput;\n\nconst ZSTextField = forwardRef<ZSTextFieldRef, TextFieldProps>(({\n typo = 'body.2',\n status = 'default',\n value,\n onChangeText,\n label = 'Placeholder',\n labelColor,\n placeHolderColor,\n inputBgColor,\n labelBgColor,\n borderWidth = 1.2,\n borderColor,\n focusColor,\n errorColor,\n borderRadius = 14,\n paddingHorizontal = 15,\n errorMessage,\n textInputProps,\n boxStyle = 'outline',\n innerBoxStyle,\n disabled = false,\n allowFontScaling = true,\n isTextArea = false,\n}, ref) => {\n const { typography, palette } = useTheme();\n const [primaryStyle, subStyle] = typo.split('.') as [TypoStyle, TypoSubStyle];\n const fErrorColor = errorColor || palette.danger.main;\n\n const fontSize = extractStyle(typography[primaryStyle][subStyle], 'fontSize') as number || 17;\n const fontFamily = extractStyle(typography[primaryStyle][subStyle], 'fontFamily') as string || '';\n const floatProgress = useSharedValue(value !== '' ? 1 : 0);\n const [isFocusedForUI, setIsFocusedForUI] = useState<boolean>(false);\n const boxHeightValue = useSharedValue(0);\n\n const isError = status === 'error';\n const hasValue = value !== '';\n\n const isFocusedRef = useRef(false);\n const hasValueRef = useRef(hasValue);\n hasValueRef.current = hasValue;\n\n useEffect(() => {\n const target = hasValue ? 1 : 0;\n if (!isFocusedRef.current && floatProgress.value !== target) {\n floatProgress.value = withTiming(target, TIMING_CONFIG);\n }\n }, [hasValue]);\n\n const animationConstants = useMemo(() => ({\n baseFontSize: fontSize + (boxStyle === 'inbox' ? 1 : 0),\n targetFontSize: boxStyle === 'inbox' ? 10 : 11,\n baseTop: isTextArea ? 12 : 0,\n targetTopOffset: boxStyle === 'inbox' ? 17 : 2,\n }), [fontSize, boxStyle, isTextArea]);\n\n const animatedLabelStyle = useAnimatedStyle(() => {\n const progress = floatProgress.value;\n\n const labelTranslateY = interpolate(\n progress,\n [0, 1],\n [\n 0,\n isTextArea ? -24 : -(boxHeightValue.value / 2) - 1 + animationConstants.targetTopOffset - animationConstants.baseTop,\n ],\n 'clamp'\n );\n\n const labelScale = interpolate(\n progress,\n [0, 1],\n [1, animationConstants.targetFontSize / animationConstants.baseFontSize],\n 'clamp'\n );\n\n return {\n transform: [\n { translateY: labelTranslateY },\n { scale: labelScale },\n ],\n };\n }, [animationConstants, isTextArea]);\n\n const handleLayout = useCallback((event: LayoutChangeEvent) => {\n const { height } = event.nativeEvent.layout;\n boxHeightValue.value = height;\n }, []);\n\n const handleFocus = useCallback(() => {\n isFocusedRef.current = true;\n if (floatProgress.value !== 1) {\n floatProgress.value = withTiming(1, TIMING_CONFIG);\n }\n setIsFocusedForUI(true);\n }, []);\n\n const handleBlur = useCallback(() => {\n isFocusedRef.current = false;\n const target = hasValueRef.current ? 1 : 0;\n if (floatProgress.value !== target) {\n floatProgress.value = withTiming(target, TIMING_CONFIG);\n }\n setIsFocusedForUI(false);\n }, []);\n\n const colorConfig = useMemo(() => ({\n primaryColor: focusColor || palette.primary.main,\n defaultBorderColor: borderColor || palette.grey[30],\n defaultLabelColor: labelColor || palette.text.secondary,\n placeholderColor: placeHolderColor || palette.grey[40],\n errorColor: fErrorColor,\n }), [focusColor, palette.primary.main, borderColor, palette.grey, labelColor, palette.text.secondary, placeHolderColor, fErrorColor]);\n\n const currentBorderColor = isError\n ? colorConfig.errorColor\n : isFocusedForUI\n ? colorConfig.primaryColor\n : colorConfig.defaultBorderColor;\n\n const currentLabelColor = isError\n ? colorConfig.errorColor\n : isFocusedForUI\n ? colorConfig.primaryColor\n : hasValue\n ? colorConfig.defaultLabelColor\n : colorConfig.placeholderColor;\n\n const styleConfig = useMemo(() => {\n const baseStyle = {\n width: '100%' as const,\n justifyContent: isTextArea ? 'flex-start' as const : 'center' as const,\n borderRadius,\n paddingHorizontal,\n backgroundColor: inputBgColor || palette.background.base,\n paddingTop: boxStyle === 'inbox' ? 13 : 0,\n };\n\n // 박스 스타일에 따른 테두리 설정\n let borderStyle = {};\n if (boxStyle === 'outline' || boxStyle === 'inbox') {\n borderStyle = { borderWidth };\n } else if (boxStyle === 'underline') {\n borderStyle = { borderBottomWidth: borderWidth };\n }\n\n // innerBoxStyle에 따른 스타일 설정\n let innerStyle = {};\n if (innerBoxStyle === 'top') {\n innerStyle = {\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomWidth: borderWidth / 2\n };\n } else if (innerBoxStyle === 'middle') {\n innerStyle = {\n borderRadius: 0,\n borderTopWidth: borderWidth / 2,\n borderBottomWidth: borderWidth / 2\n };\n } else if (innerBoxStyle === 'bottom') {\n innerStyle = {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderTopWidth: borderWidth / 2\n };\n }\n\n return { ...baseStyle, ...borderStyle, ...innerStyle };\n }, [isTextArea, borderRadius, paddingHorizontal, inputBgColor, borderWidth, boxStyle, innerBoxStyle, palette.background.base]);\n\n const labelTextStyle: StyleProp<TextStyle> = useMemo(() => ({\n fontSize,\n top: animationConstants.baseTop,\n left: paddingHorizontal,\n transformOrigin: 'left center',\n backgroundColor: labelBgColor || palette.background.base,\n paddingHorizontal: boxStyle === 'outline' ? 5 : 0,\n paddingVertical: 2,\n textAlignVertical: 'center' as const,\n fontFamily,\n borderRadius: boxStyle === 'outline' ? 5 : 0,\n ...(Platform.OS === 'android' ? { overflow: 'hidden' as const } : {}),\n }), [fontSize, animationConstants.baseTop, paddingHorizontal, labelBgColor, palette.background.base, boxStyle, fontFamily]);\n\n const handleTextChange = (text: string) => {\n if (onChangeText) onChangeText(text);\n };\n\n const textInputStyle = useMemo(() => [\n {\n paddingTop: 7 + iosOffset,\n paddingBottom: 5 + iosOffset,\n color: palette.text.base,\n fontSize,\n width: '100%' as const,\n paddingRight: 25,\n fontFamily,\n ...(Platform.OS === 'web' ? { outline: 'none' } : {}),\n },\n textInputProps?.style,\n ], [palette.text.base, fontSize, fontFamily, textInputProps?.style]);\n\n const shouldShowCloseButton = value && isFocusedForUI;\n const shouldShowError = status === 'error' && errorMessage;\n\n return (\n <ViewAtom style={{ alignSelf: 'stretch', width: '100%' }}>\n <ViewAtom\n style={[styleConfig, { borderColor: currentBorderColor }]}\n onLayout={handleLayout}\n pointerEvents={disabled ? 'none' : 'auto'}\n >\n <TextInput\n {...textInputProps}\n ref={ref}\n style={textInputStyle}\n value={value}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChangeText={handleTextChange}\n allowFontScaling={allowFontScaling}\n selectionColor={palette.grey[50]}\n autoCorrect={false}\n spellCheck={false}\n />\n\n <ViewAtom pointerEvents=\"none\" style={{ position: 'absolute' }}>\n <Animated.Text allowFontScaling={allowFontScaling} style={[labelTextStyle, { color: currentLabelColor }, animatedLabelStyle]}>\n {label}\n </Animated.Text>\n </ViewAtom>\n\n {shouldShowCloseButton && (\n <ButtonClose marginTop={isTextArea ? 13 : undefined} onChangeText={onChangeText} />\n )}\n </ViewAtom>\n\n {shouldShowError && (\n <ErrorComponent errorMessage={errorMessage} errorColor={fErrorColor} />\n )}\n </ViewAtom>\n );\n});\n\nZSTextField.displayName = 'ZSTextField';\n\nexport default ZSTextField;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSTextField/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtF,OAAO,EAAqB,QAAQ,EAAa,SAAS,EAA6B,MAAM,cAAc,CAAC;AAC5G,OAAO,QAAQ,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC9I,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACt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useMemo, useCallback, useState, forwardRef, useEffect, useRef } from 'react';\nimport { LayoutChangeEvent, Platform, StyleProp, TextInput, TextInputProps, TextStyle } from 'react-native';\nimport Animated, { interpolate, interpolateColor, useAnimatedStyle, useSharedValue, withTiming, ReduceMotion } from 'react-native-reanimated';\nimport ButtonClose from './ui/ButtonClose';\nimport ErrorComponent from './ui/ErrorComponent';\nimport { TypoOptions, TypoStyle, TypoSubStyle } from '../../theme/types';\nimport { extractStyle } from '../../model/utils';\nimport { useTheme } from '../../context/ThemeContext';\nimport ViewAtom from '../atoms/ViewAtom';\n\nexport type BoxStyle = 'outline' | 'underline' | 'inbox';\n\nconst iosOffset = Platform.OS === 'ios' ? 8 : 4;\nconst ANIM_DURATION = 150;\nconst TIMING_CONFIG = { duration: ANIM_DURATION, reduceMotion: ReduceMotion.System };\n\ninterface TextFieldProps {\n typo?: TypoOptions;\n status?: 'default' | 'error';\n value: string;\n onChangeText?: (text: string) => void;\n inputBgColor?: string;\n labelBgColor?: string;\n label?: string;\n labelColor?: string;\n placeHolderColor?: string;\n fontSize?: number;\n borderColor?: string;\n borderRadius?: number;\n focusColor?: string;\n errorColor?: string;\n paddingHorizontal?: number;\n borderWidth?: number;\n errorMessage?: string;\n textInputProps?: TextInputProps;\n boxStyle?: BoxStyle;\n innerBoxStyle?: 'top' | 'middle' | 'bottom';\n disabled?: boolean;\n allowFontScaling?: boolean;\n isTextArea?: boolean;\n}\n\nexport type ZSTextFieldRef = TextInput;\n\nconst ZSTextField = forwardRef<ZSTextFieldRef, TextFieldProps>(({\n typo = 'body.2',\n status = 'default',\n value,\n onChangeText,\n label = 'Placeholder',\n labelColor,\n placeHolderColor,\n inputBgColor,\n labelBgColor,\n borderWidth = 1.2,\n borderColor,\n focusColor,\n errorColor,\n borderRadius = 14,\n paddingHorizontal = 15,\n errorMessage,\n textInputProps,\n boxStyle = 'outline',\n innerBoxStyle,\n disabled = false,\n allowFontScaling = true,\n isTextArea = false,\n}, ref) => {\n const { typography, palette } = useTheme();\n const [primaryStyle, subStyle] = typo.split('.') as [TypoStyle, TypoSubStyle];\n const fErrorColor = errorColor || palette.danger.main;\n\n const fontSize = extractStyle(typography[primaryStyle][subStyle], 'fontSize') as number || 17;\n const fontFamily = extractStyle(typography[primaryStyle][subStyle], 'fontFamily') as string || '';\n\n const isError = status === 'error';\n const hasValue = value !== '';\n\n const floatProgress = useSharedValue(hasValue ? 1 : 0);\n const focusProgress = useSharedValue(0);\n const errorProgress = useSharedValue(isError ? 1 : 0);\n const boxHeightValue = useSharedValue(0);\n\n const [isFocusedForUI, setIsFocusedForUI] = useState<boolean>(false);\n\n const isFocusedRef = useRef(false);\n const hasValueRef = useRef(hasValue);\n hasValueRef.current = hasValue;\n\n useEffect(() => {\n const target = hasValue ? 1 : 0;\n if (!isFocusedRef.current && floatProgress.value !== target) {\n floatProgress.value = withTiming(target, TIMING_CONFIG);\n }\n }, [hasValue]);\n\n useEffect(() => {\n const target = isError ? 1 : 0;\n if (errorProgress.value !== target) {\n errorProgress.value = withTiming(target, TIMING_CONFIG);\n }\n }, [isError]);\n\n const animationConstants = useMemo(() => ({\n baseFontSize: fontSize + (boxStyle === 'inbox' ? 1 : 0),\n targetFontSize: boxStyle === 'inbox' ? 10 : 11,\n baseTop: isTextArea ? 12 : 0,\n targetTopOffset: boxStyle === 'inbox' ? 17 : 2,\n }), [fontSize, boxStyle, isTextArea]);\n\n const colorConfig = useMemo(() => ({\n primaryColor: focusColor || palette.primary.main,\n defaultBorderColor: borderColor || palette.grey[30],\n defaultLabelColor: labelColor || palette.text.secondary,\n placeholderColor: placeHolderColor || palette.grey[40],\n errorColor: fErrorColor,\n }), [focusColor, palette.primary.main, borderColor, palette.grey, labelColor, palette.text.secondary, placeHolderColor, fErrorColor]);\n\n const nonFocusLabelColor = useMemo(\n () => (hasValue ? colorConfig.defaultLabelColor : colorConfig.placeholderColor),\n [hasValue, colorConfig.defaultLabelColor, colorConfig.placeholderColor]\n );\n\n const animatedLabelStyle = useAnimatedStyle(() => {\n const progress = floatProgress.value;\n\n const labelTranslateY = interpolate(\n progress,\n [0, 1],\n [\n 0,\n isTextArea ? -24 : -(boxHeightValue.value / 2) - 1 + animationConstants.targetTopOffset - animationConstants.baseTop,\n ],\n 'clamp'\n );\n\n const labelScale = interpolate(\n progress,\n [0, 1],\n [1, animationConstants.targetFontSize / animationConstants.baseFontSize],\n 'clamp'\n );\n\n const focusedColor = interpolateColor(focusProgress.value, [0, 1], [nonFocusLabelColor, colorConfig.primaryColor]);\n const color = interpolateColor(errorProgress.value, [0, 1], [focusedColor, colorConfig.errorColor]);\n\n return {\n color,\n transform: [\n { translateY: labelTranslateY },\n { scale: labelScale },\n ],\n };\n }, [animationConstants, isTextArea, nonFocusLabelColor, colorConfig.primaryColor, colorConfig.errorColor]);\n\n const animatedBorderStyle = useAnimatedStyle(() => {\n const focusedColor = interpolateColor(focusProgress.value, [0, 1], [colorConfig.defaultBorderColor, colorConfig.primaryColor]);\n const borderColor = interpolateColor(errorProgress.value, [0, 1], [focusedColor, colorConfig.errorColor]);\n return { borderColor };\n }, [colorConfig.defaultBorderColor, colorConfig.primaryColor, colorConfig.errorColor]);\n\n const handleLayout = useCallback((event: LayoutChangeEvent) => {\n const { height } = event.nativeEvent.layout;\n if (boxHeightValue.value !== height) {\n boxHeightValue.value = height;\n }\n }, []);\n\n const handleFocus = useCallback(() => {\n isFocusedRef.current = true;\n if (floatProgress.value !== 1) {\n floatProgress.value = withTiming(1, TIMING_CONFIG);\n }\n if (focusProgress.value !== 1) {\n focusProgress.value = withTiming(1, TIMING_CONFIG);\n }\n setIsFocusedForUI(true);\n }, []);\n\n const handleBlur = useCallback(() => {\n isFocusedRef.current = false;\n const target = hasValueRef.current ? 1 : 0;\n if (floatProgress.value !== target) {\n floatProgress.value = withTiming(target, TIMING_CONFIG);\n }\n if (focusProgress.value !== 0) {\n focusProgress.value = withTiming(0, TIMING_CONFIG);\n }\n setIsFocusedForUI(false);\n }, []);\n\n const styleConfig = useMemo(() => {\n const baseStyle = {\n width: '100%' as const,\n justifyContent: isTextArea ? 'flex-start' as const : 'center' as const,\n borderRadius,\n paddingHorizontal,\n backgroundColor: inputBgColor || palette.background.base,\n paddingTop: boxStyle === 'inbox' ? 13 : 0,\n };\n\n let borderStyle = {};\n if (boxStyle === 'outline' || boxStyle === 'inbox') {\n borderStyle = { borderWidth };\n } else if (boxStyle === 'underline') {\n borderStyle = { borderBottomWidth: borderWidth };\n }\n\n let innerStyle = {};\n if (innerBoxStyle === 'top') {\n innerStyle = {\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomWidth: borderWidth / 2\n };\n } else if (innerBoxStyle === 'middle') {\n innerStyle = {\n borderRadius: 0,\n borderTopWidth: borderWidth / 2,\n borderBottomWidth: borderWidth / 2\n };\n } else if (innerBoxStyle === 'bottom') {\n innerStyle = {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderTopWidth: borderWidth / 2\n };\n }\n\n return { ...baseStyle, ...borderStyle, ...innerStyle };\n }, [isTextArea, borderRadius, paddingHorizontal, inputBgColor, borderWidth, boxStyle, innerBoxStyle, palette.background.base]);\n\n const labelTextStyle: StyleProp<TextStyle> = useMemo(() => ({\n fontSize,\n top: animationConstants.baseTop,\n left: paddingHorizontal,\n transformOrigin: 'left center',\n backgroundColor: labelBgColor || palette.background.base,\n paddingHorizontal: boxStyle === 'outline' ? 5 : 0,\n paddingVertical: 2,\n textAlignVertical: 'center' as const,\n fontFamily,\n borderRadius: boxStyle === 'outline' ? 5 : 0,\n ...(Platform.OS === 'android' ? { overflow: 'hidden' as const } : {}),\n }), [fontSize, animationConstants.baseTop, paddingHorizontal, labelBgColor, palette.background.base, boxStyle, fontFamily]);\n\n const boxStyleArray = useMemo(\n () => [styleConfig, animatedBorderStyle],\n [styleConfig, animatedBorderStyle]\n );\n\n const labelStyleArray = useMemo(\n () => [labelTextStyle, animatedLabelStyle],\n [labelTextStyle, animatedLabelStyle]\n );\n\n const handleTextChange = (text: string) => {\n if (onChangeText) onChangeText(text);\n };\n\n const textInputStyle = useMemo(() => [\n {\n paddingTop: 7 + iosOffset,\n paddingBottom: 5 + iosOffset,\n color: palette.text.base,\n fontSize,\n width: '100%' as const,\n paddingRight: 25,\n fontFamily,\n ...(Platform.OS === 'web' ? { outline: 'none' } : {}),\n },\n textInputProps?.style,\n ], [palette.text.base, fontSize, fontFamily, textInputProps?.style]);\n\n const shouldShowCloseButton = value && isFocusedForUI;\n const shouldShowError = status === 'error' && errorMessage;\n\n return (\n <ViewAtom style={{ alignSelf: 'stretch', width: '100%' }}>\n <Animated.View\n style={boxStyleArray}\n onLayout={handleLayout}\n pointerEvents={disabled ? 'none' : 'auto'}\n >\n <TextInput\n {...textInputProps}\n ref={ref}\n style={textInputStyle}\n value={value}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChangeText={handleTextChange}\n allowFontScaling={allowFontScaling}\n selectionColor={palette.grey[50]}\n autoCorrect={false}\n spellCheck={false}\n />\n\n <ViewAtom pointerEvents=\"none\" style={{ position: 'absolute' }}>\n <Animated.Text allowFontScaling={allowFontScaling} style={labelStyleArray}>\n {label}\n </Animated.Text>\n </ViewAtom>\n\n {shouldShowCloseButton && (\n <ButtonClose marginTop={isTextArea ? 13 : undefined} onChangeText={onChangeText} />\n )}\n </Animated.View>\n\n {shouldShowError && (\n <ErrorComponent errorMessage={errorMessage} errorColor={fErrorColor} />\n )}\n </ViewAtom>\n );\n});\n\nZSTextField.displayName = 'ZSTextField';\n\nexport default ZSTextField;\n"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { TouchableOpacity } from "react-native";
|
|
2
3
|
import { SvgX } from "../../../assets/SvgX";
|
|
3
4
|
const ButtonClose = ({ onChangeText, marginTop, ...props }) => {
|
|
4
|
-
return (
|
|
5
|
-
<SvgX color="#5E696E"/>
|
|
6
|
-
</TouchableOpacity>);
|
|
5
|
+
return (_jsx(TouchableOpacity, { style: { position: 'absolute', padding: 3, right: 15, borderRadius: 30, backgroundColor: '#e6e6e6', justifyContent: 'center', alignItems: 'center', ...marginTop && { top: marginTop } }, hitSlop: { top: 10, right: 10, bottom: 10, left: 10 }, onPress: () => { onChangeText?.(''); }, ...props, children: _jsx(SvgX, { color: "#5E696E" }) }));
|
|
7
6
|
};
|
|
8
7
|
export default ButtonClose;
|
|
9
8
|
//# sourceMappingURL=ButtonClose.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonClose.js","sourceRoot":"","sources":["../../../../src/ui/ZSTextField/ui/ButtonClose.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA8B,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,MAAM,WAAW,GAAG,CAAC,EACjB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EAIa,EAAE,EAAE;IACzB,OAAO,CACH,
|
|
1
|
+
{"version":3,"file":"ButtonClose.js","sourceRoot":"","sources":["../../../../src/ui/ZSTextField/ui/ButtonClose.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAA8B,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,MAAM,WAAW,GAAG,CAAC,EACjB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EAIa,EAAE,EAAE;IACzB,OAAO,CACH,KAAC,gBAAgB,IACb,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,SAAS,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EACxL,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EACrD,OAAO,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAClC,KAAK,YACT,KAAC,IAAI,IAAC,KAAK,EAAC,SAAS,GAAG,GACT,CACtB,CAAA;AACL,CAAC,CAAA;AAED,eAAe,WAAW,CAAC","sourcesContent":["import { TouchableOpacity, type TouchableOpacityProps } from \"react-native\";\nimport { SvgX } from \"../../../assets/SvgX\";\n\nconst ButtonClose = ({\n onChangeText,\n marginTop,\n ...props\n}: {\n onChangeText?: (text: string) => void;\n marginTop?: number;\n} & TouchableOpacityProps) => {\n return (\n <TouchableOpacity\n style={{ position: 'absolute', padding: 3, right: 15, borderRadius: 30, backgroundColor: '#e6e6e6', justifyContent: 'center', alignItems: 'center', ...marginTop && { top: marginTop } }}\n hitSlop={{ top: 10, right: 10, bottom: 10, left: 10 }}\n onPress={() => { onChangeText?.(''); }}\n {...props}>\n <SvgX color=\"#5E696E\" />\n </TouchableOpacity>\n )\n}\n\nexport default ButtonClose;\n"]}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import Animated, { FadeInDown } from "react-native-reanimated";
|
|
2
3
|
import ZSText from "../../ZSText";
|
|
3
4
|
import SvgExclamation from "../../../assets/SvgExclamation";
|
|
4
5
|
const ErrorComponent = ({ errorMessage, errorColor, ...props }) => {
|
|
5
|
-
return (
|
|
6
|
-
<SvgExclamation size={16} backgroundColor={errorColor}/>
|
|
7
|
-
|
|
8
|
-
<ZSText typo='body.4' style={{ marginLeft: 5, color: errorColor }}>
|
|
9
|
-
{errorMessage}
|
|
10
|
-
</ZSText>
|
|
11
|
-
</Animated.View>);
|
|
6
|
+
return (_jsxs(Animated.View, { entering: FadeInDown, style: { width: '100%', flexDirection: 'row', alignItems: 'center', paddingLeft: 5, paddingTop: 9 }, ...props, children: [_jsx(SvgExclamation, { size: 16, backgroundColor: errorColor }), _jsx(ZSText, { typo: 'body.4', style: { marginLeft: 5, color: errorColor }, children: errorMessage })] }));
|
|
12
7
|
};
|
|
13
8
|
export default ErrorComponent;
|
|
14
9
|
//# sourceMappingURL=ErrorComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorComponent.js","sourceRoot":"","sources":["../../../../src/ui/ZSTextField/ui/ErrorComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAG5D,MAAM,cAAc,GAAG,CAAC,EACtB,YAAY,EACZ,UAAU,EACV,GAAG,KAAK,EAIG,EAAE,EAAE;IACf,OAAO,CACL,
|
|
1
|
+
{"version":3,"file":"ErrorComponent.js","sourceRoot":"","sources":["../../../../src/ui/ZSTextField/ui/ErrorComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,QAAQ,EAAE,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAG5D,MAAM,cAAc,GAAG,CAAC,EACtB,YAAY,EACZ,UAAU,EACV,GAAG,KAAK,EAIG,EAAE,EAAE;IACf,OAAO,CACL,MAAC,QAAQ,CAAC,IAAI,IAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,KAAM,KAAK,aACjJ,KAAC,cAAc,IACb,IAAI,EAAE,EAAE,EACR,eAAe,EAAE,UAAU,GAC3B,EAEF,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,YAC9D,YAAY,GACN,IACK,CACjB,CAAA;AACH,CAAC,CAAA;AAED,eAAe,cAAc,CAAC","sourcesContent":["import Animated, { FadeInDown } from \"react-native-reanimated\";\nimport ZSText from \"../../ZSText\";\nimport SvgExclamation from \"../../../assets/SvgExclamation\";\nimport { type ViewProps } from \"react-native\";\n\nconst ErrorComponent = ({\n errorMessage,\n errorColor,\n ...props\n}: {\n errorMessage: string;\n errorColor: string;\n} & ViewProps) => {\n return (\n <Animated.View entering={FadeInDown} style={{ width: '100%', flexDirection: 'row', alignItems: 'center', paddingLeft: 5, paddingTop: 9 }} {...props}>\n <SvgExclamation\n size={16}\n backgroundColor={errorColor}\n />\n\n <ZSText typo='body.4' style={{ marginLeft: 5, color: errorColor }}>\n {errorMessage}\n </ZSText>\n </Animated.View>\n )\n}\n\nexport default ErrorComponent;\n"]}
|