dhre-ui-kit 0.0.121 → 0.0.123
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/{dist → lib}/index.d.ts +5 -1
- package/{dist → lib}/index.js +55 -43
- package/lib/index.js.map +1 -0
- package/{dist → lib}/index.mjs +55 -43
- package/lib/index.mjs.map +1 -0
- package/package.json +7 -7
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
package/{dist → lib}/index.mjs
RENAMED
|
@@ -263,10 +263,10 @@ const withThemeProvider = (Component) => {
|
|
|
263
263
|
return (props) => /* @__PURE__ */ React.createElement(ThemeProvider, null, /* @__PURE__ */ React.createElement(Component, { ...props }));
|
|
264
264
|
};
|
|
265
265
|
|
|
266
|
-
const { width
|
|
266
|
+
const { width, height } = Dimensions.get("window");
|
|
267
267
|
const guidelineBaseWidth = 375;
|
|
268
268
|
const guidelineBaseHeight = 812;
|
|
269
|
-
const horizontalScale = (size) => width
|
|
269
|
+
const horizontalScale = (size) => width / guidelineBaseWidth * size;
|
|
270
270
|
const verticalScale = (size) => height / guidelineBaseHeight * size;
|
|
271
271
|
const moderateScale = (size, factor = 0.5) => size + (horizontalScale(size) - size) * factor;
|
|
272
272
|
|
|
@@ -721,7 +721,7 @@ const CustomButton = ({
|
|
|
721
721
|
/* @__PURE__ */ React.createElement(
|
|
722
722
|
CustomText$1,
|
|
723
723
|
{
|
|
724
|
-
text:
|
|
724
|
+
text: title,
|
|
725
725
|
variant: titleVariant,
|
|
726
726
|
style: [
|
|
727
727
|
textStyle,
|
|
@@ -1946,7 +1946,7 @@ const styles$m = StyleSheet.create({
|
|
|
1946
1946
|
position: "absolute",
|
|
1947
1947
|
alignSelf: "center",
|
|
1948
1948
|
height: verticalScale(72),
|
|
1949
|
-
width: width
|
|
1949
|
+
width: width - horizontalScale(32),
|
|
1950
1950
|
top: 56,
|
|
1951
1951
|
borderRadius: moderateScale(8),
|
|
1952
1952
|
overflow: "hidden"
|
|
@@ -2056,7 +2056,7 @@ const Toast = React.forwardRef(({ sucessIcon, errorIcon }, ref) => {
|
|
|
2056
2056
|
Progress.Bar,
|
|
2057
2057
|
{
|
|
2058
2058
|
progress,
|
|
2059
|
-
width: width
|
|
2059
|
+
width: width - horizontalScale(48),
|
|
2060
2060
|
height: 3,
|
|
2061
2061
|
color: isSuccess ? "#024324" : "#851D41",
|
|
2062
2062
|
borderColor: "transparent"
|
|
@@ -3680,7 +3680,11 @@ const OTPInput = React.forwardRef(
|
|
|
3680
3680
|
resendOTP,
|
|
3681
3681
|
errorMessage,
|
|
3682
3682
|
testId = "",
|
|
3683
|
-
otpContainerStyle
|
|
3683
|
+
otpContainerStyle,
|
|
3684
|
+
otpHeaderTextStyle,
|
|
3685
|
+
textInputStyle,
|
|
3686
|
+
resendTextStyle,
|
|
3687
|
+
resendOtpColor
|
|
3684
3688
|
}, ref) => {
|
|
3685
3689
|
const [otp, setOTP] = useState("");
|
|
3686
3690
|
const [isResendOtpEnable, setIsResendOtpEnable] = useState(false);
|
|
@@ -3695,6 +3699,7 @@ const OTPInput = React.forwardRef(
|
|
|
3695
3699
|
setIsResendOtpEnable(false);
|
|
3696
3700
|
enableResendOtp();
|
|
3697
3701
|
resendOTP?.();
|
|
3702
|
+
setOTP("");
|
|
3698
3703
|
};
|
|
3699
3704
|
const enableResendOtp = () => {
|
|
3700
3705
|
setTimeout(() => {
|
|
@@ -3732,14 +3737,15 @@ const OTPInput = React.forwardRef(
|
|
|
3732
3737
|
onComplete?.(otp);
|
|
3733
3738
|
}
|
|
3734
3739
|
}, [otp]);
|
|
3735
|
-
return /* @__PURE__ */ React.createElement(View, { style: { ...otpContainerStyle },
|
|
3740
|
+
return /* @__PURE__ */ React.createElement(View, { style: { ...otpContainerStyle }, "data-testid": testId }, /* @__PURE__ */ React.createElement(
|
|
3736
3741
|
CustomTypography,
|
|
3737
3742
|
{
|
|
3738
3743
|
text: "OTP",
|
|
3739
3744
|
variant: FontStyle.B4_REGULAR,
|
|
3740
3745
|
style: {
|
|
3741
3746
|
color: otp?.length ? theme.CONTENT_PRIMARY : theme.CONTENT_SECONDRY,
|
|
3742
|
-
textAlign: "left"
|
|
3747
|
+
textAlign: "left",
|
|
3748
|
+
...otpHeaderTextStyle
|
|
3743
3749
|
}
|
|
3744
3750
|
}
|
|
3745
3751
|
), /* @__PURE__ */ React.createElement(View, { style: { ...styles$2.textInputContainer } }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React.createElement(
|
|
@@ -3749,7 +3755,8 @@ const OTPInput = React.forwardRef(
|
|
|
3749
3755
|
style: {
|
|
3750
3756
|
...styles$2.textInputStyle,
|
|
3751
3757
|
color: theme.CONTENT_PRIMARY,
|
|
3752
|
-
borderColor: errorMessage ? theme.ERROR : otp.length === length ? theme.SUCCESS : activeInput === index ? theme.BORDER_INVERTED : theme.BORDER_PRIMARY
|
|
3758
|
+
borderColor: errorMessage ? theme.ERROR : otp.length === length ? theme.SUCCESS : activeInput === index ? theme.BORDER_INVERTED : theme.BORDER_PRIMARY,
|
|
3759
|
+
...textInputStyle
|
|
3753
3760
|
},
|
|
3754
3761
|
onFocus: () => setActiveInput(index),
|
|
3755
3762
|
onBlur: () => setActiveInput(null),
|
|
@@ -3778,7 +3785,8 @@ const OTPInput = React.forwardRef(
|
|
|
3778
3785
|
variant: FontStyle.L2_REGULAR,
|
|
3779
3786
|
style: {
|
|
3780
3787
|
textDecorationLine: "underline",
|
|
3781
|
-
color: isResendOtpEnable ? theme.CONTENT_PRIMARY : theme.CONTENT_DISABLE
|
|
3788
|
+
color: isResendOtpEnable ? resendOtpColor ?? theme.CONTENT_PRIMARY : theme.CONTENT_DISABLE,
|
|
3789
|
+
...resendTextStyle
|
|
3782
3790
|
}
|
|
3783
3791
|
}
|
|
3784
3792
|
))));
|
|
@@ -3983,14 +3991,25 @@ const styles = StyleSheet.create({
|
|
|
3983
3991
|
}
|
|
3984
3992
|
});
|
|
3985
3993
|
|
|
3986
|
-
const { width } = Dimensions.get("window");
|
|
3987
3994
|
const BUTTON_WIDTH = 40;
|
|
3988
3995
|
const CustomSlideButton = ({
|
|
3989
3996
|
label,
|
|
3990
3997
|
onComplete,
|
|
3991
3998
|
icon
|
|
3992
3999
|
}) => {
|
|
4000
|
+
const value = useRef(0);
|
|
4001
|
+
const cardRef = useRef(null);
|
|
3993
4002
|
const pan = useRef(new Animated.Value(0)).current;
|
|
4003
|
+
const handleLayout = (event) => {
|
|
4004
|
+
const { width } = event.nativeEvent.layout;
|
|
4005
|
+
if (cardRef.current) {
|
|
4006
|
+
cardRef.current.setNativeProps({
|
|
4007
|
+
style: { width }
|
|
4008
|
+
// Change the width here
|
|
4009
|
+
});
|
|
4010
|
+
value.current = width;
|
|
4011
|
+
}
|
|
4012
|
+
};
|
|
3994
4013
|
const panResponder = useRef(
|
|
3995
4014
|
PanResponder.create({
|
|
3996
4015
|
onMoveShouldSetPanResponder: (evt, gestureState) => {
|
|
@@ -3999,15 +4018,15 @@ const CustomSlideButton = ({
|
|
|
3999
4018
|
onPanResponderGrant: () => {
|
|
4000
4019
|
},
|
|
4001
4020
|
onPanResponderMove: (evt, gestureState) => {
|
|
4002
|
-
if (gestureState.dx <
|
|
4021
|
+
if (gestureState.dx < value.current - BUTTON_WIDTH) {
|
|
4003
4022
|
pan.setValue(gestureState.dx);
|
|
4004
4023
|
}
|
|
4005
4024
|
},
|
|
4006
4025
|
onPanResponderRelease: (evt, gestureState) => {
|
|
4007
|
-
if (gestureState.dx >
|
|
4026
|
+
if (gestureState.dx > value.current - BUTTON_WIDTH - 100) {
|
|
4008
4027
|
onComplete && onComplete();
|
|
4009
4028
|
Animated.spring(pan, {
|
|
4010
|
-
toValue:
|
|
4029
|
+
toValue: value.current - BUTTON_WIDTH - 10,
|
|
4011
4030
|
useNativeDriver: false
|
|
4012
4031
|
}).start();
|
|
4013
4032
|
} else {
|
|
@@ -4020,43 +4039,36 @@ const CustomSlideButton = ({
|
|
|
4020
4039
|
})
|
|
4021
4040
|
).current;
|
|
4022
4041
|
const { theme } = useTheme();
|
|
4023
|
-
return /* @__PURE__ */ React.createElement(
|
|
4024
|
-
|
|
4042
|
+
return /* @__PURE__ */ React.createElement(View, { style: {
|
|
4043
|
+
...styles.sliderContainer,
|
|
4044
|
+
backgroundColor: theme.SURFACE_INVERTED
|
|
4045
|
+
}, onLayout: handleLayout, ref: cardRef }, /* @__PURE__ */ React.createElement(View, { style: styles.buttonTextCOntainer }, /* @__PURE__ */ React.createElement(
|
|
4046
|
+
CustomTypography,
|
|
4025
4047
|
{
|
|
4048
|
+
text: label,
|
|
4049
|
+
variant: FontStyle.L1_REGULAR,
|
|
4026
4050
|
style: {
|
|
4027
|
-
|
|
4028
|
-
backgroundColor: theme.SURFACE_INVERTED
|
|
4051
|
+
color: theme.CONTENT_INVERTED
|
|
4029
4052
|
}
|
|
4053
|
+
}
|
|
4054
|
+
)), /* @__PURE__ */ React.createElement(
|
|
4055
|
+
Animated.View,
|
|
4056
|
+
{
|
|
4057
|
+
style: [styles.slider, { transform: [{ translateX: pan }] }],
|
|
4058
|
+
...panResponder.panHandlers
|
|
4030
4059
|
},
|
|
4031
|
-
/* @__PURE__ */ React.createElement(
|
|
4032
|
-
|
|
4060
|
+
/* @__PURE__ */ React.createElement(
|
|
4061
|
+
View,
|
|
4033
4062
|
{
|
|
4034
|
-
text: label,
|
|
4035
|
-
variant: FontStyle.L1_REGULAR,
|
|
4036
4063
|
style: {
|
|
4037
|
-
|
|
4064
|
+
...styles.button,
|
|
4065
|
+
backgroundColor: theme.SURFACE_PRIMARY,
|
|
4066
|
+
width: BUTTON_WIDTH
|
|
4038
4067
|
}
|
|
4039
|
-
}
|
|
4040
|
-
)),
|
|
4041
|
-
/* @__PURE__ */ React.createElement(
|
|
4042
|
-
Animated.View,
|
|
4043
|
-
{
|
|
4044
|
-
style: [styles.slider, { transform: [{ translateX: pan }] }],
|
|
4045
|
-
...panResponder.panHandlers
|
|
4046
4068
|
},
|
|
4047
|
-
|
|
4048
|
-
View,
|
|
4049
|
-
{
|
|
4050
|
-
style: {
|
|
4051
|
-
...styles.button,
|
|
4052
|
-
backgroundColor: theme.SURFACE_PRIMARY,
|
|
4053
|
-
width: BUTTON_WIDTH
|
|
4054
|
-
}
|
|
4055
|
-
},
|
|
4056
|
-
icon
|
|
4057
|
-
)
|
|
4069
|
+
icon
|
|
4058
4070
|
)
|
|
4059
|
-
);
|
|
4071
|
+
));
|
|
4060
4072
|
};
|
|
4061
4073
|
var index = withThemeProvider(CustomSlideButton);
|
|
4062
4074
|
|
|
@@ -4064,5 +4076,5 @@ const copyToClipboard = (textToCopy) => {
|
|
|
4064
4076
|
Clipboard.setString(textToCopy);
|
|
4065
4077
|
};
|
|
4066
4078
|
|
|
4067
|
-
export { Accordion, Badge$1 as Badge, BottomDrawer, CustomButton$1 as Button, Cards, category as Category, Checkbox as CheckBox, ContactModel, CountryDropDown as CountryPicker, CustomDocumentPicker$1 as CustomDocumentPicker, CustomDropdown$1 as CustomDropdown, CustomHeader, CustomIcon, CustomLoader, CustomProgressBar, CustomSearchBar, index as CustomSlideButton, CustomSwitchBtn, CustomText$1 as CustomText, CustomTextInput, CustomTooltip, CustomTypography, DHRE_COLORS_ALERT, DHRE_COLORS_BG, DHRE_COLORS_PRIMARY, DHRE_COLORS_SECONDARY, DHRE_COLORS_TEXT, DHRE_DEFAULT, DateRangePicker, CustomDropdown as DropDown, FONT_STYLES, FeedbackForm, FileUpload, FontStyle, Line, NotificationBandge, index$2 as OTPInput, OurOffices as OurOfficesButton, PdfView, PopUp, ShapeType, TagsComponent as SingleSelectionTags, Star as StarRating, index$1 as Stepper, SwipableList, Tabs$1 as Tabs, Tags, TextDirectType, CommonTextInput as TextInput, Theme, Toast, CustomSwitch as ToggleButton, ToggleButtonType, ToggleTextType, Topic$1 as Topic, copyToClipboard, theme as default, height, horizontalScale, moderateScale, toastService, verticalScale, width
|
|
4079
|
+
export { Accordion, Badge$1 as Badge, BottomDrawer, CustomButton$1 as Button, Cards, category as Category, Checkbox as CheckBox, ContactModel, CountryDropDown as CountryPicker, CustomDocumentPicker$1 as CustomDocumentPicker, CustomDropdown$1 as CustomDropdown, CustomHeader, CustomIcon, CustomLoader, CustomProgressBar, CustomSearchBar, index as CustomSlideButton, CustomSwitchBtn, CustomText$1 as CustomText, CustomTextInput, CustomTooltip, CustomTypography, DHRE_COLORS_ALERT, DHRE_COLORS_BG, DHRE_COLORS_PRIMARY, DHRE_COLORS_SECONDARY, DHRE_COLORS_TEXT, DHRE_DEFAULT, DateRangePicker, CustomDropdown as DropDown, FONT_STYLES, FeedbackForm, FileUpload, FontStyle, Line, NotificationBandge, index$2 as OTPInput, OurOffices as OurOfficesButton, PdfView, PopUp, ShapeType, TagsComponent as SingleSelectionTags, Star as StarRating, index$1 as Stepper, SwipableList, Tabs$1 as Tabs, Tags, TextDirectType, CommonTextInput as TextInput, Theme, Toast, CustomSwitch as ToggleButton, ToggleButtonType, ToggleTextType, Topic$1 as Topic, copyToClipboard, theme as default, height, horizontalScale, moderateScale, toastService, verticalScale, width };
|
|
4068
4080
|
//# sourceMappingURL=index.mjs.map
|