Skip to content

feat: OtpInput#7129

Merged
hevele-moda merged 1 commit intomainfrom
ECX-171
Apr 20, 2026
Merged

feat: OtpInput#7129
hevele-moda merged 1 commit intomainfrom
ECX-171

Conversation

@hevele-moda
Copy link
Copy Markdown
Contributor

image

Copilot AI review requested due to automatic review settings April 20, 2026 11:28
@hevele-moda hevele-moda requested a review from a team as a code owner April 20, 2026 11:28
@hevele-moda hevele-moda merged commit 96d0ec5 into main Apr 20, 2026
5 checks passed
@hevele-moda hevele-moda deleted the ECX-171 branch April 20, 2026 11:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 OtpInput component wrapper around react-otp-input with SCSS styling.
  • Added Storybook stories and Jest tests for OtpInput.
  • Added a global JSX.Element type override and introduced react-otp-input as 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 thread package.json
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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants