-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
60 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<script setup lang="ts"> | ||
defineProps({ | ||
value: { | ||
type: String, | ||
required: true | ||
}, | ||
size: { | ||
type: String, | ||
default: 'lg' | ||
} | ||
}) | ||
const { copy, copied } = useClipboard() | ||
</script> | ||
|
||
<template> | ||
<label> | ||
<UInput :model-value="value" :size="size" disabled :ui="{ icon: { trailing: { pointer: '' } } }" icon="i-ph-terminal"> | ||
<div class="absolute inset-0" :class="[copied ? 'cursor-default' : 'cursor-copy']" @click="copy(value)" /> | ||
<template #trailing> | ||
<UButton | ||
:icon="copied ? 'i-ph-check' : 'i-ph-copy'" | ||
color="gray" | ||
variant="link" | ||
:padded="false" | ||
:class="{ 'text-green-500 hover:text-green-500 dark:text-green-400 hover:dark:text-green-400': copied }" | ||
aria-label="copy button" | ||
@click="copy(value)" | ||
/> | ||
</template> | ||
</UInput> | ||
</label> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,12 +39,12 @@ function onSubmit() { | |
|
||
<template> | ||
<form @submit.prevent="onSubmit"> | ||
<UFormGroup name="email" :label="label" :description="description" size="xl" :ui="{ label: { base: 'font-semibold' }, container: 'mt-3' }"> | ||
<UFormGroup name="email" :label="label" size="lg" :description="description" :ui="{ label: { base: 'font-semibold' }, container: 'mt-3' }"> | ||
<UInput | ||
v-model="email" | ||
type="email" | ||
placeholder="[email protected]" | ||
:ui="{ icon: { trailing: { pointer: '' } } }" | ||
:ui="{ icon: { trailing: { pointer: '', padding: { lg: 'px-1' } } } }" | ||
required | ||
autocomplete="off" | ||
class="max-w-sm" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters