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

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

export default meta
type Story = StoryObj<typeof meta>

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

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

export const On: Story = {
  args: { label: "Enabled", modelValue: true },
}

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

export const WithStateLabels: Story = {
  args: {
    label: "Visibility",
    trueLabel: "Online",
    falseLabel: "Offline",
    modelValue: true,
  },
}

export const WithHelpText: Story = {
  args: {
    label: "Email digest",
    helpText: "Receive a weekly summary of activity.",
  },
}

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

export const HiddenLabel: Story = {
  args: { label: "Hidden", hideLabel: true },
}
