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