@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.
Files changed (3) hide show
  1. package/index.css +2 -2
  2. package/index.js +16 -2
  3. package/package.json +2 -2
package/index.css CHANGED
@@ -258,7 +258,8 @@
258
258
 
259
259
  &__wrapper {
260
260
  @apply flex
261
- gap-2;
261
+ gap-2
262
+ items-center;
262
263
  }
263
264
 
264
265
  &--checked {
@@ -309,7 +310,6 @@
309
310
  @apply bg-white;
310
311
  }
311
312
 
312
-
313
313
  &__label-container {
314
314
  @apply gap-y-1
315
315
  grid;
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, flip, autoUpdate, useInteractions, useClick, useHover, useRole, useDismiss, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
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: [offset(8), shift(), flip({ crossAxis: true, fallbackPlacements: ["top", "bottom", "left", "right"] })],
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.36",
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.22",
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",