@reportportal/ui-kit 0.0.1-alpha.215 → 0.0.1-alpha.217

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,22 +1,22 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { useState as P, useRef as w, useCallback as V, useEffect as C, isValidElement as F, Fragment as K } from "react";
3
- import { S as R } from "./details-dbb1530b.js";
4
- import { B as U } from "./baseIconButton-251479f7.js";
5
- import { Popover as z } from "./popover.js";
6
- import { c as G } from "./bind-06a7ff84.js";
7
- const H = "_disabled_gfti4_69", J = "_divider_gfti4_76", m = {
2
+ import { useState as V, useRef as w, useCallback as C, useEffect as F, isValidElement as K, Fragment as R } from "react";
3
+ import { S as U } from "./details-dbb1530b.js";
4
+ import { B as z } from "./baseIconButton-251479f7.js";
5
+ import { Popover as G } from "./popover.js";
6
+ import { c as H } from "./bind-06a7ff84.js";
7
+ const J = "_disabled_gfti4_69", L = "_divider_gfti4_76", m = {
8
8
  "action-menu": "_action-menu_gfti4_16",
9
9
  "actions-popover": "_actions-popover_gfti4_20",
10
10
  "action-dropdown": "_action-dropdown_gfti4_24",
11
11
  "action-menu-button": "_action-menu-button_gfti4_29",
12
12
  "action-item": "_action-item_gfti4_42",
13
- disabled: H,
14
- divider: J
15
- }, l = G.bind(m), ee = ({
13
+ disabled: J,
14
+ divider: L
15
+ }, l = H.bind(m), ne = ({
16
16
  className: p,
17
17
  children: b,
18
18
  ...h
19
- }) => /* @__PURE__ */ i("div", { className: l("action-item", p), tabIndex: -1, ...h, children: b }), ne = ({
19
+ }) => /* @__PURE__ */ i("div", { className: l("action-item", p), tabIndex: -1, ...h, children: b }), te = ({
20
20
  placement: p = "bottom-end",
21
21
  items: b = [],
22
22
  cleanupDividers: h = !0,
@@ -27,15 +27,16 @@ const H = "_disabled_gfti4_69", J = "_divider_gfti4_76", m = {
27
27
  menuClassName: M,
28
28
  ariaLabel: S,
29
29
  trigger: v,
30
- disabled: a = !1
30
+ disabled: a = !1,
31
+ shouldUsePortal: O
31
32
  }) => {
32
- const [u, f] = P(!1), c = w(null), _ = w(/* @__PURE__ */ new Map()), O = V(
33
+ const [u, f] = V(!1), c = w(null), _ = w(/* @__PURE__ */ new Map()), q = C(
33
34
  (e) => {
34
35
  a || f(e);
35
36
  },
36
37
  [a]
37
38
  );
38
- C(() => {
39
+ F(() => {
39
40
  u && c.current && requestAnimationFrame(() => {
40
41
  requestAnimationFrame(() => {
41
42
  var n;
@@ -46,7 +47,7 @@ const H = "_disabled_gfti4_69", J = "_divider_gfti4_76", m = {
46
47
  });
47
48
  });
48
49
  }, [u]);
49
- const s = (e) => !!(e && typeof e == "object" && "type" in e && e.type === "divider"), q = (e) => s(e) ? !0 : typeof e == "object" && e !== null && "hasPermission" in e ? e.hasPermission !== !1 : !0, $ = (e) => {
50
+ const s = (e) => !!(e && typeof e == "object" && "type" in e && e.type === "divider"), $ = (e) => s(e) ? !0 : typeof e == "object" && e !== null && "hasPermission" in e ? e.hasPermission !== !1 : !0, j = (e) => {
50
51
  var r, I, d, k, x, D;
51
52
  const n = Array.from(
52
53
  ((r = c.current) == null ? void 0 : r.querySelectorAll(
@@ -75,7 +76,7 @@ const H = "_disabled_gfti4_69", J = "_divider_gfti4_76", m = {
75
76
  o && ((D = c.current) != null && D.contains(o)) && (o.click(), f(!1));
76
77
  } else
77
78
  e.key === "Escape" && (e.preventDefault(), f(!1));
78
- }, j = (e) => {
79
+ }, B = (e) => {
79
80
  const n = e.target, t = n.closest(`[role="menuitem"], .${m["action-item"]}`);
80
81
  if (t && !t.hasAttribute("disabled")) {
81
82
  if (n === t) {
@@ -86,7 +87,7 @@ const H = "_disabled_gfti4_69", J = "_divider_gfti4_76", m = {
86
87
  }
87
88
  f(!1);
88
89
  }
89
- }, B = (e, n) => s(e) ? /* @__PURE__ */ i("div", { className: l("divider") }, `divider-${n}`) : F(e) ? /* @__PURE__ */ i(K, { children: e }, n) : typeof e == "object" && e !== null && "label" in e ? e.hasPermission === !1 ? null : /* @__PURE__ */ i(
90
+ }, P = (e, n) => s(e) ? /* @__PURE__ */ i("div", { className: l("divider") }, `divider-${n}`) : K(e) ? /* @__PURE__ */ i(R, { children: e }, n) : typeof e == "object" && e !== null && "label" in e ? e.hasPermission === !1 ? null : /* @__PURE__ */ i(
90
91
  "button",
91
92
  {
92
93
  ref: (t) => {
@@ -114,42 +115,43 @@ const H = "_disabled_gfti4_69", J = "_divider_gfti4_76", m = {
114
115
  n.shift();
115
116
  for (; n.length > 0 && s(n[n.length - 1]); )
116
117
  n.pop();
117
- return n = n.filter((t, r) => !s(t) || r === 0 ? !0 : !s(n[r - 1])), n = n.filter((t, r) => s(t) ? n.slice(r + 1).some((d) => q(d)) : !0), n;
118
- })(b).map(B).filter(Boolean);
118
+ return n = n.filter((t, r) => !s(t) || r === 0 ? !0 : !s(n[r - 1])), n = n.filter((t, r) => s(t) ? n.slice(r + 1).some((d) => $(d)) : !0), n;
119
+ })(b).map(P).filter(Boolean);
119
120
  return y.length === 0 ? null : /* @__PURE__ */ i("div", { className: l("action-menu", A), children: /* @__PURE__ */ i(
120
- z,
121
+ G,
121
122
  {
122
123
  placement: p,
123
124
  isOpened: a ? !1 : u,
124
- setIsOpened: O,
125
+ setIsOpened: q,
126
+ shouldUsePortal: O,
125
127
  content: /* @__PURE__ */ i(
126
128
  "div",
127
129
  {
128
130
  ref: c,
129
131
  role: "menu",
130
132
  tabIndex: -1,
131
- onKeyDown: $,
132
- onClick: j,
133
+ onKeyDown: j,
134
+ onClick: B,
133
135
  className: l("action-dropdown", M, N),
134
136
  children: y
135
137
  }
136
138
  ),
137
139
  className: l("actions-popover", E),
138
140
  children: v ? /* @__PURE__ */ i("div", { className: g, children: v }) : /* @__PURE__ */ i(
139
- U,
141
+ z,
140
142
  {
141
143
  className: l("action-menu-button", g),
142
144
  disabled: a,
143
145
  "aria-label": S || "Actions menu",
144
146
  "aria-expanded": u,
145
147
  "aria-haspopup": "menu",
146
- children: /* @__PURE__ */ i(R, {})
148
+ children: /* @__PURE__ */ i(U, {})
147
149
  }
148
150
  )
149
151
  }
150
152
  ) });
151
153
  };
152
154
  export {
153
- ne as A,
154
- ee as a
155
+ te as A,
156
+ ne as a
155
157
  };
@@ -1,4 +1,4 @@
1
- import { A as c, a as s } from "./actionMenu-e78f9615.js";
1
+ import { A as c, a as s } from "./actionMenu-6a964512.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "./details-dbb1530b.js";
@@ -18,7 +18,7 @@ export declare const ActionMenuItem: ({ className, children, ...props }: {
18
18
  className?: string | undefined;
19
19
  children: ReactNode;
20
20
  }) => import("react/jsx-runtime").JSX.Element;
21
- export interface ActionMenuProps extends Pick<PopoverProps, 'placement'> {
21
+ export interface ActionMenuProps extends Pick<PopoverProps, 'placement' | 'shouldUsePortal'> {
22
22
  items?: MenuItem[];
23
23
  cleanupDividers?: boolean;
24
24
  className?: string;
@@ -30,4 +30,4 @@ export interface ActionMenuProps extends Pick<PopoverProps, 'placement'> {
30
30
  trigger?: ReactNode;
31
31
  disabled?: boolean;
32
32
  }
33
- export declare const ActionMenu: ({ placement, items, cleanupDividers, className, contentClassName, buttonClassName, popoverClassName, menuClassName, ariaLabel, trigger, disabled, }: ActionMenuProps) => ReactElement | null;
33
+ export declare const ActionMenu: ({ placement, items, cleanupDividers, className, contentClassName, buttonClassName, popoverClassName, menuClassName, ariaLabel, trigger, disabled, shouldUsePortal, }: ActionMenuProps) => ReactElement | null;
@@ -5,6 +5,7 @@ interface TooltipProps {
5
5
  content: ReactNode;
6
6
  children: ReactNode;
7
7
  wrapperClassName?: string;
8
+ wrapperTabIndex?: number;
8
9
  tooltipClassName?: string;
9
10
  contentClassName?: string;
10
11
  dynamicWidth?: boolean;
@@ -4,7 +4,7 @@ import { c as K } from "./bind-06a7ff84.js";
4
4
  import "react-dnd";
5
5
  import "react-dnd-html5-backend";
6
6
  import { u as L } from "./useEllipsisTitle-462fa254.js";
7
- import { A as M } from "./actionMenu-e78f9615.js";
7
+ import { A as M } from "./actionMenu-6a964512.js";
8
8
  import "./details-dbb1530b.js";
9
9
  import "./baseIconButton-251479f7.js";
10
10
  import "./popover.js";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AdaptiveTagList as y } from "./adaptiveTagList.js";
2
- import { A as h, a as M } from "./actionMenu-e78f9615.js";
2
+ import { A as h, a as M } from "./actionMenu-6a964512.js";
3
3
  import { ACTION_MENU_DIVIDER as w } from "./actionMenu.js";
4
4
  import { A as R } from "./index-d6e02727.js";
5
5
  import { B as k } from "./baseIconButton-251479f7.js";
package/dist/tooltip.js CHANGED
@@ -1,82 +1,83 @@
1
- import { jsxs as u, Fragment as P, jsx as s } from "react/jsx-runtime";
2
- import { useState as R, useRef as f } from "react";
3
- import { createPortal as G } from "react-dom";
4
- import { c as j } from "./bind-06a7ff84.js";
5
- import { useFloating as k, offset as $, flip as B, arrow as C, autoUpdate as U, FloatingArrow as Y } from "@floating-ui/react";
6
- import { T as h, g as Z, a as q, b as z } from "./floatingUi-46f5b896.js";
7
- const J = {
1
+ import { jsxs as u, Fragment as R, jsx as s } from "react/jsx-runtime";
2
+ import { useState as G, useRef as f } from "react";
3
+ import { createPortal as j } from "react-dom";
4
+ import { c as k } from "./bind-06a7ff84.js";
5
+ import { useFloating as $, offset as B, flip as C, arrow as U, autoUpdate as Y, FloatingArrow as Z } from "@floating-ui/react";
6
+ import { T as h, g as q, a as z, b as J } from "./floatingUi-46f5b896.js";
7
+ const K = {
8
8
  "tooltip-wrapper": "_tooltip-wrapper_1n6ya_16",
9
9
  "tooltip-content": "_tooltip-content_1n6ya_26"
10
- }, i = j.bind(J), K = 300, Q = 100, st = ({
10
+ }, i = k.bind(K), Q = 300, V = 100, it = ({
11
11
  content: g,
12
12
  wrapperClassName: x,
13
- tooltipClassName: T,
14
- contentClassName: w,
15
- dynamicWidth: _,
16
- width: A,
17
- minWidth: E = 120,
18
- safeZone: b = 4,
19
- zIndex: y = 9,
20
- placement: I = "bottom",
21
- arrowColor: N = "rgba(34, 34, 34, 0.91)",
22
- dataAutomationId: F,
23
- mainAxis: O = !0,
24
- children: S,
13
+ wrapperTabIndex: T = 0,
14
+ tooltipClassName: w,
15
+ contentClassName: _,
16
+ dynamicWidth: A,
17
+ width: E,
18
+ minWidth: b = 120,
19
+ safeZone: y = 4,
20
+ zIndex: I = 9,
21
+ placement: N = "bottom",
22
+ arrowColor: F = "rgba(34, 34, 34, 0.91)",
23
+ dataAutomationId: O,
24
+ mainAxis: S = !0,
25
+ children: W,
25
26
  portalRoot: r,
26
- isFloating: W = !0
27
+ isFloating: v = !0
27
28
  }) => {
28
- const [a, l] = R(!1), c = f(null), e = f(), { refs: m, floatingStyles: v, context: L } = k({
29
+ const [a, l] = G(!1), c = f(null), e = f(), { refs: m, floatingStyles: L, context: M } = $({
29
30
  open: a,
30
- placement: I,
31
+ placement: N,
31
32
  middleware: [
32
- $(({ rects: t, placement: H }) => ({
33
- mainAxis: b + h,
34
- alignmentAxis: Z(t, H)
33
+ B(({ rects: t, placement: P }) => ({
34
+ mainAxis: y + h,
35
+ alignmentAxis: q(t, P)
35
36
  })),
36
- W && B({
37
- mainAxis: O,
37
+ v && C({
38
+ mainAxis: S,
38
39
  fallbackAxisSideDirection: "start",
39
- fallbackPlacements: q
40
+ fallbackPlacements: z
40
41
  }),
41
- C({
42
+ U({
42
43
  element: c
43
44
  })
44
45
  ],
45
- whileElementsMounted: U
46
- }), o = _ ? null : { width: `${A}px` }, M = document.documentElement.clientWidth, D = o || M - Q, n = () => {
46
+ whileElementsMounted: Y
47
+ }), o = A ? null : { width: `${E}px` }, D = document.documentElement.clientWidth, H = o || D - V, n = () => {
47
48
  e.current && clearTimeout(e.current), l(!1);
48
49
  }, d = () => {
49
- e.current = setTimeout(() => l(!0), K);
50
+ e.current = setTimeout(() => l(!0), Q);
50
51
  }, p = () => /* @__PURE__ */ u(
51
52
  "div",
52
53
  {
53
54
  ref: m.setFloating,
54
55
  style: {
55
- ...v,
56
+ ...L,
56
57
  ...o,
57
- minWidth: E,
58
- zIndex: y,
58
+ minWidth: b,
59
+ zIndex: I,
59
60
  pointerEvents: "none"
60
61
  },
61
- "data-automation-id": F,
62
- className: i(T),
62
+ "data-automation-id": O,
63
+ className: i(w),
63
64
  children: [
64
65
  /* @__PURE__ */ s(
65
- Y,
66
+ Z,
66
67
  {
67
68
  ref: c,
68
- context: L,
69
- width: z,
69
+ context: M,
70
+ width: J,
70
71
  height: h,
71
- fill: N
72
+ fill: F
72
73
  }
73
74
  ),
74
75
  /* @__PURE__ */ s(
75
76
  "div",
76
77
  {
77
- className: i("tooltip-content", w),
78
+ className: i("tooltip-content", _),
78
79
  style: {
79
- maxWidth: `${D}px`
80
+ maxWidth: `${H}px`
80
81
  },
81
82
  children: g
82
83
  }
@@ -84,7 +85,7 @@ const J = {
84
85
  ]
85
86
  }
86
87
  );
87
- return /* @__PURE__ */ u(P, { children: [
88
+ return /* @__PURE__ */ u(R, { children: [
88
89
  /* @__PURE__ */ s(
89
90
  "div",
90
91
  {
@@ -97,13 +98,13 @@ const J = {
97
98
  t.target === t.currentTarget && d();
98
99
  },
99
100
  onBlur: n,
100
- tabIndex: 0,
101
- children: S
101
+ tabIndex: T,
102
+ children: W
102
103
  }
103
104
  ),
104
- a && (r ? G(p(), r) : p())
105
+ a && (r ? j(p(), r) : p())
105
106
  ] });
106
107
  };
107
108
  export {
108
- st as Tooltip
109
+ it as Tooltip
109
110
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reportportal/ui-kit",
3
- "version": "0.0.1-alpha.215",
3
+ "version": "0.0.1-alpha.217",
4
4
  "description": "The UI-kit library for ReportPortal Design System.",
5
5
  "type": "module",
6
6
  "scripts": {