-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input and select story/#26 #30
Merged
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6dfb48d
setting: Add path alias for webpack resolve
seonghunYang 7374159
feat: Add TextInput component stories
seonghunYang d2a3ec8
chore: merge main
seonghunYang 8326c32
refactor: ํ๋ ํธ์ ๋ง์ถฐ์ color ๋ณ๊ฒฝ
seonghunYang 64cd1d8
feat: Fix default and disabled values in text input stories
seonghunYang cd6b40e
chore: ํ๋ ํธ etc color ์์
seonghunYang 832f081
fix: fix error message styling in text input component
seonghunYang f622ccd
fix: Fix disabled text color in select component
seonghunYang 4f20278
feat: Add Select component stories
seonghunYang d7029a4
chore: Add optimization and enable SWC builder in Storybook configuraโฆ
seonghunYang eb71071
refactor: Update layout in storybook previews
seonghunYang 93ddd2e
chore: fix ์ฃผ์ ์ ๊ฑฐ
seonghunYang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,67 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { MagnifyingGlassIcon } from '@heroicons/react/24/outline'; | ||
|
||
import TextInput from './text-input'; | ||
|
||
const meta = { | ||
title: 'ui/view/atom/TextInput', | ||
component: TextInput, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
} satisfies Meta<typeof TextInput>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
// fix: border ์๊น ์์ด๋ผ? | ||
export const Default: Story = { | ||
args: { | ||
defaultValue: 'default', | ||
}, | ||
}; | ||
|
||
// fix: ์ ์๋ณํจ | ||
export const Disabled: Story = { | ||
args: { | ||
defaultValue: 'Disabled', | ||
disabled: true, | ||
}, | ||
}; | ||
|
||
export const Password: Story = { | ||
args: { | ||
type: 'password', | ||
defaultValue: 'asd', | ||
}, | ||
}; | ||
|
||
export const WithIcon: Story = { | ||
args: { | ||
defaultValue: '', | ||
icon: MagnifyingGlassIcon, | ||
}, | ||
}; | ||
|
||
export const DisabledWithIcon: Story = { | ||
args: { | ||
defaultValue: 'Disabled with icon', | ||
disabled: true, | ||
icon: MagnifyingGlassIcon, | ||
}, | ||
}; | ||
|
||
export const WithError: Story = { | ||
args: { | ||
defaultValue: '', | ||
error: true, | ||
errorMessage: 'error message', | ||
}, | ||
}; | ||
|
||
export const WithPlaceholder: Story = { | ||
args: { | ||
defaultValue: '', | ||
placeholder: 'placeholder', | ||
}, | ||
}; |
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,83 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { ShieldExclamationIcon } from '@heroicons/react/24/outline'; | ||
|
||
import Select from '.'; | ||
|
||
const meta = { | ||
title: 'ui/view/molecule/Select', | ||
component: Select, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
decorators: [ | ||
(Story) => ( | ||
<div className="w-52"> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
} as Meta<typeof Select>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
type SelectTemplateProps = { | ||
placeholder: string; | ||
defaultValue?: string; | ||
icon?: React.ElementType; | ||
error?: boolean; | ||
errorMessage?: string; | ||
disabled?: boolean; | ||
}; | ||
|
||
const SelectTemplate: Story = { | ||
render: ({ placeholder, ...arg }: SelectTemplateProps) => { | ||
return ( | ||
<Select placeholder={placeholder} {...arg}> | ||
<Select.Item value="1" placeholder="data1" /> | ||
<Select.Item value="2" placeholder="data2" /> | ||
<Select.Item value="3" placeholder="data3" /> | ||
</Select> | ||
); | ||
}, | ||
}; | ||
|
||
export const Default = { | ||
...SelectTemplate, | ||
args: { | ||
placeholder: 'Select..', | ||
}, | ||
}; | ||
|
||
export const Disabled = { | ||
...SelectTemplate, | ||
args: { | ||
placeholder: 'Select..', | ||
disabled: true, | ||
}, | ||
}; | ||
|
||
export const WithDefaultValue = { | ||
...SelectTemplate, | ||
args: { | ||
placeholder: 'Select..', | ||
defaultValue: '2', | ||
}, | ||
}; | ||
|
||
export const WithIcon = { | ||
...SelectTemplate, | ||
args: { | ||
placeholder: 'Select..', | ||
icon: ShieldExclamationIcon, | ||
}, | ||
}; | ||
|
||
export const WithError = { | ||
...SelectTemplate, | ||
args: { | ||
placeholder: 'Select..', | ||
error: true, | ||
errorMessage: 'error message', | ||
}, | ||
}; |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preview ์ ๋ฃ์ด๋ ์ข์ ๊ฒ ๊ฐ์์!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preview์ ์ถ๊ฐํ์ต๋๋ค
eb71071