@react-fabric/core 1.0.0-beta.41 → 1.0.0-beta.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,38 +1,21 @@
1
1
  'use strict';
2
2
 
3
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
+ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
3
5
  var classNames = require('classnames');
4
6
  var Animations = require('../../components/animations/Animations.js');
5
7
  var Icon = require('../../components/icon/Icon.js');
6
8
  var jsxRuntime = require('react/jsx-runtime');
7
9
 
8
- /*
9
- * React Fabric
10
- * @version: 1.0.0
11
- *
12
- *
13
- * The MIT License (MIT)
14
- * Copyright (c) 2024 Adarsh Pastakia
15
- *
16
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
17
- * and associated documentation files (the "Software"), to deal in the Software without restriction,
18
- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
19
- * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
20
- * subject to the following conditions:
21
- *
22
- * The above copyright notice and this permission notice shall be included in all copies or substantial
23
- * portions of the Software.
24
- *
25
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
26
- * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
28
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
- */
30
-
10
+ var _excluded = ["ref", "children", "paper", "title", "titleClassName", "icon", "rtlFlip", "iconBg", "iconColor", "loading", "data-testid", "data-test-value"];
11
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
31
13
  /**
32
14
  * The page component used typically for routes, is a structured layout used within an application to organize and display content in a sectioned format, ensuring a consistent and intuitive user experience.
33
15
  */
34
16
  var Page = function Page(_ref) {
35
- var children = _ref.children,
17
+ var ref = _ref.ref,
18
+ children = _ref.children,
36
19
  paper = _ref.paper,
37
20
  title = _ref.title,
38
21
  titleClassName = _ref.titleClassName,
@@ -42,12 +25,15 @@ var Page = function Page(_ref) {
42
25
  iconColor = _ref.iconColor,
43
26
  loading = _ref.loading,
44
27
  testId = _ref["data-testid"],
45
- testValue = _ref["data-test-value"];
46
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
28
+ testValue = _ref["data-test-value"],
29
+ rest = _objectWithoutProperties(_ref, _excluded);
30
+ return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({
47
31
  "data-testid": testId,
48
32
  "data-test-value": testValue,
49
33
  "data-loading": loading,
50
- className: classNames("fabric-page", "overflow-hidden grid area-content", paper && "shadow-paper m-[6px] rounded-capped"),
34
+ className: classNames("fabric-page relative", "overflow-hidden grid area-content", paper && "shadow-paper m-[6px] rounded-capped"),
35
+ ref: ref
36
+ }, rest), {}, {
51
37
  children: [title && /*#__PURE__*/jsxRuntime.jsxs("div", {
52
38
  "data-ref": "pageTitle",
53
39
  className: classNames("fabric-pageTitle", "select-none flex gap-1 items-center justify-center px-1 py-0.5 font-medium text-center", titleClassName),
@@ -59,7 +45,7 @@ var Page = function Page(_ref) {
59
45
  color: iconColor
60
46
  }), title]
61
47
  }), loading && /*#__PURE__*/jsxRuntime.jsx(Animations.Loading, {}), children]
62
- });
48
+ }));
63
49
  };
64
50
 
65
51
  exports.Page = Page;
@@ -13,7 +13,7 @@ var HotKeyWrapper = require('../../hotkeys/HotKeyWrapper.js');
13
13
  var icons = require('../../types/icons.js');
14
14
  var jsxRuntime = require('react/jsx-runtime');
15
15
 
16
- var _excluded = ["icon", "iconBg", "iconColor", "iconClassName", "rtlFlip", "title", "actions", "headerClassName", "onClose", "onBeforeClose", "children", "loading", "size", "width", "height", "minHeight", "minWidth"];
16
+ var _excluded = ["icon", "iconBg", "iconColor", "iconClassName", "rtlFlip", "title", "actions", "headerClassName", "onClose", "onBeforeClose", "children", "loading", "root", "size", "noMask", "width", "height", "minHeight", "minWidth"];
17
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
18
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
19
  var Modal = function Modal(_ref) {
@@ -29,7 +29,9 @@ var Modal = function Modal(_ref) {
29
29
  onBeforeClose = _ref.onBeforeClose,
30
30
  children = _ref.children,
31
31
  loading = _ref.loading,
32
+ root = _ref.root,
32
33
  size = _ref.size,
34
+ noMask = _ref.noMask,
33
35
  width = _ref.width,
34
36
  height = _ref.height,
35
37
  minHeight = _ref.minHeight,
@@ -75,13 +77,15 @@ var Modal = function Modal(_ref) {
75
77
  }, 50);
76
78
  }, []);
77
79
  return /*#__PURE__*/jsxRuntime.jsx(react.FloatingPortal, {
80
+ root: root,
78
81
  children: /*#__PURE__*/jsxRuntime.jsx(react.FloatingOverlay, {
79
82
  lockScroll: true,
80
83
  style: {
81
84
  zIndex: "var(--z-overlay-mask)",
85
+ position: "absolute",
82
86
  overflow: "hidden"
83
87
  },
84
- className: "bg-tint-100/20 backdrop-blur-sm grid place-items-center p-16",
88
+ className: classNames("grid place-items-center p-16", !noMask && "bg-tint-100/20 backdrop-blur-sm"),
85
89
  children: /*#__PURE__*/jsxRuntime.jsx(react.FloatingFocusManager, {
86
90
  context: context,
87
91
  children: /*#__PURE__*/jsxRuntime.jsx("dialog", _objectSpread(_objectSpread(_objectSpread({
@@ -120,8 +120,8 @@ var Tooltip = function Tooltip(_ref) {
120
120
  backgroundColor: color ? getColor.getColor(color) : undefined
121
121
  }, floatingStyles)
122
122
  }, getFloatingProps()), {}, {
123
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
124
- className: classNames("font-medium flex-1 break-all", !textColor && "contrast", utilities.isString(content) && "whitespace-pre-wrap mixed-lang"),
123
+ children: [/*#__PURE__*/react.isValidElement(content) && content, utilities.isString(content) && /*#__PURE__*/jsxRuntime.jsx("span", {
124
+ className: classNames("font-medium flex-1 break-all whitespace-pre-wrap mixed-lang", !textColor && "contrast"),
125
125
  style: {
126
126
  color: textColor ? undefined : color ? getColor.getColor(color) : "var(--bg-color-muted)"
127
127
  },
@@ -1,38 +1,21 @@
1
1
  'use client';
2
2
 
3
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
5
  import classNames from 'classnames';
4
6
  import { Loading } from '../../components/animations/Animations.js';
5
7
  import { Icon } from '../../components/icon/Icon.js';
6
8
  import { jsxs, jsx } from 'react/jsx-runtime';
7
9
 
8
- /*
9
- * React Fabric
10
- * @version: 1.0.0
11
- *
12
- *
13
- * The MIT License (MIT)
14
- * Copyright (c) 2024 Adarsh Pastakia
15
- *
16
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
17
- * and associated documentation files (the "Software"), to deal in the Software without restriction,
18
- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
19
- * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
20
- * subject to the following conditions:
21
- *
22
- * The above copyright notice and this permission notice shall be included in all copies or substantial
23
- * portions of the Software.
24
- *
25
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
26
- * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
28
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
- */
30
-
10
+ var _excluded = ["ref", "children", "paper", "title", "titleClassName", "icon", "rtlFlip", "iconBg", "iconColor", "loading", "data-testid", "data-test-value"];
11
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
31
13
  /**
32
14
  * The page component used typically for routes, is a structured layout used within an application to organize and display content in a sectioned format, ensuring a consistent and intuitive user experience.
33
15
  */
34
16
  var Page = function Page(_ref) {
35
- var children = _ref.children,
17
+ var ref = _ref.ref,
18
+ children = _ref.children,
36
19
  paper = _ref.paper,
37
20
  title = _ref.title,
38
21
  titleClassName = _ref.titleClassName,
@@ -42,12 +25,15 @@ var Page = function Page(_ref) {
42
25
  iconColor = _ref.iconColor,
43
26
  loading = _ref.loading,
44
27
  testId = _ref["data-testid"],
45
- testValue = _ref["data-test-value"];
46
- return /*#__PURE__*/jsxs("div", {
28
+ testValue = _ref["data-test-value"],
29
+ rest = _objectWithoutProperties(_ref, _excluded);
30
+ return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
47
31
  "data-testid": testId,
48
32
  "data-test-value": testValue,
49
33
  "data-loading": loading,
50
- className: classNames("fabric-page", "overflow-hidden grid area-content", paper && "shadow-paper m-[6px] rounded-capped"),
34
+ className: classNames("fabric-page relative", "overflow-hidden grid area-content", paper && "shadow-paper m-[6px] rounded-capped"),
35
+ ref: ref
36
+ }, rest), {}, {
51
37
  children: [title && /*#__PURE__*/jsxs("div", {
52
38
  "data-ref": "pageTitle",
53
39
  className: classNames("fabric-pageTitle", "select-none flex gap-1 items-center justify-center px-1 py-0.5 font-medium text-center", titleClassName),
@@ -59,7 +45,7 @@ var Page = function Page(_ref) {
59
45
  color: iconColor
60
46
  }), title]
61
47
  }), loading && /*#__PURE__*/jsx(Loading, {}), children]
62
- });
48
+ }));
63
49
  };
64
50
 
65
51
  export { Page };
@@ -13,7 +13,7 @@ import { HotKeyWrapper } from '../../hotkeys/HotKeyWrapper.js';
13
13
  import { CoreIcons } from '../../types/icons.js';
14
14
  import { jsx, jsxs } from 'react/jsx-runtime';
15
15
 
16
- var _excluded = ["icon", "iconBg", "iconColor", "iconClassName", "rtlFlip", "title", "actions", "headerClassName", "onClose", "onBeforeClose", "children", "loading", "size", "width", "height", "minHeight", "minWidth"];
16
+ var _excluded = ["icon", "iconBg", "iconColor", "iconClassName", "rtlFlip", "title", "actions", "headerClassName", "onClose", "onBeforeClose", "children", "loading", "root", "size", "noMask", "width", "height", "minHeight", "minWidth"];
17
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
18
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
19
  var Modal = function Modal(_ref) {
@@ -29,7 +29,9 @@ var Modal = function Modal(_ref) {
29
29
  onBeforeClose = _ref.onBeforeClose,
30
30
  children = _ref.children,
31
31
  loading = _ref.loading,
32
+ root = _ref.root,
32
33
  size = _ref.size,
34
+ noMask = _ref.noMask,
33
35
  width = _ref.width,
34
36
  height = _ref.height,
35
37
  minHeight = _ref.minHeight,
@@ -75,13 +77,15 @@ var Modal = function Modal(_ref) {
75
77
  }, 50);
76
78
  }, []);
77
79
  return /*#__PURE__*/jsx(FloatingPortal, {
80
+ root: root,
78
81
  children: /*#__PURE__*/jsx(FloatingOverlay, {
79
82
  lockScroll: true,
80
83
  style: {
81
84
  zIndex: "var(--z-overlay-mask)",
85
+ position: "absolute",
82
86
  overflow: "hidden"
83
87
  },
84
- className: "bg-tint-100/20 backdrop-blur-sm grid place-items-center p-16",
88
+ className: classNames("grid place-items-center p-16", !noMask && "bg-tint-100/20 backdrop-blur-sm"),
85
89
  children: /*#__PURE__*/jsx(FloatingFocusManager, {
86
90
  context: context,
87
91
  children: /*#__PURE__*/jsx("dialog", _objectSpread(_objectSpread(_objectSpread({
@@ -120,8 +120,8 @@ var Tooltip = function Tooltip(_ref) {
120
120
  backgroundColor: color ? getColor(color) : undefined
121
121
  }, floatingStyles)
122
122
  }, getFloatingProps()), {}, {
123
- children: [/*#__PURE__*/jsx("span", {
124
- className: classNames("font-medium flex-1 break-all", !textColor && "contrast", isString(content) && "whitespace-pre-wrap mixed-lang"),
123
+ children: [/*#__PURE__*/isValidElement(content) && content, isString(content) && /*#__PURE__*/jsx("span", {
124
+ className: classNames("font-medium flex-1 break-all whitespace-pre-wrap mixed-lang", !textColor && "contrast"),
125
125
  style: {
126
126
  color: textColor ? undefined : color ? getColor(color) : "var(--bg-color-muted)"
127
127
  },
@@ -1,5 +1,5 @@
1
- import { type ChildrenProp, type IconProps, type TestProps } from "../../types";
2
- export interface PageProps extends IconProps, ChildrenProp, TestProps {
1
+ import { type ChildrenProp, type IconProps, type RefProp, type TestProps } from "../../types";
2
+ export interface PageProps extends IconProps, ChildrenProp, TestProps, RefProp<HTMLDivElement> {
3
3
  /**
4
4
  * page title
5
5
  */
@@ -20,4 +20,4 @@ export interface PageProps extends IconProps, ChildrenProp, TestProps {
20
20
  /**
21
21
  * The page component used typically for routes, is a structured layout used within an application to organize and display content in a sectioned format, ensuring a consistent and intuitive user experience.
22
22
  */
23
- export declare const Page: ({ children, paper, title, titleClassName, icon, rtlFlip, iconBg, iconColor, loading, "data-testid": testId, "data-test-value": testValue, }: PageProps) => import("react/jsx-runtime").JSX.Element;
23
+ export declare const Page: ({ ref, children, paper, title, titleClassName, icon, rtlFlip, iconBg, iconColor, loading, "data-testid": testId, "data-test-value": testValue, ...rest }: PageProps) => import("react/jsx-runtime").JSX.Element;
@@ -42,6 +42,14 @@ export interface ModalProps extends AriaProps, TestProps, Omit<IconProps, "icon"
42
42
  * minimum width
43
43
  */
44
44
  minWidth?: string | number;
45
+ /**
46
+ * portal root element
47
+ */
48
+ root?: HTMLElement;
49
+ /**
50
+ * hide mask background
51
+ */
52
+ noMask?: boolean;
45
53
  /**
46
54
  * close handler
47
55
  */
@@ -51,4 +59,4 @@ export interface ModalProps extends AriaProps, TestProps, Omit<IconProps, "icon"
51
59
  */
52
60
  onBeforeClose?: (...args: AnyObject) => CallbackReturn;
53
61
  }
54
- export declare const Modal: ({ icon, iconBg, iconColor, iconClassName, rtlFlip, title, actions, headerClassName, onClose, onBeforeClose, children, loading, size, width, height, minHeight, minWidth, ...aria }: ModalProps) => import("react/jsx-runtime").JSX.Element;
62
+ export declare const Modal: ({ icon, iconBg, iconColor, iconClassName, rtlFlip, title, actions, headerClassName, onClose, onBeforeClose, children, loading, root, size, noMask, width, height, minHeight, minWidth, ...aria }: ModalProps) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-fabric/core",
3
- "version": "1.0.0-beta.41",
3
+ "version": "1.0.0-beta.42",
4
4
  "description": "RUF: Core package",
5
5
  "author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
6
6
  "license": "MIT",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@floating-ui/react": "^0.26.24",
39
- "@react-fabric/utilities": "^1.0.0-beta.41",
39
+ "@react-fabric/utilities": "^1.0.0-beta.42",
40
40
  "@tailwindcss/postcss": "~4.0.14",
41
41
  "boring-avatars": "^1.10.2",
42
42
  "classnames": "^2.5.1",
@@ -54,5 +54,5 @@
54
54
  "node": ">=18.12.0",
55
55
  "npm": ">=8.19.0"
56
56
  },
57
- "gitHead": "bc737416d3c6a217a6b8c47291c3975a22722d80"
57
+ "gitHead": "61c9612bb2c7bc9a807f46922881432748c9e7a3"
58
58
  }
@@ -24,9 +24,18 @@
24
24
  import classNames from "classnames";
25
25
  import { Loading } from "../../components/animations/Animations";
26
26
  import { Icon } from "../../components/icon/Icon";
27
- import { type ChildrenProp, type IconProps, type TestProps } from "../../types";
27
+ import {
28
+ type ChildrenProp,
29
+ type IconProps,
30
+ type RefProp,
31
+ type TestProps,
32
+ } from "../../types";
28
33
 
29
- export interface PageProps extends IconProps, ChildrenProp, TestProps {
34
+ export interface PageProps
35
+ extends IconProps,
36
+ ChildrenProp,
37
+ TestProps,
38
+ RefProp<HTMLDivElement> {
30
39
  /**
31
40
  * page title
32
41
  */
@@ -49,6 +58,7 @@ export interface PageProps extends IconProps, ChildrenProp, TestProps {
49
58
  * The page component used typically for routes, is a structured layout used within an application to organize and display content in a sectioned format, ensuring a consistent and intuitive user experience.
50
59
  */
51
60
  export const Page = ({
61
+ ref,
52
62
  children,
53
63
  paper,
54
64
  title,
@@ -60,6 +70,7 @@ export const Page = ({
60
70
  loading,
61
71
  "data-testid": testId,
62
72
  "data-test-value": testValue,
73
+ ...rest
63
74
  }: PageProps) => {
64
75
  return (
65
76
  <div
@@ -67,10 +78,12 @@ export const Page = ({
67
78
  data-test-value={testValue}
68
79
  data-loading={loading}
69
80
  className={classNames(
70
- "fabric-page",
81
+ "fabric-page relative",
71
82
  "overflow-hidden grid area-content",
72
83
  paper && "shadow-paper m-[6px] rounded-capped",
73
84
  )}
85
+ ref={ref}
86
+ {...rest}
74
87
  >
75
88
  {title && (
76
89
  <div
@@ -98,6 +98,14 @@ export interface ModalProps
98
98
  * minimum width
99
99
  */
100
100
  minWidth?: string | number;
101
+ /**
102
+ * portal root element
103
+ */
104
+ root?: HTMLElement;
105
+ /**
106
+ * hide mask background
107
+ */
108
+ noMask?: boolean;
101
109
  /**
102
110
  * close handler
103
111
  */
@@ -121,7 +129,9 @@ export const Modal = ({
121
129
  onBeforeClose,
122
130
  children,
123
131
  loading,
132
+ root,
124
133
  size,
134
+ noMask,
125
135
  width,
126
136
  height,
127
137
  minHeight,
@@ -173,11 +183,18 @@ export const Modal = ({
173
183
  }, []);
174
184
 
175
185
  return (
176
- <FloatingPortal>
186
+ <FloatingPortal root={root}>
177
187
  <FloatingOverlay
178
188
  lockScroll
179
- style={{ zIndex: "var(--z-overlay-mask)", overflow: "hidden" }}
180
- className="bg-tint-100/20 backdrop-blur-sm grid place-items-center p-16"
189
+ style={{
190
+ zIndex: "var(--z-overlay-mask)",
191
+ position: "absolute",
192
+ overflow: "hidden",
193
+ }}
194
+ className={classNames(
195
+ "grid place-items-center p-16",
196
+ !noMask && "bg-tint-100/20 backdrop-blur-sm",
197
+ )}
181
198
  >
182
199
  <FloatingFocusManager context={context}>
183
200
  <dialog
@@ -186,22 +186,24 @@ export const Tooltip = ({
186
186
  }}
187
187
  {...getFloatingProps()}
188
188
  >
189
- <span
190
- className={classNames(
191
- "font-medium flex-1 break-all",
192
- !textColor && "contrast",
193
- isString(content) && "whitespace-pre-wrap mixed-lang",
194
- )}
195
- style={{
196
- color: textColor
197
- ? undefined
198
- : color
199
- ? getColor(color)
200
- : "var(--bg-color-muted)",
201
- }}
202
- >
203
- {content}
204
- </span>
189
+ {isValidElement(content) && content}
190
+ {isString(content) && (
191
+ <span
192
+ className={classNames(
193
+ "font-medium flex-1 break-all whitespace-pre-wrap mixed-lang",
194
+ !textColor && "contrast",
195
+ )}
196
+ style={{
197
+ color: textColor
198
+ ? undefined
199
+ : color
200
+ ? getColor(color)
201
+ : "var(--bg-color-muted)",
202
+ }}
203
+ >
204
+ {content}
205
+ </span>
206
+ )}
205
207
  {copyEl}
206
208
  <FloatingArrow
207
209
  ref={arrowRef}