Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

2.0.0 · 2026-07-30

First stable release of the awaitable, typed modal system.

Breaking

  • Replaced the global modalStore and module augmentation API with isolated systems created by createModalSystem().
  • Replaced injected flat modal props with ModalRenderProps<Input, Result>.
  • Changed ModalProvider registration from modals to system.

Added

  • Added typed, awaitable open() outcomes with explicit cancellation reasons.
  • Added stack, replace, and singleton orchestration policies.
  • Added headless dialog, drawer, and sheet motion presets.
  • Added automatic reduced-motion rendering and provider-unmount cancellation.
  • Added a v1-to-v2 migration guide and typed-flow examples.

Changed

  • Made the distributed stylesheet structural and headless; applications now own backdrop color, surface styling, spacing, and shadows.
  • Separated business input from per-open rendering and interaction options.

1.4.0 · 2026-07-30

Fixed

  • Bound injected close handlers to modal instance IDs, so repeated modal names close the correct instance.
  • Made closing an empty or missing modal a safe no-op and prevented rapid repeated close actions from throwing.
  • Made closeAllModal() invoke each open modal's onClose callback once.
  • Fixed modals opened before ModalProvider mounts so the portal renders after the body root is available.
  • Added a real Tab focus trap, accessible dialog naming props, and inactive-dialog isolation for stacked modals.
  • Allowed oversized modal bodies to scroll instead of clipping their content.
  • Prevented edge and corner positions from squeezing modal bodies into half or quarter viewports on smaller screens.
  • Prevented horizontal scrollbars from flashing while positioned modals animate into view.

Added

  • Exported the full public type surface, including Params, BaseModalParams, ModalConfig, and ModalInitialParams.
  • Added Chromium browser regression tests for portal rendering, focus containment, accessible names, and responsive modal placement.

Changed

  • Docs deployment now triggers on documentation changes to main (and manual dispatch) instead of tag pushes, because the GitHub Pages environment does not allow tag-based deployments.
  • Release publishing now runs lint, type checks, unit tests, browser tests, build, and package verification before publishing.
  • Trusted publishing now uses Node 24 and a compatible npm 11 release instead of upgrading to an incompatible npm major.

1.3.2 · 2026-06-27

Fixed

  • Fixed onClose firing twice when a modal is closed by clicking outside it; the store is now the single source of truth for the callback.
  • Fixed closeModal(name) leaving active pointing at the wrong modal when a non-topmost modal is closed by name.
  • Enforced the documented closeOnPressEsc default of true; pressing Escape now closes the topmost modal unless explicitly disabled.
  • Synced the blur JSDoc default with its runtime default (true).
  • Fixed API documentation headings so inline code titles keep the gradient text treatment without showing an inline-code background.

Added

  • Accessibility baseline: dialogs now render with role="dialog" and aria-modal="true", lock background scroll while open, move focus into the active dialog on open, and restore focus to the trigger when the stack empties.
  • Unit tests for the modal store.
  • A Husky pre-commit hook that runs Biome format + lint on staged files.
  • An apps/example Vite app that imports the library source for local testing.

Changed

  • Externalized motion and zustand from the published bundle so peer dependencies are no longer duplicated, reducing package size.
  • Declared sideEffects for the stylesheet and removed the vestigial path dependency and an invalid require export map entry.
  • The docs site now rebuilds only on tag pushes or when documentation files change.

1.3.1 · 2026-06-05

Changed

  • Switched the library version bump scripts to Yarn and removed the root package-lock.json from the repository and future commits.
  • Updated the published package homepage to point to the GitHub Pages documentation site.
  • Restored the Turbo task pipeline and added a dedicated check-types script for the library workspace so CI can run type checks again.
  • Restored the default click-outside behavior so clicking the backdrop closes a modal unless it is explicitly disabled.
  • Added a root LICENSE file so repository and package tooling can detect the MIT license from the monorepo root.

1.3.0 · 2026-06-01

Changed

  • Converted the repository to a Turbo monorepo with apps/library, apps/document, and shared TypeScript config packages.
  • Moved the published library source, package metadata, README, license, and security files into apps/library.
  • Replaced the root Prettier setup with a root-level Biome setup and wired lint / format scripts through the workspaces.
  • Added a Docusaurus documentation site in apps/document, including API, guide, getting started, and changelog pages.
  • Added GitHub Pages deployment for the docs site and updated CI workflows to build from the monorepo layout.
  • Renamed store and provider entrypoints to src/stores/modal.ts and src/providers/modal.tsx, and updated public exports accordingly.
  • Renamed type files to shorter names such as base-modal-params.ts, modal-components.ts, and modal-state.ts.
  • Removed the bundled example app source from src/example and the unused example stylesheet from the package source.
  • Extracted modal class-name and body animation helpers into src/utils, and moved modal animation constants and z-index constants into src/configs/constant.ts.
  • Replaced uuid, keyboardjs, and clsx usage with built-in JavaScript and DOM APIs, removing those packages from runtime dependencies.
  • Updated the README install note and examples to reflect the current modalStore API and peer dependency expectations.

1.2.8 · 2026-06-01

Added

  • Added GitHub Actions workflows for CI and npm publishing with provenance.
  • Added a SECURITY.md policy and an MIT LICENSE file to document release and security expectations.
  • Added release:check and ci scripts to validate release artifacts and CI builds consistently.
  • Added npm, bundle, type, issue, and Socket badges to the README.

Changed

  • Documented the trusted publishing release flow in the README.
  • Replaced the manual local publish script with a CI-oriented release verification script.

1.2.6 · 2026-05-31

Changed

  • Removed Tailwind CSS and the Tailwind Vite plugin from package dependencies.
  • Replaced the example app Tailwind utilities with plain CSS classes.
  • Moved modal default layout to main.css with zero-specificity selectors so consumer classes can override defaults without !important.
  • Added modal positions: top, top-left, top-right, top-center, left, right, bottom, bottom-left, bottom-right, bottom-center, center, and center-full.
  • Added default position-aware body animations for edge and corner placements.

1.2.5 · 2026-05-30

Fixed

  • Removed Tailwind CSS injection from the distributed library build.
  • Moved Tailwind CSS import to the example app only.
  • Replaced internal modal layout Tailwind classes with inline styles to avoid overriding consumer app utilities.

1.2.4 · 2025-05-30

Changed

  • Split modal.type.ts into separate files for better maintainability.
  • base-modal-params.type.ts handled base modal parameter types.
  • modal-components.type.ts handled modal component and config types.
  • modal-state.type.ts handled modal state and action types.
  • modal.type.ts re-exported all types for backward compatibility.
  • Bumped dependencies such as motion, zustand, vite, tailwindcss, biome, and playwright.

1.2.3 · 2025-05-30

Fixed

  • Fixed ModalParams so it correctly extends ModalDefinition[T] with closeModal.
  • Updated dependencies for stability.

1.2.2 · 2025-11-21

Added

  • Enhanced TypeScript documentation with comprehensive JSDoc comments.
  • Added more detailed examples for modal animations and positioning.
  • Improved documentation for the blur effect parameter.
  • Added more complete examples for ModalComponent and ModalConfig.

Changed

  • Improved type documentation with more realistic usage examples.
  • Expanded Framer Motion animation configuration documentation.
  • Clarified modal positioning options.

Fixed

  • Type definitions now import required dependencies correctly.
  • Documentation examples now match the current API.