-
Notifications
You must be signed in to change notification settings - Fork 2
Feat[#THKV-121] : Selectbox 및 하위 컴포넌트 리디자인 및 리팩토링 #118
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
da4c09b
feat: Body2Grey200 typo 추가
grapefruit13 207720f
fix: ArrowDown svg 파일 변경
grapefruit13 20b4f65
fix: ArrowUp svg 파일 변경
grapefruit13 c878b0c
fix: ArrowUp,Down type fill로 수정
grapefruit13 586331d
style: custom-scrollbar 스타일 수정
grapefruit13 7912f00
feat: select-test 페이지 구현
grapefruit13 115ce1b
fix: select-test 페이지 타이포 임포트 수정
grapefruit13 2e7ca0b
style: selectButtonVariants 리디자인 적용
grapefruit13 e517249
feat: selectButton 리디자인 적용- buttonSize, bgColor 프롭 추가
grapefruit13 3c94bf2
style: selectIcons 리디자인 right-4 추가, 기존 size 스타일 초기화
grapefruit13 21022e0
style: Dropdownvariants 리디자인, 기존 size 스타일 초기화
grapefruit13 1d322fd
feat: Selectbox 리디자인-bgColor,buttonsize 타입 정의
grapefruit13 0d17440
style: optionListVariants 리디자인 적용, 기존 size 스타일 초기화
grapefruit13 033260c
feat: useToggleable 훅 구현 - ref 바깥 클릭시 닫히게
grapefruit13 5ba8ffd
refactor: selectbox - useToggleable 훅 적용
grapefruit13 b509bd5
feat: button variant 스타일 필요없을 때 사용 가능한 default variant 추가
grapefruit13 f688458
fix: 콘솔로그 삭제
grapefruit13 92675da
fix: typoVariants buttonsize tailwind 속성명 개선
grapefruit13 fc0d2a4
fix: SelectButton - 버튼 태그 Button 컴포넌트로 교체
grapefruit13 e56fea7
fix: optionList variants 공통 스타일 해당 컴포넌트에 직접 적용
grapefruit13 96c4ce9
fix: optionList variants 공통 스타일 해당 컴포넌트에 직접 적용
grapefruit13 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 hidden or 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,44 @@ | ||
| import React from 'react'; | ||
| import { Selectbox } from '@/components/common/Selectbox'; | ||
| import { Body2Black } from '@/components/common/Typography'; | ||
|
|
||
| const options = [ | ||
| { value: 'option1', label: '옵션 1' }, | ||
| { value: 'option2', label: '옵션 2' }, | ||
| { value: 'option3', label: '옵션 3' }, | ||
| { value: 'option4', label: '옵션 4' }, | ||
| { value: 'option5', label: '옵션 5' }, | ||
| { value: 'option6', label: '옵션 6' }, | ||
| { value: 'option7', label: '옵션 7' }, | ||
| { value: 'option8', label: '옵션 8' }, | ||
| { value: 'option9', label: '옵션 9' }, | ||
| { value: 'option10', label: '옵션 10' }, | ||
| ]; | ||
|
|
||
| const page = () => { | ||
| return ( | ||
| <div className='mt-20 bg-[#D8D8D8] p-4'> | ||
| <Body2Black>Select Box</Body2Black> | ||
| <div className='flex flex-col gap-2'> | ||
| <Selectbox options={options} buttonSize='sm' /> | ||
| <Selectbox options={options} buttonSize='sm' bgColor='grey' /> | ||
| <Selectbox options={options} buttonSize='md' /> | ||
| <Selectbox options={options} buttonSize='md' bgColor='grey' /> | ||
| <Selectbox | ||
| options={options} | ||
| buttonSize='sm' | ||
| bgColor='disabled' | ||
| readonly | ||
| /> | ||
| <Selectbox | ||
| options={options} | ||
| buttonSize='md' | ||
| bgColor='disabled' | ||
| readonly | ||
| /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default page; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,25 +1,25 @@ | ||
| import { cva } from 'class-variance-authority'; | ||
|
|
||
| // 추후 variants 비롯 파일 전체 삭제 | ||
| export const optionListUlVariants = cva('flex h-full w-full flex-col', { | ||
| variants: { | ||
| // 추후 삭제 | ||
| size: { | ||
| small: 'pl-2 pt-2 pb-2 pr-1 gap-1 text-sm rounded-md', | ||
| basic: | ||
| 'pl-[10px] pt-[10px] pb-[10px] pr-[5px] gap-2 text-basic rounded-lg', | ||
| large: 'pl-3 pt-3 pb-3 pr-[6px] gap-2 text-lg rounded-lg', | ||
| small: '', | ||
| basic: '', | ||
| large: '', | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| export const optionListLiVariants = cva( | ||
| 'cursor-pointer rounded-md hover:bg-gray-100 active:bg-gray-200', | ||
| { | ||
| variants: { | ||
| size: { | ||
| small: 'pt-2 pb-2 pl-2 mr-1 gap-1 text-sm rounded-md', | ||
| basic: 'p-[10px] mr-[5px] gap-2 text-basic rounded-lg ', | ||
| large: 'pl-3 mr-[6px] pt-3 pb-3 py-4 gap-2 text-lg rounded-lg', | ||
| }, | ||
| // 추후 variants 비롯 파일 전체 삭제 | ||
| export const optionListLiVariants = cva('', { | ||
| variants: { | ||
| // 추후 삭제 | ||
| size: { | ||
| small: '', | ||
| basic: '', | ||
| large: '', | ||
| }, | ||
| }, | ||
| ); | ||
| }); |
This file contains hidden or 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
34 changes: 29 additions & 5 deletions
34
src/components/common/SelectButton/SelectButton.variant.tsx
This file contains hidden or 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 |
|---|---|---|
| @@ -1,17 +1,41 @@ | ||
| import { cva } from 'class-variance-authority'; | ||
|
|
||
| export const selectButtonVariants = cva( | ||
| 'w-fit border-[1px] border-gray-300 rounded-md bg-white-100 text-left text-nowrap focus:border-green-700 focus:outline-none', | ||
| 'w-full rounded-lg text-left text-nowrap border border-transparent focus:border-green-500 focus:border focus:outline-none', | ||
| { | ||
| variants: { | ||
| size: { | ||
| small: 'min-w-20 px-3 py-2 text-sm rounded-md pr-8', | ||
| basic: 'min-w-24 px-5 py-3 text-basic rounded-lg pr-10', | ||
| large: 'min-w-28 px-7 py-5 text-lg rounded-lg pr-12', | ||
| buttonSize: { | ||
| sm: 'h-12 px-4 py-3', | ||
| md: 'h-16 px-4 py-4', | ||
| }, | ||
| bgColor: { | ||
| grey: 'bg-grey-50', | ||
| white: 'bg-white-100', | ||
| disabled: | ||
| 'bg-grey-100 text-grey-500 cursor-not-allowed focus:border-transparent', | ||
| }, | ||
| isError: { | ||
| true: 'border-red-300', | ||
| }, | ||
| // 리디자인 완성 시 삭제 | ||
| size: { | ||
| small: 'min-w-20 px-3 py-2 text-sm rounded-md pr-8', | ||
| basic: 'min-w-24 px-5 py-3 text-base rounded-lg pr-10', | ||
| large: 'min-w-28 px-7 py-5 text-lg rounded-lg pr-12', | ||
| }, | ||
| }, | ||
| }, | ||
| ); | ||
|
|
||
| export const typoVariants = cva('whitespace-pre-line text-wrap', { | ||
| variants: { | ||
| buttonSize: { | ||
| sm: 'text-lg leading-[1.52] tracking-[-0.008em] font-medium', | ||
| md: 'text-base leading-[1.52] tracking-[-0.008em] font-medium', | ||
| }, | ||
| state: { | ||
| selected: 'text-black-100', | ||
| placeholder: 'text-grey-200', | ||
| }, | ||
| }, | ||
| }); |
This file contains hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.