import { Meta } from "@storybook/react-vite"; import { useState } from "react"; import { Field } from "./Field"; import { Toggle } from "../toggle/Toggle"; import { Checkbox } from "../checkbox/Checkbox"; import { Radio } from "../radio/Radio"; import { Input } from "../text/Input"; const meta = { title: "Components/fields/Field", component: Field, decorators: [(Story) => ], } satisfies Meta; export default meta; export const Playbook = () => { const [value, setValue] = useState(""); const [label, setLabel] = useState("Your label"); const [hint, setHint] = useState("Any hint related to input field"); const [placeholder, setPlaceholder] = useState("Ex: Fernando"); const [description, setDescription] = useState(""); const [footerDescription, setFooterDescription] = useState(""); const [warning, setWarning] = useState(""); const [errors, setErrors] = useState(""); return ( <> setValue(e.target.value)} /> setLabel(e.target.value)} /> setHint(e.target.value)} /> setPlaceholder(e.target.value)} /> setDescription(e.target.value)} /> setFooterDescription(e.target.value)} /> setWarning(e.target.value)} /> setErrors(e.target.value)} /> > ); }; export const Context = () => { const [name, setName] = useState(""); const [isAgree, setIsAgree] = useState(true); const [isEnabled, setIsEnabled] = useState(true); return ( setName(e.target.value)} /> setName(e.target.value)} /> setName(e.target.value)} /> Male Female I don't want to answer Male Female I don't want to answer Male Female I don't want to answer setIsAgree(e.target.checked)}> I agree setIsAgree(e.target.checked)}> I agree setIsAgree(e.target.checked)}> I agree setIsEnabled(e.target.checked)}> Enabled setIsEnabled(e.target.checked)}> Enabled setIsEnabled(e.target.checked)}> Enabled name: {name} agree: {isAgree ? "True" : "False"} enabled: {isEnabled ? "True" : "False"} ); };
name: {name} agree: {isAgree ? "True" : "False"} enabled: {isEnabled ? "True" : "False"}