Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/components/forms/Label/Label.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import { Label } from './Label'
import type { Meta, StoryObj } from '@storybook/react-vite'
import { Form } from '../Form/Form'

const meta = {
title: 'Components/Form elements/Label',
Expand All @@ -17,6 +18,11 @@ Source: https://designsystem.digital.gov/components/form-controls/
},
},
args: { htmlFor: 'testInput', children: 'Text input' },
render: (args) => (
<Form onSubmit={() => {}}>
<Label {...args} />
</Form>
),
} satisfies Meta<typeof Label>

export default meta
Expand All @@ -35,11 +41,10 @@ export const Error: Story = {
}

export const WithHint: Story = {
render: (args) => (
<Label {...args} htmlFor="testInputHint" hint={<> (optional)</>}>
Text input
</Label>
),
args: {
htmlFor: 'testInputHint',
hint: <> (optional)</>,
},
}

export const WithRequiredMarker: Story = {
Expand Down
Loading