import type { Meta, StoryObj } from "@storybook/nextjs" import { PageLoader } from "./PageLoader" const meta = { title: "Components/PageLoader", component: PageLoader, parameters: { layout: "centered", docs: { description: { component: "Modern loading spinner with ResponsiveValue support, multiple display modes, and semantic tones.", }, }, }, tags: ["autodocs"], argTypes: { label: { control: "text", description: "Loading text label for accessibility", }, emphasis: { control: "select", options: ["subtle", "normal", "strong"], description: "Visual emphasis level", }, tone: { control: "select", options: ["neutral", "accent", "positive", "critical"], description: "Semantic tone", }, size: { control: "select", options: ["xs", "sm", "md", "lg", "xl"], description: "Component size", }, speed: { control: "select", options: ["slow", "normal", "fast"], description: "Animation speed", }, display: { control: "select", options: ["inline", "block", "overlay"], description: "Display mode", }, withBackdrop: { control: "boolean", description: "Show with backdrop (for overlay mode)", }, }, } satisfies Meta export default meta type Story = StoryObj export const Default: Story = { args: { label: "Loading", }, } export const Sizes: Story = { render: () => (
), } export const Tones: Story = { render: () => (

Neutral

Accent

Positive

Critical

), } export const EmphasisLevels: Story = { render: () => (

Subtle

Normal

Strong

), } export const Speeds: Story = { render: () => (

Slow

Normal

Fast

), } export const WithLabel: Story = { render: () => (
), } export const DisplayModes: Story = { render: () => (

Inline

Text before text after

Block

Overlay (shown in button demo)

), } export const ResponsiveExample: Story = { args: { size: { mobile: "sm", tablet: "md", desktop: "lg", }, emphasis: { mobile: "subtle", tablet: "normal", desktop: "strong", }, tone: "accent", label: "Responsive loader", }, parameters: { docs: { description: { story: "Loader that changes size and emphasis based on viewport. Resize to see changes.", }, }, }, } export const UseCases: Story = { render: () => (

Form Submission

Data Processing

Critical Operation

), }