dhre-ui-kit 0.0.247 → 0.0.249

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/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import React, { createContext, useContext, useRef, useEffect, useState, memo, useCallback } from 'react';
1
+ import React, { createContext, useContext, useState, useEffect, useRef, memo, useCallback } from 'react';
2
2
  import { useSelector } from 'react-redux';
3
- import { Dimensions, StyleSheet, Text, Pressable, View, Modal, KeyboardAvoidingView, Platform, Animated, Easing, TextInput, ScrollView, FlatList, TouchableOpacity, Alert, Linking, PanResponder } from 'react-native';
3
+ import { Dimensions, StyleSheet, Text, Pressable, View, Modal, KeyboardAvoidingView, Platform, TextInput, ScrollView, Animated, FlatList, TouchableOpacity, Alert, Linking, PanResponder } from 'react-native';
4
4
  import { PanGestureHandler, GestureHandlerRootView, Swipeable } from 'react-native-gesture-handler';
5
5
  import { BlurView } from '@react-native-community/blur';
6
- import Svg, { Defs, LinearGradient, Stop, Circle } from 'react-native-svg';
6
+ import LottieView from 'lottie-react-native';
7
7
  import Tooltip from 'react-native-walkthrough-tooltip';
8
8
  import Pdf from 'react-native-pdf';
9
9
  import * as Progress from 'react-native-progress';
@@ -15,6 +15,7 @@ import { Dropdown } from 'react-native-element-dropdown';
15
15
  import DocumentPicker from 'react-native-document-picker';
16
16
  import RNFS from 'react-native-fs';
17
17
  import OTPVerify, { removeListener, startOtpListener } from 'react-native-otp-verify';
18
+ import { verticalScale as verticalScale$1, moderateScale as moderateScale$1 } from 'src/utils/stylehelper';
18
19
  import Clipboard from '@react-native-clipboard/clipboard';
19
20
 
20
21
  var ShapeType = /* @__PURE__ */ ((ShapeType2) => {
@@ -710,6 +711,13 @@ const BottomDrawer = ({
710
711
 
711
712
  const createStyles$3 = (theme) => {
712
713
  return StyleSheet.create({
714
+ container: {
715
+ position: "absolute",
716
+ left: 0,
717
+ right: 0,
718
+ bottom: 0,
719
+ top: 0
720
+ },
713
721
  backdrop: {
714
722
  flex: 1,
715
723
  justifyContent: "center",
@@ -745,68 +753,22 @@ const createStyles$3 = (theme) => {
745
753
  });
746
754
  };
747
755
 
756
+ const loaderJson = { "nm": "Main Scene", "ddd": 0, "h": 100, "w": 100, "meta": { "g": "@lottiefiles/creator 1.44.0" }, "layers": [{ "ty": 4, "nm": "6", "sr": 1, "st": 0, "op": 120, "ip": 0, "hd": false, "ddd": 0, "bm": 0, "hasMask": false, "ao": 0, "ks": { "a": { "a": 0, "k": [-2.905, -24.228, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100, 100], "ix": 6 }, "sk": { "a": 0, "k": 0 }, "p": { "a": 0, "k": [50, 50, 0], "ix": 2 }, "r": { "a": 1, "k": [{ "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.223, "y": 1 }, "s": [0], "t": 10 }, { "s": [360], "t": 100 }], "ix": 10 }, "sa": { "a": 0, "k": 0 }, "o": { "a": 0, "k": 100, "ix": 11 } }, "shapes": [{ "ty": "gr", "bm": 0, "hd": false, "mn": "ADBE Vector Group", "nm": "Ellipse 1", "ix": 1, "cix": 2, "np": 3, "it": [{ "ty": "el", "bm": 0, "hd": false, "mn": "ADBE Vector Shape - Ellipse", "nm": "Ellipse Path 1", "d": 1, "p": { "a": 0, "k": [0, 0], "ix": 3 }, "s": { "a": 0, "k": [14.822, 14.822], "ix": 2 } }, { "ty": "fl", "bm": 0, "hd": false, "mn": "ADBE Vector Graphic - Fill", "nm": "Fill 1", "c": { "a": 0, "k": [0.8, 0.8, 0.8], "ix": 4 }, "r": 1, "o": { "a": 0, "k": 100, "ix": 5 } }, { "ty": "tr", "a": { "a": 0, "k": [0, 0], "ix": 1 }, "s": { "a": 1, "k": [{ "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.236, "y": 1 }, "s": [100, 100], "t": 10 }, { "s": [0, 0], "t": 100 }], "ix": 3 }, "sk": { "a": 0, "k": 0, "ix": 4 }, "p": { "a": 0, "k": [-2.905, -64.316], "ix": 2 }, "r": { "a": 0, "k": 357, "ix": 6 }, "sa": { "a": 0, "k": 0, "ix": 5 }, "o": { "a": 0, "k": 100, "ix": 7 } }] }], "ind": 1 }, { "ty": 4, "nm": "5", "sr": 1, "st": 0, "op": 120, "ip": 0, "hd": false, "ddd": 0, "bm": 0, "hasMask": false, "ao": 0, "ks": { "a": { "a": 0, "k": [-2.905, -24.228, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100, 100], "ix": 6 }, "sk": { "a": 0, "k": 0 }, "p": { "a": 0, "k": [50, 50, 0], "ix": 2 }, "r": { "a": 1, "k": [{ "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.223, "y": 1 }, "s": [0], "t": 8 }, { "s": [360], "t": 98 }], "ix": 10 }, "sa": { "a": 0, "k": 0 }, "o": { "a": 0, "k": 100, "ix": 11 } }, "shapes": [{ "ty": "gr", "bm": 0, "hd": false, "mn": "ADBE Vector Group", "nm": "Ellipse 1", "ix": 1, "cix": 2, "np": 3, "it": [{ "ty": "el", "bm": 0, "hd": false, "mn": "ADBE Vector Shape - Ellipse", "nm": "Ellipse Path 1", "d": 1, "p": { "a": 0, "k": [0, 0], "ix": 3 }, "s": { "a": 0, "k": [14.822, 14.822], "ix": 2 } }, { "ty": "fl", "bm": 0, "hd": false, "mn": "ADBE Vector Graphic - Fill", "nm": "Fill 1", "c": { "a": 0, "k": [0.8, 0.8, 0.8], "ix": 4 }, "r": 1, "o": { "a": 0, "k": 100, "ix": 5 } }, { "ty": "tr", "a": { "a": 0, "k": [0, 0], "ix": 1 }, "s": { "a": 1, "k": [{ "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.236, "y": 1 }, "s": [80, 80], "t": 8 }, { "s": [20, 20], "t": 98 }], "ix": 3 }, "sk": { "a": 0, "k": 0, "ix": 4 }, "p": { "a": 0, "k": [-2.905, -64.316], "ix": 2 }, "r": { "a": 0, "k": 357, "ix": 6 }, "sa": { "a": 0, "k": 0, "ix": 5 }, "o": { "a": 0, "k": 100, "ix": 7 } }] }], "ind": 2 }, { "ty": 4, "nm": "4", "sr": 1, "st": 0, "op": 120, "ip": 0, "hd": false, "ddd": 0, "bm": 0, "hasMask": false, "ao": 0, "ks": { "a": { "a": 0, "k": [-2.905, -24.228, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100, 100], "ix": 6 }, "sk": { "a": 0, "k": 0 }, "p": { "a": 0, "k": [50, 50, 0], "ix": 2 }, "r": { "a": 1, "k": [{ "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.223, "y": 1 }, "s": [0], "t": 6 }, { "s": [360], "t": 96 }], "ix": 10 }, "sa": { "a": 0, "k": 0 }, "o": { "a": 0, "k": 100, "ix": 11 } }, "shapes": [{ "ty": "gr", "bm": 0, "hd": false, "mn": "ADBE Vector Group", "nm": "Ellipse 1", "ix": 1, "cix": 2, "np": 3, "it": [{ "ty": "el", "bm": 0, "hd": false, "mn": "ADBE Vector Shape - Ellipse", "nm": "Ellipse Path 1", "d": 1, "p": { "a": 0, "k": [0, 0], "ix": 3 }, "s": { "a": 0, "k": [14.822, 14.822], "ix": 2 } }, { "ty": "fl", "bm": 0, "hd": false, "mn": "ADBE Vector Graphic - Fill", "nm": "Fill 1", "c": { "a": 0, "k": [0.8, 0.8, 0.8], "ix": 4 }, "r": 1, "o": { "a": 0, "k": 100, "ix": 5 } }, { "ty": "tr", "a": { "a": 0, "k": [0, 0], "ix": 1 }, "s": { "a": 1, "k": [{ "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.236, "y": 1 }, "s": [60, 60], "t": 6 }, { "s": [40, 40], "t": 96 }], "ix": 3 }, "sk": { "a": 0, "k": 0, "ix": 4 }, "p": { "a": 0, "k": [-2.905, -64.316], "ix": 2 }, "r": { "a": 0, "k": 357, "ix": 6 }, "sa": { "a": 0, "k": 0, "ix": 5 }, "o": { "a": 0, "k": 100, "ix": 7 } }] }], "ind": 3 }, { "ty": 4, "nm": "3", "sr": 1, "st": 0, "op": 120, "ip": 0, "hd": false, "ddd": 0, "bm": 0, "hasMask": false, "ao": 0, "ks": { "a": { "a": 0, "k": [-2.905, -24.228, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100, 100], "ix": 6 }, "sk": { "a": 0, "k": 0 }, "p": { "a": 0, "k": [50, 50, 0], "ix": 2 }, "r": { "a": 1, "k": [{ "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.223, "y": 1 }, "s": [0], "t": 4 }, { "s": [360], "t": 94 }], "ix": 10 }, "sa": { "a": 0, "k": 0 }, "o": { "a": 0, "k": 100, "ix": 11 } }, "shapes": [{ "ty": "gr", "bm": 0, "hd": false, "mn": "ADBE Vector Group", "nm": "Ellipse 1", "ix": 1, "cix": 2, "np": 3, "it": [{ "ty": "el", "bm": 0, "hd": false, "mn": "ADBE Vector Shape - Ellipse", "nm": "Ellipse Path 1", "d": 1, "p": { "a": 0, "k": [0, 0], "ix": 3 }, "s": { "a": 0, "k": [14.822, 14.822], "ix": 2 } }, { "ty": "fl", "bm": 0, "hd": false, "mn": "ADBE Vector Graphic - Fill", "nm": "Fill 1", "c": { "a": 0, "k": [0.8, 0.8, 0.8], "ix": 4 }, "r": 1, "o": { "a": 0, "k": 100, "ix": 5 } }, { "ty": "tr", "a": { "a": 0, "k": [0, 0], "ix": 1 }, "s": { "a": 1, "k": [{ "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.236, "y": 1 }, "s": [40, 40], "t": 4 }, { "s": [60, 60], "t": 94 }], "ix": 3 }, "sk": { "a": 0, "k": 0, "ix": 4 }, "p": { "a": 0, "k": [-2.905, -64.316], "ix": 2 }, "r": { "a": 0, "k": 357, "ix": 6 }, "sa": { "a": 0, "k": 0, "ix": 5 }, "o": { "a": 0, "k": 100, "ix": 7 } }] }], "ind": 4 }, { "ty": 4, "nm": "2", "sr": 1, "st": 0, "op": 120, "ip": 0, "hd": false, "ddd": 0, "bm": 0, "hasMask": false, "ao": 0, "ks": { "a": { "a": 0, "k": [-2.905, -24.228, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100, 100], "ix": 6 }, "sk": { "a": 0, "k": 0 }, "p": { "a": 0, "k": [50, 50, 0], "ix": 2 }, "r": { "a": 1, "k": [{ "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.223, "y": 1 }, "s": [0], "t": 2 }, { "s": [360], "t": 92 }], "ix": 10 }, "sa": { "a": 0, "k": 0 }, "o": { "a": 0, "k": 100, "ix": 11 } }, "shapes": [{ "ty": "gr", "bm": 0, "hd": false, "mn": "ADBE Vector Group", "nm": "Ellipse 1", "ix": 1, "cix": 2, "np": 3, "it": [{ "ty": "el", "bm": 0, "hd": false, "mn": "ADBE Vector Shape - Ellipse", "nm": "Ellipse Path 1", "d": 1, "p": { "a": 0, "k": [0, 0], "ix": 3 }, "s": { "a": 0, "k": [14.822, 14.822], "ix": 2 } }, { "ty": "fl", "bm": 0, "hd": false, "mn": "ADBE Vector Graphic - Fill", "nm": "Fill 1", "c": { "a": 0, "k": [0.8, 0.8, 0.8], "ix": 4 }, "r": 1, "o": { "a": 0, "k": 100, "ix": 5 } }, { "ty": "tr", "a": { "a": 0, "k": [0, 0], "ix": 1 }, "s": { "a": 1, "k": [{ "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.236, "y": 1 }, "s": [20, 20], "t": 2 }, { "s": [80, 80], "t": 92 }], "ix": 3 }, "sk": { "a": 0, "k": 0, "ix": 4 }, "p": { "a": 0, "k": [-2.905, -64.316], "ix": 2 }, "r": { "a": 0, "k": 357, "ix": 6 }, "sa": { "a": 0, "k": 0, "ix": 5 }, "o": { "a": 0, "k": 100, "ix": 7 } }] }], "ind": 5 }, { "ty": 4, "nm": "1", "sr": 1, "st": 0, "op": 120, "ip": 0, "hd": false, "ddd": 0, "bm": 0, "hasMask": false, "ao": 0, "ks": { "a": { "a": 0, "k": [-2.905, -24.228, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100, 100], "ix": 6 }, "sk": { "a": 0, "k": 0 }, "p": { "a": 0, "k": [50, 50, 0], "ix": 2 }, "r": { "a": 1, "k": [{ "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.223, "y": 1 }, "s": [0], "t": 0 }, { "s": [360], "t": 90 }], "ix": 10 }, "sa": { "a": 0, "k": 0 }, "o": { "a": 0, "k": 100, "ix": 11 } }, "shapes": [{ "ty": "gr", "bm": 0, "hd": false, "mn": "ADBE Vector Group", "nm": "Ellipse 1", "ix": 1, "cix": 2, "np": 3, "it": [{ "ty": "el", "bm": 0, "hd": false, "mn": "ADBE Vector Shape - Ellipse", "nm": "Ellipse Path 1", "d": 1, "p": { "a": 0, "k": [0, 0], "ix": 3 }, "s": { "a": 0, "k": [14.822, 14.822], "ix": 2 } }, { "ty": "fl", "bm": 0, "hd": false, "mn": "ADBE Vector Graphic - Fill", "nm": "Fill 1", "c": { "a": 0, "k": [0.8, 0.8, 0.8], "ix": 4 }, "r": 1, "o": { "a": 0, "k": 100, "ix": 5 } }, { "ty": "tr", "a": { "a": 0, "k": [0, 0], "ix": 1 }, "s": { "a": 1, "k": [{ "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.236, "y": 1 }, "s": [0, 0], "t": 0 }, { "s": [100, 100], "t": 90 }], "ix": 3 }, "sk": { "a": 0, "k": 0, "ix": 4 }, "p": { "a": 0, "k": [-2.905, -64.316], "ix": 2 }, "r": { "a": 0, "k": 357, "ix": 6 }, "sa": { "a": 0, "k": 0, "ix": 5 }, "o": { "a": 0, "k": 100, "ix": 7 } }] }], "ind": 6 }], "v": "5.7.0", "fr": 60, "op": 90, "ip": 0, "assets": [] };
748
757
  const CustomLoader = ({ loading, loadingText = "Loading..." }) => {
749
- const rotateAnim = useRef(new Animated.Value(0)).current;
750
758
  const { theme, mode } = useTheme();
751
759
  const styles = createStyles$3(theme);
752
- useEffect(() => {
753
- if (loading) {
754
- Animated.loop(
755
- Animated.timing(rotateAnim, {
756
- toValue: 1,
757
- duration: 1500,
758
- easing: Easing.linear,
759
- useNativeDriver: true
760
- })
761
- ).start();
762
- } else {
763
- rotateAnim.stopAnimation();
764
- rotateAnim.setValue(0);
765
- }
766
- return () => {
767
- rotateAnim.stopAnimation();
768
- };
769
- }, [loading, rotateAnim]);
770
760
  if (!loading) return null;
771
- const spin = rotateAnim.interpolate({
772
- inputRange: [0, 1],
773
- outputRange: ["0deg", "360deg"]
774
- });
775
- return /* @__PURE__ */ React.createElement(Modal, { transparent: true, visible: loading, animationType: "fade" }, /* @__PURE__ */ React.createElement(View, { style: styles.backdrop }, /* @__PURE__ */ React.createElement(View, { style: styles.box }, /* @__PURE__ */ React.createElement(Animated.View, { style: [styles.loader, { transform: [{ rotate: spin }] }] }, /* @__PURE__ */ React.createElement(Svg, { width: "100", height: "100", viewBox: "0 0 100 100" }, /* @__PURE__ */ React.createElement(Defs, null, /* @__PURE__ */ React.createElement(LinearGradient, { id: "grad", x1: "0%", y1: "0%", x2: "100%", y2: "100%" }, /* @__PURE__ */ React.createElement(Stop, { offset: "0%", stopColor: "#000000", stopOpacity: "2" }), /* @__PURE__ */ React.createElement(
776
- Stop,
777
- {
778
- offset: "40%",
779
- stopColor: mode === "dark" ? "#5A5A5A00" : "#686868",
780
- stopOpacity: "5"
781
- }
782
- ), /* @__PURE__ */ React.createElement(
783
- Stop,
784
- {
785
- offset: "100%",
786
- stopColor: mode === "dark" ? "#FFFFFF" : "#AAAAAA",
787
- stopOpacity: ".9"
788
- }
789
- ))), /* @__PURE__ */ React.createElement(
790
- Circle,
791
- {
792
- cx: "50",
793
- cy: "50",
794
- r: "40",
795
- stroke: "url(#grad)",
796
- strokeWidth: "8",
797
- fill: "none",
798
- strokeDasharray: "250",
799
- strokeLinecap: "round"
800
- }
801
- ))), /* @__PURE__ */ React.createElement(
802
- CustomText$1,
803
- {
804
- text: loadingText,
805
- style: styles.text,
806
- variant: FontStyle.B4_REGULAR,
807
- textColor: "#000000"
808
- }
809
- ))));
761
+ else {
762
+ return /* @__PURE__ */ React.createElement(View, { style: styles.container }, /* @__PURE__ */ React.createElement(View, { style: styles.backdrop }, /* @__PURE__ */ React.createElement(View, { style: styles.box }, /* @__PURE__ */ React.createElement(View, { style: styles.loader }, /* @__PURE__ */ React.createElement(LottieView, { style: styles.loader, source: loaderJson, autoPlay: true, loop: true })), /* @__PURE__ */ React.createElement(
763
+ CustomText$1,
764
+ {
765
+ text: loadingText,
766
+ style: styles.text,
767
+ variant: FontStyle.B4_REGULAR,
768
+ textColor: "#000000"
769
+ }
770
+ ))));
771
+ }
810
772
  };
811
773
  var CustomLoader$1 = withThemeProvider(CustomLoader);
812
774
 
@@ -4381,8 +4343,8 @@ const styles$3 = StyleSheet.create({
4381
4343
  alignItems: "center"
4382
4344
  },
4383
4345
  sliderContainer: {
4384
- height: verticalScale(48),
4385
- borderRadius: moderateScale(25),
4346
+ height: verticalScale$1(48),
4347
+ borderRadius: moderateScale$1(25),
4386
4348
  overflow: "hidden",
4387
4349
  justifyContent: "center"
4388
4350
  },
@@ -4393,11 +4355,11 @@ const styles$3 = StyleSheet.create({
4393
4355
  justifyContent: "center"
4394
4356
  },
4395
4357
  button: {
4396
- height: verticalScale(40),
4358
+ height: verticalScale$1(40),
4397
4359
  justifyContent: "center",
4398
4360
  alignItems: "center",
4399
- borderRadius: moderateScale(20),
4400
- margin: moderateScale(4)
4361
+ borderRadius: moderateScale$1(20),
4362
+ margin: 4
4401
4363
  },
4402
4364
  buttonTextContainer: {
4403
4365
  position: "absolute",
@@ -4406,7 +4368,8 @@ const styles$3 = StyleSheet.create({
4406
4368
  bottom: 0,
4407
4369
  top: 0,
4408
4370
  alignItems: "center",
4409
- justifyContent: "center"
4371
+ justifyContent: "center",
4372
+ borderRadius: 25
4410
4373
  }
4411
4374
  });
4412
4375
 
@@ -4415,30 +4378,25 @@ const CustomSlideButton = React.forwardRef(
4415
4378
  ({
4416
4379
  label,
4417
4380
  onComplete,
4381
+ onReset,
4418
4382
  icon,
4419
4383
  textStyle,
4420
4384
  containerStyle,
4421
4385
  sliderStyle,
4422
4386
  size = BUTTON_WIDTH,
4423
- slideButtonTail,
4424
- slideButtonTailColor = "#fff"
4387
+ sliderBackgroundColor = "#fff",
4388
+ sliderTextColor = "#000",
4389
+ resetTimer = 2e3
4425
4390
  }, ref) => {
4426
4391
  const value = useRef(0);
4427
4392
  const cardRef = useRef(null);
4428
4393
  const [translateX] = useState(new Animated.Value(0));
4429
- const slideTailCardRef = useRef(null);
4430
- slideTailCardRef?.current?.setNativeProps({
4431
- style: { width: 0 }
4432
- });
4394
+ const sliderConteinerRef = useRef(null);
4395
+ const [color, setColor] = useState(new Animated.Value(0));
4396
+ const [sliderBackgroundColorRef, setSliderBackgroundColorRef] = useState(new Animated.Value(0));
4433
4397
  React.useImperativeHandle(ref, () => ({
4434
4398
  reset() {
4435
- Animated.spring(translateX, {
4436
- toValue: 0,
4437
- useNativeDriver: false
4438
- }).start();
4439
- slideTailCardRef?.current?.setNativeProps({
4440
- style: { width: 0 }
4441
- });
4399
+ resetAll();
4442
4400
  }
4443
4401
  }));
4444
4402
  const handleLayout = (event) => {
@@ -4449,68 +4407,102 @@ const CustomSlideButton = React.forwardRef(
4449
4407
  // Change the width here
4450
4408
  });
4451
4409
  value.current = width;
4410
+ sliderConteinerRef?.current?.setNativeProps({
4411
+ style: { width }
4412
+ });
4452
4413
  }
4453
4414
  };
4415
+ const resetAll = () => {
4416
+ Animated.timing(translateX, {
4417
+ toValue: 0,
4418
+ useNativeDriver: false
4419
+ }).start();
4420
+ Animated.timing(sliderBackgroundColorRef, {
4421
+ toValue: 0,
4422
+ duration: 0,
4423
+ // no transition time, immediate change
4424
+ useNativeDriver: false
4425
+ // because we're animating the color, not layout
4426
+ }).start();
4427
+ Animated.timing(color, {
4428
+ toValue: 0,
4429
+ delay: 300,
4430
+ // no transition time, immediate change
4431
+ useNativeDriver: false
4432
+ // because we're animating the color, not layout
4433
+ }).start();
4434
+ onReset?.();
4435
+ };
4454
4436
  const panResponder = PanResponder.create({
4455
4437
  onMoveShouldSetPanResponder: (e, gestureState) => {
4456
4438
  return gestureState.dx !== 0;
4457
4439
  },
4458
4440
  onPanResponderMove: (evt, gestureState) => {
4459
- if (gestureState.dx > 0) {
4441
+ if (gestureState.dx > 0 && gestureState.dx <= value?.current - BUTTON_WIDTH - 8) {
4460
4442
  translateX.setValue(gestureState.dx);
4461
- slideTailCardRef?.current?.setNativeProps({
4462
- style: { width: gestureState.dx + BUTTON_WIDTH / 2 }
4463
- });
4443
+ let colorValue = gestureState.dx > value.current / 3 ? 1 : 0;
4444
+ Animated.timing(color, {
4445
+ toValue: colorValue,
4446
+ duration: 0,
4447
+ // no transition time, immediate change
4448
+ useNativeDriver: false
4449
+ // because we're animating the color, not layout
4450
+ }).start();
4464
4451
  }
4465
4452
  },
4466
4453
  onPanResponderRelease: (e, gestureState) => {
4467
- if (gestureState.dx >= value.current * 0.7) {
4454
+ if (gestureState.dx >= value.current * 0.8) {
4468
4455
  Animated.timing(translateX, {
4469
- toValue: value.current - BUTTON_WIDTH - 12,
4456
+ toValue: value?.current - (BUTTON_WIDTH + 8),
4470
4457
  // Slide to the end
4471
4458
  duration: 300,
4472
4459
  useNativeDriver: false
4473
- }).start(() => {
4474
- onComplete?.();
4475
- });
4476
- slideTailCardRef?.current?.setNativeProps({
4477
- style: { width: value.current + BUTTON_WIDTH }
4478
- // Change the width here
4479
- });
4480
- } else {
4481
- Animated.spring(translateX, {
4482
- toValue: 0,
4460
+ }).start();
4461
+ Animated.timing(sliderBackgroundColorRef, {
4462
+ toValue: 1,
4463
+ duration: 0,
4464
+ // no transition time, immediate change
4483
4465
  useNativeDriver: false
4466
+ // because we're animating the color, not layout
4484
4467
  }).start();
4485
- slideTailCardRef?.current?.setNativeProps({
4486
- style: { width: 0 }
4487
- });
4468
+ onComplete?.();
4469
+ setTimeout(() => {
4470
+ resetAll();
4471
+ }, resetTimer);
4472
+ } else {
4473
+ resetAll();
4488
4474
  }
4489
4475
  }
4490
4476
  });
4477
+ const textColor = color.interpolate({
4478
+ inputRange: [0, 1],
4479
+ outputRange: [sliderTextColor, "transparent"]
4480
+ });
4481
+ const backgroundColor = sliderBackgroundColorRef.interpolate({
4482
+ inputRange: [0, 1],
4483
+ outputRange: [sliderBackgroundColor, "transparent"]
4484
+ });
4491
4485
  const { theme } = useTheme();
4492
4486
  return /* @__PURE__ */ React.createElement(View, { style: {
4493
4487
  ...styles$3.sliderContainer,
4494
4488
  backgroundColor: theme.SURFACE_INVERTED,
4495
4489
  ...containerStyle
4496
- }, onLayout: handleLayout, ref: cardRef }, slideButtonTail && /* @__PURE__ */ React.createElement(
4490
+ }, onLayout: handleLayout, ref: cardRef }, /* @__PURE__ */ React.createElement(
4497
4491
  Animated.View,
4498
4492
  {
4499
- ref: slideTailCardRef,
4500
- style: [{ height: "100%", width: 0, backgroundColor: slideButtonTailColor }]
4493
+ style: [styles$3.buttonTextContainer, { backgroundColor, transform: [{ translateX }] }],
4494
+ ref: sliderConteinerRef
4501
4495
  }
4502
- ), /* @__PURE__ */ React.createElement(View, { style: styles$3.buttonTextContainer }, /* @__PURE__ */ React.createElement(
4503
- CustomTypography,
4496
+ ), /* @__PURE__ */ React.createElement(
4497
+ View,
4504
4498
  {
4505
- text: label,
4506
- variant: FontStyle.L1_REGULAR,
4507
- style: {
4508
- color: theme.CONTENT_INVERTED,
4509
- alignSelf: "center",
4510
- ...textStyle
4511
- }
4512
- }
4513
- )), /* @__PURE__ */ React.createElement(
4499
+ style: styles$3.buttonTextContainer
4500
+ },
4501
+ /* @__PURE__ */ React.createElement(Animated.Text, { style: [{
4502
+ alignSelf: "center",
4503
+ ...textStyle
4504
+ }, { color: textColor }] }, label)
4505
+ ), /* @__PURE__ */ React.createElement(
4514
4506
  Animated.View,
4515
4507
  {
4516
4508
  style: [styles$3.slider, { transform: [{ translateX }] }],