import type { Meta, StoryObj } from "@storybook/react"; import type { CheckboxGroupProps } from "."; import { Checkbox, CheckboxGroup } from "."; import { excludeControls } from "../../utils"; import { StoryContainer } from "../../utils/StoryContainer"; type StoryType = StoryObj; const meta: Meta = { title: "Forms/CheckboxGroup", component: CheckboxGroup, argTypes: { ...excludeControls( "isRequired", "isReadOnly", "defaultValue", "value", "validationState", ), }, decorators: [ Story => ( ), ], }; export const Default: StoryType = { render: (args: CheckboxGroupProps) => ( ), args: { label: "Value", errorMessage: "", isDisabled: false, orientation: "vertical", defaultValue: ["option1", "option3"], isRequired: false, }, }; export const Horizontal: StoryType = { render: (args: CheckboxGroupProps) => ( ), args: { label: "Value", errorMessage: "", isDisabled: false, orientation: "horizontal", defaultValue: ["option2", "option4"], isRequired: false, itemsPerRow: 2, }, }; export const Disabled: StoryType = { render: (args: CheckboxGroupProps) => ( ), args: { label: "Value", errorMessage: "", isDisabled: true, orientation: "vertical", isRequired: false, }, }; export const Valid: StoryType = { render: (args: CheckboxGroupProps) => ( ), args: { label: "Value", errorMessage: "", isDisabled: false, isInvalid: false, orientation: "vertical", isRequired: false, }, }; export const Invalid: StoryType = { render: (args: CheckboxGroupProps) => ( ), args: { label: "Value", errorMessage: "This field is required", isDisabled: false, isInvalid: true, orientation: "vertical", isRequired: false, }, }; export const LastItemDisables: StoryType = { render: (args: CheckboxGroupProps) => ( ), args: { label: "Value", lastItemDisables: true, }, }; export default meta;