dhre-ui-kit 0.0.191 → 0.0.193
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 +7 -4
- package/lib/index.js +37 -4
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +37 -4
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -706,7 +706,8 @@ interface IProps$1 {
|
|
|
706
706
|
mode?: 'light' | 'dark';
|
|
707
707
|
}
|
|
708
708
|
type OTPInputHandle = {
|
|
709
|
-
reset
|
|
709
|
+
reset?: () => void;
|
|
710
|
+
set?: (newOtp: string) => void;
|
|
710
711
|
};
|
|
711
712
|
|
|
712
713
|
declare const _default$4: (props: IProps$1 & React$1.RefAttributes<OTPInputHandle>) => React$1.JSX.Element;
|
|
@@ -735,6 +736,8 @@ interface CustomSlideButtonProps {
|
|
|
735
736
|
textStyle?: TextStyle;
|
|
736
737
|
containerStyle?: ViewStyle;
|
|
737
738
|
sliderStyle?: ViewStyle;
|
|
739
|
+
slideButtonTail?: boolean;
|
|
740
|
+
slideButtonTailColor?: string;
|
|
738
741
|
}
|
|
739
742
|
|
|
740
743
|
declare const _default$2: (props: CustomSlideButtonProps) => React$1.JSX.Element;
|
|
@@ -1083,9 +1086,9 @@ interface PropertyDetailsProps {
|
|
|
1083
1086
|
brandIcon: React.ReactElement;
|
|
1084
1087
|
title: string;
|
|
1085
1088
|
subTitle: string;
|
|
1086
|
-
propertyNumber
|
|
1087
|
-
hintIcon
|
|
1088
|
-
btnIcon
|
|
1089
|
+
propertyNumber?: string;
|
|
1090
|
+
hintIcon?: React.ReactElement;
|
|
1091
|
+
btnIcon?: React.ReactElement;
|
|
1089
1092
|
containerStyle?: ViewStyle;
|
|
1090
1093
|
onRightIconPress: () => void;
|
|
1091
1094
|
}
|
package/lib/index.js
CHANGED
|
@@ -3918,6 +3918,11 @@ const OTPInput = React__default["default"].forwardRef(
|
|
|
3918
3918
|
React__default["default"].useImperativeHandle(ref, () => ({
|
|
3919
3919
|
reset() {
|
|
3920
3920
|
setOTP("");
|
|
3921
|
+
refs.current[0]?.focus();
|
|
3922
|
+
},
|
|
3923
|
+
set(newOtp) {
|
|
3924
|
+
setOTP(newOtp);
|
|
3925
|
+
refs.current[newOtp?.length - 1]?.focus();
|
|
3921
3926
|
}
|
|
3922
3927
|
}));
|
|
3923
3928
|
const handleChange = (index, value) => {
|
|
@@ -3930,6 +3935,9 @@ const OTPInput = React__default["default"].forwardRef(
|
|
|
3930
3935
|
const newOTP = otp.slice(0, -1);
|
|
3931
3936
|
setOTP(newOTP);
|
|
3932
3937
|
refs.current[index - 1]?.focus();
|
|
3938
|
+
} else if (value?.length === length) {
|
|
3939
|
+
setOTP(value);
|
|
3940
|
+
refs.current[length - 1]?.focus();
|
|
3933
3941
|
} else {
|
|
3934
3942
|
const newOTP = otp.slice(0, -1);
|
|
3935
3943
|
setOTP(newOTP);
|
|
@@ -3976,6 +3984,9 @@ const OTPInput = React__default["default"].forwardRef(
|
|
|
3976
3984
|
keyboardType: "numeric",
|
|
3977
3985
|
ref: (el) => refs.current[index] = el,
|
|
3978
3986
|
returnKeyType: otp.length === length ? "done" : "next",
|
|
3987
|
+
importantForAutofill: "yes",
|
|
3988
|
+
textContentType: "oneTimeCode",
|
|
3989
|
+
autoComplete: "sms-otp",
|
|
3979
3990
|
selectionColor: theme$1.CONTENT_PRIMARY
|
|
3980
3991
|
}
|
|
3981
3992
|
))), /* @__PURE__ */ React__default["default"].createElement(
|
|
@@ -4218,11 +4229,17 @@ const CustomSlideButton = ({
|
|
|
4218
4229
|
textStyle,
|
|
4219
4230
|
containerStyle,
|
|
4220
4231
|
sliderStyle,
|
|
4221
|
-
size = BUTTON_WIDTH
|
|
4232
|
+
size = BUTTON_WIDTH,
|
|
4233
|
+
slideButtonTail,
|
|
4234
|
+
slideButtonTailColor = "#fff"
|
|
4222
4235
|
}) => {
|
|
4223
4236
|
const value = React.useRef(0);
|
|
4224
4237
|
const cardRef = React.useRef(null);
|
|
4225
4238
|
const pan = React.useRef(new reactNative.Animated.Value(0)).current;
|
|
4239
|
+
const slideTailCardRef = React.useRef(null);
|
|
4240
|
+
slideTailCardRef?.current?.setNativeProps({
|
|
4241
|
+
style: { width: 0 }
|
|
4242
|
+
});
|
|
4226
4243
|
const handleLayout = (event) => {
|
|
4227
4244
|
const { width } = event.nativeEvent.layout;
|
|
4228
4245
|
if (cardRef.current) {
|
|
@@ -4243,6 +4260,9 @@ const CustomSlideButton = ({
|
|
|
4243
4260
|
onPanResponderMove: (evt, gestureState) => {
|
|
4244
4261
|
if (gestureState.dx < value.current - BUTTON_WIDTH) {
|
|
4245
4262
|
pan.setValue(gestureState.dx);
|
|
4263
|
+
slideTailCardRef?.current?.setNativeProps({
|
|
4264
|
+
style: { width: gestureState.dx + BUTTON_WIDTH / 2 }
|
|
4265
|
+
});
|
|
4246
4266
|
}
|
|
4247
4267
|
},
|
|
4248
4268
|
onPanResponderRelease: (evt, gestureState) => {
|
|
@@ -4252,11 +4272,18 @@ const CustomSlideButton = ({
|
|
|
4252
4272
|
toValue: value.current - BUTTON_WIDTH - 10,
|
|
4253
4273
|
useNativeDriver: false
|
|
4254
4274
|
}).start();
|
|
4275
|
+
slideTailCardRef?.current?.setNativeProps({
|
|
4276
|
+
style: { width: value.current + BUTTON_WIDTH }
|
|
4277
|
+
// Change the width here
|
|
4278
|
+
});
|
|
4255
4279
|
} else {
|
|
4256
4280
|
reactNative.Animated.spring(pan, {
|
|
4257
4281
|
toValue: 0,
|
|
4258
4282
|
useNativeDriver: false
|
|
4259
4283
|
}).start();
|
|
4284
|
+
slideTailCardRef?.current?.setNativeProps({
|
|
4285
|
+
style: { width: 0 }
|
|
4286
|
+
});
|
|
4260
4287
|
}
|
|
4261
4288
|
}
|
|
4262
4289
|
})
|
|
@@ -4266,7 +4293,13 @@ const CustomSlideButton = ({
|
|
|
4266
4293
|
...styles$2.sliderContainer,
|
|
4267
4294
|
backgroundColor: theme.SURFACE_INVERTED,
|
|
4268
4295
|
...containerStyle
|
|
4269
|
-
}, onLayout: handleLayout, ref: cardRef },
|
|
4296
|
+
}, onLayout: handleLayout, ref: cardRef }, slideButtonTail && /* @__PURE__ */ React__default["default"].createElement(
|
|
4297
|
+
reactNative.Animated.View,
|
|
4298
|
+
{
|
|
4299
|
+
ref: slideTailCardRef,
|
|
4300
|
+
style: [{ height: "100%", backgroundColor: slideButtonTailColor }]
|
|
4301
|
+
}
|
|
4302
|
+
), /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$2.buttonTextContainer }, /* @__PURE__ */ React__default["default"].createElement(
|
|
4270
4303
|
CustomTypography,
|
|
4271
4304
|
{
|
|
4272
4305
|
text: label,
|
|
@@ -4605,7 +4638,7 @@ const PropertyDetails = ({
|
|
|
4605
4638
|
variant: FontStyle.L1_REGULAR,
|
|
4606
4639
|
style: { color: theme.CONTENT_PRIMARY }
|
|
4607
4640
|
}
|
|
4608
|
-
), /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles.propertyNumber }, /* @__PURE__ */ React__default["default"].createElement(
|
|
4641
|
+
), propertyNumber && /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles.propertyNumber }, /* @__PURE__ */ React__default["default"].createElement(
|
|
4609
4642
|
CustomTypography,
|
|
4610
4643
|
{
|
|
4611
4644
|
text: propertyNumber,
|
|
@@ -4615,7 +4648,7 @@ const PropertyDetails = ({
|
|
|
4615
4648
|
}
|
|
4616
4649
|
}
|
|
4617
4650
|
), hintIcon)),
|
|
4618
|
-
/* @__PURE__ */ React__default["default"].createElement(
|
|
4651
|
+
btnIcon && /* @__PURE__ */ React__default["default"].createElement(
|
|
4619
4652
|
CustomIcon,
|
|
4620
4653
|
{
|
|
4621
4654
|
icon: btnIcon,
|