import type { Meta, StoryObj } from "@storybook/vue3-vite"
import IconToggleBoolean from "./IconToggleBoolean.vue"
import { componentDoc } from "@/lib/storybook"

const meta = {
  title: "Elements/Boolean/IconToggleBoolean",
  component: IconToggleBoolean,
  tags: ["autodocs"],
  parameters: componentDoc("IconToggleBoolean", { barrel: "boolean" }),
  args: { label: "Toggle" },
} satisfies Meta<typeof IconToggleBoolean>

export default meta
type Story = StoryObj<typeof meta>

export const Default: Story = {
  args: { label: "Toggle" },
}

export const DarkMode: Story = {
  args: {
    label: "Dark mode",
    trueIcon: "moon",
    falseIcon: "sun",
  },
}

export const VisibilityToggle: Story = {
  args: {
    label: "Show password",
    trueIcon: "eye",
    falseIcon: "eye-off",
  },
}

export const Pressed: Story = {
  args: { label: "Currently on", modelValue: true },
}

export const Required: Story = {
  args: { label: "Must enable", required: true },
}

export const Disabled: Story = {
  args: { label: "Disabled", disabled: true, modelValue: true },
}

export const WithHelpText: Story = {
  args: {
    label: "Mute",
    helpText: "Toggle to mute all notifications.",
  },
}

export const WithErrors: Story = {
  args: {
    label: "Toggle",
    required: true,
    errors: ["This must be enabled."],
  },
}

export const HiddenLabel: Story = {
  args: {
    label: "Hidden",
    hideLabel: true,
    trueIcon: "moon",
    falseIcon: "sun",
  },
}
