Skip to content

Commit

Permalink
Merge pull request #75 from brainstormforce/SUR-289
Browse files Browse the repository at this point in the history
SUR-289 - Added label story
  • Loading branch information
vrundakansara authored Sep 25, 2024
2 parents 2786bab + 173acbd commit cd32a4a
Showing 1 changed file with 87 additions and 0 deletions.
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 cd32a4a

Please sign in to comment.