Skip to content

Commit

Permalink
ui-core: add label stories
Browse files Browse the repository at this point in the history
  • Loading branch information
turnerian2004 committed Jul 28, 2024
1 parent eb50698 commit 274cc03
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions ui-core/src/stories/Label.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import '@osrd-project/ui-core/dist/theme.css';

import Input from '../components/inputs/Input';
import Label from '../components/inputs/Label';

const meta: Meta<typeof Label> = {
component: Label,
args: {
htmlFor: 'https://osrd.fr/en/',
text: 'OSRD',
small: true,
},
decorators: [
(Story) => (
<div style={{ maxWidth: '20rem' }}>
<Story />
</div>
),
],
title: 'Core/Label',
tags: ['autodocs'],
};

export default meta;

type LabelStory = StoryObj<typeof Label>;
type InputStory = StoryObj<typeof Input>;

export const Default: InputStory = {
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,
},
};

0 comments on commit 274cc03

Please sign in to comment.