@moda/om 21.9.0 → 21.10.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moda/om",
3
- "version": "21.9.0",
3
+ "version": "21.10.0",
4
4
  "description": "Moda Operandi design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -56,39 +56,43 @@ export const OtpInput: React.FC<OtpInputProps> = ({
56
56
  renderSeparator,
57
57
  required,
58
58
  shouldAutoFocus,
59
- value = ''
59
+ value = '',
60
+ ...rest
60
61
  }) => {
61
62
  return (
62
- <ReactOtpInput
63
- containerStyle={classNames('OtpInput', className)}
64
- inputType={inputType}
65
- numInputs={numInputs}
66
- onChange={onChange}
67
- onPaste={onPaste}
68
- placeholder={placeholder}
69
- renderSeparator={renderSeparator}
70
- shouldAutoFocus={shouldAutoFocus}
71
- skipDefaultStyles
72
- value={value}
73
- renderInput={(inputProps: ReactOtpInputInputProps, index: number) => (
74
- <input
75
- {...inputProps}
76
- id={id ? `${id}-${index + 1}` : undefined}
77
- autoComplete={autoComplete}
78
- aria-describedby={ariaDescribedBy}
79
- aria-invalid={error ? true : undefined}
80
- aria-label={getInputAriaLabel(index, numInputs, ariaLabel, label)}
81
- className={classNames(inputProps.className, 'OtpInput__input', inputClassName, {
82
- 'OtpInput__input--disabled': disabled,
83
- 'OtpInput__input--error': error,
84
- 'OtpInput__input--focus': focus
85
- })}
86
- disabled={disabled}
87
- name={name}
88
- required={required}
89
- />
90
- )}
91
- />
63
+ <>
64
+ <input type='hidden' name={name} value={value} />
65
+ <ReactOtpInput
66
+ {...rest}
67
+ containerStyle={classNames('OtpInput', className)}
68
+ inputType={inputType}
69
+ numInputs={numInputs}
70
+ onChange={onChange}
71
+ onPaste={onPaste}
72
+ placeholder={placeholder}
73
+ renderSeparator={renderSeparator}
74
+ shouldAutoFocus={shouldAutoFocus}
75
+ skipDefaultStyles
76
+ value={value}
77
+ renderInput={(inputProps: ReactOtpInputInputProps, index: number) => (
78
+ <input
79
+ {...inputProps}
80
+ id={id ? `${id}-${index + 1}` : undefined}
81
+ autoComplete={autoComplete}
82
+ aria-describedby={ariaDescribedBy}
83
+ aria-invalid={error ? true : undefined}
84
+ aria-label={getInputAriaLabel(index, numInputs, ariaLabel, label)}
85
+ className={classNames(inputProps.className, 'OtpInput__input', inputClassName, {
86
+ 'OtpInput__input--disabled': disabled,
87
+ 'OtpInput__input--error': error,
88
+ 'OtpInput__input--focus': focus
89
+ })}
90
+ disabled={disabled}
91
+ required={required}
92
+ />
93
+ )}
94
+ />
95
+ </>
92
96
  );
93
97
  };
94
98