@reportportal/ui-kit 0.0.1-alpha.170 → 0.0.1-alpha.172

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/sidePanel.js CHANGED
@@ -1,88 +1,131 @@
1
- import { jsxs as s, jsx as i, Fragment as p } from "react/jsx-runtime";
2
- import { useId as N, useEffect as y } from "react";
3
- import { c as g } from "./bind-06a7ff84.js";
4
- import { K as E } from "./keyCodes-f63c0e11.js";
5
- import { S as x } from "./close-4d480ef7.js";
6
- import { B as k } from "./baseIconButton-251479f7.js";
7
- const I = "_active_6bj2z_15", K = "_compact_6bj2z_39", S = "_header_6bj2z_35", w = "_title_6bj2z_65", B = "_description_6bj2z_76", D = "_content_6bj2z_85", L = "_footer_6bj2z_92", P = "_divider_6bj2z_98", $ = {
8
- "side-panel": "_side-panel_6bj2z_1",
9
- active: I,
10
- "side-right": "_side-right_6bj2z_19",
11
- "side-left": "_side-left_6bj2z_27",
12
- "header-section": "_header-section_6bj2z_35",
13
- compact: K,
14
- header: S,
15
- "header-content": "_header-content_6bj2z_55",
16
- "close-button": "_close-button_6bj2z_59",
17
- title: w,
18
- description: B,
19
- content: D,
20
- footer: L,
21
- divider: P
22
- }, e = g.bind($), J = ({
23
- className: h,
24
- title: c,
25
- descriptionComponent: r,
26
- headerComponent: d,
1
+ import { jsxs as a, jsx as i, Fragment as S } from "react/jsx-runtime";
2
+ import { useId as D, useRef as I, useMemo as K, useEffect as P } from "react";
3
+ import { c as $ } from "./bind-06a7ff84.js";
4
+ import { K as A } from "./keyCodes-f63c0e11.js";
5
+ import { u as B } from "./useOnClickOutside-8f7d68a1.js";
6
+ import "react-dnd";
7
+ import "react-dnd-html5-backend";
8
+ import { a as L } from "./dropdown-7d024c49.js";
9
+ import { S as T } from "./close-4d480ef7.js";
10
+ import { B as j } from "./baseIconButton-251479f7.js";
11
+ import "react-dom";
12
+ import "@floating-ui/react-dom";
13
+ import "downshift";
14
+ import "rc-scrollbars";
15
+ import "./clear-53660571.js";
16
+ import "./dropdown-0260bb66.js";
17
+ import "./fieldLabel.js";
18
+ import "./adaptiveTagList.js";
19
+ import "./button-97d9e587.js";
20
+ import "./isEmpty-ccacb5ff.js";
21
+ import "./checkbox-493fdc63.js";
22
+ const M = "_active_5ebdz_11", F = "_compact_5ebdz_62", H = "_header_5ebdz_58", O = "_title_5ebdz_88", U = "_description_5ebdz_99", W = "_content_5ebdz_108", Y = "_footer_5ebdz_115", q = "_divider_5ebdz_121", w = {
23
+ "side-panel-overlay": "_side-panel-overlay_5ebdz_1",
24
+ active: M,
25
+ "overlay-default": "_overlay-default_5ebdz_16",
26
+ "overlay-light-cyan": "_overlay-light-cyan_5ebdz_20",
27
+ "side-panel": "_side-panel_5ebdz_1",
28
+ "side-right": "_side-right_5ebdz_42",
29
+ "side-left": "_side-left_5ebdz_50",
30
+ "header-section": "_header-section_5ebdz_58",
31
+ compact: F,
32
+ header: H,
33
+ "header-content": "_header-content_5ebdz_78",
34
+ "close-button": "_close-button_5ebdz_82",
35
+ title: O,
36
+ description: U,
37
+ content: W,
38
+ footer: Y,
39
+ divider: q
40
+ }, e = $.bind(w), ve = ({
41
+ className: u,
42
+ title: r,
43
+ descriptionComponent: o,
44
+ headerComponent: c,
27
45
  contentComponent: n,
28
- footerComponent: o,
46
+ footerComponent: l,
29
47
  top: _ = 0,
30
- side: b = "right",
31
- isOpen: a = !0,
48
+ side: z = "right",
49
+ isOpen: d = !0,
32
50
  onClose: t,
33
- closeButtonAriaLabel: v = "Close panel"
51
+ closeButtonAriaLabel: y = "Close panel",
52
+ showOverlay: m = !1,
53
+ overlay: p = "default",
54
+ allowCloseOutside: s = !0,
55
+ overlayClassName: N
34
56
  }) => {
35
- const l = N(), f = () => {
57
+ const v = D(), f = I(null), g = () => {
36
58
  t == null || t();
37
- };
38
- y(() => {
39
- if (!a || !t)
59
+ }, E = K(
60
+ () => ({
61
+ ignoreSelectors: [`[${L}]`]
62
+ }),
63
+ []
64
+ );
65
+ B(
66
+ f,
67
+ s && m && d ? t : void 0,
68
+ E
69
+ ), P(() => {
70
+ if (!d || !t)
40
71
  return;
41
- const m = (z) => {
42
- const { keyCode: u } = z;
43
- u === E.ESCAPE_KEY_CODE && t();
72
+ const b = (x) => {
73
+ const { keyCode: R } = x;
74
+ R === A.ESCAPE_KEY_CODE && s && t();
44
75
  };
45
- return document.addEventListener("keydown", m, !1), () => {
46
- document.removeEventListener("keydown", m, !1);
76
+ return document.addEventListener("keydown", b, !1), () => {
77
+ document.removeEventListener("keydown", b, !1);
47
78
  };
48
- }, [a, t]);
49
- const j = !!(d || r);
50
- return /* @__PURE__ */ s(
79
+ }, [d, t, s]);
80
+ const k = !!(c || o), h = /* @__PURE__ */ a(
51
81
  "aside",
52
82
  {
53
- className: e("side-panel", `side-${b}`, { active: a }, h),
83
+ ref: f,
84
+ className: e("side-panel", `side-${z}`, { active: d }, u),
54
85
  role: "dialog",
55
86
  "aria-modal": "true",
56
- "aria-hidden": !a,
57
- "aria-labelledby": c ? l : void 0,
87
+ "aria-hidden": !d,
88
+ "aria-labelledby": r ? v : void 0,
58
89
  style: { top: _, height: `calc(100vh - ${_}px)` },
59
90
  tabIndex: -1,
60
91
  children: [
61
- /* @__PURE__ */ s("div", { className: e("header-section", { compact: !j }), children: [
62
- (d || c) && /* @__PURE__ */ s("div", { className: e("header"), children: [
63
- c ? /* @__PURE__ */ i("span", { id: l, className: e("title"), children: c }) : d,
92
+ /* @__PURE__ */ a("div", { className: e("header-section", { compact: !k }), children: [
93
+ (c || r) && /* @__PURE__ */ a("div", { className: e("header"), children: [
94
+ r ? /* @__PURE__ */ i("span", { id: v, className: e("title"), children: r }) : c,
64
95
  t && /* @__PURE__ */ i(
65
- k,
96
+ j,
66
97
  {
67
98
  className: e("close-button"),
68
- onClick: f,
69
- "aria-label": v,
70
- children: /* @__PURE__ */ i(x, {})
99
+ onClick: g,
100
+ "aria-label": y,
101
+ children: /* @__PURE__ */ i(T, {})
71
102
  }
72
103
  )
73
104
  ] }),
74
- r
105
+ o
75
106
  ] }),
76
107
  /* @__PURE__ */ i("div", { className: e("divider") }),
77
108
  n && /* @__PURE__ */ i("div", { className: e("content"), children: n }),
78
- o && /* @__PURE__ */ s(p, { children: [
109
+ l && /* @__PURE__ */ a(S, { children: [
79
110
  /* @__PURE__ */ i("div", { className: e("divider") }),
80
- /* @__PURE__ */ i("div", { className: e("footer"), children: o })
111
+ /* @__PURE__ */ i("div", { className: e("footer"), children: l })
81
112
  ] })
82
113
  ]
83
114
  }
84
115
  );
116
+ return m ? /* @__PURE__ */ i(
117
+ "div",
118
+ {
119
+ className: e(
120
+ "side-panel-overlay",
121
+ { active: d },
122
+ p && `overlay-${p}`,
123
+ N
124
+ ),
125
+ children: h
126
+ }
127
+ ) : h;
85
128
  };
86
129
  export {
87
- J as SidePanel
130
+ ve as SidePanel
88
131
  };