feat: add Surface, Link and Spinner components

This commit is contained in:
maoyingjie
2026-10-21 13:04:06 +08:00
parent 9d40dc0ecb
commit 630963c652
52 changed files with 2683 additions and 162 deletions
@@ -0,0 +1,25 @@
<script setup lang="ts">
import { provide, computed, useAttrs } from "vue";
import { surfaceVariants, type SurfaceVariants } from "@heroui-vue/styles";
import { surfaceContextKey } from "./context";
defineOptions({ inheritAttrs: false });
const props = withDefaults(
defineProps<{
variant?: SurfaceVariants["variant"];
}>(),
{ variant: "default" },
);
const attrs = useAttrs();
const variant = computed(() => props.variant ?? "default");
provide(surfaceContextKey, { variant });
</script>
<template>
<div v-bind="attrs" :class="surfaceVariants({ variant })" data-slot="surface">
<slot />
</div>
</template>
@@ -0,0 +1,9 @@
import type { ComputedRef, InjectionKey } from "vue";
import type { SurfaceVariants } from "@heroui-vue/styles";
export interface SurfaceContext {
variant: ComputedRef<SurfaceVariants["variant"]>;
}
export const surfaceContextKey: InjectionKey<SurfaceContext> =
Symbol("HeroUIVue.Surface");