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

const meta = {
  title: "Elements/Input/TelInput",
  component: TelInput,
  tags: ["autodocs"],
  args: {
    label: "Phone",
    placeholder: "+1 555 123 4567",
  },
  parameters: componentDoc("TelInput", { barrel: "input" }),
} satisfies Meta<typeof TelInput>

export default meta
type Story = StoryObj<typeof meta>

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

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

export const WithDefaultValue: Story = {
  args: { label: "Phone", modelValue: "+1 (555) 555-0100" },
}

export const Disabled: Story = {
  args: { label: "Phone", disabled: true, modelValue: "+1 555 555 0100" },
}

export const WithErrors: Story = {
  args: {
    label: "Phone",
    errors: ["Phone is required."],
  },
}
