Skip to content

Releases: wh1teee/mui-otp-input

@wh1teee/mui-otp-input 8.1.0

Choose a tag to compare

@github-actions github-actions released this 05 Oct 09:27
d1e8360

@wh1teee/mui-otp-input 8.1.0

This minor release fixes input-engine defects found in an independent review,
brings the MUI and Base UI renderers closer together, and replaces the
Docusaurus site with interactive documentation.

Input fixes

  • MUI: a rejected character no longer erases the slot it was typed into;
    the value is unchanged and only onInvalid fires.
  • Both renderers: transformChar runs once per typed, pasted, or
    autofilled character. Stored values (value, defaultValue) are validated
    by position but no longer transformed again on every render.
  • Base UI: validateChar receives the real slot index for typed and pasted
    characters, and onValueChange can cancel a change with details.cancel().
  • MUI: typing after the character of a filled slot overwrites only that
    slot instead of replacing the rest of the code.
  • MUI: after length shrinks, an uncontrolled field submits only the
    visible characters.
  • Slots made read-only through TextFieldsProps or slotProps keep their
    characters on Backspace, Delete, and paste.
  • A form reset cancelled with preventDefault() no longer clears the field.
  • MUI: arrow keys follow the visual order in right-to-left layouts.

One keyboard contract

  • MUI now matches the Base UI field: Backspace deletes the slot's
    character (or the previous one when the slot is empty) and steps back, and
    only the active slot is in the tab order, so Tab moves past the whole code.
  • Both renderers keep IME composition text in the slot until composition ends
    and commit it once.
  • Characters outside the Basic Multilingual Plane, such as emoji, are rejected
    everywhere, so one slot always holds one character.
  • The MUI component still reports onComplete once on mount for a value that
    starts complete, as the original package did; the Base UI field reports
    completion only for user input.

Forms and accessibility

  • Base UI form adapter: React Hook Form marks the field touched only when
    focus leaves the whole field, not when moving between slots.
  • MUI form adapter: the error message is referenced by every slot through
    aria-describedby, not only the first.
  • Base UI: a slot's own aria-describedby is kept next to the field
    description.

MUI presentation

  • Six slots keep whole digits on phone widths: slots may shrink, side padding
    is removed, and the default gap narrows from 20px with the field.
  • TextFieldsProps.type (for example "password") is respected; mask still
    takes precedence.
  • A gap passed to MuiOtpInput replaces the default spacing in MUI 7 and 9.
  • onInvalid is typed as the field callback rather than intersecting with the
    DOM invalid handler.

Packaging and documentation

  • react and react-dom are optional peers, so /headless installs without
    React; every UI entrypoint still requires them.
  • Documentation, a configurator with generated code, a React Hook Form example,
    and a migration guide now live in the Next.js site under site/. Its type
    check, build, and Playwright/axe suite are part of pnpm ci:pr.

Public exports and renderer boundaries are unchanged. The input fixes add
roughly 200–270 bytes gzip per renderer, so entrypoint budgets are re-based on
8.1.0 with about 5% headroom: MUI 4.7 KB, Base UI and shadcn 3.65 KB, MUI +
React Hook Form 5.15 KB gzip. /headless and Base UI + React Hook Form keep
their 8.0 ceilings.

@wh1teee/mui-otp-input 8.0.1

Choose a tag to compare

@github-actions github-actions released this 21 Sep 21:53
c2b7355

@wh1teee/mui-otp-input 8.0.1

This patch moves the repository, declaration checks, examples, and exact
consumer matrix to the stable native TypeScript 7 compiler. OTP runtime bytes,
public props, renderer boundaries, keyboard behavior, autofill handling, form
semantics, and CSS contracts are unchanged from 8.0.0.

TypeScript 7 toolchain

  • tsc resolves to TypeScript 7.0.2 in the root package and docs workspace.
  • tsdown, Docusaurus, ESLint integrations, and any other tools that still embed
    the compiler API receive Microsoft's official
    @typescript/typescript6@6.0.2 compatibility package through an npm alias.
  • The compatibility package is not used for project type-checking. A dedicated
    executable contract proves the native TypeScript 7 binary, compatibility API,
    docs compiler, and exact packed consumer topology.
  • Isolated React 18/19, MUI 7/9, Base UI, React Hook Form, Next.js 16 and SSR
    consumers compile against the exact tarball using the same toolchain boundary.

This follows the TypeScript team's production guidance while TypeScript 7's
programmatic API remains unstable. It avoids holding the actual compiler on the
legacy JavaScript implementation solely for build tools that inspect TypeScript.

All existing unit, Chromium/Firefox/WebKit, automated WCAG, package boundary,
bundle budget, Next.js, docs/Storybook, OIDC provenance and registry byte-parity
gates remain mandatory.

@wh1teee/mui-otp-input 8.0.0

Choose a tag to compare

@github-actions github-actions released this 21 Sep 16:01
369b233

@wh1teee/mui-otp-input 8.0.0

This is the stable v8 release of the maintained fork. It synchronizes the MUI renderer with upstream v7, qualifies MUI 7/9 and React 18/19, and freezes renderer-independent OTP behavior for MUI and Base UI / shadcn applications.

Stable public surface

  • Existing package-root imports remain MUI-compatible; /mui is the explicit renderer alias.
  • /base-ui and /shadcn expose Base UI OTP primitives and a complete accessible field.
  • /headless provides normalization and completion utilities with no React or UI runtime.
  • Explicit React Hook Form adapters are published at /mui/react-hook-form, /base-ui/react-hook-form, and /shadcn/react-hook-form; the historical /react-hook-form path remains compatible.
  • The opt-in shadcn stylesheet is scoped to semantic data-slot selectors and defines no reset, remote asset, or global token.

Behavior retained

Delayed autofocus, transformChar, paste preprocessing, native one-time-code replacement, stable refs, empty-slot focus routing, native form submission/reset, keyboard navigation, controlled/uncontrolled ownership, and opt-in auto-submit share one behavior contract across renderers.

Bundle and Next.js proof

Exact-tarball bundle budgets keep React and app-owned UI/form peers external. Current package-owned gzip closures are approximately 0.7 KiB headless, 2.9 KiB Base UI/shadcn, 3.8 KiB MUI, 3.1 KiB Base UI + RHF, and 4.0 KiB MUI + RHF. CI rejects cross-renderer imports and size regressions.

A production Next.js 16 App Router/Turbopack consumer installs the exact tarball, builds and server-renders the shadcn field without MUI/Emotion and without transpilePackages, serverExternalPackages, or experimental optimizePackageImports configuration.

Qualification

  • 25 unit and adapter tests plus Chromium, Firefox, and WebKit typing, paste, autofill replacement, focus, form, narrow viewport, and automated WCAG checks.
  • Strict declaration and SSR/runtime consumers from the exact tarball.
  • MUI 7 + React 18 and MUI 9 + React 19 matrices.
  • Base UI consumers without MUI/Emotion and MUI consumers without Base UI.
  • Byte-identical npm registry artifact and provenance/signature verification through trusted OIDC publication.

Stable publication and npm latest promotion were explicitly authorized by the package owner on 2026-09-21.

@wh1teee/mui-otp-input 8.0.0-next.0

Pre-release

Choose a tag to compare

@github-actions github-actions released this 21 Sep 03:00
1e36762

@wh1teee/mui-otp-input 8.0.0-next.0

This prerelease synchronizes the maintained fork with upstream v7 and introduces renderer-independent OTP behavior for MUI and Base UI / shadcn applications.

Included

  • Existing root imports remain MUI-compatible; /mui is the explicit alias.
  • Upstream MUI 9 support is included while MUI 7 + React 18 remains qualified.
  • /base-ui and /shadcn expose Base UI OTP primitives and a complete accessible field.
  • /headless provides UI-independent normalization utilities.
  • MUI and Base UI React Hook Form adapters are published as separate subpaths.
  • Fork behavior remains covered: delayed autofocus, character transformation, paste preprocessing, stable native refs, and empty-slot focus routing.
  • The opt-in shadcn stylesheet is scoped to semantic data-slot selectors and does not define global tokens or remote assets.

Qualification

  • Chromium, Firefox, and WebKit input, paste, autofill replacement, keyboard, form, viewport, and automated WCAG checks.
  • Strict declaration and SSR/runtime consumers from the exact tarball.
  • MUI 7 + React 18 and MUI 9 + React 19 matrices.
  • MUI consumers without Base UI installed and Base UI consumers without MUI/Emotion installed.
  • Byte-identical registry artifact and npm provenance verification in the release workflow.

This is a prerelease published under the next dist-tag. It does not replace latest.