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

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

export default meta
type Story = StoryObj<typeof meta>

export const Default: Story = {
  args: { label: "Do you agree?" },
}

export const Required: Story = {
  args: { label: "Do you agree?", required: true },
}

export const Inline: Story = {
  args: { label: "Inline choices", inline: true },
}

export const CustomLabels: Story = {
  args: {
    label: "Should we proceed?",
    trueLabel: "Of course",
    falseLabel: "Absolutely not",
  },
}

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

export const WithHelpText: Story = {
  args: {
    label: "Receive emails?",
    helpText: "You can change this later in settings.",
  },
}

export const WithErrors: Story = {
  args: {
    label: "Agree?",
    required: true,
    errors: ["You must choose one option."],
  },
}

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