- Forward data-test-id attrs through rendered controls instead of exposing test-id props - Move shell chrome components into the Shell namespace - Remove internal planning docs from published VitePress docs - Add guardrails and contributor guidance for test hooks and component placement
31 lines
664 B
Vue
31 lines
664 B
Vue
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
import { twMerge } from 'tailwind-merge'
|
|
interface AppTextButtonProps {
|
|
ui?: {
|
|
base?: string
|
|
}
|
|
size?: 'xs' | 'sm'
|
|
underline?: boolean
|
|
}
|
|
|
|
const { ui, size = 'sm', underline = false } = defineProps<AppTextButtonProps>()
|
|
|
|
const emit = defineEmits<{ click: [event: MouseEvent] }>()
|
|
|
|
const cls = computed(() =>
|
|
twMerge(
|
|
'cursor-pointer text-muted hover:text-surface',
|
|
size === 'xs' ? 'text-[9px]' : 'text-[10px]',
|
|
underline && 'underline',
|
|
ui?.base
|
|
)
|
|
)
|
|
</script>
|
|
|
|
<template>
|
|
<button type="button" :class="cls" @click="emit('click', $event)">
|
|
<slot />
|
|
</button>
|
|
</template>
|