mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-09 09:30:06 +00:00
## Summary Only remaining use is in `buttonTypes.ts` which @viva-jinyi is going to be working on to consolidate our different buttons soon. ## Changes - **What**: Replace light/dark colors with theme aware design system tokens. ## Review Focus Double check the chosen colors for the components ## Screenshots | Before | After | | ------ | ----- | | <img width="607" height="432" alt="image" src="https://github.com/user-attachments/assets/6c0ee6d6-819f-40b1-b775-f8b25dd18104" /> | <img width="646" height="488" alt="image" src="https://github.com/user-attachments/assets/9c8532de-8ac6-4b48-9021-3fd0b3e0bc63" /> | ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6705-Style-WIP-Design-System-use-across-more-components-2ab6d73d365081619115fc5f87a46341) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <github-actions@github.com>
56 lines
1.3 KiB
Vue
56 lines
1.3 KiB
Vue
<template>
|
|
<div class="flex flex-row gap-2.5 items-center min-h-6 relative">
|
|
<span class="text-left text-xs font-sans text-[var(--descrip-text)]">{{
|
|
label
|
|
}}</span>
|
|
<select
|
|
class="absolute right-0 h-6 px-1.5 rounded-md border border-border-default transition-colors duration-100 bg-secondary-background focus:outline focus:outline-node-component-border"
|
|
:value="modelValue"
|
|
@change="onChange"
|
|
>
|
|
<option
|
|
v-for="option in normalizedOptions"
|
|
:key="option.value"
|
|
:value="option.value"
|
|
>
|
|
{{ option.label }}
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
|
|
interface DropdownOption {
|
|
label: string
|
|
value: string | number
|
|
}
|
|
|
|
interface Props {
|
|
label: string
|
|
options: string[] | DropdownOption[]
|
|
modelValue: string | number
|
|
}
|
|
|
|
const props = defineProps<Props>()
|
|
|
|
const emit = defineEmits<{
|
|
'update:modelValue': [value: string | number]
|
|
}>()
|
|
|
|
const normalizedOptions = computed((): DropdownOption[] => {
|
|
return props.options.map((option) => {
|
|
if (typeof option === 'string') {
|
|
return { label: option, value: option }
|
|
}
|
|
return option
|
|
})
|
|
})
|
|
|
|
const onChange = (event: Event) => {
|
|
const value = (event.target as HTMLSelectElement).value
|
|
emit('update:modelValue', value)
|
|
}
|
|
</script>
|