import { useState } from 'react'; import type { Meta, StoryObj } from '@storybook/react'; import { Dropdown } from './Dropdown'; const choices = [ { id: 'draft', label: 'Draft' }, { id: 'review', label: 'In review' }, { id: 'published', label: 'Published' }, ]; const meta = { title: 'Components/Dropdown', component: Dropdown, tags: ['autodocs'], parameters: { docs: { description: { component: 'Styled select component with label, error state, stacked/inline layout, and multiple sizes.', }, }, }, argTypes: { label: { description: 'Label text shown above (stacked) or on the left (inline).', control: 'text', table: { type: { summary: 'string' } }, }, value: { description: 'Current selected value (must match one `choices[].id`).', control: 'text', table: { type: { summary: 'string' } }, }, choices: { description: 'Options list in `{ id: string; label: string }` format.', control: 'object', table: { type: { summary: 'Array<{ id: string; label: string }>' } }, }, size: { description: 'Control size.', options: ['sm', 'md', 'lg', 'full'], control: 'inline-radio', table: { type: { summary: "'sm' | 'md' | 'lg' | 'full'" } }, }, width: { description: 'Control width constraint.', options: ['sm', 'md', 'lg', 'full'], control: 'inline-radio', table: { type: { summary: "'sm' | 'md' | 'lg' | 'full'" } }, }, layout: { description: 'Label/control layout mode.', options: ['stacked', 'inline'], control: 'inline-radio', table: { type: { summary: "'stacked' | 'inline'" } }, }, disabled: { description: 'Disables the field.', control: 'boolean', table: { type: { summary: 'boolean' } }, }, required: { description: 'Sets the native HTML `required` attribute.', control: 'boolean', table: { type: { summary: 'boolean' } }, }, error: { description: 'Error message shown below the field.', control: 'text', table: { type: { summary: 'string' } }, }, className: { description: 'Extra CSS classes for the wrapper.', control: 'text', table: { type: { summary: 'string' } }, }, selectClassName: { description: 'Extra CSS classes for the `