Skip to content

Commit

Permalink
Merge pull request #1 from Hiroshiba/hiho-counter-pr-3c188a47
Browse files Browse the repository at this point in the history
VOICEVOX#2333 の変更提案プルリクエスト
  • Loading branch information
takusea authored Oct 28, 2024
2 parents 45cefa8 + bd41419 commit 6a95442
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 88 deletions.
24 changes: 8 additions & 16 deletions src/components/Base/BaseCheckbox.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ import BaseCheckbox from "./BaseCheckbox.vue";

const meta: Meta<typeof BaseCheckbox> = {
component: BaseCheckbox,
render: (args) => ({
components: { BaseCheckbox },
setup() {
const checked = ref(false);
return { args, checked };
},
template: `<BaseCheckbox v-bind="args" v-model:checked="checked"></BaseCheckbox>`,
}),
};

export default meta;
Expand All @@ -14,27 +22,11 @@ export const Unchecked: Story = {
args: {
label: "Unchecked",
},
render: (args) => ({
components: { BaseCheckbox },
setup() {
const checked = ref(false);
return { args, checked };
},
template: `<BaseCheckbox v-bind="args" v-model:checked="checked"></BaseCheckbox>`,
}),
};

export const Checked: Story = {
args: {
label: "Checked",
checked: true,
},
render: (args) => ({
components: { BaseCheckbox },
setup() {
const checked = ref(true);
return { args, checked };
},
template: `<BaseCheckbox v-bind="args" v-model:checked="checked"></BaseCheckbox>`,
}),
};
37 changes: 5 additions & 32 deletions src/components/Base/BaseSelect.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ import BaseSelectItem from "./BaseSelectItem.vue";

const meta: Meta<typeof BaseSelect> = {
component: BaseSelect,
};

export default meta;
type Story = StoryObj<typeof BaseSelect>;

export const Default: Story = {
render: (args) => ({
components: { BaseSelect, BaseSelectItem },
setup() {
Expand All @@ -27,40 +21,19 @@ export const Default: Story = {
}),
};

export default meta;
type Story = StoryObj<typeof BaseSelect>;

export const Default: Story = {};

export const Placeholder: Story = {
args: {
placeholder: "placeholder",
},
render: (args) => ({
components: { BaseSelect, BaseSelectItem },
setup() {
const modelValue = ref("a");
return { args, modelValue };
},
template: `
<BaseSelect v-bind="args" v-model="modelValue">
<BaseSelectItem label="A" value="a" />
<BaseSelectItem label="B" value="b" />
<BaseSelectItem label="C" value="c" />
</BaseSelect>`,
}),
};

export const Disabled: Story = {
args: {
disabled: true,
},
render: (args) => ({
components: { BaseSelect, BaseSelectItem },
setup() {
const modelValue = ref("a");
return { args, modelValue };
},
template: `
<BaseSelect v-bind="args" v-model="modelValue">
<BaseSelectItem label="A" value="a" />
<BaseSelectItem label="B" value="b" />
<BaseSelectItem label="C" value="c" />
</BaseSelect>`,
}),
};
24 changes: 8 additions & 16 deletions src/components/Base/BaseSwitch.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ import BaseSwitch from "./BaseSwitch.vue";

const meta: Meta<typeof BaseSwitch> = {
component: BaseSwitch,
render: (args) => ({
components: { BaseSwitch },
setup() {
const checked = ref(false);
return { args, checked };
},
template: `<BaseSwitch v-bind="args" v-model:checked="checked"></BaseSwitch>`,
}),
};

export default meta;
Expand All @@ -16,14 +24,6 @@ export const Unchecked: Story = {
checkedLabel: "On",
checked: false,
},
render: (args) => ({
components: { BaseSwitch },
setup() {
const checked = ref(false);
return { args, checked };
},
template: `<BaseSwitch v-bind="args" v-model:checked="checked"></BaseSwitch>`,
}),
};

export const Checked: Story = {
Expand All @@ -32,12 +32,4 @@ export const Checked: Story = {
checkedLabel: "On",
checked: true,
},
render: (args) => ({
components: { BaseSwitch },
setup() {
const checked = ref(true);
return { args, checked };
},
template: `<BaseSwitch v-bind="args" v-model:checked="checked"></BaseSwitch>`,
}),
};
33 changes: 9 additions & 24 deletions src/components/Base/BaseTooltip.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ import BaseTooltip from "./BaseTooltip.vue";

const meta: Meta<typeof BaseTooltip> = {
component: BaseTooltip,
};

export default meta;
type Story = StoryObj<typeof BaseTooltip>;

export const Default: Story = {
args: {
label: "Default",
},
render: (args) => ({
components: { BaseTooltip, TooltipProvider },
setup() {
Expand All @@ -28,24 +19,18 @@ export const Default: Story = {
}),
};

export default meta;
type Story = StoryObj<typeof BaseTooltip>;

export const Default: Story = {
args: {
label: "Default",
},
};

export const Disabled: Story = {
args: {
label: "Default",
disabled: true,
},
render: (args) => ({
components: {
BaseTooltip,
TooltipProvider,
},
setup() {
return { args };
},
template: `
<TooltipProvider>
<BaseTooltip v-bind="args">
<span>Hover</span>
</BaseTooltip>
</TooltipProvider>`,
}),
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6a95442

Please sign in to comment.