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

const meta = {
  title: "Elements/Input/EmailInput",
  component: EmailInput,
  tags: ["autodocs"],
  args: {
    label: "Email",
    placeholder: "you@example.com",
  },
  parameters: componentDoc("EmailInput", { barrel: "input" }),
} satisfies Meta<typeof EmailInput>

export default meta
type Story = StoryObj<typeof meta>

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

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

export const Disabled: Story = {
  args: { label: "Email", disabled: true, modelValue: "user@example.com" },
}

export const WithHelpText: Story = {
  args: {
    label: "Email",
    helpText: "We'll never share your email.",
  },
}

export const WithErrors: Story = {
  args: {
    label: "Email",
    errors: ["Please enter a valid email address."],
  },
}

export const WithDefaultValue: Story = {
  args: { label: "Email", modelValue: "user@example.com" },
}
