diff --git a/apps/storybook/stories/select.stories.tsx b/apps/storybook/stories/select.stories.tsx index 8050a030..e7b02537 100644 --- a/apps/storybook/stories/select.stories.tsx +++ b/apps/storybook/stories/select.stories.tsx @@ -7,6 +7,9 @@ const SelectDisplays: ReadonlyArray = ['inline', 'block']; export default { argTypes: { + disabled: { + control: 'boolean', + }, display: { control: { type: 'select' }, options: SelectDisplays, @@ -71,9 +74,87 @@ Basic.args = { export function Display() { const [value, setValue] = useState('apple'); + return ( +
+ +
+ ); +} + +export function HiddenLabel() { + const [value, setValue] = useState('apple'); + + return ( +
+ , + 'disabled' | 'name' | 'onBlur' | 'onFocus' | 'required' +>; + export type SelectItem = Readonly<{ label: string; value: T; @@ -16,17 +23,22 @@ type Props = Readonly<{ onChange: (value: string) => void; options: ReadonlyArray>; value: T; -}>; +}> & + Readonly; -export default function Select({ - display, - label, - isLabelHidden, - name, - options, - value, - onChange, -}: Props) { +function Select( + { + display, + disabled, + label, + isLabelHidden, + options, + value, + onChange, + ...props + }: Props, + ref: ForwardedRef, +) { const id = useId(); return ( @@ -40,17 +52,20 @@ export default function Select({ {label}