dhre-ui-kit 0.0.122 → 0.0.124
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 +9 -1
- package/lib/index.js +65 -47
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +65 -47
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -217,8 +217,8 @@ const theme = {
|
|
|
217
217
|
dark: "#404040"
|
|
218
218
|
},
|
|
219
219
|
[Theme.BORDER_SEPRATOR]: {
|
|
220
|
-
light: "#
|
|
221
|
-
dark: "#
|
|
220
|
+
light: "#F5F5F5",
|
|
221
|
+
dark: "#282828"
|
|
222
222
|
},
|
|
223
223
|
[Theme.BORDER_SEPERATOR_HEADER]: {
|
|
224
224
|
light: "#E1E1E1",
|
|
@@ -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
|
|
|
@@ -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"
|
|
@@ -3242,15 +3242,19 @@ const CustomDropdown = ({
|
|
|
3242
3242
|
placeholder,
|
|
3243
3243
|
containerStyle,
|
|
3244
3244
|
dropdownStyle,
|
|
3245
|
+
dropdownFocusStyle,
|
|
3245
3246
|
placeholderStyle,
|
|
3246
3247
|
selectedTextStyle,
|
|
3247
3248
|
iconStyle,
|
|
3248
3249
|
labelStyle,
|
|
3250
|
+
labelFocusStyle,
|
|
3249
3251
|
defaultValue,
|
|
3250
3252
|
iconColor,
|
|
3251
3253
|
itemTextStyle,
|
|
3252
3254
|
onValueChange,
|
|
3253
|
-
itemContainerStyle
|
|
3255
|
+
itemContainerStyle,
|
|
3256
|
+
menuContainerStyle,
|
|
3257
|
+
activeColor
|
|
3254
3258
|
}) => {
|
|
3255
3259
|
const [value, setValue] = useState(defaultValue);
|
|
3256
3260
|
const [isFocus, setIsFocus] = useState(false);
|
|
@@ -3262,7 +3266,7 @@ const CustomDropdown = ({
|
|
|
3262
3266
|
style: [
|
|
3263
3267
|
styles$6.label,
|
|
3264
3268
|
labelStyle,
|
|
3265
|
-
isFocus && { color: theme.BORDER_INVERTED["light"] }
|
|
3269
|
+
isFocus && (labelFocusStyle ?? { color: theme.BORDER_INVERTED["light"] })
|
|
3266
3270
|
]
|
|
3267
3271
|
},
|
|
3268
3272
|
label
|
|
@@ -3284,7 +3288,7 @@ const CustomDropdown = ({
|
|
|
3284
3288
|
style: [
|
|
3285
3289
|
styles$6.dropdown,
|
|
3286
3290
|
dropdownStyle,
|
|
3287
|
-
isFocus && { borderColor: theme.BORDER_INVERTED["light"] }
|
|
3291
|
+
isFocus && (dropdownFocusStyle ?? { borderColor: theme.BORDER_INVERTED["light"] })
|
|
3288
3292
|
],
|
|
3289
3293
|
placeholderStyle: [styles$6.placeholderStyle, placeholderStyle],
|
|
3290
3294
|
selectedTextStyle: [styles$6.selectedTextStyle, selectedTextStyle],
|
|
@@ -3300,6 +3304,8 @@ const CustomDropdown = ({
|
|
|
3300
3304
|
iconColor,
|
|
3301
3305
|
dropdownPosition: "bottom",
|
|
3302
3306
|
itemTextStyle,
|
|
3307
|
+
containerStyle: menuContainerStyle,
|
|
3308
|
+
activeColor,
|
|
3303
3309
|
itemContainerStyle: [styles$6.itemListStyle, itemContainerStyle]
|
|
3304
3310
|
}
|
|
3305
3311
|
));
|
|
@@ -3680,7 +3686,11 @@ const OTPInput = React.forwardRef(
|
|
|
3680
3686
|
resendOTP,
|
|
3681
3687
|
errorMessage,
|
|
3682
3688
|
testId = "",
|
|
3683
|
-
otpContainerStyle
|
|
3689
|
+
otpContainerStyle,
|
|
3690
|
+
otpHeaderTextStyle,
|
|
3691
|
+
textInputStyle,
|
|
3692
|
+
resendTextStyle,
|
|
3693
|
+
resendOtpColor
|
|
3684
3694
|
}, ref) => {
|
|
3685
3695
|
const [otp, setOTP] = useState("");
|
|
3686
3696
|
const [isResendOtpEnable, setIsResendOtpEnable] = useState(false);
|
|
@@ -3695,6 +3705,7 @@ const OTPInput = React.forwardRef(
|
|
|
3695
3705
|
setIsResendOtpEnable(false);
|
|
3696
3706
|
enableResendOtp();
|
|
3697
3707
|
resendOTP?.();
|
|
3708
|
+
setOTP("");
|
|
3698
3709
|
};
|
|
3699
3710
|
const enableResendOtp = () => {
|
|
3700
3711
|
setTimeout(() => {
|
|
@@ -3732,14 +3743,15 @@ const OTPInput = React.forwardRef(
|
|
|
3732
3743
|
onComplete?.(otp);
|
|
3733
3744
|
}
|
|
3734
3745
|
}, [otp]);
|
|
3735
|
-
return /* @__PURE__ */ React.createElement(View, { style: { ...otpContainerStyle },
|
|
3746
|
+
return /* @__PURE__ */ React.createElement(View, { style: { ...otpContainerStyle }, "data-testid": testId }, /* @__PURE__ */ React.createElement(
|
|
3736
3747
|
CustomTypography,
|
|
3737
3748
|
{
|
|
3738
3749
|
text: "OTP",
|
|
3739
3750
|
variant: FontStyle.B4_REGULAR,
|
|
3740
3751
|
style: {
|
|
3741
3752
|
color: otp?.length ? theme.CONTENT_PRIMARY : theme.CONTENT_SECONDRY,
|
|
3742
|
-
textAlign: "left"
|
|
3753
|
+
textAlign: "left",
|
|
3754
|
+
...otpHeaderTextStyle
|
|
3743
3755
|
}
|
|
3744
3756
|
}
|
|
3745
3757
|
), /* @__PURE__ */ React.createElement(View, { style: { ...styles$2.textInputContainer } }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React.createElement(
|
|
@@ -3749,7 +3761,8 @@ const OTPInput = React.forwardRef(
|
|
|
3749
3761
|
style: {
|
|
3750
3762
|
...styles$2.textInputStyle,
|
|
3751
3763
|
color: theme.CONTENT_PRIMARY,
|
|
3752
|
-
borderColor: errorMessage ? theme.ERROR : otp.length === length ? theme.SUCCESS : activeInput === index ? theme.BORDER_INVERTED : theme.BORDER_PRIMARY
|
|
3764
|
+
borderColor: errorMessage ? theme.ERROR : otp.length === length ? theme.SUCCESS : activeInput === index ? theme.BORDER_INVERTED : theme.BORDER_PRIMARY,
|
|
3765
|
+
...textInputStyle
|
|
3753
3766
|
},
|
|
3754
3767
|
onFocus: () => setActiveInput(index),
|
|
3755
3768
|
onBlur: () => setActiveInput(null),
|
|
@@ -3778,7 +3791,8 @@ const OTPInput = React.forwardRef(
|
|
|
3778
3791
|
variant: FontStyle.L2_REGULAR,
|
|
3779
3792
|
style: {
|
|
3780
3793
|
textDecorationLine: "underline",
|
|
3781
|
-
color: isResendOtpEnable ? theme.CONTENT_PRIMARY : theme.CONTENT_DISABLE
|
|
3794
|
+
color: isResendOtpEnable ? resendOtpColor ?? theme.CONTENT_PRIMARY : theme.CONTENT_DISABLE,
|
|
3795
|
+
...resendTextStyle
|
|
3782
3796
|
}
|
|
3783
3797
|
}
|
|
3784
3798
|
))));
|
|
@@ -3983,14 +3997,25 @@ const styles = StyleSheet.create({
|
|
|
3983
3997
|
}
|
|
3984
3998
|
});
|
|
3985
3999
|
|
|
3986
|
-
const { width } = Dimensions.get("window");
|
|
3987
4000
|
const BUTTON_WIDTH = 40;
|
|
3988
4001
|
const CustomSlideButton = ({
|
|
3989
4002
|
label,
|
|
3990
4003
|
onComplete,
|
|
3991
4004
|
icon
|
|
3992
4005
|
}) => {
|
|
4006
|
+
const value = useRef(0);
|
|
4007
|
+
const cardRef = useRef(null);
|
|
3993
4008
|
const pan = useRef(new Animated.Value(0)).current;
|
|
4009
|
+
const handleLayout = (event) => {
|
|
4010
|
+
const { width } = event.nativeEvent.layout;
|
|
4011
|
+
if (cardRef.current) {
|
|
4012
|
+
cardRef.current.setNativeProps({
|
|
4013
|
+
style: { width }
|
|
4014
|
+
// Change the width here
|
|
4015
|
+
});
|
|
4016
|
+
value.current = width;
|
|
4017
|
+
}
|
|
4018
|
+
};
|
|
3994
4019
|
const panResponder = useRef(
|
|
3995
4020
|
PanResponder.create({
|
|
3996
4021
|
onMoveShouldSetPanResponder: (evt, gestureState) => {
|
|
@@ -3999,15 +4024,15 @@ const CustomSlideButton = ({
|
|
|
3999
4024
|
onPanResponderGrant: () => {
|
|
4000
4025
|
},
|
|
4001
4026
|
onPanResponderMove: (evt, gestureState) => {
|
|
4002
|
-
if (gestureState.dx <
|
|
4027
|
+
if (gestureState.dx < value.current - BUTTON_WIDTH) {
|
|
4003
4028
|
pan.setValue(gestureState.dx);
|
|
4004
4029
|
}
|
|
4005
4030
|
},
|
|
4006
4031
|
onPanResponderRelease: (evt, gestureState) => {
|
|
4007
|
-
if (gestureState.dx >
|
|
4032
|
+
if (gestureState.dx > value.current - BUTTON_WIDTH - 100) {
|
|
4008
4033
|
onComplete && onComplete();
|
|
4009
4034
|
Animated.spring(pan, {
|
|
4010
|
-
toValue:
|
|
4035
|
+
toValue: value.current - BUTTON_WIDTH - 10,
|
|
4011
4036
|
useNativeDriver: false
|
|
4012
4037
|
}).start();
|
|
4013
4038
|
} else {
|
|
@@ -4020,43 +4045,36 @@ const CustomSlideButton = ({
|
|
|
4020
4045
|
})
|
|
4021
4046
|
).current;
|
|
4022
4047
|
const { theme } = useTheme();
|
|
4023
|
-
return /* @__PURE__ */ React.createElement(
|
|
4024
|
-
|
|
4048
|
+
return /* @__PURE__ */ React.createElement(View, { style: {
|
|
4049
|
+
...styles.sliderContainer,
|
|
4050
|
+
backgroundColor: theme.SURFACE_INVERTED
|
|
4051
|
+
}, onLayout: handleLayout, ref: cardRef }, /* @__PURE__ */ React.createElement(View, { style: styles.buttonTextCOntainer }, /* @__PURE__ */ React.createElement(
|
|
4052
|
+
CustomTypography,
|
|
4025
4053
|
{
|
|
4054
|
+
text: label,
|
|
4055
|
+
variant: FontStyle.L1_REGULAR,
|
|
4026
4056
|
style: {
|
|
4027
|
-
|
|
4028
|
-
backgroundColor: theme.SURFACE_INVERTED
|
|
4057
|
+
color: theme.CONTENT_INVERTED
|
|
4029
4058
|
}
|
|
4059
|
+
}
|
|
4060
|
+
)), /* @__PURE__ */ React.createElement(
|
|
4061
|
+
Animated.View,
|
|
4062
|
+
{
|
|
4063
|
+
style: [styles.slider, { transform: [{ translateX: pan }] }],
|
|
4064
|
+
...panResponder.panHandlers
|
|
4030
4065
|
},
|
|
4031
|
-
/* @__PURE__ */ React.createElement(
|
|
4032
|
-
|
|
4066
|
+
/* @__PURE__ */ React.createElement(
|
|
4067
|
+
View,
|
|
4033
4068
|
{
|
|
4034
|
-
text: label,
|
|
4035
|
-
variant: FontStyle.L1_REGULAR,
|
|
4036
4069
|
style: {
|
|
4037
|
-
|
|
4070
|
+
...styles.button,
|
|
4071
|
+
backgroundColor: theme.SURFACE_PRIMARY,
|
|
4072
|
+
width: BUTTON_WIDTH
|
|
4038
4073
|
}
|
|
4039
|
-
}
|
|
4040
|
-
)),
|
|
4041
|
-
/* @__PURE__ */ React.createElement(
|
|
4042
|
-
Animated.View,
|
|
4043
|
-
{
|
|
4044
|
-
style: [styles.slider, { transform: [{ translateX: pan }] }],
|
|
4045
|
-
...panResponder.panHandlers
|
|
4046
4074
|
},
|
|
4047
|
-
|
|
4048
|
-
View,
|
|
4049
|
-
{
|
|
4050
|
-
style: {
|
|
4051
|
-
...styles.button,
|
|
4052
|
-
backgroundColor: theme.SURFACE_PRIMARY,
|
|
4053
|
-
width: BUTTON_WIDTH
|
|
4054
|
-
}
|
|
4055
|
-
},
|
|
4056
|
-
icon
|
|
4057
|
-
)
|
|
4075
|
+
icon
|
|
4058
4076
|
)
|
|
4059
|
-
);
|
|
4077
|
+
));
|
|
4060
4078
|
};
|
|
4061
4079
|
var index = withThemeProvider(CustomSlideButton);
|
|
4062
4080
|
|
|
@@ -4064,5 +4082,5 @@ const copyToClipboard = (textToCopy) => {
|
|
|
4064
4082
|
Clipboard.setString(textToCopy);
|
|
4065
4083
|
};
|
|
4066
4084
|
|
|
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
|
|
4085
|
+
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
4086
|
//# sourceMappingURL=index.mjs.map
|