import React, { useState } from "react"; import SelectInput from "../../app/components/controls/SelectInput"; export default { title: "Components/Controls/SelectInput", component: SelectInput, parameters: { layout: "centered", }, argTypes: { state: { control: { type: "select" }, options: ["default", "active", "focus"], }, disabled: { control: { type: "boolean" }, }, error: { control: { type: "boolean" }, }, placeholder: { control: { type: "text" }, }, label: { control: { type: "text" }, }, }, }; const Template = (args) => { const [value, setValue] = useState(""); return ( setValue(data.target.value)} options={[ { value: "option1", label: "Option 1" }, { value: "option2", label: "Option 2" }, { value: "option3", label: "Option 3" }, ]} /> ); }; // Default story export const Default = { args: { label: "Default Select Input", placeholder: "Choose an option", state: "default", }, render: Template, }; // States export const Active = { args: { label: "Active State", placeholder: "Choose an option", state: "active", }, render: Template, }; export const Focus = { args: { label: "Focus State", placeholder: "Choose an option", state: "focus", }, render: Template, }; export const Error = { args: { label: "Error State", placeholder: "Choose an option", error: true, }, render: Template, }; export const Disabled = { args: { label: "Disabled State", placeholder: "Choose an option", disabled: true, }, render: Template, }; // Interactive example export const Interactive = (args) => { const [value, setValue] = useState(""); return (
setValue(data.target.value)} options={[ { value: "option1", label: "Option 1" }, { value: "option2", label: "Option 2" }, { value: "option3", label: "Option 3" }, ]} />

Current value: "{value}"

); }; Interactive.args = { label: "Interactive Select Input", placeholder: "Choose an option", state: "default", }; // All states comparison export const AllStates = () => (

Select Input States

);