Component: The Rest of the PrimeVue buttons (#7649)

## Summary

Automated initial change, cleaned up manually.

Please check the screenshot changes.

Includes a11y updates to icon buttons.

Doesn't hit the buttons in Desktop.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7649-WIP-Component-The-Rest-of-the-PrimeVue-buttons-2ce6d73d365081d68e06f200f1321267)
by [Unito](https://www.unito.io)

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Alexander Brown
2025-12-29 15:03:34 -08:00
committed by GitHub
parent ea96c71818
commit 7b68b19f11
159 changed files with 1330 additions and 1359 deletions

View File

@@ -183,25 +183,22 @@
</div>
<div class="flex flex-col p-8">
<Button
:label="getButtonLabel(tier)"
:severity="getButtonSeverity(tier)"
:variant="getButtonSeverity(tier)"
:disabled="isLoading || isCurrentPlan(tier.key)"
:loading="loadingTier === tier.key"
:class="
cn(
'h-10 w-full',
getButtonTextClass(tier),
tier.key === 'creator'
? 'bg-base-foreground border-transparent hover:bg-inverted-background-hover'
: 'bg-secondary-background border-transparent hover:bg-secondary-background-hover focus:bg-secondary-background-selected'
)
"
:pt="{
label: {
class: getButtonTextClass(tier)
}
}"
@click="() => handleSubscribe(tier.key)"
/>
>
{{ getButtonLabel(tier) }}
</Button>
</div>
</div>
</div>
@@ -241,13 +238,13 @@
<script setup lang="ts">
import { cn } from '@comfyorg/tailwind-utils'
import Button from 'primevue/button'
import Popover from 'primevue/popover'
import SelectButton from 'primevue/selectbutton'
import type { ToggleButtonPassThroughMethodOptions } from 'primevue/togglebutton'
import { computed, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import Button from '@/components/ui/button/Button.vue'
import { useFirebaseAuthActions } from '@/composables/auth/useFirebaseAuthActions'
import { useErrorHandling } from '@/composables/useErrorHandling'
import { getComfyApiBaseUrl } from '@/config/comfyApi'

View File

@@ -1,10 +1,9 @@
<template>
<Button
:label="label || $t('subscription.required.subscribe')"
:size="size"
:size
:loading="isLoading"
:disabled="isPolling"
severity="primary"
variant="primary"
:style="
variant === 'gradient'
? {
@@ -13,39 +12,33 @@
}
: undefined
"
:pt="{
root: {
class: rootClass
}
}"
:class="cn('font-bold', fluid && 'w-full')"
@click="handleSubscribe"
/>
>
{{ label || $t('subscription.required.subscribe') }}
</Button>
</template>
<script setup lang="ts">
import Button from 'primevue/button'
import { computed, onBeforeUnmount, ref, watch } from 'vue'
import { onBeforeUnmount, ref, watch } from 'vue'
import Button from '@/components/ui/button/Button.vue'
import { useSubscription } from '@/platform/cloud/subscription/composables/useSubscription'
import { isCloud } from '@/platform/distribution/types'
import { useTelemetry } from '@/platform/telemetry'
import { cn } from '@/utils/tailwindUtil'
const props = withDefaults(
defineProps<{
label?: string
size?: 'small' | 'large'
variant?: 'default' | 'gradient'
fluid?: boolean
}>(),
{
size: 'large',
variant: 'default',
fluid: true
}
)
const rootClass = computed(() => cn('font-bold', props.fluid && 'w-full'))
const {
size = 'lg',
fluid = true,
variant = 'default',
label
} = defineProps<{
label?: string
size?: 'sm' | 'lg'
variant?: 'default' | 'gradient'
fluid?: boolean
}>()
const emit = defineEmits<{
subscribed: []

View File

@@ -4,34 +4,28 @@
value: $t('subscription.subscribeToRunFull'),
showDelay: 600
}"
class="subscribe-to-run-button"
:label="buttonLabel"
icon="pi pi-lock"
severity="primary"
size="small"
class="subscribe-to-run-button whitespace-nowrap"
variant="primary"
size="sm"
:style="{
background: 'var(--color-subscription-button-gradient)',
color: 'var(--color-white)'
}"
:pt="{
root: {
class: 'whitespace-nowrap',
style: {
borderColor: 'transparent'
}
}
color: 'var(--color-white)',
borderColor: 'transparent'
}"
data-testid="subscribe-to-run-button"
@click="handleSubscribeToRun"
/>
>
<i class="pi pi-lock" />
{{ buttonLabel }}
</Button>
</template>
<script setup lang="ts">
import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'
import Button from 'primevue/button'
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import Button from '@/components/ui/button/Button.vue'
import { useSubscription } from '@/platform/cloud/subscription/composables/useSubscription'
import { isCloud } from '@/platform/distribution/types'
import { useTelemetry } from '@/platform/telemetry'

View File

@@ -54,42 +54,29 @@
<Button
v-if="isActiveSubscription"
:label="$t('subscription.manageSubscription')"
severity="secondary"
class="ml-auto bg-interface-menu-component-surface-selected"
:pt="{
root: {
style: 'border-radius: 8px; padding: 8px 16px;'
},
label: {
class: 'text-sm font-normal text-text-primary'
}
}"
variant="secondary"
class="ml-auto rounded-lg px-4 py-2 text-sm font-normal text-text-primary bg-interface-menu-component-surface-selected"
@click="
async () => {
await authActions.accessBillingPortal()
}
"
/>
>
{{ $t('subscription.manageSubscription') }}
</Button>
<Button
v-if="isActiveSubscription"
:label="$t('subscription.upgradePlan')"
severity="primary"
:pt="{
root: {
style: 'border-radius: 8px; padding: 8px 16px;'
},
label: {
class: 'text-sm font-normal text-text-primary'
}
}"
variant="primary"
class="rounded-lg px-4 py-2 text-sm font-normal text-text-primary"
@click="showSubscriptionDialog"
/>
>
{{ $t('subscription.upgradePlan') }}
</Button>
<SubscribeButton
v-else
:label="$t('subscription.subscribeNow')"
size="small"
size="sm"
:fluid="false"
class="text-xs"
@subscribed="handleRefresh"
@@ -109,21 +96,14 @@
"
>
<Button
icon="pi pi-sync"
text
size="small"
variant="muted-textonly"
size="icon-sm"
class="absolute top-0.5 right-0"
:loading="isLoadingBalance"
:pt="{
icon: {
class: 'text-text-secondary text-xs'
},
loadingIcon: {
class: 'text-text-secondary text-xs'
}
}"
@click="handleRefresh"
/>
>
<i class="pi pi-sync text-text-secondary text-xs" />
</Button>
<div class="flex flex-col gap-2">
<div class="text-sm text-muted">
@@ -183,17 +163,14 @@
</div>
<Button
v-tooltip="$t('subscription.prepaidCreditsInfo')"
icon="pi pi-question-circle"
text
rounded
size="small"
class="h-4 w-4 shrink-0"
:pt="{
icon: {
class: 'text-text-secondary text-xs'
}
}"
/>
variant="muted-textonly"
size="icon-sm"
class="h-4 w-4 shrink-0 rounded-full"
>
<i
class="pi pi-question-circle text-text-secondary text-xs"
/>
</Button>
</div>
</div>
</div>
@@ -209,19 +186,12 @@
</a>
<Button
v-if="isActiveSubscription"
:label="$t('subscription.addCredits')"
severity="secondary"
class="p-2 min-h-8 bg-interface-menu-component-surface-selected"
:pt="{
root: {
style: 'border-radius: 8px;'
},
label: {
class: 'text-sm font-normal text-text-primary'
}
}"
variant="secondary"
class="p-2 min-h-8 rounded-lg text-sm font-normal text-text-primary bg-interface-menu-component-surface-selected"
@click="handleAddApiCredits"
/>
>
{{ $t('subscription.addCredits') }}
</Button>
</div>
</div>
</div>
@@ -276,86 +246,53 @@
>
<div class="flex gap-2">
<Button
:label="$t('subscription.learnMore')"
text
severity="secondary"
icon="pi pi-question-circle"
class="text-xs"
:pt="{
label: {
class: 'text-text-secondary'
},
icon: {
class: 'text-text-secondary text-xs'
}
}"
variant="muted-textonly"
class="text-xs text-text-secondary"
@click="handleLearnMoreClick"
/>
>
<i class="pi pi-question-circle text-text-secondary text-xs" />
{{ $t('subscription.learnMore') }}
</Button>
<Button
:label="$t('subscription.partnerNodesCredits')"
text
severity="secondary"
icon="pi pi-question-circle"
class="text-xs"
:pt="{
label: {
class: 'text-text-secondary'
},
icon: {
class: 'text-text-secondary text-xs'
}
}"
variant="muted-textonly"
class="text-xs text-text-secondary"
@click="handleOpenPartnerNodesInfo"
/>
>
<i class="pi pi-question-circle text-text-secondary text-xs" />
{{ $t('subscription.partnerNodesCredits') }}
</Button>
<Button
:label="$t('subscription.messageSupport')"
text
severity="secondary"
icon="pi pi-comment"
class="text-xs"
variant="muted-textonly"
class="text-xs text-text-secondary"
:loading="isLoadingSupport"
:pt="{
label: {
class: 'text-text-secondary'
},
icon: {
class: 'text-text-secondary text-xs'
}
}"
@click="handleMessageSupport"
/>
>
<i class="pi pi-comment text-text-secondary text-xs" />
{{ $t('subscription.messageSupport') }}
</Button>
</div>
<Button
:label="$t('subscription.invoiceHistory')"
text
severity="secondary"
icon="pi pi-external-link"
icon-pos="right"
class="text-xs"
:pt="{
label: {
class: 'text-text-secondary'
},
icon: {
class: 'text-text-secondary text-xs'
}
}"
variant="muted-textonly"
class="text-xs text-text-secondary"
@click="handleInvoiceHistory"
/>
>
{{ $t('subscription.invoiceHistory') }}
<i class="pi pi-external-link text-text-secondary text-xs" />
</Button>
</div>
</div>
</TabPanel>
</template>
<script setup lang="ts">
import Button from 'primevue/button'
import Skeleton from 'primevue/skeleton'
import TabPanel from 'primevue/tabpanel'
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import CloudBadge from '@/components/topbar/CloudBadge.vue'
import Button from '@/components/ui/button/Button.vue'
import { useFirebaseAuthActions } from '@/composables/auth/useFirebaseAuthActions'
import { useExternalLink } from '@/composables/useExternalLink'
import SubscribeButton from '@/platform/cloud/subscription/components/SubscribeButton.vue'

View File

@@ -4,16 +4,14 @@
class="relative flex flex-col p-4 pt-8 md:p-16 !overflow-y-auto h-full gap-8"
>
<Button
:pt="{
icon: { class: 'text-xl' }
}"
icon="pi pi-times"
text
rounded
class="shrink-0 text-text-secondary hover:bg-white/10 absolute right-2.5 top-2.5"
size="icon"
variant="muted-textonly"
class="rounded-full shrink-0 text-text-secondary hover:bg-white/10 absolute right-2.5 top-2.5"
:aria-label="$t('g.close')"
@click="handleClose"
/>
>
<i class="pi pi-times text-xl" />
</Button>
<div class="text-center">
<h2 class="text-xl lg:text-2xl text-muted-foreground m-0">
{{ $t('subscription.description') }}
@@ -29,37 +27,36 @@
</p>
<div class="flex items-center gap-1.5">
<Button
:label="$t('subscription.contactUs')"
text
severity="secondary"
icon="pi pi-comments"
icon-pos="right"
variant="muted-textonly"
class="h-6 p-1 text-sm text-text-secondary hover:text-base-foreground"
@click="handleContactUs"
/>
>
{{ $t('subscription.contactUs') }}
<i class="pi pi-comments" />
</Button>
<span class="text-sm text-text-secondary">{{ $t('g.or') }}</span>
<Button
:label="$t('subscription.viewEnterprise')"
text
severity="secondary"
icon="pi pi-external-link"
icon-pos="right"
variant="muted-textonly"
class="h-6 p-1 text-sm text-text-secondary hover:text-base-foreground"
@click="handleViewEnterprise"
/>
>
{{ $t('subscription.viewEnterprise') }}
<i class="pi pi-external-link" />
</Button>
</div>
</div>
</div>
<div v-else class="legacy-dialog relative grid h-full grid-cols-5">
<!-- Custom close button -->
<Button
icon="pi pi-times"
text
rounded
class="absolute top-2.5 right-2.5 z-10 h-8 w-8 p-0 text-white hover:bg-white/20"
size="icon"
variant="muted-textonly"
class="rounded-full absolute top-2.5 right-2.5 z-10 h-8 w-8 p-0 text-white hover:bg-white/20"
:aria-label="$t('g.close')"
@click="handleClose"
/>
>
<i class="pi pi-times" />
</Button>
<div
class="relative col-span-2 flex items-center justify-center overflow-hidden rounded-sm"
@@ -122,10 +119,10 @@
</template>
<script setup lang="ts">
import Button from 'primevue/button'
import { computed, onBeforeUnmount, watch } from 'vue'
import CloudBadge from '@/components/topbar/CloudBadge.vue'
import Button from '@/components/ui/button/Button.vue'
import { MONTHLY_SUBSCRIPTION_PRICE } from '@/config/subscriptionPricesConfig'
import PricingTable from '@/platform/cloud/subscription/components/PricingTable.vue'
import SubscribeButton from '@/platform/cloud/subscription/components/SubscribeButton.vue'