import { Text } from "./index"; import { DocsPage } from "@shared/stories/DocsTemplate"; import type { Meta, StoryObj } from "@storybook/react"; const meta: Meta = { title: "Components/Text", component: Text, tags: ["autodocs"], parameters: { layout: "centered", docs: { page: DocsPage, description: { component: "A flexible text component with multiple typography variants and semantic elements.", }, }, }, argTypes: { as: { control: { type: "select" }, options: [ "h1", "h2", "h3", "h4", "h5", "h6", "p", "span", "div", "label", ], description: "HTML element to render", }, className: { control: { type: "text" }, description: "Additional CSS classes (use typography classes like body1, heading1, etc.)", }, children: { control: { type: "text" }, description: "Text content", }, }, args: { children: "Sample text content", className: "body1", as: "p", }, }; export default meta; type Story = StoryObj; // Default text export const Default: Story = { args: {}, }; // Headings export const Headings: Story = { render: () => (
Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6
), parameters: { docs: { description: { story: "All heading variants with appropriate semantic HTML elements.", }, }, }, }; // Subheadings export const Subheadings: Story = { render: () => (
Subheading 1 Subheading 2 Subheading 3
), parameters: { docs: { description: { story: "All subheading variants.", }, }, }, }; // Body text export const BodyText: Story = { render: () => (
Body 1 text is used for the main content of your application. It provides good readability and is suitable for paragraphs and longer text content. Body 2 text is slightly smaller and can be used for secondary content, descriptions, or supporting text that doesn't need as much emphasis. Body 3 text is the smallest body variant, perfect for fine print, captions, or less important information.
), parameters: { docs: { description: { story: "Body text variants for different content hierarchy levels.", }, }, }, }; // Labels export const Labels: Story = { render: () => (
Label 1
Label 2
Label 3
Label 4
), parameters: { docs: { description: { story: "Label variants commonly used with form inputs.", }, }, }, }; // Utility text export const UtilityText: Story = { render: () => (
Footnote text is used for additional information, citations, or less important details. Micro text is the smallest text variant, perfect for timestamps, version numbers, or other very small information. Unstyled text inherits all styling from its parent element.
), parameters: { docs: { description: { story: "Utility text variants for specific use cases.", }, }, }, }; // Semantic elements export const SemanticElements: Story = { render: () => (
Main Page Title Page Description This is a paragraph element that provides the main content of the page. It demonstrates how the Text component can be used with semantic HTML elements. Form Label Additional information
), parameters: { docs: { description: { story: "Examples of using different semantic HTML elements with the Text component.", }, }, }, }; // All variants showcase export const AllVariants: Story = { render: () => (

Headings

Heading 1 Heading 2 Heading 3

Body Text

Body 1 - Main content text Body 2 - Secondary content text Body 3 - Smaller content text

Labels

Label 1 Label 2 Label 3 Label 4

Utility

Footnote text Micro text
), parameters: { docs: { description: { story: "Complete showcase of all text variants in organized sections.", }, }, }, };