Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tall-needles-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@devup-ui/components": patch
---

Feat Radio components
2 changes: 1 addition & 1 deletion apps/rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@devup-ui/react": "workspace:*"
},
"devDependencies": {
"@rsbuild/core": "^1.5.3",
"@rsbuild/core": "^1.5.6",
"@rsbuild/plugin-react": "^1.4.0",
"@devup-ui/rsbuild-plugin": "workspace:*"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/vite-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"vite-plugin-dts": "^4.5.4",
"@devup-ui/vite-plugin": "workspace:*",
"@vitejs/plugin-react": "^5.0.2",
"vite": "^7.1.4",
"vite": "^7.1.5",
"typescript": "^5",
"@types/node": "^24",
"@types/react": "^19"
Expand Down
2 changes: 1 addition & 1 deletion apps/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"devDependencies": {
"@devup-ui/vite-plugin": "workspace:*",
"vite": "^7.1.4",
"vite": "^7.1.5",
"@vitejs/plugin-react": "^5.0.2",
"typescript": "^5",
"@types/node": "^24",
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
},
"devDependencies": {
"eslint-plugin-devup": "^2.0.5",
"eslint": "^9.34.0",
"eslint": "^9.35.0",
"vitest": "^3.2.4",
"@vitest/coverage-v8": "^3.2.4",
"@changesets/cli": "^2.29.6",
"@changesets/cli": "^2.29.7",
"@types/node": "^24.3.1",
"happy-dom": "^18.0.1",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "14.6.1",
"@testing-library/jest-dom": "^6.8.0",
"@devup-ui/vite-plugin": "workspace:*"
},
Expand Down
12 changes: 6 additions & 6 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@
},
"devDependencies": {
"@devup-ui/vite-plugin": "workspace:*",
"@storybook/addon-docs": "^9.1.4",
"@storybook/addon-onboarding": "^9.1.4",
"@storybook/react-vite": "^9.1.4",
"@storybook/addon-docs": "^9.1.5",
"@storybook/addon-onboarding": "^9.1.5",
"@storybook/react-vite": "^9.1.5",
"@types/react": "^19.1.12",
"eslint-plugin-storybook": "^9.1.4",
"eslint-plugin-storybook": "^9.1.5",
"rollup-plugin-preserve-directives": "^0.4.0",
"storybook": "^9.1.4",
"storybook": "^9.1.5",
"typescript": "^5.9.2",
"vite": "^7.1.4",
"vite": "^7.1.5",
"vite-plugin-dts": "^4.5.4",
"vitest": "^3.2.4"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/__tests__/index.browser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ describe('export', () => {
Input: expect.any(Function),
Stepper: expect.any(Function),
Select: expect.any(Function),
Radio: expect.any(Function),
RadioGroup: expect.any(Function),
SelectContainer: expect.any(Function),
SelectDivider: expect.any(Function),
SelectOption: expect.any(Function),
Expand Down
29 changes: 29 additions & 0 deletions packages/components/src/components/Radio/Radio.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Radio } from '.'

export default {
title: 'Devfive/Radio',
component: Radio,
}

export const Default = {
args: {
checked: undefined,
colors: {
primary: 'var(--primary)',
border: 'var(--border)',
text: 'var(--text)',
bg: 'var(--bg)',
hoverBg: 'var(--hoverBg)',
hoverBorder: 'var(--hoverBorder)',
hoverColor: 'var(--hoverColor)',
checkedBg: 'var(--checkedBg)',
checkedBorder: 'var(--checkedBorder)',
checkedColor: 'var(--checkedColor)',
disabledBg: 'var(--disabledBg)',
disabledColor: 'var(--disabledColor)',
},
name: 'radio',
children: '옵션1',
variant: 'default',
},
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import { render } from '@testing-library/react'

import { Radio } from '../index'

vi.mock('react', async (originImport: any) => {
const origin = await originImport()
return {
...origin,
cache: vi.fn((arg) => arg),
}
})
describe('Radio', () => {
it('should Radio snapshot', () => {
expect(render(<Radio />).container).toMatchSnapshot()
expect(render(<Radio variant="button" />).container).toMatchSnapshot()
expect(render(<Radio disabled />).container).toMatchSnapshot()
expect(
render(<Radio disabled variant="button" />).container,
).toMatchSnapshot()
expect(
render(
<Radio
disabled
style={{
width: '500px',
}}
/>,
).container,
).toMatchSnapshot()
expect(
render(
<Radio
disabled
style={{
width: '500px',
}}
styles={{
label: {
width: '500px',
},
}}
variant="button"
/>,
).container,
).toMatchSnapshot()
expect(
render(
<Radio
disabled
style={{
width: '500px',
}}
styles={{
label: {
width: '500px',
},
}}
/>,
).container,
).toMatchSnapshot()

expect(
render(
<Radio
className="className"
classNames={{ label: 'classNameLabel' }}
disabled
variant="button"
/>,
).container,
).toMatchSnapshot()
expect(
render(
<Radio
className="className"
classNames={{ label: 'classNameLabel' }}
disabled
/>,
).container,
).toMatchSnapshot()

expect(
render(<Radio firstButton variant="button" />).container,
).toMatchSnapshot()
expect(
render(<Radio lastButton variant="button" />).container,
).toMatchSnapshot()
})
})
Loading