@reportportal/ui-kit 0.0.1-alpha.210 → 0.0.1-alpha.211

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.
@@ -12,9 +12,14 @@ export interface PopoverProps {
12
12
  safeZone?: number;
13
13
  arrowColor?: string;
14
14
  dataAutomationId?: string;
15
- isOpened?: boolean;
16
- isCentered?: boolean;
17
15
  strategy?: Strategy;
16
+ transitionDuration?: number | Partial<{
17
+ open: number;
18
+ close: number;
19
+ }>;
20
+ isCentered?: boolean;
21
+ isFocusDisabled?: boolean;
22
+ isOpened?: boolean;
18
23
  shouldUsePortal?: boolean;
19
24
  setIsOpened?: (isOpened: boolean) => void;
20
25
  }
package/dist/popover.js CHANGED
@@ -1,86 +1,95 @@
1
- import { jsxs as f, Fragment as j, jsx as s } from "react/jsx-runtime";
2
- import { useRef as C, useState as L, useCallback as M } from "react";
3
- import { useFloating as W, offset as U, flip as q, arrow as z, autoUpdate as B, useClick as J, useDismiss as K, useRole as Q, useInteractions as V, FloatingFocusManager as X, FloatingArrow as Y, FloatingPortal as Z } from "@floating-ui/react";
4
- import { c as $ } from "./bind-06a7ff84.js";
5
- import { g as ee, T as g, a as te, A as se, b as ne, m as oe } from "./floatingUi-46f5b896.js";
6
- const le = "_popover_n3nff_1", ae = "_title_n3nff_28", re = {
1
+ import { jsxs as f, Fragment as W, jsx as s } from "react/jsx-runtime";
2
+ import { useRef as U, useState as q, useCallback as z } from "react";
3
+ import { useFloating as B, offset as J, flip as K, arrow as Q, autoUpdate as V, useClick as X, useDismiss as Y, useRole as Z, useInteractions as $, useTransitionStyles as ee, FloatingFocusManager as te, FloatingArrow as se, FloatingPortal as ne } from "@floating-ui/react";
4
+ import { c as oe } from "./bind-06a7ff84.js";
5
+ import { g as ae, T as u, a as le, A as ie, b as re, m as ce } from "./floatingUi-46f5b896.js";
6
+ const pe = "_popover_n3nff_1", me = "_title_n3nff_28", fe = {
7
7
  "popover-wrapper": "_popover-wrapper_n3nff_1",
8
- popover: le,
9
- title: ae
10
- }, a = $.bind(re), ge = ({
11
- content: u,
12
- children: d,
13
- className: _,
14
- placement: h = "bottom",
15
- fallbackPlacements: v = te,
16
- title: r,
17
- arrowOffset: n = se,
8
+ popover: pe,
9
+ title: me
10
+ }, l = oe.bind(fe), he = ({
11
+ content: d,
12
+ children: g,
13
+ placement: v = "bottom",
14
+ fallbackPlacements: _ = le,
15
+ className: h,
16
+ title: i,
17
+ arrowOffset: n = ie,
18
18
  safeZone: A = 4,
19
19
  arrowColor: F = "white",
20
20
  dataAutomationId: x,
21
- isOpened: R,
22
- isCentered: i = !0,
23
- strategy: w = "absolute",
24
- shouldUsePortal: E = !1,
21
+ strategy: y = "absolute",
22
+ transitionDuration: R = 0,
23
+ isCentered: r = !0,
24
+ isFocusDisabled: w = !1,
25
+ isOpened: E,
26
+ shouldUsePortal: b = !1,
25
27
  setIsOpened: o
26
28
  }) => {
27
- const c = C(null), [b, N] = L(!1), m = o ? R : b, P = (e) => {
29
+ const c = U(null), [T, N] = q(!1), p = o ? E : T, P = (e) => {
28
30
  o ? o(e) : N(e);
29
- }, T = M(
30
- (e, l) => ee(e, l, n, i),
31
- [n, i]
32
- ), { placement: y, refs: p, floatingStyles: k, context: t } = W({
33
- open: m,
31
+ }, S = z(
32
+ (e, a) => ae(e, a, n, r),
33
+ [n, r]
34
+ ), { placement: k, refs: m, floatingStyles: I, context: t } = B({
35
+ open: p,
34
36
  onOpenChange: P,
35
- placement: h,
36
- strategy: w,
37
+ placement: v,
38
+ strategy: y,
37
39
  middleware: [
38
- U(({ rects: e, placement: l }) => ({
39
- mainAxis: A + g,
40
- alignmentAxis: T(e, l)
40
+ J(({ rects: e, placement: a }) => ({
41
+ mainAxis: A + u,
42
+ alignmentAxis: S(e, a)
41
43
  })),
42
- q({
44
+ K({
43
45
  fallbackAxisSideDirection: "start",
44
- fallbackPlacements: v
46
+ fallbackPlacements: _
45
47
  }),
46
- z({
48
+ Q({
47
49
  element: c
48
50
  })
49
51
  ],
50
- whileElementsMounted: B
51
- }), I = J(t), S = K(t), D = Q(t), { getReferenceProps: G, getFloatingProps: H } = V([I, S, D]), O = () => {
52
- const e = /* @__PURE__ */ s(X, { context: t, modal: !1, children: /* @__PURE__ */ f(
52
+ whileElementsMounted: V
53
+ }), D = X(t), G = Y(t), H = Z(t), { getReferenceProps: M, getFloatingProps: O } = $([D, G, H]), { isMounted: j, styles: C } = ee(t, {
54
+ duration: R,
55
+ initial: { opacity: 0 }
56
+ }), L = () => {
57
+ const e = /* @__PURE__ */ s(te, { context: t, modal: !1, disabled: w, children: /* @__PURE__ */ f(
53
58
  "div",
54
59
  {
55
- className: a("popover", _),
60
+ className: l("popover", h),
56
61
  "data-automation-id": x,
57
- ref: p.setFloating,
58
- style: k,
59
- ...H(),
62
+ ref: m.setFloating,
63
+ style: {
64
+ ...I,
65
+ ...C,
66
+ pointerEvents: p ? "auto" : "none"
67
+ },
68
+ ...O(),
60
69
  children: [
61
70
  /* @__PURE__ */ s(
62
- Y,
71
+ se,
63
72
  {
64
73
  ref: c,
65
74
  context: t,
66
- width: ne,
67
- height: g,
75
+ width: re,
76
+ height: u,
68
77
  fill: F,
69
- staticOffset: oe.includes(y) ? null : n
78
+ staticOffset: ce.includes(k) ? null : n
70
79
  }
71
80
  ),
72
- r && /* @__PURE__ */ s("div", { className: a("title"), children: r }),
73
- u
81
+ i && /* @__PURE__ */ s("div", { className: l("title"), children: i }),
82
+ d
74
83
  ]
75
84
  }
76
85
  ) });
77
- return E ? /* @__PURE__ */ s(Z, { children: e }) : e;
86
+ return b ? /* @__PURE__ */ s(ne, { children: e }) : e;
78
87
  };
79
- return /* @__PURE__ */ f(j, { children: [
80
- /* @__PURE__ */ s("div", { ref: p.setReference, ...G(), className: a("popover-wrapper"), children: d }),
81
- m && O()
88
+ return /* @__PURE__ */ f(W, { children: [
89
+ /* @__PURE__ */ s("div", { ref: m.setReference, ...M(), className: l("popover-wrapper"), children: g }),
90
+ j && L()
82
91
  ] });
83
92
  };
84
93
  export {
85
- ge as Popover
94
+ he as Popover
86
95
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reportportal/ui-kit",
3
- "version": "0.0.1-alpha.210",
3
+ "version": "0.0.1-alpha.211",
4
4
  "description": "The UI-kit library for ReportPortal Design System.",
5
5
  "type": "module",
6
6
  "scripts": {