import type { Meta, StoryObj } from '@storybook/web-components-vite'; import { html } from 'lit'; import './index.js'; import type { USAList } from './usa-list.js'; const meta: Meta = { title: 'Data Display/List', component: 'usa-list', parameters: { layout: 'padded', docs: { description: { component: ` The USA List component organizes information into discrete sequential sections using semantic HTML lists. It supports both ordered and unordered lists with proper accessibility features and styling. ## Features - Semantic HTML with proper list structure - Ordered and unordered list types - Unstyled variant for custom layouts - Nested list support with proper styling - Full accessibility compliance `, }, }, }, argTypes: { type: { control: { type: 'select' }, options: ['unordered', 'ordered'], description: 'List type - unordered (ul) or ordered (ol)', }, unstyled: { control: { type: 'boolean' }, description: 'Remove default list styling', }, }, }; export default meta; type Story = StoryObj; export const Default: Story = { args: { type: 'unordered', unstyled: false, }, render: (args) => html`
  • First item in the list
  • Second item in the list
  • Third item in the list
  • Fourth item in the list
  • `, }; export const UnorderedList: Story = { parameters: { controls: { disable: true }, // Static demo - no interactive controls needed docs: { description: { story: 'Example of mixed nested lists with both ordered and unordered sub-lists.', }, }, }, render: () => html`
  • Item without specific order
  • Another unordered item
  • Yet another item
  • Final unordered item
  • `, }; export const OrderedList: Story = { parameters: { controls: { disable: true }, // Static demo - no interactive controls needed }, render: () => html`
  • First step in the process
  • Second step in the process
  • Third step in the process
  • Fourth step in the process
  • `, }; export const UnstyledList: Story = { parameters: { controls: { disable: true }, // Static demo - no interactive controls needed }, render: () => html`
  • No bullet points or indentation
  • Clean presentation without default styling
  • Still maintains semantic structure
  • Good for custom-styled lists
  • `, }; export const NestedLists: Story = { parameters: { controls: { disable: true }, // Static demo - no interactive controls needed }, render: () => html`
  • Parent item with nested content
    • Nested item one
    • Nested item two
    • Nested item three
  • Another parent item
    • Another nested item
    • More nested content
  • Simple parent item without nesting
  • `, }; export const MixedNestedLists: Story = { parameters: { controls: { disable: true }, // Static demo - no interactive controls needed }, render: () => html`
  • Main process step
    • Sub-task A
    • Sub-task B
    • Sub-task C
  • Next main step
    1. Ordered sub-step 1
    2. Ordered sub-step 2
  • Final main step
  • `, }; export const InteractiveDemo: Story = { parameters: { controls: { disable: true }, // Static demo - no interactive controls needed docs: { description: { story: 'Interactive demonstration showing dynamic list manipulation and property changes.', }, }, }, render: () => html`

    Interactive List Demo

  • Dynamic list item 1
  • Dynamic list item 2
  • Dynamic list item 3
  • Dynamic list item 4
  • `, }; export const AccessibilityShowcase: Story = { parameters: { controls: { disable: true }, // Static demo - no interactive controls needed docs: { description: { story: 'Demonstrates accessibility features and screen reader behavior with lists.', }, }, }, render: () => html`

    Accessibility Features

    Lists provide semantic structure that helps screen readers and other assistive technology:

    Screen Reader Announcement:

    "List with 4 items" - announced when entering the list

    "List item 1 of 4" - announced for each item

    Contact Information (Unordered)

  • Phone: 1-800-555-0123
  • Email: info@example.com
  • Address: 1234 Main Street, City, State 12345
  • Office Hours: Monday-Friday, 8:00 AM - 5:00 PM EST
  • Application Submission Steps (Ordered)

  • Complete the online application form
  • Upload required documentation
  • Submit application before deadline
  • Wait for confirmation email
  • Track application status online
  • `, }; 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.

    `, };