import type { Meta, StoryObj } from '@storybook/react' import { Typography } from '../Typography' import { Section } from './Section' export default { title: 'Layout/Section', component: Section, parameters: { layout: 'fullscreen', }, argTypes: { variant: { control: { type: 'select' }, options: ['default', 'alt'], description: 'The visual variant of the section', }, border: { control: { type: 'boolean' }, description: 'Whether to show a top border', }, width: { control: { type: 'select' }, options: ['default', 'fluid', 'narrow'], description: 'The width constraint of the section content', }, fluid: { control: { type: 'boolean' }, description: 'Deprecated: use width="fluid" instead', }, className: { control: { type: 'text' }, description: 'Additional CSS classes', }, children: { control: false, description: 'The content to render inside the section', }, }, args: { variant: 'default', border: false, width: 'default', fluid: false, className: '', }, } satisfies Meta type Story = StoryObj export const Default: Story = { args: { variant: 'default', border: false, width: 'default', }, render: (args) => (
Section Title This is a default section with standard width constraints. The content is centered and has a maximum width for optimal readability.
), } export const AltVariant: Story = { args: { variant: 'alt', border: true, width: 'default', }, render: (args) => (
Alternative Section This section uses the alt variant with a background color and top border. It's useful for creating visual separation between sections.
), } export const FluidWidth: Story = { args: { variant: 'default', border: false, width: 'fluid', }, render: (args) => (
Fluid Width Section This section uses fluid width, allowing content to span the full width of the viewport without container constraints.
), } export const NarrowWidth: Story = { args: { variant: 'default', border: false, width: 'narrow', }, render: (args) => (
Narrow Width Section This section uses narrow width constraints, perfect for focused content that benefits from a more constrained reading width.
), } export const WithBorder: Story = { args: { variant: 'default', border: true, width: 'default', }, render: (args) => (
Section with Border This section has a top border enabled, creating a clear visual separation from the content above.
), } export const MultipleSections: Story = { args: { variant: 'default', border: true, width: 'default', }, render: (args) => ( <>
First Section This is the first section using the alt variant without a border.
Second Section This section uses the default variant with a border enabled.
Third Section This section uses the alt variant with a border for maximum separation.
Fourth Section This is the final section demonstrating the pattern.
), } export const Interactive: Story = { args: { variant: 'default', border: false, width: 'default', className: '', }, render: (args) => (
Interactive Section Use the Controls panel to experiment with different section variants, borders, and width options. This story demonstrates all the available props and their effects.
Current props: variant="{args.variant}", border= {args.border?.toString() ?? 'false'}, width="{args.width}"
), }