import { getDefaultArgTypes, getValidationArgTypes, StorybookControlCategory, } from "../storybook-arg-types.js";
import { Checkbox } from "./checkbox.js";
/**
 * The `Checkbox` component allows users to select one or more items from a set.
 * It is based on Radix UI's Checkbox component and styled according to the design system.
 *
 * The component supports different states such as checked, unchecked, indeterminate, disabled,
 * and can display error states. It also supports labels, descriptions, and validation messages.
 *
 * > **Note:** This component does not have built-in validation. If you need built-in validation
 * > you can use the [BooleanField](?path=/docs/document-engineering-scalars-boolean-field--readme)
 * > component.
 */
const meta = {
    title: "UI/Checkbox",
    component: Checkbox,
    parameters: {
        layout: "centered",
        chromatic: {
            disableSnapshot: true,
        },
    },
    tags: ["autodocs"],
    argTypes: {
        ...getDefaultArgTypes({
            enabledArgTypes: {
                value: false,
                id: false,
            },
            valueControlType: "boolean",
            valueType: "boolean",
        }),
        value: {
            control: "inline-radio",
            options: ["indeterminate", true, false],
            description: "Current value of the input field",
            table: {
                type: { summary: "boolean" },
                category: StorybookControlCategory.DEFAULT,
            },
        },
        ...getValidationArgTypes({
            enabledArgTypes: {
                validators: false,
                showErrorOnBlur: false,
                showErrorOnChange: false,
            },
        }),
    },
};
export default meta;
export const Default = {
    args: {
        label: "Accept terms and conditions",
    },
};
export const Checked = {
    args: {
        label: "Accept terms and conditions",
        defaultValue: true,
    },
};
export const Indeterminate = {
    args: {
        label: "Select some items",
        defaultValue: "indeterminate",
    },
};
export const WithDescription = {
    args: {
        label: "Subscribe to newsletter",
        description: "Receive updates about our product",
    },
};
export const Required = {
    args: {
        label: "I agree to the terms and conditions",
        required: true,
    },
};
export const Disabled = {
    args: {
        label: "This option is disabled",
        disabled: true,
    },
};
export const WithErrors = {
    args: {
        label: "Accept terms",
        errors: ["You must accept the terms to continue"],
    },
};
export const WithWarnings = {
    args: {
        label: "Share my data",
        warnings: ["Your data will be shared with third-party services"],
    },
};
export const WithErrorsAndWarnings = {
    args: {
        label: "Accept privacy policy",
        errors: ["This field is required"],
        warnings: ["Please review our privacy policy carefully"],
    },
};
//# sourceMappingURL=checkbox.stories.js.map