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

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

export default meta
type Story = StoryObj<typeof meta>

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

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

export const WithDefaultValue: Story = {
  args: { label: "Website", modelValue: "https://gramercytech.com" },
}

export const Disabled: Story = {
  args: { label: "Website", disabled: true, modelValue: "https://example.com" },
}

export const WithErrors: Story = {
  args: {
    label: "Website",
    errors: ["Must be a valid URL."],
  },
}
