Skip to content

v2.0.0 — accessible dialog, modern toolchain, cleaned-up API

Latest

Choose a tag to compare

@Guillaume-da Guillaume-da released this 01 Aug 09:16
· 30 commits to master since this release
6876738

v2 is a full modernization: accessible dialog, current toolchain, cleaned-up API.

📦 npm: https://www.npmjs.com/package/react-tailwind-flex-modal

⚠️ Breaking changes

  • The stylesheet moved from dist/index.css to the react-tailwind-flex-modal/styles.css export and is no longer pulled in as a side effect of importing the component:
    import 'react-tailwind-flex-modal/styles.css'
  • Tailwind 4 is required.
  • The package is now ESM-first with an exports map (CJS still available).

The v1 prop names still work — they are marked @deprecated and resolve to the new API — so existing consumers keep running once the CSS import is updated. See the migration table in the README.

♿ Accessibility

  • Renders through a portal so no clipping or stacking parent can hide the modal.
  • role="dialog" + aria-modal, labelled and described by title and message.
  • Traps Tab/Shift+Tab, focuses the close button on open (never the destructive one), restores focus to the opener on unmount.
  • Locks body scroll, restoring the previous overflow rather than clearing it.
  • Dismisses on backdrop click, opt out with closeOnBackdropClick.

🐛 Fixes

  • Resolved ./Modal/Modal.jsx import Jest could not handle.
  • Replaced the placeholder test with a real suite (38 tests).
  • Approval handlers are now optional; a simple modal no longer fails to typecheck.
  • Fixed rose-600 typo (##E11D48), npm badge, fomModal typo, and two documented defaults that disagreed with the code.
  • Added the MIT LICENSE file the manifest already claimed.

🔧 Toolchain

  • microbundle-crltsup (ESM + CJS + d.ts), react-scripts → Vitest.
  • Tailwind 2 → 4, deleting ~170 hand-copied colour definitions.
  • TypeScript 5.9 strict, ESLint 9 flat config, React 18 || 19 peer range.
  • Inlined the warning icon as SVG, dropping the react-icons runtime dependency.
  • Travis → GitHub Actions; examples app migrated from CRA to Vite.
  • 1920 packages → 449; 208 vulnerabilities (12 critical) → 1 low, dev-only.

Full Changelog: v1.9.3...v2.0.0