Files
codex-proxy-rs/frontend/src/components/base/BaseMenuItem.vue
T
ZyyandCodex dab221cdb9 refactor(theme): standardize container color roles
Rename primary, semantic and preset background roles to container and their paired foreground roles to on-container across derivation, CSS variables, utilities, consumers and documentation.

Preserve existing palette values and contrast relationships while making text on neutral surfaces distinct from content inside semantic containers.

Validated with token equivalence across presets and custom seeds, frontend typecheck, lint and production build.

Co-authored-by: Codex <noreply@openai.com>
2026-09-06 12:48:19 +08:00

47 lines
1.5 KiB
Vue

<script setup lang="ts">
import { LoaderCircle } from '@lucide/vue'
import { computed } from 'vue'
const props = withDefaults(
defineProps<{
tone?: 'neutral' | 'destructive'
disabled?: boolean
loading?: boolean
}>(),
{
tone: 'neutral',
disabled: false,
loading: false,
},
)
defineSlots<{
icon?: () => unknown
loading?: () => unknown
default: () => unknown
}>()
const classes = computed(() => [
'flex min-h-9 w-full touch-manipulation items-center gap-2 rounded-cp-sm border-0 bg-transparent px-3 text-left text-cp leading-none font-emphasis outline-none transition-[background-color,color] duration-150 motion-reduce:transition-none',
'focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-cp-control-outline',
'disabled:cursor-not-allowed disabled:text-cp-text-disabled',
props.tone === 'destructive'
? 'text-cp-error-text hover:bg-cp-error-container-hover hover:text-cp-error-on-container'
: 'text-cp-text hover:bg-cp-bg-text-hover',
])
</script>
<template>
<button type="button" :class="classes" :disabled="disabled || loading" :aria-busy="loading || undefined">
<span v-if="loading" class="inline-grid size-3.5 shrink-0 place-items-center">
<slot name="loading">
<LoaderCircle class="size-3.5 animate-spin motion-reduce:animate-none" />
</slot>
</span>
<span v-else-if="$slots.icon" class="inline-grid shrink-0 place-items-center">
<slot name="icon" />
</span>
<span class="min-w-0 flex-1 truncate"><slot /></span>
</button>
</template>