import type { Meta, StoryObj } from '@storybook/web-components-vite'; import { html } from 'lit'; import './index.js'; import type { USAProse } from './usa-prose.js'; const meta: Meta = { title: 'Layout/Prose', component: 'usa-prose', parameters: { layout: 'padded', docs: { description: { component: ` The USA Prose component provides USWDS-styled content blocks for rich text and document formatting. It applies consistent typography, spacing, and styling to various content types, making it perfect for documentation, articles, and formatted text content. ## Features - Multiple variant options (default, condensed, expanded) - Width control (default, narrow, wide) - HTML content support via property or slot - Light DOM for USWDS CSS compatibility - Consistent typography and spacing - Accessibility-compliant semantic HTML `, }, }, }, argTypes: { variant: { control: 'select', options: ['default', 'condensed', 'expanded'], description: 'Typography variant affecting line height and spacing', }, width: { control: 'select', options: ['default', 'narrow', 'wide'], description: 'Content width variant', }, content: { control: 'text', description: 'HTML content to display (alternative to slot content)', }, }, }; export default meta; type Story = StoryObj; export const Default: Story = { args: { variant: 'default', width: 'default', }, render: (args) => html`

Content Formatting Overview

The prose component provides consistent formatting for various types of content including articles, documentation, and structured text.

Supported Content Types

  • Articles and blog posts
  • Documentation pages
  • Policy documents
  • Technical specifications
  • User guides

"Well-formatted content improves readability and user experience across all platforms."

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

Default Spacing

Application Process

The application process has been streamlined to provide better service to users. Our digital-first approach ensures faster processing times and improved accessibility.

  • Online application submission
  • Document upload portal
  • Real-time status tracking

Condensed Spacing

Application Process

The application process has been streamlined to provide better service to users. Our digital-first approach ensures faster processing times and improved accessibility.

  • Online application submission
  • Document upload portal
  • Real-time status tracking

Expanded Spacing

Application Process

The application process has been streamlined to provide better service to users. Our digital-first approach ensures faster processing times and improved accessibility.

  • Online application submission
  • Document upload portal
  • Real-time status tracking
`, }; export const AllWidths: Story = { parameters: { controls: { disable: true }, // Static demo - no interactive controls needed }, render: () => html`

Narrow Width (45ex)

This content is displayed in a narrow column, ideal for focused reading and mobile-friendly layouts. The reduced line length improves readability and comprehension for detailed information.

Default Width (68ex)

This content uses the standard reading width, optimized for most content and documentation. It provides a balanced approach between readability and efficient use of screen space.

Wide Width (85ex)

This content spans a wider column, suitable for detailed technical documentation, data tables, or content that benefits from additional horizontal space. Use this width when displaying complex information or when screen real estate allows.

`, }; export const WithHTMLContent: Story = { args: { content: `

Content via Property

This content is set via the content property rather than using slot content. This approach is useful when content is dynamically generated or comes from a content management system.

Benefits of Property-Based Content

Both slot-based and property-based content approaches are supported for maximum flexibility.

`, }, }; export const MixedContent: Story = { args: { content: '

Property content: This content was set via the content property.

', }, render: (args) => html`

Slot content: This content was provided via the slot.

Both types of content can be used together, with slot content appearing first.

`, }; 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.

`, };