@matbea-ui/matbea-ui 0.1.0 → 0.1.2
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/matbea-ui.cjs.js +1 -933
- package/dist/matbea-ui.cjs10.js +1 -0
- package/dist/matbea-ui.cjs11.js +1 -0
- package/dist/matbea-ui.cjs12.js +1 -0
- package/dist/matbea-ui.cjs13.js +1 -0
- package/dist/matbea-ui.cjs14.js +1 -0
- package/dist/matbea-ui.cjs15.js +1 -0
- package/dist/matbea-ui.cjs16.js +1 -0
- package/dist/matbea-ui.cjs17.js +1 -0
- package/dist/matbea-ui.cjs18.js +1 -0
- package/dist/matbea-ui.cjs19.js +1 -0
- package/dist/matbea-ui.cjs2.js +1 -0
- package/dist/matbea-ui.cjs20.js +1 -0
- package/dist/matbea-ui.cjs21.js +1 -0
- package/dist/matbea-ui.cjs22.js +1 -0
- package/dist/matbea-ui.cjs23.js +1 -0
- package/dist/matbea-ui.cjs24.js +1 -0
- package/dist/matbea-ui.cjs25.js +1 -0
- package/dist/matbea-ui.cjs26.js +1 -0
- package/dist/matbea-ui.cjs27.js +1 -0
- package/dist/matbea-ui.cjs28.js +1 -0
- package/dist/matbea-ui.cjs29.js +63 -0
- package/dist/matbea-ui.cjs3.js +1 -0
- package/dist/matbea-ui.cjs30.js +34 -0
- package/dist/matbea-ui.cjs31.js +44 -0
- package/dist/matbea-ui.cjs32.js +1 -0
- package/dist/matbea-ui.cjs33.js +11 -0
- package/dist/matbea-ui.cjs34.js +71 -0
- package/dist/matbea-ui.cjs35.js +14 -0
- package/dist/matbea-ui.cjs36.js +11 -0
- package/dist/matbea-ui.cjs37.js +1 -0
- package/dist/matbea-ui.cjs38.js +1 -0
- package/dist/matbea-ui.cjs39.js +37 -0
- package/dist/matbea-ui.cjs4.js +1 -0
- package/dist/matbea-ui.cjs40.js +62 -0
- package/dist/matbea-ui.cjs41.js +102 -0
- package/dist/matbea-ui.cjs42.js +103 -0
- package/dist/matbea-ui.cjs43.js +7 -0
- package/dist/matbea-ui.cjs44.js +1 -0
- package/dist/matbea-ui.cjs45.js +1 -0
- package/dist/matbea-ui.cjs46.js +55 -0
- package/dist/matbea-ui.cjs47.js +23 -0
- package/dist/matbea-ui.cjs48.js +38 -0
- package/dist/matbea-ui.cjs49.js +51 -0
- package/dist/matbea-ui.cjs5.js +1 -0
- package/dist/matbea-ui.cjs50.js +1 -0
- package/dist/matbea-ui.cjs51.js +27 -0
- package/dist/matbea-ui.cjs52.js +48 -0
- package/dist/matbea-ui.cjs53.js +1 -0
- package/dist/matbea-ui.cjs54.js +1 -0
- package/dist/matbea-ui.cjs55.js +1 -0
- package/dist/matbea-ui.cjs56.js +34 -0
- package/dist/matbea-ui.cjs57.js +11 -0
- package/dist/matbea-ui.cjs58.js +24 -0
- package/dist/matbea-ui.cjs59.js +27 -0
- package/dist/matbea-ui.cjs6.js +1 -0
- package/dist/matbea-ui.cjs60.js +29 -0
- package/dist/matbea-ui.cjs61.js +1 -0
- package/dist/matbea-ui.cjs62.js +20 -0
- package/dist/matbea-ui.cjs63.js +1 -0
- package/dist/matbea-ui.cjs64.js +1 -0
- package/dist/matbea-ui.cjs65.js +1 -0
- package/dist/matbea-ui.cjs66.js +6 -0
- package/dist/matbea-ui.cjs67.js +6 -0
- package/dist/matbea-ui.cjs68.js +1 -0
- package/dist/matbea-ui.cjs69.js +1 -0
- package/dist/matbea-ui.cjs7.js +1 -0
- package/dist/matbea-ui.cjs70.js +1 -0
- package/dist/matbea-ui.cjs71.js +1 -0
- package/dist/matbea-ui.cjs72.js +1 -0
- package/dist/matbea-ui.cjs8.js +1 -0
- package/dist/matbea-ui.cjs9.js +1 -0
- package/dist/matbea-ui.es.js +54 -2670
- package/dist/matbea-ui.es10.js +10 -0
- package/dist/matbea-ui.es11.js +47 -0
- package/dist/matbea-ui.es12.js +178 -0
- package/dist/matbea-ui.es13.js +188 -0
- package/dist/matbea-ui.es14.js +12 -0
- package/dist/matbea-ui.es15.js +31 -0
- package/dist/matbea-ui.es16.js +25 -0
- package/dist/matbea-ui.es17.js +40 -0
- package/dist/matbea-ui.es18.js +43 -0
- package/dist/matbea-ui.es19.js +25 -0
- package/dist/matbea-ui.es2.js +38 -0
- package/dist/matbea-ui.es20.js +13 -0
- package/dist/matbea-ui.es21.js +33 -0
- package/dist/matbea-ui.es22.js +16 -0
- package/dist/matbea-ui.es23.js +25 -0
- package/dist/matbea-ui.es24.js +36 -0
- package/dist/matbea-ui.es25.js +29 -0
- package/dist/matbea-ui.es26.js +30 -0
- package/dist/matbea-ui.es27.js +20 -0
- package/dist/matbea-ui.es28.js +5 -0
- package/dist/matbea-ui.es29.js +163 -0
- package/dist/matbea-ui.es3.js +24 -0
- package/dist/matbea-ui.es30.js +40 -0
- package/dist/matbea-ui.es31.js +330 -0
- package/dist/matbea-ui.es32.js +15 -0
- package/dist/matbea-ui.es33.js +26 -0
- package/dist/matbea-ui.es34.js +85 -0
- package/dist/matbea-ui.es35.js +18 -0
- package/dist/matbea-ui.es36.js +18 -0
- package/dist/matbea-ui.es37.js +24 -0
- package/dist/matbea-ui.es38.js +10 -0
- package/dist/matbea-ui.es39.js +42 -0
- package/dist/matbea-ui.es4.js +31 -0
- package/dist/matbea-ui.es40.js +70 -0
- package/dist/matbea-ui.es41.js +119 -0
- package/dist/matbea-ui.es42.js +131 -0
- package/dist/matbea-ui.es43.js +13 -0
- package/dist/matbea-ui.es44.js +25 -0
- package/dist/matbea-ui.es45.js +34 -0
- package/dist/matbea-ui.es46.js +64 -0
- package/dist/matbea-ui.es47.js +39 -0
- package/dist/matbea-ui.es48.js +44 -0
- package/dist/matbea-ui.es49.js +58 -0
- package/dist/matbea-ui.es5.js +19 -0
- package/dist/matbea-ui.es50.js +26 -0
- package/dist/matbea-ui.es51.js +58 -0
- package/dist/matbea-ui.es52.js +62 -0
- package/dist/matbea-ui.es53.js +12 -0
- package/dist/matbea-ui.es54.js +12 -0
- package/dist/matbea-ui.es55.js +15 -0
- package/dist/matbea-ui.es56.js +74 -0
- package/dist/matbea-ui.es57.js +17 -0
- package/dist/matbea-ui.es58.js +55 -0
- package/dist/matbea-ui.es59.js +57 -0
- package/dist/matbea-ui.es6.js +62 -0
- package/dist/matbea-ui.es60.js +59 -0
- package/dist/matbea-ui.es61.js +21 -0
- package/dist/matbea-ui.es62.js +34 -0
- package/dist/matbea-ui.es63.js +10 -0
- package/dist/matbea-ui.es64.js +4 -0
- package/dist/matbea-ui.es65.js +26 -0
- package/dist/matbea-ui.es66.js +236 -0
- package/dist/matbea-ui.es67.js +10 -0
- package/dist/matbea-ui.es68.js +9 -0
- package/dist/matbea-ui.es69.js +12 -0
- package/dist/matbea-ui.es7.js +5 -0
- package/dist/matbea-ui.es70.js +4 -0
- package/dist/matbea-ui.es71.js +4 -0
- package/dist/matbea-ui.es72.js +17 -0
- package/dist/matbea-ui.es8.js +6 -0
- package/dist/matbea-ui.es9.js +27 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { j as o } from "./matbea-ui.es28.js";
|
|
2
|
+
import { LoaderDots as s, LoaderDot as r } from "./matbea-ui.es39.js";
|
|
3
|
+
const e = () => /* @__PURE__ */ o.jsxs(s, { children: [
|
|
4
|
+
/* @__PURE__ */ o.jsx(r, {}),
|
|
5
|
+
/* @__PURE__ */ o.jsx(r, {}),
|
|
6
|
+
/* @__PURE__ */ o.jsx(r, {})
|
|
7
|
+
] });
|
|
8
|
+
export {
|
|
9
|
+
e as Loader
|
|
10
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { j as t } from "./matbea-ui.es28.js";
|
|
2
|
+
import { useId as k, useState as p, useCallback as j } from "react";
|
|
3
|
+
import { RadioLabel as C, HiddenInput as g, VisualRadio as I, LabelText as R } from "./matbea-ui.es40.js";
|
|
4
|
+
const y = ({
|
|
5
|
+
checked: o,
|
|
6
|
+
defaultChecked: d = !1,
|
|
7
|
+
disabled: e = !1,
|
|
8
|
+
name: h,
|
|
9
|
+
value: u,
|
|
10
|
+
label: r,
|
|
11
|
+
onChange: s,
|
|
12
|
+
className: l
|
|
13
|
+
}) => {
|
|
14
|
+
const c = k(), [m, x] = p(d), n = o !== void 0, i = n ? o : m, f = j(
|
|
15
|
+
(a) => {
|
|
16
|
+
e || (n || x(a.target.checked), s?.(a.target.checked));
|
|
17
|
+
},
|
|
18
|
+
[e, n, s]
|
|
19
|
+
);
|
|
20
|
+
return /* @__PURE__ */ t.jsxs(
|
|
21
|
+
C,
|
|
22
|
+
{
|
|
23
|
+
className: l,
|
|
24
|
+
htmlFor: c,
|
|
25
|
+
disabled: e,
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ t.jsx(
|
|
28
|
+
g,
|
|
29
|
+
{
|
|
30
|
+
id: c,
|
|
31
|
+
type: "radio",
|
|
32
|
+
checked: i,
|
|
33
|
+
onChange: f,
|
|
34
|
+
disabled: e,
|
|
35
|
+
name: h,
|
|
36
|
+
value: u
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ t.jsx(I, { $checked: i, $disabled: e }),
|
|
40
|
+
r && /* @__PURE__ */ t.jsx(R, { variant: "button", children: r })
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
y as RadioButton
|
|
47
|
+
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { j as t } from "./matbea-ui.es28.js";
|
|
2
|
+
import { forwardRef as J, useRef as L, useState as u, useMemo as Q, useCallback as h, useLayoutEffect as X, useEffect as Y } from "react";
|
|
3
|
+
import { Wrapper as Z, Label as ee, FieldContainer as ne, LeadingIcon as te, Value as re, HiddenInput as oe, ErrorText as se, List as le, Option as ae, OptionIcon as ce } from "./matbea-ui.es41.js";
|
|
4
|
+
import { Typography as ie } from "./matbea-ui.es4.js";
|
|
5
|
+
const de = 8, ue = J(
|
|
6
|
+
({
|
|
7
|
+
options: o,
|
|
8
|
+
value: F,
|
|
9
|
+
defaultValue: C,
|
|
10
|
+
placeholder: M = "Text",
|
|
11
|
+
label: O,
|
|
12
|
+
error: p,
|
|
13
|
+
disabled: s = !1,
|
|
14
|
+
icon: R,
|
|
15
|
+
name: T,
|
|
16
|
+
onChange: $,
|
|
17
|
+
onFocus: S,
|
|
18
|
+
onBlur: B,
|
|
19
|
+
className: V
|
|
20
|
+
}, A) => {
|
|
21
|
+
const w = L(null), v = L(null), x = L(null), [r, b] = u(!1), [H, g] = u(!1), [P, z] = u(C ?? ""), [f, a] = u(null), [m, K] = u({
|
|
22
|
+
top: 0,
|
|
23
|
+
left: 0,
|
|
24
|
+
width: 0
|
|
25
|
+
}), c = F ?? P, y = Q(
|
|
26
|
+
() => o.find((e) => e.value === c),
|
|
27
|
+
[o, c]
|
|
28
|
+
), E = !!p, N = !y, W = y?.label ?? M, D = h(() => {
|
|
29
|
+
if (!v.current) return;
|
|
30
|
+
const e = v.current.getBoundingClientRect();
|
|
31
|
+
K({
|
|
32
|
+
top: e.bottom + de,
|
|
33
|
+
left: e.left,
|
|
34
|
+
width: e.width
|
|
35
|
+
});
|
|
36
|
+
}, []);
|
|
37
|
+
X(() => {
|
|
38
|
+
if (!r) return;
|
|
39
|
+
D();
|
|
40
|
+
const e = () => D();
|
|
41
|
+
return window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
42
|
+
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
43
|
+
};
|
|
44
|
+
}, [r, D]);
|
|
45
|
+
const i = h(() => {
|
|
46
|
+
b(!1), a(null);
|
|
47
|
+
}, []), d = h(() => {
|
|
48
|
+
s || (b(!0), a((e) => {
|
|
49
|
+
if (e !== null) return e;
|
|
50
|
+
const n = o.findIndex(
|
|
51
|
+
(l) => l.value === c
|
|
52
|
+
);
|
|
53
|
+
return n >= 0 ? n : 0;
|
|
54
|
+
}));
|
|
55
|
+
}, [s, o, c]), U = h(() => {
|
|
56
|
+
r ? i() : d();
|
|
57
|
+
}, [r, i, d]), k = (e) => {
|
|
58
|
+
s || (z(e.value), $?.(e.value), i());
|
|
59
|
+
}, _ = (e) => {
|
|
60
|
+
if (!s)
|
|
61
|
+
switch (e.key) {
|
|
62
|
+
case "ArrowDown":
|
|
63
|
+
e.preventDefault(), d(), a(
|
|
64
|
+
(n) => n === null ? 0 : Math.min(n + 1, o.length - 1)
|
|
65
|
+
);
|
|
66
|
+
break;
|
|
67
|
+
case "ArrowUp":
|
|
68
|
+
e.preventDefault(), d(), a(
|
|
69
|
+
(n) => n === null ? o.length - 1 : Math.max(n - 1, 0)
|
|
70
|
+
);
|
|
71
|
+
break;
|
|
72
|
+
case "Enter":
|
|
73
|
+
case " ":
|
|
74
|
+
e.preventDefault(), r ? f !== null && o[f] && k(o[f]) : d();
|
|
75
|
+
break;
|
|
76
|
+
case "Escape":
|
|
77
|
+
case "Tab":
|
|
78
|
+
i();
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
Y(() => {
|
|
83
|
+
if (!r) return;
|
|
84
|
+
const e = (n) => {
|
|
85
|
+
const l = n.target, j = w.current && w.current.contains(l), I = x.current && x.current.contains(l);
|
|
86
|
+
!j && !I && i();
|
|
87
|
+
};
|
|
88
|
+
return document.addEventListener("mousedown", e), () => {
|
|
89
|
+
document.removeEventListener("mousedown", e);
|
|
90
|
+
};
|
|
91
|
+
}, [r, i]);
|
|
92
|
+
const q = (e) => {
|
|
93
|
+
g(!0), S?.(e);
|
|
94
|
+
}, G = (e) => {
|
|
95
|
+
g(!1), B?.(e);
|
|
96
|
+
};
|
|
97
|
+
return /* @__PURE__ */ t.jsxs(
|
|
98
|
+
Z,
|
|
99
|
+
{
|
|
100
|
+
className: V,
|
|
101
|
+
ref: w,
|
|
102
|
+
onKeyDown: _,
|
|
103
|
+
onFocus: q,
|
|
104
|
+
onBlur: G,
|
|
105
|
+
children: [
|
|
106
|
+
O && /* @__PURE__ */ t.jsx(ee, { children: O }),
|
|
107
|
+
/* @__PURE__ */ t.jsxs(
|
|
108
|
+
ne,
|
|
109
|
+
{
|
|
110
|
+
ref: v,
|
|
111
|
+
role: "button",
|
|
112
|
+
tabIndex: s ? -1 : 0,
|
|
113
|
+
"aria-haspopup": "listbox",
|
|
114
|
+
"aria-expanded": r,
|
|
115
|
+
"aria-invalid": E,
|
|
116
|
+
"aria-disabled": s,
|
|
117
|
+
$hasError: E,
|
|
118
|
+
$disabled: s,
|
|
119
|
+
"data-state": E ? "error" : r || H ? "active" : void 0,
|
|
120
|
+
onClick: U,
|
|
121
|
+
children: [
|
|
122
|
+
R && /* @__PURE__ */ t.jsx(te, { children: R }),
|
|
123
|
+
/* @__PURE__ */ t.jsx(re, { $placeholder: N, children: W }),
|
|
124
|
+
/* @__PURE__ */ t.jsx(
|
|
125
|
+
oe,
|
|
126
|
+
{
|
|
127
|
+
ref: A,
|
|
128
|
+
readOnly: !0,
|
|
129
|
+
name: T,
|
|
130
|
+
value: c,
|
|
131
|
+
tabIndex: -1,
|
|
132
|
+
"aria-hidden": !0
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
p && /* @__PURE__ */ t.jsx(se, { children: p }),
|
|
139
|
+
r && /* @__PURE__ */ t.jsx(
|
|
140
|
+
le,
|
|
141
|
+
{
|
|
142
|
+
ref: x,
|
|
143
|
+
role: "listbox",
|
|
144
|
+
$top: m.top,
|
|
145
|
+
$left: m.left,
|
|
146
|
+
$width: m.width,
|
|
147
|
+
children: o.map((e, n) => {
|
|
148
|
+
const l = e.value === c, j = n === f;
|
|
149
|
+
return /* @__PURE__ */ t.jsxs(
|
|
150
|
+
ae,
|
|
151
|
+
{
|
|
152
|
+
role: "option",
|
|
153
|
+
"aria-selected": l,
|
|
154
|
+
"data-active": l || void 0,
|
|
155
|
+
"data-hovered": j || void 0,
|
|
156
|
+
onMouseEnter: () => a(n),
|
|
157
|
+
onMouseLeave: () => a(null),
|
|
158
|
+
onMouseDown: (I) => I.preventDefault(),
|
|
159
|
+
onClick: () => k(e),
|
|
160
|
+
children: [
|
|
161
|
+
e.icon && /* @__PURE__ */ t.jsx(ce, { children: e.icon }),
|
|
162
|
+
/* @__PURE__ */ t.jsx(ie, { variant: "form-input", children: e.label })
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
e.value
|
|
166
|
+
);
|
|
167
|
+
})
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
ue.displayName = "SelectField";
|
|
176
|
+
export {
|
|
177
|
+
ue as SelectField
|
|
178
|
+
};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { j as T } from "./matbea-ui.es28.js";
|
|
2
|
+
import { useState as q, useRef as d, useId as pt, useMemo as wt, useCallback as I, useLayoutEffect as bt, useEffect as K } from "react";
|
|
3
|
+
import { TooltipWrapper as gt, TooltipTrigger as vt, TooltipBubble as Tt, TooltipContentText as Et, TooltipArrow as Lt } from "./matbea-ui.es42.js";
|
|
4
|
+
const o = 8, l = 12, V = 12, xt = {
|
|
5
|
+
top: ["top", "bottom", "right", "left"],
|
|
6
|
+
bottom: ["bottom", "top", "right", "left"],
|
|
7
|
+
left: ["left", "right", "top", "bottom"],
|
|
8
|
+
right: ["right", "left", "top", "bottom"]
|
|
9
|
+
}, M = (p, A, a) => Math.min(Math.max(p, A), a), kt = ({
|
|
10
|
+
content: p,
|
|
11
|
+
children: A,
|
|
12
|
+
position: a = "top",
|
|
13
|
+
open: Y,
|
|
14
|
+
defaultOpen: Z = !1,
|
|
15
|
+
onOpenChange: B,
|
|
16
|
+
showDelay: X = 150,
|
|
17
|
+
hideDelay: _ = 150,
|
|
18
|
+
interactive: j = !1,
|
|
19
|
+
disabled: c = !1,
|
|
20
|
+
hideOnClick: J = !1,
|
|
21
|
+
maxWidth: E
|
|
22
|
+
}) => {
|
|
23
|
+
const [Q, tt] = q(Z), P = typeof Y == "boolean", i = P ? !!Y : Q, H = d(null), L = d(null), w = d(null), x = d(null), R = d(null), u = d(null), N = pt(), S = wt(
|
|
24
|
+
() => ({
|
|
25
|
+
top: -9999,
|
|
26
|
+
left: -9999,
|
|
27
|
+
arrowX: 0,
|
|
28
|
+
arrowY: 0,
|
|
29
|
+
placement: a
|
|
30
|
+
}),
|
|
31
|
+
[a]
|
|
32
|
+
), [f, W] = q(S), y = () => {
|
|
33
|
+
x.current && (clearTimeout(x.current), x.current = null), R.current && (clearTimeout(R.current), R.current = null);
|
|
34
|
+
}, s = I(
|
|
35
|
+
(e) => {
|
|
36
|
+
P || tt(e), e || W(S), B?.(e);
|
|
37
|
+
},
|
|
38
|
+
[S, P, B]
|
|
39
|
+
), D = I(() => {
|
|
40
|
+
c || (y(), x.current = setTimeout(() => s(!0), X));
|
|
41
|
+
}, [c, s, X]), $ = I(() => {
|
|
42
|
+
c || (y(), R.current = setTimeout(() => s(!1), _));
|
|
43
|
+
}, [c, s, _]), et = () => {
|
|
44
|
+
c || D();
|
|
45
|
+
}, nt = () => {
|
|
46
|
+
c || $();
|
|
47
|
+
}, rt = () => {
|
|
48
|
+
c || D();
|
|
49
|
+
}, ot = () => {
|
|
50
|
+
c || $();
|
|
51
|
+
}, ct = () => {
|
|
52
|
+
J && s(!1);
|
|
53
|
+
}, it = () => {
|
|
54
|
+
j && y();
|
|
55
|
+
}, st = () => {
|
|
56
|
+
j && $();
|
|
57
|
+
}, G = I(() => {
|
|
58
|
+
if (typeof window > "u" || !L.current || !w.current)
|
|
59
|
+
return;
|
|
60
|
+
const e = L.current.getBoundingClientRect(), t = w.current.getBoundingClientRect(), r = window.innerWidth, h = window.innerHeight, m = e.left + e.width / 2, z = e.top + e.height / 2, lt = (n) => {
|
|
61
|
+
switch (n) {
|
|
62
|
+
case "top":
|
|
63
|
+
return e.top >= t.height + l + o;
|
|
64
|
+
case "bottom":
|
|
65
|
+
return h - e.bottom >= t.height + l + o;
|
|
66
|
+
case "left":
|
|
67
|
+
return e.left >= t.width + l + o;
|
|
68
|
+
case "right":
|
|
69
|
+
return r - e.right >= t.width + l + o;
|
|
70
|
+
default:
|
|
71
|
+
return !0;
|
|
72
|
+
}
|
|
73
|
+
}, b = xt[a].find((n) => lt(n)) ?? a;
|
|
74
|
+
let g = 0, v = 0;
|
|
75
|
+
switch (b) {
|
|
76
|
+
case "top":
|
|
77
|
+
g = e.top - t.height - l, v = m - t.width / 2;
|
|
78
|
+
break;
|
|
79
|
+
case "bottom":
|
|
80
|
+
g = e.bottom + l, v = m - t.width / 2;
|
|
81
|
+
break;
|
|
82
|
+
case "left":
|
|
83
|
+
g = z - t.height / 2, v = e.left - t.width - l;
|
|
84
|
+
break;
|
|
85
|
+
case "right":
|
|
86
|
+
default:
|
|
87
|
+
g = z - t.height / 2, v = e.right + l;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
const at = Math.max(r - o * 2, 0), ut = Math.max(h - o * 2, 0), ft = o, ht = r - t.width - o, mt = o, dt = h - t.height - o, C = t.width >= at ? o : M(v, ft, ht), F = t.height >= ut ? o : M(g, mt, dt);
|
|
91
|
+
let O = 0, k = 0;
|
|
92
|
+
if (b === "top" || b === "bottom") {
|
|
93
|
+
const n = Math.max(t.width / 2 - V, 0);
|
|
94
|
+
O = M(
|
|
95
|
+
m - (C + t.width / 2),
|
|
96
|
+
-n,
|
|
97
|
+
n
|
|
98
|
+
), k = 0;
|
|
99
|
+
} else {
|
|
100
|
+
const n = Math.max(t.height / 2 - V, 0);
|
|
101
|
+
k = M(
|
|
102
|
+
z - (F + t.height / 2),
|
|
103
|
+
-n,
|
|
104
|
+
n
|
|
105
|
+
), O = 0;
|
|
106
|
+
}
|
|
107
|
+
W((n) => n.top === F && n.left === C && n.arrowX === O && n.arrowY === k && n.placement === b ? n : {
|
|
108
|
+
top: F,
|
|
109
|
+
left: C,
|
|
110
|
+
arrowX: O,
|
|
111
|
+
arrowY: k,
|
|
112
|
+
placement: b
|
|
113
|
+
});
|
|
114
|
+
}, [a]);
|
|
115
|
+
bt(() => {
|
|
116
|
+
if (!i)
|
|
117
|
+
return;
|
|
118
|
+
const e = w.current, t = L.current;
|
|
119
|
+
if (!e || !t) return;
|
|
120
|
+
const r = () => {
|
|
121
|
+
u.current !== null && cancelAnimationFrame(u.current), u.current = window.requestAnimationFrame(() => {
|
|
122
|
+
u.current = null, G();
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
r();
|
|
126
|
+
const m = typeof window < "u" && "ResizeObserver" in window ? new ResizeObserver(r) : null;
|
|
127
|
+
return m?.observe(e), m?.observe(t), window.addEventListener("resize", r), window.addEventListener("scroll", r, !0), () => {
|
|
128
|
+
window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0), m?.disconnect(), u.current !== null && (cancelAnimationFrame(u.current), u.current = null);
|
|
129
|
+
};
|
|
130
|
+
}, [i, G]), K(() => y, []), K(() => {
|
|
131
|
+
if (!i) return;
|
|
132
|
+
const e = (r) => {
|
|
133
|
+
r.key === "Escape" && s(!1);
|
|
134
|
+
}, t = (r) => {
|
|
135
|
+
const h = r.target;
|
|
136
|
+
H.current?.contains(h) || w.current?.contains(h) || s(!1);
|
|
137
|
+
};
|
|
138
|
+
return document.addEventListener("keydown", e), document.addEventListener("pointerdown", t), () => {
|
|
139
|
+
document.removeEventListener("keydown", e), document.removeEventListener("pointerdown", t);
|
|
140
|
+
};
|
|
141
|
+
}, [i, s]);
|
|
142
|
+
const U = {
|
|
143
|
+
top: f.top,
|
|
144
|
+
left: f.left,
|
|
145
|
+
"--tooltip-arrow-x": `${f.arrowX}px`,
|
|
146
|
+
"--tooltip-arrow-y": `${f.arrowY}px`
|
|
147
|
+
};
|
|
148
|
+
return E !== void 0 && (U.maxWidth = typeof E == "number" ? `${E}px` : E), /* @__PURE__ */ T.jsxs(gt, { ref: H, "data-disabled": c, children: [
|
|
149
|
+
/* @__PURE__ */ T.jsx(
|
|
150
|
+
vt,
|
|
151
|
+
{
|
|
152
|
+
ref: L,
|
|
153
|
+
tabIndex: c ? -1 : 0,
|
|
154
|
+
"aria-describedby": i ? N : void 0,
|
|
155
|
+
onMouseEnter: et,
|
|
156
|
+
onMouseLeave: nt,
|
|
157
|
+
onFocus: rt,
|
|
158
|
+
onBlur: ot,
|
|
159
|
+
onClick: ct,
|
|
160
|
+
"data-open": i,
|
|
161
|
+
children: A
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
/* @__PURE__ */ T.jsxs(
|
|
165
|
+
Tt,
|
|
166
|
+
{
|
|
167
|
+
ref: w,
|
|
168
|
+
id: N,
|
|
169
|
+
role: "tooltip",
|
|
170
|
+
"aria-hidden": !i,
|
|
171
|
+
$visible: i,
|
|
172
|
+
$interactive: j,
|
|
173
|
+
$placement: f.placement,
|
|
174
|
+
style: U,
|
|
175
|
+
"data-placement": f.placement,
|
|
176
|
+
onMouseEnter: it,
|
|
177
|
+
onMouseLeave: st,
|
|
178
|
+
children: [
|
|
179
|
+
["string", "number"].includes(typeof p) ? /* @__PURE__ */ T.jsx(Et, { variant: "body-m", children: p }) : p,
|
|
180
|
+
/* @__PURE__ */ T.jsx(Lt, { $placement: f.placement })
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
] });
|
|
185
|
+
};
|
|
186
|
+
export {
|
|
187
|
+
kt as Tooltip
|
|
188
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { j as o } from "./matbea-ui.es28.js";
|
|
2
|
+
import { maskEmail as t } from "./matbea-ui.es27.js";
|
|
3
|
+
import { UserAccountStyled as m, UserAccountText as s } from "./matbea-ui.es43.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { UserIcon as e } from "./matbea-ui.es44.js";
|
|
6
|
+
const a = ({ email: r }) => /* @__PURE__ */ o.jsxs(m, { children: [
|
|
7
|
+
/* @__PURE__ */ o.jsx(e, {}),
|
|
8
|
+
/* @__PURE__ */ o.jsx(s, { variant: "body-m-semibold", children: t(r) })
|
|
9
|
+
] });
|
|
10
|
+
export {
|
|
11
|
+
a as UserAccount
|
|
12
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { j as t } from "./matbea-ui.es28.js";
|
|
2
|
+
import { useCallback as a } from "react";
|
|
3
|
+
import { Tab as c } from "./matbea-ui.es45.js";
|
|
4
|
+
import { TabRow as p } from "./matbea-ui.es46.js";
|
|
5
|
+
const j = ({
|
|
6
|
+
size: e = "m",
|
|
7
|
+
activeId: i,
|
|
8
|
+
items: m,
|
|
9
|
+
onChange: r,
|
|
10
|
+
className: s
|
|
11
|
+
}) => {
|
|
12
|
+
const l = a(
|
|
13
|
+
(o) => {
|
|
14
|
+
r(o);
|
|
15
|
+
},
|
|
16
|
+
[r]
|
|
17
|
+
);
|
|
18
|
+
return /* @__PURE__ */ t.jsx(p, { role: "tablist", className: s, children: m.map((o) => /* @__PURE__ */ t.jsx(
|
|
19
|
+
c,
|
|
20
|
+
{
|
|
21
|
+
...o,
|
|
22
|
+
size: e,
|
|
23
|
+
active: o.id === i,
|
|
24
|
+
onSelect: l
|
|
25
|
+
},
|
|
26
|
+
o.id
|
|
27
|
+
)) });
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
j as TabList
|
|
31
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { j as i } from "./matbea-ui.es28.js";
|
|
2
|
+
import { TableStyled as t, TableHead as h, TableRow as r, TableHeader as s, TableBody as x, TableCell as j } from "./matbea-ui.es47.js";
|
|
3
|
+
const p = ({ columns: a, data: l }) => /* @__PURE__ */ i.jsxs(t, { children: [
|
|
4
|
+
/* @__PURE__ */ i.jsx(h, { children: /* @__PURE__ */ i.jsx(r, { children: a.map((e) => /* @__PURE__ */ i.jsx(
|
|
5
|
+
s,
|
|
6
|
+
{
|
|
7
|
+
width: e.width,
|
|
8
|
+
align: e.align || "left",
|
|
9
|
+
children: e.name
|
|
10
|
+
},
|
|
11
|
+
e.id
|
|
12
|
+
)) }) }),
|
|
13
|
+
/* @__PURE__ */ i.jsx(x, { children: l.map((e) => /* @__PURE__ */ i.jsx(r, { children: a.map((d) => /* @__PURE__ */ i.jsx(
|
|
14
|
+
j,
|
|
15
|
+
{
|
|
16
|
+
width: d.width,
|
|
17
|
+
align: d.align || "left",
|
|
18
|
+
children: d.render ? d.render(e) : e[d.id]
|
|
19
|
+
},
|
|
20
|
+
d.id
|
|
21
|
+
)) }, e.id)) })
|
|
22
|
+
] });
|
|
23
|
+
export {
|
|
24
|
+
p as Table
|
|
25
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { j as c } from "./matbea-ui.es28.js";
|
|
2
|
+
import { useId as p, useState as j, useCallback as a } from "react";
|
|
3
|
+
import { SwitcherRoot as w, Track as I, Thumb as y } from "./matbea-ui.es48.js";
|
|
4
|
+
const g = ({
|
|
5
|
+
checked: s,
|
|
6
|
+
defaultChecked: l = !1,
|
|
7
|
+
disabled: e = !1,
|
|
8
|
+
onChange: i,
|
|
9
|
+
id: u,
|
|
10
|
+
className: f
|
|
11
|
+
}) => {
|
|
12
|
+
const h = p(), m = u ?? h, r = s !== void 0, [x, d] = j(l), o = r ? s : x, n = a(() => {
|
|
13
|
+
if (e) return;
|
|
14
|
+
const t = !o;
|
|
15
|
+
r || d(t), i?.(t);
|
|
16
|
+
}, [o, r, e, i]), k = a(
|
|
17
|
+
(t) => {
|
|
18
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), n());
|
|
19
|
+
},
|
|
20
|
+
[n]
|
|
21
|
+
);
|
|
22
|
+
return /* @__PURE__ */ c.jsx(w, { className: f, children: /* @__PURE__ */ c.jsx(
|
|
23
|
+
I,
|
|
24
|
+
{
|
|
25
|
+
id: m,
|
|
26
|
+
role: "switch",
|
|
27
|
+
"aria-checked": o,
|
|
28
|
+
"aria-disabled": e,
|
|
29
|
+
tabIndex: e ? -1 : 0,
|
|
30
|
+
onClick: n,
|
|
31
|
+
onKeyDown: k,
|
|
32
|
+
disabled: e,
|
|
33
|
+
$checked: o,
|
|
34
|
+
children: /* @__PURE__ */ c.jsx(y, { $checked: o, $disabled: e })
|
|
35
|
+
}
|
|
36
|
+
) });
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
g as Switcher
|
|
40
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { j as t } from "./matbea-ui.es28.js";
|
|
2
|
+
import { useId as L, useState as m, useCallback as p } from "react";
|
|
3
|
+
import { Label as C, HiddenInput as j, Box as u, CheckIcon as I } from "./matbea-ui.es49.js";
|
|
4
|
+
const b = ({
|
|
5
|
+
checked: n,
|
|
6
|
+
defaultChecked: i = !1,
|
|
7
|
+
disabled: e = !1,
|
|
8
|
+
name: d,
|
|
9
|
+
value: x,
|
|
10
|
+
onChange: r,
|
|
11
|
+
className: f
|
|
12
|
+
}) => {
|
|
13
|
+
const s = L(), c = n !== void 0, [l, a] = m(i), o = c ? n : l, k = p(
|
|
14
|
+
(h) => {
|
|
15
|
+
e || (c || a(h.target.checked), r?.(h.target.checked));
|
|
16
|
+
},
|
|
17
|
+
[e, c, r]
|
|
18
|
+
);
|
|
19
|
+
return /* @__PURE__ */ t.jsxs(C, { htmlFor: s, disabled: e, className: f, children: [
|
|
20
|
+
/* @__PURE__ */ t.jsx(
|
|
21
|
+
j,
|
|
22
|
+
{
|
|
23
|
+
id: s,
|
|
24
|
+
type: "checkbox",
|
|
25
|
+
checked: o,
|
|
26
|
+
disabled: e,
|
|
27
|
+
onChange: k,
|
|
28
|
+
name: d,
|
|
29
|
+
value: x
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ t.jsx(u, { $checked: o, $disabled: e, children: o && /* @__PURE__ */ t.jsx(I, { viewBox: "0 0 15 11", children: /* @__PURE__ */ t.jsx(
|
|
33
|
+
"path",
|
|
34
|
+
{
|
|
35
|
+
d: "M5.00034 11L0 6.18738L1.42838 4.81262L5.00185 8.24806L5.00034 8.24951L13.5716 0L15 1.37476L6.42872 9.62524L5.00135 10.999L5.00034 11Z",
|
|
36
|
+
fill: "#fff"
|
|
37
|
+
}
|
|
38
|
+
) }) })
|
|
39
|
+
] });
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
b as Checkbox
|
|
43
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { j as i } from "./matbea-ui.es28.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { InfoIcon as e } from "./matbea-ui.es32.js";
|
|
4
|
+
import { WithdrawIcon as c } from "./matbea-ui.es50.js";
|
|
5
|
+
import { ApplicationDataStyled as s, ApplicationDataContent as r, ApplicationDataLabel as l, ApplicationDataValue as m } from "./matbea-ui.es51.js";
|
|
6
|
+
import { Tooltip as a } from "./matbea-ui.es13.js";
|
|
7
|
+
const D = ({
|
|
8
|
+
label: t,
|
|
9
|
+
statusValue: o,
|
|
10
|
+
withdraw: p,
|
|
11
|
+
info: n
|
|
12
|
+
}) => /* @__PURE__ */ i.jsxs(s, { children: [
|
|
13
|
+
/* @__PURE__ */ i.jsxs(r, { children: [
|
|
14
|
+
/* @__PURE__ */ i.jsx(l, { children: t }),
|
|
15
|
+
n && /* @__PURE__ */ i.jsx(a, { content: n, children: /* @__PURE__ */ i.jsx(e, { size: 18 }) })
|
|
16
|
+
] }),
|
|
17
|
+
/* @__PURE__ */ i.jsxs(r, { children: [
|
|
18
|
+
["number", "string"].includes(typeof o) && /* @__PURE__ */ i.jsx(m, { children: o }),
|
|
19
|
+
!["number", "string"].includes(typeof o) && o,
|
|
20
|
+
p && /* @__PURE__ */ i.jsx(c, { size: 18 })
|
|
21
|
+
] })
|
|
22
|
+
] });
|
|
23
|
+
export {
|
|
24
|
+
D as ApplicationData
|
|
25
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { j as e } from "./matbea-ui.es28.js";
|
|
2
|
+
import { StyledButton as d, IconSlot as n } from "./matbea-ui.es29.js";
|
|
3
|
+
const p = ({
|
|
4
|
+
variant: a = "primary",
|
|
5
|
+
size: f = "default",
|
|
6
|
+
form: h = "default",
|
|
7
|
+
fullWidth: u = !1,
|
|
8
|
+
icon: t,
|
|
9
|
+
iconPosition: s = "left",
|
|
10
|
+
children: r,
|
|
11
|
+
disabled: y,
|
|
12
|
+
...$
|
|
13
|
+
}) => {
|
|
14
|
+
const o = !!r, l = !!t && (!o || s === "only"), x = !!t && !l && s === "left", c = !!t && !l && s === "right";
|
|
15
|
+
return /* @__PURE__ */ e.jsxs(
|
|
16
|
+
d,
|
|
17
|
+
{
|
|
18
|
+
type: "button",
|
|
19
|
+
$variant: a,
|
|
20
|
+
$size: f,
|
|
21
|
+
$form: h,
|
|
22
|
+
$fullWidth: u,
|
|
23
|
+
$hasIcon: !!t && o,
|
|
24
|
+
$iconOnly: l,
|
|
25
|
+
disabled: y,
|
|
26
|
+
...$,
|
|
27
|
+
children: [
|
|
28
|
+
x && /* @__PURE__ */ e.jsx(n, { $iconOnly: !1, children: t }),
|
|
29
|
+
(!l || !t) && r,
|
|
30
|
+
l && t && /* @__PURE__ */ e.jsx(n, { $iconOnly: !0, children: t }),
|
|
31
|
+
c && /* @__PURE__ */ e.jsx(n, { $iconOnly: !1, children: t })
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
p as Button
|
|
38
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { j as i } from "./matbea-ui.es28.js";
|
|
2
|
+
import { ApplicationInfoStyled as p, ApplicationInfoDataContainer as a, ApplicationDataActions as r } from "./matbea-ui.es52.js";
|
|
3
|
+
const l = ({
|
|
4
|
+
children: t,
|
|
5
|
+
actions: o,
|
|
6
|
+
variant: n = "primary"
|
|
7
|
+
}) => /* @__PURE__ */ i.jsxs(p, { $variant: n, children: [
|
|
8
|
+
/* @__PURE__ */ i.jsx(a, { children: t }),
|
|
9
|
+
o && /* @__PURE__ */ i.jsx(r, { children: o })
|
|
10
|
+
] });
|
|
11
|
+
export {
|
|
12
|
+
l as ApplicationInfo
|
|
13
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { j as t } from "./matbea-ui.es28.js";
|
|
2
|
+
import { useMemo as e } from "react";
|
|
3
|
+
import { ClockIcon as c } from "./matbea-ui.es53.js";
|
|
4
|
+
import { SuccessfullSmallIcon as a } from "./matbea-ui.es54.js";
|
|
5
|
+
import { WarningIcon as l } from "./matbea-ui.es55.js";
|
|
6
|
+
import { ApplicationStatusStyled as p, ApplicationStatusContent as i, ApplicationStatusLabel as u, ApplicationStatusValue as m } from "./matbea-ui.es56.js";
|
|
7
|
+
const A = ({
|
|
8
|
+
label: n,
|
|
9
|
+
statusValue: r,
|
|
10
|
+
type: s
|
|
11
|
+
}) => {
|
|
12
|
+
const o = e(() => {
|
|
13
|
+
switch (s) {
|
|
14
|
+
case "success":
|
|
15
|
+
return /* @__PURE__ */ t.jsx(a, { size: 18 });
|
|
16
|
+
case "warning":
|
|
17
|
+
return /* @__PURE__ */ t.jsx(l, { size: 18 });
|
|
18
|
+
case "pending":
|
|
19
|
+
default:
|
|
20
|
+
return /* @__PURE__ */ t.jsx(c, { size: 18 });
|
|
21
|
+
}
|
|
22
|
+
}, [s]);
|
|
23
|
+
return /* @__PURE__ */ t.jsxs(p, { children: [
|
|
24
|
+
/* @__PURE__ */ t.jsx(i, { children: /* @__PURE__ */ t.jsx(u, { children: n }) }),
|
|
25
|
+
/* @__PURE__ */ t.jsxs(i, { children: [
|
|
26
|
+
o,
|
|
27
|
+
/* @__PURE__ */ t.jsx(m, { $type: s, children: r })
|
|
28
|
+
] })
|
|
29
|
+
] });
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
A as ApplicationStatus
|
|
33
|
+
};
|