import type { Meta, StoryObj } from '@storybook/vue3-vite' import { ref } from 'vue' import { Checkbox as NychCheckbox, CheckboxGroup as NychCheckboxGroup } from '@nychthemeron/library' const meta = { title: 'Components/Checkbox', component: NychCheckbox, parameters: { layout: 'centered', }, tags: ['autodocs'], argTypes: { disabled: { control: { type: 'boolean' }, description: 'Disable the checkbox', }, }, } satisfies Meta export default meta type Story = StoryObj export const Default: Story = { render: () => ({ components: { NychCheckbox }, setup() { const checked = ref(false) return { checked } }, template: ``, }), } export const Checked: Story = { render: () => ({ components: { NychCheckbox }, setup() { const checked = ref(true) return { checked } }, template: ``, }), } export const Disabled: Story = { render: () => ({ components: { NychCheckbox }, setup() { const checked = ref(true) return { checked } }, template: `
`, }), } export const WithLabels: Story = { render: () => ({ components: { NychCheckbox }, setup() { const offerings = ref(['honey']) return { offerings } }, template: `

Offerings: {{ offerings.join(', ') || 'none' }}

`, }), } // CheckboxGroup holds the array v-model and shares a name across children. export const Group: Story = { render: () => ({ components: { NychCheckbox, NychCheckboxGroup }, setup() { const offerings = ref(['honey']) return { offerings } }, template: `

Offerings: {{ offerings.join(', ') || 'none' }}

`, }), }