@reportportal/ui-kit 0.0.1-alpha.7 → 0.0.1-alpha.8
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/LICENSE +201 -201
- package/README.md +197 -3
- package/dist/baseIconButton-7bc53dec.js +25 -0
- package/dist/baseIconButton.js +7 -0
- package/dist/bubblesLoader-a7e709d4.js +17 -0
- package/dist/bubblesLoader.js +1 -1
- package/dist/button-497b4d19.js +62 -0
- package/dist/button.js +1 -1
- package/dist/{checkbox-fdc44740.js → checkbox-1e21cf3e.js} +16 -16
- package/dist/checkbox.js +1 -1
- package/dist/components/button/button.d.ts +0 -1
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/dropdown/constants.d.ts +4 -0
- package/dist/components/dropdown/dropdown.d.ts +0 -1
- package/dist/components/fieldTextFlex/fieldTextFlex.d.ts +14 -0
- package/dist/components/fieldTextFlex/index.d.ts +3 -0
- package/dist/components/icons/baseIconButton/baseIconButton.d.ts +8 -0
- package/dist/components/icons/baseIconButton/index.d.ts +4 -0
- package/dist/components/icons/index.d.ts +7 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/components/modal/modal.d.ts +3 -1
- package/dist/components/radio/index.d.ts +4 -0
- package/dist/components/radio/radio.d.ts +16 -0
- package/dist/components/radio/radioGroup.d.ts +8 -0
- package/dist/components/themeProvider/themeProvider.d.ts +2 -1
- package/dist/dropdown-e07f2a71.js +212 -0
- package/dist/dropdown.js +3 -4
- package/dist/fieldNumber-46fe79b9.js +127 -0
- package/dist/fieldNumber.js +2 -3
- package/dist/fieldText-65a50d9d.js +101 -0
- package/dist/fieldText.js +2 -2
- package/dist/index-2bee4457.js +131 -0
- package/dist/index.js +31 -25
- package/dist/modal.js +14 -126
- package/dist/style.css +1 -1
- package/dist/systemMessage-1ced6079.js +30 -0
- package/dist/systemMessage.js +1 -1
- package/dist/themeProvider-46c2be7b.js +23 -0
- package/dist/themeProvider.js +4 -3
- package/dist/toggle-707ecb74.js +67 -0
- package/dist/toggle.js +1 -1
- package/package.json +28 -5
- package/dist/bubblesLoader-9bec3797.js +0 -17
- package/dist/button-d4944dbc.js +0 -64
- package/dist/clear-4963efcd.js +0 -5
- package/dist/components/icon/icon.d.ts +0 -11
- package/dist/components/icon/icons.d.ts +0 -21
- package/dist/components/icon/index.d.ts +0 -3
- package/dist/dropdown-45e7bc7d.js +0 -204
- package/dist/fieldNumber-27e69676.js +0 -132
- package/dist/fieldText-c7085849.js +0 -99
- package/dist/icon-71262f5c.js +0 -26
- package/dist/icon.js +0 -9
- package/dist/systemMessage-62c3133d.js +0 -30
- package/dist/themeProvider-5800417e.js +0 -19
- package/dist/toggle-5b3d8333.js +0 -67
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { jsxs as K, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { useRef as A, useMemo as B } from "react";
|
|
4
|
+
import { c as T } from "./bind-06a7ff84.js";
|
|
5
|
+
import { K as e } from "./keyCodes-f63c0e11.js";
|
|
6
|
+
import { B as f } from "./baseIconButton-7bc53dec.js";
|
|
7
|
+
const W = (t) => /* @__PURE__ */ d.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "#C1C7D0", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ d.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.00117 2.62046C7.63142 2.6189 7.33294 2.91738 7.3345 3.28712L7.35159 7.35159L3.28712 7.3345C2.91738 7.33295 2.6189 7.63142 2.62045 8.00117C2.62201 8.37091 2.92301 8.67191 3.29275 8.67346L7.35722 8.69056L7.37391 12.6599C7.37547 13.0296 7.67647 13.3306 8.04621 13.3322C8.41596 13.3337 8.71443 13.0352 8.71288 12.6655L8.69619 8.69619L12.6655 8.71288C13.0352 8.71444 13.3337 8.41596 13.3322 8.04621C13.3306 7.67647 13.0296 7.37547 12.6599 7.37392L8.69056 7.35722L8.67346 3.29275C8.67191 2.92301 8.37091 2.62201 8.00117 2.62046Z" })), v = (t) => /* @__PURE__ */ d.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "#C1C7D0", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ d.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.31082 7.31081C2.94108 7.30926 2.6426 7.60773 2.64415 7.97748C2.64571 8.34722 2.9467 8.64822 3.31645 8.64977L12.6892 8.68919C13.0589 8.69074 13.3574 8.39227 13.3559 8.02252C13.3543 7.65278 13.0533 7.35178 12.6836 7.35023L3.31082 7.31081Z" })), y = 5, h = 16, S = [
|
|
8
|
+
e.TAB_KEY_CODE,
|
|
9
|
+
e.BACKSPACE_KEY_CODE,
|
|
10
|
+
e.ARROW_LEFT_KEY_CODE,
|
|
11
|
+
e.ARROW_UP_KEY_CODE,
|
|
12
|
+
e.ARROW_RIGHT_KEY_CODE,
|
|
13
|
+
e.ARROW_DOWN_KEY_CODE,
|
|
14
|
+
e.DELETE_KEY_CODE,
|
|
15
|
+
e.NUM_LOCK_0_KEY_CODE,
|
|
16
|
+
e.NUM_LOCK_1_KEY_CODE,
|
|
17
|
+
e.NUM_LOCK_2_KEY_CODE,
|
|
18
|
+
e.NUM_LOCK_3_KEY_CODE,
|
|
19
|
+
e.NUM_LOCK_4_KEY_CODE,
|
|
20
|
+
e.NUM_LOCK_5_KEY_CODE,
|
|
21
|
+
e.NUM_LOCK_6_KEY_CODE,
|
|
22
|
+
e.NUM_LOCK_7_KEY_CODE,
|
|
23
|
+
e.NUM_LOCK_8_KEY_CODE,
|
|
24
|
+
e.NUM_LOCK_9_KEY_CODE
|
|
25
|
+
], I = "_disabled_3tc9r_6", b = "_label_3tc9r_10", k = "_sign_3tc9r_21", F = "_error_3tc9r_36", H = "_touched_3tc9r_36", V = "_filled_3tc9r_41", P = "_input_3tc9r_26", j = {
|
|
26
|
+
"field-number": "_field-number_3tc9r_1",
|
|
27
|
+
disabled: I,
|
|
28
|
+
label: b,
|
|
29
|
+
sign: k,
|
|
30
|
+
"input-container": "_input-container_3tc9r_26",
|
|
31
|
+
error: F,
|
|
32
|
+
touched: H,
|
|
33
|
+
filled: V,
|
|
34
|
+
"input-field": "_input-field_3tc9r_48",
|
|
35
|
+
input: P
|
|
36
|
+
}, r = T.bind(j), z = ({
|
|
37
|
+
value: t = "",
|
|
38
|
+
placeholder: D = "0",
|
|
39
|
+
disabled: c = !1,
|
|
40
|
+
onChange: i,
|
|
41
|
+
onFocus: a,
|
|
42
|
+
onBlur: G,
|
|
43
|
+
label: O,
|
|
44
|
+
postfix: s = "",
|
|
45
|
+
min: o = 0,
|
|
46
|
+
max: E = Number.MAX_SAFE_INTEGER,
|
|
47
|
+
title: p,
|
|
48
|
+
error: m,
|
|
49
|
+
touched: L = !1,
|
|
50
|
+
...N
|
|
51
|
+
}) => {
|
|
52
|
+
const C = A(null), R = (_) => {
|
|
53
|
+
let n = _.target.value.replace(/^0(?=\d+|^\d)/g, "");
|
|
54
|
+
if (n === "") {
|
|
55
|
+
i("");
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
n = +n, n >= o && n <= E && i(n);
|
|
59
|
+
}, Y = (_) => {
|
|
60
|
+
const { keyCode: n } = _;
|
|
61
|
+
S.includes(n) || (n < e.NUMBER_START_KEY_CODE || n > e.NUMBER_END_KEY_CODE || _.shiftKey) && _.preventDefault();
|
|
62
|
+
}, w = () => {
|
|
63
|
+
const _ = +t - 1;
|
|
64
|
+
_ >= o && _ <= E && i(_);
|
|
65
|
+
}, g = () => {
|
|
66
|
+
const _ = +t + 1;
|
|
67
|
+
_ >= o && _ <= E && i(_);
|
|
68
|
+
}, u = D + s, M = B(() => {
|
|
69
|
+
let _ = (String(t) || u).length;
|
|
70
|
+
return s && !t && (_ += 1), _ > h ? `${h}ch` : `${_ || y}ch`;
|
|
71
|
+
}, [u, s, t]), U = () => {
|
|
72
|
+
C && C.current && C.current.focus(), a && a();
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ K("div", { className: r("field-number", { disabled: c }), children: [
|
|
75
|
+
O && /* @__PURE__ */ l("span", { className: r("label"), children: O }),
|
|
76
|
+
/* @__PURE__ */ K(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: r("input-container", {
|
|
80
|
+
filled: !!t || t === 0,
|
|
81
|
+
error: m,
|
|
82
|
+
disabled: c,
|
|
83
|
+
touched: L
|
|
84
|
+
}),
|
|
85
|
+
title: p,
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ l(
|
|
88
|
+
f,
|
|
89
|
+
{
|
|
90
|
+
className: r("sign", "minus"),
|
|
91
|
+
disabled: c,
|
|
92
|
+
onClick: w,
|
|
93
|
+
children: /* @__PURE__ */ l(v, {})
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ K("span", { className: r("input-field", { disabled: c }), onClick: U, children: [
|
|
97
|
+
/* @__PURE__ */ l(
|
|
98
|
+
"input",
|
|
99
|
+
{
|
|
100
|
+
ref: C,
|
|
101
|
+
className: r("input"),
|
|
102
|
+
type: "number",
|
|
103
|
+
value: t,
|
|
104
|
+
placeholder: u,
|
|
105
|
+
disabled: c,
|
|
106
|
+
min: o,
|
|
107
|
+
max: E,
|
|
108
|
+
onKeyDown: c ? void 0 : Y,
|
|
109
|
+
onChange: c ? void 0 : R,
|
|
110
|
+
onFocus: c ? void 0 : a,
|
|
111
|
+
style: { width: M },
|
|
112
|
+
...N
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
!!s && (t === 0 || !!t) && /* @__PURE__ */ l("span", { children: s.slice(0, 1) })
|
|
116
|
+
] }),
|
|
117
|
+
/* @__PURE__ */ l(f, { className: r("sign", "plus"), disabled: c, onClick: g, children: /* @__PURE__ */ l(W, {}) })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
] });
|
|
122
|
+
};
|
|
123
|
+
export {
|
|
124
|
+
z as F,
|
|
125
|
+
W as S,
|
|
126
|
+
v as a
|
|
127
|
+
};
|
package/dist/fieldNumber.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { F as m } from "./fieldNumber-
|
|
1
|
+
import { F as m } from "./fieldNumber-46fe79b9.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./bind-06a7ff84.js";
|
|
5
5
|
import "./keyCodes-f63c0e11.js";
|
|
6
|
-
import "./
|
|
7
|
-
import "./clear-4963efcd.js";
|
|
6
|
+
import "./baseIconButton-7bc53dec.js";
|
|
8
7
|
export {
|
|
9
8
|
m as FieldNumber,
|
|
10
9
|
m as default
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsx as n, jsxs as t, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import { forwardRef as E } from "react";
|
|
4
|
+
import { c as A } from "./bind-06a7ff84.js";
|
|
5
|
+
import "./baseIconButton-7bc53dec.js";
|
|
6
|
+
const F = (a) => /* @__PURE__ */ o.createElement("svg", { width: 17, height: 17, viewBox: "0 0 17 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...a }, /* @__PURE__ */ o.createElement("rect", { width: 16.2089, height: 16.1568, rx: 8.07842, fill: "#A2AAB5" }), /* @__PURE__ */ o.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.14768 5.14645C4.95077 5.34171 4.95077 5.65829 5.14768 5.85355L7.49578 8.18198L5.35655 10.3033C5.15963 10.4986 5.15963 10.8151 5.35655 11.0104C5.55346 11.2057 5.87271 11.2057 6.06962 11.0104L8.20886 8.88909L10.1392 10.8033C10.3361 10.9986 10.6554 10.9986 10.8523 10.8033C11.0492 10.608 11.0492 10.2915 10.8523 10.0962L8.92193 8.18198L11.0612 6.06065C11.2581 5.86539 11.2581 5.54881 11.0612 5.35355C10.8643 5.15828 10.545 5.15828 10.3481 5.35355L8.20886 7.47487L5.86076 5.14645C5.66385 4.95118 5.34459 4.95118 5.14768 5.14645Z", fill: "white" })), R = "_label_18rqf_18", j = "_asterisk_18rqf_27", y = "_disabled_18rqf_33", B = "_field_18rqf_38", S = "_error_18rqf_52", M = "_touched_18rqf_52", Z = "_placeholder_18rqf_63", z = "_input_18rqf_70", D = "_icon_18rqf_1", G = "_text_18rqf_159", H = {
|
|
7
|
+
"icon-container": "_icon-container_18rqf_1",
|
|
8
|
+
"icon-container-end": "_icon-container-end_18rqf_1",
|
|
9
|
+
"icon-container-start": "_icon-container-start_18rqf_1",
|
|
10
|
+
label: R,
|
|
11
|
+
asterisk: j,
|
|
12
|
+
disabled: y,
|
|
13
|
+
field: B,
|
|
14
|
+
error: S,
|
|
15
|
+
touched: M,
|
|
16
|
+
placeholder: Z,
|
|
17
|
+
"default-width": "_default-width_18rqf_66",
|
|
18
|
+
"input-container": "_input-container_18rqf_70",
|
|
19
|
+
input: z,
|
|
20
|
+
icon: D,
|
|
21
|
+
"clear-icon": "_clear-icon_18rqf_116",
|
|
22
|
+
"additional-content": "_additional-content_18rqf_152",
|
|
23
|
+
text: G,
|
|
24
|
+
"error-text": "_error-text_18rqf_167",
|
|
25
|
+
"help-text": "_help-text_18rqf_171"
|
|
26
|
+
}, e = A.bind(H), Q = E(
|
|
27
|
+
({
|
|
28
|
+
value: a,
|
|
29
|
+
className: q,
|
|
30
|
+
error: r,
|
|
31
|
+
placeholder: _,
|
|
32
|
+
disabled: c = !1,
|
|
33
|
+
onChange: N,
|
|
34
|
+
touched: i = !1,
|
|
35
|
+
title: u,
|
|
36
|
+
label: s,
|
|
37
|
+
helpText: l,
|
|
38
|
+
defaultWidth: w = !0,
|
|
39
|
+
startIcon: d,
|
|
40
|
+
endIcon: f,
|
|
41
|
+
clearable: C = !1,
|
|
42
|
+
onClear: p,
|
|
43
|
+
isRequired: h = !1,
|
|
44
|
+
hasDoubleMessage: L = !1,
|
|
45
|
+
type: g = "text",
|
|
46
|
+
...k
|
|
47
|
+
}, v) => {
|
|
48
|
+
const b = () => {
|
|
49
|
+
p && p(a);
|
|
50
|
+
}, m = /* @__PURE__ */ n("span", { className: e("text", "help-text"), children: l });
|
|
51
|
+
return /* @__PURE__ */ t(x, { children: [
|
|
52
|
+
s && /* @__PURE__ */ t("span", { className: e("label", { disabled: c }), children: [
|
|
53
|
+
s,
|
|
54
|
+
h && /* @__PURE__ */ n("span", { className: e("asterisk"), children: "*" })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ t(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: e("field", q, {
|
|
60
|
+
error: r,
|
|
61
|
+
touched: i,
|
|
62
|
+
disabled: c,
|
|
63
|
+
"default-width": w
|
|
64
|
+
}),
|
|
65
|
+
title: u,
|
|
66
|
+
children: [
|
|
67
|
+
d && /* @__PURE__ */ n("span", { className: e("icon-container-start"), children: /* @__PURE__ */ n("span", { className: e("icon"), children: d }) }),
|
|
68
|
+
/* @__PURE__ */ t("span", { className: e("input-container"), children: [
|
|
69
|
+
/* @__PURE__ */ n(
|
|
70
|
+
"input",
|
|
71
|
+
{
|
|
72
|
+
ref: v,
|
|
73
|
+
type: g,
|
|
74
|
+
className: e("input"),
|
|
75
|
+
value: a,
|
|
76
|
+
disabled: c,
|
|
77
|
+
onChange: N,
|
|
78
|
+
...k
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
_ && !a && /* @__PURE__ */ t("span", { className: e("placeholder"), children: [
|
|
82
|
+
_,
|
|
83
|
+
h && !s && /* @__PURE__ */ n("span", { className: e("asterisk") })
|
|
84
|
+
] })
|
|
85
|
+
] }),
|
|
86
|
+
f && /* @__PURE__ */ n("span", { className: e("icon-container-end"), children: /* @__PURE__ */ n("span", { className: e("icon"), children: f }) }),
|
|
87
|
+
C && /* @__PURE__ */ n("span", { className: e("icon-container-end"), children: /* @__PURE__ */ n("button", { type: "button", className: e("clear-icon", { disabled: c }), onClick: b, children: /* @__PURE__ */ n(F, {}) }) })
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
(r && i || l) && /* @__PURE__ */ n("div", { className: e("additional-content", { disabled: c }), children: r && i ? /* @__PURE__ */ t(x, { children: [
|
|
92
|
+
/* @__PURE__ */ n("span", { className: e("text", "error-text"), children: r }),
|
|
93
|
+
L && m
|
|
94
|
+
] }) : l && m })
|
|
95
|
+
] });
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
export {
|
|
99
|
+
Q as F,
|
|
100
|
+
F as S
|
|
101
|
+
};
|
package/dist/fieldText.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { F as o } from "./fieldText-
|
|
1
|
+
import { F as o } from "./fieldText-65a50d9d.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./bind-06a7ff84.js";
|
|
5
|
-
import "./
|
|
5
|
+
import "./baseIconButton-7bc53dec.js";
|
|
6
6
|
export {
|
|
7
7
|
o as FieldText,
|
|
8
8
|
o as default
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import * as y from "react";
|
|
3
|
+
import { useState as w, useEffect as g, useRef as j } from "react";
|
|
4
|
+
import { Scrollbars as B } from "rc-scrollbars";
|
|
5
|
+
import { AnimatePresence as D, motion as I } from "framer-motion";
|
|
6
|
+
import { c as m } from "./bind-06a7ff84.js";
|
|
7
|
+
import { u as K } from "./useOnClickOutside-c332f7d3.js";
|
|
8
|
+
import { K as F } from "./keyCodes-f63c0e11.js";
|
|
9
|
+
import { B as C } from "./button-497b4d19.js";
|
|
10
|
+
import { B as P } from "./baseIconButton-7bc53dec.js";
|
|
11
|
+
const G = (t) => /* @__PURE__ */ y.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ y.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.732179 15.2698C0.330639 14.8683 0.33064 14.2172 0.73218 13.8157L6.54858 7.99928L0.73218 2.18288C0.33064 1.78134 0.330639 1.13031 0.732179 0.728774C1.13372 0.327235 1.78474 0.327235 2.18628 0.728774L8.00269 6.54518L13.8191 0.728767C14.2206 0.327229 14.8717 0.327228 15.2732 0.728767C15.6747 1.13031 15.6747 1.78133 15.2732 2.18287L9.45679 7.99928L15.2732 13.8157C15.6747 14.2172 15.6747 14.8683 15.2732 15.2698C14.8717 15.6713 14.2206 15.6713 13.8191 15.2698L8.00269 9.45338L2.18628 15.2698C1.78474 15.6713 1.13372 15.6713 0.732179 15.2698Z", fill: "#A2AAB5" })), X = () => {
|
|
12
|
+
const [t, a] = w({ width: 0, height: 0 });
|
|
13
|
+
return g(() => {
|
|
14
|
+
const o = () => {
|
|
15
|
+
a({
|
|
16
|
+
width: window.innerWidth,
|
|
17
|
+
height: window.innerHeight
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
return window.addEventListener("resize", o), o(), () => window.removeEventListener("resize", o);
|
|
21
|
+
}, []), t;
|
|
22
|
+
}, Y = {
|
|
23
|
+
"modal-content": "_modal-content_ojybs_1"
|
|
24
|
+
}, Z = m.bind(Y), b = ({ children: t }) => /* @__PURE__ */ e("div", { className: Z("modal-content"), children: t }), q = {
|
|
25
|
+
"buttons-block": "_buttons-block_1dgm4_1",
|
|
26
|
+
"button-container": "_button-container_1dgm4_5",
|
|
27
|
+
"modal-footer": "_modal-footer_1dgm4_14",
|
|
28
|
+
"with-extra-node": "_with-extra-node_1dgm4_21",
|
|
29
|
+
"size-small": "_size-small_1dgm4_25"
|
|
30
|
+
}, c = m.bind(q), J = ({
|
|
31
|
+
footerNode: t,
|
|
32
|
+
closeHandler: a,
|
|
33
|
+
okButton: o,
|
|
34
|
+
cancelButton: l,
|
|
35
|
+
size: s
|
|
36
|
+
}) => /* @__PURE__ */ i("div", { className: c("modal-footer", { "with-extra-node": t, [`size-${s}`]: s }), children: [
|
|
37
|
+
t && t,
|
|
38
|
+
/* @__PURE__ */ i("div", { className: c("buttons-block"), children: [
|
|
39
|
+
l && /* @__PURE__ */ e("div", { className: c("button-container"), children: /* @__PURE__ */ e(
|
|
40
|
+
C,
|
|
41
|
+
{
|
|
42
|
+
variant: "ghost",
|
|
43
|
+
adjustWidthOn: s === "small" ? "parent" : "content",
|
|
44
|
+
onClick: a,
|
|
45
|
+
...l
|
|
46
|
+
}
|
|
47
|
+
) }),
|
|
48
|
+
o && /* @__PURE__ */ e("div", { className: c("button-container"), children: /* @__PURE__ */ e(C, { adjustWidthOn: s === "small" ? "parent" : "content", ...o }) })
|
|
49
|
+
] })
|
|
50
|
+
] }), Q = {
|
|
51
|
+
"modal-header": "_modal-header_11gdx_1",
|
|
52
|
+
"modal-header-content": "_modal-header-content_11gdx_11",
|
|
53
|
+
"modal-title": "_modal-title_11gdx_20",
|
|
54
|
+
"close-modal-icon": "_close-modal-icon_11gdx_28"
|
|
55
|
+
}, r = m.bind(Q), U = ({ title: t, onClose: a, headerNode: o }) => /* @__PURE__ */ i("div", { className: r("modal-header"), children: [
|
|
56
|
+
/* @__PURE__ */ i("div", { className: r("modal-header-content"), children: [
|
|
57
|
+
t && /* @__PURE__ */ e("span", { className: r("modal-title"), children: t }),
|
|
58
|
+
o && o
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ e(P, { className: r("close-modal-icon"), onClick: a, children: /* @__PURE__ */ e(G, {}) })
|
|
61
|
+
] }), V = "_modal_1kzzv_1", ee = {
|
|
62
|
+
modal: V,
|
|
63
|
+
"overlay-default": "_overlay-default_1kzzv_11",
|
|
64
|
+
"overlay-light-cyan": "_overlay-light-cyan_1kzzv_15",
|
|
65
|
+
"scrolling-content": "_scrolling-content_1kzzv_19",
|
|
66
|
+
"modal-window": "_modal-window_1kzzv_25",
|
|
67
|
+
"size-default": "_size-default_1kzzv_42",
|
|
68
|
+
"size-small": "_size-small_1kzzv_54",
|
|
69
|
+
"size-large": "_size-large_1kzzv_66"
|
|
70
|
+
}, k = m.bind(ee), te = 0.9, oe = 176, _e = ({
|
|
71
|
+
title: t,
|
|
72
|
+
headerNode: a,
|
|
73
|
+
children: o,
|
|
74
|
+
footerNode: l,
|
|
75
|
+
okButton: s,
|
|
76
|
+
cancelButton: E,
|
|
77
|
+
className: M,
|
|
78
|
+
size: _ = "default",
|
|
79
|
+
onClose: H = () => {
|
|
80
|
+
},
|
|
81
|
+
overlay: v = "default",
|
|
82
|
+
zIndex: L = 2,
|
|
83
|
+
allowCloseOutside: N = !0,
|
|
84
|
+
scrollable: A = !1
|
|
85
|
+
}) => {
|
|
86
|
+
const [O, f] = w(!1), [R, S] = w(0), n = j(null), z = X(), p = z.height, $ = p * te, h = (p - R) / 2, T = $ - oe, d = () => {
|
|
87
|
+
f(!1);
|
|
88
|
+
}, x = (u) => {
|
|
89
|
+
const { keyCode: W } = u;
|
|
90
|
+
W === F.ESCAPE_KEY_CODE && d();
|
|
91
|
+
};
|
|
92
|
+
return g(() => {
|
|
93
|
+
if (n && n.current) {
|
|
94
|
+
const { clientHeight: u } = n.current;
|
|
95
|
+
S(u);
|
|
96
|
+
}
|
|
97
|
+
}, [o, z]), g(() => (f(!0), n && n.current && n.current.focus(), document.addEventListener("keydown", x, !1), () => document.removeEventListener("keydown", x, !1)), []), K(n, N ? d : void 0), /* @__PURE__ */ e(D, { onExitComplete: H, children: O && /* @__PURE__ */ e("div", { className: k("modal", { [`overlay-${v}`]: v }), style: { zIndex: L }, children: /* @__PURE__ */ i(
|
|
98
|
+
I.div,
|
|
99
|
+
{
|
|
100
|
+
className: k("modal-window", { [`size-${_}`]: _ }, M),
|
|
101
|
+
ref: n,
|
|
102
|
+
tabIndex: 0,
|
|
103
|
+
initial: { opacity: 0, marginTop: -h },
|
|
104
|
+
animate: { opacity: 1, marginTop: h },
|
|
105
|
+
exit: { opacity: 0, marginTop: -h },
|
|
106
|
+
transition: { duration: 0.3 },
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ e(U, { title: t, headerNode: a, onClose: d }),
|
|
109
|
+
A ? /* @__PURE__ */ e(B, { autoHeight: !0, autoHeightMax: T, hideTracksWhenNotNeeded: !0, children: /* @__PURE__ */ e(b, { children: o }) }) : /* @__PURE__ */ e(b, { children: o }),
|
|
110
|
+
/* @__PURE__ */ e(
|
|
111
|
+
J,
|
|
112
|
+
{
|
|
113
|
+
size: _,
|
|
114
|
+
footerNode: l,
|
|
115
|
+
okButton: s,
|
|
116
|
+
cancelButton: E,
|
|
117
|
+
closeHandler: d
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"modal-window"
|
|
123
|
+
) }) });
|
|
124
|
+
};
|
|
125
|
+
export {
|
|
126
|
+
_e as M,
|
|
127
|
+
G as S,
|
|
128
|
+
b as a,
|
|
129
|
+
U as b,
|
|
130
|
+
J as c
|
|
131
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,34 +1,40 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import { C as
|
|
3
|
-
import { S as
|
|
4
|
-
import { F as
|
|
5
|
-
import { T as
|
|
6
|
-
import {
|
|
7
|
-
import { D as
|
|
8
|
-
import { T as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { B as
|
|
1
|
+
import { B as f } from "./button-497b4d19.js";
|
|
2
|
+
import { C as c } from "./checkbox-1e21cf3e.js";
|
|
3
|
+
import { S as B } from "./systemMessage-1ced6079.js";
|
|
4
|
+
import { S as g, F as h } from "./fieldText-65a50d9d.js";
|
|
5
|
+
import { T as w } from "./themeProvider-46c2be7b.js";
|
|
6
|
+
import { S as v, M as I } from "./index-2bee4457.js";
|
|
7
|
+
import { D as A, S as D } from "./dropdown-e07f2a71.js";
|
|
8
|
+
import { T as b } from "./toggle-707ecb74.js";
|
|
9
|
+
import { F as V, a as Z, S as E } from "./fieldNumber-46fe79b9.js";
|
|
10
|
+
import { B as P } from "./bubblesLoader-a7e709d4.js";
|
|
11
|
+
import { B as y } from "./baseIconButton-7bc53dec.js";
|
|
12
|
+
import * as o from "react";
|
|
12
13
|
import "react/jsx-runtime";
|
|
13
|
-
import "react";
|
|
14
14
|
import "./bind-06a7ff84.js";
|
|
15
15
|
import "./keyCodes-f63c0e11.js";
|
|
16
|
-
import "./clear-4963efcd.js";
|
|
17
16
|
import "rc-scrollbars";
|
|
18
17
|
import "framer-motion";
|
|
19
18
|
import "./useOnClickOutside-c332f7d3.js";
|
|
20
|
-
import "react-
|
|
19
|
+
import "@floating-ui/react-dom";
|
|
21
20
|
import "downshift";
|
|
21
|
+
const i = (e) => /* @__PURE__ */ o.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ o.createElement("path", { d: "M9.80051 6.3661C9.95672 6.20989 10.21 6.20989 10.3662 6.3661L10.6338 6.63375C10.7901 6.78996 10.7901 7.04323 10.6338 7.19944L8.83331 8.99996L10.6338 10.8005C10.79 10.9567 10.79 11.2099 10.6338 11.3662L10.3662 11.6338C10.21 11.79 9.95669 11.79 9.80048 11.6338L7.99998 9.8333L6.19953 11.6338C6.04332 11.79 5.79005 11.79 5.63384 11.6338L5.36619 11.3661C5.20998 11.2099 5.20998 10.9566 5.36619 10.8004L7.16665 8.99996L5.36617 7.19949C5.20996 7.04328 5.20996 6.79001 5.36617 6.6338L5.63382 6.36615C5.79003 6.20994 6.04329 6.20994 6.1995 6.36615L7.99998 8.16663L9.80051 6.3661Z", fill: "#A2AAB5" }), /* @__PURE__ */ o.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.99878 3V2C4.99878 1.44772 5.44649 1 5.99878 1H9.99878C10.5511 1 10.9988 1.44772 10.9988 2V3H14.5C14.7761 3 15 3.22386 15 3.5C15 3.77614 14.7761 4 14.5 4H13.4167L12.6146 13.6246C12.5498 14.402 11.8999 15 11.1198 15H4.8802C4.10007 15 3.45017 14.402 3.38538 13.6246L2.58333 4H1.5C1.22386 4 1 3.77614 1 3.5C1 3.22386 1.22386 3 1.5 3H4.99878ZM5.99878 2H9.99878V3H5.99878V2ZM3.5868 4L4.38193 13.5415C4.40352 13.8007 4.62016 14 4.8802 14H11.1198C11.3798 14 11.5965 13.8007 11.6181 13.5415L12.4132 4H3.5868Z", fill: "#A2AAB5" }));
|
|
22
22
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
y as BaseIconButton,
|
|
24
|
+
P as BubblesLoader,
|
|
25
|
+
f as Button,
|
|
26
|
+
c as Checkbox,
|
|
27
|
+
g as ClearIcon,
|
|
28
|
+
v as CloseIcon,
|
|
29
|
+
i as DeleteIcon,
|
|
30
|
+
A as Dropdown,
|
|
31
|
+
D as DropdownIcon,
|
|
32
|
+
V as FieldNumber,
|
|
33
|
+
h as FieldText,
|
|
34
|
+
Z as MinusIcon,
|
|
35
|
+
I as Modal,
|
|
36
|
+
E as PlusIcon,
|
|
37
|
+
B as SystemMessage,
|
|
38
|
+
w as ThemeProvider,
|
|
39
|
+
b as Toggle
|
|
34
40
|
};
|
package/dist/modal.js
CHANGED
|
@@ -1,128 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import "./
|
|
11
|
-
const K = () => {
|
|
12
|
-
const [t, a] = w({ width: 0, height: 0 });
|
|
13
|
-
return f(() => {
|
|
14
|
-
const o = () => {
|
|
15
|
-
a({
|
|
16
|
-
width: window.innerWidth,
|
|
17
|
-
height: window.innerHeight
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
return window.addEventListener("resize", o), o(), () => window.removeEventListener("resize", o);
|
|
21
|
-
}, []), t;
|
|
22
|
-
}, F = {
|
|
23
|
-
"modal-content": "_modal-content_xak18_1"
|
|
24
|
-
}, P = m.bind(F), G = ({ children: t }) => /* @__PURE__ */ e("div", { className: P("modal-content"), children: t }), X = {
|
|
25
|
-
"buttons-block": "_buttons-block_1dgm4_1",
|
|
26
|
-
"button-container": "_button-container_1dgm4_5",
|
|
27
|
-
"modal-footer": "_modal-footer_1dgm4_14",
|
|
28
|
-
"with-extra-node": "_with-extra-node_1dgm4_21",
|
|
29
|
-
"size-small": "_size-small_1dgm4_25"
|
|
30
|
-
}, c = m.bind(X), Y = ({
|
|
31
|
-
footerNode: t,
|
|
32
|
-
closeHandler: a,
|
|
33
|
-
okButton: o,
|
|
34
|
-
cancelButton: s,
|
|
35
|
-
size: i
|
|
36
|
-
}) => /* @__PURE__ */ l("div", { className: c("modal-footer", { "with-extra-node": t, [`size-${i}`]: i }), children: [
|
|
37
|
-
t && t,
|
|
38
|
-
/* @__PURE__ */ l("div", { className: c("buttons-block"), children: [
|
|
39
|
-
s && /* @__PURE__ */ e("div", { className: c("button-container"), children: /* @__PURE__ */ e(
|
|
40
|
-
b,
|
|
41
|
-
{
|
|
42
|
-
variant: "ghost",
|
|
43
|
-
adjustWidthOn: i === "small" ? "parent" : "content",
|
|
44
|
-
onClick: a,
|
|
45
|
-
...s
|
|
46
|
-
}
|
|
47
|
-
) }),
|
|
48
|
-
o && /* @__PURE__ */ e("div", { className: c("button-container"), children: /* @__PURE__ */ e(b, { adjustWidthOn: i === "small" ? "parent" : "content", ...o }) })
|
|
49
|
-
] })
|
|
50
|
-
] }), q = {
|
|
51
|
-
"modal-header": "_modal-header_1d7tr_1",
|
|
52
|
-
"modal-header-content": "_modal-header-content_1d7tr_11",
|
|
53
|
-
"modal-title": "_modal-title_1d7tr_20",
|
|
54
|
-
"close-modal-icon": "_close-modal-icon_1d7tr_28"
|
|
55
|
-
}, r = m.bind(q), B = ({ title: t, onClose: a, headerNode: o }) => /* @__PURE__ */ l("div", { className: r("modal-header"), children: [
|
|
56
|
-
/* @__PURE__ */ l("div", { className: r("modal-header-content"), children: [
|
|
57
|
-
t && /* @__PURE__ */ e("span", { className: r("modal-title"), children: t }),
|
|
58
|
-
o && o
|
|
59
|
-
] }),
|
|
60
|
-
/* @__PURE__ */ e(j, { icon: "close", className: r("close-modal-icon"), onClick: a })
|
|
61
|
-
] }), J = "_modal_8a5l_1", Q = {
|
|
62
|
-
modal: J,
|
|
63
|
-
"overlay-default": "_overlay-default_8a5l_11",
|
|
64
|
-
"overlay-light-cyan": "_overlay-light-cyan_8a5l_16",
|
|
65
|
-
"scrolling-content": "_scrolling-content_8a5l_21",
|
|
66
|
-
"modal-window": "_modal-window_8a5l_28",
|
|
67
|
-
"size-default": "_size-default_8a5l_45",
|
|
68
|
-
"size-small": "_size-small_8a5l_57",
|
|
69
|
-
"size-large": "_size-large_8a5l_69"
|
|
70
|
-
}, E = m.bind(Q), U = 0.9, V = 176, ce = ({
|
|
71
|
-
title: t,
|
|
72
|
-
headerNode: a,
|
|
73
|
-
children: o,
|
|
74
|
-
footerNode: s,
|
|
75
|
-
okButton: i,
|
|
76
|
-
cancelButton: H,
|
|
77
|
-
className: M,
|
|
78
|
-
size: _ = "default",
|
|
79
|
-
onClose: z = () => {
|
|
80
|
-
},
|
|
81
|
-
overlay: g = "default",
|
|
82
|
-
allowCloseOutside: N = !0
|
|
83
|
-
}) => {
|
|
84
|
-
const [k, p] = w(!1), [C, O] = w(0), n = R(null), v = K(), y = v.height, $ = y * U, h = (y - C) / 2, A = $ - V, d = () => {
|
|
85
|
-
p(!1);
|
|
86
|
-
}, x = (u) => {
|
|
87
|
-
const { keyCode: S } = u;
|
|
88
|
-
S === I.ESCAPE_KEY_CODE && d();
|
|
89
|
-
};
|
|
90
|
-
return f(() => {
|
|
91
|
-
if (n && n.current) {
|
|
92
|
-
const { clientHeight: u } = n.current;
|
|
93
|
-
O(u);
|
|
94
|
-
}
|
|
95
|
-
}, [o, v]), f(() => (p(!0), n && n.current && n.current.focus(), document.addEventListener("keydown", x, !1), () => document.removeEventListener("keydown", x, !1)), []), D(n, N ? d : void 0), /* @__PURE__ */ e(L, { onExitComplete: z, children: k && /* @__PURE__ */ e("div", { className: E("modal", { [`overlay-${g}`]: g }), children: /* @__PURE__ */ l(
|
|
96
|
-
W.div,
|
|
97
|
-
{
|
|
98
|
-
className: E("modal-window", { [`size-${_}`]: _ }, M),
|
|
99
|
-
ref: n,
|
|
100
|
-
tabIndex: 0,
|
|
101
|
-
initial: { opacity: 0, marginTop: -h },
|
|
102
|
-
animate: { opacity: 1, marginTop: h },
|
|
103
|
-
exit: { opacity: 0, marginTop: -h },
|
|
104
|
-
transition: { duration: 0.3 },
|
|
105
|
-
children: [
|
|
106
|
-
/* @__PURE__ */ e(B, { title: t, headerNode: a, onClose: d }),
|
|
107
|
-
/* @__PURE__ */ e(T, { autoHeight: !0, autoHeightMax: A, hideTracksWhenNotNeeded: !0, children: /* @__PURE__ */ e(G, { children: o }) }),
|
|
108
|
-
/* @__PURE__ */ e(
|
|
109
|
-
Y,
|
|
110
|
-
{
|
|
111
|
-
size: _,
|
|
112
|
-
footerNode: s,
|
|
113
|
-
okButton: i,
|
|
114
|
-
cancelButton: H,
|
|
115
|
-
closeHandler: d
|
|
116
|
-
}
|
|
117
|
-
)
|
|
118
|
-
]
|
|
119
|
-
},
|
|
120
|
-
"modal-window"
|
|
121
|
-
) }) });
|
|
122
|
-
};
|
|
1
|
+
import { M as s, a as n, c as b, b as c } from "./index-2bee4457.js";
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
4
|
+
import "rc-scrollbars";
|
|
5
|
+
import "framer-motion";
|
|
6
|
+
import "./bind-06a7ff84.js";
|
|
7
|
+
import "./useOnClickOutside-c332f7d3.js";
|
|
8
|
+
import "./keyCodes-f63c0e11.js";
|
|
9
|
+
import "./button-497b4d19.js";
|
|
10
|
+
import "./baseIconButton-7bc53dec.js";
|
|
123
11
|
export {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
12
|
+
s as Modal,
|
|
13
|
+
n as ModalContent,
|
|
14
|
+
b as ModalFooter,
|
|
15
|
+
c as ModalHeader
|
|
128
16
|
};
|