forked from VOICEVOX/voicevox
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BaseコンポーネントのStorybookファイルを作成 (VOICEVOX#2227)
* storybook/addon-themesを導入 * Baseコンポーネントのstorybookファイルを追加 * 文字色を付与 * onLabel/offLabelをcheckedLabel/uncheckedLabelに改名 * lintを適用 * typecheckエラーを修正 * test-storybookのtimeoutを倍の時間に変更 * 冗長な記述を削除 * clickableのStoryを追加 * test-storybookのtimeoutを更に倍に変更
- Loading branch information
Showing
13 changed files
with
277 additions
and
7 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,34 @@ | ||
import type { Meta, StoryObj } from "@storybook/vue3"; | ||
|
||
import BaseButton from "./BaseButton.vue"; | ||
|
||
const meta: Meta<typeof BaseButton> = { | ||
component: BaseButton, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof BaseButton>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
label: "Default", | ||
variant: "default", | ||
icon: "settings", | ||
}, | ||
}; | ||
|
||
export const Primary: Story = { | ||
args: { | ||
label: "Primary", | ||
variant: "primary", | ||
icon: "settings", | ||
}, | ||
}; | ||
|
||
export const Danger: Story = { | ||
args: { | ||
label: "Danger", | ||
variant: "danger", | ||
icon: "settings", | ||
}, | ||
}; |
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,76 @@ | ||
import type { Meta, StoryObj } from "@storybook/vue3"; | ||
|
||
import BaseDocumentView from "./BaseDocumentView.vue"; | ||
|
||
const meta: Meta<typeof BaseDocumentView> = { | ||
component: BaseDocumentView, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof BaseDocumentView>; | ||
|
||
export const Default: Story = { | ||
render: (args) => ({ | ||
components: { BaseDocumentView }, | ||
|
||
setup() { | ||
return { args }; | ||
}, | ||
|
||
template: ` | ||
<BaseDocumentView> | ||
<h1>Heading 1</h1> | ||
<h2>Heading 2</h2> | ||
<h3>Heading 3</h3> | ||
<h4>Heading 4</h4> | ||
<h5>Heading 5</h5> | ||
<h6>Heading 6</h6> | ||
<p>ParagraphParagraph<a href="#">Link</a>ParagraphParagraph<code>code</code>ParagraphParagraph</p> | ||
<ul> | ||
<li>List</li> | ||
<li>List</li> | ||
<li>List</li> | ||
</ul> | ||
<ol> | ||
<li>List</li> | ||
<li>List</li> | ||
<li>List</li> | ||
</ol> | ||
<pre>pre</pre> | ||
<details> | ||
<summary>summary</summary> | ||
<p>Details</p> | ||
</details> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Table Header</th> | ||
<th>Table Header</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>Table</td> | ||
<td>Table</td> | ||
</tr> | ||
<tr> | ||
<td>Table</td> | ||
<td>Table</td> | ||
</tr> | ||
<tr> | ||
<td>Table</td> | ||
<td>Table</td> | ||
</tr> | ||
<tr> | ||
<td>Table</td> | ||
<td>Table</td> | ||
</tr> | ||
<tr> | ||
<td>Table</td> | ||
<td>Table</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</BaseDocumentView>`, | ||
}), | ||
}; |
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 |
---|---|---|
|
@@ -10,6 +10,8 @@ | |
@use "@/styles/v2/colors" as colors; | ||
.document { | ||
color: colors.$display; | ||
:deep(*) { | ||
margin: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import type { Meta, StoryObj } from "@storybook/vue3"; | ||
|
||
import BaseListItem from "./BaseListItem.vue"; | ||
|
||
const meta: Meta<typeof BaseListItem> = { | ||
component: BaseListItem, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof BaseListItem>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
selected: false, | ||
}, | ||
render: (args) => ({ | ||
components: { BaseListItem }, | ||
setup() { | ||
return { args }; | ||
}, | ||
template: '<BaseListItem v-bind="args">ListItem</BaseListItem>', | ||
}), | ||
}; | ||
|
||
export const Selected: Story = { | ||
...Default, | ||
args: { | ||
selected: true, | ||
}, | ||
}; |
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,37 @@ | ||
import type { Meta, StoryObj } from "@storybook/vue3"; | ||
|
||
import BaseRowCard from "./BaseRowCard.vue"; | ||
|
||
import BaseButton from "./BaseButton.vue"; | ||
|
||
const meta: Meta<typeof BaseRowCard> = { | ||
component: BaseRowCard, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof BaseRowCard>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
title: "Title", | ||
description: "Description", | ||
clickable: false, | ||
}, | ||
render: (args) => ({ | ||
components: { BaseRowCard, BaseButton }, | ||
setup() { | ||
return { args }; | ||
}, | ||
template: | ||
'<BaseRowCard v-bind="args"><BaseButton label="RightControl" /></BaseRowCard>', | ||
}), | ||
}; | ||
|
||
export const Clickable: Story = { | ||
...Default, | ||
args: { | ||
title: "Title", | ||
description: "Description", | ||
clickable: true, | ||
}, | ||
}; |
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,21 @@ | ||
import type { Meta, StoryObj } from "@storybook/vue3"; | ||
|
||
import BaseScrollArea from "./BaseScrollArea.vue"; | ||
|
||
const meta: Meta<typeof BaseScrollArea> = { | ||
component: BaseScrollArea, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof BaseScrollArea>; | ||
|
||
export const Default: Story = { | ||
render: (args) => ({ | ||
components: { BaseScrollArea }, | ||
setup() { | ||
return { args }; | ||
}, | ||
template: | ||
'<BaseScrollArea style="width: 100%; height:480px" v-bind="args"><div style="width: 100%; height:4800px;"></div></BaseScrollArea>', | ||
}), | ||
}; |
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,26 @@ | ||
import type { Meta, StoryObj } from "@storybook/vue3"; | ||
|
||
import BaseSwitch from "./BaseSwitch.vue"; | ||
|
||
const meta: Meta<typeof BaseSwitch> = { | ||
component: BaseSwitch, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof BaseSwitch>; | ||
|
||
export const Unchecked: Story = { | ||
args: { | ||
uncheckedLabel: "Off", | ||
checkedLabel: "On", | ||
checked: false, | ||
}, | ||
}; | ||
|
||
export const Checked: Story = { | ||
args: { | ||
uncheckedLabel: "Off", | ||
checkedLabel: "On", | ||
checked: true, | ||
}, | ||
}; |
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