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.
Merge remote-tracking branch 'upstream/main' into エンジンのmockを作る
- Loading branch information
Showing
25 changed files
with
2,189 additions
and
1,040 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
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,27 @@ | ||
import type { Meta, StoryObj } from "@storybook/vue3"; | ||
|
||
import BaseNavigationView from "./BaseNavigationView.vue"; | ||
import BaseListItem from "./BaseListItem.vue"; | ||
|
||
const meta: Meta<typeof BaseNavigationView> = { | ||
component: BaseNavigationView, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof BaseNavigationView>; | ||
|
||
export const Default: Story = { | ||
render: (args) => ({ | ||
components: { BaseNavigationView, BaseListItem }, | ||
setup() { | ||
return { args }; | ||
}, | ||
template: ` | ||
<BaseNavigationView style="width: 100%; height:480px" v-bind="args"> | ||
<template #sidebar> | ||
<BaseListItem>ListItem</BaseListItem> | ||
</template> | ||
<div>Content</div> | ||
</BaseNavigationView>`, | ||
}), | ||
}; |
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,46 @@ | ||
<template> | ||
<div class="grid"> | ||
<div class="sidebar"> | ||
<BaseScrollArea> | ||
<div class="sidebar-inner"> | ||
<slot name="sidebar" /> | ||
</div> | ||
</BaseScrollArea> | ||
</div> | ||
|
||
<main class="content"> | ||
<slot /> | ||
</main> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import BaseScrollArea from "./BaseScrollArea.vue"; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
@use "@/styles/v2/variables" as vars; | ||
@use "@/styles/v2/colors" as colors; | ||
// TODO: MenuBar+Header分のマージン。Dialogコンポーネント置き換え後削除 | ||
.grid { | ||
height: calc(100vh - 90px); | ||
display: grid; | ||
grid-template-columns: auto 1fr; | ||
grid-template-rows: 100%; | ||
backdrop-filter: blur(32px); | ||
background-color: colors.$background-drawer; | ||
} | ||
.sidebar-inner { | ||
display: flex; | ||
flex-direction: column; | ||
padding: vars.$padding-2; | ||
width: max-content; | ||
} | ||
.content { | ||
background-color: colors.$background; | ||
border-left: 1px solid colors.$border; | ||
} | ||
</style> |
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,48 @@ | ||
import type { Meta, StoryObj } from "@storybook/vue3"; | ||
|
||
import BaseTextField from "./BaseTextField.vue"; | ||
|
||
const meta: Meta<typeof BaseTextField> = { | ||
component: BaseTextField, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof BaseTextField>; | ||
|
||
export const Default: Story = {}; | ||
|
||
export const Placeholder: Story = { | ||
args: { | ||
placeholder: "Placeholder", | ||
}, | ||
}; | ||
|
||
export const Disabled: Story = { | ||
args: { | ||
disabled: true, | ||
}, | ||
}; | ||
|
||
export const ReadOnly: Story = { | ||
args: { | ||
readonly: true, | ||
}, | ||
}; | ||
|
||
export const HasError: Story = { | ||
args: { | ||
hasError: true, | ||
}, | ||
render: (args) => ({ | ||
components: { BaseTextField }, | ||
setup() { | ||
return { args }; | ||
}, | ||
template: ` | ||
<BaseTextField v-bind="args"> | ||
<template #error> | ||
ERROR TEXT | ||
</template> | ||
</BaseTextField>`, | ||
}), | ||
}; |
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,75 @@ | ||
<template> | ||
<div class="wrapper"> | ||
<input | ||
v-model="model" | ||
type="text" | ||
class="input" | ||
:class="{ error: hasError }" | ||
:placeholder | ||
:readonly | ||
:disabled | ||
@click="(payload) => $emit('click', payload)" | ||
/> | ||
<div v-if="hasError" class="error-label"> | ||
<slot name="error" /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
defineProps<{ | ||
placeholder?: string; | ||
hasError?: boolean; | ||
readonly?: boolean; | ||
disabled?: boolean; | ||
}>(); | ||
defineEmits<{ | ||
click: [payload: MouseEvent]; | ||
}>(); | ||
const model = defineModel<string>(); | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
@use "@/styles/v2/variables" as vars; | ||
@use "@/styles/v2/colors" as colors; | ||
@use "@/styles/v2/mixin" as mixin; | ||
.wrapper { | ||
width: 100%; | ||
} | ||
.input { | ||
height: vars.$size-control; | ||
width: 100%; | ||
display: flex; | ||
align-items: center; | ||
gap: vars.$gap-1; | ||
border: 1px solid colors.$border; | ||
border-radius: vars.$radius-1; | ||
padding-inline: vars.$padding-1; | ||
background-color: colors.$control; | ||
color: colors.$display; | ||
&:focus { | ||
@include mixin.on-focus; | ||
} | ||
&:disabled { | ||
opacity: 0.5; | ||
} | ||
&::placeholder { | ||
color: colors.$display-sub; | ||
} | ||
} | ||
.error { | ||
border: 2px solid colors.$display-warning; | ||
} | ||
.error-label { | ||
color: colors.$display-warning; | ||
} | ||
</style> |
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,47 @@ | ||
import type { Meta, StoryObj } from "@storybook/vue3"; | ||
|
||
import BaseToggleGroup from "./BaseToggleGroup.vue"; | ||
import BaseToggleGroupItem from "./BaseToggleGroupItem.vue"; | ||
|
||
const meta: Meta<typeof BaseToggleGroup> = { | ||
component: BaseToggleGroup, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof BaseToggleGroup>; | ||
|
||
export const Single: Story = { | ||
args: { | ||
type: "single", | ||
}, | ||
render: (args) => ({ | ||
components: { BaseToggleGroup, BaseToggleGroupItem }, | ||
setup() { | ||
return { args }; | ||
}, | ||
template: ` | ||
<BaseToggleGroup v-bind="args"> | ||
<BaseToggleGroupItem label="A" value="a" /> | ||
<BaseToggleGroupItem label="B" value="B" /> | ||
<BaseToggleGroupItem label="C" value="C" /> | ||
</BaseToggleGroup>`, | ||
}), | ||
}; | ||
|
||
export const Multiple: Story = { | ||
args: { | ||
type: "multiple", | ||
}, | ||
render: (args) => ({ | ||
components: { BaseToggleGroup, BaseToggleGroupItem }, | ||
setup() { | ||
return { args }; | ||
}, | ||
template: ` | ||
<BaseToggleGroup v-bind="args"> | ||
<BaseToggleGroupItem label="A" value="a" /> | ||
<BaseToggleGroupItem label="B" value="B" /> | ||
<BaseToggleGroupItem label="C" value="C" /> | ||
</BaseToggleGroup>`, | ||
}), | ||
}; |
Oops, something went wrong.