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

const meta = {
  title: "Elements/Picker/ColorPicker",
  component: ColorPicker,
  tags: ["autodocs"],
  args: {
    label: "Brand color",
  },
  parameters: componentDoc("ColorPicker", { barrel: "picker" }),
  decorators: [
    () => ({
      template: '<div class="w-80 p-4"><story /></div>',
    }),
  ],
} satisfies Meta<typeof ColorPicker>

export default meta
type Story = StoryObj<typeof meta>

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

export const WithValue: Story = {
  args: { label: "Brand color", modelValue: "#0008db" },
}

export const WithSwatches: Story = {
  args: {
    label: "Brand color",
    swatches: ["#0008db", "#ff5722", "#10b981", "#facc15", "#a855f7"],
  },
}

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

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