Basic implementation for anime page
This commit is contained in:
@ -4,6 +4,7 @@ import type { HTMLAttributes } from "vue"
|
||||
import { reactiveOmit } from "@vueuse/core"
|
||||
import { TooltipArrow, TooltipContent, TooltipPortal, useForwardPropsEmits } from "reka-ui"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { tooltipArrowVariants, tooltipContentVariants, type TooltipArrowVariants, type TooltipContentVariants } from "."
|
||||
|
||||
defineOptions({
|
||||
inheritAttrs: false,
|
||||
@ -13,6 +14,8 @@ interface Props {
|
||||
includeArrow?: boolean
|
||||
class?: HTMLAttributes["class"]
|
||||
arrowClass?: HTMLAttributes["class"]
|
||||
tooltipColor?: TooltipContentVariants["color"]
|
||||
tooltipArrowColor?: TooltipArrowVariants["color"]
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<TooltipContentProps & Props>(), {
|
||||
@ -29,11 +32,11 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
||||
<template>
|
||||
<TooltipPortal>
|
||||
<TooltipContent data-slot="tooltip-content" v-bind="{ ...forwarded, ...$attrs }"
|
||||
:class="cn('bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance', props.class)">
|
||||
:class="cn(tooltipContentVariants({ variant: 'default', color: tooltipColor }), props.class)">
|
||||
<slot />
|
||||
|
||||
<TooltipArrow
|
||||
:class="cn('bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]', arrowClass)"
|
||||
:class="cn(tooltipArrowVariants({ variant: 'default', color: tooltipArrowColor }), arrowClass)"
|
||||
v-if="includeArrow" />
|
||||
</TooltipContent>
|
||||
</TooltipPortal>
|
||||
|
||||
Reference in New Issue
Block a user