* feat(ui): add `input group` base component * feat(history): add history viewer and rewind * test: update selector snapshot * test: add PW base page * style: apply TS style fixes * chore(history): request history wiki * chore(history): remove unwanted symbol * chore: fix type * style: apply TS style fixes
34 lines
1.4 KiB
Vue
34 lines
1.4 KiB
Vue
<script setup lang="ts">
|
|
import { cn } from '@/utils';
|
|
import { useVModel } from '@vueuse/core';
|
|
import type { HTMLAttributes } from 'vue';
|
|
|
|
const props = defineProps<{
|
|
class?: HTMLAttributes['class'];
|
|
defaultValue?: string | number;
|
|
modelValue?: string | number;
|
|
}>();
|
|
|
|
const emits = defineEmits<{
|
|
(e: 'update:modelValue', payload: string | number): void;
|
|
}>();
|
|
|
|
const modelValue = useVModel(props, 'modelValue', emits, {
|
|
passive: true,
|
|
defaultValue: props.defaultValue,
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<textarea
|
|
v-model="modelValue"
|
|
data-slot="textarea"
|
|
:class="
|
|
cn(
|
|
'flex field-sizing-content min-h-16 w-full rounded-md border border-zinc-200 bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-zinc-500 focus-visible:border-zinc-950 focus-visible:ring-[3px] focus-visible:ring-zinc-950/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-red-500 aria-invalid:ring-red-500/20 md:text-sm dark:border-zinc-800 dark:bg-zinc-200/30 dark:dark:bg-zinc-800/30 dark:placeholder:text-zinc-400 dark:focus-visible:border-zinc-300 dark:focus-visible:ring-zinc-300/50 dark:aria-invalid:border-red-900 dark:aria-invalid:ring-red-500/40 dark:aria-invalid:ring-red-900/20 dark:dark:aria-invalid:ring-red-900/40',
|
|
props.class,
|
|
)
|
|
"
|
|
/>
|
|
</template>
|