@overdoser/react-toolkit 0.15.0 → 0.17.0
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/AGENTS.md +2 -0
- package/CHANGELOG.md +87 -0
- package/components/Chart/AreaChart.d.ts +5 -1
- package/components/Chart/AreaChart.js +155 -144
- package/components/Chart/BarChart.js +5 -5
- package/components/Chart/PieChart.js +2 -5
- package/components/Chart/RadarChart.js +2 -5
- package/components/Chart/TradingChart.js +258 -257
- package/components/Drawer/Drawer.js +69 -70
- package/components/Dropdown/Dropdown.js +51 -56
- package/components/Modal/Modal.js +42 -47
- package/components/Popover/Popover.js +52 -55
- package/components/SplitButton/SplitButton.js +50 -55
- package/components/inputs/DatePicker/CalendarPanel.d.ts +40 -0
- package/components/inputs/DatePicker/CalendarPanel.js +287 -0
- package/components/inputs/DatePicker/CalendarPanel.module.scss.js +41 -0
- package/components/inputs/DatePicker/DatePicker.d.ts +3 -1
- package/components/inputs/DatePicker/DatePicker.js +105 -192
- package/components/inputs/DatePicker/DatePicker.module.scss.js +20 -40
- package/components/inputs/DateTimePicker/DateTimePicker.d.ts +141 -0
- package/components/inputs/DateTimePicker/DateTimePicker.js +232 -0
- package/components/inputs/DateTimePicker/DateTimePicker.module.scss.js +37 -0
- package/components/inputs/DateTimePicker/DateTimeSegments.d.ts +48 -0
- package/components/inputs/DateTimePicker/DateTimeSegments.js +252 -0
- package/components/inputs/DateTimePicker/TimeField.d.ts +18 -0
- package/components/inputs/DateTimePicker/TimeField.js +135 -0
- package/components/inputs/DateTimePicker/index.d.ts +3 -0
- package/components/inputs/DateTimePicker/timeZoneUtils.d.ts +44 -0
- package/components/inputs/DateTimePicker/timeZoneUtils.js +102 -0
- package/components/inputs/NumberInput/NumberInput.js +79 -81
- package/components/inputs/Select/Select.d.ts +5 -0
- package/components/inputs/Select/Select.js +340 -285
- package/hooks/useEscapeLayer.d.ts +36 -0
- package/hooks/useEscapeLayer.js +33 -0
- package/index.css +1 -1
- package/index.d.ts +2 -0
- package/index.js +108 -106
- package/index.layered.css +1 -1
- package/llms.txt +29 -4
- package/manifest.json +127 -1
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as q, useRef as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import
|
|
5
|
-
import { useFocusTrap as
|
|
6
|
-
import {
|
|
1
|
+
import { jsx as c, jsxs as z } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as q, useRef as T, useId as G, useState as u, useEffect as w, createContext as J, useContext as h } from "react";
|
|
3
|
+
import { createPortal as K } from "react-dom";
|
|
4
|
+
import d from "clsx";
|
|
5
|
+
import { useFocusTrap as Q } from "../../hooks/useFocusTrap.js";
|
|
6
|
+
import { useEscapeLayer as V, EscapeLayerProvider as X } from "../../hooks/useEscapeLayer.js";
|
|
7
7
|
import t from "./Drawer.module.scss.js";
|
|
8
|
-
const m =
|
|
9
|
-
const { classes: i, titleId:
|
|
10
|
-
return /* @__PURE__ */
|
|
8
|
+
const m = J({ classes: {}, titleId: "" }), x = ({ children: e, className: s, style: a, onClose: o }) => {
|
|
9
|
+
const { classes: i, titleId: p } = h(m);
|
|
10
|
+
return /* @__PURE__ */ z(
|
|
11
11
|
"div",
|
|
12
12
|
{
|
|
13
|
-
id:
|
|
14
|
-
className:
|
|
15
|
-
style:
|
|
13
|
+
id: p,
|
|
14
|
+
className: d(t.header, o && t.headerWithClose, i.header, s),
|
|
15
|
+
style: a,
|
|
16
16
|
children: [
|
|
17
17
|
e,
|
|
18
|
-
o && /* @__PURE__ */
|
|
18
|
+
o && /* @__PURE__ */ c(
|
|
19
19
|
"button",
|
|
20
20
|
{
|
|
21
21
|
type: "button",
|
|
22
|
-
className:
|
|
22
|
+
className: d(t.closeButton, i.closeButton),
|
|
23
23
|
onClick: o,
|
|
24
24
|
"aria-label": "Close",
|
|
25
25
|
children: "×"
|
|
@@ -29,91 +29,90 @@ const m = Q({ classes: {}, titleId: "" }), M = ({ children: e, className: a, sty
|
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
31
|
};
|
|
32
|
-
|
|
33
|
-
const R = ({ children: e, className:
|
|
32
|
+
x.displayName = "Drawer.Header";
|
|
33
|
+
const R = ({ children: e, className: s, style: a }) => {
|
|
34
34
|
const { classes: o } = h(m);
|
|
35
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ c("div", { className: d(t.body, o.body, s), style: a, children: e });
|
|
36
36
|
};
|
|
37
37
|
R.displayName = "Drawer.Body";
|
|
38
|
-
const
|
|
38
|
+
const M = ({ children: e, className: s, style: a }) => {
|
|
39
39
|
const { classes: o } = h(m);
|
|
40
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ c("div", { className: d(t.footer, o.footer, s), style: a, children: e });
|
|
41
41
|
};
|
|
42
|
-
|
|
43
|
-
const
|
|
42
|
+
M.displayName = "Drawer.Footer";
|
|
43
|
+
const Y = 340, f = q(
|
|
44
44
|
({
|
|
45
45
|
open: e,
|
|
46
|
-
onClose:
|
|
47
|
-
side:
|
|
46
|
+
onClose: s,
|
|
47
|
+
side: a = "right",
|
|
48
48
|
size: o = "md",
|
|
49
49
|
variant: i = "temporary",
|
|
50
|
-
closeOnBackdrop:
|
|
51
|
-
closeOnEscape:
|
|
52
|
-
classes:
|
|
53
|
-
className:
|
|
54
|
-
style:
|
|
55
|
-
children:
|
|
56
|
-
"aria-label":
|
|
57
|
-
"aria-labelledby":
|
|
50
|
+
closeOnBackdrop: p = !0,
|
|
51
|
+
closeOnEscape: C = !0,
|
|
52
|
+
classes: y,
|
|
53
|
+
className: _,
|
|
54
|
+
style: $,
|
|
55
|
+
children: A,
|
|
56
|
+
"aria-label": N,
|
|
57
|
+
"aria-labelledby": E
|
|
58
58
|
}, n) => {
|
|
59
|
-
const B =
|
|
59
|
+
const B = T(null), F = (r) => {
|
|
60
60
|
B.current = r, typeof n == "function" ? n(r) : n && (n.current = r);
|
|
61
|
-
}, O = G(), g =
|
|
61
|
+
}, O = G(), g = E ?? `${O}-title`, b = i === "temporary", [l, k] = u(e), [D, I] = u(!1), [S, H] = u(a), [P, j] = u(o);
|
|
62
62
|
w(() => {
|
|
63
|
-
e && (
|
|
64
|
-
}, [e,
|
|
65
|
-
if (e || !
|
|
66
|
-
|
|
67
|
-
const r = setTimeout(() =>
|
|
63
|
+
e && (k(!0), I(!1), H(a), j(o));
|
|
64
|
+
}, [e, a, o]), w(() => {
|
|
65
|
+
if (e || !l) return;
|
|
66
|
+
I(!0);
|
|
67
|
+
const r = setTimeout(() => k(!1), Y);
|
|
68
68
|
return () => clearTimeout(r);
|
|
69
|
-
}, [e,
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
if (!c) return;
|
|
69
|
+
}, [e, l]), Q(B, l && e && b);
|
|
70
|
+
const L = V(() => {
|
|
71
|
+
C && s();
|
|
72
|
+
}, e);
|
|
73
|
+
w(() => {
|
|
74
|
+
if (!l) return;
|
|
76
75
|
const r = document.body.style.overflow;
|
|
77
76
|
return document.body.style.overflow = "hidden", () => {
|
|
78
77
|
document.body.style.overflow = r;
|
|
79
78
|
};
|
|
80
|
-
}, [
|
|
81
|
-
const v =
|
|
79
|
+
}, [l]);
|
|
80
|
+
const v = T(!1), U = (r) => {
|
|
82
81
|
v.current = r.target === r.currentTarget;
|
|
83
|
-
},
|
|
84
|
-
|
|
82
|
+
}, W = (r) => {
|
|
83
|
+
p && v.current && r.target === r.currentTarget && s(), v.current = !1;
|
|
85
84
|
};
|
|
86
|
-
return
|
|
87
|
-
/* @__PURE__ */
|
|
85
|
+
return l ? K(
|
|
86
|
+
/* @__PURE__ */ c(
|
|
88
87
|
"div",
|
|
89
88
|
{
|
|
90
|
-
className:
|
|
89
|
+
className: d(
|
|
91
90
|
t.backdrop,
|
|
92
|
-
|
|
91
|
+
D && t.backdropClosing,
|
|
93
92
|
!b && t.backdropBare,
|
|
94
|
-
|
|
93
|
+
y?.backdrop
|
|
95
94
|
),
|
|
96
|
-
onMouseDown:
|
|
97
|
-
onMouseUp:
|
|
95
|
+
onMouseDown: U,
|
|
96
|
+
onMouseUp: W,
|
|
98
97
|
role: "presentation",
|
|
99
|
-
children: /* @__PURE__ */
|
|
98
|
+
children: /* @__PURE__ */ c(
|
|
100
99
|
"div",
|
|
101
100
|
{
|
|
102
|
-
ref:
|
|
103
|
-
className:
|
|
101
|
+
ref: F,
|
|
102
|
+
className: d(
|
|
104
103
|
t.drawer,
|
|
105
|
-
t[`side_${
|
|
106
|
-
t[`size_${
|
|
107
|
-
t[`${
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
t[`side_${S}`],
|
|
105
|
+
t[`size_${P}`],
|
|
106
|
+
t[`${D ? "slideOut" : "slideIn"}_${S}`],
|
|
107
|
+
y?.drawer,
|
|
108
|
+
_
|
|
110
109
|
),
|
|
111
|
-
style:
|
|
110
|
+
style: $,
|
|
112
111
|
role: "dialog",
|
|
113
112
|
"aria-modal": b ? "true" : void 0,
|
|
114
|
-
"aria-label":
|
|
115
|
-
"aria-labelledby":
|
|
116
|
-
children: /* @__PURE__ */
|
|
113
|
+
"aria-label": N,
|
|
114
|
+
"aria-labelledby": N ? void 0 : g,
|
|
115
|
+
children: /* @__PURE__ */ c(m.Provider, { value: { classes: y ?? {}, titleId: g }, children: /* @__PURE__ */ c(X, { value: L, children: A }) })
|
|
117
116
|
}
|
|
118
117
|
)
|
|
119
118
|
}
|
|
@@ -123,9 +122,9 @@ const Z = 340, f = q(
|
|
|
123
122
|
}
|
|
124
123
|
);
|
|
125
124
|
f.displayName = "Drawer";
|
|
126
|
-
f.Header =
|
|
125
|
+
f.Header = x;
|
|
127
126
|
f.Body = R;
|
|
128
|
-
f.Footer =
|
|
127
|
+
f.Footer = M;
|
|
129
128
|
export {
|
|
130
129
|
f as Drawer
|
|
131
130
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { createPortal as
|
|
1
|
+
import { jsx as d, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as J, useState as K, useRef as v, useId as Q, useEffect as S, useCallback as b } from "react";
|
|
3
|
+
import { createPortal as T } from "react-dom";
|
|
4
4
|
import o from "clsx";
|
|
5
5
|
import t from "./Dropdown.module.scss.js";
|
|
6
|
-
import {
|
|
7
|
-
import { usePortalPosition as
|
|
8
|
-
const
|
|
6
|
+
import { useEscapeLayer as U, EscapeLayerProvider as V } from "../../hooks/useEscapeLayer.js";
|
|
7
|
+
import { usePortalPosition as X } from "../../hooks/usePortalPosition.js";
|
|
8
|
+
const Y = J(
|
|
9
9
|
({
|
|
10
10
|
trigger: k,
|
|
11
11
|
children: D,
|
|
@@ -14,47 +14,42 @@ const V = G(
|
|
|
14
14
|
style: z,
|
|
15
15
|
id: O,
|
|
16
16
|
onOpen: y,
|
|
17
|
-
onClose:
|
|
17
|
+
onClose: s,
|
|
18
18
|
options: i,
|
|
19
19
|
placeholder: W = "Select...",
|
|
20
|
-
value:
|
|
21
|
-
onChange:
|
|
20
|
+
value: L,
|
|
21
|
+
onChange: w,
|
|
22
22
|
error: q = !1,
|
|
23
|
-
fullWidth:
|
|
23
|
+
fullWidth: a = !0,
|
|
24
24
|
portal: u = !0,
|
|
25
25
|
classes: n
|
|
26
|
-
},
|
|
27
|
-
const [r,
|
|
26
|
+
}, M) => {
|
|
27
|
+
const [r, x] = K(!1), E = v(null), m = v(null), h = v(null), N = Q();
|
|
28
28
|
S(() => {
|
|
29
|
-
r &&
|
|
29
|
+
r && m.current && m.current.querySelector('[role="menuitem"]:not(:disabled)')?.focus();
|
|
30
30
|
}, [r]);
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
}, [
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
return
|
|
31
|
+
const c = b(() => {
|
|
32
|
+
x(!1), s?.(), h.current?.focus();
|
|
33
|
+
}, [s]), A = b(() => {
|
|
34
|
+
x((e) => {
|
|
35
|
+
const f = !e;
|
|
36
|
+
return f ? y?.() : s?.(), f;
|
|
37
37
|
});
|
|
38
|
-
}, [y,
|
|
38
|
+
}, [y, s]), B = b(
|
|
39
39
|
(e) => {
|
|
40
|
-
|
|
40
|
+
w?.(e), c();
|
|
41
41
|
},
|
|
42
|
-
[
|
|
42
|
+
[w, c]
|
|
43
43
|
);
|
|
44
44
|
S(() => {
|
|
45
45
|
if (!r) return;
|
|
46
|
-
const e = (
|
|
47
|
-
const
|
|
48
|
-
E.current?.contains(
|
|
46
|
+
const e = (f) => {
|
|
47
|
+
const R = f.target;
|
|
48
|
+
E.current?.contains(R) || m.current?.contains(R) || c();
|
|
49
49
|
};
|
|
50
50
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
51
|
-
}, [r,
|
|
52
|
-
|
|
53
|
-
Escape: () => l()
|
|
54
|
-
},
|
|
55
|
-
r
|
|
56
|
-
);
|
|
57
|
-
const d = U(h, r && u), L = i?.find((e) => e.value === w)?.label, B = i ? L || W : k, C = i && !L, F = i ? i.map((e) => /* @__PURE__ */ f(
|
|
51
|
+
}, [r, c]);
|
|
52
|
+
const C = U(c, r), l = X(h, r && u), I = i?.find((e) => e.value === L)?.label, F = i ? I || W : k, G = i && !I, H = i ? i.map((e) => /* @__PURE__ */ d(
|
|
58
53
|
"button",
|
|
59
54
|
{
|
|
60
55
|
type: "button",
|
|
@@ -62,39 +57,39 @@ const V = G(
|
|
|
62
57
|
className: o(
|
|
63
58
|
t.item,
|
|
64
59
|
e.disabled && t.itemDisabled,
|
|
65
|
-
e.value ===
|
|
60
|
+
e.value === L && t.itemSelected,
|
|
66
61
|
n?.item
|
|
67
62
|
),
|
|
68
63
|
disabled: e.disabled,
|
|
69
|
-
onClick: () =>
|
|
64
|
+
onClick: () => B(e.value),
|
|
70
65
|
children: e.label
|
|
71
66
|
},
|
|
72
67
|
e.value
|
|
73
|
-
)) : D,
|
|
68
|
+
)) : D, P = (e) => /* @__PURE__ */ d(
|
|
74
69
|
"div",
|
|
75
70
|
{
|
|
76
|
-
ref:
|
|
77
|
-
id:
|
|
71
|
+
ref: m,
|
|
72
|
+
id: N,
|
|
78
73
|
className: o(
|
|
79
74
|
t.menu,
|
|
80
75
|
r && t.menuOpen,
|
|
81
76
|
g === "left" ? t.alignLeft : t.alignRight,
|
|
82
|
-
!u &&
|
|
77
|
+
!u && a && t.fullWidth,
|
|
83
78
|
n?.menu
|
|
84
79
|
),
|
|
85
80
|
style: e,
|
|
86
81
|
role: "menu",
|
|
87
|
-
children:
|
|
82
|
+
children: /* @__PURE__ */ d(V, { value: C, children: H })
|
|
88
83
|
}
|
|
89
84
|
);
|
|
90
85
|
return /* @__PURE__ */ p(
|
|
91
86
|
"div",
|
|
92
87
|
{
|
|
93
|
-
ref:
|
|
94
|
-
className: o(t.root,
|
|
88
|
+
ref: M,
|
|
89
|
+
className: o(t.root, a && t.fullWidth, n?.root, j),
|
|
95
90
|
style: z,
|
|
96
91
|
children: [
|
|
97
|
-
/* @__PURE__ */ p("div", { ref: E, style:
|
|
92
|
+
/* @__PURE__ */ p("div", { ref: E, style: a ? { width: "100%" } : void 0, children: [
|
|
98
93
|
/* @__PURE__ */ p(
|
|
99
94
|
"button",
|
|
100
95
|
{
|
|
@@ -105,32 +100,32 @@ const V = G(
|
|
|
105
100
|
t.trigger,
|
|
106
101
|
r && t.triggerOpen,
|
|
107
102
|
q && t.triggerError,
|
|
108
|
-
|
|
103
|
+
a && t.fullWidth,
|
|
109
104
|
n?.trigger
|
|
110
105
|
),
|
|
111
|
-
onClick:
|
|
106
|
+
onClick: A,
|
|
112
107
|
"aria-expanded": r,
|
|
113
108
|
"aria-haspopup": "menu",
|
|
114
|
-
"aria-controls": r ?
|
|
109
|
+
"aria-controls": r ? N : void 0,
|
|
115
110
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ d("span", { className: o(t.triggerLabel, G && t.placeholder, n?.triggerLabel), children: F }),
|
|
112
|
+
/* @__PURE__ */ d("span", { className: o(t.chevron, n?.chevron), "aria-hidden": "true" })
|
|
118
113
|
]
|
|
119
114
|
}
|
|
120
115
|
),
|
|
121
|
-
!u &&
|
|
116
|
+
!u && P()
|
|
122
117
|
] }),
|
|
123
|
-
u && r && typeof document < "u" &&
|
|
124
|
-
|
|
118
|
+
u && r && typeof document < "u" && T(
|
|
119
|
+
P({
|
|
125
120
|
position: "fixed",
|
|
126
|
-
top:
|
|
127
|
-
left: g === "right" ? void 0 :
|
|
121
|
+
top: l.top + 4,
|
|
122
|
+
left: g === "right" ? void 0 : l.left,
|
|
128
123
|
// clientWidth, not innerWidth: `right` on a fixed element is
|
|
129
124
|
// measured from the viewport edge inside the scrollbar, while
|
|
130
125
|
// innerWidth includes it — the menu would shift left by the
|
|
131
126
|
// scrollbar width whenever the page scrolls.
|
|
132
|
-
right: g === "right" ? document.documentElement.clientWidth - (
|
|
133
|
-
minWidth:
|
|
127
|
+
right: g === "right" ? document.documentElement.clientWidth - (l.left + l.width) : void 0,
|
|
128
|
+
minWidth: l.width,
|
|
134
129
|
zIndex: "var(--crk-z-floating)"
|
|
135
130
|
}),
|
|
136
131
|
document.body
|
|
@@ -140,7 +135,7 @@ const V = G(
|
|
|
140
135
|
);
|
|
141
136
|
}
|
|
142
137
|
);
|
|
143
|
-
|
|
138
|
+
Y.displayName = "Dropdown";
|
|
144
139
|
export {
|
|
145
|
-
|
|
140
|
+
Y as Dropdown
|
|
146
141
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { createPortal as
|
|
1
|
+
import { jsx as l, jsxs as E } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as H, useRef as h, useId as P, useEffect as j, createContext as D, useContext as p } from "react";
|
|
3
|
+
import { createPortal as L } from "react-dom";
|
|
4
4
|
import d from "clsx";
|
|
5
5
|
import { useFocusTrap as O } from "../../hooks/useFocusTrap.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useEscapeLayer as U, EscapeLayerProvider as S } from "../../hooks/useEscapeLayer.js";
|
|
7
7
|
import a from "./Modal.module.scss.js";
|
|
8
|
-
const u =
|
|
9
|
-
const { classes: n, titleId: c } =
|
|
10
|
-
return /* @__PURE__ */
|
|
8
|
+
const u = D({ classes: {}, titleId: "" }), M = ({ children: e, className: t, style: s, onClose: r }) => {
|
|
9
|
+
const { classes: n, titleId: c } = p(u);
|
|
10
|
+
return /* @__PURE__ */ E(
|
|
11
11
|
"div",
|
|
12
12
|
{
|
|
13
13
|
id: c,
|
|
14
|
-
className: d(a.header,
|
|
14
|
+
className: d(a.header, r && a.headerWithClose, n.header, t),
|
|
15
15
|
style: s,
|
|
16
16
|
children: [
|
|
17
17
|
e,
|
|
18
|
-
|
|
18
|
+
r && /* @__PURE__ */ l(
|
|
19
19
|
"button",
|
|
20
20
|
{
|
|
21
21
|
type: "button",
|
|
22
22
|
className: d(a.closeButton, n.closeButton),
|
|
23
|
-
onClick:
|
|
23
|
+
onClick: r,
|
|
24
24
|
"aria-label": "Close",
|
|
25
25
|
children: "×"
|
|
26
26
|
}
|
|
@@ -30,73 +30,68 @@ const u = E({ classes: {}, titleId: "" }), M = ({ children: e, className: r, sty
|
|
|
30
30
|
);
|
|
31
31
|
};
|
|
32
32
|
M.displayName = "Modal.Header";
|
|
33
|
-
const N = ({ children: e, className:
|
|
34
|
-
const { classes:
|
|
35
|
-
return /* @__PURE__ */ l("div", { className: d(a.body,
|
|
33
|
+
const N = ({ children: e, className: t, style: s }) => {
|
|
34
|
+
const { classes: r } = p(u);
|
|
35
|
+
return /* @__PURE__ */ l("div", { className: d(a.body, r.body, t), style: s, children: e });
|
|
36
36
|
};
|
|
37
37
|
N.displayName = "Modal.Body";
|
|
38
|
-
const B = ({ children: e, className:
|
|
39
|
-
const { classes:
|
|
40
|
-
return /* @__PURE__ */ l("div", { className: d(a.footer,
|
|
38
|
+
const B = ({ children: e, className: t, style: s }) => {
|
|
39
|
+
const { classes: r } = p(u);
|
|
40
|
+
return /* @__PURE__ */ l("div", { className: d(a.footer, r.footer, t), style: s, children: e });
|
|
41
41
|
};
|
|
42
42
|
B.displayName = "Modal.Footer";
|
|
43
|
-
const m =
|
|
43
|
+
const m = H(
|
|
44
44
|
({
|
|
45
45
|
open: e,
|
|
46
|
-
onClose:
|
|
46
|
+
onClose: t,
|
|
47
47
|
closeOnBackdrop: s = !0,
|
|
48
|
-
closeOnEscape:
|
|
48
|
+
closeOnEscape: r = !0,
|
|
49
49
|
size: n = "md",
|
|
50
50
|
classes: c,
|
|
51
|
-
className:
|
|
52
|
-
style:
|
|
53
|
-
children:
|
|
54
|
-
"aria-label":
|
|
55
|
-
"aria-labelledby":
|
|
51
|
+
className: w,
|
|
52
|
+
style: x,
|
|
53
|
+
children: k,
|
|
54
|
+
"aria-label": y,
|
|
55
|
+
"aria-labelledby": C
|
|
56
56
|
}, i) => {
|
|
57
|
-
const b =
|
|
57
|
+
const b = h(null), g = (o) => {
|
|
58
58
|
b.current = o, typeof i == "function" ? i(o) : i && (i.current = o);
|
|
59
|
-
}, I =
|
|
59
|
+
}, I = P(), v = C ?? `${I}-title`;
|
|
60
60
|
O(b, e);
|
|
61
|
-
const F =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
}),
|
|
67
|
-
[t, r]
|
|
68
|
-
);
|
|
69
|
-
S(F, e), U(() => {
|
|
61
|
+
const F = U(() => {
|
|
62
|
+
r && t();
|
|
63
|
+
}, e);
|
|
64
|
+
j(() => {
|
|
70
65
|
if (!e) return;
|
|
71
66
|
const o = document.body.style.overflow;
|
|
72
67
|
return document.body.style.overflow = "hidden", () => {
|
|
73
68
|
document.body.style.overflow = o;
|
|
74
69
|
};
|
|
75
70
|
}, [e]);
|
|
76
|
-
const f =
|
|
71
|
+
const f = h(!1), R = (o) => {
|
|
77
72
|
f.current = o.target === o.currentTarget;
|
|
78
|
-
},
|
|
79
|
-
s && f.current && o.target === o.currentTarget &&
|
|
73
|
+
}, T = (o) => {
|
|
74
|
+
s && f.current && o.target === o.currentTarget && t(), f.current = !1;
|
|
80
75
|
};
|
|
81
|
-
return e ?
|
|
76
|
+
return e ? L(
|
|
82
77
|
/* @__PURE__ */ l(
|
|
83
78
|
"div",
|
|
84
79
|
{
|
|
85
80
|
className: d(a.backdrop, c?.backdrop),
|
|
86
|
-
onMouseDown:
|
|
87
|
-
onMouseUp:
|
|
81
|
+
onMouseDown: R,
|
|
82
|
+
onMouseUp: T,
|
|
88
83
|
role: "presentation",
|
|
89
84
|
children: /* @__PURE__ */ l(
|
|
90
85
|
"div",
|
|
91
86
|
{
|
|
92
|
-
ref:
|
|
93
|
-
className: d(a.modal, a[n], c?.modal,
|
|
94
|
-
style:
|
|
87
|
+
ref: g,
|
|
88
|
+
className: d(a.modal, a[n], c?.modal, w),
|
|
89
|
+
style: x,
|
|
95
90
|
role: "dialog",
|
|
96
91
|
"aria-modal": "true",
|
|
97
|
-
"aria-label":
|
|
98
|
-
"aria-labelledby":
|
|
99
|
-
children: /* @__PURE__ */ l(u.Provider, { value: { classes: c ?? {}, titleId:
|
|
92
|
+
"aria-label": y,
|
|
93
|
+
"aria-labelledby": y ? void 0 : v,
|
|
94
|
+
children: /* @__PURE__ */ l(u.Provider, { value: { classes: c ?? {}, titleId: v }, children: /* @__PURE__ */ l(S, { value: F, children: k }) })
|
|
100
95
|
}
|
|
101
96
|
)
|
|
102
97
|
}
|