import { Meta, StoryObj } from '@storybook/react-webpack5'; import Header, { type HeaderProps } from './Header'; import { withVariantConfig } from '../../.storybook/helpers'; const meta: Meta = { component: Header, tags: ['!autodocs', '!manifest'], title: 'Typography/Header/Tests', }; export default meta; type Story = StoryObj; const TestComponent = () => (
Placeholder component
); const BaseLevelStory: Story = { render: (args) => { return ( <> {(['legend', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as HeaderProps['as'][]).map((tag) => { const Wrapper = tag === 'legend' ? 'fieldset' : 'section'; return (
); })} ); }, }; export const GroupTrailingSpace: Story = { ...BaseLevelStory, args: { ...BaseLevelStory.args, level: 'group', }, }; export const GroupTrailingSpaceWithAction: Story = { ...BaseLevelStory, args: { ...BaseLevelStory.args, level: 'group', action: { text: 'Action', href: '#target' }, }, }; export const SectionTrailingSpace: Story = { ...BaseLevelStory, args: { ...BaseLevelStory.args, level: 'section', }, }; export const SectionTrailingSpaceWithAction: Story = { ...BaseLevelStory, args: { ...BaseLevelStory.args, level: 'section', action: { text: 'Action', href: '#target' }, }, }; export const AllVariants: Story = { ...withVariantConfig(['default', 'dark', 'bright-green', 'forest-green', 'rtl'], { parameters: { padding: '0', }, }), render: () => (
{(['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'legend'] as const).map((as) => (
))} {(['section', 'group'] as const).map((level) => (
))}
alert('Action clicked!'), }} />
), };