-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
309ca1c
commit 9c81312
Showing
8 changed files
with
311 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
import Alert from './alert.jsx'; | ||
import { fn } from '@storybook/test'; | ||
|
||
// Alert component story configuration | ||
export default { | ||
title: 'Components/Alert', | ||
component: Alert, | ||
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' ], | ||
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 Neutral = { | ||
args: { | ||
variant: 'neutral', | ||
children: 'Badge', | ||
type: 'pill', | ||
size: 'sm', | ||
label: 'Badge', | ||
onClose: fn(), | ||
onMouseDown: fn(), | ||
}, | ||
}; | ||
|
||
export const Disabled = { | ||
args: { | ||
variant: 'neutral', | ||
children: 'Badge', | ||
type: 'pill', | ||
size: 'sm', | ||
label: 'Badge', | ||
onClose: fn(), | ||
onMouseDown: fn(), | ||
disabled: true, | ||
}, | ||
}; | ||
|
||
export const Red = { | ||
args: { | ||
variant: 'red', | ||
children: 'Badge', | ||
type: 'rounded', | ||
size: 'sm', | ||
label: 'Badge', | ||
onClose: fn(), | ||
onMouseDown: fn(), | ||
}, | ||
}; | ||
|
||
export const Yellow = { | ||
args: { | ||
variant: 'yellow', | ||
children: 'Badge', | ||
type: 'rounded', | ||
size: 'sm', | ||
label: 'Badge', | ||
onClose: fn(), | ||
onMouseDown: fn(), | ||
}, | ||
}; | ||
|
||
export const Green = { | ||
args: { | ||
variant: 'green', | ||
children: 'Badge', | ||
type: 'rounded', | ||
size: 'sm', | ||
label: 'Badge', | ||
onClose: fn(), | ||
onMouseDown: fn(), | ||
}, | ||
}; | ||
|
||
export const Blue = { | ||
args: { | ||
variant: 'blue', | ||
children: 'Badge', | ||
type: 'rounded', | ||
size: 'sm', | ||
label: 'Badge', | ||
onClose: fn(), | ||
onMouseDown: fn(), | ||
}, | ||
}; | ||
|
||
export const Inverse = { | ||
args: { | ||
variant: 'inverse', | ||
children: 'Badge', | ||
type: 'rounded', | ||
size: 'sm', | ||
label: 'Badge', | ||
onClose: fn(), | ||
onMouseDown: fn(), | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
import Label from '../../components/label/label.jsx'; | ||
import Input from '../../components/input/input.jsx'; | ||
import TextArea from '../../components/textarea/textarea.jsx'; | ||
import Container from '../../components/container/container.jsx'; | ||
import { Info } from 'lucide-react'; | ||
|
||
export const InputField = { | ||
render: () => ( | ||
<div style={{width: '800px'}}> | ||
<Container direction="column" gap="xs"> | ||
<Label size="md">Label</Label> | ||
<Input type="text" placeholder="Placeholder" /> | ||
<Label size="xs" variant="help"> | ||
<Info/> Help label with a <a href="https://example.com">link</a> | ||
. | ||
</Label> | ||
</Container> | ||
</div> | ||
) | ||
}; | ||
|
||
export const TextAreaField = { | ||
render: () => ( | ||
<div style={{width: '800px'}}> | ||
<Container direction="column" gap="xs"> | ||
<Label size="md">Label</Label> | ||
<TextArea size="md" placeholder="Placeholder"/> | ||
<Label size="xs" variant="help"> | ||
<Info/> Help label with a <a href="https://example.com">link</a> | ||
. | ||
</Label> | ||
</Container> | ||
</div> | ||
) | ||
}; | ||
|
||
// Badge component story configuration | ||
export const InputFileField = { | ||
render: () => ( | ||
<div style={{width: '800px'}}> | ||
<Container direction="column" gap="xs"> | ||
<Label size="md">Label</Label> | ||
<Input type="file" /> | ||
<Label size="xs" variant="help"> | ||
<Info/> Help label with a <a href="https://example.com">link</a> | ||
. | ||
</Label> | ||
</Container> | ||
</div> | ||
) | ||
}; | ||
|
||
// Badge component story configuration | ||
export default { | ||
title: 'Molecules/Input Field', | ||
component: InputField, | ||
render: () => ( | ||
<> | ||
<Label size="md">Input Field</Label> | ||
<Input type="text" /> | ||
</> | ||
), | ||
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' ], | ||
// 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' }, | ||
// }, | ||
}; |