@verifiedinc-public/shared-ui-elements 0.14.2 → 0.14.4
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/shared-ui-elements.mjs +1534 -1518
- package/package.json +1 -1
- package/src/components/Snackbar/index.tsx +17 -1
- package/src/components/form/OTPInput.tsx +19 -16
package/package.json
CHANGED
@@ -94,7 +94,23 @@ export const CustomAlertComponent = forwardRef<
|
|
94
94
|
CustomAlertComponentProps
|
95
95
|
>(
|
96
96
|
(
|
97
|
-
{
|
97
|
+
{
|
98
|
+
id,
|
99
|
+
message,
|
100
|
+
severity,
|
101
|
+
alertAction,
|
102
|
+
sx,
|
103
|
+
showCloseIcon = true,
|
104
|
+
|
105
|
+
// remove these props because they were triggering warnings. They are not used in this component anyway
|
106
|
+
persist,
|
107
|
+
hideIconVariant,
|
108
|
+
autoHideDuration,
|
109
|
+
anchorOrigin,
|
110
|
+
iconVariant,
|
111
|
+
|
112
|
+
...props
|
113
|
+
},
|
98
114
|
ref,
|
99
115
|
) => {
|
100
116
|
return (
|
@@ -20,6 +20,7 @@ import {
|
|
20
20
|
type InputBaseProps,
|
21
21
|
Typography,
|
22
22
|
useTheme,
|
23
|
+
FormControl,
|
23
24
|
} from '@mui/material';
|
24
25
|
import { v4 as uuid } from 'uuid';
|
25
26
|
|
@@ -192,22 +193,24 @@ function OTPInputComponent(
|
|
192
193
|
(startIndex: number) => {
|
193
194
|
return new Array(3).fill(undefined).map((_, index) => {
|
194
195
|
return (
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
(
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
196
|
+
// FormControl is required for InputBase to avoid bad setState in handleBlur event, and it is one per input.
|
197
|
+
<FormControl key={ids.current[index + startIndex]}>
|
198
|
+
<InputBase
|
199
|
+
inputRef={(input) =>
|
200
|
+
((inputsRef.current[index + startIndex] as any) = input)
|
201
|
+
}
|
202
|
+
autoComplete='one-time-code'
|
203
|
+
autoFocus={index + startIndex === 0}
|
204
|
+
value={values[index + startIndex] || ''}
|
205
|
+
disabled={props.disabled}
|
206
|
+
onChange={handleChange}
|
207
|
+
onKeyUp={handleKeyUp}
|
208
|
+
onFocus={handleFocus}
|
209
|
+
onBlur={() => setIsFocused(false)}
|
210
|
+
{...inputProps}
|
211
|
+
data-testid={`otp-input-${index + startIndex}`}
|
212
|
+
/>
|
213
|
+
</FormControl>
|
211
214
|
);
|
212
215
|
});
|
213
216
|
},
|