Skip to content

Commit

Permalink
Added label story
Browse files Browse the repository at this point in the history
  • Loading branch information
ravindra114 committed Sep 24, 2024
1 parent c72340e commit d53b2e7
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/force-ui.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom'), 'version' => '3841f7c324ffa1d4415d');
<?php return array('dependencies' => array('react', 'react-dom'), 'version' => '2313942efbf357138322');
2 changes: 1 addition & 1 deletion dist/force-ui.js

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions src/components/label/label.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import Label from './label.jsx';

export default {
title: 'Atoms/Label',
component: Label,
parameters: {
layout: 'centered',
},
tags: [ 'autodocs' ],
argTypes: {
size: {
name: 'Size',
description: 'Defines the size of the label.',
control: 'select',
options: [ 'xs', 'sm', 'md' ],
table: {
type: { summary: 'string' },
defaultValue: { summary: 'sm' },
},
},
variant: {
name: 'Variant',
description: 'Defines the style variant of the label.',
control: 'select',
options: [ 'neutral', 'help', 'error', 'disabled' ],
table: {
type: { summary: 'string' },
defaultValue: { summary: 'neutral' },
},
},
required: {
name: 'Required',
description: 'Defines if the label is required.',
control: 'boolean',
table: {
type: { summary: 'boolean' },
defaultValue: { summary: 'false' },
},
},
children: {
name: 'Text',
description: 'The label text or content.',
control: 'text',
defaultValue: 'Label Text',
},
},
};

// Basic Label
export const Basic = {
args: {
size: 'sm',
variant: 'neutral',
required: false,
children: 'Basic Label',
},
};

// Required Label
export const Required = {
args: {
size: 'sm',
variant: 'neutral',
required: true,
children: 'Required Label',
},
};

// Error Variant
export const Error = {
args: {
size: 'sm',
variant: 'error',
required: false,
children: 'Error Label',
},
};

// Disabled Variant
export const Disabled = {
args: {
size: 'sm',
variant: 'disabled',
required: false,
children: 'Disabled Label',
},
};

0 comments on commit d53b2e7

Please sign in to comment.