@airplane/views
Version:
A React library for building Airplane views. Views components are optimized in style and functionality to produce internal apps that are easy to build and maintain.
26 lines (25 loc) • 1.07 kB
JavaScript
import { jsx } from "react/jsx-runtime";
import { Tooltip as Tooltip$1 } from "@mantine/core";
import { Fragment, createElement } from "react";
import { ComponentErrorBoundary } from "../errorBoundary/ComponentErrorBoundary.js";
const TooltipComponent = ({
color = "gray.8",
children,
wrapper,
...restProps
}) => {
if (!wrapper) {
if (typeof children === "string" || typeof children === "number" || typeof children === "object" && // eslint-disable-next-line @typescript-eslint/no-explicit-any
(children == null ? void 0 : children.type) === Fragment) {
wrapper = "span";
}
}
return /* @__PURE__ */ jsx(Tooltip$1, { color, withinPortal: true, ...restProps, children: wrapper ? /* @__PURE__ */ createElement(wrapper, {}, children) : children });
};
const Tooltip = (props) => /* @__PURE__ */ jsx(ComponentErrorBoundary, { componentName: Tooltip.displayName, children: /* @__PURE__ */ jsx(TooltipComponent, { ...props }) });
Tooltip.displayName = "Tooltip";
export {
Tooltip,
TooltipComponent
};
//# sourceMappingURL=Tooltip.js.map