import type { Meta, StoryObj } from '@storybook/react'; import React, { useState } from 'react'; import { Tabs, TabList, Tab, TabPanels, TabPanel } from '../index'; import { Callout } from '../../Callout'; import { Icon } from '../../Icon'; import { Tag } from '../../Tag'; import styles from './TabsStories.module.css'; import { SnapshotContainer } from '../../../test-utils/SnapshotsContainer'; const meta: Meta = { title: 'Navigation/Tabs', component: Tabs, parameters: { chromatic: { delay: 300, diffThreshold: 0.5, } /* Size of indicitor is flaky */, }, }; export default meta; type Story = StoryObj; export const Default: Story = { render: (args) => ( Tab One Tab Two Tab Three First panel Second panel Third panel ), }; export const TabsWithDefaultTab: Story = { args: { defaultTabIndex: 2, }, render: Default.render, }; export const TabListAtTheBottom: Story = { render: (args) => ( First panel Second panel Third panel Tab One Tab Two Tab Three ), }; export const TabWithIcon: Story = { render: (args) => ( Tab One Tab Two Tab Three First panel Second panel Third panel ), }; export const TabWithTag: Story = { render: (args) => ( Tab One Tab Two Tab Three 3 First panel Second panel Third panel ), }; export const FittedTabs: Story = { render: (args) => ( Tab One Tab Two Tab Three First panel Second panel Third panel ), }; export const ControlledTabs: Story = { render: (args) => { const [value, setValue] = useState(2); return (
Tab One Tab Two Tab Three First panel Second panel Third panel
); }, }; export const Snapshot: Story = { parameters: { chromatic: { disableSnapshot: false }, }, render: () => ( ), };