Skip to content

Commit

Permalink
docs(Input): type の Story にラベルとパターンを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
uknmr committed Dec 16, 2024
1 parent 0f0c33e commit dc5464c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default {
parameters: {
chromatic: { disableSnapshot: true },
},
tags: ['skip-test-runner'],
} satisfies Meta<typeof DatePicker>

export const Playground: StoryObj<typeof DatePicker> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default {
parameters: {
chromatic: { disableSnapshot: false },
},
tags: ['!autodocs'],
tags: ['!autodocs', 'skip-test-runner'],
} satisfies Meta<typeof DatePicker>

export const VRT = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,15 @@ export const Type: StoryObj<typeof Input> = {
name: 'type',
render: (args) => (
<Stack>
{[undefined, 'text', 'number', 'password'].map((type) => (
// eslint-disable-next-line smarthr/a11y-input-in-form-control
<Input {...args} type={type} key={type} />
))}
{[undefined, 'text', 'number', 'password', 'date', 'datetime-local', 'time', 'month'].map(
(type) => (
<label key={type}>
{`${type ?? '未指定'}: `}
{/* eslint-disable-next-line smarthr/a11y-input-in-form-control */}
<Input {...args} type={type} key={type} />
</label>
),
)}
</Stack>
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export default {
const value = '2024/11/06'
const placeholder = '日付を入力してください'
const width = '100%'
const showAlternative = (_: Date | null) => <div>alt</div>
const formatDate = (date: Date | null) => dayjs(date).format('YYYY年MM月DD')

const matrics = [
Expand All @@ -35,12 +34,6 @@ export default {
<WarekiPicker error={m.error} disabled={m.disabled} placeholder={placeholder} />
<WarekiPicker error={m.error} disabled={m.disabled} value={value} />
<WarekiPicker error={m.error} disabled={m.disabled} width={width} />
<WarekiPicker
error={m.error}
disabled={m.disabled}
value={value}
showAlternative={showAlternative}
/>
<WarekiPicker
error={m.error}
disabled={m.disabled}
Expand All @@ -55,7 +48,7 @@ export default {
parameters: {
chromatic: { disableSnapshot: false },
},
tags: ['!autodocs'],
tags: ['!autodocs', 'skip-test-runner'],
} satisfies Meta<typeof WarekiPicker>

export const VRT = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default {
parameters: {
chromatic: { disableSnapshot: true },
},
tags: ['skip-test-runner'],
} satisfies Meta<typeof WarekiPicker>

export const Playground: StoryObj<typeof WarekiPicker> = {
Expand Down
5 changes: 0 additions & 5 deletions packages/smarthr-ui/test-runner-jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ module.exports = {
'ComboBox.stories.tsx',
'FieldSet.stories.tsx',
'Switch.stories.tsx',
/**
* error: "Form elements must have labels"
* error: "Elements must only use allowed ARIA attributes"
*/
'DatePicker.stories.tsx',
'FormControl.stories.tsx', // DatePicker を含むために除外
/**
* error: "ARIA attributes must conform to valid values"
Expand Down

0 comments on commit dc5464c

Please sign in to comment.