Skip to content

Commit

Permalink
Merge pull request #499 from pixiv/chore/storybook-Radio
Browse files Browse the repository at this point in the history
chore: Radio story
  • Loading branch information
toshusai authored Apr 5, 2024
2 parents 6b68a60 + dbb1501 commit dc3642b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storybook Tests Radio Basic 1`] = `
exports[`Storybook Tests Radio Default 1`] = `
.c2 {
display: grid;
grid-template-columns: auto 1fr;
Expand Down
10 changes: 4 additions & 6 deletions packages/react/src/components/Radio/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import { useState } from 'react'
export default {
title: 'Radio',
component: Radio,
args: {
name: 'name',
label: 'label',
},
parameters: {
layout: 'centered',
},
Expand All @@ -22,15 +18,17 @@ const LayoutDiv = styled.div`
gap: ${({ theme }) => px(theme.spacing[24])};
`

export const Basic: StoryObj<typeof Radio> = {
render: function Render() {
export const Default: StoryObj<typeof Radio> = {
render: function Render(args) {
const options = ['1', '2', '3']
const [value, setValue] = useState(options[0])

return (
<LayoutDiv>
<RadioGroup
label={'label'}
name={'name'}
{...args}
value={value}
onChange={setValue}
>
Expand Down

0 comments on commit dc3642b

Please sign in to comment.