-
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
[Feat/#37] Input 컴포넌트 구현 #38
Merged
Merged
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7966c30
feat: input 컴포넌트 구현
zzz-myam 5022b34
feat: input 컴포넌트 스토리북 구현
zzz-myam 9630868
setting: git merge develop
zzz-myam c6b4d29
chore: git merge develop 후 후순위 이슈로 잠정적 중단
zzz-myam 300338f
setting: git merge develop
zzz-myam de1d287
chore: pr fail 해결
zzz-myam b845b3c
feat: input 컴포넌트 80% 완성
zzz-myam 1de9a2f
input 컴포넌트 완성
zzz-myam b18be01
App.tsx 파일 최신화
zzz-myam feefc40
chore: 코드리뷰 반영
zzz-myam 82a455f
feat: input 완성
zzz-myam c408435
chore: base 폰트 추가
zzz-myam efcb0c0
chore: 트렌지션 수정
zzz-myam 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,12 @@ | ||
import type { SVGProps } from 'react'; | ||
const SvgIcFormDot = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 20 20" | ||
{...props} | ||
> | ||
<circle cx={10} cy={10} r={1.5} fill="#454545" /> | ||
</svg> | ||
); | ||
export default SvgIcFormDot; |
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,13 @@ | ||
import type { SVGProps } from 'react'; | ||
const SvgIcFormDotdot = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 10 20" | ||
{...props} | ||
> | ||
<circle cx={5} cy={7} r={1} fill="#454545" /> | ||
<circle cx={5} cy={13} r={1} fill="#454545" /> | ||
</svg> | ||
); | ||
export default SvgIcFormDotdot; |
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,42 @@ | ||
import { style } from '@vanilla-extract/css'; | ||
import { recipe } from '@vanilla-extract/recipes'; | ||
|
||
import { flexGenerator } from '@styles/generator.css'; | ||
import { vars } from '@styles/theme.css'; | ||
|
||
export const inputContainer = style([ | ||
flexGenerator('column', 'center', 'flex-start'), | ||
{ | ||
gap: '0.4rem', | ||
}, | ||
]); | ||
|
||
export const inputTitle = style([ | ||
flexGenerator(), | ||
vars.fonts.body05_m_14, | ||
{ | ||
color: vars.colors.gray700, | ||
}, | ||
]); | ||
|
||
export const inputStyle = recipe({ | ||
base: { | ||
width: '100%', | ||
backgroundColor: vars.colors.gray100, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이거 백그라운드 컬러 피그마 상에서는 white인것 같은데 확인 부탁드립니다! |
||
borderRadius: '8px', | ||
padding: '1.4rem 2rem', | ||
transition: 'border-color 0.3s ease', | ||
}, | ||
variants: { | ||
state: { | ||
default: { color: vars.colors.gray400 }, | ||
active: { | ||
color: vars.colors.gray900, | ||
border: `1px solid ${vars.colors.red1}`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. border 컬러도 gray500으로 변경된 것 같은데 반영 부탁드립니다! |
||
}, | ||
}, | ||
}, | ||
defaultVariants: { | ||
state: 'default', | ||
}, | ||
}); |
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,31 @@ | ||
import { IcFormDot, IcFormDotdot } from '@svgs'; | ||
|
||
import { inputTitle, inputContainer, inputStyle } from './Input.css'; | ||
|
||
type InputProps = { | ||
inputLabel?: string; | ||
value: string; | ||
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void; | ||
placeholder?: string; | ||
}; | ||
|
||
const Input = ({ inputLabel, value, onChange, placeholder }: InputProps) => { | ||
return ( | ||
<div className={inputContainer}> | ||
<label htmlFor={value} className={inputTitle}> | ||
<IcFormDot width={20} height={20} /> | ||
{inputLabel} <IcFormDotdot width={10} height={20} /> | ||
</label> | ||
<input | ||
className={inputStyle({ state: value ? 'active' : 'default' })} | ||
type="text" | ||
id={value} | ||
value={value} | ||
onChange={onChange} | ||
placeholder={placeholder} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default 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
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,30 @@ | ||
import { Input } from '@components'; | ||
|
||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
const meta: Meta<typeof Input> = { | ||
title: 'Components/Input', | ||
component: Input, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
inputLabel: { control: 'text' }, | ||
value: { control: 'text' }, | ||
onChange: { action: 'changed' }, | ||
placeholder: { control: 'text' }, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
inputLabel: '픽업 날짜/요일/시간(30분 단위로)', | ||
value: '', | ||
onChange: () => {}, | ||
placeholder: '예: 01.03/금/16:30', | ||
}, | ||
}; |
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.
폰트 body07 넣어주시기 바랍니다!