import type { Meta, StoryObj } from '@storybook/react-vite'; import { type ComponentMatrixCellProps, Story } from './_internal/Story'; import { Text, type TextProps } from './Text'; const meta = { component: Text, parameters: { layout: 'fullscreen', }, title: 'components/Text', } satisfies Meta; export default meta; type StoryDefinition = StoryObj; type TextTone = NonNullable; type TextVariant = NonNullable; const VARIANT_ROWS: { key: TextVariant; label: string }[] = [ { key: 'h1', label: 'H1' }, { key: 'h2', label: 'H2' }, { key: 'h3', label: 'H3' }, { key: 'h4', label: 'H4' }, { key: 'lead', label: 'Lead' }, { key: 'body', label: 'Body' }, { key: 'small', label: 'Small' }, { key: 'code', label: 'Code' }, ]; const TONE_COLUMNS: { key: TextTone; label: string }[] = [ { key: 'primary', label: 'Primary' }, { key: 'muted', label: 'Muted' }, { key: 'destructive', label: 'Destructive' }, ]; const WEIGHT_ROWS: { key: NonNullable; label: string }[] = [ { key: 'normal', label: 'Normal' }, { key: 'bold', label: 'Bold' }, ]; function ToneCell({ column, row }: ComponentMatrixCellProps) { return ( Sample text ); } function WeightCell({ column, row }: ComponentMatrixCellProps) { return ( }> {column.label} weight ); } export const All: StoryDefinition = { render: () => (
{VARIANT_ROWS.map(({ key, label }) => (
{label} {key === 'code' ? 'npm install pickle-ui' : 'The quick brown fox jumps over the lazy dog.'}
))}
This is a very long line of text that will be truncated because there is not enough horizontal space to display it all.
h2 styles on an <h1> element Body copy rendered as a <div> Small muted text rendered as a <label>
), };