import type { Meta, StoryObj } from '@storybook/web-components-vite'; import { html } from 'lit'; import './index.ts'; import type { USAProcessList } from './usa-process-list.js'; const meta: Meta = { title: 'Layout/Process List', component: 'usa-process-list', parameters: { layout: 'padded', docs: { description: { component: ` The USA Process List component provides an accessible, numbered list for displaying step-by-step processes using official USWDS styling. Perfect for applications requiring clear procedural documentation and user guidance. **Use Cases:** - Application processes - Enrollment procedures - Registration workflows - Emergency response procedures - Compliance steps - Service registration guides - Document submission processes `, }, }, }, argTypes: { items: { control: 'object', description: 'Array of process steps with heading and content', }, headingLevel: { control: 'select', options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'], description: 'Heading level for process step titles', }, }, }; export default meta; type Story = StoryObj; export const Default: Story = { args: { items: [ { heading: 'Start your application', content: 'Visit our website and create an account to begin the application process.', }, { heading: 'Submit required documents', content: 'Upload all necessary documentation through our secure portal.', }, { heading: 'Receive confirmation', content: 'You will receive an email confirmation with your application reference number.', }, ], headingLevel: 'h4', }, }; export const WithCustomContent: Story = { parameters: { controls: { disable: true }, // Static demo - no interactive controls needed }, render: () => html`

Emergency Evacuation Procedures

In case of emergency, follow these steps:

  1. Remain calm

    Do not panic. Listen for instructions from emergency personnel.

  2. Evacuate immediately

    Leave the building using the nearest emergency exit. Do not use elevators.

    Important: Help those who need assistance but do not put yourself in danger.
  3. Go to assembly point

    Proceed to the designated emergency assembly point for your building.

    Map showing assembly points
  4. Wait for all-clear

    Remain at the assembly point until emergency personnel give the all-clear signal.

`, }; export const DifferentHeadingLevels: Story = { parameters: { controls: { disable: true }, // Static demo - no interactive controls needed }, render: () => html`

Heading Level Examples

H2 Headings

H3 Headings (Recommended for most uses)

H5 Headings (For nested processes)

`, }; export const InteractiveDemo: Story = { parameters: { controls: { disable: true }, // Static demo - no interactive controls needed }, render: () => html`

Build Your Own Process List

Preview:

Interactive Process Builder

Add your own process steps above to see how the component renders them. HTML content is supported in the content field.
`, }; export const AccessibilityDemo: Story = { args: { items: [ { heading: 'Screen reader compatible', content: 'The ordered list structure provides natural navigation for screen readers, announcing step numbers automatically.', }, { heading: 'Proper heading hierarchy', content: "Configurable heading levels ensure the process list fits properly within your page's heading structure.", }, { heading: 'Semantic HTML', content: 'Uses ordered lists (
    ) and list items (
  1. ) for proper document structure and accessibility.', }, { heading: 'Keyboard navigation', content: 'All content is accessible via keyboard navigation. Interactive elements within steps maintain proper focus management.', }, ], headingLevel: 'h3', }, render: (args) => html`

    Accessibility Features

    The Process List component is designed with accessibility in mind, meeting WCAG 2.1 AA standards.

    Testing Tips

    • Use a screen reader to navigate through the process steps
    • Check that step numbers are announced properly
    • Verify heading levels match your page hierarchy
    • Test keyboard navigation through any interactive content
    `, }; export const CustomContent: Story = { parameters: { controls: { disable: true }, docs: { description: { story: 'Demonstrates using the default slot for custom content.', }, }, }, render: () => html`

    This is custom slotted content.

    Slots allow you to provide your own HTML content to the component.

    `, };