UNPKG

laif-ds

Version:

Design System di Laif con componenti React basati su principi di Atomic Design

88 lines (87 loc) 2.27 kB
"use client"; import { jsx as r, jsxs as s } from "react/jsx-runtime"; import { Root as l, Trigger as p, Portal as m, Content as c, Arrow as f, Provider as u } from "../../node_modules/@radix-ui/react-tooltip/dist/index.js"; import { cva as d } from "../../node_modules/class-variance-authority/dist/index.js"; import { cn as i } from "../../lib/utils.js"; const g = d( "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 origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance", { variants: { variant: { primary: "bg-d-primary text-d-primary-foreground", card: "bg-d-card text-d-card-foreground border border-d-border shadow-xl" } }, defaultVariants: { variant: "primary" } } ), b = d( "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]", { variants: { variant: { primary: "bg-d-primary fill-d-primary", card: "bg-d-card fill-d-card border border-d-border" } }, defaultVariants: { variant: "primary" } } ); function x({ delayDuration: t = 0, ...o }) { return /* @__PURE__ */ r( u, { "data-slot": "tooltip-provider", delayDuration: t, ...o } ); } function w({ ...t }) { return /* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(l, { "data-slot": "tooltip", ...t }) }); } function z({ ...t }) { return /* @__PURE__ */ r(p, { "data-slot": "tooltip-trigger", ...t }); } function V({ className: t, sideOffset: o = 0, variant: a, children: e, ...n }) { return /* @__PURE__ */ r(m, { children: /* @__PURE__ */ s( c, { "data-slot": "tooltip-content", sideOffset: o, className: i(g({ variant: a }), t), ...n, children: [ e, /* @__PURE__ */ r( f, { className: i(b({ variant: a })) } ) ] } ) }); } export { w as Tooltip, V as TooltipContent, x as TooltipProvider, z as TooltipTrigger };