import React, { useState } from "react"; import SelectInput from "../app/components/SelectInput"; export default { title: "Forms/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 = Template.bind({}); Default.args = { label: "Default Select Input", placeholder: "Choose an option", state: "default", }; // States export const Active = Template.bind({}); Active.args = { label: "Active State", placeholder: "Choose an option", state: "active", }; export const Focus = Template.bind({}); Focus.args = { label: "Focus State", placeholder: "Choose an option", state: "focus", }; export const Error = Template.bind({}); Error.args = { label: "Error State", placeholder: "Choose an option", error: true, }; export const Disabled = Template.bind({}); Disabled.args = { label: "Disabled State", placeholder: "Choose an option", disabled: true, }; // 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

);