related-ui-components 2.4.8 → 2.5.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/module/app.js +39 -21
- package/lib/module/app.js.map +1 -1
- package/lib/module/components/Input/PhoneInput.js +178 -0
- package/lib/module/components/Input/PhoneInput.js.map +1 -0
- package/lib/module/components/Input/index.js +2 -0
- package/lib/module/components/Input/index.js.map +1 -1
- package/lib/module/contexts/BottomSheetStackContext.js +12 -0
- package/lib/module/contexts/BottomSheetStackContext.js.map +1 -0
- package/lib/module/contexts/BottomSheetStackProvider.js +111 -0
- package/lib/module/contexts/BottomSheetStackProvider.js.map +1 -0
- package/lib/module/contexts/index.js +2 -2
- package/lib/module/contexts/index.js.map +1 -1
- package/lib/module/utils/flags.js +6 -0
- package/lib/module/utils/flags.js.map +1 -0
- package/lib/typescript/src/components/Input/PhoneInput.d.ts +22 -0
- package/lib/typescript/src/components/Input/PhoneInput.d.ts.map +1 -0
- 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/contexts/BottomSheetStackContext.d.ts +16 -0
- package/lib/typescript/src/contexts/BottomSheetStackContext.d.ts.map +1 -0
- package/lib/typescript/src/contexts/BottomSheetStackProvider.d.ts +5 -0
- package/lib/typescript/src/contexts/BottomSheetStackProvider.d.ts.map +1 -0
- package/lib/typescript/src/contexts/index.d.ts +2 -2
- package/lib/typescript/src/contexts/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/flags.d.ts +2 -0
- package/lib/typescript/src/utils/flags.d.ts.map +1 -0
- package/package.json +4 -1
- package/src/app.tsx +39 -21
- package/src/components/Input/PhoneInput.tsx +214 -0
- package/src/components/Input/index.ts +4 -1
- package/src/contexts/BottomSheetStackContext.tsx +30 -0
- package/src/contexts/BottomSheetStackProvider.tsx +138 -0
- package/src/contexts/index.ts +2 -2
- package/src/utils/flags.ts +7 -0
- package/lib/module/contexts/BottomSheetContext.js +0 -13
- package/lib/module/contexts/BottomSheetContext.js.map +0 -1
- package/lib/module/contexts/BottomSheetProvider.js +0 -104
- package/lib/module/contexts/BottomSheetProvider.js.map +0 -1
- package/lib/typescript/src/contexts/BottomSheetContext.d.ts +0 -10
- package/lib/typescript/src/contexts/BottomSheetContext.d.ts.map +0 -1
- package/lib/typescript/src/contexts/BottomSheetProvider.d.ts +0 -7
- package/lib/typescript/src/contexts/BottomSheetProvider.d.ts.map +0 -1
- package/src/contexts/BottomSheetContext.tsx +0 -28
- package/src/contexts/BottomSheetProvider.tsx +0 -136
package/lib/module/app.js
CHANGED
|
@@ -2,9 +2,20 @@
|
|
|
2
2
|
// import { SafeAreaView, StyleSheet, StatusBar } 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
|
-
// import {
|
|
5
|
+
// import {
|
|
6
|
+
// CarRentalForm,
|
|
7
|
+
// DateRangePicker,
|
|
8
|
+
// FlightForm,
|
|
9
|
+
// FlightSummary,
|
|
10
|
+
// HotelForm,
|
|
11
|
+
// HotelSummary,
|
|
12
|
+
// Filters,
|
|
13
|
+
// } from "./components";
|
|
6
14
|
// import { lightTheme, RelatedProvider, useTheme } from "./theme";
|
|
7
15
|
// import CircularProgressBar from "./components/ProgressBar/CircularProgressBar";
|
|
16
|
+
// import PhoneInput from "./components/Input/PhoneInput";
|
|
17
|
+
// import { BottomSheetStackProvider } from "./contexts";
|
|
18
|
+
// import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
8
19
|
|
|
9
20
|
// // Sample data - replace with your actual image URLs
|
|
10
21
|
// const DUMMY_DATA = [
|
|
@@ -43,27 +54,31 @@
|
|
|
43
54
|
// const App = () => {
|
|
44
55
|
// const { theme } = useTheme();
|
|
45
56
|
|
|
46
|
-
// const [departureDate, setDepartureDate] = useState<string | undefined>(
|
|
57
|
+
// const [departureDate, setDepartureDate] = useState<string | undefined>(
|
|
58
|
+
// undefined
|
|
59
|
+
// );
|
|
47
60
|
// const [returnDate, setReturnDate] = useState<string | undefined>(undefined);
|
|
48
61
|
|
|
49
62
|
// const [progress, setProgress] = useState(25);
|
|
50
|
-
//
|
|
63
|
+
// const handleAnimate = () => {
|
|
51
64
|
// // Set progress to a new random value between 0 and 100
|
|
52
65
|
// const newProgress = Math.floor(Math.random() * 101);
|
|
53
66
|
// setProgress(newProgress);
|
|
54
67
|
// };
|
|
55
68
|
// return (
|
|
56
69
|
// <>
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
// <
|
|
61
|
-
// <
|
|
70
|
+
// <SafeAreaProvider>
|
|
71
|
+
// <GestureHandlerRootView style={{ flex: 1 }}>
|
|
72
|
+
// <RelatedProvider theme={lightTheme}>
|
|
73
|
+
// <BottomSheetStackProvider>
|
|
74
|
+
// <StatusBar barStyle="light-content" />
|
|
75
|
+
// <SafeAreaView style={styles.appContainer}>
|
|
76
|
+
// {/* <CircularProgressBar
|
|
62
77
|
// progress={5}
|
|
63
78
|
// lineCap="round"
|
|
64
79
|
// textFont={""}
|
|
65
|
-
// />
|
|
66
|
-
//
|
|
80
|
+
// /> */}
|
|
81
|
+
// {/* <DateRangePicker
|
|
67
82
|
// onDatesChange={(t) => {
|
|
68
83
|
// setDepartureDate(t.departure);
|
|
69
84
|
// setReturnDate(t.return);
|
|
@@ -73,7 +88,7 @@
|
|
|
73
88
|
// returnDate={returnDate}
|
|
74
89
|
// // returnDisplayValue={returnDate}
|
|
75
90
|
// ></DateRangePicker> */}
|
|
76
|
-
//
|
|
91
|
+
// {/* <Filters
|
|
77
92
|
// bottomSheetBackgroundStyle={{
|
|
78
93
|
// borderTopRightRadius: 30,
|
|
79
94
|
// borderTopLeftRadius: 30,
|
|
@@ -97,16 +112,19 @@
|
|
|
97
112
|
// applyButtonTextStyle={{ color: theme.secondary }}
|
|
98
113
|
// headerStyle={{ borderBottomWidth: 0 }}
|
|
99
114
|
// ></Filters> */}
|
|
100
|
-
//
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
//
|
|
107
|
-
//
|
|
108
|
-
//
|
|
109
|
-
//
|
|
115
|
+
// {/* <FlightSummary></FlightSummary> */}
|
|
116
|
+
// {/* <FlightForm></FlightForm> */}
|
|
117
|
+
// {/* <HotelSummary></HotelSummary> */}
|
|
118
|
+
// {/* <HotelForm></HotelForm> */}
|
|
119
|
+
// {/* <DateRangePicker onDatesChange={()=>{}} labelContainerStyle={{backgroundColor:"red"}}></DateRangePicker> */}
|
|
120
|
+
// {/* <CarRentalForm onSelectionChange={console.log}></CarRentalForm> */}
|
|
121
|
+
// {/* <CarouselCardStack data={DUMMY_DATA} /> */}
|
|
122
|
+
// <PhoneInput value="" onChangeText={() => {}} inputContainerStyle={{height: 55}}></PhoneInput>
|
|
123
|
+
// </SafeAreaView>
|
|
124
|
+
// </BottomSheetStackProvider>
|
|
125
|
+
// </RelatedProvider>
|
|
126
|
+
// </GestureHandlerRootView>
|
|
127
|
+
// </SafeAreaProvider>
|
|
110
128
|
// </>
|
|
111
129
|
// );
|
|
112
130
|
// };
|
package/lib/module/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"..\\..\\src","sources":["app.tsx"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\src","sources":["app.tsx"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { forwardRef, useMemo, useCallback } from "react";
|
|
4
|
+
import { Text, View, TouchableOpacity, StyleSheet } from "react-native";
|
|
5
|
+
import CustomInput from "./Input.js";
|
|
6
|
+
import { useTheme } from "../../theme/index.js";
|
|
7
|
+
import { Ionicons } from "@expo/vector-icons";
|
|
8
|
+
import { useBottomSheetStack } from "../../contexts/index.js";
|
|
9
|
+
import { BottomSheetFlatList } from "@gorhom/bottom-sheet";
|
|
10
|
+
import { allCountries } from 'country-telephone-data';
|
|
11
|
+
import { iso2ToFlagEmoji } from "../../utils/flags.js";
|
|
12
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
const DEFAULT_COUNTRIES = allCountries.map(c => ({
|
|
14
|
+
code: `+${c.dialCode}`,
|
|
15
|
+
iso2: c.iso2,
|
|
16
|
+
name: c.name
|
|
17
|
+
}));
|
|
18
|
+
const PhoneInput = /*#__PURE__*/forwardRef(({
|
|
19
|
+
value,
|
|
20
|
+
onChangeText,
|
|
21
|
+
selectedCountry,
|
|
22
|
+
onSelectCountry,
|
|
23
|
+
countries = DEFAULT_COUNTRIES,
|
|
24
|
+
containerStyle,
|
|
25
|
+
inputContainerStyle,
|
|
26
|
+
inputStyle,
|
|
27
|
+
label,
|
|
28
|
+
labelStyle,
|
|
29
|
+
error,
|
|
30
|
+
errorStyle,
|
|
31
|
+
helper,
|
|
32
|
+
helperStyle,
|
|
33
|
+
listTitle = "Select Country",
|
|
34
|
+
listTitleStyle,
|
|
35
|
+
countryCodeStyle,
|
|
36
|
+
countryNameStyle,
|
|
37
|
+
...rest
|
|
38
|
+
}, ref) => {
|
|
39
|
+
const {
|
|
40
|
+
theme
|
|
41
|
+
} = useTheme();
|
|
42
|
+
const {
|
|
43
|
+
push
|
|
44
|
+
} = useBottomSheetStack();
|
|
45
|
+
const sel = useMemo(() => selectedCountry || countries.find(c => c.code === "+1") || countries[0], [selectedCountry, countries]);
|
|
46
|
+
const handleCountryPress = useCallback(c => {
|
|
47
|
+
onSelectCountry && onSelectCountry(c);
|
|
48
|
+
}, [onSelectCountry]);
|
|
49
|
+
const renderCountry = ({
|
|
50
|
+
item
|
|
51
|
+
}) => /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
52
|
+
style: styles.countryRow,
|
|
53
|
+
onPress: () => handleCountryPress(item),
|
|
54
|
+
children: [/*#__PURE__*/_jsxs(Text, {
|
|
55
|
+
style: styles.flag,
|
|
56
|
+
children: [" ", iso2ToFlagEmoji(item.iso2)]
|
|
57
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
58
|
+
style: styles.countryText,
|
|
59
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
60
|
+
style: [styles.countryName, countryNameStyle],
|
|
61
|
+
children: item.name
|
|
62
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
63
|
+
style: [styles.countryCode, countryCodeStyle],
|
|
64
|
+
children: item.code
|
|
65
|
+
})]
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
68
|
+
const leftIcon = /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
69
|
+
style: [styles.selector, {
|
|
70
|
+
backgroundColor: theme.inputBackground
|
|
71
|
+
}],
|
|
72
|
+
hitSlop: {
|
|
73
|
+
left: 30,
|
|
74
|
+
top: 30,
|
|
75
|
+
right: 30,
|
|
76
|
+
bottom: 30
|
|
77
|
+
},
|
|
78
|
+
onPress: () => push({
|
|
79
|
+
component: /*#__PURE__*/_jsxs(View, {
|
|
80
|
+
style: styles.popup,
|
|
81
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
82
|
+
style: [styles.popupTitle, listTitleStyle, {
|
|
83
|
+
color: theme.text
|
|
84
|
+
}],
|
|
85
|
+
children: listTitle
|
|
86
|
+
}), /*#__PURE__*/_jsx(BottomSheetFlatList, {
|
|
87
|
+
data: countries,
|
|
88
|
+
keyExtractor: (c, i) => i.toString(),
|
|
89
|
+
renderItem: renderCountry,
|
|
90
|
+
contentContainerStyle: {
|
|
91
|
+
paddingBottom: 16
|
|
92
|
+
}
|
|
93
|
+
})]
|
|
94
|
+
}),
|
|
95
|
+
snapPoints: ["100%"]
|
|
96
|
+
}),
|
|
97
|
+
activeOpacity: 0.8,
|
|
98
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
99
|
+
style: [styles.flag, {
|
|
100
|
+
color: theme.inputText
|
|
101
|
+
}],
|
|
102
|
+
children: iso2ToFlagEmoji(sel.iso2)
|
|
103
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
104
|
+
style: [styles.code, {
|
|
105
|
+
color: theme.inputText
|
|
106
|
+
}],
|
|
107
|
+
children: sel.code
|
|
108
|
+
}), /*#__PURE__*/_jsx(Ionicons, {
|
|
109
|
+
name: "chevron-down",
|
|
110
|
+
size: 16,
|
|
111
|
+
style: {
|
|
112
|
+
marginHorizontal: 4
|
|
113
|
+
}
|
|
114
|
+
})]
|
|
115
|
+
});
|
|
116
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
117
|
+
children: /*#__PURE__*/_jsx(CustomInput, {
|
|
118
|
+
ref: ref,
|
|
119
|
+
label: label,
|
|
120
|
+
value: value,
|
|
121
|
+
onChangeText: onChangeText,
|
|
122
|
+
keyboardType: "phone-pad",
|
|
123
|
+
placeholder: "123 456 7890",
|
|
124
|
+
leftIcon: leftIcon,
|
|
125
|
+
containerStyle: containerStyle,
|
|
126
|
+
inputContainerStyle: inputContainerStyle,
|
|
127
|
+
inputStyle: inputStyle,
|
|
128
|
+
labelStyle: labelStyle,
|
|
129
|
+
error: error,
|
|
130
|
+
errorStyle: errorStyle,
|
|
131
|
+
helper: helper,
|
|
132
|
+
helperStyle: helperStyle,
|
|
133
|
+
...rest
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
const styles = StyleSheet.create({
|
|
138
|
+
selector: {
|
|
139
|
+
flexDirection: "row",
|
|
140
|
+
alignItems: "center",
|
|
141
|
+
borderRightWidth: 1,
|
|
142
|
+
borderRightColor: "grey"
|
|
143
|
+
},
|
|
144
|
+
flag: {
|
|
145
|
+
fontSize: 18
|
|
146
|
+
},
|
|
147
|
+
code: {
|
|
148
|
+
fontSize: 14,
|
|
149
|
+
marginLeft: 4
|
|
150
|
+
},
|
|
151
|
+
popup: {
|
|
152
|
+
// maxHeight: 400,
|
|
153
|
+
width: "100%",
|
|
154
|
+
padding: 16
|
|
155
|
+
},
|
|
156
|
+
popupTitle: {
|
|
157
|
+
fontSize: 18,
|
|
158
|
+
fontWeight: "600",
|
|
159
|
+
marginBottom: 12
|
|
160
|
+
},
|
|
161
|
+
countryRow: {
|
|
162
|
+
flexDirection: "row",
|
|
163
|
+
alignItems: "center",
|
|
164
|
+
paddingVertical: 10
|
|
165
|
+
},
|
|
166
|
+
countryText: {
|
|
167
|
+
marginLeft: 12
|
|
168
|
+
},
|
|
169
|
+
countryName: {
|
|
170
|
+
fontSize: 16
|
|
171
|
+
},
|
|
172
|
+
countryCode: {
|
|
173
|
+
fontSize: 14,
|
|
174
|
+
color: "#666"
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
export default PhoneInput;
|
|
178
|
+
//# sourceMappingURL=PhoneInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useMemo","useCallback","Text","View","TouchableOpacity","StyleSheet","CustomInput","useTheme","Ionicons","useBottomSheetStack","BottomSheetFlatList","allCountries","iso2ToFlagEmoji","jsxs","_jsxs","jsx","_jsx","Fragment","_Fragment","DEFAULT_COUNTRIES","map","c","code","dialCode","iso2","name","PhoneInput","value","onChangeText","selectedCountry","onSelectCountry","countries","containerStyle","inputContainerStyle","inputStyle","label","labelStyle","error","errorStyle","helper","helperStyle","listTitle","listTitleStyle","countryCodeStyle","countryNameStyle","rest","ref","theme","push","sel","find","handleCountryPress","renderCountry","item","style","styles","countryRow","onPress","children","flag","countryText","countryName","countryCode","leftIcon","selector","backgroundColor","inputBackground","hitSlop","left","top","right","bottom","component","popup","popupTitle","color","text","data","keyExtractor","i","toString","renderItem","contentContainerStyle","paddingBottom","snapPoints","activeOpacity","inputText","size","marginHorizontal","keyboardType","placeholder","create","flexDirection","alignItems","borderRightWidth","borderRightColor","fontSize","marginLeft","width","padding","fontWeight","marginB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Q;IACpBS,eAAe,EAAE;EACnB,CAAC;EACD1C,WAAW,EAAE;IACXqC,UAAU,EAAE;EACd,CAAC;EACDpC,WAAW,EAAE;IACXmC,QAAQ,EAAE;EACZ,CAAC;EACDlC,WAAW,EAAE;IACXkC,QAAQ,EAAE,EAAE;IACZrB,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAejD,UAAU","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","Input"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Input/index.ts"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,KAAK,QAAO,YAAS;AACzC,cAAc,YAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["default","Input","PhoneInput"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Input/index.ts"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,KAAK,QAAO,YAAS;AACzC,cAAc,YAAS;AAEvB,SAASD,OAAO,IAAIE,UAAU,QAAO,iBAAc;AACnD,cAAc,iBAAc","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useContext } from "react";
|
|
4
|
+
export const BottomSheetStackContext = /*#__PURE__*/React.createContext(null);
|
|
5
|
+
export const useBottomSheetStack = () => {
|
|
6
|
+
const context = useContext(BottomSheetStackContext);
|
|
7
|
+
if (!context) {
|
|
8
|
+
throw new Error("useBottomSheetStack must be used within a BottomSheetStackProvider");
|
|
9
|
+
}
|
|
10
|
+
return context;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=BottomSheetStackContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useContext","BottomSheetStackContext","createContext","useBottomSheetStack","context","Error"],"sourceRoot":"..\\..\\..\\src","sources":["contexts/BottomSheetStackContext.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAeC,UAAU,QAAQ,OAAO;AAgBpD,OAAO,MAAMC,uBAAuB,gBAClCF,KAAK,CAACG,aAAa,CAAqC,IAAI,CAAC;AAE/D,OAAO,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EACvC,MAAMC,OAAO,GAAGJ,UAAU,CAACC,uBAAuB,CAAC;EAEnD,IAAI,CAACG,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CACb,oEACF,CAAC;EACH;EAEA,OAAOD,OAAO;AAChB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import BottomSheet, { BottomSheetBackdrop } from "@gorhom/bottom-sheet";
|
|
4
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
+
import { BackHandler, StyleSheet } from "react-native";
|
|
6
|
+
import Animated, { FadeIn, FadeOut } from "react-native-reanimated";
|
|
7
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
8
|
+
import { BottomSheetStackContext } from "./BottomSheetStackContext.js";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
export const BottomSheetStackProvider = ({
|
|
11
|
+
children
|
|
12
|
+
}) => {
|
|
13
|
+
const [stack, setStack] = useState([]);
|
|
14
|
+
const sheetRef = useRef(null);
|
|
15
|
+
const {
|
|
16
|
+
top
|
|
17
|
+
} = useSafeAreaInsets();
|
|
18
|
+
const push = useCallback(item => {
|
|
19
|
+
setStack(prev => [...prev, item]);
|
|
20
|
+
}, []);
|
|
21
|
+
const clear = useCallback(() => {
|
|
22
|
+
sheetRef.current?.close();
|
|
23
|
+
setStack([]);
|
|
24
|
+
}, []);
|
|
25
|
+
const pop = useCallback(() => {
|
|
26
|
+
if (stack.length <= 1) {
|
|
27
|
+
clear();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
setStack(prev => prev.slice(0, -1));
|
|
31
|
+
}, [stack.length, clear]);
|
|
32
|
+
const replace = useCallback(item => {
|
|
33
|
+
setStack(prev => [...prev.slice(0, -1), item]);
|
|
34
|
+
}, []);
|
|
35
|
+
const currentItem = useMemo(() => stack[stack.length - 1], [stack]);
|
|
36
|
+
const canGoBack = stack.length > 1;
|
|
37
|
+
const isOpen = stack.length > 0;
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (isOpen && currentItem) {
|
|
40
|
+
sheetRef.current?.snapToIndex(0);
|
|
41
|
+
}
|
|
42
|
+
const backHandlerSubscription = BackHandler.addEventListener("hardwareBackPress", () => {
|
|
43
|
+
if (canGoBack) {
|
|
44
|
+
pop();
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
if (!canGoBack && stack.length === 1) {
|
|
48
|
+
sheetRef.current?.close();
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
});
|
|
53
|
+
return () => backHandlerSubscription.remove();
|
|
54
|
+
}, [isOpen, canGoBack, currentItem, pop, stack]);
|
|
55
|
+
const AnimatedView = Animated.View;
|
|
56
|
+
const enteringAnimation = FadeIn.duration(200);
|
|
57
|
+
const exitingAnimation = FadeOut.duration(200);
|
|
58
|
+
const renderBackdrop = useCallback(props => /*#__PURE__*/_jsx(BottomSheetBackdrop, {
|
|
59
|
+
...props,
|
|
60
|
+
disappearsOnIndex: -1,
|
|
61
|
+
style: [props.style, {
|
|
62
|
+
backgroundColor: "rgba(0,0,0,0,1)"
|
|
63
|
+
}],
|
|
64
|
+
appearsOnIndex: 0,
|
|
65
|
+
pressBehavior: "close"
|
|
66
|
+
}), []);
|
|
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
|
+
ref: sheetRef,
|
|
77
|
+
index: 0,
|
|
78
|
+
snapPoints: currentItem?.snapPoints || ["100%"],
|
|
79
|
+
enableDynamicSizing: currentItem?.snapPoints === undefined,
|
|
80
|
+
enablePanDownToClose: true,
|
|
81
|
+
android_keyboardInputMode: "adjustResize",
|
|
82
|
+
enableBlurKeyboardOnGesture: true,
|
|
83
|
+
keyboardBlurBehavior: "restore",
|
|
84
|
+
keyboardBehavior: "fillParent",
|
|
85
|
+
onClose: clear,
|
|
86
|
+
backdropComponent: renderBackdrop,
|
|
87
|
+
topInset: top,
|
|
88
|
+
handleIndicatorStyle: {
|
|
89
|
+
backgroundColor: "#CCCCCC"
|
|
90
|
+
},
|
|
91
|
+
style: styles.sheetContainer,
|
|
92
|
+
children: currentItem && /*#__PURE__*/_jsx(AnimatedView, {
|
|
93
|
+
entering: enteringAnimation,
|
|
94
|
+
exiting: exitingAnimation,
|
|
95
|
+
style: styles.animatedView,
|
|
96
|
+
children: currentItem.component
|
|
97
|
+
}, stack.length)
|
|
98
|
+
})]
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
const styles = StyleSheet.create({
|
|
102
|
+
sheetContainer: {
|
|
103
|
+
// backgroundColor: "#FFFFFF",
|
|
104
|
+
// borderTopLeftRadius: 20,
|
|
105
|
+
// borderTopRightRadius: 20,
|
|
106
|
+
},
|
|
107
|
+
animatedView: {
|
|
108
|
+
flex: 1
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
//# sourceMappingURL=BottomSheetStackProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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","backHandlerSubscription","addEventListener","remove","AnimatedView","View","enteringAnimation","duration","exitingAnimation","renderBackdrop","props","disappearsOnIndex","style","backgroundColor","appearsOnIndex","pressBehavior","Provider","value","ref","index","snapPoints","enableDynamicSizing","undefined","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,WAAW,IAChBC,mBAAmB,QAEd,sBAAsB;AAC7B,OAAOC,KAAK,IAEVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SAASC,WAAW,EAAEC,UAAU,QAAQ,cAAc;AACtD,OAAOC,QAAQ,IAAIC,MAAM,EAAEC,OAAO,QAAQ,yBAAyB;AACnE,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SACEC,uBAAuB,QAElB,8BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnC,OAAO,MAAMC,wBAA2D,GAAGA,CAAC;EAC1EC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGf,QAAQ,CAAyB,EAAE,CAAC;EAC9D,MAAMgB,QAAQ,GAAGjB,MAAM,CAAc,IAAI,CAAC;EAC1C,MAAM;IAAEkB;EAAI,CAAC,GAAGX,iBAAiB,CAAC,CAAC;EAEnC,MAAMY,IAAI,GAAGtB,WAAW,CAAEuB,IAA0B,IAAK;IACvDJ,QAAQ,CAAEK,IAAI,IAAK,CAAC,GAAGA,IAAI,EAAED,IAAI,CAAC,CAAC;EACrC,CAAC,EAAE,EAAE,CAAC;EAEN,MAAME,KAAK,GAAGzB,WAAW,CAAC,MAAM;IAC9BoB,QAAQ,CAACM,OAAO,EAAEC,KAAK,CAAC,CAAC;IACzBR,QAAQ,CA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,GAAI;MACd6C,oBAAoB,EAAE;QAAElB,eAAe,EAAE;MAAU,CAAE;MACrDD,KAAK,EAAEoB,MAAM,CAACC,cAAe;MAAAnD,QAAA,EAE5Be,WAAW,iBACVnB,IAAA,CAAC0B,YAAY;QAEX8B,QAAQ,EAAE5B,iBAAkB;QAC5B6B,OAAO,EAAE3B,gBAAiB;QAC1BI,KAAK,EAAEoB,MAAM,CAACI,YAAa;QAAAtD,QAAA,EAE1Be,WAAW,CAACwC;MAAS,GALjBtD,KAAK,CAACW,MAMC;IACf,CACU,CAAC;EAAA,CACkB,CAAC;AAEvC,CAAC;AAED,MAAMsC,MAAM,GAAG7D,UAAU,CAACmE,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,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["contexts/index.ts"],"mappings":";;AAAA,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["contexts/index.ts"],"mappings":";;AAAA,cAAc,8BAA2B;AACzC,cAAc,+BAA4B","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["iso2ToFlagEmoji","countryCode","toUpperCase","split","map","ch","String","fromCodePoint","charCodeAt","join"],"sourceRoot":"..\\..\\..\\src","sources":["utils/flags.ts"],"mappings":";;AAAA,OAAO,SAASA,eAAeA,CAACC,WAAmB,EAAU;EAC3D,OAAOA,WAAW,CACfC,WAAW,CAAC,CAAC,CACbC,KAAK,CAAC,EAAE,CAAC,CACTC,GAAG,CAACC,EAAE,IAAIC,MAAM,CAACC,aAAa,CAACF,EAAE,CAACG,UAAU,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAC1DC,IAAI,CAAC,EAAE,CAAC;AACb","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TextInput, StyleProp, TextStyle } from "react-native";
|
|
3
|
+
import { CustomInputProps } from "./Input";
|
|
4
|
+
export type Country = {
|
|
5
|
+
code: string;
|
|
6
|
+
iso2: string;
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
export interface PhoneInputProps extends Omit<CustomInputProps, "leftIcon" | "rightIcon" | "onRightIconPress" | "keyboardType" | "style" | "placeholderTextColor"> {
|
|
10
|
+
value: string;
|
|
11
|
+
onChangeText: (text: string) => void;
|
|
12
|
+
selectedCountry?: Country;
|
|
13
|
+
onSelectCountry?: (c: Country) => void;
|
|
14
|
+
countries?: Country[];
|
|
15
|
+
countryNameStyle?: StyleProp<TextStyle>;
|
|
16
|
+
countryCodeStyle?: StyleProp<TextStyle>;
|
|
17
|
+
listTitleStyle?: StyleProp<TextStyle>;
|
|
18
|
+
listTitle?: string;
|
|
19
|
+
}
|
|
20
|
+
declare const PhoneInput: React.ForwardRefExoticComponent<PhoneInputProps & React.RefAttributes<TextInput>>;
|
|
21
|
+
export default PhoneInput;
|
|
22
|
+
//# sourceMappingURL=PhoneInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/PhoneInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AAC1E,OAAO,EACL,SAAS,EAOT,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,CAAA;CACnB;AAQD,QAAA,MAAM,UAAU,mFAiHf,CAAC;AA2CF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAC,MAAM,SAAS,CAAC;AAC1C,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAC,MAAM,SAAS,CAAC;AAC1C,cAAc,SAAS,CAAC;AAExB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAC,MAAM,cAAc,CAAC;AACpD,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
export interface BottomSheetStackItem {
|
|
3
|
+
component: ReactNode;
|
|
4
|
+
snapPoints?: string[] | number[];
|
|
5
|
+
initialSnapIndex?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface BottomSheetStackContextType {
|
|
8
|
+
push: (item: BottomSheetStackItem) => void;
|
|
9
|
+
pop: () => void;
|
|
10
|
+
replace: (item: BottomSheetStackItem) => void;
|
|
11
|
+
clear: () => void;
|
|
12
|
+
canGoBack: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const BottomSheetStackContext: React.Context<BottomSheetStackContextType | null>;
|
|
15
|
+
export declare const useBottomSheetStack: () => BottomSheetStackContextType;
|
|
16
|
+
//# sourceMappingURL=BottomSheetStackContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetStackContext.d.ts","sourceRoot":"","sources":["../../../../src/contexts/BottomSheetStackContext.tsx"],"names":[],"mappings":"AAAA,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;CAC3B;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"}
|
|
@@ -0,0 +1 @@
|
|
|
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,CA0GtE,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
1
|
+
export * from "./BottomSheetStackContext";
|
|
2
|
+
export * from "./BottomSheetStackProvider";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../../../src/utils/flags.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAM3D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "related-ui-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"main": "./src/index.ts",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "expo start",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"@react-native-community/slider": "4.5.6",
|
|
17
17
|
"@react-native-picker/picker": "2.11.0",
|
|
18
18
|
"@shopify/react-native-skia": "v2.0.0-next.4",
|
|
19
|
+
"country-telephone-data": "^0.6.3",
|
|
19
20
|
"date-fns": "^4.1.0",
|
|
20
21
|
"expo": "~53.0.9",
|
|
21
22
|
"expo-blur": "~14.1.4",
|
|
@@ -31,10 +32,12 @@
|
|
|
31
32
|
"react-native-picker-select": "^9.3.1",
|
|
32
33
|
"react-native-qrcode-svg": "^6.3.15",
|
|
33
34
|
"react-native-reanimated": "~3.17.4",
|
|
35
|
+
"react-native-safe-area-context": "^5.4.1",
|
|
34
36
|
"react-native-svg": "15.11.2"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
37
39
|
"@babel/core": "^7.25.2",
|
|
40
|
+
"@types/country-telephone-data": "^0.6.3",
|
|
38
41
|
"@types/react": "~19.0.10",
|
|
39
42
|
"react-native-builder-bob": "^0.40.11",
|
|
40
43
|
"typescript": "~5.8.3"
|