Skip to content

Commit 607210f

Browse files
refactor: JDS Radio 컴포넌트 vanilla-extract 마이그레이션 (#437)
* chore: @react-aria/radio 패키지 의존성 추가 * feat: 컨테이너 요소용 인터랙션 훅 구현 * chore: focusRing, forwardRef, overlay 유틸 export 추가 * refactor: Radio VE 마이그레이션 * fix: Radio.Item empty 탭 확장 영역 비대칭 수정 및 inset으로 단순화 * fix: Radio.Item empty 탭 영역 inset 값을 피그마 기준으로 수정 * refactor: Radio 타이포 토큰 vars 참조 교체 및 recipe defaultVariants 제거 * refactor: Radio variant 옵션 상수 분리 * fix: Radio Item inset 단위를 px에서 rem으로 수정 * refactor: 제어/비제어 모드 타입 내로잉 * refactor: radioGroup 스타일링을 VE className으로 교체 * fix: Radio.Basic 그룹에서 개별 onChange가 누락되는 문제 수정 * fix: Radio.Basic isDisabled 계산 시 상위 컨텍스트의 disabled 무시되는 문제 수정 * fix: Radio.Basic value를 필수값으로 강제
1 parent bddcf51 commit 607210f

15 files changed

Lines changed: 638 additions & 420 deletions

package-lock.json

Lines changed: 18 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/jds/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@
6969
"@react-aria/button": "^3.15.0",
7070
"@react-aria/focus": "^3.22.0",
7171
"@react-aria/interactions": "^3.28.0",
72+
"@react-aria/radio": "^3.13.0",
7273
"@react-aria/utils": "^3.34.0",
7374
"clsx": "^2.1.1",
74-
"radix-ui": "^1.4.3"
75+
"radix-ui": "^1.4.3",
76+
"react-stately": "^3.46.0"
7577
},
7678
"devDependencies": {
7779
"@chromatic-com/storybook": "^4.1.3",

packages/jds/src/components/Radio/Radio.stories.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ const meta: Meta<typeof Radio.Item> = {
99
parameters: {
1010
layout: "centered",
1111
},
12-
argTypes: {
13-
radioSize: {
14-
control: { type: "radio" },
15-
options: ["lg", "md", "sm", "xs"],
16-
},
17-
},
1812
} satisfies Meta<typeof Radio.Item>;
1913

2014
export default meta;
@@ -40,13 +34,13 @@ export const RadioBasicDisabled: Story = {
4034
</FlexRow>
4135
<span>Radio.Root를 통해 그룹 전체를 비활성화합니다.</span>
4236
<FlexRow>
43-
<Radio.Root disabled name='rootControl'>
37+
<Radio.Root disabled defaultValue='2' name='rootControl'>
4438
<Radio.Item>
4539
<Radio.Basic value='1' />
4640
<Radio.Label>레이블</Radio.Label>
4741
</Radio.Item>
4842
<Radio.Item>
49-
<Radio.Basic value='2' checked />
43+
<Radio.Basic value='2' />
5044
<Radio.Label>레이블</Radio.Label>
5145
</Radio.Item>
5246
</Radio.Root>
@@ -140,7 +134,7 @@ export const RadioAlign: Story = {
140134
render: () => (
141135
<FlexColumn>
142136
<FlexRow style={{ alignItems: "flex-start" }}>
143-
<Radio.Root radioStyle='empty' radioSize='lg' radioAlign='right' name='emptyStyle'>
137+
<Radio.Root radioStyle='empty' radioSize='lg' radioAlign='right' name='emptyRight'>
144138
<Radio.Item>
145139
<Radio.Label>레이블</Radio.Label>
146140
<Radio.Basic value='1' />
@@ -162,7 +156,7 @@ export const RadioAlign: Story = {
162156
</Radio.Root>
163157
</FlexRow>
164158
<FlexRow style={{ alignItems: "flex-start" }}>
165-
<Radio.Root radioStyle='outline' radioSize='lg' radioAlign='right' name='outlineStyle'>
159+
<Radio.Root radioStyle='outline' radioSize='lg' radioAlign='right' name='outlineRight'>
166160
<Radio.Item>
167161
<Radio.Label>레이블</Radio.Label>
168162
<Radio.Basic value='1' />

packages/jds/src/components/Radio/Radio.style.ts

Lines changed: 0 additions & 262 deletions
This file was deleted.

0 commit comments

Comments
 (0)