11<script setup lang="ts">
2- import { cn } from ' @comfyorg/tailwind-utils'
32import { isEqual } from ' es-toolkit'
43import { computed } from ' vue'
54import { useI18n } from ' vue-i18n'
65
76import MoreButton from ' @/components/button/MoreButton.vue'
7+ import Button from ' @/components/ui/button/Button.vue'
88import { isProxyWidget } from ' @/core/graph/subgraph/proxyWidget'
99import {
1010 demoteWidget ,
@@ -123,12 +123,6 @@ function handleResetToDefault() {
123123 if (! hasDefault .value ) return
124124 emit (' resetToDefault' , defaultValue .value )
125125}
126-
127- const buttonClasses = cn ([
128- ' border-none bg-transparent' ,
129- ' w-full flex items-center gap-2 rounded px-3 py-2 text-sm' ,
130- ' cursor-pointer transition-all hover:bg-secondary-background-hover active:scale-95'
131- ])
132126 </script >
133127
134128<template >
@@ -137,8 +131,10 @@ const buttonClasses = cn([
137131 class =" text-muted-foreground bg-transparent hover:text-base-foreground hover:bg-secondary-background-hover active:scale-95 transition-all"
138132 >
139133 <template #default =" { close } " >
140- <button
141- :class =" buttonClasses"
134+ <Button
135+ variant =" textonly"
136+ size =" unset"
137+ class =" w-full flex items-center gap-2 rounded px-3 py-2 text-sm transition-all active:scale-95"
142138 @click ="
143139 () => {
144140 handleRename()
@@ -148,11 +144,13 @@ const buttonClasses = cn([
148144 >
149145 <i class =" icon-[lucide--edit] size-4" />
150146 <span >{{ t('g.rename') }}</span >
151- </button >
147+ </Button >
152148
153- <button
149+ <Button
154150 v-if =" hasParents"
155- :class =" buttonClasses"
151+ variant =" textonly"
152+ size =" unset"
153+ class =" w-full flex items-center gap-2 rounded px-3 py-2 text-sm transition-all active:scale-95"
156154 @click ="
157155 () => {
158156 if (isShownOnParents) handleHideInput()
@@ -169,10 +167,12 @@ const buttonClasses = cn([
169167 <i class =" icon-[lucide--eye] size-4" />
170168 <span >{{ t('rightSidePanel.showInput') }}</span >
171169 </template >
172- </button >
170+ </Button >
173171
174- <button
175- :class =" buttonClasses"
172+ <Button
173+ variant =" textonly"
174+ size =" unset"
175+ class =" w-full flex items-center gap-2 rounded px-3 py-2 text-sm transition-all active:scale-95"
176176 @click ="
177177 () => {
178178 handleToggleFavorite()
@@ -181,18 +181,20 @@ const buttonClasses = cn([
181181 "
182182 >
183183 <template v-if =" isFavorited " >
184- <i class =" icon-[lucide--star]" />
184+ <i class =" icon-[lucide--star] size-4 " />
185185 <span >{{ t('rightSidePanel.removeFavorite') }}</span >
186186 </template >
187187 <template v-else >
188- <i class =" icon-[lucide--star]" />
188+ <i class =" icon-[lucide--star] size-4 " />
189189 <span >{{ t('rightSidePanel.addFavorite') }}</span >
190190 </template >
191- </button >
191+ </Button >
192192
193- <button
193+ <Button
194194 v-if =" hasDefault"
195- :class =" cn(buttonClasses, isCurrentValueDefault && 'opacity-50')"
195+ variant =" textonly"
196+ size =" unset"
197+ class =" w-full flex items-center gap-2 rounded px-3 py-2 text-sm transition-all active:scale-95"
196198 :disabled =" isCurrentValueDefault"
197199 @click ="
198200 () => {
@@ -203,7 +205,7 @@ const buttonClasses = cn([
203205 >
204206 <i class =" icon-[lucide--rotate-ccw] size-4" />
205207 <span >{{ t('rightSidePanel.resetToDefault') }}</span >
206- </button >
208+ </Button >
207209 </template >
208210 </MoreButton >
209211</template >
0 commit comments