@guruhotel/aura-ui
Version:
⚛️ React UI library by GuruHotel
1 lines • 1.3 kB
JavaScript
var e=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports.TooltipWrapper=exports.HorizontalTooltip=void 0;e(require("react"));var o=require("../tooltip"),r=require("./utils"),t=require("react/jsx-runtime");exports.TooltipWrapper=({children:e,hoverEndSelection:i,hoverStartSelection:l,numberOfDays:s,tooltip:n})=>{if((l||i)&&s&&n){const{day:i,night:l}=n,{dayLabel:a,nightLabel:d}=(0,r.getTooltipLabels)({day:i,night:l,numberOfDays:s});return(0,t.jsx)(o.TooltipProvider,{children:(0,t.jsxs)(o.Tooltip,{defaultOpen:!0,delayDuration:0,children:[(0,t.jsx)(o.TooltipTrigger,{asChild:!0,children:e}),(0,t.jsx)(o.TooltipPortal,{children:(0,t.jsxs)(o.TooltipContent,{sideOffset:2,side:"top",css:{bg:"$surfaceLight !important",color:"$text12"},shadow:"md",children:[d,l&&i&&", ",a,(0,t.jsx)(o.TooltipArrow,{css:{fill:"$surfaceLight !important"}})]})})]})})}return e};exports.HorizontalTooltip=({children:e,extendedDate:r})=>(0,t.jsx)(o.TooltipProvider,{children:(0,t.jsxs)(o.Tooltip,{delayDuration:0,children:[(0,t.jsx)(o.TooltipTrigger,{asChild:!0,children:e}),(0,t.jsx)(o.TooltipPortal,{children:(0,t.jsxs)(o.TooltipContent,{sideOffset:2,side:"top",css:{bg:"$surfaceLight",color:"$text12"},shadow:"md",children:[r,(0,t.jsx)(o.TooltipArrow,{css:{fill:"$surfaceLight"}})]})})]})});