@reportportal/ui-kit 0.0.1-alpha.143 → 0.0.1-alpha.145

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/modal.js CHANGED
@@ -1,11 +1,11 @@
1
- import { jsx as t, jsxs as u, Fragment as F } from "react/jsx-runtime";
2
- import { useRef as C, useEffect as w, useState as y, useMemo as G } from "react";
3
- import { Scrollbars as K } from "rc-scrollbars";
4
- import { AnimatePresence as U, motion as Y } from "framer-motion";
5
- import { c as x } from "./bind-06a7ff84.js";
1
+ import { jsx as e, jsxs as h, Fragment as G } from "react/jsx-runtime";
2
+ import { useRef as z, useEffect as w, useState as v, useMemo as K } from "react";
3
+ import { Scrollbars as U } from "rc-scrollbars";
4
+ import { AnimatePresence as Y, motion as X } from "framer-motion";
5
+ import { c as b } from "./bind-06a7ff84.js";
6
6
  import "react-dnd";
7
7
  import "react-dnd-html5-backend";
8
- import { a as X } from "./dropdown-893c692c.js";
8
+ import { a as q } from "./dropdown-893c692c.js";
9
9
  import { K as J } from "./keyCodes-f63c0e11.js";
10
10
  import { B as D } from "./button-97d9e587.js";
11
11
  import { Tooltip as Q } from "./tooltip.js";
@@ -22,163 +22,171 @@ import "./isEmpty-ccacb5ff.js";
22
22
  import "./checkbox-ed6cc375.js";
23
23
  import "@floating-ui/react";
24
24
  import "./floatingUi-41f8c7b5.js";
25
- function tt(e, o, n) {
26
- const c = C(n);
25
+ function ee(t, i, o) {
26
+ const c = z(o);
27
27
  w(() => {
28
- c.current = n;
29
- }, [n]), w(() => {
30
- if (!o)
28
+ c.current = o;
29
+ }, [o]), w(() => {
30
+ if (!i)
31
31
  return;
32
- const s = (a) => {
32
+ const s = (l) => {
33
33
  var r, d;
34
- if (e && e.current && !e.current.contains(a.target)) {
35
- const l = a.target;
34
+ if (t && t.current && !t.current.contains(l.target)) {
35
+ const a = l.target;
36
36
  ((d = (r = c.current) == null ? void 0 : r.ignoreSelectors) == null ? void 0 : d.some(
37
- (v) => l == null ? void 0 : l.closest(v)
38
- )) || o(a);
37
+ (E) => a == null ? void 0 : a.closest(E)
38
+ )) || i(l);
39
39
  }
40
40
  };
41
41
  return document.addEventListener("pointerdown", s), () => {
42
42
  document.removeEventListener("pointerdown", s);
43
43
  };
44
- }, [e, o]);
44
+ }, [t, i]);
45
45
  }
46
- const et = () => {
47
- const [e, o] = y({ width: 0, height: 0 });
46
+ const te = () => {
47
+ const [t, i] = v({ width: 0, height: 0 });
48
48
  return w(() => {
49
- const n = () => {
50
- o({
49
+ const o = () => {
50
+ i({
51
51
  width: window.innerWidth,
52
52
  height: window.innerHeight
53
53
  });
54
54
  };
55
- return window.addEventListener("resize", n), n(), () => window.removeEventListener("resize", n);
56
- }, []), e;
57
- }, ot = "_scrollable_zh8d2_12", nt = {
58
- "modal-content": "_modal-content_zh8d2_1",
59
- scrollable: ot
60
- }, it = x.bind(nt), S = ({ scrollable: e = !1, children: o }) => /* @__PURE__ */ t("div", { className: it("modal-content", { scrollable: e }), children: o }), st = {
55
+ return window.addEventListener("resize", o), o(), () => window.removeEventListener("resize", o);
56
+ }, []), t;
57
+ }, oe = {
58
+ "modal-content": "_modal-content_ppzcb_1"
59
+ }, ne = b.bind(oe), S = ({ children: t }) => /* @__PURE__ */ e("div", { className: ne("modal-content"), children: t }), ie = {
61
60
  "buttons-block": "_buttons-block_1mwne_1",
62
61
  "button-container": "_button-container_1mwne_7",
63
62
  "modal-footer": "_modal-footer_1mwne_12",
64
63
  "with-extra-node": "_with-extra-node_1mwne_19",
65
64
  "size-small": "_size-small_1mwne_23"
66
- }, p = x.bind(st), lt = ({
67
- footerNode: e,
68
- closeHandler: o,
69
- okButton: n,
65
+ }, f = b.bind(ie), se = ({
66
+ footerNode: t,
67
+ closeHandler: i,
68
+ okButton: o,
70
69
  cancelButton: c,
71
70
  size: s
72
71
  }) => {
73
- const { tooltipNode: a, ...r } = n || {}, d = () => {
74
- const l = /* @__PURE__ */ t(D, { adjustWidthOn: s === "small" ? "parent" : "min-width", ...r });
75
- return a ? /* @__PURE__ */ t(Q, { content: a, placement: "top", width: 270, children: l }) : l;
72
+ const { tooltipNode: l, ...r } = o || {}, d = () => {
73
+ const a = /* @__PURE__ */ e(D, { adjustWidthOn: s === "small" ? "parent" : "min-width", ...r });
74
+ return l ? /* @__PURE__ */ e(Q, { content: l, placement: "top", width: 270, children: a }) : a;
76
75
  };
77
- return /* @__PURE__ */ u("div", { className: p("modal-footer", { "with-extra-node": e, [`size-${s}`]: s }), children: [
78
- e && e,
79
- /* @__PURE__ */ u("div", { className: p("buttons-block"), children: [
80
- c && /* @__PURE__ */ t("div", { className: p("button-container"), children: /* @__PURE__ */ t(
76
+ return /* @__PURE__ */ h("div", { className: f("modal-footer", { "with-extra-node": t, [`size-${s}`]: s }), children: [
77
+ t && t,
78
+ /* @__PURE__ */ h("div", { className: f("buttons-block"), children: [
79
+ c && /* @__PURE__ */ e("div", { className: f("button-container"), children: /* @__PURE__ */ e(
81
80
  D,
82
81
  {
83
82
  variant: "ghost",
84
83
  adjustWidthOn: s === "small" ? "parent" : "min-width",
85
- onClick: o,
84
+ onClick: i,
86
85
  ...c
87
86
  }
88
87
  ) }),
89
- n && /* @__PURE__ */ t("div", { className: p("button-container"), children: d() })
88
+ o && /* @__PURE__ */ e("div", { className: f("button-container"), children: d() })
90
89
  ] })
91
90
  ] });
92
- }, at = {
91
+ }, ae = {
93
92
  "modal-header": "_modal-header_w4aaf_1",
94
93
  "width-description": "_width-description_w4aaf_10",
95
94
  "modal-header-content": "_modal-header-content_w4aaf_14",
96
95
  "modal-title": "_modal-title_w4aaf_20",
97
96
  "close-modal-icon": "_close-modal-icon_w4aaf_29"
98
- }, f = x.bind(at), rt = ({ title: e, onClose: o, withDescription: n = !1 }) => /* @__PURE__ */ u("div", { className: f("modal-header", { "width-description": n }), children: [
99
- /* @__PURE__ */ t("div", { className: f("modal-header-content"), children: e && /* @__PURE__ */ t("div", { className: f("modal-title"), children: e }) }),
100
- /* @__PURE__ */ t(V, { className: f("close-modal-icon"), onClick: o, children: /* @__PURE__ */ t(Z, {}) })
101
- ] }), ct = "_modal_yxql5_1", dt = "_description_yxql5_43", mt = "_scrollable_yxql5_53", _t = {
102
- modal: ct,
103
- "overlay-default": "_overlay-default_yxql5_12",
104
- "overlay-light-cyan": "_overlay-light-cyan_yxql5_16",
105
- "scrolling-content": "_scrolling-content_yxql5_20",
106
- "modal-window": "_modal-window_yxql5_26",
107
- description: dt,
108
- scrollable: mt,
109
- "size-default": "_size-default_yxql5_57",
110
- "size-small": "_size-small_yxql5_69",
111
- "size-large": "_size-large_yxql5_81"
112
- }, g = x.bind(_t), ut = 0.9, ht = 32 + 24, wt = 32 + 8, pt = 36 + 16, ft = 32 * 2, Bt = ({
113
- title: e,
114
- children: o,
115
- footerNode: n,
97
+ }, g = b.bind(ae), le = ({ title: t, onClose: i, withDescription: o = !1 }) => /* @__PURE__ */ h("div", { className: g("modal-header", { "width-description": o }), children: [
98
+ /* @__PURE__ */ e("div", { className: g("modal-header-content"), children: t && /* @__PURE__ */ e("div", { className: g("modal-title"), children: t }) }),
99
+ /* @__PURE__ */ e(V, { className: g("close-modal-icon"), onClick: i, children: /* @__PURE__ */ e(Z, {}) })
100
+ ] }), re = "_modal_35896_1", ce = "_description_35896_43", de = {
101
+ modal: re,
102
+ "overlay-default": "_overlay-default_35896_12",
103
+ "overlay-light-cyan": "_overlay-light-cyan_35896_16",
104
+ "scrolling-content": "_scrolling-content_35896_20",
105
+ "modal-window": "_modal-window_35896_26",
106
+ description: ce,
107
+ "scrollable-wrapper": "_scrollable-wrapper_35896_54",
108
+ "scrollable-content": "_scrollable-content_35896_58",
109
+ "size-default": "_size-default_35896_62",
110
+ "size-small": "_size-small_35896_74",
111
+ "size-large": "_size-large_35896_86"
112
+ }, u = b.bind(de), me = 0.9, _e = 32 + 24, ue = 32 + 8, he = 36 + 16, pe = 32 * 2, Pe = ({
113
+ title: t,
114
+ children: i,
115
+ footerNode: o,
116
116
  okButton: c,
117
117
  cancelButton: s,
118
- className: a,
118
+ className: l,
119
119
  size: r = "default",
120
120
  onClose: d = () => {
121
121
  },
122
- overlay: l = "default",
123
- zIndex: E = 2,
124
- allowCloseOutside: v = !0,
125
- scrollable: H = !1,
126
- withoutFooter: O = !1,
127
- createFooter: M = null,
122
+ overlay: a = "default",
123
+ zIndex: H = 2,
124
+ allowCloseOutside: E = !0,
125
+ scrollable: C = !1,
126
+ withoutFooter: N = !1,
127
+ createFooter: O = null,
128
128
  description: m = null
129
129
  }) => {
130
- const [I, N] = y(!1), [L, R] = y(0), [k, $] = y(!1), _ = C(null), A = et(), T = A.height, q = T * ut, b = (T - L) / 2, W = () => {
131
- let i = q - ft;
132
- return O || (i = i - pt), m ? i = i - wt : i = i - ht, i;
133
- }, h = () => {
134
- N(!1);
135
- }, z = (i) => {
136
- const { keyCode: j } = i;
137
- j === J.ESCAPE_KEY_CODE && h();
138
- }, P = () => {
139
- var i;
140
- k || ((i = _.current) == null || i.focus(), $(!0));
130
+ const [I, M] = v(!1), [L, R] = v(0), [k, $] = v(!1), _ = z(null), x = te(), A = x.height, W = A * me, y = (A - L) / 2, P = () => {
131
+ let n = W - pe;
132
+ return N || (n = n - he), m ? n = n - ue : n = n - _e, n;
133
+ }, p = () => {
134
+ M(!1);
135
+ }, T = (n) => {
136
+ const { keyCode: F } = n;
137
+ F === J.ESCAPE_KEY_CODE && p();
138
+ }, B = () => {
139
+ var n;
140
+ k || ((n = _.current) == null || n.focus(), $(!0));
141
141
  };
142
142
  w(() => {
143
143
  if (_ && _.current) {
144
- const { clientHeight: i } = _.current;
145
- R(i);
144
+ const { clientHeight: n } = _.current;
145
+ R(n);
146
146
  }
147
- }, [o, A]), w(() => (N(!0), document.addEventListener("keydown", z, !1), () => document.removeEventListener("keydown", z, !1)), []);
148
- const B = G(
147
+ }, [i, x]), w(() => (M(!0), document.addEventListener("keydown", T, !1), () => document.removeEventListener("keydown", T, !1)), []);
148
+ const j = K(
149
149
  () => ({
150
- ignoreSelectors: [`[${X}]`]
150
+ ignoreSelectors: [`[${q}]`]
151
151
  }),
152
152
  []
153
153
  );
154
- return tt(_, v ? h : void 0, B), /* @__PURE__ */ t(U, { onExitComplete: d, children: I && /* @__PURE__ */ t("div", { className: g("modal", { [`overlay-${l}`]: l }), style: { zIndex: E }, children: /* @__PURE__ */ u(
155
- Y.div,
154
+ return ee(_, E ? p : void 0, j), /* @__PURE__ */ e(Y, { onExitComplete: d, children: I && /* @__PURE__ */ e("div", { className: u("modal", { [`overlay-${a}`]: a }), style: { zIndex: H }, children: /* @__PURE__ */ h(
155
+ X.div,
156
156
  {
157
- className: g("modal-window", { [`size-${r}`]: r }, a),
157
+ className: u("modal-window", { [`size-${r}`]: r }, l),
158
158
  ref: _,
159
159
  tabIndex: 0,
160
- initial: { opacity: 0, marginTop: -b },
161
- animate: { opacity: 1, marginTop: b },
162
- exit: { opacity: 0, marginTop: -b },
160
+ initial: { opacity: 0, marginTop: -y },
161
+ animate: { opacity: 1, marginTop: y },
162
+ exit: { opacity: 0, marginTop: -y },
163
163
  transition: { duration: 0.3 },
164
- onAnimationStart: P,
164
+ onAnimationStart: B,
165
165
  children: [
166
- /* @__PURE__ */ t(rt, { title: e, onClose: h, withDescription: !!m }),
167
- H ? /* @__PURE__ */ u(K, { autoHeight: !0, autoHeightMax: W(), hideTracksWhenNotNeeded: !0, children: [
168
- m && /* @__PURE__ */ t("span", { className: g("description", { scrollable: H }), children: m }),
169
- /* @__PURE__ */ t(S, { scrollable: !0, children: o })
170
- ] }) : /* @__PURE__ */ u(F, { children: [
171
- m && /* @__PURE__ */ t("span", { className: g("description"), children: m }),
172
- /* @__PURE__ */ t(S, { children: o })
166
+ /* @__PURE__ */ e(le, { title: t, onClose: p, withDescription: !!m }),
167
+ C ? /* @__PURE__ */ e("div", { className: u("scrollable-wrapper"), children: /* @__PURE__ */ e(
168
+ U,
169
+ {
170
+ autoHeight: !0,
171
+ autoHeightMax: P(),
172
+ hideTracksWhenNotNeeded: !0,
173
+ children: /* @__PURE__ */ h("div", { className: u("scrollable-content"), children: [
174
+ m && /* @__PURE__ */ e("span", { className: u("description"), children: m }),
175
+ /* @__PURE__ */ e(S, { children: i })
176
+ ] })
177
+ }
178
+ ) }) : /* @__PURE__ */ h(G, { children: [
179
+ m && /* @__PURE__ */ e("span", { className: u("description"), children: m }),
180
+ /* @__PURE__ */ e(S, { children: i })
173
181
  ] }),
174
- !O && (M ? M(h) : /* @__PURE__ */ t(
175
- lt,
182
+ !N && (O ? O(p) : /* @__PURE__ */ e(
183
+ se,
176
184
  {
177
185
  size: r,
178
- footerNode: n,
186
+ footerNode: o,
179
187
  okButton: c,
180
188
  cancelButton: s,
181
- closeHandler: h
189
+ closeHandler: p
182
190
  }
183
191
  ))
184
192
  ]
@@ -187,8 +195,8 @@ const et = () => {
187
195
  ) }) });
188
196
  };
189
197
  export {
190
- Bt as Modal,
198
+ Pe as Modal,
191
199
  S as ModalContent,
192
- lt as ModalFooter,
193
- rt as ModalHeader
200
+ se as ModalFooter,
201
+ le as ModalHeader
194
202
  };
@@ -1,7 +1,8 @@
1
1
  import * as e from "react";
2
- const l = (t) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.85355 12.8536C7.65829 13.0488 7.34171 13.0488 7.14645 12.8536L4.14645 9.85355C3.95118 9.65829 3.95118 9.34171 4.14645 9.14645C4.34171 8.95118 4.65829 8.95118 4.85355 9.14645L7 11.2929L7 3.5C7 3.22386 7.22386 3 7.5 3C7.77614 3 8 3.22386 8 3.5L8 11.2929L10.1464 9.14645C10.3417 8.95119 10.6583 8.95118 10.8536 9.14645C11.0488 9.34171 11.0488 9.65829 10.8536 9.85355L7.85355 12.8536Z", fill: "#A2AAB5" })), n = (t) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.14645 3.14645C7.34171 2.95118 7.65829 2.95118 7.85355 3.14645L10.8536 6.14645C11.0488 6.34171 11.0488 6.65829 10.8536 6.85355C10.6583 7.04882 10.3417 7.04882 10.1464 6.85355L8 4.70711V12.5C8 12.7761 7.77614 13 7.5 13C7.22386 13 7 12.7761 7 12.5L7 4.70711L4.85355 6.85355C4.65829 7.04882 4.34171 7.04882 4.14645 6.85355C3.95118 6.65829 3.95118 6.34171 4.14645 6.14645L7.14645 3.14645Z", fill: "#A2AAB5" })), o = (t) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { d: "M14.2174 5.82426C14.3736 5.66805 14.3736 5.41479 14.2174 5.25858L14.0759 5.11716C13.9197 4.96095 13.6665 4.96095 13.5103 5.11716L8.16726 10.4602L2.82426 5.11716C2.66805 4.96095 2.41479 4.96095 2.25858 5.11716L2.11716 5.25858C1.96095 5.41479 1.96095 5.66805 2.11716 5.82426L7.89176 11.5989C8.04797 11.7551 8.30124 11.7551 8.45745 11.5989L8.88171 11.1746L8.87436 11.1673L14.2174 5.82426Z", fill: "#A2AAB5" }));
2
+ const l = (t) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.85355 12.8536C7.65829 13.0488 7.34171 13.0488 7.14645 12.8536L4.14645 9.85355C3.95118 9.65829 3.95118 9.34171 4.14645 9.14645C4.34171 8.95118 4.65829 8.95118 4.85355 9.14645L7 11.2929L7 3.5C7 3.22386 7.22386 3 7.5 3C7.77614 3 8 3.22386 8 3.5L8 11.2929L10.1464 9.14645C10.3417 8.95119 10.6583 8.95118 10.8536 9.14645C11.0488 9.34171 11.0488 9.65829 10.8536 9.85355L7.85355 12.8536Z", fill: "#A2AAB5" })), n = (t) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.14645 3.14645C7.34171 2.95118 7.65829 2.95118 7.85355 3.14645L10.8536 6.14645C11.0488 6.34171 11.0488 6.65829 10.8536 6.85355C10.6583 7.04882 10.3417 7.04882 10.1464 6.85355L8 4.70711V12.5C8 12.7761 7.77614 13 7.5 13C7.22386 13 7 12.7761 7 12.5L7 4.70711L4.85355 6.85355C4.65829 7.04882 4.34171 7.04882 4.14645 6.85355C3.95118 6.65829 3.95118 6.34171 4.14645 6.14645L7.14645 3.14645Z", fill: "#A2AAB5" })), i = (t) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { d: "M14.2174 5.82426C14.3736 5.66805 14.3736 5.41479 14.2174 5.25858L14.0759 5.11716C13.9197 4.96095 13.6665 4.96095 13.5103 5.11716L8.16726 10.4602L2.82426 5.11716C2.66805 4.96095 2.41479 4.96095 2.25858 5.11716L2.11716 5.25858C1.96095 5.41479 1.96095 5.66805 2.11716 5.82426L7.89176 11.5989C8.04797 11.7551 8.30124 11.7551 8.45745 11.5989L8.88171 11.1746L8.87436 11.1673L14.2174 5.82426Z", fill: "#A2AAB5" })), w = (t) => /* @__PURE__ */ e.createElement("svg", { width: 11, height: 24, viewBox: "0 0 11 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("rect", { x: 5, width: 1, height: 24, fill: "#A2AAB5" }), /* @__PURE__ */ e.createElement("rect", { x: 1, y: 4, width: 2, height: 16, rx: 1, fill: "#A2AAB5" }), /* @__PURE__ */ e.createElement("rect", { x: 8, y: 4, width: 2, height: 16, rx: 1, fill: "#A2AAB5" }));
3
3
  export {
4
4
  l as S,
5
5
  n as a,
6
- o as b
6
+ i as b,
7
+ w as c
7
8
  };