-
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
[TASK-67] feat: 디자인 시스템 수정 및 추가사항 반영 (색상, 아이콘, Input) #42
Changes from all commits
9c312fe
a0415a1
64e4768
418d76a
bf7de5d
08ebfdd
66e9fc0
0df6309
de3007d
f3e2c11
7b59f5a
1f11412
1d645e8
2a4406f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
export type IconSize = 'xl' | 'l' | 'm' | 's'; | ||
|
||
const iconSizes: Record<IconSize, string> = { | ||
xl: 'w-15 h-15', | ||
l: 'w-7.5 h-7.5', | ||
xl: 'w-[60px] h-[60px]', | ||
l: 'w-[30px] h-[30px]', | ||
m: 'w-6 h-6', | ||
s: 'w-4.5 h-4.5', | ||
s: 'w-[18px] h-[18px]', | ||
}; | ||
|
||
export default iconSizes; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { IconProps } from '@/types'; | ||
|
||
const MoreVertical = ({ className }: IconProps) => { | ||
return ( | ||
<svg | ||
className={className} | ||
viewBox='0 0 30 30' | ||
fill='none' | ||
xmlns='http://www.w3.org/2000/svg' | ||
> | ||
<path | ||
fillRule='evenodd' | ||
clipRule='evenodd' | ||
d='M13.75 6.875C13.75 7.91053 14.5895 8.75 15.625 8.75C16.6605 8.75 17.5 7.91053 17.5 6.875C17.5 5.83947 16.6605 5 15.625 5C14.5895 5 13.75 5.83947 13.75 6.875ZM13.7134 15.1001C13.7134 16.1356 14.5528 16.9751 15.5884 16.9751C16.6239 16.9751 17.4634 16.1356 17.4634 15.1001C17.4634 14.0646 16.6239 13.2251 15.5884 13.2251C14.5528 13.2251 13.7134 14.0646 13.7134 15.1001ZM15.4883 25.188C14.4527 25.188 13.6133 24.3485 13.6133 23.313C13.6133 22.2775 14.4527 21.438 15.4883 21.438C16.5238 21.438 17.3633 22.2775 17.3633 23.313C17.3633 24.3485 16.5238 25.188 15.4883 25.188Z' | ||
fill='currentColor' | ||
/> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default MoreVertical; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
'use client'; | ||
|
||
import { Input } from '@nextui-org/react'; | ||
import { ChangeEvent, useState } from 'react'; | ||
|
||
import Icon from '../Icon/Icon'; | ||
|
||
interface BasicInputProps { | ||
type?: string; | ||
label?: string; | ||
placeholder?: string; | ||
|
||
value: string; | ||
onChange: (e: ChangeEvent<HTMLInputElement>) => void; | ||
|
||
showClear?: boolean; | ||
onClear?: () => void; | ||
showEyeIcon?: boolean; | ||
showTextLength?: boolean; | ||
isInvalid?: boolean; | ||
minLength?: number; | ||
maxLength?: number; | ||
errorMessage?: string; | ||
successMessage?: string; | ||
} | ||
|
||
const BasicInput = ({ | ||
type, | ||
label, | ||
placeholder, | ||
value, | ||
onChange, | ||
showClear = false, | ||
onClear, | ||
showEyeIcon = false, | ||
showTextLength = false, | ||
isInvalid = false, | ||
minLength, | ||
maxLength, | ||
errorMessage, | ||
successMessage, | ||
}: BasicInputProps) => { | ||
const [isPasswordVisible, setIsPasswordVisible] = useState(false); | ||
|
||
const togglePasswordVisibility = () => | ||
setIsPasswordVisible(!isPasswordVisible); | ||
|
||
const currentTextLength = value.length; | ||
const textLengthColor = | ||
currentTextLength === 0 | ||
? 'text-gray-700' | ||
: maxLength && currentTextLength > maxLength | ||
? 'text-system-error' | ||
: 'text-white'; | ||
|
||
return ( | ||
<div> | ||
<Input | ||
type={showEyeIcon && isPasswordVisible ? 'text' : type || 'text'} | ||
label={label} | ||
labelPlacement='outside' | ||
placeholder={placeholder} | ||
value={value} | ||
onChange={onChange} | ||
onClear={showClear ? onClear : undefined} | ||
isInvalid={false} | ||
minLength={minLength} | ||
maxLength={maxLength} | ||
endContent={ | ||
<> | ||
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. 드문 경우겠지만 endContent의 해당 요소들이 모두 true로서 보이게 되었을때 정렬 문제는 없나요? 요소들이 단순히 태그로 묶여있어서 코멘트 드렸습니다..! 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. 엇 디자인 시스템에 하지만 향후 |
||
{showEyeIcon && ( | ||
<button | ||
type='button' | ||
aria-label='toggle password visibility' | ||
onClick={togglePasswordVisibility} | ||
disabled={value === ''} | ||
> | ||
<Icon | ||
name={isPasswordVisible ? 'Eye' : 'EyeOff'} | ||
size='m' | ||
className={`text-gray-200 ${value === '' ? 'text-gray-800' : ''}`} | ||
/> | ||
</button> | ||
)} | ||
|
||
{showTextLength && maxLength && ( | ||
<div className='flex items-center'> | ||
<span className={`placeholder ${textLengthColor}`}> | ||
{currentTextLength} | ||
</span> | ||
<span className='placeholder text-gray-700'>/{maxLength}</span> | ||
</div> | ||
)} | ||
</> | ||
} | ||
classNames={{ | ||
label: ['custom-label', 'top-5', '!text-gray-400'], | ||
input: 'placeholder:text-gray-700', | ||
inputWrapper: ['bg-gray-900', 'rounded-md', 'h-15'], | ||
}} | ||
/> | ||
<div className='flex items-center mt-[3px] h-[26px]'> | ||
{isInvalid && errorMessage ? ( | ||
<> | ||
<Icon | ||
name='CheckCircleFilled' | ||
size='s' | ||
className='text-system-error mr-2' | ||
/> | ||
<p className='button-s text-system-error'>{errorMessage}</p> | ||
</> | ||
) : ( | ||
successMessage && ( | ||
<> | ||
<Icon | ||
name='AlertCircle' | ||
size='s' | ||
className='text-gray-400 mr-2' | ||
/> | ||
<p className='button-s text-system-success'>{successMessage}</p> | ||
</> | ||
) | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BasicInput; |
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.
엇 얘만 따로 변경사항이 없는데 일부러 남겨두신 걸까요? 해당 크기를 추측하는데는 어려움은 없지만 다른 값들과 포멧이 달라 다른 의도가 있는지 궁금해서 코멘트 남깁니다!
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.
아 ㅋㅋㅋㅋ m 사이즈만
Tailwind CSS
클래스에 등록돼 있어서 커스텀 하지 않고 그대로 작성했습니다! 혹시 포맷이 달라서 불편하시면 알려주셔용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.
아하 아닙니다 ㅎㅎ 그대로 가도 좋습니다!