UNPKG

@guruhotel/aura-ui

Version:

⚛️ React UI library by GuruHotel

1 lines 1.07 kB
import t from"react";import{Tooltip as e,TooltipTrigger as r,TooltipProvider as i,TooltipContent as o,TooltipArrow as s,TooltipPortal as n}from"../tooltip";import{getTooltipLabels as l}from"./utils";import{jsx as a}from"react/jsx-runtime";import{jsxs as d}from"react/jsx-runtime";export const TooltipWrapper=({children:t,hoverEndSelection:c,hoverStartSelection:h,numberOfDays:f,tooltip:m})=>{if((h||c)&&f&&m){const{day:c,night:h}=m,{dayLabel:p,nightLabel:u}=l({day:c,night:h,numberOfDays:f});return a(i,{children:d(e,{defaultOpen:!0,delayDuration:0,children:[a(r,{asChild:!0,children:t}),a(n,{children:d(o,{sideOffset:2,side:"top",css:{bg:"$surfaceLight !important",color:"$text12"},shadow:"md",children:[u,h&&c&&", ",p,a(s,{css:{fill:"$surfaceLight !important"}})]})})]})})}return t};export const HorizontalTooltip=({children:t,extendedDate:l})=>a(i,{children:d(e,{delayDuration:0,children:[a(r,{asChild:!0,children:t}),a(n,{children:d(o,{sideOffset:2,side:"top",css:{bg:"$surfaceLight",color:"$text12"},shadow:"md",children:[l,a(s,{css:{fill:"$surfaceLight"}})]})})]})});