From 639fe8162829f9fa3a8a9aeb311345582299987e Mon Sep 17 00:00:00 2001 From: Ian Turner Date: Sun, 28 Jul 2024 20:43:06 +0200 Subject: [PATCH] ui-core: add label stories --- ui-core/src/stories/Label.stories.tsx | 55 +++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 ui-core/src/stories/Label.stories.tsx diff --git a/ui-core/src/stories/Label.stories.tsx b/ui-core/src/stories/Label.stories.tsx new file mode 100644 index 00000000..3a0dfacf --- /dev/null +++ b/ui-core/src/stories/Label.stories.tsx @@ -0,0 +1,55 @@ +import React from 'react'; +import type { Meta, StoryObj } from '@storybook/react'; +import '@osrd-project/ui-core/dist/theme.css'; + +import Label from '../components/inputs/Label'; + +const meta: Meta = { + component: Label, + args: { + htmlFor: 'https://osrd.fr/en/', + text: 'OSRD', + small: true, + }, + decorators: [ + (Story) => ( +
+ +
+ ), + ], + title: 'Core/Label', + tags: ['autodocs'], +}; + +export default meta; + +type LabelStory = StoryObj; + +export const Default: LabelStory = { + args: {}, +}; + +export const Hint: LabelStory = { + args: { + hasHint: true, + }, +}; + +export const Required: LabelStory = { + args: { + required: true, + }, +}; + +export const Disabled: LabelStory = { + args: { + disabled: true, + }, +}; + +export const Large: LabelStory = { + args: { + small: false, + }, +};