Skip to content

[Phase 2] Modal Plugin #40

Description

@prosdev

Description

Implement modal plugin with full accessibility support (focus trap, ARIA, keyboard handling) for high-attention experiences like exit intent.

Tasks

  • Create packages/plugins/src/modal/ directory structure
  • Define TypeScript types (types.ts)
  • Implement core modal plugin (modal.ts)
    • Overlay/backdrop rendering
    • Dialog content rendering
    • Focus trap implementation
    • Keyboard event handlers (Escape, Tab)
    • ARIA attribute management
  • Add default CSS styles
  • Export from packages/plugins/src/index.ts
  • Auto-register in packages/core/src/runtime.ts

Acceptance Criteria

  • Modal renders with overlay backdrop
  • Focus trap works (Tab cycles within modal)
  • Escape key closes modal
  • Backdrop click closes modal (configurable)
  • ARIA attributes present (role="dialog", aria-modal="true")
  • First focusable element receives focus on open
  • Focus returns to trigger element on close
  • Mobile responsive
  • Body scroll prevented when modal open
  • Multiple modals supported
  • Emits standard events (shown, action, dismissed)

Estimate: 2 days

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions