-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
プリセットの管理ダイアログのリデザイン #2418
Open
takusea
wants to merge
12
commits into
VOICEVOX:main
Choose a base branch
from
takusea:redesign-preset-manage-dialog
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+447
−41
Open
プリセットの管理ダイアログのリデザイン #2418
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8f68555
BaseSliderコンポーネントを追加
takusea df2da0b
focus時のoutlineの表示を外側に
takusea 7a397fb
プリセット管理ダイアログのデザインを変更
takusea 703ddeb
アイコンが表示されるタイミングを選択時に変更
takusea 2f200f6
Merge branch 'main' into redesign-preset-manage-dialog
Hiroshiba e164799
型エラーを修正
takusea 92a3175
BaseListItemが幅いっぱいに表示されるように修正
takusea f5ca673
getParameterValueでエラーをthrowするように修正
takusea 4b9f345
parameterConfigsからsliderKeyを削除
takusea 1beadc1
template側でparameterKeyに変換するように変更
takusea 1ac6c53
Revert "template側でparameterKeyに変換するように変更"
takusea e866246
コメントを追加
takusea File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { Meta, StoryObj } from "@storybook/vue3"; | ||
|
||
import { ref } from "vue"; | ||
import BaseSlider from "./BaseSlider.vue"; | ||
|
||
const meta: Meta<typeof BaseSlider> = { | ||
component: BaseSlider, | ||
args: { | ||
modelValue: 50, | ||
min: 0, | ||
max: 100, | ||
step: 1, | ||
}, | ||
render: (args) => ({ | ||
components: { BaseSlider }, | ||
setup() { | ||
const model = ref(Number(args.modelValue)); | ||
return { args, model }; | ||
}, | ||
template: `<BaseSlider v-bind="args" v-model="model"></BaseSlider>`, | ||
}), | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof BaseSlider>; | ||
|
||
export const Default: Story = {}; | ||
|
||
export const Disabled: Story = { | ||
args: { | ||
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,97 @@ | ||
<template> | ||
<SliderRoot | ||
class="SliderRoot" | ||
:min | ||
:max | ||
:step | ||
:disabled | ||
:modelValue="[model]" | ||
@update:modelValue=" | ||
(value) => value != undefined && $emit('update:modelValue', value[0]) | ||
" | ||
> | ||
<SliderTrack class="SliderTrack"> | ||
<SliderRange class="SliderRange" /> | ||
</SliderTrack> | ||
<SliderThumb class="SliderThumb" /> | ||
</SliderRoot> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { SliderRange, SliderRoot, SliderThumb, SliderTrack } from "radix-vue"; | ||
|
||
defineProps<{ | ||
min?: number; | ||
max?: number; | ||
step?: number; | ||
disabled?: boolean; | ||
modelValue: number; | ||
}>(); | ||
|
||
defineEmits<{ | ||
"update:modelValue": [value: number]; | ||
}>(); | ||
|
||
const model = defineModel<number>({ required: true }); | ||
</script> | ||
|
||
<style lang="scss"> | ||
@use "@/styles/v2/variables" as vars; | ||
@use "@/styles/v2/colors" as colors; | ||
@use "@/styles/v2/mixin" as mixin; | ||
|
||
.SliderRoot { | ||
position: relative; | ||
display: flex; | ||
align-items: center; | ||
height: vars.$size-control; | ||
cursor: grab; | ||
|
||
&:active { | ||
cursor: grabbing; | ||
} | ||
|
||
&[data-disabled] { | ||
opacity: 0.5; | ||
cursor: not-allowed; | ||
} | ||
} | ||
|
||
.SliderTrack { | ||
background-color: colors.$border; | ||
position: relative; | ||
flex-grow: 1; | ||
border-radius: 9999px; | ||
height: 4px; | ||
} | ||
|
||
.SliderRange { | ||
position: absolute; | ||
background-color: colors.$primary; | ||
border-radius: 9999px; | ||
height: 100%; | ||
} | ||
|
||
.SliderThumb { | ||
display: block; | ||
width: 8px; | ||
height: vars.$size-indicator; | ||
background-color: colors.$primary; | ||
border: 1px solid colors.$border; | ||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); | ||
border-radius: vars.$radius-1; | ||
|
||
:hover:not([data-disabled]) > & { | ||
background-color: colors.$primary-hovered; | ||
} | ||
|
||
:active:not([data-disabled]) > & { | ||
background-color: colors.$primary-pressed; | ||
box-shadow: 0 0 0 transparent; | ||
} | ||
|
||
&:focus-visible { | ||
@include mixin.on-focus; | ||
} | ||
} | ||
</style> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
radix-vue、なんでundefinedが来る仕様なんだろう・・・ 😇
とりあえずエラーの握りつぶしになっている(ドツボにはまるととても厄介)ので、エラー出すようにしますか!