mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-25 09:14:25 +00:00
Component: Button migration 1: TextButton (#7537)
## Summary Setup the variants and migrate existing uses of TextButton/TextIconButton/IconButton to a single Button component. Still a work in progress. ## Changes - **What**: Add a new Button - **What**: Migrate old buttons - **What**: Delete old buttons - **Dependencies**: CVA, upgrade Storybook ## Review Focus <!-- Critical design decisions or edge cases that need attention --> <!-- If this PR fixes an issue, uncomment and update the line below --> <!-- Fixes #ISSUE_NUMBER --> ## Screenshots (if applicable) <!-- Add screenshots or video recording to help explain your changes --> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7537-WIP-Component-Button-migration-2cb6d73d36508156a81bfc7bbddb36e9) by [Unito](https://www.unito.io) --------- Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
@@ -13,24 +13,26 @@
|
||||
<i class="icon-[lucide--circle-question-mark]" />
|
||||
</template>
|
||||
</IconTextButton>
|
||||
<TextButton
|
||||
<Button
|
||||
v-if="currentStep === 1"
|
||||
:label="$t('g.cancel')"
|
||||
type="transparent"
|
||||
size="md"
|
||||
variant="muted-textonly"
|
||||
size="lg"
|
||||
data-attr="upload-model-step1-cancel-button"
|
||||
:disabled="isFetchingMetadata || isUploading"
|
||||
@click="emit('close')"
|
||||
/>
|
||||
<TextButton
|
||||
>
|
||||
{{ $t('g.cancel') }}
|
||||
</Button>
|
||||
<Button
|
||||
v-if="currentStep !== 1 && currentStep !== 3"
|
||||
:label="$t('g.back')"
|
||||
type="transparent"
|
||||
size="md"
|
||||
variant="muted-textonly"
|
||||
size="lg"
|
||||
:data-attr="`upload-model-step${currentStep}-back-button`"
|
||||
:disabled="isFetchingMetadata || isUploading"
|
||||
@click="emit('back')"
|
||||
/>
|
||||
>
|
||||
{{ $t('g.back') }}
|
||||
</Button>
|
||||
<span v-else />
|
||||
|
||||
<IconTextButton
|
||||
@@ -65,14 +67,14 @@
|
||||
/>
|
||||
</template>
|
||||
</IconTextButton>
|
||||
<TextButton
|
||||
<Button
|
||||
v-else-if="currentStep === 3 && uploadStatus === 'success'"
|
||||
:label="$t('assetBrowser.finish')"
|
||||
type="secondary"
|
||||
size="md"
|
||||
variant="secondary"
|
||||
data-attr="upload-model-step3-finish-button"
|
||||
@click="emit('close')"
|
||||
/>
|
||||
>
|
||||
{{ $t('assetBrowser.finish') }}
|
||||
</Button>
|
||||
<VideoHelpDialog
|
||||
v-model="showVideoHelp"
|
||||
video-url="https://media.comfy.org/compressed_768/civitai_howto.webm"
|
||||
@@ -85,7 +87,7 @@
|
||||
import { ref } from 'vue'
|
||||
|
||||
import IconTextButton from '@/components/button/IconTextButton.vue'
|
||||
import TextButton from '@/components/button/TextButton.vue'
|
||||
import Button from '@/components/ui/button/Button.vue'
|
||||
import VideoHelpDialog from '@/platform/assets/components/VideoHelpDialog.vue'
|
||||
|
||||
const showVideoHelp = ref(false)
|
||||
|
||||
@@ -9,23 +9,17 @@
|
||||
<i class="icon-[lucide--external-link]" />
|
||||
<span>{{ $t('g.learnMore') }}</span>
|
||||
</a>
|
||||
<TextButton
|
||||
:label="$t('g.close')"
|
||||
type="transparent"
|
||||
size="md"
|
||||
@click="emit('close')"
|
||||
/>
|
||||
<TextButton
|
||||
:label="$t('subscription.required.subscribe')"
|
||||
type="secondary"
|
||||
size="md"
|
||||
@click="emit('subscribe')"
|
||||
/>
|
||||
<Button variant="textonly" @click="emit('close')">{{
|
||||
$t('g.close')
|
||||
}}</Button>
|
||||
<Button variant="secondary" @click="emit('subscribe')">
|
||||
{{ $t('subscription.required.subscribe') }}
|
||||
</Button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import TextButton from '@/components/button/TextButton.vue'
|
||||
import Button from '@/components/ui/button/Button.vue'
|
||||
|
||||
const emit = defineEmits<{
|
||||
close: []
|
||||
|
||||
Reference in New Issue
Block a user