related-ui-components 2.6.5 → 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/PhoneInput.js +1 -2
- 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/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/PhoneInput.tsx +1 -2
- 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
package/lib/module/app.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React, { useState } from "react";
|
|
4
|
-
import { SafeAreaView, StyleSheet, StatusBar } from "react-native";
|
|
4
|
+
import { SafeAreaView, StyleSheet, StatusBar, I18nManager } from "react-native";
|
|
5
5
|
// Adjust path as needed
|
|
6
6
|
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
7
7
|
import { RangeSlider } from "./components/index.js";
|
|
@@ -50,6 +50,8 @@ const App = () => {
|
|
|
50
50
|
const newProgress = Math.floor(Math.random() * 101);
|
|
51
51
|
setProgress(newProgress);
|
|
52
52
|
};
|
|
53
|
+
I18nManager.allowRTL(true);
|
|
54
|
+
I18nManager.forceRTL(true);
|
|
53
55
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
54
56
|
children: /*#__PURE__*/_jsx(SafeAreaProvider, {
|
|
55
57
|
children: /*#__PURE__*/_jsx(GestureHandlerRootView, {
|
package/lib/module/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","SafeAreaView","StyleSheet","StatusBar","GestureHandlerRootView","RangeSlider","lightTheme","RelatedProvider","useTheme","BottomSheetStackProvider","SafeAreaProvider","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","DUMMY_DATA","id","image","title","App","theme","departureDate","setDepartureDate","undefined","returnDate","setReturnDate","progress","setProgress","handleAnimate","newProgress","Math","floor","random","children","style","flex","barStyle","styles","appContainer","initialMinValue","initialMaxValue","min","max","sliderWidth","onValueChange","console","log","create","backgroundColor","justifyContent"],"sourceRoot":"..\\..\\src","sources":["app.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,YAAY,EAAEC,UAAU,EAAEC,SAAS,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["React","useState","SafeAreaView","StyleSheet","StatusBar","I18nManager","GestureHandlerRootView","RangeSlider","lightTheme","RelatedProvider","useTheme","BottomSheetStackProvider","SafeAreaProvider","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","DUMMY_DATA","id","image","title","App","theme","departureDate","setDepartureDate","undefined","returnDate","setReturnDate","progress","setProgress","handleAnimate","newProgress","Math","floor","random","allowRTL","forceRTL","children","style","flex","barStyle","styles","appContainer","initialMinValue","initialMaxValue","min","max","sliderWidth","onValueChange","console","log","create","backgroundColor","justifyContent"],"sourceRoot":"..\\..\\src","sources":["app.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,YAAY,EAAEC,UAAU,EAAEC,SAAS,EAAEC,WAAW,QAAQ,cAAc;AACG;AAClF,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAQEC,WAAW,QACN,uBAAc;AACrB,SAASC,UAAU,EAAEC,eAAe,EAAEC,QAAQ,QAAQ,kBAAS;AAG/D,SAASC,wBAAwB,QAAQ,qBAAY;AACrD,SAASC,gBAAgB,QAAQ,gCAAgC;;AAEjE;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AACA,MAAMC,UAAU,GAAG,CACjB;EACEC,EAAE,EAAE,GAAG;EACPC,KAAK,EACH,iHAAiH;EACnHC,KAAK,EAAE;AACT,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;EACEF,EAAE,EAAE,GAAG;EACPC,KAAK,EACH,iHAAiH;EACnHC,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAE,GAAG;EACPC,KAAK,EACH,iHAAiH;EACnHC,KAAK,EAAE;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,CACD;AAED,MAAMC,GAAG,GAAGA,CAAA,KAAM;EAChB,MAAM;IAAEC;EAAM,CAAC,GAAGd,QAAQ,CAAC,CAAC;EAE5B,MAAM,CAACe,aAAa,EAAEC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AAMT,MAAM,GAAGxC,UAAU,CAACkD,MAAM,CAAC;EAC/BT,YAAY,EAAE;IACZH,IAAI,EAAE,CAAC;IACPa,eAAe,EAAC,MAAM;IACtBC,cAAc,EAAE,QAAQ,CAAE;EAC5B;AACF,CAAC,CAAC;AAEF,eAAehC,GAAG","ignoreList":[]}
|
|
@@ -31,7 +31,7 @@ const CountryRow = /*#__PURE__*/React.memo(({
|
|
|
31
31
|
})]
|
|
32
32
|
});
|
|
33
33
|
});
|
|
34
|
-
|
|
34
|
+
const CountryPickerView = ({
|
|
35
35
|
countries,
|
|
36
36
|
onSelectCountry,
|
|
37
37
|
listTitle,
|
|
@@ -120,4 +120,5 @@ const styles = StyleSheet.create({
|
|
|
120
120
|
fontSize: 14
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
|
+
export default CountryPickerView;
|
|
123
124
|
//# sourceMappingURL=CountryPickerView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useMemo","Text","View","TouchableOpacity","StyleSheet","BottomSheetFlatList","useTheme","iso2ToFlagEmoji","jsxs","_jsxs","jsx","_jsx","CountryRow","memo","item","onSelectCountry","nameStyle","codeStyle","handlePress","style","styles","countryRow","onPress","children","flag","iso2","countryText","name","code","CountryPickerView","countries","listTitle","listTitleStyle","countryNameStyle","countryCodeStyle","theme","memoizedNameStyle","countryName","color","text","memoizedCodeStyle","countryCode","helper","renderCountry","popup","popupTitle","data","keyExtractor","c","renderItem","contentContainerStyle","paddingBottom","initialNumToRender","maxToRenderPerBatch","create","flex","width","paddingHorizontal","loaderContainer","alignItems","justifyContent","fontSize","fontWeight","marginBottom","paddingTop","flexDirection","paddingVertical","height","marginLeft"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Input/CountryPickerView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAyBC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACxE,SACEC,IAAI,EACJC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,QAKL,cAAc;AACrB,SAA+BC,mBAAmB,QAAQ,sBAAsB;AAChF,SAASC,QAAQ,QAAQ,sBAAa;AACtC,SAASC,eAAe,QAAQ,sBAAmB;AAAC,SAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAAC,IAAA;AAYpD,MAAMC,UAAU,gBAAGd,KAAK,CAACe,IAAI,CAC3B,CAAC;EACCC,IAAI;EACJC,eAAe;EACfC,SAAS;EACTC;AAMF,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGA,CAAA,KAAMH,eAAe,CAACD,IAAI,CAAC;EAE/C,oBACEL,KAAA,CAACN,gBAAgB;IAACgB,KAAK,EAAEC,MAAM,CAACC,UAAW;IAACC,OAAO,EAAEJ,WAAY;IAAAK,QAAA,gBAC/Dd,KAAA,CAACR,IAAI;MAACkB,KAAK,EAAEC,MAAM,CAACI,IAAK;MAAAD,QAAA,GAAC,GAAC,EAAChB,eAAe,CAACO,IAAI,CAACW,IAAI,CAAC;IAAA,CAAO,CAAC,eAC9DhB,KAAA,CAACP,IAAI;MAACiB,KAAK,EAAEC,MAAM,CAACM,WAAY;MAAAH,QAAA,gBAC9BZ,IAAA,CAACV,IAAI;QAACkB,KAAK,EAAEH,SAAU;QAAAO,QAAA,EAAET,IAAI,CAACa;MAAI,CAAO,CAAC,eAC1ChB,IAAA,CAACV,IAAI;QAACkB,KAAK,EAAEF,SAAU;QAAAM,QAAA,EAAET,IAAI,CAACc;MAAI,CAAO,CAAC;IAAA,CACtC,CAAC;EAAA,CACS,CAAC;AAEvB,CACF,CAAC;AAED,
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","Text","View","TouchableOpacity","StyleSheet","BottomSheetFlatList","useTheme","iso2ToFlagEmoji","jsxs","_jsxs","jsx","_jsx","CountryRow","memo","item","onSelectCountry","nameStyle","codeStyle","handlePress","style","styles","countryRow","onPress","children","flag","iso2","countryText","name","code","CountryPickerView","countries","listTitle","listTitleStyle","countryNameStyle","countryCodeStyle","theme","memoizedNameStyle","countryName","color","text","memoizedCodeStyle","countryCode","helper","renderCountry","popup","popupTitle","data","keyExtractor","c","renderItem","contentContainerStyle","paddingBottom","initialNumToRender","maxToRenderPerBatch","create","flex","width","paddingHorizontal","loaderContainer","alignItems","justifyContent","fontSize","fontWeight","marginBottom","paddingTop","flexDirection","paddingVertical","height","marginLeft"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Input/CountryPickerView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAyBC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACxE,SACEC,IAAI,EACJC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,QAKL,cAAc;AACrB,SAA+BC,mBAAmB,QAAQ,sBAAsB;AAChF,SAASC,QAAQ,QAAQ,sBAAa;AACtC,SAASC,eAAe,QAAQ,sBAAmB;AAAC,SAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAAC,IAAA;AAYpD,MAAMC,UAAU,gBAAGd,KAAK,CAACe,IAAI,CAC3B,CAAC;EACCC,IAAI;EACJC,eAAe;EACfC,SAAS;EACTC;AAMF,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGA,CAAA,KAAMH,eAAe,CAACD,IAAI,CAAC;EAE/C,oBACEL,KAAA,CAACN,gBAAgB;IAACgB,KAAK,EAAEC,MAAM,CAACC,UAAW;IAACC,OAAO,EAAEJ,WAAY;IAAAK,QAAA,gBAC/Dd,KAAA,CAACR,IAAI;MAACkB,KAAK,EAAEC,MAAM,CAACI,IAAK;MAAAD,QAAA,GAAC,GAAC,EAAChB,eAAe,CAACO,IAAI,CAACW,IAAI,CAAC;IAAA,CAAO,CAAC,eAC9DhB,KAAA,CAACP,IAAI;MAACiB,KAAK,EAAEC,MAAM,CAACM,WAAY;MAAAH,QAAA,gBAC9BZ,IAAA,CAACV,IAAI;QAACkB,KAAK,EAAEH,SAAU;QAAAO,QAAA,EAAET,IAAI,CAACa;MAAI,CAAO,CAAC,eAC1ChB,IAAA,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import { useBottomSheetStack } from "../../contexts/index.js";
|
|
9
9
|
import { allCountries } from "country-telephone-data";
|
|
10
10
|
import { iso2ToFlagEmoji } from "../../utils/flags.js";
|
|
11
|
-
import
|
|
11
|
+
import CountryPickerView from "./CountryPickerView.js";
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
const DEFAULT_COUNTRIES = allCountries.map(c => ({
|
|
14
14
|
code: `+${c.dialCode}`,
|
|
@@ -59,7 +59,6 @@ const PhoneInput = /*#__PURE__*/forwardRef(({
|
|
|
59
59
|
countryNameStyle: countryNameStyle,
|
|
60
60
|
countryCodeStyle: countryCodeStyle
|
|
61
61
|
}),
|
|
62
|
-
isModal: isBottomSheet,
|
|
63
62
|
snapPoints: ["80%"]
|
|
64
63
|
});
|
|
65
64
|
}, [push, countries, handleCountryPress, listTitle, listTitleStyle, countryNameStyle, countryCodeStyle]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useMemo","useCallback","Text","TouchableOpacity","StyleSheet","CustomInput","useTheme","Ionicons","useBottomSheetStack","allCountries","iso2ToFlagEmoji","CountryPickerView","jsx","_jsx","jsxs","_jsxs","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","isBottomSheet","rest","ref","theme","push","clear","sel","find","handleCountryPress","openCountryPicker","component","
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useMemo","useCallback","Text","TouchableOpacity","StyleSheet","CustomInput","useTheme","Ionicons","useBottomSheetStack","allCountries","iso2ToFlagEmoji","CountryPickerView","jsx","_jsx","jsxs","_jsxs","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","isBottomSheet","rest","ref","theme","push","clear","sel","find","handleCountryPress","openCountryPicker","component","snapPoints","leftIcon","style","styles","selector","backgroundColor","inputBackground","borderRightColor","border","hitSlop","left","top","right","bottom","onPress","activeOpacity","children","flag","color","inputText","size","marginHorizontal","keyboardType","placeholder","create","flexDirection","alignItems","borderRightWidth","paddingHorizontal","fontSize","marginLeft"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Input/PhoneInput.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,OAAO,EAAEC,WAAW,QAAQ,OAAO;AAC/D,SAEEC,IAAI,EAEJC,gBAAgB,EAChBC,UAAU,QAIL,cAAc;AACrB,OAAOC,WAAW,MAA4B,YAAS;AACvD,SAASC,QAAQ,QAAQ,sBAAa;AACtC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,mBAAmB,QAAQ,yBAAgB;AACpD,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,eAAe,QAAQ,sBAAmB;AACnD,OAAOC,iBAAiB,MAAO,wBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAkCrD,MAAMC,iBAA4B,GAAGP,YAAY,CAACQ,GAAG,CAAEC,CAAC,KAAM;EAC5DC,IAAI,EAAE,IAAID,CAAC,CAACE,QAAQ,EAAE;EACtBC,IAAI,EAAEH,CAAC,CAACG,IAAI;EACZC,IAAI,EAAEJ,CAAC,CAACI;AACV,CAAC,CAAC,CAAC;AAEH,MAAMC,UAAU,gBAAGxB,UAAU,CAC3B,CACE;EACEyB,KAAK;EACLC,YAAY;EACZC,eAAe;EACfC,eAAe;EACfC,SAAS,GAAGZ,iBAAiB;EAC7Ba,cAAc;EACdC,mBAAmB;EACnBC,UAAU;EACVC,KAAK;EACLC,UAAU;EACVC,KAAK;EACLC,UAAU;EACVC,MAA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/BC,mBAAmB,EAAEA,mBAAoB;IACzCC,UAAU,EAAEA,UAAW;IACvBE,UAAU,EAAEA,UAAW;IACvBC,KAAK,EAAEA,KAAM;IACbC,UAAU,EAAEA,UAAW;IACvBC,MAAM,EAAEA,MAAO;IACfC,WAAW,EAAEA,WAAY;IAAA,GACrBM;EAAI,CACT,CAAC;AAEN,CACF,CAAC;AAED,MAAMa,MAAM,GAAGpD,UAAU,CAACyE,MAAM,CAAC;EAC/BpB,QAAQ,EAAE;IACRqB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,gBAAgB,EAAE,CAAC;IACnBC,iBAAiB,EAAE,CAAC,CAAE;EACxB,CAAC;EACDX,IAAI,EAAE;IACJY,QAAQ,EAAE,EAAE,CAAE;EAChB,CAAC;EACD/D,IAAI,EAAE;IACJ+D,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAe5D,UAAU","ignoreList":[]}
|
|
@@ -4,4 +4,6 @@ export { default as Input } from "./Input.js";
|
|
|
4
4
|
export * from "./Input.js";
|
|
5
5
|
export { default as PhoneInput } from "./PhoneInput.js";
|
|
6
6
|
export * from "./PhoneInput.js";
|
|
7
|
+
export { default as CountryPickerView } from "./CountryPickerView.js";
|
|
8
|
+
export * from "./CountryPickerView.js";
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","Input","PhoneInput"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Input/index.ts"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,KAAK,
|
|
1
|
+
{"version":3,"names":["default","Input","PhoneInput","CountryPickerView"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Input/index.ts"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,KAAK,QAAQ,YAAS;AAC1C,cAAc,YAAS;AAEvB,SAASD,OAAO,IAAIE,UAAU,QAAQ,iBAAc;AACpD,cAAc,iBAAc;AAE5B,SAASF,OAAO,IAAIG,iBAAiB,QAAQ,wBAAqB;AAClE,cAAc,wBAAqB","ignoreList":[]}
|
|
@@ -1,15 +1,69 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React, { useCallback, useState } from "react";
|
|
4
|
-
import { StyleSheet, View } from "react-native";
|
|
4
|
+
import { StyleSheet, View, Text, I18nManager } from "react-native";
|
|
5
5
|
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
6
6
|
import Animated, { runOnJS, useAnimatedStyle, useSharedValue } from "react-native-reanimated";
|
|
7
|
-
import { SliderLabels } from "./SliderLabel.js";
|
|
8
7
|
import { useTheme } from "../../theme/index.js";
|
|
9
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
9
|
const THUMB_SIZE = 28;
|
|
11
10
|
const RAIL_HEIGHT = 6;
|
|
12
11
|
const LABEL_HEIGHT = 26;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Renders the floating labels above the thumbs.
|
|
15
|
+
*/
|
|
16
|
+
const SliderLabels = ({
|
|
17
|
+
leftValue,
|
|
18
|
+
rightValue,
|
|
19
|
+
leftPosition,
|
|
20
|
+
rightPosition,
|
|
21
|
+
sliderWidth,
|
|
22
|
+
isRTL,
|
|
23
|
+
theme
|
|
24
|
+
}) => {
|
|
25
|
+
const styles = getStyles(theme);
|
|
26
|
+
const animatedLeftLabelStyle = useAnimatedStyle(() => {
|
|
27
|
+
const labelWidth = leftValue.length * 8;
|
|
28
|
+
const centeredPosition = leftPosition.value + THUMB_SIZE / 2 - labelWidth / 2;
|
|
29
|
+
const clampedPosition = Math.max(0, Math.min(centeredPosition, sliderWidth - labelWidth));
|
|
30
|
+
return {
|
|
31
|
+
transform: [{
|
|
32
|
+
translateX: clampedPosition
|
|
33
|
+
}]
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
const animatedRightLabelStyle = useAnimatedStyle(() => {
|
|
37
|
+
const labelWidth = rightValue.length * 8;
|
|
38
|
+
const centeredPosition = rightPosition.value + THUMB_SIZE / 2 - labelWidth / 2;
|
|
39
|
+
const clampedPosition = Math.max(0, Math.min(centeredPosition, sliderWidth - labelWidth));
|
|
40
|
+
return {
|
|
41
|
+
transform: [{
|
|
42
|
+
translateX: clampedPosition
|
|
43
|
+
}]
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
const minLabel = isRTL ? rightValue : leftValue;
|
|
47
|
+
const maxLabel = isRTL ? leftValue : rightValue;
|
|
48
|
+
const minStyle = isRTL ? animatedRightLabelStyle : animatedLeftLabelStyle;
|
|
49
|
+
const maxStyle = isRTL ? animatedLeftLabelStyle : animatedRightLabelStyle;
|
|
50
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
51
|
+
style: styles.labelRow,
|
|
52
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
53
|
+
style: [styles.labelContainer, minStyle],
|
|
54
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
55
|
+
style: styles.labelText,
|
|
56
|
+
children: minLabel
|
|
57
|
+
})
|
|
58
|
+
}), /*#__PURE__*/_jsx(Animated.View, {
|
|
59
|
+
style: [styles.labelContainer, maxStyle],
|
|
60
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
61
|
+
style: styles.labelText,
|
|
62
|
+
children: maxLabel
|
|
63
|
+
})
|
|
64
|
+
})]
|
|
65
|
+
});
|
|
66
|
+
};
|
|
13
67
|
const RangeSlider = ({
|
|
14
68
|
min,
|
|
15
69
|
max,
|
|
@@ -24,32 +78,38 @@ const RangeSlider = ({
|
|
|
24
78
|
theme: defaultTheme
|
|
25
79
|
} = useTheme();
|
|
26
80
|
const currTheme = theme || defaultTheme;
|
|
81
|
+
const isRTL = I18nManager.isRTL;
|
|
27
82
|
const styles = getStyles(currTheme);
|
|
28
|
-
|
|
29
|
-
// State for label text values, passed down to the SliderLabels component
|
|
30
|
-
const [leftLabel, setLeftLabel] = useState(initialMinValue.toLocaleString());
|
|
31
|
-
const [rightLabel, setRightLabel] = useState(initialMaxValue.toLocaleString());
|
|
83
|
+
const railWidth = sliderWidth - THUMB_SIZE;
|
|
32
84
|
const valueToPosition = useCallback(value => {
|
|
33
85
|
"worklet";
|
|
34
86
|
|
|
35
|
-
|
|
36
|
-
|
|
87
|
+
const percentage = (value - min) / (max - min);
|
|
88
|
+
return isRTL ? (1 - percentage) * railWidth : percentage * railWidth;
|
|
89
|
+
}, [min, max, railWidth, isRTL]);
|
|
37
90
|
const positionToValue = useCallback(position => {
|
|
38
91
|
"worklet";
|
|
39
92
|
|
|
40
|
-
const
|
|
93
|
+
const percentage = position / railWidth;
|
|
94
|
+
const rawValue = isRTL ? max - percentage * (max - min) : percentage * (max - min) + min;
|
|
41
95
|
return Math.round(rawValue / step) * step;
|
|
42
|
-
}, [min, max, step,
|
|
96
|
+
}, [min, max, step, railWidth, isRTL]);
|
|
97
|
+
|
|
98
|
+
// --- Shared Values for Animation ---
|
|
43
99
|
const leftPosition = useSharedValue(valueToPosition(initialMinValue));
|
|
44
100
|
const rightPosition = useSharedValue(valueToPosition(initialMaxValue));
|
|
101
|
+
const [leftLabel, setLeftLabel] = useState(initialMinValue.toLocaleString());
|
|
102
|
+
const [rightLabel, setRightLabel] = useState(initialMaxValue.toLocaleString());
|
|
45
103
|
const context = useSharedValue({
|
|
46
104
|
x: 0
|
|
47
105
|
});
|
|
48
106
|
const activeThumb = useSharedValue(null);
|
|
107
|
+
|
|
108
|
+
// --- Gesture Handler ---
|
|
49
109
|
const panGesture = Gesture.Pan().onBegin(e => {
|
|
50
110
|
const distToLeft = Math.abs(e.x - leftPosition.value);
|
|
51
111
|
const distToRight = Math.abs(e.x - rightPosition.value);
|
|
52
|
-
if (distToLeft
|
|
112
|
+
if (distToLeft < distToRight) {
|
|
53
113
|
activeThumb.value = "left";
|
|
54
114
|
context.value = {
|
|
55
115
|
x: leftPosition.value
|
|
@@ -64,11 +124,11 @@ const RangeSlider = ({
|
|
|
64
124
|
if (activeThumb.value === null) return;
|
|
65
125
|
const newPos = context.value.x + e.translationX;
|
|
66
126
|
if (activeThumb.value === "left") {
|
|
67
|
-
const clampedPos = Math.max(0, Math.min(newPos, rightPosition.value
|
|
127
|
+
const clampedPos = Math.max(0, Math.min(newPos, rightPosition.value));
|
|
68
128
|
leftPosition.value = clampedPos;
|
|
69
129
|
runOnJS(setLeftLabel)(positionToValue(clampedPos).toLocaleString());
|
|
70
130
|
} else {
|
|
71
|
-
const clampedPos = Math.min(
|
|
131
|
+
const clampedPos = Math.min(railWidth, Math.max(newPos, leftPosition.value));
|
|
72
132
|
rightPosition.value = clampedPos;
|
|
73
133
|
runOnJS(setRightLabel)(positionToValue(clampedPos).toLocaleString());
|
|
74
134
|
}
|
|
@@ -82,6 +142,8 @@ const RangeSlider = ({
|
|
|
82
142
|
});
|
|
83
143
|
activeThumb.value = null;
|
|
84
144
|
});
|
|
145
|
+
|
|
146
|
+
// --- Animated Styles ---
|
|
85
147
|
const animatedLeftThumbStyle = useAnimatedStyle(() => ({
|
|
86
148
|
transform: [{
|
|
87
149
|
translateX: leftPosition.value
|
|
@@ -89,12 +151,12 @@ const RangeSlider = ({
|
|
|
89
151
|
}));
|
|
90
152
|
const animatedRightThumbStyle = useAnimatedStyle(() => ({
|
|
91
153
|
transform: [{
|
|
92
|
-
translateX: rightPosition.value
|
|
154
|
+
translateX: rightPosition.value
|
|
93
155
|
}]
|
|
94
156
|
}));
|
|
95
157
|
const animatedActiveRailStyle = useAnimatedStyle(() => ({
|
|
96
|
-
left: leftPosition.value,
|
|
97
|
-
right:
|
|
158
|
+
left: leftPosition.value + THUMB_SIZE / 2,
|
|
159
|
+
right: railWidth - rightPosition.value + THUMB_SIZE / 2
|
|
98
160
|
}));
|
|
99
161
|
return /*#__PURE__*/_jsxs(View, {
|
|
100
162
|
style: [styles.container, {
|
|
@@ -106,7 +168,8 @@ const RangeSlider = ({
|
|
|
106
168
|
leftPosition: leftPosition,
|
|
107
169
|
rightPosition: rightPosition,
|
|
108
170
|
sliderWidth: sliderWidth,
|
|
109
|
-
|
|
171
|
+
isRTL: isRTL,
|
|
172
|
+
theme: currTheme
|
|
110
173
|
}), /*#__PURE__*/_jsx(GestureDetector, {
|
|
111
174
|
gesture: panGesture,
|
|
112
175
|
children: /*#__PURE__*/_jsxs(View, {
|
|
@@ -133,8 +196,7 @@ const RangeSlider = ({
|
|
|
133
196
|
const getStyles = theme => StyleSheet.create({
|
|
134
197
|
container: {
|
|
135
198
|
height: LABEL_HEIGHT + THUMB_SIZE,
|
|
136
|
-
justifyContent: "
|
|
137
|
-
marginTop: LABEL_HEIGHT // Add margin to prevent label cutoff
|
|
199
|
+
justifyContent: "flex-end"
|
|
138
200
|
},
|
|
139
201
|
railContainer: {
|
|
140
202
|
justifyContent: "center",
|
|
@@ -164,6 +226,23 @@ const getStyles = theme => StyleSheet.create({
|
|
|
164
226
|
backgroundColor: theme.background,
|
|
165
227
|
borderColor: theme.primary,
|
|
166
228
|
borderWidth: 5
|
|
229
|
+
},
|
|
230
|
+
labelRow: {
|
|
231
|
+
position: "absolute",
|
|
232
|
+
top: 0,
|
|
233
|
+
width: "100%"
|
|
234
|
+
},
|
|
235
|
+
labelContainer: {
|
|
236
|
+
position: "absolute",
|
|
237
|
+
backgroundColor: theme.primary,
|
|
238
|
+
borderRadius: 4,
|
|
239
|
+
paddingVertical: 4,
|
|
240
|
+
paddingHorizontal: 8,
|
|
241
|
+
height: LABEL_HEIGHT
|
|
242
|
+
},
|
|
243
|
+
labelText: {
|
|
244
|
+
color: theme.onPrimary,
|
|
245
|
+
fontSize: 12
|
|
167
246
|
}
|
|
168
247
|
});
|
|
169
248
|
export default RangeSlider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useState","StyleSheet","View","Gesture","GestureDetector","Animated","runOnJS","useAnimatedStyle","useSharedValue","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useState","StyleSheet","View","Text","I18nManager","Gesture","GestureDetector","Animated","runOnJS","useAnimatedStyle","useSharedValue","useTheme","jsx","_jsx","jsxs","_jsxs","THUMB_SIZE","RAIL_HEIGHT","LABEL_HEIGHT","SliderLabels","leftValue","rightValue","leftPosition","rightPosition","sliderWidth","isRTL","theme","styles","getStyles","animatedLeftLabelStyle","labelWidth","length","centeredPosition","value","clampedPosition","Math","max","min","transform","translateX","animatedRightLabelStyle","minLabel","maxLabel","minStyle","maxStyle","style","labelRow","children","labelContainer","labelText","RangeSlider","step","initialMinValue","initialMaxValue","onValueChange","defaultTheme","currTheme","railWidth","valueToPosition","percentage","positionToValue","position","rawValue","round","leftLabel","setLeftLabel","toLocaleString","rightLabel","setRightLabel","context","x","activeThumb","panGesture","Pan","onBegin","e","distToLeft","abs","distToRight","onUpdate","newPos","translationX","clampedPos","onEnd","finalLeftValue","finalRightValue","animatedLeftThumbStyle","animatedRightThumbStyle","animatedActiveRailStyle","left","right","container","width","gesture","railContainer","rail","activeRail","thumbContainer","thumb","create","height","justifyContent","borderRadius","backgroundColor","surface","primary","alignItems","background","borderColor","borderWidth","top","paddingVertical","paddingHorizontal","color","onPrimary","fontSize"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/RangeSlider/RangeSlider.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACpD,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,EAAEC,WAAW,QAAQ,cAAc;AAClE,SAASC,OAAO,EAAEC,eAAe,QAAQ,8BAA8B;AACvE,OAAOC,QAAQ,IACbC,OAAO,EACPC,gBAAgB,EAChBC,cAAc,QACT,yBAAyB;AAChC,SAAoBC,QAAQ,QAAQ,sBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAElD,MAAMC,UAAU,GAAG,EAAE;AACrB,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,YAAY,GAAG,EAAE;;AAGvB;AACA;AAC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,EAAEpF;EACV,CAAC;EACD+E,IAAI,EAAE;IACJK,MAAM,EAAEnF,WAAW;IACnBqF,YAAY,EAAErF,WAAW,GAAG,CAAC;IAC7BsF,eAAe,EAAE7E,KAAK,CAAC8E;EACzB,CAAC;EACDR,UAAU,EAAE;IACVI,MAAM,EAAEnF,WAAW;IACnBsF,eAAe,EAAE7E,KAAK,CAAC+E,OAAO;IAC9B5C,QAAQ,EAAE;EACZ,CAAC;EACDoC,cAAc,EAAE;IACdpC,QAAQ,EAAE,UAAU;IACpB+B,KAAK,EAAE5E,UAAU;IACjBoF,MAAM,EAAEpF,UAAU;IAClBqF,cAAc,EAAE,QAAQ;IACxBK,UAAU,EAAE;EACd,CAAC;EACDR,KAAK,EAAE;IACLN,KAAK,EAAE5E,UAAU;IACjBoF,MAAM,EAAEpF,UAAU;IAClBsF,YAAY,EAAEtF,UAAU,GAAG,CAAC;IAC5BuF,eAAe,EAAE7E,KAAK,CAACiF,UAAU;IACjCC,WAAW,EAAElF,KAAK,CAAC+E,OAAO;IAC1BI,WAAW,EAAE;EACf,CAAC;EACD/D,QAAQ,EAAE;IACRe,QAAQ,EAAE,UAAU;IACpBiD,GAAG,EAAE,CAAC;IACNlB,KAAK,EAAE;EACT,CAAC;EACD5C,cAAc,EAAE;IACda,QAAQ,EAAE,UAAU;IACpB0C,eAAe,EAAE7E,KAAK,CAAC+E,OAAO;IAC9BH,YAAY,EAAE,CAAC;IACfS,eAAe,EAAE,CAAC;IAClBC,iBAAiB,EAAE,CAAC;IACpBZ,MAAM,EAAElF;EACV,CAAC;EACD+B,SAAS,EAAE;IACTgE,KAAK,EAAEvF,KAAK,CAACwF,SAAS;IACtBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEJ,eAAejE,WAAW","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useContext","BottomSheetStackContext","createContext","useBottomSheetStack","context","Error"],"sourceRoot":"..\\..\\..\\src","sources":["contexts/BottomSheetStackContext.tsx"],"mappings":";;AACA,OAAOA,KAAK,IAAeC,UAAU,QAAQ,OAAO;
|
|
1
|
+
{"version":3,"names":["React","useContext","BottomSheetStackContext","createContext","useBottomSheetStack","context","Error"],"sourceRoot":"..\\..\\..\\src","sources":["contexts/BottomSheetStackContext.tsx"],"mappings":";;AACA,OAAOA,KAAK,IAAeC,UAAU,QAAQ,OAAO;AAkBpD,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":[]}
|
|
@@ -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,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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;MAClCsB,QAAQ,EAAE9C,GAAI;MACd+C,oBAAoB,EAAE;QAAEnB,eAAe,EAAE;MAAU,CAAE;MACrDD,KAAK,EAAEqB,MAAM,CAACC,cAAe;MAAArD,QAAA,EAE5Be,WAAW,iBACVnB,IAAA,CAAC2B,YAAY;QAEX+B,QAAQ,EAAE7B,iBAAkB;QAC5B8B,OAAO,EAAE5B,gBAAiB;QAC1BI,KAAK,EAAEqB,MAAM,CAACI,YAAa;QAAAxD,QAAA,EAE1Be,WAAW,CAAC0C;MAAS,GALjBxD,KAAK,CAACW,MAMC;IACf,CACU,CAAC;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"}
|
|
@@ -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;
|
|
@@ -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
|
}, [
|
|
@@ -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";
|
|
@@ -1,18 +1,79 @@
|
|
|
1
1
|
import React, { useCallback, useState } from "react";
|
|
2
|
-
import { StyleSheet, View } from "react-native";
|
|
2
|
+
import { StyleSheet, View, Text, I18nManager } from "react-native";
|
|
3
3
|
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
4
4
|
import Animated, {
|
|
5
5
|
runOnJS,
|
|
6
6
|
useAnimatedStyle,
|
|
7
7
|
useSharedValue,
|
|
8
8
|
} from "react-native-reanimated";
|
|
9
|
-
import { SliderLabels } from "./SliderLabel";
|
|
10
9
|
import { ThemeType, useTheme } from "../../theme";
|
|
11
10
|
|
|
12
11
|
const THUMB_SIZE = 28;
|
|
13
12
|
const RAIL_HEIGHT = 6;
|
|
14
13
|
const LABEL_HEIGHT = 26;
|
|
15
14
|
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Renders the floating labels above the thumbs.
|
|
18
|
+
*/
|
|
19
|
+
const SliderLabels = ({
|
|
20
|
+
leftValue,
|
|
21
|
+
rightValue,
|
|
22
|
+
leftPosition,
|
|
23
|
+
rightPosition,
|
|
24
|
+
sliderWidth,
|
|
25
|
+
isRTL,
|
|
26
|
+
theme,
|
|
27
|
+
}: {
|
|
28
|
+
leftValue: string;
|
|
29
|
+
rightValue: string;
|
|
30
|
+
leftPosition: Animated.SharedValue<number>;
|
|
31
|
+
rightPosition: Animated.SharedValue<number>;
|
|
32
|
+
sliderWidth: number;
|
|
33
|
+
isRTL: boolean;
|
|
34
|
+
theme: ThemeType;
|
|
35
|
+
}) => {
|
|
36
|
+
const styles = getStyles(theme);
|
|
37
|
+
|
|
38
|
+
const animatedLeftLabelStyle = useAnimatedStyle(() => {
|
|
39
|
+
const labelWidth = leftValue.length * 8;
|
|
40
|
+
const centeredPosition =
|
|
41
|
+
leftPosition.value + THUMB_SIZE / 2 - labelWidth / 2;
|
|
42
|
+
const clampedPosition = Math.max(
|
|
43
|
+
0,
|
|
44
|
+
Math.min(centeredPosition, sliderWidth - labelWidth)
|
|
45
|
+
);
|
|
46
|
+
return { transform: [{ translateX: clampedPosition }] };
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const animatedRightLabelStyle = useAnimatedStyle(() => {
|
|
50
|
+
const labelWidth = rightValue.length * 8;
|
|
51
|
+
const centeredPosition =
|
|
52
|
+
rightPosition.value + THUMB_SIZE / 2 - labelWidth / 2;
|
|
53
|
+
const clampedPosition = Math.max(
|
|
54
|
+
0,
|
|
55
|
+
Math.min(centeredPosition, sliderWidth - labelWidth)
|
|
56
|
+
);
|
|
57
|
+
return { transform: [{ translateX: clampedPosition }] };
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const minLabel = isRTL ? rightValue : leftValue;
|
|
61
|
+
const maxLabel = isRTL ? leftValue : rightValue;
|
|
62
|
+
const minStyle = isRTL ? animatedRightLabelStyle : animatedLeftLabelStyle;
|
|
63
|
+
const maxStyle = isRTL ? animatedLeftLabelStyle : animatedRightLabelStyle;
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<View style={styles.labelRow}>
|
|
67
|
+
<Animated.View style={[styles.labelContainer, minStyle]}>
|
|
68
|
+
<Text style={styles.labelText}>{minLabel}</Text>
|
|
69
|
+
</Animated.View>
|
|
70
|
+
<Animated.View style={[styles.labelContainer, maxStyle]}>
|
|
71
|
+
<Text style={styles.labelText}>{maxLabel}</Text>
|
|
72
|
+
</Animated.View>
|
|
73
|
+
</View>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
16
77
|
interface RangeSliderProps {
|
|
17
78
|
min: number;
|
|
18
79
|
max: number;
|
|
@@ -21,8 +82,8 @@ interface RangeSliderProps {
|
|
|
21
82
|
initialMinValue: number;
|
|
22
83
|
initialMaxValue: number;
|
|
23
84
|
onValueChange: (values: { min: number; max: number }) => void;
|
|
24
|
-
|
|
25
|
-
theme?: ThemeType
|
|
85
|
+
isRTL?: boolean;
|
|
86
|
+
theme?: ThemeType;
|
|
26
87
|
}
|
|
27
88
|
|
|
28
89
|
const RangeSlider: React.FC<RangeSliderProps> = ({
|
|
@@ -33,47 +94,52 @@ const RangeSlider: React.FC<RangeSliderProps> = ({
|
|
|
33
94
|
initialMinValue,
|
|
34
95
|
initialMaxValue,
|
|
35
96
|
onValueChange,
|
|
36
|
-
theme
|
|
97
|
+
theme,
|
|
37
98
|
}) => {
|
|
38
|
-
const { theme: defaultTheme} = useTheme();
|
|
39
|
-
|
|
99
|
+
const { theme: defaultTheme } = useTheme();
|
|
40
100
|
const currTheme = theme || defaultTheme;
|
|
41
|
-
|
|
101
|
+
const isRTL = I18nManager.isRTL;
|
|
42
102
|
const styles = getStyles(currTheme);
|
|
43
103
|
|
|
44
|
-
|
|
45
|
-
const [leftLabel, setLeftLabel] = useState(initialMinValue.toLocaleString());
|
|
46
|
-
const [rightLabel, setRightLabel] = useState(
|
|
47
|
-
initialMaxValue.toLocaleString()
|
|
48
|
-
);
|
|
104
|
+
const railWidth = sliderWidth - THUMB_SIZE;
|
|
49
105
|
|
|
50
106
|
const valueToPosition = useCallback(
|
|
51
107
|
(value: number) => {
|
|
52
108
|
"worklet";
|
|
53
|
-
|
|
109
|
+
const percentage = (value - min) / (max - min);
|
|
110
|
+
return isRTL
|
|
111
|
+
? (1 - percentage) * railWidth
|
|
112
|
+
: percentage * railWidth;
|
|
54
113
|
},
|
|
55
|
-
[min, max,
|
|
114
|
+
[min, max, railWidth, isRTL]
|
|
56
115
|
);
|
|
57
116
|
|
|
58
117
|
const positionToValue = useCallback(
|
|
59
118
|
(position: number) => {
|
|
60
119
|
"worklet";
|
|
61
|
-
const
|
|
120
|
+
const percentage = position / railWidth;
|
|
121
|
+
const rawValue = isRTL
|
|
122
|
+
? max - percentage * (max - min)
|
|
123
|
+
: percentage * (max - min) + min;
|
|
62
124
|
return Math.round(rawValue / step) * step;
|
|
63
125
|
},
|
|
64
|
-
[min, max, step,
|
|
126
|
+
[min, max, step, railWidth, isRTL]
|
|
65
127
|
);
|
|
66
128
|
|
|
129
|
+
// --- Shared Values for Animation ---
|
|
67
130
|
const leftPosition = useSharedValue(valueToPosition(initialMinValue));
|
|
68
131
|
const rightPosition = useSharedValue(valueToPosition(initialMaxValue));
|
|
132
|
+
const [leftLabel, setLeftLabel] = useState(initialMinValue.toLocaleString());
|
|
133
|
+
const [rightLabel, setRightLabel] = useState(initialMaxValue.toLocaleString());
|
|
69
134
|
const context = useSharedValue({ x: 0 });
|
|
70
135
|
const activeThumb = useSharedValue<"left" | "right" | null>(null);
|
|
71
136
|
|
|
137
|
+
// --- Gesture Handler ---
|
|
72
138
|
const panGesture = Gesture.Pan()
|
|
73
139
|
.onBegin((e) => {
|
|
74
140
|
const distToLeft = Math.abs(e.x - leftPosition.value);
|
|
75
141
|
const distToRight = Math.abs(e.x - rightPosition.value);
|
|
76
|
-
if (distToLeft
|
|
142
|
+
if (distToLeft < distToRight) {
|
|
77
143
|
activeThumb.value = "left";
|
|
78
144
|
context.value = { x: leftPosition.value };
|
|
79
145
|
} else {
|
|
@@ -86,17 +152,11 @@ const RangeSlider: React.FC<RangeSliderProps> = ({
|
|
|
86
152
|
const newPos = context.value.x + e.translationX;
|
|
87
153
|
|
|
88
154
|
if (activeThumb.value === "left") {
|
|
89
|
-
const clampedPos = Math.max(
|
|
90
|
-
0,
|
|
91
|
-
Math.min(newPos, rightPosition.value - THUMB_SIZE)
|
|
92
|
-
);
|
|
155
|
+
const clampedPos = Math.max(0, Math.min(newPos, rightPosition.value));
|
|
93
156
|
leftPosition.value = clampedPos;
|
|
94
157
|
runOnJS(setLeftLabel)(positionToValue(clampedPos).toLocaleString());
|
|
95
158
|
} else {
|
|
96
|
-
const clampedPos = Math.min(
|
|
97
|
-
sliderWidth,
|
|
98
|
-
Math.max(newPos, leftPosition.value + THUMB_SIZE)
|
|
99
|
-
);
|
|
159
|
+
const clampedPos = Math.min(railWidth, Math.max(newPos, leftPosition.value));
|
|
100
160
|
rightPosition.value = clampedPos;
|
|
101
161
|
runOnJS(setRightLabel)(positionToValue(clampedPos).toLocaleString());
|
|
102
162
|
}
|
|
@@ -109,17 +169,18 @@ const RangeSlider: React.FC<RangeSliderProps> = ({
|
|
|
109
169
|
activeThumb.value = null;
|
|
110
170
|
});
|
|
111
171
|
|
|
172
|
+
// --- Animated Styles ---
|
|
112
173
|
const animatedLeftThumbStyle = useAnimatedStyle(() => ({
|
|
113
174
|
transform: [{ translateX: leftPosition.value }],
|
|
114
175
|
}));
|
|
115
176
|
|
|
116
177
|
const animatedRightThumbStyle = useAnimatedStyle(() => ({
|
|
117
|
-
transform: [{ translateX: rightPosition.value
|
|
178
|
+
transform: [{ translateX: rightPosition.value }],
|
|
118
179
|
}));
|
|
119
180
|
|
|
120
181
|
const animatedActiveRailStyle = useAnimatedStyle(() => ({
|
|
121
|
-
left: leftPosition.value,
|
|
122
|
-
right:
|
|
182
|
+
left: leftPosition.value + THUMB_SIZE / 2,
|
|
183
|
+
right: railWidth - rightPosition.value + THUMB_SIZE / 2,
|
|
123
184
|
}));
|
|
124
185
|
|
|
125
186
|
return (
|
|
@@ -130,23 +191,17 @@ const RangeSlider: React.FC<RangeSliderProps> = ({
|
|
|
130
191
|
leftPosition={leftPosition}
|
|
131
192
|
rightPosition={rightPosition}
|
|
132
193
|
sliderWidth={sliderWidth}
|
|
133
|
-
|
|
194
|
+
isRTL={isRTL}
|
|
195
|
+
theme={currTheme}
|
|
134
196
|
/>
|
|
135
|
-
|
|
136
197
|
<GestureDetector gesture={panGesture}>
|
|
137
198
|
<View style={styles.railContainer}>
|
|
138
199
|
<View style={styles.rail} />
|
|
139
200
|
<Animated.View style={[styles.activeRail, animatedActiveRailStyle]} />
|
|
140
|
-
|
|
141
|
-
<Animated.View
|
|
142
|
-
style={[styles.thumbContainer, animatedLeftThumbStyle]}
|
|
143
|
-
>
|
|
201
|
+
<Animated.View style={[styles.thumbContainer, animatedLeftThumbStyle]}>
|
|
144
202
|
<View style={styles.thumb} />
|
|
145
203
|
</Animated.View>
|
|
146
|
-
|
|
147
|
-
<Animated.View
|
|
148
|
-
style={[styles.thumbContainer, animatedRightThumbStyle]}
|
|
149
|
-
>
|
|
204
|
+
<Animated.View style={[styles.thumbContainer, animatedRightThumbStyle]}>
|
|
150
205
|
<View style={styles.thumb} />
|
|
151
206
|
</Animated.View>
|
|
152
207
|
</View>
|
|
@@ -159,8 +214,7 @@ const getStyles = (theme: ThemeType) =>
|
|
|
159
214
|
StyleSheet.create({
|
|
160
215
|
container: {
|
|
161
216
|
height: LABEL_HEIGHT + THUMB_SIZE,
|
|
162
|
-
justifyContent: "
|
|
163
|
-
marginTop: LABEL_HEIGHT, // Add margin to prevent label cutoff
|
|
217
|
+
justifyContent: "flex-end",
|
|
164
218
|
},
|
|
165
219
|
railContainer: {
|
|
166
220
|
justifyContent: "center",
|
|
@@ -191,6 +245,23 @@ const getStyles = (theme: ThemeType) =>
|
|
|
191
245
|
borderColor: theme.primary,
|
|
192
246
|
borderWidth: 5,
|
|
193
247
|
},
|
|
248
|
+
labelRow: {
|
|
249
|
+
position: "absolute",
|
|
250
|
+
top: 0,
|
|
251
|
+
width: "100%",
|
|
252
|
+
},
|
|
253
|
+
labelContainer: {
|
|
254
|
+
position: "absolute",
|
|
255
|
+
backgroundColor: theme.primary,
|
|
256
|
+
borderRadius: 4,
|
|
257
|
+
paddingVertical: 4,
|
|
258
|
+
paddingHorizontal: 8,
|
|
259
|
+
height: LABEL_HEIGHT,
|
|
260
|
+
},
|
|
261
|
+
labelText: {
|
|
262
|
+
color: theme.onPrimary,
|
|
263
|
+
fontSize: 12,
|
|
264
|
+
},
|
|
194
265
|
});
|
|
195
266
|
|
|
196
|
-
export default RangeSlider;
|
|
267
|
+
export default RangeSlider;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import BottomSheet, {
|
|
2
2
|
BottomSheetBackdrop,
|
|
3
3
|
BottomSheetBackdropProps,
|
|
4
|
-
BottomSheetModal,
|
|
5
|
-
BottomSheetModalProvider,
|
|
6
4
|
} from "@gorhom/bottom-sheet";
|
|
7
5
|
import React, {
|
|
8
6
|
ReactNode,
|
|
@@ -12,7 +10,7 @@ import React, {
|
|
|
12
10
|
useRef,
|
|
13
11
|
useState,
|
|
14
12
|
} from "react";
|
|
15
|
-
import { BackHandler, StyleSheet
|
|
13
|
+
import { BackHandler, StyleSheet } from "react-native";
|
|
16
14
|
import Animated, { FadeIn, FadeOut } from "react-native-reanimated";
|
|
17
15
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
18
16
|
import {
|
|
@@ -24,10 +22,7 @@ export const BottomSheetStackProvider: React.FC<{ children: ReactNode }> = ({
|
|
|
24
22
|
children,
|
|
25
23
|
}) => {
|
|
26
24
|
const [stack, setStack] = useState<BottomSheetStackItem[]>([]);
|
|
27
|
-
|
|
28
25
|
const sheetRef = useRef<BottomSheet>(null);
|
|
29
|
-
const modalRef = useRef<BottomSheetModal>(null);
|
|
30
|
-
|
|
31
26
|
const { top } = useSafeAreaInsets();
|
|
32
27
|
|
|
33
28
|
const push = useCallback((item: BottomSheetStackItem) => {
|
|
@@ -36,7 +31,6 @@ export const BottomSheetStackProvider: React.FC<{ children: ReactNode }> = ({
|
|
|
36
31
|
|
|
37
32
|
const clear = useCallback(() => {
|
|
38
33
|
sheetRef.current?.close();
|
|
39
|
-
modalRef.current?.dismiss();
|
|
40
34
|
setStack([]);
|
|
41
35
|
}, []);
|
|
42
36
|
|
|
@@ -58,30 +52,26 @@ export const BottomSheetStackProvider: React.FC<{ children: ReactNode }> = ({
|
|
|
58
52
|
|
|
59
53
|
useEffect(() => {
|
|
60
54
|
if (isOpen && currentItem) {
|
|
61
|
-
|
|
62
|
-
sheetRef.current?.close();
|
|
63
|
-
modalRef.current?.present();
|
|
64
|
-
} else {
|
|
65
|
-
modalRef.current?.dismiss();
|
|
66
|
-
sheetRef.current?.snapToIndex(currentItem.initialSnapIndex ?? 0);
|
|
67
|
-
}
|
|
55
|
+
sheetRef.current?.snapToIndex(currentItem.initialSnapIndex ?? 0);
|
|
68
56
|
}
|
|
69
57
|
|
|
70
58
|
const backHandlerSubscription = BackHandler.addEventListener(
|
|
71
59
|
"hardwareBackPress",
|
|
72
60
|
() => {
|
|
73
|
-
if (!isOpen) return false;
|
|
74
61
|
if (canGoBack) {
|
|
75
62
|
pop();
|
|
76
|
-
|
|
77
|
-
clear();
|
|
63
|
+
return true;
|
|
78
64
|
}
|
|
79
|
-
|
|
65
|
+
if (!canGoBack && stack.length === 1) {
|
|
66
|
+
sheetRef.current?.close();
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
return false;
|
|
80
70
|
}
|
|
81
71
|
);
|
|
82
72
|
|
|
83
73
|
return () => backHandlerSubscription.remove();
|
|
84
|
-
}, [isOpen, canGoBack, currentItem, pop,
|
|
74
|
+
}, [isOpen, canGoBack, currentItem, pop, stack]);
|
|
85
75
|
|
|
86
76
|
const AnimatedView = Animated.View;
|
|
87
77
|
const enteringAnimation = FadeIn.duration(200);
|
|
@@ -92,6 +82,7 @@ export const BottomSheetStackProvider: React.FC<{ children: ReactNode }> = ({
|
|
|
92
82
|
<BottomSheetBackdrop
|
|
93
83
|
{...props}
|
|
94
84
|
disappearsOnIndex={-1}
|
|
85
|
+
style={[props.style, { backgroundColor: "rgba(0,0,0,0,1)" }]}
|
|
95
86
|
appearsOnIndex={0}
|
|
96
87
|
pressBehavior={"close"}
|
|
97
88
|
/>
|
|
@@ -99,61 +90,50 @@ export const BottomSheetStackProvider: React.FC<{ children: ReactNode }> = ({
|
|
|
99
90
|
[]
|
|
100
91
|
);
|
|
101
92
|
|
|
102
|
-
const currentSheetContent = currentItem ? (
|
|
103
|
-
<AnimatedView
|
|
104
|
-
key={stack.length}
|
|
105
|
-
entering={enteringAnimation}
|
|
106
|
-
exiting={exitingAnimation}
|
|
107
|
-
style={styles.animatedView}
|
|
108
|
-
>
|
|
109
|
-
{currentItem.component}
|
|
110
|
-
</AnimatedView>
|
|
111
|
-
) : null;
|
|
112
|
-
|
|
113
93
|
return (
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
94
|
+
<BottomSheetStackContext.Provider
|
|
95
|
+
value={{ push, pop, replace, clear, canGoBack }}
|
|
96
|
+
>
|
|
97
|
+
{children}
|
|
98
|
+
<BottomSheet
|
|
99
|
+
{...currentItem?.bottomSheetProps}
|
|
100
|
+
ref={sheetRef}
|
|
101
|
+
index={-1}
|
|
102
|
+
snapPoints={currentItem?.snapPoints || ["100%"]}
|
|
103
|
+
enableDynamicSizing={currentItem?.dynamicSizing ?? false}
|
|
104
|
+
enablePanDownToClose
|
|
105
|
+
android_keyboardInputMode="adjustResize"
|
|
106
|
+
enableBlurKeyboardOnGesture
|
|
107
|
+
keyboardBlurBehavior="restore"
|
|
108
|
+
keyboardBehavior="fillParent"
|
|
109
|
+
onClose={clear}
|
|
110
|
+
backdropComponent={renderBackdrop}
|
|
111
|
+
topInset={top}
|
|
112
|
+
handleIndicatorStyle={{ backgroundColor: "#CCCCCC" }}
|
|
113
|
+
style={styles.sheetContainer}
|
|
117
114
|
>
|
|
118
|
-
{
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
style={styles.sheetContainer}
|
|
131
|
-
>
|
|
132
|
-
{!currentItem?.isModal ? currentSheetContent : <View />}
|
|
133
|
-
</BottomSheet>
|
|
134
|
-
|
|
135
|
-
<BottomSheetModal
|
|
136
|
-
{...currentItem?.bottomSheetProps}
|
|
137
|
-
ref={modalRef}
|
|
138
|
-
index={0}
|
|
139
|
-
snapPoints={currentItem?.isModal ? (currentItem?.snapPoints || ["100%"]) : ["1%"]}
|
|
140
|
-
onDismiss={clear}
|
|
141
|
-
topInset={top}
|
|
142
|
-
handleIndicatorStyle={{ backgroundColor: "#CCCCCC" }}
|
|
143
|
-
style={styles.sheetContainer}
|
|
144
|
-
>
|
|
145
|
-
{currentItem?.isModal ? currentSheetContent : <View />}
|
|
146
|
-
</BottomSheetModal>
|
|
147
|
-
</BottomSheetStackContext.Provider>
|
|
148
|
-
</BottomSheetModalProvider>
|
|
115
|
+
{currentItem && (
|
|
116
|
+
<AnimatedView
|
|
117
|
+
key={stack.length}
|
|
118
|
+
entering={enteringAnimation}
|
|
119
|
+
exiting={exitingAnimation}
|
|
120
|
+
style={styles.animatedView}
|
|
121
|
+
>
|
|
122
|
+
{currentItem.component}
|
|
123
|
+
</AnimatedView>
|
|
124
|
+
)}
|
|
125
|
+
</BottomSheet>
|
|
126
|
+
</BottomSheetStackContext.Provider>
|
|
149
127
|
);
|
|
150
128
|
};
|
|
151
129
|
|
|
152
130
|
const styles = StyleSheet.create({
|
|
153
131
|
sheetContainer: {
|
|
154
|
-
//
|
|
132
|
+
// backgroundColor: "#FFFFFF",
|
|
133
|
+
// borderTopLeftRadius: 20,
|
|
134
|
+
// borderTopRightRadius: 20,
|
|
155
135
|
},
|
|
156
136
|
animatedView: {
|
|
157
137
|
flex: 1,
|
|
158
138
|
},
|
|
159
|
-
});
|
|
139
|
+
});
|
package/src/index.ts
CHANGED