import React, { useState } from "react"; import { styled, theme } from "../theme"; import { Checkbox as Component } from "."; import type { StoryFn, Meta } from "@storybook/react"; const variants = ["primary", "secondary", "cta"]; const size = ["087", "125"]; const isOutline = [true, false]; const Column = styled("div", { display: "flex", flexDirection: "column", gap: "$100", alignItems: "center", marginBlockStart: "$200", }); const HStack = styled("section", { display: "flex", flexDirection: "row", gap: "$100", borderRadius: "$075", }); const Heading = styled("h2", { color: theme.colors.primary, fontSize: theme.fontSizes["100"], marginBlock: 0, }); export default { title: "Checkbox", component: Component, argTypes: { size: { options: size, }, variant: { options: variants, }, isOutline: { options: isOutline, }, defaultChecked: { options: [true, false, "indeterminate"], }, checked: { options: [true, false, "indeterminate"], }, onCheckedChange: { action: "onCheckedChange", }, disabled: { options: [true, false], }, required: { options: [true, false], }, name: { control: "text", }, value: { control: "text", }, id: { control: "text", }, label: { control: "text", }, }, } as Meta; export const Play = { render: (args) => { const [checked, setChecked] = useState(false); return ( ); }, args: {}, name: "Checkbox", }; const ChromaticTemplate: StoryFn = () => { const isRequired = true; return ( <> Regular old checked states w/ required this checkbox is required this checkbox is required this checkbox is required this checkbox is required this checkbox is required this checkbox is required this checkbox is required this checkbox is required Regular old checked states Regular old indeterminate states Regular old false states isOutline states 087 states Disabled states Boxes with labels! Checkbox 3 ); }; export const Chromatic = { render: ChromaticTemplate, args: {}, decorators: [ (Story) => ( ), ], };