import type { ComponentMeta, ComponentStory } from '@storybook/react'; import { List, type ListProps } from './list'; import { ListItem } from './list-item'; /** * List - Storybook Meta */ export default { title: 'Atoms/Lists', component: List, args: {}, argTypes: { className: { control: { type: 'text', }, description: 'Set additional classnames to the list wrapper', table: { category: 'Styles', }, type: { name: 'string', required: false, }, }, }, } as ComponentMeta; const Template: ComponentStory = < O extends boolean, H extends boolean, >( args: ListProps ) => ; /** * List Stories - Hierarchical list */ export const Hierarchical = Template.bind({}); Hierarchical.args = { children: [ Item 1 Subitem 1 Subitem 2 , Item 2 Subitem 1 Subitem 2 Nested item 1 Nested item 2 Subitem 3 , Item 3, ], isHierarchical: true, }; /** * List Stories - Ordered list */ export const Ordered = Template.bind({}); Ordered.args = { children: [ Item 1 Subitem 1 Subitem 2 , Item 2 Subitem 1 Subitem 2 Nested item 1 Nested item 2 Subitem 3 , Item 3, ], isOrdered: true, }; /** * List Stories - Unordered list */ export const Unordered = Template.bind({}); Unordered.args = { children: [ Item 1 Subitem 1 Subitem 2 , Item 2 Subitem 1 Subitem 2 Nested item 1 Nested item 2 Subitem 3 , Item 3, ], }; const items = [ { id: 'item-1', label: 'Item 1' }, { id: 'item-2', label: 'Item 2' }, { id: 'item-3', label: ( <> Item 3 Subitem 1 Subitem 2 ), }, { id: 'item-4', label: 'Item 4' }, { id: 'item-5', label: 'Item 5' }, ]; /** * List Stories - Inline and ordered list */ export const InlineOrdered = Template.bind({}); InlineOrdered.args = { children: items.map((item) => ( {item.label} )), isInline: true, isOrdered: true, spacing: 'sm', }; /** * List Stories - Inline and unordered list */ export const InlineUnordered = Template.bind({}); InlineUnordered.args = { children: items.map((item) => ( {item.label} )), isInline: true, spacing: 'sm', }; /** * List Stories - Ordered list without marker */ export const OrderedHideMarker = Template.bind({}); OrderedHideMarker.args = { children: items.map((item) => ( {item.label} )), hideMarker: true, isOrdered: true, }; /** * List Stories - Unordered list without marker */ export const UnorderedHideMarker = Template.bind({}); UnorderedHideMarker.args = { children: items.map((item) => ( {item.label} )), hideMarker: true, };