-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add input state * fix format --------- Co-authored-by: Nutthapat Pongtanyavichai <contact@leomotors.me>
- Loading branch information
1 parent
19d3dce
commit a5a6cea
Showing
4 changed files
with
87 additions
and
15 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
35 changes: 35 additions & 0 deletions
35
packages/ui/src/components/atom/input/input.stories.svelte
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,35 @@ | ||
<script module lang="ts"> | ||
import { defineMeta } from '@storybook/addon-svelte-csf' | ||
import { Input } from './index.js' | ||
const { Story } = defineMeta<typeof Input>({ | ||
title: 'Atom/Input', | ||
component: Input, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
placeholder: { | ||
control: 'text', | ||
defaultValue: 'Input', | ||
}, | ||
state: { | ||
control: { | ||
type: 'select', | ||
}, | ||
options: ['default', 'error', 'success'], | ||
defaultValue: 'default', | ||
}, | ||
class: { | ||
control: false, | ||
}, | ||
}, | ||
}) | ||
</script> | ||
|
||
<!-- 👇 Each story then reuses that template --> | ||
|
||
<Story name="Default" args={{ state: 'default', placeholder: 'Input' }} /> | ||
|
||
<Story name="Error" args={{ state: 'error', placeholder: 'Input' }} /> | ||
|
||
<Story name="Success" args={{ state: 'success', placeholder: 'Input' }} /> |
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