forked from VOICEVOX/voicevox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ショートカットキー割り当てダイアログのリデザイン (VOICEVOX#2348)
Co-authored-by: Hiroshiba <hihokaruta@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
c707aae
commit 0735fbe
Showing
12 changed files
with
282 additions
and
185 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import type { Meta, StoryObj } from "@storybook/vue3"; | ||
|
||
import { TooltipProvider } from "radix-vue"; | ||
import BaseIconButton from "./BaseIconButton.vue"; | ||
|
||
const meta: Meta<typeof BaseIconButton> = { | ||
component: BaseIconButton, | ||
render: (args) => ({ | ||
components: { BaseIconButton, TooltipProvider }, | ||
setup() { | ||
return { args }; | ||
}, | ||
template: ` | ||
<TooltipProvider> | ||
<BaseIconButton v-bind="args" /> | ||
</TooltipProvider>`, | ||
}), | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof BaseIconButton>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
label: "Default", | ||
icon: "settings", | ||
}, | ||
}; | ||
|
||
export const Disabled: Story = { | ||
args: { | ||
label: "Disabled", | ||
icon: "settings", | ||
disabled: 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,62 @@ | ||
<template> | ||
<BaseTooltip :label> | ||
<button | ||
class="button" | ||
:disabled | ||
@click="(payload) => $emit('click', payload)" | ||
> | ||
<!-- 暫定でq-iconを使用 --> | ||
<QIcon v-if="icon" :name="icon" size="sm" /> | ||
</button> | ||
</BaseTooltip> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import BaseTooltip from "./BaseTooltip.vue"; | ||
defineProps<{ | ||
icon: string; | ||
label: string; | ||
disabled?: boolean; | ||
}>(); | ||
defineEmits<{ | ||
(e: "click", payload: MouseEvent): void; | ||
}>(); | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
@use "@/styles/v2/variables" as vars; | ||
@use "@/styles/v2/mixin" as mixin; | ||
@use "@/styles/v2/colors" as colors; | ||
.button { | ||
border: none; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: vars.$size-control; | ||
width: vars.$size-control; | ||
border-radius: vars.$radius-1; | ||
color: colors.$display; | ||
background-color: colors.$clear; | ||
cursor: pointer; | ||
&:focus-visible { | ||
@include mixin.on-focus; | ||
} | ||
&:hover:not(:disabled) { | ||
background-color: colors.$clear-hovered; | ||
} | ||
&:active:not(:disabled) { | ||
background-color: colors.$clear-pressed; | ||
} | ||
&:disabled { | ||
// Quasar側のopacity: 0.6 !important;を上書きするためimportantを付与 | ||
opacity: 0.4 !important; | ||
} | ||
} | ||
</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
Oops, something went wrong.