feat(front): update InputGroupField component with improved delete button styling and add new Textarea component for enhanced text input

This commit is contained in:
keven1024
2026-04-26 21:40:46 +08:00
parent e8b5f98260
commit c841d8e1a2
4 changed files with 67 additions and 1 deletions

View File

@@ -20,7 +20,14 @@ const addInput = ref('')
:aria-invalid="!!errorMessage || undefined"
v-bind="$attrs"
/>
<Button variant="ghost" size="icon" @click="setValue(value.filter((_, i) => i !== index))"><LucideX class="size-4" /></Button>
<Button
variant="ghost"
size="icon"
class="bg-red-500/10 text-red-500 hover:bg-red-500 hover:text-white"
@click="setValue(value.filter((_, i) => i !== index))"
>
<LucideTrash class="size-4" />
</Button>
</div>
<div class="flex flex-row gap-2 items-center">
<Input v-model="addInput" :aria-invalid="!!errorMessage || undefined" v-bind="$attrs" />

View File

@@ -0,0 +1,25 @@
<script setup lang="ts">
import { Label } from '@/components/ui/label'
import { Textarea } from '@/components/ui/textarea'
const props = withDefaults(
defineProps<{
name: string
label?: string
placeholder?: string
rows?: number
}>(),
{
rows: 3,
}
)
const { value } = useField<string>(props.name)
</script>
<template>
<div class="flex flex-col gap-2">
<Label v-if="label">{{ label }}</Label>
<Textarea v-model="value" :placeholder="placeholder" :rows="rows" v-bind="$attrs" />
</div>
</template>