diff --git a/apps/web/package.json b/apps/web/package.json index c21f774..1035dcb 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -44,6 +44,7 @@ "@pandacss/dev": "0.36.1", "@radix-ui/colors": "3.0.0", "@storybook/addon-a11y": "8.0.5", + "@storybook/addon-actions": "8.1.3", "@storybook/addon-essentials": "8.0.5", "@storybook/addon-interactions": "8.0.5", "@storybook/addon-links": "8.0.5", diff --git a/apps/web/src/components/Checkbox/Checkbox.stories.tsx b/apps/web/src/components/Checkbox/Checkbox.stories.tsx new file mode 100644 index 0000000..f5ef8c2 --- /dev/null +++ b/apps/web/src/components/Checkbox/Checkbox.stories.tsx @@ -0,0 +1,114 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { expect, fn, userEvent, within } from '@storybook/test'; +import { Checkbox } from './Checkbox'; +import { css } from 'styled-system/css'; + +type Story = StoryObj; + +const meta: Meta = { + component: Checkbox, + tags: ['autodocs'], + args: { + id: 'example', + 'aria-labelledby': 'example-label', + onChange: fn(), + checked: undefined, + }, + decorators: [ + // a11yテストでラベルが存在しないエラーを防ぐために