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

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

export default meta
type Story = StoryObj<typeof meta>

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

export const WithValue: Story = {
  args: { label: "Opens at", modelValue: "09:30" },
}

export const QuarterHourSteps: Story = {
  args: {
    label: "Opens at",
    minuteStep: 15,
    helpText: "Minutes step by 15.",
  },
}

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

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