@equinor/eds-core-react 0.42.1 → 0.42.2
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.
package/dist/eds-core-react.cjs
CHANGED
|
@@ -5,6 +5,7 @@ var styled = require('styled-components');
|
|
|
5
5
|
var edsTokens = require('@equinor/eds-tokens');
|
|
6
6
|
var edsUtils = require('@equinor/eds-utils');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
var reactDom = require('react-dom');
|
|
8
9
|
var react$1 = require('@floating-ui/react');
|
|
9
10
|
var edsIcons = require('@equinor/eds-icons');
|
|
10
11
|
var downshift = require('downshift');
|
|
@@ -1151,7 +1152,7 @@ const Tooltip$2 = /*#__PURE__*/react.forwardRef(function Tooltip({
|
|
|
1151
1152
|
}, ref) {
|
|
1152
1153
|
const arrowRef = react.useRef(null);
|
|
1153
1154
|
const [open, setOpen] = react.useState(false);
|
|
1154
|
-
const shouldOpen = title !== '';
|
|
1155
|
+
const shouldOpen = title !== '' && typeof document !== 'undefined';
|
|
1155
1156
|
const {
|
|
1156
1157
|
x,
|
|
1157
1158
|
y,
|
|
@@ -1255,7 +1256,7 @@ const Tooltip$2 = /*#__PURE__*/react.forwardRef(function Tooltip({
|
|
|
1255
1256
|
})]
|
|
1256
1257
|
});
|
|
1257
1258
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1258
|
-
children: [shouldOpen && open && TooltipEl, updatedChildren]
|
|
1259
|
+
children: [shouldOpen && open && /*#__PURE__*/reactDom.createPortal(TooltipEl, document.body), updatedChildren]
|
|
1259
1260
|
});
|
|
1260
1261
|
});
|
|
1261
1262
|
|
|
@@ -7772,6 +7773,7 @@ const MenuItem$1 = /*#__PURE__*/react.forwardRef(function MenuItem({
|
|
|
7772
7773
|
return /*#__PURE__*/jsxRuntime.jsx(Item, {
|
|
7773
7774
|
...props,
|
|
7774
7775
|
$active: active,
|
|
7776
|
+
type: "button",
|
|
7775
7777
|
ref: edsUtils.mergeRefs(ref, el => {
|
|
7776
7778
|
if (isFocused) {
|
|
7777
7779
|
requestAnimationFrame(() => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { forwardRef, useRef, useState, useMemo, useEffect, cloneElement } from 'react';
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
2
3
|
import styled from 'styled-components';
|
|
3
4
|
import { typographyTemplate, spacingsTemplate, bordersTemplate, mergeRefs, useIsomorphicLayoutEffect } from '@equinor/eds-utils';
|
|
4
5
|
import { tooltip } from './Tooltip.tokens.js';
|
|
@@ -29,7 +30,7 @@ const Tooltip = /*#__PURE__*/forwardRef(function Tooltip({
|
|
|
29
30
|
}, ref) {
|
|
30
31
|
const arrowRef = useRef(null);
|
|
31
32
|
const [open, setOpen] = useState(false);
|
|
32
|
-
const shouldOpen = title !== '';
|
|
33
|
+
const shouldOpen = title !== '' && typeof document !== 'undefined';
|
|
33
34
|
const {
|
|
34
35
|
x,
|
|
35
36
|
y,
|
|
@@ -133,7 +134,7 @@ const Tooltip = /*#__PURE__*/forwardRef(function Tooltip({
|
|
|
133
134
|
})]
|
|
134
135
|
});
|
|
135
136
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
136
|
-
children: [shouldOpen && open && TooltipEl, updatedChildren]
|
|
137
|
+
children: [shouldOpen && open && /*#__PURE__*/createPortal(TooltipEl, document.body), updatedChildren]
|
|
137
138
|
});
|
|
138
139
|
});
|
|
139
140
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/eds-core-react",
|
|
3
|
-
"version": "0.42.
|
|
3
|
+
"version": "0.42.2",
|
|
4
4
|
"description": "The React implementation of the Equinor Design System",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
"@types/ramda": "^0.30.1",
|
|
53
53
|
"@types/react": "^18.3.3",
|
|
54
54
|
"@types/react-dom": "^18.3.0",
|
|
55
|
-
"babel-loader": "^9.1.3",
|
|
56
55
|
"babel-plugin-styled-components": "^2.1.4",
|
|
57
56
|
"jest": "^29.7.0",
|
|
58
57
|
"jest-environment-jsdom": "^29.7.0",
|
|
@@ -89,8 +88,8 @@
|
|
|
89
88
|
"downshift": "9.0.8",
|
|
90
89
|
"react-aria": "^3.34.1",
|
|
91
90
|
"@equinor/eds-icons": "^0.21.0",
|
|
92
|
-
"@equinor/eds-
|
|
93
|
-
"@equinor/eds-
|
|
91
|
+
"@equinor/eds-utils": "0.8.5",
|
|
92
|
+
"@equinor/eds-tokens": "0.9.2"
|
|
94
93
|
},
|
|
95
94
|
"scripts": {
|
|
96
95
|
"build": "rollup -c --bundleConfigAsCjs && tsc -p tsconfig.build.json",
|