import type { Meta, StoryObj } from '@storybook/react-vite' import React from 'react' import { useArgs } from 'storybook/preview-api' import DrawerSelect from './DrawerSelect' import { DocsTemplate } from '../../../.storybook' const meta: Meta = { title: 'Components/DrawerSelect', component: DrawerSelect, parameters: { docs: { page: () => ( The DrawerSelect component provides a selection interface that opens in a SideDrawer. It allows users to choose from a list of options. This component is ideal for interfaces where users need to select from a potentially large list of options. } /> ), }, }, } export default meta type Story = StoryObj const Template: Story = { render: function Render(args) { const [{ options, active }, updateArgs] = useArgs() function onChange(option) { updateArgs({ active: option }) } return ( ) }, } export const Basic: Story = { ...Template, args: { options: Array.from({ length: 20 }, (_, index) => ({ name: `option_${index + 1}`, label: `Option ${index + 1}`, })), header: 'Header', placeholder: 'Select an option', }, } export const Active: Story = { ...Template, args: { ...Basic.args, active: { name: 'option_5', label: 'Option 5', }, }, } export const Icon: Story = { ...Template, args: { ...Basic.args, buttonIcon: 'plus', }, } export const Disabled: Story = { ...Template, args: { ...Basic.args, options: [ { name: 'option_1', label: 'Option 1', }, ], active: { name: 'option_1', label: 'Option 1', }, disabled: true, }, } export const Loading: Story = { ...Template, args: { ...Basic.args, loading: true, }, }