-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/master' into HEAD
- Loading branch information
Showing
57 changed files
with
3,155 additions
and
2,737 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
20.17.0 | ||
20.18.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// src/components 配下のコンポーネントを取得得する | ||
import fs from 'fs' | ||
|
||
const components = fs | ||
.readdirSync('src/components') | ||
.map((name) => ({ name, value: name })) | ||
.sort() | ||
|
||
export default ( | ||
/** @type {import('plop').NodePlopAPI} */ | ||
plop, | ||
) => { | ||
plop.setGenerator('story', { | ||
description: 'Story の雛形を作ります。', | ||
prompts: [ | ||
{ | ||
type: 'list', | ||
name: 'name', | ||
message: '作成対象コンポーネントを選択してください。', | ||
choices: components, | ||
loop: false, | ||
}, | ||
], | ||
actions: [ | ||
{ | ||
type: 'addMany', | ||
destination: 'src/components/{{name}}/stories', | ||
base: 'scaffold/templates/stories', | ||
templateFiles: 'scaffold/templates/stories/*.hbs', | ||
}, | ||
], | ||
}) | ||
} |
53 changes: 53 additions & 0 deletions
53
packages/smarthr-ui/scaffold/templates/stories/VRT{{ pascalCase name }}.stories.tsx.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { fireEvent, within } from '@storybook/test' | ||
import React from 'react' | ||
|
||
import { Stack } from '../../Layout' | ||
import { {{ name }} } from '../{{ name }}' | ||
|
||
import type { StoryObj } from '@storybook/react' | ||
|
||
export default { | ||
title: 'SomeCategory(カテゴリ)/{{ name }}/VRT', | ||
/* ペアワイズ法による網羅 */ | ||
render: (args: any) => ( | ||
<Stack {...args}> | ||
<{{ name }} /> | ||
<{{ name }} /> | ||
</Stack> | ||
), | ||
parameters: { | ||
chromatic: { disableSnapshot: false }, | ||
}, | ||
tags: ['!autodocs'], | ||
} | ||
|
||
export const VRT = {} | ||
|
||
export const VRTHover = { | ||
...VRT, | ||
args: { | ||
id: 'hover', | ||
}, | ||
parameters: { | ||
pseudo: { | ||
hover: ['#hover .smarthr-ui-{{ name }}'], | ||
}, | ||
// MEMO: VRT として機能していないので、解決するまでスナップショットを無効化 | ||
chromatic: { disableSnapshot: true }, | ||
}, | ||
} | ||
|
||
export const VRTKeyboardFocus: StoryObj = { | ||
...VRT, | ||
play: async ({ canvasElement }) => { | ||
const canvas = within(canvasElement) | ||
// FIXME: ここにフォーカス処理を書いて | ||
}, | ||
} | ||
|
||
export const VRTForcedColors: StoryObj = { | ||
...VRT, | ||
parameters: { | ||
chromatic: { forcedColors: 'active' }, | ||
}, | ||
} |
34 changes: 34 additions & 0 deletions
34
packages/smarthr-ui/scaffold/templates/stories/{{ pascalCase name }}.stories.tsx.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react' | ||
|
||
import { {{ name }} } from '../{{ name }}' | ||
|
||
import type { Meta, StoryObj } from '@storybook/react' | ||
|
||
export default { | ||
title: 'SomeCategory(カテゴリ)/{{ name }}', | ||
component: {{ name }}, | ||
render: (args) => <{{ name }} {...args} />, | ||
args: { | ||
}, | ||
parameters: { | ||
chromatic: { disableSnapshot: true }, | ||
}, | ||
} as Meta<typeof {{ name }}> | ||
|
||
export const Default: StoryObj<typeof {{ name }}> = { | ||
args: { | ||
}, | ||
} | ||
|
||
export const {{ name }}Control: StoryObj<typeof {{ name }}> = { | ||
name: 'Playground', | ||
args: { | ||
}, | ||
} | ||
|
||
export const SomeProps: StoryObj<typeof {{ name }}> = { | ||
name: 'someProps', | ||
args: { | ||
someProps: someValue, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.