import { Meta } from "@storybook/react"; import React from "react"; import { Switch } from ":/components/Forms/Switch/index"; import { Button } from ":/components/Button"; export default { title: "Components/Forms/Switch", component: Switch, } as Meta; export const Default = { args: {}, }; export const Checked = { args: { checked: true, }, }; export const WithLabel = { args: { label: "Label", }, }; export const WithLabelChecked = { args: { label: "Label", checked: true, }, }; export const WithText = { args: { label: "Label", text: "This is an optional text", checked: true, }, }; export const FullWidth = { args: { label: "Label", text: "This is an optional text", fullWidth: true, }, }; export const WithLabelRight = { args: { label: "Label", labelSide: "right", }, }; export const WithLabelRightAndText = { args: { label: "Label", labelSide: "right", text: "This is an optional text", }, }; export const WithLabelRightAndFullWidth = { args: { label: "Label", text: "This is an optional text", fullWidth: true, labelSide: "right", }, }; export const Disabled = { args: { label: "Label", text: "This is an optional text", disabled: true, }, }; export const DisabledChecked = { args: { label: "Label", text: "This is an optional text", disabled: true, defaultChecked: true, }, }; export const Error = { args: { label: "Label", text: "This is an optional text", state: "error", defaultChecked: true, }, }; export const Success = { args: { label: "Label", text: "This is an optional text", state: "success", defaultChecked: true, }, }; export const Controlled = { render: () => { const [checked, setChecked] = React.useState(false); return (
Value: {JSON.stringify(checked)}
setChecked(e.target.checked)} />
); }, }; export const FormExample = { render: () => { return (
); }, }; export const FormExampleRight = { render: () => { return (
); }, };