import type { Meta, StoryObj } from '@storybook/vue3' import FdsTextarea from './FdsTextarea.vue' const meta: Meta = { title: 'FDS/Form/FdsTextarea', component: FdsTextarea, tags: ['autodocs'], argTypes: { modelValue: { control: { type: 'text' } }, label: { control: { type: 'text' } }, meta: { control: { type: 'text' } }, disabled: { control: { type: 'boolean' } }, optional: { control: { type: 'boolean' } }, valid: { control: { type: 'select' }, options: ['true', 'false', 'null'] }, invalidMessage: { control: { type: 'text' } }, rows: { control: { type: 'number', min: 1, step: 1 } }, maxlength: { control: { type: 'number', min: 1, step: 1 } }, id: { control: { type: 'text' } }, }, args: { modelValue: '', label: 'Beskrivning', meta: '', disabled: false, optional: false, valid: null, invalidMessage: undefined, rows: 4, id: '', }, } export default meta type Story = StoryObj export const Default: Story = { render: (args: Story['args']) => ({ components: { FdsTextarea }, setup: () => ({ args }), template: ``, }), } export const Disabled: Story = { args: { disabled: true }, render: (args: Story['args']) => ({ components: { FdsTextarea }, setup: () => ({ args }), template: ``, }), } export const WithMaxLength: Story = { args: { label: 'Aktuellt behov', meta: 'Beskriv vad Feelgood bör känna till för att kunna hjälpa på bästa sätt. Inkludera uppdragets omfattning, som antal besök.', maxlength: 500, modelValue: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem.', }, render: (args: Story['args']) => ({ components: { FdsTextarea }, setup: () => ({ args }), template: ``, }), }