Skip to content

Commit

Permalink
Badge story
Browse files Browse the repository at this point in the history
  • Loading branch information
vrundakansara committed Sep 4, 2024
1 parent c8b17f3 commit 8ddd04a
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions src/components/badge/badge.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import Badge from './button.jsx';

Check failure on line 1 in src/components/badge/badge.stories.js

View workflow job for this annotation

GitHub Actions / analysis (18.15)

Unable to resolve path to module './button.jsx'

// Badge component story configuration
export default {
title: 'Components/Badge',
component: Badge,
parameters: {
layout: 'centered',
},
tags: [ 'autodocs' ],
argTypes: {
variant: {
name: 'Variant',
description: 'Defines the style variant of the badge.',
control: 'select',
options: [ "neutral", "red", "yellow", "green", "blue", "inverse" ],

Check failure on line 16 in src/components/badge/badge.stories.js

View workflow job for this annotation

GitHub Actions / analysis (18.15)

Strings must use singlequote

Check failure on line 16 in src/components/badge/badge.stories.js

View workflow job for this annotation

GitHub Actions / analysis (18.15)

Strings must use singlequote

Check failure on line 16 in src/components/badge/badge.stories.js

View workflow job for this annotation

GitHub Actions / analysis (18.15)

Strings must use singlequote

Check failure on line 16 in src/components/badge/badge.stories.js

View workflow job for this annotation

GitHub Actions / analysis (18.15)

Strings must use singlequote

Check failure on line 16 in src/components/badge/badge.stories.js

View workflow job for this annotation

GitHub Actions / analysis (18.15)

Strings must use singlequote

Check failure on line 16 in src/components/badge/badge.stories.js

View workflow job for this annotation

GitHub Actions / analysis (18.15)

Strings must use singlequote
table: {
type: { summary: 'string' },
defaultValue: { summary: 'neutral' },
},
},
size: {
name: 'Size',
description: 'Defines the size of the badge.',
control: 'select',
options: [ 'xs', 'sm', 'md', 'lg' ],
table: {
type: { summary: 'string' },
defaultValue: { summary: 'md' },
},
},
type: {
name: 'Type',
description: 'Defines the type of the badge.',
control: 'select',
options: [ 'pill', 'rounded' ],
table: {
type: { summary: 'string' },
defaultValue: { summary: 'pill' },
},
},
disabled: {
name: 'Disabled',
description: 'Defines if the badge is disabled.',
control: 'boolean',
table: {
type: { summary: 'boolean' },
defaultValue: { summary: 'false' },
},
},
closable: {
name: 'Clasable',
description: 'Defines if the badge is closable.',
control: 'boolean',
table: {
type: { summary: 'boolean' },
defaultValue: { summary: 'true' },
},
},
label: { control: 'text', defaultValue: 'Badge' },
},
};

// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
export const Primary = {
args: {
variant: 'primary',
children: 'Badge',
},
};

0 comments on commit 8ddd04a

Please sign in to comment.