dhre-ui-kit 0.0.325 → 0.0.327
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 +1 -0
- package/lib/index.js +22 -18
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +22 -18
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -2014,7 +2014,8 @@ const Accordion = ({
|
|
|
2014
2014
|
headerComponent,
|
|
2015
2015
|
disabled = false,
|
|
2016
2016
|
icon,
|
|
2017
|
-
titleVariant = "B4_REGULAR"
|
|
2017
|
+
titleVariant = "B4_REGULAR",
|
|
2018
|
+
slideAnimation = true
|
|
2018
2019
|
}) => {
|
|
2019
2020
|
const contentRef = React.useRef(null);
|
|
2020
2021
|
const [animation] = React.useState(new reactNative.Animated.Value(0));
|
|
@@ -2073,7 +2074,7 @@ const Accordion = ({
|
|
|
2073
2074
|
}) : null
|
|
2074
2075
|
),
|
|
2075
2076
|
optionalElement ? optionalElement() : null,
|
|
2076
|
-
isOpen && /* @__PURE__ */ React__default["default"].createElement(reactNative.Animated.View, { style: [styles$m.content, { height: cardHeight }] }, /* @__PURE__ */ React__default["default"].createElement(
|
|
2077
|
+
isOpen && /* @__PURE__ */ React__default["default"].createElement(reactNative.Animated.View, { style: [styles$m.content, slideAnimation && { height: cardHeight }] }, /* @__PURE__ */ React__default["default"].createElement(
|
|
2077
2078
|
reactNative.View,
|
|
2078
2079
|
{
|
|
2079
2080
|
ref: contentRef,
|
|
@@ -4183,22 +4184,25 @@ const OTPInput = React__default["default"].forwardRef(
|
|
|
4183
4184
|
}
|
|
4184
4185
|
}));
|
|
4185
4186
|
const handleChange = (index, value) => {
|
|
4186
|
-
const
|
|
4187
|
-
if (value
|
|
4188
|
-
const
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4187
|
+
const specialCharacterRegex = /[^a-zA-Z0-9 ]/;
|
|
4188
|
+
if (value === "" || value?.length > 1 || !specialCharacterRegex.test(value)) {
|
|
4189
|
+
const regex = /^\d+$/;
|
|
4190
|
+
if (value.length === 1 && regex.test(value) && index >= 0 && index < length) {
|
|
4191
|
+
const newOTP = `${otp}${value}`;
|
|
4192
|
+
setOTP(newOTP);
|
|
4193
|
+
refs.current[index + 1]?.focus();
|
|
4194
|
+
} else if (value.length === 0 && index > 0) {
|
|
4195
|
+
const newOTP = otp.slice(0, -1);
|
|
4196
|
+
setOTP(newOTP);
|
|
4197
|
+
refs.current[index - 1]?.focus();
|
|
4198
|
+
} else if (value?.length === length) {
|
|
4199
|
+
setOTP(value);
|
|
4200
|
+
refs.current[length - 1]?.focus();
|
|
4201
|
+
} else {
|
|
4202
|
+
const newOTP = otp.slice(0, -1);
|
|
4203
|
+
setOTP(newOTP);
|
|
4204
|
+
refs.current[index]?.focus();
|
|
4205
|
+
}
|
|
4202
4206
|
}
|
|
4203
4207
|
};
|
|
4204
4208
|
const handleKeyPress = (e, index) => {
|