diff --git a/packages/aap-felles-react/src/FileInput/FileInput.stories.tsx b/packages/aap-felles-react/src/FileInput/FileInput.stories.tsx index 0a7ad6c8..f0e2cdb8 100644 --- a/packages/aap-felles-react/src/FileInput/FileInput.stories.tsx +++ b/packages/aap-felles-react/src/FileInput/FileInput.stories.tsx @@ -19,7 +19,7 @@ export const Primary: StoryFn = (args) => { uploadUrl={'/upload'} deleteUrl={'/delete'} onUpload={(attachments) => setFiles([...files, ...attachments])} - onDelete={(attachment) => setFiles(files.filter((file) => file.id !== attachment.id))} + onDelete={(attachment) => setFiles(files.filter((file) => file.vedleggId !== attachment.vedleggId))} files={files} /> ); @@ -35,7 +35,7 @@ export const Bokmål:StoryFn = (args) => { uploadUrl={'/upload'} deleteUrl={'/delete'} onUpload={(attachments) => setFiles([...files, ...attachments])} - onDelete={(attachment) => setFiles(files.filter((file) => file.id !== attachment.id))} + onDelete={(attachment) => setFiles(files.filter((file) => file.vedleggId !== attachment.vedleggId))} files={files} /> ); @@ -51,9 +51,9 @@ export const Nynorsk:StoryFn = (args) => { uploadUrl={'/upload'} deleteUrl={'/delete'} onUpload={(attachments) => setFiles([...files, ...attachments])} - onDelete={(attachment) => setFiles(files.filter((file) => file.id !== attachment.id))} + onDelete={(attachment) => setFiles(files.filter((file) => file.vedleggId !== attachment.vedleggId))} files={files} locale={'nn'} /> ); -} \ No newline at end of file +} diff --git a/packages/aap-felles-react/src/Form/comboboxwrapper/Combobox.stories.tsx b/packages/aap-felles-react/src/Form/comboboxwrapper/Combobox.stories.tsx index e82036c3..e8cd9b11 100644 --- a/packages/aap-felles-react/src/Form/comboboxwrapper/Combobox.stories.tsx +++ b/packages/aap-felles-react/src/Form/comboboxwrapper/Combobox.stories.tsx @@ -1,33 +1,21 @@ -import { BodyShort, Button } from '@navikt/ds-react'; +import { Button } from '@navikt/ds-react'; import { Meta, StoryFn } from '@storybook/react'; import { useConfigForm } from '../FormHook'; import React from 'react'; import { FormField } from '../FormField'; +import { ComboboxWrapper } from './ComboboxWrapper'; // More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export export default { title: 'Combobox', - component: ComboboxForm, + component: ComboboxWrapper, } as Meta; -// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args -const Template: StoryFn<{}> = (args) => ; - -export const Primary = Template.bind({}); -// More on args: https://storybook.js.org/docs/react/writing-stories/args -Primary.args = { - children: Dette er tekst som havner inne i Luca, -}; - interface FormFields { type: string; } -interface Props { - defaultValue?: string; -} - -function ComboboxForm(props: Props) { +export const ComboboxForm: StoryFn = () => { const { formFields, form } = useConfigForm({ type: { type: 'combobox', @@ -38,10 +26,36 @@ function ComboboxForm(props: Props) { rules: { required: 'Du må velge type' }, }, }); + return ( -
console.log('submitting'))}> + console.log('submitting'))} + style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }} + > ); -} +}; + +export const MultipleComboboxForm: StoryFn = () => { + const { formFields, form } = useConfigForm({ + type: { + type: 'combobox_multiple', + label: 'Velg type', + description: 'Velg en type', + options: ['Alternativ 1', 'Alternativ 2', 'Alternativ 3'], + rules: { required: 'Du må velge type' }, + }, + }); + + return ( +
console.log('submitting'))} + style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }} + > + + + + ); +};