dhre-ui-kit 0.0.246 → 0.0.248
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.d.ts +4 -2
- package/lib/index.js +113 -119
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +114 -120
- package/lib/index.mjs.map +1 -1
- package/package.json +2 -1
package/lib/index.d.ts
CHANGED
|
@@ -743,13 +743,15 @@ declare const _default$3: (props: IProps) => React$1.JSX.Element;
|
|
|
743
743
|
interface CustomSlideButtonProps {
|
|
744
744
|
label?: string;
|
|
745
745
|
onComplete?: () => void;
|
|
746
|
+
onReset?: () => void;
|
|
746
747
|
icon: React$1.ReactElement;
|
|
747
748
|
size?: number;
|
|
748
749
|
textStyle?: TextStyle;
|
|
749
750
|
containerStyle?: ViewStyle;
|
|
750
751
|
sliderStyle?: ViewStyle;
|
|
751
|
-
|
|
752
|
-
|
|
752
|
+
sliderBackgroundColor?: string;
|
|
753
|
+
sliderTextColor?: string;
|
|
754
|
+
resetTimer?: number;
|
|
753
755
|
}
|
|
754
756
|
type SlideButtonHandle = {
|
|
755
757
|
reset?: () => void;
|
package/lib/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var reactRedux = require('react-redux');
|
|
|
7
7
|
var reactNative = require('react-native');
|
|
8
8
|
var reactNativeGestureHandler = require('react-native-gesture-handler');
|
|
9
9
|
var blur = require('@react-native-community/blur');
|
|
10
|
-
var
|
|
10
|
+
var LottieView = require('lottie-react-native');
|
|
11
11
|
var Tooltip = require('react-native-walkthrough-tooltip');
|
|
12
12
|
var Pdf = require('react-native-pdf');
|
|
13
13
|
var Progress = require('react-native-progress');
|
|
@@ -19,6 +19,7 @@ var reactNativeElementDropdown = require('react-native-element-dropdown');
|
|
|
19
19
|
var DocumentPicker = require('react-native-document-picker');
|
|
20
20
|
var RNFS = require('react-native-fs');
|
|
21
21
|
var OTPVerify = require('react-native-otp-verify');
|
|
22
|
+
var stylehelper = require('src/utils/stylehelper');
|
|
22
23
|
var Clipboard = require('@react-native-clipboard/clipboard');
|
|
23
24
|
|
|
24
25
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -42,7 +43,7 @@ function _interopNamespace(e) {
|
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
45
|
-
var
|
|
46
|
+
var LottieView__default = /*#__PURE__*/_interopDefaultLegacy(LottieView);
|
|
46
47
|
var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
|
|
47
48
|
var Pdf__default = /*#__PURE__*/_interopDefaultLegacy(Pdf);
|
|
48
49
|
var Progress__namespace = /*#__PURE__*/_interopNamespace(Progress);
|
|
@@ -746,6 +747,13 @@ const BottomDrawer = ({
|
|
|
746
747
|
|
|
747
748
|
const createStyles$3 = (theme) => {
|
|
748
749
|
return reactNative.StyleSheet.create({
|
|
750
|
+
container: {
|
|
751
|
+
position: "absolute",
|
|
752
|
+
left: 0,
|
|
753
|
+
right: 0,
|
|
754
|
+
bottom: 0,
|
|
755
|
+
top: 0
|
|
756
|
+
},
|
|
749
757
|
backdrop: {
|
|
750
758
|
flex: 1,
|
|
751
759
|
justifyContent: "center",
|
|
@@ -782,67 +790,20 @@ const createStyles$3 = (theme) => {
|
|
|
782
790
|
};
|
|
783
791
|
|
|
784
792
|
const CustomLoader = ({ loading, loadingText = "Loading..." }) => {
|
|
785
|
-
const rotateAnim = React.useRef(new reactNative.Animated.Value(0)).current;
|
|
786
793
|
const { theme, mode } = useTheme();
|
|
787
794
|
const styles = createStyles$3(theme);
|
|
788
|
-
React.useEffect(() => {
|
|
789
|
-
if (loading) {
|
|
790
|
-
reactNative.Animated.loop(
|
|
791
|
-
reactNative.Animated.timing(rotateAnim, {
|
|
792
|
-
toValue: 1,
|
|
793
|
-
duration: 1500,
|
|
794
|
-
easing: reactNative.Easing.linear,
|
|
795
|
-
useNativeDriver: true
|
|
796
|
-
})
|
|
797
|
-
).start();
|
|
798
|
-
} else {
|
|
799
|
-
rotateAnim.stopAnimation();
|
|
800
|
-
rotateAnim.setValue(0);
|
|
801
|
-
}
|
|
802
|
-
return () => {
|
|
803
|
-
rotateAnim.stopAnimation();
|
|
804
|
-
};
|
|
805
|
-
}, [loading, rotateAnim]);
|
|
806
795
|
if (!loading) return null;
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
), /* @__PURE__ */ React__default["default"].createElement(
|
|
819
|
-
Svg.Stop,
|
|
820
|
-
{
|
|
821
|
-
offset: "100%",
|
|
822
|
-
stopColor: mode === "dark" ? "#FFFFFF" : "#AAAAAA",
|
|
823
|
-
stopOpacity: ".9"
|
|
824
|
-
}
|
|
825
|
-
))), /* @__PURE__ */ React__default["default"].createElement(
|
|
826
|
-
Svg.Circle,
|
|
827
|
-
{
|
|
828
|
-
cx: "50",
|
|
829
|
-
cy: "50",
|
|
830
|
-
r: "40",
|
|
831
|
-
stroke: "url(#grad)",
|
|
832
|
-
strokeWidth: "8",
|
|
833
|
-
fill: "none",
|
|
834
|
-
strokeDasharray: "250",
|
|
835
|
-
strokeLinecap: "round"
|
|
836
|
-
}
|
|
837
|
-
))), /* @__PURE__ */ React__default["default"].createElement(
|
|
838
|
-
CustomText$1,
|
|
839
|
-
{
|
|
840
|
-
text: loadingText,
|
|
841
|
-
style: styles.text,
|
|
842
|
-
variant: FontStyle.B4_REGULAR,
|
|
843
|
-
textColor: "#000000"
|
|
844
|
-
}
|
|
845
|
-
))));
|
|
796
|
+
else {
|
|
797
|
+
return /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles.container }, /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles.backdrop }, /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles.box }, /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles.loader }, /* @__PURE__ */ React__default["default"].createElement(LottieView__default["default"], { style: styles.loader, source: require("../../assets/json/Loading.json"), autoPlay: true, loop: true })), /* @__PURE__ */ React__default["default"].createElement(
|
|
798
|
+
CustomText$1,
|
|
799
|
+
{
|
|
800
|
+
text: loadingText,
|
|
801
|
+
style: styles.text,
|
|
802
|
+
variant: FontStyle.B4_REGULAR,
|
|
803
|
+
textColor: "#000000"
|
|
804
|
+
}
|
|
805
|
+
))));
|
|
806
|
+
}
|
|
846
807
|
};
|
|
847
808
|
var CustomLoader$1 = withThemeProvider(CustomLoader);
|
|
848
809
|
|
|
@@ -4010,15 +3971,18 @@ const styles$5 = reactNative.StyleSheet.create({
|
|
|
4010
3971
|
textDecorationLine: "underline"
|
|
4011
3972
|
},
|
|
4012
3973
|
resendOTPStyle: {
|
|
4013
|
-
alignSelf: "flex-end"
|
|
4014
|
-
marginTop: verticalScale(8)
|
|
3974
|
+
alignSelf: "flex-end"
|
|
4015
3975
|
},
|
|
4016
3976
|
timerContainer: {
|
|
4017
3977
|
flexDirection: "row",
|
|
4018
3978
|
justifyContent: "space-between",
|
|
4019
3979
|
marginTop: verticalScale(8)
|
|
4020
3980
|
},
|
|
4021
|
-
timerIconContainer: {
|
|
3981
|
+
timerIconContainer: {
|
|
3982
|
+
flexDirection: "row",
|
|
3983
|
+
gap: horizontalScale(8),
|
|
3984
|
+
alignItems: "center"
|
|
3985
|
+
}
|
|
4022
3986
|
});
|
|
4023
3987
|
|
|
4024
3988
|
const OTPInput = React__default["default"].forwardRef(
|
|
@@ -4194,12 +4158,12 @@ const OTPInput = React__default["default"].forwardRef(
|
|
|
4194
4158
|
autoComplete: "sms-otp",
|
|
4195
4159
|
selectionColor: theme$1.CONTENT_PRIMARY
|
|
4196
4160
|
}
|
|
4197
|
-
))), !errorMessageMaxReachCount && /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$5.timerContainer },
|
|
4161
|
+
))), !errorMessageMaxReachCount && /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$5.timerContainer }, (disableResendButton() || !isResendOtpEnable) && /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$5.timerIconContainer }, timerIcon, /* @__PURE__ */ React__default["default"].createElement(
|
|
4198
4162
|
CustomTypography,
|
|
4199
4163
|
{
|
|
4200
|
-
text:
|
|
4201
|
-
variant: FontStyle.
|
|
4202
|
-
style: { color: theme$1.
|
|
4164
|
+
text: `00:${timeLeft} secs`,
|
|
4165
|
+
variant: FontStyle.L1_REGULAR,
|
|
4166
|
+
style: { color: theme$1.INFO }
|
|
4203
4167
|
}
|
|
4204
4168
|
)), /* @__PURE__ */ React__default["default"].createElement(
|
|
4205
4169
|
reactNative.Pressable,
|
|
@@ -4414,8 +4378,8 @@ const styles$3 = reactNative.StyleSheet.create({
|
|
|
4414
4378
|
alignItems: "center"
|
|
4415
4379
|
},
|
|
4416
4380
|
sliderContainer: {
|
|
4417
|
-
height: verticalScale(48),
|
|
4418
|
-
borderRadius: moderateScale(25),
|
|
4381
|
+
height: stylehelper.verticalScale(48),
|
|
4382
|
+
borderRadius: stylehelper.moderateScale(25),
|
|
4419
4383
|
overflow: "hidden",
|
|
4420
4384
|
justifyContent: "center"
|
|
4421
4385
|
},
|
|
@@ -4426,11 +4390,11 @@ const styles$3 = reactNative.StyleSheet.create({
|
|
|
4426
4390
|
justifyContent: "center"
|
|
4427
4391
|
},
|
|
4428
4392
|
button: {
|
|
4429
|
-
height: verticalScale(40),
|
|
4393
|
+
height: stylehelper.verticalScale(40),
|
|
4430
4394
|
justifyContent: "center",
|
|
4431
4395
|
alignItems: "center",
|
|
4432
|
-
borderRadius: moderateScale(20),
|
|
4433
|
-
margin:
|
|
4396
|
+
borderRadius: stylehelper.moderateScale(20),
|
|
4397
|
+
margin: 4
|
|
4434
4398
|
},
|
|
4435
4399
|
buttonTextContainer: {
|
|
4436
4400
|
position: "absolute",
|
|
@@ -4439,7 +4403,8 @@ const styles$3 = reactNative.StyleSheet.create({
|
|
|
4439
4403
|
bottom: 0,
|
|
4440
4404
|
top: 0,
|
|
4441
4405
|
alignItems: "center",
|
|
4442
|
-
justifyContent: "center"
|
|
4406
|
+
justifyContent: "center",
|
|
4407
|
+
borderRadius: 25
|
|
4443
4408
|
}
|
|
4444
4409
|
});
|
|
4445
4410
|
|
|
@@ -4448,30 +4413,25 @@ const CustomSlideButton = React__default["default"].forwardRef(
|
|
|
4448
4413
|
({
|
|
4449
4414
|
label,
|
|
4450
4415
|
onComplete,
|
|
4416
|
+
onReset,
|
|
4451
4417
|
icon,
|
|
4452
4418
|
textStyle,
|
|
4453
4419
|
containerStyle,
|
|
4454
4420
|
sliderStyle,
|
|
4455
4421
|
size = BUTTON_WIDTH,
|
|
4456
|
-
|
|
4457
|
-
|
|
4422
|
+
sliderBackgroundColor = "#fff",
|
|
4423
|
+
sliderTextColor = "#000",
|
|
4424
|
+
resetTimer = 2e3
|
|
4458
4425
|
}, ref) => {
|
|
4459
4426
|
const value = React.useRef(0);
|
|
4460
4427
|
const cardRef = React.useRef(null);
|
|
4461
4428
|
const [translateX] = React.useState(new reactNative.Animated.Value(0));
|
|
4462
|
-
const
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
});
|
|
4429
|
+
const sliderConteinerRef = React.useRef(null);
|
|
4430
|
+
const [color, setColor] = React.useState(new reactNative.Animated.Value(0));
|
|
4431
|
+
const [sliderBackgroundColorRef, setSliderBackgroundColorRef] = React.useState(new reactNative.Animated.Value(0));
|
|
4466
4432
|
React__default["default"].useImperativeHandle(ref, () => ({
|
|
4467
4433
|
reset() {
|
|
4468
|
-
|
|
4469
|
-
toValue: 0,
|
|
4470
|
-
useNativeDriver: false
|
|
4471
|
-
}).start();
|
|
4472
|
-
slideTailCardRef?.current?.setNativeProps({
|
|
4473
|
-
style: { width: 0 }
|
|
4474
|
-
});
|
|
4434
|
+
resetAll();
|
|
4475
4435
|
}
|
|
4476
4436
|
}));
|
|
4477
4437
|
const handleLayout = (event) => {
|
|
@@ -4482,68 +4442,102 @@ const CustomSlideButton = React__default["default"].forwardRef(
|
|
|
4482
4442
|
// Change the width here
|
|
4483
4443
|
});
|
|
4484
4444
|
value.current = width;
|
|
4445
|
+
sliderConteinerRef?.current?.setNativeProps({
|
|
4446
|
+
style: { width }
|
|
4447
|
+
});
|
|
4485
4448
|
}
|
|
4486
4449
|
};
|
|
4450
|
+
const resetAll = () => {
|
|
4451
|
+
reactNative.Animated.timing(translateX, {
|
|
4452
|
+
toValue: 0,
|
|
4453
|
+
useNativeDriver: false
|
|
4454
|
+
}).start();
|
|
4455
|
+
reactNative.Animated.timing(sliderBackgroundColorRef, {
|
|
4456
|
+
toValue: 0,
|
|
4457
|
+
duration: 0,
|
|
4458
|
+
// no transition time, immediate change
|
|
4459
|
+
useNativeDriver: false
|
|
4460
|
+
// because we're animating the color, not layout
|
|
4461
|
+
}).start();
|
|
4462
|
+
reactNative.Animated.timing(color, {
|
|
4463
|
+
toValue: 0,
|
|
4464
|
+
delay: 300,
|
|
4465
|
+
// no transition time, immediate change
|
|
4466
|
+
useNativeDriver: false
|
|
4467
|
+
// because we're animating the color, not layout
|
|
4468
|
+
}).start();
|
|
4469
|
+
onReset?.();
|
|
4470
|
+
};
|
|
4487
4471
|
const panResponder = reactNative.PanResponder.create({
|
|
4488
4472
|
onMoveShouldSetPanResponder: (e, gestureState) => {
|
|
4489
4473
|
return gestureState.dx !== 0;
|
|
4490
4474
|
},
|
|
4491
4475
|
onPanResponderMove: (evt, gestureState) => {
|
|
4492
|
-
if (gestureState.dx > 0) {
|
|
4476
|
+
if (gestureState.dx > 0 && gestureState.dx <= value?.current - BUTTON_WIDTH - 8) {
|
|
4493
4477
|
translateX.setValue(gestureState.dx);
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4478
|
+
let colorValue = gestureState.dx > value.current / 3 ? 1 : 0;
|
|
4479
|
+
reactNative.Animated.timing(color, {
|
|
4480
|
+
toValue: colorValue,
|
|
4481
|
+
duration: 0,
|
|
4482
|
+
// no transition time, immediate change
|
|
4483
|
+
useNativeDriver: false
|
|
4484
|
+
// because we're animating the color, not layout
|
|
4485
|
+
}).start();
|
|
4497
4486
|
}
|
|
4498
4487
|
},
|
|
4499
4488
|
onPanResponderRelease: (e, gestureState) => {
|
|
4500
|
-
if (gestureState.dx >= value.current * 0.
|
|
4489
|
+
if (gestureState.dx >= value.current * 0.8) {
|
|
4501
4490
|
reactNative.Animated.timing(translateX, {
|
|
4502
|
-
toValue: value
|
|
4491
|
+
toValue: value?.current - (BUTTON_WIDTH + 8),
|
|
4503
4492
|
// Slide to the end
|
|
4504
4493
|
duration: 300,
|
|
4505
4494
|
useNativeDriver: false
|
|
4506
|
-
}).start(
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
// Change the width here
|
|
4512
|
-
});
|
|
4513
|
-
} else {
|
|
4514
|
-
reactNative.Animated.spring(translateX, {
|
|
4515
|
-
toValue: 0,
|
|
4495
|
+
}).start();
|
|
4496
|
+
reactNative.Animated.timing(sliderBackgroundColorRef, {
|
|
4497
|
+
toValue: 1,
|
|
4498
|
+
duration: 0,
|
|
4499
|
+
// no transition time, immediate change
|
|
4516
4500
|
useNativeDriver: false
|
|
4501
|
+
// because we're animating the color, not layout
|
|
4517
4502
|
}).start();
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4503
|
+
onComplete?.();
|
|
4504
|
+
setTimeout(() => {
|
|
4505
|
+
resetAll();
|
|
4506
|
+
}, resetTimer);
|
|
4507
|
+
} else {
|
|
4508
|
+
resetAll();
|
|
4521
4509
|
}
|
|
4522
4510
|
}
|
|
4523
4511
|
});
|
|
4512
|
+
const textColor = color.interpolate({
|
|
4513
|
+
inputRange: [0, 1],
|
|
4514
|
+
outputRange: [sliderTextColor, "transparent"]
|
|
4515
|
+
});
|
|
4516
|
+
const backgroundColor = sliderBackgroundColorRef.interpolate({
|
|
4517
|
+
inputRange: [0, 1],
|
|
4518
|
+
outputRange: [sliderBackgroundColor, "transparent"]
|
|
4519
|
+
});
|
|
4524
4520
|
const { theme } = useTheme();
|
|
4525
4521
|
return /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: {
|
|
4526
4522
|
...styles$3.sliderContainer,
|
|
4527
4523
|
backgroundColor: theme.SURFACE_INVERTED,
|
|
4528
4524
|
...containerStyle
|
|
4529
|
-
}, onLayout: handleLayout, ref: cardRef },
|
|
4525
|
+
}, onLayout: handleLayout, ref: cardRef }, /* @__PURE__ */ React__default["default"].createElement(
|
|
4530
4526
|
reactNative.Animated.View,
|
|
4531
4527
|
{
|
|
4532
|
-
|
|
4533
|
-
|
|
4528
|
+
style: [styles$3.buttonTextContainer, { backgroundColor, transform: [{ translateX }] }],
|
|
4529
|
+
ref: sliderConteinerRef
|
|
4534
4530
|
}
|
|
4535
|
-
), /* @__PURE__ */ React__default["default"].createElement(
|
|
4536
|
-
|
|
4531
|
+
), /* @__PURE__ */ React__default["default"].createElement(
|
|
4532
|
+
reactNative.View,
|
|
4537
4533
|
{
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
}
|
|
4546
|
-
)), /* @__PURE__ */ React__default["default"].createElement(
|
|
4534
|
+
style: styles$3.buttonTextContainer
|
|
4535
|
+
},
|
|
4536
|
+
/* @__PURE__ */ React__default["default"].createElement(reactNative.Animated.Text, { style: [{
|
|
4537
|
+
alignSelf: "center",
|
|
4538
|
+
...textStyle
|
|
4539
|
+
}, { color: textColor }] }, label)
|
|
4540
|
+
), /* @__PURE__ */ React__default["default"].createElement(
|
|
4547
4541
|
reactNative.Animated.View,
|
|
4548
4542
|
{
|
|
4549
4543
|
style: [styles$3.slider, { transform: [{ translateX }] }],
|