dhre-ui-kit 0.0.206 → 0.0.207
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 -1
- package/lib/index.js +117 -104
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +117 -104
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -3917,6 +3917,9 @@ const OTPInput = React.forwardRef(
|
|
|
3917
3917
|
const otpRegex = new RegExp(`(\\d{${length}})`, "g");
|
|
3918
3918
|
const otp2 = otpRegex.exec(message)?.[1];
|
|
3919
3919
|
setOTP(otp2 ?? "");
|
|
3920
|
+
if (otp2) {
|
|
3921
|
+
refs.current[otp2?.length - 1]?.focus();
|
|
3922
|
+
}
|
|
3920
3923
|
});
|
|
3921
3924
|
};
|
|
3922
3925
|
React.useImperativeHandle(ref, () => ({
|
|
@@ -4226,116 +4229,126 @@ const styles$3 = StyleSheet.create({
|
|
|
4226
4229
|
});
|
|
4227
4230
|
|
|
4228
4231
|
const BUTTON_WIDTH = 40;
|
|
4229
|
-
const CustomSlideButton = (
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
value.current = width;
|
|
4255
|
-
}
|
|
4256
|
-
};
|
|
4257
|
-
const panResponder = useRef(
|
|
4258
|
-
PanResponder.create({
|
|
4259
|
-
onMoveShouldSetPanResponder: (evt, gestureState) => {
|
|
4260
|
-
return gestureState.dx > 0;
|
|
4261
|
-
},
|
|
4262
|
-
onPanResponderGrant: () => {
|
|
4263
|
-
},
|
|
4264
|
-
onPanResponderMove: (evt, gestureState) => {
|
|
4265
|
-
if (gestureState.dx < value.current - BUTTON_WIDTH) {
|
|
4266
|
-
pan.setValue(gestureState.dx);
|
|
4267
|
-
slideTailCardRef?.current?.setNativeProps({
|
|
4268
|
-
style: { width: gestureState.dx + BUTTON_WIDTH / 2 }
|
|
4269
|
-
});
|
|
4270
|
-
}
|
|
4271
|
-
},
|
|
4272
|
-
onPanResponderRelease: (evt, gestureState) => {
|
|
4273
|
-
if (gestureState.dx > value.current - BUTTON_WIDTH - 100) {
|
|
4274
|
-
onComplete && onComplete();
|
|
4275
|
-
Animated.spring(pan, {
|
|
4276
|
-
toValue: value.current - BUTTON_WIDTH - 10,
|
|
4277
|
-
useNativeDriver: false
|
|
4278
|
-
}).start();
|
|
4279
|
-
slideTailCardRef?.current?.setNativeProps({
|
|
4280
|
-
style: { width: value.current + BUTTON_WIDTH }
|
|
4281
|
-
// Change the width here
|
|
4282
|
-
});
|
|
4283
|
-
} else {
|
|
4284
|
-
Animated.spring(pan, {
|
|
4285
|
-
toValue: 0,
|
|
4286
|
-
useNativeDriver: false
|
|
4287
|
-
}).start();
|
|
4288
|
-
slideTailCardRef?.current?.setNativeProps({
|
|
4289
|
-
style: { width: 0 }
|
|
4290
|
-
});
|
|
4291
|
-
}
|
|
4232
|
+
const CustomSlideButton = React.forwardRef(
|
|
4233
|
+
({
|
|
4234
|
+
label,
|
|
4235
|
+
onComplete,
|
|
4236
|
+
icon,
|
|
4237
|
+
textStyle,
|
|
4238
|
+
containerStyle,
|
|
4239
|
+
sliderStyle,
|
|
4240
|
+
size = BUTTON_WIDTH,
|
|
4241
|
+
slideButtonTail,
|
|
4242
|
+
slideButtonTailColor = "#fff"
|
|
4243
|
+
}, ref) => {
|
|
4244
|
+
const value = useRef(0);
|
|
4245
|
+
const cardRef = useRef(null);
|
|
4246
|
+
const pan = useRef(new Animated.Value(0)).current;
|
|
4247
|
+
const slideTailCardRef = useRef(null);
|
|
4248
|
+
slideTailCardRef?.current?.setNativeProps({
|
|
4249
|
+
style: { width: 0 }
|
|
4250
|
+
});
|
|
4251
|
+
React.useImperativeHandle(ref, () => ({
|
|
4252
|
+
reset() {
|
|
4253
|
+
Animated.spring(pan, {
|
|
4254
|
+
toValue: 0,
|
|
4255
|
+
useNativeDriver: false
|
|
4256
|
+
}).start();
|
|
4292
4257
|
}
|
|
4293
|
-
})
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
{
|
|
4303
|
-
ref: slideTailCardRef,
|
|
4304
|
-
style: [{ height: "100%", backgroundColor: slideButtonTailColor }]
|
|
4305
|
-
}
|
|
4306
|
-
), /* @__PURE__ */ React.createElement(View, { style: styles$3.buttonTextContainer }, /* @__PURE__ */ React.createElement(
|
|
4307
|
-
CustomTypography,
|
|
4308
|
-
{
|
|
4309
|
-
text: label,
|
|
4310
|
-
variant: FontStyle.L1_REGULAR,
|
|
4311
|
-
style: {
|
|
4312
|
-
color: theme.CONTENT_INVERTED,
|
|
4313
|
-
alignSelf: "center",
|
|
4314
|
-
...textStyle
|
|
4258
|
+
}));
|
|
4259
|
+
const handleLayout = (event) => {
|
|
4260
|
+
const { width } = event.nativeEvent.layout;
|
|
4261
|
+
if (cardRef.current) {
|
|
4262
|
+
cardRef.current.setNativeProps({
|
|
4263
|
+
style: { width }
|
|
4264
|
+
// Change the width here
|
|
4265
|
+
});
|
|
4266
|
+
value.current = width;
|
|
4315
4267
|
}
|
|
4316
|
-
}
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4268
|
+
};
|
|
4269
|
+
const panResponder = useRef(
|
|
4270
|
+
PanResponder.create({
|
|
4271
|
+
onMoveShouldSetPanResponder: (evt, gestureState) => {
|
|
4272
|
+
return gestureState.dx > 0;
|
|
4273
|
+
},
|
|
4274
|
+
onPanResponderGrant: () => {
|
|
4275
|
+
},
|
|
4276
|
+
onPanResponderMove: (evt, gestureState) => {
|
|
4277
|
+
if (gestureState.dx < value.current - BUTTON_WIDTH) {
|
|
4278
|
+
pan.setValue(gestureState.dx);
|
|
4279
|
+
slideTailCardRef?.current?.setNativeProps({
|
|
4280
|
+
style: { width: gestureState.dx + BUTTON_WIDTH / 2 }
|
|
4281
|
+
});
|
|
4282
|
+
}
|
|
4283
|
+
},
|
|
4284
|
+
onPanResponderRelease: (evt, gestureState) => {
|
|
4285
|
+
if (gestureState.dx > value.current - BUTTON_WIDTH - 100) {
|
|
4286
|
+
onComplete && onComplete();
|
|
4287
|
+
Animated.spring(pan, {
|
|
4288
|
+
toValue: value.current - BUTTON_WIDTH - 10,
|
|
4289
|
+
useNativeDriver: false
|
|
4290
|
+
}).start();
|
|
4291
|
+
slideTailCardRef?.current?.setNativeProps({
|
|
4292
|
+
style: { width: value.current + BUTTON_WIDTH }
|
|
4293
|
+
// Change the width here
|
|
4294
|
+
});
|
|
4295
|
+
} else {
|
|
4296
|
+
Animated.spring(pan, {
|
|
4297
|
+
toValue: 0,
|
|
4298
|
+
useNativeDriver: false
|
|
4299
|
+
}).start();
|
|
4300
|
+
slideTailCardRef?.current?.setNativeProps({
|
|
4301
|
+
style: { width: 0 }
|
|
4302
|
+
});
|
|
4303
|
+
}
|
|
4304
|
+
}
|
|
4305
|
+
})
|
|
4306
|
+
).current;
|
|
4307
|
+
const { theme } = useTheme();
|
|
4308
|
+
return /* @__PURE__ */ React.createElement(View, { style: {
|
|
4309
|
+
...styles$3.sliderContainer,
|
|
4310
|
+
backgroundColor: theme.SURFACE_INVERTED,
|
|
4311
|
+
...containerStyle
|
|
4312
|
+
}, onLayout: handleLayout, ref: cardRef }, slideButtonTail && /* @__PURE__ */ React.createElement(
|
|
4313
|
+
Animated.View,
|
|
4325
4314
|
{
|
|
4315
|
+
ref: slideTailCardRef,
|
|
4316
|
+
style: [{ height: "100%", backgroundColor: slideButtonTailColor }]
|
|
4317
|
+
}
|
|
4318
|
+
), /* @__PURE__ */ React.createElement(View, { style: styles$3.buttonTextContainer }, /* @__PURE__ */ React.createElement(
|
|
4319
|
+
CustomTypography,
|
|
4320
|
+
{
|
|
4321
|
+
text: label,
|
|
4322
|
+
variant: FontStyle.L1_REGULAR,
|
|
4326
4323
|
style: {
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
height: verticalScale(size),
|
|
4331
|
-
borderRadius: verticalScale(size / 2),
|
|
4332
|
-
...sliderStyle
|
|
4324
|
+
color: theme.CONTENT_INVERTED,
|
|
4325
|
+
alignSelf: "center",
|
|
4326
|
+
...textStyle
|
|
4333
4327
|
}
|
|
4328
|
+
}
|
|
4329
|
+
)), /* @__PURE__ */ React.createElement(
|
|
4330
|
+
Animated.View,
|
|
4331
|
+
{
|
|
4332
|
+
style: [styles$3.slider, { transform: [{ translateX: pan }] }],
|
|
4333
|
+
...panResponder.panHandlers
|
|
4334
4334
|
},
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4335
|
+
/* @__PURE__ */ React.createElement(
|
|
4336
|
+
View,
|
|
4337
|
+
{
|
|
4338
|
+
style: {
|
|
4339
|
+
...styles$3.button,
|
|
4340
|
+
backgroundColor: theme.SURFACE_PRIMARY,
|
|
4341
|
+
width: verticalScale(size),
|
|
4342
|
+
height: verticalScale(size),
|
|
4343
|
+
borderRadius: verticalScale(size / 2),
|
|
4344
|
+
...sliderStyle
|
|
4345
|
+
}
|
|
4346
|
+
},
|
|
4347
|
+
icon
|
|
4348
|
+
)
|
|
4349
|
+
));
|
|
4350
|
+
}
|
|
4351
|
+
);
|
|
4339
4352
|
var index$2 = withThemeProvider(CustomSlideButton);
|
|
4340
4353
|
|
|
4341
4354
|
const copyToClipboard = (textToCopy) => {
|