standardize size and color

This commit is contained in:
bymyself
2025-06-09 04:58:17 -07:00
parent 20e4427602
commit e488b2abce
7 changed files with 45 additions and 26 deletions

View File

@@ -1,10 +1,13 @@
<template> <template>
<div class="badged-number-input relative w-full"> <div class="badged-number-input relative w-full">
<InputGroup class="w-full rounded-lg"> <InputGroup class="w-full rounded-lg border-none px-0.5">
<!-- State badge prefix --> <!-- State badge prefix -->
<InputGroupAddon v-if="badgeState !== 'normal'" class="rounded-l-lg"> <InputGroupAddon
v-if="badgeState !== 'normal'"
class="rounded-l-lg bg-[#222222] border-[#222222] shadow-none border-r-[#A0A1A2] rounded-r-none"
>
<i <i
:class="badgeIcon" :class="badgeIcon + ' text-xs'"
:title="badgeTooltip" :title="badgeTooltip"
:style="{ color: badgeColor }" :style="{ color: badgeColor }"
></i> ></i>
@@ -19,11 +22,26 @@
:step="step" :step="step"
:placeholder="placeholder" :placeholder="placeholder"
:disabled="disabled" :disabled="disabled"
:class="{ size="small"
'rounded-r-lg': badgeState !== 'normal', :pt="{
'rounded-lg': badgeState === 'normal' pcInputText: {
root: {
class: 'bg-[#222222] text-xs shadow-none rounded-none !border-0'
}
},
incrementButton: {
class: 'text-xs shadow-none bg-[#222222] rounded-l-none !border-0'
},
decrementButton: {
class: {
'text-xs shadow-none bg-[#222222] rounded-r-none !border-0':
badgeState === 'normal',
'text-xs shadow-none bg-[#222222] rounded-none !border-0':
badgeState !== 'normal'
}
}
}" }"
class="flex-1" class="flex-1 rounded-none"
show-buttons show-buttons
button-layout="horizontal" button-layout="horizontal"
:increment-button-icon="'pi pi-plus'" :increment-button-icon="'pi pi-plus'"
@@ -37,7 +55,7 @@
'rounded-r-lg': badgeState !== 'normal', 'rounded-r-lg': badgeState !== 'normal',
'rounded-lg': badgeState === 'normal' 'rounded-lg': badgeState === 'normal'
}" }"
class="flex-1 flex items-center gap-2 px-3 py-2 bg-surface-0 border border-surface-300" class="flex-1 flex items-center gap-2 px-1 bg-surface-0 border border-surface-300"
> >
<Slider <Slider
v-model="numericValue" v-model="numericValue"
@@ -53,7 +71,14 @@
:max="max" :max="max"
:step="step" :step="step"
:disabled="disabled" :disabled="disabled"
class="w-16" class="w-16 rounded-md"
:pt="{
pcInputText: {
root: {
class: 'bg-[#222222] text-xs shadow-none border-[#222222]'
}
}
}"
:show-buttons="false" :show-buttons="false"
size="small" size="small"
/> />

View File

@@ -38,7 +38,8 @@
:pt="{ :pt="{
pcInputText: { pcInputText: {
root: { root: {
class: 'max-w-12' class:
'max-w-12 bg-[#222222] text-xs shadow-none border-[#222222]'
} }
} }
}" }"
@@ -54,15 +55,8 @@
:options="colorFormats" :options="colorFormats"
option-label="label" option-label="label"
option-value="value" option-value="value"
class="w-24 ml-3" class="w-24 ml-3 bg-[#222222] text-xs shadow-none border-none p-0"
size="small" size="small"
:pt="{
pcInputText: {
root: {
class: 'max-w-12'
}
}
}"
@update:model-value="handleFormatChange" @update:model-value="handleFormatChange"
/> />
</div> </div>

View File

@@ -4,7 +4,7 @@
v-model="selectedValue" v-model="selectedValue"
:options="computedOptions" :options="computedOptions"
:placeholder="placeholder" :placeholder="placeholder"
class="w-full rounded-lg" class="w-full rounded-lg bg-[#222222] text-xs border-[#222222] shadow-none"
:disabled="isLoading" :disabled="isLoading"
/> />
</div> </div>

View File

@@ -5,7 +5,7 @@
v-if="!isMultiline" v-if="!isMultiline"
v-model="modelValue" v-model="modelValue"
:placeholder="placeholder" :placeholder="placeholder"
class="w-full rounded-lg px-3 py-2 text-sm" class="w-full rounded-lg px-3 py-2 text-sm bg-[#222222] text-xs mt-0.5 border-[#222222] shadow-none"
/> />
<!-- Multi-line textarea --> <!-- Multi-line textarea -->
@@ -15,7 +15,7 @@
:placeholder="placeholder" :placeholder="placeholder"
:auto-resize="true" :auto-resize="true"
:rows="3" :rows="3"
class="w-full rounded-lg px-3 py-2 text-sm resize-none" class="w-full rounded-lg px-3 py-2 text-sm resize-none bg-[#222222] text-xs mt-0.5 border-[#222222] shadow-none"
/> />
</div> </div>
</template> </template>

View File

@@ -118,7 +118,7 @@ export const useBadgedNumberInput = (
// Optional: minimum height for the widget // Optional: minimum height for the widget
getMinHeight: () => minHeight + PADDING, getMinHeight: () => minHeight + PADDING,
// Lock maximum height to prevent oversizing // Lock maximum height to prevent oversizing
getMaxHeight: () => 45, getMaxHeight: () => 48,
// Optional: whether to serialize this widget's value // Optional: whether to serialize this widget's value
serialize serialize

View File

@@ -31,9 +31,9 @@ const addMultiSelectWidget = (node: LGraphNode, inputSpec: ComboInputSpec) => {
widgetValue.value = value widgetValue.value = value
}, },
// Optional: minimum height for the widget (multiselect needs minimal height) // Optional: minimum height for the widget (multiselect needs minimal height)
getMinHeight: () => 32, getMinHeight: () => 24,
// Lock maximum height to prevent oversizing // Lock maximum height to prevent oversizing
getMaxHeight: () => 45, getMaxHeight: () => 32,
// Optional: whether to serialize this widget's value // Optional: whether to serialize this widget's value
serialize: true serialize: true
} }

View File

@@ -50,9 +50,9 @@ export const useDropdownComboWidget = (
}, },
// Optional: minimum height for the widget (dropdown needs minimal height) // Optional: minimum height for the widget (dropdown needs minimal height)
getMinHeight: () => 48, getMinHeight: () => 32,
// Lock maximum height to prevent oversizing // Lock maximum height to prevent oversizing
getMaxHeight: () => 64, getMaxHeight: () => 48,
// Optional: whether to serialize this widget's value // Optional: whether to serialize this widget's value
serialize: true serialize: true