// // Copyright 2023 DXOS.org // import '@dxos-theme'; import { type StoryObj } from '@storybook/react'; import React, { useState } from 'react'; import { faker } from '@dxos/random'; import { Select } from './Select'; import { withSurfaceVariantsLayout, withTheme } from '../../testing'; faker.seed(1234); type ItemProps = { id: string; text: string }; type StoryProps = { items: ItemProps[] }; const DefaultStory = ({ items = [] }: StoryProps) => { const [value, setValue] = useState(); return ( {items.map(({ id, text }) => ( {text} ))} ); }; export const Default: StoryObj = { args: { items: Array.from({ length: 16 }).map((_, i) => ({ id: `item-${i}`, text: faker.lorem.word() })), }, }; export default { title: 'ui/react-ui-core/Select', render: DefaultStory, decorators: [withSurfaceVariantsLayout(), withTheme], parameters: { chromatic: { disableSnapshot: false } }, };