related-ui-components 2.6.4 → 2.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/module/app.js +3 -1
- package/lib/module/app.js.map +1 -1
- package/lib/module/components/Input/CountryPickerView.js +2 -1
- package/lib/module/components/Input/CountryPickerView.js.map +1 -1
- package/lib/module/components/Input/Input.js +11 -8
- package/lib/module/components/Input/Input.js.map +1 -1
- package/lib/module/components/Input/PhoneInput.js +3 -5
- package/lib/module/components/Input/PhoneInput.js.map +1 -1
- package/lib/module/components/Input/index.js +2 -0
- package/lib/module/components/Input/index.js.map +1 -1
- package/lib/module/components/RangeSlider/RangeSlider.js +98 -19
- package/lib/module/components/RangeSlider/RangeSlider.js.map +1 -1
- package/lib/module/contexts/BottomSheetStackContext.js.map +1 -1
- package/lib/module/contexts/BottomSheetStackProvider.js +48 -59
- package/lib/module/contexts/BottomSheetStackProvider.js.map +1 -1
- package/lib/typescript/src/app.d.ts.map +1 -1
- package/lib/typescript/src/components/Input/CountryPickerView.d.ts +2 -2
- package/lib/typescript/src/components/Input/CountryPickerView.d.ts.map +1 -1
- package/lib/typescript/src/components/Input/Input.d.ts +1 -0
- package/lib/typescript/src/components/Input/Input.d.ts.map +1 -1
- package/lib/typescript/src/components/Input/PhoneInput.d.ts.map +1 -1
- package/lib/typescript/src/components/Input/index.d.ts +2 -0
- package/lib/typescript/src/components/Input/index.d.ts.map +1 -1
- package/lib/typescript/src/components/RangeSlider/RangeSlider.d.ts +1 -0
- package/lib/typescript/src/components/RangeSlider/RangeSlider.d.ts.map +1 -1
- package/lib/typescript/src/contexts/BottomSheetStackContext.d.ts +0 -1
- package/lib/typescript/src/contexts/BottomSheetStackContext.d.ts.map +1 -1
- package/lib/typescript/src/contexts/BottomSheetStackProvider.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/app.tsx +3 -1
- package/src/components/Input/CountryPickerView.tsx +4 -2
- package/src/components/Input/Input.tsx +12 -7
- package/src/components/Input/PhoneInput.tsx +3 -5
- package/src/components/Input/index.ts +6 -3
- package/src/components/RangeSlider/RangeSlider.tsx +113 -42
- package/src/contexts/BottomSheetStackContext.tsx +0 -1
- package/src/contexts/BottomSheetStackProvider.tsx +46 -66
- package/src/index.ts +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import BottomSheet, { BottomSheetBackdrop
|
|
3
|
+
import BottomSheet, { BottomSheetBackdrop } from "@gorhom/bottom-sheet";
|
|
4
4
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
-
import { BackHandler, StyleSheet
|
|
5
|
+
import { BackHandler, StyleSheet } from "react-native";
|
|
6
6
|
import Animated, { FadeIn, FadeOut } from "react-native-reanimated";
|
|
7
7
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
8
8
|
import { BottomSheetStackContext } from "./BottomSheetStackContext.js";
|
|
@@ -12,7 +12,6 @@ export const BottomSheetStackProvider = ({
|
|
|
12
12
|
}) => {
|
|
13
13
|
const [stack, setStack] = useState([]);
|
|
14
14
|
const sheetRef = useRef(null);
|
|
15
|
-
const modalRef = useRef(null);
|
|
16
15
|
const {
|
|
17
16
|
top
|
|
18
17
|
} = useSafeAreaInsets();
|
|
@@ -21,7 +20,6 @@ export const BottomSheetStackProvider = ({
|
|
|
21
20
|
}, []);
|
|
22
21
|
const clear = useCallback(() => {
|
|
23
22
|
sheetRef.current?.close();
|
|
24
|
-
modalRef.current?.dismiss();
|
|
25
23
|
setStack([]);
|
|
26
24
|
}, []);
|
|
27
25
|
const pop = useCallback(() => {
|
|
@@ -39,82 +37,73 @@ export const BottomSheetStackProvider = ({
|
|
|
39
37
|
const isOpen = stack.length > 0;
|
|
40
38
|
useEffect(() => {
|
|
41
39
|
if (isOpen && currentItem) {
|
|
42
|
-
|
|
43
|
-
sheetRef.current?.close();
|
|
44
|
-
modalRef.current?.present();
|
|
45
|
-
} else {
|
|
46
|
-
modalRef.current?.dismiss();
|
|
47
|
-
sheetRef.current?.snapToIndex(currentItem.initialSnapIndex ?? 0);
|
|
48
|
-
}
|
|
40
|
+
sheetRef.current?.snapToIndex(currentItem.initialSnapIndex ?? 0);
|
|
49
41
|
}
|
|
50
42
|
const backHandlerSubscription = BackHandler.addEventListener("hardwareBackPress", () => {
|
|
51
|
-
if (!isOpen) return false;
|
|
52
43
|
if (canGoBack) {
|
|
53
44
|
pop();
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
if (!canGoBack && stack.length === 1) {
|
|
48
|
+
sheetRef.current?.close();
|
|
49
|
+
return true;
|
|
56
50
|
}
|
|
57
|
-
return
|
|
51
|
+
return false;
|
|
58
52
|
});
|
|
59
53
|
return () => backHandlerSubscription.remove();
|
|
60
|
-
}, [isOpen, canGoBack, currentItem, pop,
|
|
54
|
+
}, [isOpen, canGoBack, currentItem, pop, stack]);
|
|
61
55
|
const AnimatedView = Animated.View;
|
|
62
56
|
const enteringAnimation = FadeIn.duration(200);
|
|
63
57
|
const exitingAnimation = FadeOut.duration(200);
|
|
64
58
|
const renderBackdrop = useCallback(props => /*#__PURE__*/_jsx(BottomSheetBackdrop, {
|
|
65
59
|
...props,
|
|
66
60
|
disappearsOnIndex: -1,
|
|
61
|
+
style: [props.style, {
|
|
62
|
+
backgroundColor: "rgba(0,0,0,0,1)"
|
|
63
|
+
}],
|
|
67
64
|
appearsOnIndex: 0,
|
|
68
65
|
pressBehavior: "close"
|
|
69
66
|
}), []);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
67
|
+
return /*#__PURE__*/_jsxs(BottomSheetStackContext.Provider, {
|
|
68
|
+
value: {
|
|
69
|
+
push,
|
|
70
|
+
pop,
|
|
71
|
+
replace,
|
|
72
|
+
clear,
|
|
73
|
+
canGoBack
|
|
74
|
+
},
|
|
75
|
+
children: [children, /*#__PURE__*/_jsx(BottomSheet, {
|
|
76
|
+
...currentItem?.bottomSheetProps,
|
|
77
|
+
ref: sheetRef,
|
|
78
|
+
index: -1,
|
|
79
|
+
snapPoints: currentItem?.snapPoints || ["100%"],
|
|
80
|
+
enableDynamicSizing: currentItem?.dynamicSizing ?? false,
|
|
81
|
+
enablePanDownToClose: true,
|
|
82
|
+
android_keyboardInputMode: "adjustResize",
|
|
83
|
+
enableBlurKeyboardOnGesture: true,
|
|
84
|
+
keyboardBlurBehavior: "restore",
|
|
85
|
+
keyboardBehavior: "fillParent",
|
|
86
|
+
onClose: clear,
|
|
87
|
+
backdropComponent: renderBackdrop,
|
|
88
|
+
topInset: top,
|
|
89
|
+
handleIndicatorStyle: {
|
|
90
|
+
backgroundColor: "#CCCCCC"
|
|
84
91
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
topInset: top,
|
|
94
|
-
handleIndicatorStyle: {
|
|
95
|
-
backgroundColor: "#CCCCCC"
|
|
96
|
-
},
|
|
97
|
-
style: styles.sheetContainer,
|
|
98
|
-
children: !currentItem?.isModal ? currentSheetContent : /*#__PURE__*/_jsx(View, {})
|
|
99
|
-
}), /*#__PURE__*/_jsx(BottomSheetModal, {
|
|
100
|
-
...currentItem?.bottomSheetProps,
|
|
101
|
-
ref: modalRef,
|
|
102
|
-
index: 0,
|
|
103
|
-
snapPoints: currentItem?.isModal ? currentItem?.snapPoints || ["100%"] : ["1%"],
|
|
104
|
-
onDismiss: clear,
|
|
105
|
-
topInset: top,
|
|
106
|
-
handleIndicatorStyle: {
|
|
107
|
-
backgroundColor: "#CCCCCC"
|
|
108
|
-
},
|
|
109
|
-
style: styles.sheetContainer,
|
|
110
|
-
children: currentItem?.isModal ? currentSheetContent : /*#__PURE__*/_jsx(View, {})
|
|
111
|
-
})]
|
|
112
|
-
})
|
|
92
|
+
style: styles.sheetContainer,
|
|
93
|
+
children: currentItem && /*#__PURE__*/_jsx(AnimatedView, {
|
|
94
|
+
entering: enteringAnimation,
|
|
95
|
+
exiting: exitingAnimation,
|
|
96
|
+
style: styles.animatedView,
|
|
97
|
+
children: currentItem.component
|
|
98
|
+
}, stack.length)
|
|
99
|
+
})]
|
|
113
100
|
});
|
|
114
101
|
};
|
|
115
102
|
const styles = StyleSheet.create({
|
|
116
103
|
sheetContainer: {
|
|
117
|
-
//
|
|
104
|
+
// backgroundColor: "#FFFFFF",
|
|
105
|
+
// borderTopLeftRadius: 20,
|
|
106
|
+
// borderTopRightRadius: 20,
|
|
118
107
|
},
|
|
119
108
|
animatedView: {
|
|
120
109
|
flex: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BottomSheet","BottomSheetBackdrop","
|
|
1
|
+
{"version":3,"names":["BottomSheet","BottomSheetBackdrop","React","useCallback","useEffect","useMemo","useRef","useState","BackHandler","StyleSheet","Animated","FadeIn","FadeOut","useSafeAreaInsets","BottomSheetStackContext","jsx","_jsx","jsxs","_jsxs","BottomSheetStackProvider","children","stack","setStack","sheetRef","top","push","item","prev","clear","current","close","pop","length","slice","replace","currentItem","canGoBack","isOpen","snapToIndex","initialSnapIndex","backHandlerSubscription","addEventListener","remove","AnimatedView","View","enteringAnimation","duration","exitingAnimation","renderBackdrop","props","disappearsOnIndex","style","backgroundColor","appearsOnIndex","pressBehavior","Provider","value","bottomSheetProps","ref","index","snapPoints","enableDynamicSizing","dynamicSizing","enablePanDownToClose","android_keyboardInputMode","enableBlurKeyboardOnGesture","keyboardBlurBehavior","keyboardBehavior","onClose","backdropComponent","topInset","handleIndicatorStyle","styles","sheetContainer","entering","exiting","animatedView","component","create","flex"],"sourceRoot":"..\\..\\..\\src","sources":["contexts/BottomSheetStackProvider.tsx"],"mappings":";;AAAA,OAAOA,WAA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C;EAAA,CACkB,CAAC;AAEvC,CAAC;AAED,MAAMwC,MAAM,GAAG/D,UAAU,CAACqE,MAAM,CAAC;EAC/BL,cAAc,EAAE;IACd;IACA;IACA;EAAA,CACD;EACDG,YAAY,EAAE;IACZG,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAsDxC,QAAA,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAsDxC,QAAA,MAAM,GAAG,yBAgFR,CAAC;AAUF,eAAe,GAAG,CAAC"}
|
|
@@ -9,6 +9,6 @@ interface CountryPickerViewProps {
|
|
|
9
9
|
countryNameStyle?: StyleProp<TextStyle>;
|
|
10
10
|
countryCodeStyle?: StyleProp<TextStyle>;
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
export
|
|
12
|
+
declare const CountryPickerView: ({ countries, onSelectCountry, listTitle, listTitleStyle, countryNameStyle, countryCodeStyle, }: CountryPickerViewProps) => React.JSX.Element;
|
|
13
|
+
export default CountryPickerView;
|
|
14
14
|
//# sourceMappingURL=CountryPickerView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CountryPickerView.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/CountryPickerView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AACzE,OAAO,EAOL,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAItB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,UAAU,sBAAsB;IAC9B,SAAS,EAAE,OAAO,EAAE,CAAC;IACrB,eAAe,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACxC,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACzC;AA4BD,
|
|
1
|
+
{"version":3,"file":"CountryPickerView.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/CountryPickerView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AACzE,OAAO,EAOL,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAItB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,UAAU,sBAAsB;IAC9B,SAAS,EAAE,OAAO,EAAE,CAAC;IACrB,eAAe,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACxC,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACzC;AA4BD,QAAA,MAAM,iBAAiB,GAAI,gGAOxB,sBAAsB,sBA2CxB,CAAC;AAwCF,eAAe,iBAAiB,CAAC"}
|
|
@@ -17,6 +17,7 @@ export interface CustomInputProps extends Omit<TextInputProps, 'style'> {
|
|
|
17
17
|
onBlur?: () => void;
|
|
18
18
|
onFocus?: () => void;
|
|
19
19
|
isRTL?: boolean;
|
|
20
|
+
isBottomSheet?: boolean;
|
|
20
21
|
}
|
|
21
22
|
declare const CustomInput: React.ForwardRefExoticComponent<CustomInputProps & React.RefAttributes<TextInput>>;
|
|
22
23
|
export default CustomInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EACL,SAAS,EACT,cAAc,EAKd,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EACL,SAAS,EACT,cAAc,EAKd,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAItB,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,mBAAmB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC3C,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,WAAW,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACnC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,QAAA,MAAM,WAAW,oFAkIhB,CAAC;AA2DF,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/PhoneInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAChE,OAAO,EACL,SAAS,EAMT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAoB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AASxD,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,eACf,SAAQ,IAAI,CACV,gBAAgB,EACd,UAAU,GACV,WAAW,GACX,kBAAkB,GAClB,cAAc,GACd,OAAO,GACP,sBAAsB,CACzB;IACD,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;IAGtB,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACxC,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACxC,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAEtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAQD,QAAA,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/PhoneInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAChE,OAAO,EACL,SAAS,EAMT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAoB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AASxD,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,eACf,SAAQ,IAAI,CACV,gBAAgB,EACd,UAAU,GACV,WAAW,GACX,kBAAkB,GAClB,cAAc,GACd,OAAO,GACP,sBAAsB,CACzB;IACD,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;IAGtB,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACxC,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACxC,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAEtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAQD,QAAA,MAAM,UAAU,mFA0Hf,CAAC;AAkBF,eAAe,UAAU,CAAC"}
|
|
@@ -2,4 +2,6 @@ export { default as Input } from "./Input";
|
|
|
2
2
|
export * from "./Input";
|
|
3
3
|
export { default as PhoneInput } from "./PhoneInput";
|
|
4
4
|
export * from "./PhoneInput";
|
|
5
|
+
export { default as CountryPickerView } from "./CountryPickerView";
|
|
6
|
+
export * from "./CountryPickerView";
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,cAAc,SAAS,CAAC;AAExB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,cAAc,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangeSlider.d.ts","sourceRoot":"","sources":["../../../../../src/components/RangeSlider/RangeSlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RangeSlider.d.ts","sourceRoot":"","sources":["../../../../../src/components/RangeSlider/RangeSlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAQrD,OAAO,EAAE,SAAS,EAAY,MAAM,aAAa,CAAC;AAoElD,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC9D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA0H3C,CAAC;AAwDF,eAAe,WAAW,CAAC"}
|
|
@@ -5,7 +5,6 @@ export interface BottomSheetStackItem {
|
|
|
5
5
|
snapPoints?: string[] | number[];
|
|
6
6
|
initialSnapIndex?: number;
|
|
7
7
|
dynamicSizing?: boolean;
|
|
8
|
-
isModal?: boolean;
|
|
9
8
|
bottomSheetProps?: Partial<Omit<BottomSheetProps, "children">>;
|
|
10
9
|
}
|
|
11
10
|
export interface BottomSheetStackContextType {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetStackContext.d.ts","sourceRoot":"","sources":["../../../../src/contexts/BottomSheetStackContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAErD,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,
|
|
1
|
+
{"version":3,"file":"BottomSheetStackContext.d.ts","sourceRoot":"","sources":["../../../../src/contexts/BottomSheetStackContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAErD,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC,CAAC;CAChE;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC3C,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,OAAO,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC9C,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,uBAAuB,mDAC2B,CAAC;AAEhE,eAAO,MAAM,mBAAmB,mCAU/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetStackProvider.d.ts","sourceRoot":"","sources":["../../../../src/contexts/BottomSheetStackProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BottomSheetStackProvider.d.ts","sourceRoot":"","sources":["../../../../src/contexts/BottomSheetStackProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EACZ,SAAS,EAMV,MAAM,OAAO,CAAC;AASf,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CA2GtE,CAAC"}
|
package/package.json
CHANGED
package/src/app.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { SafeAreaView, StyleSheet, StatusBar } from "react-native";
|
|
2
|
+
import { SafeAreaView, StyleSheet, StatusBar, I18nManager } from "react-native";
|
|
3
3
|
import CarouselCardStack from "./components/CarouselCardStack/CarouselCardStack"; // Adjust path as needed
|
|
4
4
|
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
5
5
|
import {
|
|
@@ -66,6 +66,8 @@ const App = () => {
|
|
|
66
66
|
const newProgress = Math.floor(Math.random() * 101);
|
|
67
67
|
setProgress(newProgress);
|
|
68
68
|
};
|
|
69
|
+
I18nManager.allowRTL(true);
|
|
70
|
+
I18nManager.forceRTL(true);
|
|
69
71
|
return (
|
|
70
72
|
<>
|
|
71
73
|
<SafeAreaProvider>
|
|
@@ -49,7 +49,7 @@ const CountryRow = React.memo(
|
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
const CountryPickerView = ({
|
|
53
53
|
countries,
|
|
54
54
|
onSelectCountry,
|
|
55
55
|
listTitle,
|
|
@@ -137,4 +137,6 @@ const styles = StyleSheet.create({
|
|
|
137
137
|
countryCode: {
|
|
138
138
|
fontSize: 14,
|
|
139
139
|
},
|
|
140
|
-
});
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
export default CountryPickerView;
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
TextStyle,
|
|
12
12
|
} from 'react-native';
|
|
13
13
|
import { useTheme, ThemeType } from '../../theme';
|
|
14
|
+
import { BottomSheetTextInput } from '@gorhom/bottom-sheet';
|
|
14
15
|
|
|
15
16
|
export interface CustomInputProps extends Omit<TextInputProps, 'style'> {
|
|
16
17
|
label?: string;
|
|
@@ -29,6 +30,7 @@ export interface CustomInputProps extends Omit<TextInputProps, 'style'> {
|
|
|
29
30
|
onBlur?: () => void;
|
|
30
31
|
onFocus?: () => void;
|
|
31
32
|
isRTL?: boolean;
|
|
33
|
+
isBottomSheet?: boolean;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
const CustomInput = forwardRef<TextInput, CustomInputProps>(
|
|
@@ -50,6 +52,7 @@ const CustomInput = forwardRef<TextInput, CustomInputProps>(
|
|
|
50
52
|
onBlur,
|
|
51
53
|
onFocus,
|
|
52
54
|
isRTL = false,
|
|
55
|
+
isBottomSheet,
|
|
53
56
|
...rest
|
|
54
57
|
},
|
|
55
58
|
ref
|
|
@@ -67,16 +70,17 @@ const CustomInput = forwardRef<TextInput, CustomInputProps>(
|
|
|
67
70
|
onBlur && onBlur();
|
|
68
71
|
};
|
|
69
72
|
|
|
70
|
-
// Define styles using a function to access theme
|
|
71
73
|
const styles = createStyles(theme);
|
|
72
74
|
|
|
75
|
+
const FinalInput = isBottomSheet ? BottomSheetTextInput : TextInput;
|
|
76
|
+
|
|
73
77
|
return (
|
|
74
78
|
<View style={[styles.container, containerStyle]}>
|
|
75
79
|
{label && (
|
|
76
80
|
<Text
|
|
77
81
|
style={[
|
|
78
82
|
styles.label,
|
|
79
|
-
{ textAlign: isRTL ?
|
|
83
|
+
{ textAlign: isRTL ? "right" : "left" },
|
|
80
84
|
labelStyle,
|
|
81
85
|
]}
|
|
82
86
|
>
|
|
@@ -90,7 +94,7 @@ const CustomInput = forwardRef<TextInput, CustomInputProps>(
|
|
|
90
94
|
inputContainerStyle,
|
|
91
95
|
isFocused && styles.focusedInput,
|
|
92
96
|
error && styles.errorInput,
|
|
93
|
-
isRTL && { flexDirection:
|
|
97
|
+
isRTL && { flexDirection: "row-reverse" },
|
|
94
98
|
]}
|
|
95
99
|
>
|
|
96
100
|
{leftIcon && (
|
|
@@ -104,13 +108,14 @@ const CustomInput = forwardRef<TextInput, CustomInputProps>(
|
|
|
104
108
|
</View>
|
|
105
109
|
)}
|
|
106
110
|
|
|
107
|
-
<
|
|
111
|
+
<FinalInput
|
|
112
|
+
//@ts-ignore
|
|
108
113
|
ref={ref}
|
|
109
114
|
style={[
|
|
110
115
|
styles.input,
|
|
111
116
|
leftIcon ? styles.inputWithLeftIcon : undefined,
|
|
112
117
|
rightIcon ? styles.inputWithRightIcon : undefined,
|
|
113
|
-
{ textAlign: isRTL ?
|
|
118
|
+
{ textAlign: isRTL ? "right" : "left" },
|
|
114
119
|
inputStyle,
|
|
115
120
|
]}
|
|
116
121
|
onChangeText={onChangeText}
|
|
@@ -138,7 +143,7 @@ const CustomInput = forwardRef<TextInput, CustomInputProps>(
|
|
|
138
143
|
<Text
|
|
139
144
|
style={[
|
|
140
145
|
styles.error,
|
|
141
|
-
{ textAlign: isRTL ?
|
|
146
|
+
{ textAlign: isRTL ? "right" : "left" },
|
|
142
147
|
errorStyle,
|
|
143
148
|
]}
|
|
144
149
|
>
|
|
@@ -148,7 +153,7 @@ const CustomInput = forwardRef<TextInput, CustomInputProps>(
|
|
|
148
153
|
<Text
|
|
149
154
|
style={[
|
|
150
155
|
styles.helper,
|
|
151
|
-
{ textAlign: isRTL ?
|
|
156
|
+
{ textAlign: isRTL ? "right" : "left" },
|
|
152
157
|
helperStyle,
|
|
153
158
|
]}
|
|
154
159
|
>
|
|
@@ -15,7 +15,7 @@ import { Ionicons } from "@expo/vector-icons";
|
|
|
15
15
|
import { useBottomSheetStack } from "../../contexts";
|
|
16
16
|
import { allCountries } from "country-telephone-data";
|
|
17
17
|
import { iso2ToFlagEmoji } from "../../utils/flags";
|
|
18
|
-
import
|
|
18
|
+
import CountryPickerView from "./CountryPickerView";
|
|
19
19
|
import { BottomSheetTextInput } from "@gorhom/bottom-sheet";
|
|
20
20
|
|
|
21
21
|
export type Country = {
|
|
@@ -112,7 +112,6 @@ const PhoneInput = forwardRef<TextInput, PhoneInputProps>(
|
|
|
112
112
|
countryCodeStyle={countryCodeStyle}
|
|
113
113
|
/>
|
|
114
114
|
),
|
|
115
|
-
isModal: isBottomSheet,
|
|
116
115
|
snapPoints: ["80%"],
|
|
117
116
|
});
|
|
118
117
|
}, [
|
|
@@ -155,14 +154,13 @@ const PhoneInput = forwardRef<TextInput, PhoneInputProps>(
|
|
|
155
154
|
[theme, sel, openCountryPicker]
|
|
156
155
|
);
|
|
157
156
|
|
|
158
|
-
const Input = isBottomSheet ? BottomSheetTextInput : CustomInput;
|
|
159
|
-
|
|
160
157
|
return (
|
|
161
|
-
<
|
|
158
|
+
<CustomInput
|
|
162
159
|
//@ts-ignore
|
|
163
160
|
ref={ref}
|
|
164
161
|
label={label}
|
|
165
162
|
value={value}
|
|
163
|
+
isBottomSheet={isBottomSheet}
|
|
166
164
|
onChangeText={onChangeText}
|
|
167
165
|
keyboardType="phone-pad"
|
|
168
166
|
placeholder="123 456 7890"
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
export { default as Input} from "./Input";
|
|
1
|
+
export { default as Input } from "./Input";
|
|
2
2
|
export * from "./Input";
|
|
3
3
|
|
|
4
|
-
export { default as PhoneInput} from "./PhoneInput";
|
|
5
|
-
export * from "./PhoneInput";
|
|
4
|
+
export { default as PhoneInput } from "./PhoneInput";
|
|
5
|
+
export * from "./PhoneInput";
|
|
6
|
+
|
|
7
|
+
export { default as CountryPickerView } from "./CountryPickerView";
|
|
8
|
+
export * from "./CountryPickerView";
|