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

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

export default meta
type Story = StoryObj<typeof meta>

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

export const HiddenLabel: Story = {
  args: { label: "Search", hideLabel: true, placeholder: "Search..." },
}

export const WithDefaultValue: Story = {
  args: { label: "Search", modelValue: "kittens" },
}

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

export const WithErrors: Story = {
  args: {
    label: "Search",
    errors: ["No results."],
  },
}
