@trackunit/react-components 0.1.36 → 0.1.39
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/index.css +2 -2
- package/index.js +16 -2
- package/package.json +2 -2
package/index.css
CHANGED
package/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import EChart from 'echarts-for-react';
|
|
|
7
7
|
import { v4 } from 'uuid';
|
|
8
8
|
import { useMeasure, useCopyToClipboard } from 'react-use';
|
|
9
9
|
import { format, formatDistance } from 'date-fns';
|
|
10
|
-
import { useFloating, offset, shift,
|
|
10
|
+
import { useFloating, offset, flip, shift, size, autoUpdate, useInteractions, useClick, useHover, useRole, useDismiss, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
|
|
11
11
|
import { Link, UNSAFE_NavigationContext } from 'react-router-dom';
|
|
12
12
|
import { DayPicker as DayPicker$1 } from 'react-day-picker';
|
|
13
13
|
import { enGB, enUS, da, de, cs, nl, fr, fi, hu, it, nb, pl, pt, ru, ro, es, sv, ja, th } from 'date-fns/locale';
|
|
@@ -955,7 +955,20 @@ const Popover = ({ children, render, placement, activation = { click: true, hove
|
|
|
955
955
|
const { x, y, reference, floating, strategy, context } = useFloating({
|
|
956
956
|
open,
|
|
957
957
|
onOpenChange: setOpen,
|
|
958
|
-
middleware: [
|
|
958
|
+
middleware: [
|
|
959
|
+
offset(8),
|
|
960
|
+
flip({ fallbackPlacements: ["top", "bottom", "right", "left"] }),
|
|
961
|
+
shift(),
|
|
962
|
+
size({
|
|
963
|
+
padding: 8,
|
|
964
|
+
apply({ availableWidth, availableHeight, elements }) {
|
|
965
|
+
Object.assign(elements.floating.style, {
|
|
966
|
+
maxWidth: `${availableWidth}px`,
|
|
967
|
+
maxHeight: `${availableHeight}px`,
|
|
968
|
+
});
|
|
969
|
+
},
|
|
970
|
+
}),
|
|
971
|
+
],
|
|
959
972
|
placement,
|
|
960
973
|
whileElementsMounted: autoUpdate,
|
|
961
974
|
});
|
|
@@ -972,6 +985,7 @@ const Popover = ({ children, render, placement, activation = { click: true, hove
|
|
|
972
985
|
position: strategy,
|
|
973
986
|
top: y !== null && y !== void 0 ? y : 0,
|
|
974
987
|
left: x !== null && x !== void 0 ? x : 0,
|
|
988
|
+
display: "flex",
|
|
975
989
|
} }, getFloatingProps(), { children: render({
|
|
976
990
|
close: () => {
|
|
977
991
|
setOpen(false);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.39",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"dependencies": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@trackunit/tailwind-styled-components": "0.0.51",
|
|
9
9
|
"react": "18.2.0",
|
|
10
10
|
"@trackunit/ui-design-tokens": "0.0.53",
|
|
11
|
-
"@trackunit/react-core-contexts-test": "0.1.
|
|
11
|
+
"@trackunit/react-core-contexts-test": "0.1.23",
|
|
12
12
|
"echarts": "5.4.0",
|
|
13
13
|
"echarts-for-react": "3.0.2",
|
|
14
14
|
"uuid": "8.3.2",
|