@arolariu/components
Version:
🎨 70+ beautiful, accessible React components built on Base UI. TypeScript-first, CSS Modules styling, tree-shakeable, SSR-ready. Perfect for modern web apps, design systems & rapid prototyping. Zero config, maximum flexibility! ⚡
55 lines (54 loc) • 2.15 kB
JavaScript
"use client";
import { jsx } from "react/jsx-runtime";
import { Tooltip } from "@base-ui/react/tooltip";
import { cn } from "../../lib/utilities.js";
import tooltip_module from "./tooltip.module.js";
import * as __rspack_external_react from "react";
const TooltipProvider = ({ children })=>children;
TooltipProvider.displayName = "TooltipProvider";
function tooltip_Tooltip(props) {
const { delayDuration, ...otherProps } = props;
const tooltipProps = void 0 === delayDuration ? otherProps : {
...otherProps,
delay: delayDuration
};
return /*#__PURE__*/ jsx(Tooltip.Root, {
...tooltipProps
});
}
tooltip_Tooltip.displayName = "Tooltip";
const TooltipTrigger = /*#__PURE__*/ __rspack_external_react.forwardRef((props, ref)=>{
const { asChild = false, children, className, ...otherProps } = props;
if (asChild && /*#__PURE__*/ __rspack_external_react.isValidElement(children)) return /*#__PURE__*/ jsx(Tooltip.Trigger, {
ref: ref,
className: cn(tooltip_module.trigger, className),
render: children,
...otherProps
});
return /*#__PURE__*/ jsx(Tooltip.Trigger, {
ref: ref,
className: cn(tooltip_module.trigger, className),
...otherProps,
children: children
});
});
TooltipTrigger.displayName = "TooltipTrigger";
const TooltipContent = /*#__PURE__*/ __rspack_external_react.forwardRef((props, ref)=>{
const { className, children, side = "top", sideOffset = 4, ...otherProps } = props;
return /*#__PURE__*/ jsx(Tooltip.Portal, {
children: /*#__PURE__*/ jsx(Tooltip.Positioner, {
className: tooltip_module.positioner,
side: side,
sideOffset: sideOffset,
children: /*#__PURE__*/ jsx(Tooltip.Popup, {
ref: ref,
className: cn(tooltip_module.popup, className),
...otherProps,
children: children
})
})
});
});
TooltipContent.displayName = "TooltipContent";
export { TooltipContent, TooltipProvider, TooltipTrigger, tooltip_Tooltip as Tooltip };
//# sourceMappingURL=tooltip.js.map