feat: Radio 재정비 + Select 컴파운드 컴포넌트 추가 - #20
Open
hamxxn wants to merge 3 commits into
Open
Conversation
primary variant는 Select 전용 인디케이터로 옮겨갔으므로, Radio에는 실제로 남아 쓰이는 outline 스타일(원형, 반투명+blur)만 남긴다. 클릭 가능한 <button> 동작은 그대로 유지.
shadcn dropdown-menu 스타일의 Root/Trigger/Content/Item 컴파운드 패턴으로 구현. Context로 열림/선택값 상태를 공유하고, floating-ui 없이 CSS 포지셔닝(Trigger 뒤로 Content가 겹치는 구조)으로 배치한다. 바깥 클릭·Esc로 닫히고, 옵션 선택 시 자동으로 닫힌다. Trigger의 라벨은 선택값과 무관한 고정 텍스트이고, 선택 여부는 dot 색으로만 표시한다.
4 tasks
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
sohxxny
reviewed
Aug 10, 2026
|
|
||
| // Select.Item 스타일 | ||
| export const SELECT_ITEM = { | ||
| base: "flex items-center justify-between pl-[1.6rem] pr-[2.6rem] py-[1.9rem] text-tertiary-100 active:text-primary-500 typo-body-regular", |
Member
There was a problem hiding this comment.
cursor-pointer 추가하는 것 어떤가요?
그리고 지금은 active:text-primary-500가 있어서 클릭하는 순간에만 텍스트 색깔이 달라지고 selected 되었을 때 바뀌는 색깔은 점(동그라미)밖에 없어서욮!! 텍스트도 함께 변경해주시면 감사하겠습니다!
Collaborator
Author
There was a problem hiding this comment.
텍스트 자체는 변경이 안되는 것으로 알고있어요!
Content를 absolute 대신 relative + 음수 margin-top으로 Trigger 뒤에 겹치게 해서, 열렸을 때 레이아웃 공간을 정상적으로 차지하고 아래 형제 요소를 밀어내도록 했다. Root wrapper도 inline-flex flex-col로 바꿔 Trigger/Content 너비가 자연스럽게 맞도록 했다. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
|
||
| const setValue = useCallback( | ||
| (next: string) => { | ||
| setUncontrolledValue(next); |
Member
There was a problem hiding this comment.
controlled 일때도 안쓰이는 내부 상태가 계속 갱신되는 상태인데, 분기 추가해서 controlled일땐 건드리지 않게 해두면 좋을 것 같아요!
+open 도 동일합니닷
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Summary
Radio의 두 variant(primary/outline)가 서로 다른 용도로 쓰이고 있던 걸 정리했다.primary(둥근 사각형 + dot)는Select전용 인디케이터로 옮기고,Radio에는 실제로 계속 쓰이는outline스타일(원형, 반투명+blur)만 남겼다. shadcn dropdown-menu 스타일의Select컴파운드 컴포넌트(Root/Trigger/Content/Item)를 새로 추가했다.사용 방법
Related Issues
PR Point (To Reviewer)
registerItemLabel등)을 전부 걷어내고Select.Trigger가children을 그대로 받는 방식으로 단순화했다. 이슈 본문은 옛 스펙(자동 라벨) 그대로라 갱신이 필요하다.top-full로 Trigger 바로 아래 붙이면 Trigger(rounded-[1.6rem])와 Content(rounded-[2rem])의 border-radius가 달라서 이음새가 어긋나 보였다. Trigger에 더 높은 z-index를 줘서 겹치게 만들어 이음새를 없앤 아이디어 자체는 유지하되, 처음엔 Content를absolute top-0 + pt-[6rem]로 구현했었다. 그런데 이렇게 하면 Content가 레이아웃 흐름에서 완전히 빠져서,Select를 여러 개 세로로 쌓아둔 상태(지금HomePage처럼)에서 하나를 열면 자기 높이만큼 아래 형제Select를 밀어내지 못하고 그 위를 그냥 덮어버리는 문제가 있었다.absolute대신relative -mt-[6rem]로 바꿔서, 시각적으로는 여전히 Trigger 뒤로 파고들지만 레이아웃 공간은 정상적으로 차지해 열렸을 때 아래 요소가 밀려나도록 고쳤다. 바깥 클릭 감지는 Trigger+Content를 감싸는 wrapper 전체 기준이라 겹쳐도 오작동하지 않는다.Select.Root를inline-block으로,Select.Content는inset-x-0로 Trigger 폭을 상속받게 했는데, Content가absolute를 벗어나 일반 흐름으로 옮기면서inset-x-0트릭을 쓸 수 없게 됐다. 대신Select.Root를inline-flex flex-col로 바꿔서, flex가 자식 중 가장 넓은 요소(Trigger) 기준으로 컨테이너 폭을 잡고align-items: stretch로 Content도 같은 폭으로 늘어나게 했다.Select.Item은<button>이 아니라 클릭 가능한<li role="option">이라Radio(버튼)를 중첩하지 않는다. 방향키 옵션 네비게이션은 범위 밖(네이티브 버튼의 Enter/Space만 활용).Screenshot
ETC
없음