feat: OtpInput#7129
Merged
hevele-moda merged 1 commit intomainfrom Apr 20, 2026
Merged
Conversation
Contributor
hevele-moda
commented
Apr 20, 2026
robertmihaiman
approved these changes
Apr 20, 2026
There was a problem hiding this comment.
Pull request overview
Adds a new OTP input component to the design system, wiring it into the components barrel exports and introducing a third-party OTP input dependency.
Changes:
- Added
OtpInputcomponent wrapper aroundreact-otp-inputwith SCSS styling. - Added Storybook stories and Jest tests for
OtpInput. - Added a global
JSX.Elementtype override and introducedreact-otp-inputas a dependency (with lockfile updates).
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/global.d.ts | Introduces a global JSX typing override. |
| src/components/index.ts | Exports the new OtpInput component from the components barrel. |
| src/components/OtpInput/index.ts | Adds a local barrel export for OtpInput. |
| src/components/OtpInput/OtpInput.tsx | Implements the OtpInput wrapper around react-otp-input. |
| src/components/OtpInput/OtpInput.test.tsx | Adds basic rendering and typing behavior tests. |
| src/components/OtpInput/OtpInput.stories.tsx | Adds Storybook stories for default/variant states. |
| src/components/OtpInput/OtpInput.scss | Adds layout + input styling for the OTP fields. |
| package.json | Adds react-otp-input dependency. |
| package-lock.json | Updates lockfile for the new dependency (and additional metadata churn). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+39
to
+45
| export const OtpInput: React.FC<OtpInputProps> = ({ | ||
| 'aria-describedby': ariaDescribedBy, | ||
| 'aria-label': ariaLabel, | ||
| autoComplete = 'one-time-code', | ||
| className, | ||
| disabled, | ||
| error, |
Comment on lines
+62
to
+91
| <ReactOtpInput | ||
| containerStyle={classNames('OtpInput', className)} | ||
| inputType={inputType} | ||
| numInputs={numInputs} | ||
| onChange={onChange} | ||
| onPaste={onPaste} | ||
| placeholder={placeholder} | ||
| renderSeparator={renderSeparator} | ||
| shouldAutoFocus={shouldAutoFocus} | ||
| skipDefaultStyles | ||
| value={value} | ||
| renderInput={(inputProps: ReactOtpInputInputProps, index: number) => ( | ||
| <input | ||
| {...inputProps} | ||
| id={id ? `${id}-${index + 1}` : undefined} | ||
| autoComplete={autoComplete} | ||
| aria-describedby={ariaDescribedBy} | ||
| aria-invalid={error ? true : undefined} | ||
| aria-label={getInputAriaLabel(index, numInputs, ariaLabel, label)} | ||
| className={classNames(inputProps.className, 'OtpInput__input', inputClassName, { | ||
| 'OtpInput__input--disabled': disabled, | ||
| 'OtpInput__input--error': error, | ||
| 'OtpInput__input--focus': focus | ||
| })} | ||
| disabled={disabled} | ||
| name={name} | ||
| required={required} | ||
| /> | ||
| )} | ||
| /> |
Comment on lines
63
to
+65
| "proportional-scale": "^4.0.0", | ||
| "react-focus-on": "^3.10.2", | ||
| "react-otp-input": "^3.1.1", |
moda-automation-devops
pushed a commit
that referenced
this pull request
Apr 20, 2026
# [21.9.0](21.8.0...21.9.0) (2026-04-20) ### Features * OtpInput ([#7129](#7129)) ([96d0ec5](96d0ec5))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.