@pismo/marola 1.0.0-beta.49 → 1.0.0-beta.5
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/{Button-BAljjMv3.js → Button-2b1peDFT.js} +2 -2
- package/dist/{ClickAwayListener-DbEYZpyh.js → ClickAwayListener-BSW-Nd-y.js} +3 -4
- package/dist/Dialog.module-DFEmFdYT.js +30 -0
- package/dist/Group-B3p31ftp.js +26 -0
- package/dist/{Popup-Ck3XlWMq.js → Popup-B6ZSGIEI.js} +3 -3
- package/dist/{Portal-oY3enyAm.js → Portal-DIeBsWdL.js} +2 -2
- package/dist/SelectButton-K3OIfR5m.js +61 -0
- package/dist/{Tabs.module-BGGTkDc5.js → Tabs.module-jkH1Qjn7.js} +7 -7
- package/dist/Toggle-BCgIItCc.js +142 -0
- package/dist/assets/Advice.css +1 -1
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Checkbox.css +1 -1
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/EllipsisTooltip.css +1 -1
- package/dist/assets/Group.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/PageHeader.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/SelectButton.css +1 -1
- package/dist/assets/Skeleton.css +1 -1
- package/dist/assets/Snackbar.css +1 -1
- package/dist/assets/SortTooltip.css +1 -1
- package/dist/assets/Stepper.css +1 -1
- package/dist/assets/Table.css +1 -1
- package/dist/assets/Tabs.css +1 -1
- package/dist/assets/TextDisplay.css +1 -1
- package/dist/assets/Toggle.css +1 -1
- package/dist/assets/Toggle2.css +1 -1
- package/dist/assets/Typography.css +1 -1
- package/dist/{combineHooksSlotProps-C-zYvfnF.js → combineHooksSlotProps-DVjg9PRh.js} +1 -1
- package/dist/components/Advice/Advice.d.ts +17 -32
- package/dist/components/Advice/Advice.js +40 -39
- package/dist/components/Advice/Advice.stories.d.ts +3 -4
- package/dist/components/Button/Button.d.ts +0 -2
- package/dist/components/Button/Button.js +49 -51
- package/dist/components/Checkbox/Checkbox.js +52 -52
- package/dist/components/Chip/Chip.d.ts +12 -6
- package/dist/components/Chip/Chip.js +6 -9
- package/dist/components/Chip/Chip.stories.d.ts +14 -5
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +3 -3
- package/dist/components/Dialog/Backdrop.js +7 -8
- package/dist/components/Dialog/CloseIconButton.d.ts +2 -1
- package/dist/components/Dialog/CloseIconButton.js +18 -15
- package/dist/components/Dialog/Dialog.d.ts +6 -9
- package/dist/components/Dialog/Dialog.js +139 -139
- package/dist/components/Dialog/Dialog.stories.d.ts +46 -50
- package/dist/components/Dialog/DialogTitle.js +1 -1
- package/dist/components/EllipsisTooltip/EllipsisTooltip.js +17 -30
- package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +1 -2
- package/dist/components/Icon/Icon.js +52 -177
- package/dist/components/Icon/types.d.ts +1 -1
- package/dist/components/IconButton/IconButton.js +42 -42
- package/dist/components/Input/Input.d.ts +5 -24
- package/dist/components/Input/Input.js +292 -301
- package/dist/components/Input/Input.stories.d.ts +21 -2
- package/dist/components/InputSearch/InputSearch.stories.d.ts +21 -1
- package/dist/components/PageHeader/PageHeader.js +57 -57
- package/dist/components/Pagination/Pagination.d.ts +1 -5
- package/dist/components/Pagination/Pagination.js +185 -87
- package/dist/components/Pagination/Pagination.stories.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +0 -21
- package/dist/components/Select/Select.js +413 -476
- package/dist/components/Select/SelectButton.d.ts +0 -2
- package/dist/components/Select/SelectButton.js +2 -3
- package/dist/components/Skeleton/Skeleton.d.ts +1 -3
- package/dist/components/Skeleton/Skeleton.js +14 -20
- package/dist/components/Skeleton/SkeletonTable.stories.d.ts +1 -1
- package/dist/components/Snackbar/Snackbar.js +94 -94
- package/dist/components/Snackbar/Snackbar.stories.d.ts +3 -3
- package/dist/components/SortTooltip/SortTooltip.js +46 -46
- package/dist/components/Stepper/Stepper.js +35 -35
- package/dist/components/Table/Table.d.ts +1 -3
- package/dist/components/Table/Table.js +99 -87
- package/dist/components/Table/Table.stories.d.ts +1 -1
- package/dist/components/Tabs/Tab.d.ts +3 -5
- package/dist/components/Tabs/Tab.js +36 -38
- package/dist/components/Tabs/TabPanel.d.ts +2 -4
- package/dist/components/Tabs/TabPanel.js +40 -51
- package/dist/components/Tabs/Tabs.d.ts +4 -6
- package/dist/components/Tabs/Tabs.js +128 -131
- package/dist/components/TextDisplay/TextDisplay.d.ts +3 -9
- package/dist/components/TextDisplay/TextDisplay.js +31 -45
- package/dist/components/TextDisplay/TextDisplay.stories.d.ts +1 -2
- package/dist/components/Toggle/Toggle.js +56 -56
- package/dist/components/ToggleGroup/Group.d.ts +0 -2
- package/dist/components/ToggleGroup/Group.js +2 -4
- package/dist/components/ToggleGroup/Toggle.d.ts +0 -2
- package/dist/components/ToggleGroup/Toggle.js +5 -7
- package/dist/components/ToggleGroup/ToggleGroup.js +2 -2
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +0 -2
- package/dist/components/Tooltip/Tooltip.d.ts +1 -3
- package/dist/components/Tooltip/Tooltip.js +4 -4
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -1
- package/dist/components/Typography/Typography.js +47 -47
- package/dist/{useSlotProps-C_I1kEHr.js → index-CH45lKw7.js} +99 -99
- package/dist/{index-bQFToy-I.js → index-CjW42-M-.js} +1 -1
- package/dist/main.d.ts +0 -6
- package/dist/main.js +76 -87
- package/dist/{useButton-DcihopJG.js → useButton-DNk3wrQp.js} +1 -1
- package/dist/useCompoundItem-D1iRfg8D.js +84 -0
- package/dist/useEventCallback-xTG9piMa.js +45 -0
- package/dist/{useList-B9C55YB7.js → useList-B0hog_3-.js} +2 -2
- package/package.json +12 -21
- package/dist/Dialog.module-D9e4RsKo.js +0 -30
- package/dist/Group-DspH8hyO.js +0 -30
- package/dist/Popover.module-B4boCutS.js +0 -10
- package/dist/SelectButton-B38avP9u.js +0 -75
- package/dist/Toggle-BbmXeuJd.js +0 -188
- package/dist/assets/Adornment.css +0 -1
- package/dist/assets/Autocomplete.css +0 -1
- package/dist/assets/Popover.css +0 -1
- package/dist/assets/ResultWithChips.css +0 -1
- package/dist/assets/StepperNavigator.css +0 -1
- package/dist/components/Adornment/Adornment.d.ts +0 -20
- package/dist/components/Adornment/Adornment.js +0 -13
- package/dist/components/Adornment/Adornment.stories.d.ts +0 -14
- package/dist/components/Adornment/adornment.test.d.ts +0 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts +0 -20
- package/dist/components/Autocomplete/Autocomplete.js +0 -679
- package/dist/components/Autocomplete/Autocomplete.stories.d.ts +0 -23
- package/dist/components/Pagination/usePagination.d.ts +0 -90
- package/dist/components/Pagination/usePagination.js +0 -79
- package/dist/components/Popover/Popover.d.ts +0 -32
- package/dist/components/Popover/Popover.js +0 -24
- package/dist/components/Popover/Popover.stories.d.ts +0 -34
- package/dist/components/Popover/PopoverBody.d.ts +0 -6
- package/dist/components/Popover/PopoverBody.js +0 -6
- package/dist/components/Popover/PopoverFooter.d.ts +0 -6
- package/dist/components/Popover/PopoverFooter.js +0 -6
- package/dist/components/Popover/PopoverHeader.d.ts +0 -6
- package/dist/components/Popover/PopoverHeader.js +0 -6
- package/dist/components/ResultWithChips/ResultWithChips.d.ts +0 -12
- package/dist/components/ResultWithChips/ResultWithChips.js +0 -33
- package/dist/components/RowItem/RowItem.d.ts +0 -25
- package/dist/components/RowItem/RowItem.js +0 -21
- package/dist/components/RowItem/RowItem.stories.d.ts +0 -17
- package/dist/components/RowItem/rowItem.test.d.ts +0 -1
- package/dist/components/StepperNavigator/StepperNavigator.d.ts +0 -58
- package/dist/components/StepperNavigator/StepperNavigator.js +0 -115
- package/dist/components/StepperNavigator/StepperNavigator.stories.d.ts +0 -18
- package/dist/components/StepperNavigator/StepperNavigator.test.d.ts +0 -1
- package/dist/ownerDocument-YGhwAnr1.js +0 -33
- package/dist/useCompoundItem-B7Eo_qZk.js +0 -68
- package/dist/useEventCallback-BAQJJ3ye.js +0 -14
- package/dist/useId-BW-oWmul.js +0 -19
|
@@ -1,75 +1,73 @@
|
|
|
1
1
|
import { jsxs as $, jsx as S } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { u as te, P as i, f as de, b as C, g as ue, a as fe, _ as pe, c as G, d as be, e as he } from "../../useSlotProps-C_I1kEHr.js";
|
|
2
|
+
import { default as $e } from "./Actions.js";
|
|
3
|
+
import oe from "./Backdrop.js";
|
|
4
|
+
import re from "./CloseIconButton.js";
|
|
5
|
+
import { default as ze } from "./Content.js";
|
|
6
|
+
import { s as q } from "../../Dialog.module-DFEmFdYT.js";
|
|
7
|
+
import se from "./DialogTitle.js";
|
|
8
|
+
import { u as Z, P as i, f as ie, b as C, g as ae, a as le, _ as ce, c as z, d as de, e as ue } from "../../index-CH45lKw7.js";
|
|
10
9
|
import * as f from "react";
|
|
11
|
-
import { o as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
function J(...e) {
|
|
10
|
+
import { o as w, e as ee, u as G } from "../../useEventCallback-xTG9piMa.js";
|
|
11
|
+
import { P as fe, H as pe } from "../../Portal-DIeBsWdL.js";
|
|
12
|
+
import { e as be } from "../../index-CjW42-M-.js";
|
|
13
|
+
function X(...e) {
|
|
16
14
|
return e.reduce((t, o) => o == null ? t : function(...s) {
|
|
17
15
|
t.apply(this, s), o.apply(this, s);
|
|
18
16
|
}, () => {
|
|
19
17
|
});
|
|
20
18
|
}
|
|
21
19
|
function Y(e) {
|
|
22
|
-
return
|
|
20
|
+
return w(e).defaultView || window;
|
|
23
21
|
}
|
|
24
|
-
function
|
|
22
|
+
function he(e) {
|
|
25
23
|
const t = e.documentElement.clientWidth;
|
|
26
24
|
return Math.abs(window.innerWidth - t);
|
|
27
25
|
}
|
|
28
|
-
const
|
|
29
|
-
function
|
|
26
|
+
const me = ["input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])'].join(",");
|
|
27
|
+
function ge(e) {
|
|
30
28
|
const t = parseInt(e.getAttribute("tabindex") || "", 10);
|
|
31
29
|
return Number.isNaN(t) ? e.contentEditable === "true" || (e.nodeName === "AUDIO" || e.nodeName === "VIDEO" || e.nodeName === "DETAILS") && e.getAttribute("tabindex") === null ? 0 : e.tabIndex : t;
|
|
32
30
|
}
|
|
33
|
-
function
|
|
31
|
+
function Ee(e) {
|
|
34
32
|
if (e.tagName !== "INPUT" || e.type !== "radio" || !e.name)
|
|
35
33
|
return !1;
|
|
36
34
|
const t = (n) => e.ownerDocument.querySelector(`input[type="radio"]${n}`);
|
|
37
35
|
let o = t(`[name="${e.name}"]:checked`);
|
|
38
36
|
return o || (o = t(`[name="${e.name}"]`)), o !== e;
|
|
39
37
|
}
|
|
40
|
-
function
|
|
41
|
-
return !(e.disabled || e.tagName === "INPUT" && e.type === "hidden" ||
|
|
38
|
+
function Te(e) {
|
|
39
|
+
return !(e.disabled || e.tagName === "INPUT" && e.type === "hidden" || Ee(e));
|
|
42
40
|
}
|
|
43
|
-
function
|
|
41
|
+
function ye(e) {
|
|
44
42
|
const t = [], o = [];
|
|
45
|
-
return Array.from(e.querySelectorAll(
|
|
46
|
-
const r =
|
|
47
|
-
r === -1 || !
|
|
43
|
+
return Array.from(e.querySelectorAll(me)).forEach((n, s) => {
|
|
44
|
+
const r = ge(n);
|
|
45
|
+
r === -1 || !Te(n) || (r === 0 ? t.push(n) : o.push({
|
|
48
46
|
documentOrder: s,
|
|
49
47
|
tabIndex: r,
|
|
50
48
|
node: n
|
|
51
49
|
}));
|
|
52
50
|
}), o.sort((n, s) => n.tabIndex === s.tabIndex ? n.documentOrder - s.documentOrder : n.tabIndex - s.tabIndex).map((n) => n.node).concat(t);
|
|
53
51
|
}
|
|
54
|
-
function
|
|
52
|
+
function xe() {
|
|
55
53
|
return !0;
|
|
56
54
|
}
|
|
57
|
-
function
|
|
55
|
+
function W(e) {
|
|
58
56
|
const {
|
|
59
57
|
children: t,
|
|
60
58
|
disableAutoFocus: o = !1,
|
|
61
59
|
disableEnforceFocus: n = !1,
|
|
62
60
|
disableRestoreFocus: s = !1,
|
|
63
|
-
getTabbable: r =
|
|
64
|
-
isEnabled: a =
|
|
61
|
+
getTabbable: r = ye,
|
|
62
|
+
isEnabled: a = xe,
|
|
65
63
|
open: d
|
|
66
|
-
} = e, p = f.useRef(!1), x = f.useRef(null), h = f.useRef(null), m = f.useRef(null), R = f.useRef(null), g = f.useRef(!1), c = f.useRef(null),
|
|
64
|
+
} = e, p = f.useRef(!1), x = f.useRef(null), h = f.useRef(null), m = f.useRef(null), R = f.useRef(null), g = f.useRef(!1), c = f.useRef(null), O = Z(t.ref, c), I = f.useRef(null);
|
|
67
65
|
f.useEffect(() => {
|
|
68
66
|
!d || !c.current || (g.current = !o);
|
|
69
67
|
}, [o, d]), f.useEffect(() => {
|
|
70
68
|
if (!d || !c.current)
|
|
71
69
|
return;
|
|
72
|
-
const l =
|
|
70
|
+
const l = w(c.current);
|
|
73
71
|
return c.current.contains(l.activeElement) || (c.current.hasAttribute("tabIndex") || (process.env.NODE_ENV !== "production" && console.error(["MUI: The modal content node does not accept focus.", 'For the benefit of assistive technologies, the tabIndex of the node is being set to "-1".'].join(`
|
|
74
72
|
`)), c.current.setAttribute("tabIndex", "-1")), g.current && c.current.focus()), () => {
|
|
75
73
|
s || (m.current && m.current.focus && (p.current = !0, m.current.focus()), m.current = null);
|
|
@@ -77,7 +75,7 @@ function j(e) {
|
|
|
77
75
|
}, [d]), f.useEffect(() => {
|
|
78
76
|
if (!d || !c.current)
|
|
79
77
|
return;
|
|
80
|
-
const l =
|
|
78
|
+
const l = w(c.current), v = (E) => {
|
|
81
79
|
I.current = E, !(n || !a() || E.key !== "Tab") && l.activeElement === c.current && E.shiftKey && (p.current = !0, h.current && h.current.focus());
|
|
82
80
|
}, k = () => {
|
|
83
81
|
const E = c.current;
|
|
@@ -98,20 +96,20 @@ function j(e) {
|
|
|
98
96
|
let T = [];
|
|
99
97
|
if ((l.activeElement === x.current || l.activeElement === h.current) && (T = r(c.current)), T.length > 0) {
|
|
100
98
|
var L, y;
|
|
101
|
-
const
|
|
102
|
-
typeof F != "string" && typeof H != "string" && (
|
|
99
|
+
const M = !!((L = I.current) != null && L.shiftKey && ((y = I.current) == null ? void 0 : y.key) === "Tab"), F = T[0], H = T[T.length - 1];
|
|
100
|
+
typeof F != "string" && typeof H != "string" && (M ? H.focus() : F.focus());
|
|
103
101
|
} else
|
|
104
102
|
E.focus();
|
|
105
103
|
};
|
|
106
104
|
l.addEventListener("focusin", k), l.addEventListener("keydown", v, !0);
|
|
107
|
-
const
|
|
105
|
+
const D = setInterval(() => {
|
|
108
106
|
l.activeElement && l.activeElement.tagName === "BODY" && k();
|
|
109
107
|
}, 50);
|
|
110
108
|
return () => {
|
|
111
|
-
clearInterval(
|
|
109
|
+
clearInterval(D), l.removeEventListener("focusin", k), l.removeEventListener("keydown", v, !0);
|
|
112
110
|
};
|
|
113
111
|
}, [o, n, s, a, d, r]);
|
|
114
|
-
const
|
|
112
|
+
const A = (l) => {
|
|
115
113
|
m.current === null && (m.current = l.relatedTarget), g.current = !0, R.current = l.target;
|
|
116
114
|
const v = t.props.onFocus;
|
|
117
115
|
v && v(l);
|
|
@@ -125,8 +123,8 @@ function j(e) {
|
|
|
125
123
|
ref: x,
|
|
126
124
|
"data-testid": "sentinelStart"
|
|
127
125
|
}), /* @__PURE__ */ f.cloneElement(t, {
|
|
128
|
-
ref:
|
|
129
|
-
onFocus:
|
|
126
|
+
ref: O,
|
|
127
|
+
onFocus: A
|
|
130
128
|
}), /* @__PURE__ */ S("div", {
|
|
131
129
|
tabIndex: d ? 0 : -1,
|
|
132
130
|
onFocus: N,
|
|
@@ -135,7 +133,7 @@ function j(e) {
|
|
|
135
133
|
})]
|
|
136
134
|
});
|
|
137
135
|
}
|
|
138
|
-
process.env.NODE_ENV !== "production" && (
|
|
136
|
+
process.env.NODE_ENV !== "production" && (W.propTypes = {
|
|
139
137
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
140
138
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
141
139
|
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
@@ -143,7 +141,7 @@ process.env.NODE_ENV !== "production" && (j.propTypes = {
|
|
|
143
141
|
/**
|
|
144
142
|
* A single child content element.
|
|
145
143
|
*/
|
|
146
|
-
children:
|
|
144
|
+
children: ee,
|
|
147
145
|
/**
|
|
148
146
|
* If `true`, the focus trap will not automatically shift focus to itself when it opens, and
|
|
149
147
|
* replace it to the last focused element when it closes.
|
|
@@ -189,54 +187,54 @@ process.env.NODE_ENV !== "production" && (j.propTypes = {
|
|
|
189
187
|
*/
|
|
190
188
|
open: i.bool.isRequired
|
|
191
189
|
});
|
|
192
|
-
process.env.NODE_ENV !== "production" && (
|
|
193
|
-
function
|
|
194
|
-
const t =
|
|
190
|
+
process.env.NODE_ENV !== "production" && (W.propTypes = be(W.propTypes));
|
|
191
|
+
function Re(e) {
|
|
192
|
+
const t = w(e);
|
|
195
193
|
return t.body === e ? Y(e).innerWidth > t.documentElement.clientWidth : e.scrollHeight > e.clientHeight;
|
|
196
194
|
}
|
|
197
|
-
function
|
|
195
|
+
function K(e, t) {
|
|
198
196
|
t ? e.setAttribute("aria-hidden", "true") : e.removeAttribute("aria-hidden");
|
|
199
197
|
}
|
|
200
|
-
function
|
|
198
|
+
function J(e) {
|
|
201
199
|
return parseInt(Y(e).getComputedStyle(e).paddingRight, 10) || 0;
|
|
202
200
|
}
|
|
203
|
-
function
|
|
201
|
+
function ve(e) {
|
|
204
202
|
const o = ["TEMPLATE", "SCRIPT", "STYLE", "LINK", "MAP", "META", "NOSCRIPT", "PICTURE", "COL", "COLGROUP", "PARAM", "SLOT", "SOURCE", "TRACK"].indexOf(e.tagName) !== -1, n = e.tagName === "INPUT" && e.getAttribute("type") === "hidden";
|
|
205
203
|
return o || n;
|
|
206
204
|
}
|
|
207
|
-
function
|
|
205
|
+
function Q(e, t, o, n, s) {
|
|
208
206
|
const r = [t, o, ...n];
|
|
209
207
|
[].forEach.call(e.children, (a) => {
|
|
210
|
-
const d = r.indexOf(a) === -1, p = !
|
|
211
|
-
d && p &&
|
|
208
|
+
const d = r.indexOf(a) === -1, p = !ve(a);
|
|
209
|
+
d && p && K(a, s);
|
|
212
210
|
});
|
|
213
211
|
}
|
|
214
212
|
function V(e, t) {
|
|
215
213
|
let o = -1;
|
|
216
214
|
return e.some((n, s) => t(n) ? (o = s, !0) : !1), o;
|
|
217
215
|
}
|
|
218
|
-
function
|
|
216
|
+
function ke(e, t) {
|
|
219
217
|
const o = [], n = e.container;
|
|
220
218
|
if (!t.disableScrollLock) {
|
|
221
|
-
if (
|
|
222
|
-
const a =
|
|
219
|
+
if (Re(n)) {
|
|
220
|
+
const a = he(w(n));
|
|
223
221
|
o.push({
|
|
224
222
|
value: n.style.paddingRight,
|
|
225
223
|
property: "padding-right",
|
|
226
224
|
el: n
|
|
227
|
-
}), n.style.paddingRight = `${
|
|
228
|
-
const d =
|
|
225
|
+
}), n.style.paddingRight = `${J(n) + a}px`;
|
|
226
|
+
const d = w(n).querySelectorAll(".mui-fixed");
|
|
229
227
|
[].forEach.call(d, (p) => {
|
|
230
228
|
o.push({
|
|
231
229
|
value: p.style.paddingRight,
|
|
232
230
|
property: "padding-right",
|
|
233
231
|
el: p
|
|
234
|
-
}), p.style.paddingRight = `${
|
|
232
|
+
}), p.style.paddingRight = `${J(p) + a}px`;
|
|
235
233
|
});
|
|
236
234
|
}
|
|
237
235
|
let r;
|
|
238
236
|
if (n.parentNode instanceof DocumentFragment)
|
|
239
|
-
r =
|
|
237
|
+
r = w(n).body;
|
|
240
238
|
else {
|
|
241
239
|
const a = n.parentElement, d = Y(n);
|
|
242
240
|
r = (a == null ? void 0 : a.nodeName) === "HTML" && d.getComputedStyle(a).overflowY === "scroll" ? a : n;
|
|
@@ -265,13 +263,13 @@ function Ie(e, t) {
|
|
|
265
263
|
});
|
|
266
264
|
};
|
|
267
265
|
}
|
|
268
|
-
function
|
|
266
|
+
function Pe(e) {
|
|
269
267
|
const t = [];
|
|
270
268
|
return [].forEach.call(e.children, (o) => {
|
|
271
269
|
o.getAttribute("aria-hidden") === "true" && t.push(o);
|
|
272
270
|
}), t;
|
|
273
271
|
}
|
|
274
|
-
class
|
|
272
|
+
class Ne {
|
|
275
273
|
constructor() {
|
|
276
274
|
this.containers = void 0, this.modals = void 0, this.modals = [], this.containers = [];
|
|
277
275
|
}
|
|
@@ -279,9 +277,9 @@ class Se {
|
|
|
279
277
|
let n = this.modals.indexOf(t);
|
|
280
278
|
if (n !== -1)
|
|
281
279
|
return n;
|
|
282
|
-
n = this.modals.length, this.modals.push(t), t.modalRef &&
|
|
283
|
-
const s =
|
|
284
|
-
|
|
280
|
+
n = this.modals.length, this.modals.push(t), t.modalRef && K(t.modalRef, !1);
|
|
281
|
+
const s = Pe(o);
|
|
282
|
+
Q(o, t.mount, t.modalRef, s, !0);
|
|
285
283
|
const r = V(this.containers, (a) => a.container === o);
|
|
286
284
|
return r !== -1 ? (this.containers[r].modals.push(t), n) : (this.containers.push({
|
|
287
285
|
modals: [t],
|
|
@@ -292,7 +290,7 @@ class Se {
|
|
|
292
290
|
}
|
|
293
291
|
mount(t, o) {
|
|
294
292
|
const n = V(this.containers, (r) => r.modals.indexOf(t) !== -1), s = this.containers[n];
|
|
295
|
-
s.restore || (s.restore =
|
|
293
|
+
s.restore || (s.restore = ke(s, o));
|
|
296
294
|
}
|
|
297
295
|
remove(t, o = !0) {
|
|
298
296
|
const n = this.modals.indexOf(t);
|
|
@@ -300,10 +298,10 @@ class Se {
|
|
|
300
298
|
return n;
|
|
301
299
|
const s = V(this.containers, (a) => a.modals.indexOf(t) !== -1), r = this.containers[s];
|
|
302
300
|
if (r.modals.splice(r.modals.indexOf(t), 1), this.modals.splice(n, 1), r.modals.length === 0)
|
|
303
|
-
r.restore && r.restore(), t.modalRef &&
|
|
301
|
+
r.restore && r.restore(), t.modalRef && K(t.modalRef, o), Q(r.container, t.mount, t.modalRef, r.hiddenSiblings, !1), this.containers.splice(s, 1);
|
|
304
302
|
else {
|
|
305
303
|
const a = r.modals[r.modals.length - 1];
|
|
306
|
-
a.modalRef &&
|
|
304
|
+
a.modalRef && K(a.modalRef, !1);
|
|
307
305
|
}
|
|
308
306
|
return n;
|
|
309
307
|
}
|
|
@@ -311,20 +309,20 @@ class Se {
|
|
|
311
309
|
return this.modals.length > 0 && this.modals[this.modals.length - 1] === t;
|
|
312
310
|
}
|
|
313
311
|
}
|
|
314
|
-
function
|
|
312
|
+
function Ce(e) {
|
|
315
313
|
return typeof e == "function" ? e() : e;
|
|
316
314
|
}
|
|
317
|
-
function
|
|
315
|
+
function Ie(e) {
|
|
318
316
|
return e ? e.props.hasOwnProperty("in") : !1;
|
|
319
317
|
}
|
|
320
|
-
const
|
|
321
|
-
function
|
|
318
|
+
const Fe = new Ne();
|
|
319
|
+
function Se(e) {
|
|
322
320
|
const {
|
|
323
321
|
container: t,
|
|
324
322
|
disableEscapeKeyDown: o = !1,
|
|
325
323
|
disableScrollLock: n = !1,
|
|
326
324
|
// @ts-ignore internal logic - Base UI supports the manager as a prop too
|
|
327
|
-
manager: s =
|
|
325
|
+
manager: s = Fe,
|
|
328
326
|
closeAfterTransition: r = !1,
|
|
329
327
|
onTransitionEnter: a,
|
|
330
328
|
onTransitionExited: d,
|
|
@@ -332,18 +330,18 @@ function De(e) {
|
|
|
332
330
|
onClose: x,
|
|
333
331
|
open: h,
|
|
334
332
|
rootRef: m
|
|
335
|
-
} = e, R = f.useRef({}), g = f.useRef(null), c = f.useRef(null),
|
|
333
|
+
} = e, R = f.useRef({}), g = f.useRef(null), c = f.useRef(null), O = Z(c, m), [I, A] = f.useState(!h), N = Ie(p);
|
|
336
334
|
let l = !0;
|
|
337
335
|
(e["aria-hidden"] === "false" || e["aria-hidden"] === !1) && (l = !1);
|
|
338
|
-
const v = () =>
|
|
336
|
+
const v = () => w(g.current), k = () => (R.current.modalRef = c.current, R.current.mount = g.current, R.current), D = () => {
|
|
339
337
|
s.mount(k(), {
|
|
340
338
|
disableScrollLock: n
|
|
341
339
|
}), c.current && (c.current.scrollTop = 0);
|
|
342
|
-
}, E =
|
|
343
|
-
const b =
|
|
344
|
-
s.add(k(), b), c.current &&
|
|
345
|
-
}), T = f.useCallback(() => s.isTopModal(k()), [s]), L =
|
|
346
|
-
g.current = b, b && (h && T() ?
|
|
340
|
+
}, E = G(() => {
|
|
341
|
+
const b = Ce(t) || v().body;
|
|
342
|
+
s.add(k(), b), c.current && D();
|
|
343
|
+
}), T = f.useCallback(() => s.isTopModal(k()), [s]), L = G((b) => {
|
|
344
|
+
g.current = b, b && (h && T() ? D() : c.current && K(c.current, l));
|
|
347
345
|
}), y = f.useCallback(() => {
|
|
348
346
|
s.remove(k(), l);
|
|
349
347
|
}, [l, s]);
|
|
@@ -352,7 +350,7 @@ function De(e) {
|
|
|
352
350
|
}, [y]), f.useEffect(() => {
|
|
353
351
|
h ? E() : (!N || !r) && y();
|
|
354
352
|
}, [h, y, N, r, E]);
|
|
355
|
-
const
|
|
353
|
+
const M = (b) => (u) => {
|
|
356
354
|
var P;
|
|
357
355
|
(P = b.onKeyDown) == null || P.call(b, u), !(u.key !== "Escape" || u.which === 229 || // Wait until IME is settled.
|
|
358
356
|
!T()) && (o || (u.stopPropagation(), x && x(u, "escapeKeyDown")));
|
|
@@ -362,14 +360,14 @@ function De(e) {
|
|
|
362
360
|
};
|
|
363
361
|
return {
|
|
364
362
|
getRootProps: (b = {}) => {
|
|
365
|
-
const u =
|
|
363
|
+
const u = ie(e);
|
|
366
364
|
delete u.onTransitionEnter, delete u.onTransitionExited;
|
|
367
365
|
const P = C({}, u, b);
|
|
368
366
|
return C({
|
|
369
367
|
role: "presentation"
|
|
370
368
|
}, P, {
|
|
371
|
-
onKeyDown:
|
|
372
|
-
ref:
|
|
369
|
+
onKeyDown: M(P),
|
|
370
|
+
ref: O
|
|
373
371
|
});
|
|
374
372
|
},
|
|
375
373
|
getBackdropProps: (b = {}) => {
|
|
@@ -383,37 +381,37 @@ function De(e) {
|
|
|
383
381
|
},
|
|
384
382
|
getTransitionProps: () => {
|
|
385
383
|
const b = () => {
|
|
386
|
-
|
|
384
|
+
A(!1), a && a();
|
|
387
385
|
}, u = () => {
|
|
388
|
-
|
|
386
|
+
A(!0), d && d(), r && y();
|
|
389
387
|
};
|
|
390
388
|
return {
|
|
391
|
-
onEnter:
|
|
392
|
-
onExited:
|
|
389
|
+
onEnter: X(b, p == null ? void 0 : p.props.onEnter),
|
|
390
|
+
onExited: X(u, p == null ? void 0 : p.props.onExited)
|
|
393
391
|
};
|
|
394
392
|
},
|
|
395
|
-
rootRef:
|
|
393
|
+
rootRef: O,
|
|
396
394
|
portalRef: L,
|
|
397
395
|
isTopModal: T,
|
|
398
396
|
exited: I,
|
|
399
397
|
hasTransition: N
|
|
400
398
|
};
|
|
401
399
|
}
|
|
402
|
-
const
|
|
403
|
-
function
|
|
404
|
-
return
|
|
400
|
+
const te = "Modal";
|
|
401
|
+
function we(e) {
|
|
402
|
+
return ae(te, e);
|
|
405
403
|
}
|
|
406
|
-
|
|
407
|
-
const
|
|
404
|
+
le(te, ["root", "hidden", "backdrop"]);
|
|
405
|
+
const Oe = ["children", "closeAfterTransition", "container", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "onBackdropClick", "onClose", "onKeyDown", "open", "onTransitionEnter", "onTransitionExited", "slotProps", "slots"], Ae = (e) => {
|
|
408
406
|
const {
|
|
409
407
|
open: t,
|
|
410
408
|
exited: o
|
|
411
409
|
} = e;
|
|
412
|
-
return
|
|
410
|
+
return de({
|
|
413
411
|
root: ["root", !t && o && "hidden"],
|
|
414
412
|
backdrop: ["backdrop"]
|
|
415
|
-
},
|
|
416
|
-
},
|
|
413
|
+
}, ue(we));
|
|
414
|
+
}, ne = /* @__PURE__ */ f.forwardRef(function(t, o) {
|
|
417
415
|
var n;
|
|
418
416
|
const {
|
|
419
417
|
children: s,
|
|
@@ -427,11 +425,11 @@ const Le = ["children", "closeAfterTransition", "container", "disableAutoFocus",
|
|
|
427
425
|
disableScrollLock: R = !1,
|
|
428
426
|
hideBackdrop: g = !1,
|
|
429
427
|
keepMounted: c = !1,
|
|
430
|
-
onBackdropClick:
|
|
428
|
+
onBackdropClick: O,
|
|
431
429
|
open: I,
|
|
432
|
-
slotProps:
|
|
430
|
+
slotProps: A = {},
|
|
433
431
|
slots: N = {}
|
|
434
|
-
} = t, l =
|
|
432
|
+
} = t, l = ce(t, Oe), v = C({}, t, {
|
|
435
433
|
closeAfterTransition: r,
|
|
436
434
|
disableAutoFocus: d,
|
|
437
435
|
disableEnforceFocus: p,
|
|
@@ -443,60 +441,60 @@ const Le = ["children", "closeAfterTransition", "container", "disableAutoFocus",
|
|
|
443
441
|
keepMounted: c
|
|
444
442
|
}), {
|
|
445
443
|
getRootProps: k,
|
|
446
|
-
getBackdropProps:
|
|
444
|
+
getBackdropProps: D,
|
|
447
445
|
getTransitionProps: E,
|
|
448
446
|
portalRef: T,
|
|
449
447
|
isTopModal: L,
|
|
450
448
|
exited: y,
|
|
451
|
-
hasTransition:
|
|
452
|
-
} =
|
|
449
|
+
hasTransition: M
|
|
450
|
+
} = Se(C({}, v, {
|
|
453
451
|
rootRef: o
|
|
454
452
|
})), F = C({}, v, {
|
|
455
453
|
exited: y,
|
|
456
|
-
hasTransition:
|
|
457
|
-
}), H =
|
|
458
|
-
if (s.props.tabIndex === void 0 && (
|
|
454
|
+
hasTransition: M
|
|
455
|
+
}), H = Ae(F), _ = {};
|
|
456
|
+
if (s.props.tabIndex === void 0 && (_.tabIndex = "-1"), M) {
|
|
459
457
|
const {
|
|
460
458
|
onEnter: B,
|
|
461
|
-
onExited:
|
|
459
|
+
onExited: U
|
|
462
460
|
} = E();
|
|
463
|
-
|
|
461
|
+
_.onEnter = B, _.onExited = U;
|
|
464
462
|
}
|
|
465
|
-
const
|
|
466
|
-
elementType:
|
|
467
|
-
externalSlotProps:
|
|
463
|
+
const j = (n = N.root) != null ? n : "div", b = z({
|
|
464
|
+
elementType: j,
|
|
465
|
+
externalSlotProps: A.root,
|
|
468
466
|
externalForwardedProps: l,
|
|
469
467
|
getSlotProps: k,
|
|
470
468
|
className: H.root,
|
|
471
469
|
ownerState: F
|
|
472
|
-
}), u = N.backdrop, P =
|
|
470
|
+
}), u = N.backdrop, P = z({
|
|
473
471
|
elementType: u,
|
|
474
|
-
externalSlotProps:
|
|
475
|
-
getSlotProps: (B) =>
|
|
476
|
-
onClick: (
|
|
477
|
-
|
|
472
|
+
externalSlotProps: A.backdrop,
|
|
473
|
+
getSlotProps: (B) => D(C({}, B, {
|
|
474
|
+
onClick: (U) => {
|
|
475
|
+
O && O(U), B != null && B.onClick && B.onClick(U);
|
|
478
476
|
}
|
|
479
477
|
})),
|
|
480
478
|
className: H.backdrop,
|
|
481
479
|
ownerState: F
|
|
482
480
|
});
|
|
483
|
-
return !c && !I && (!
|
|
481
|
+
return !c && !I && (!M || y) ? null : /* @__PURE__ */ S(fe, {
|
|
484
482
|
ref: T,
|
|
485
483
|
container: a,
|
|
486
484
|
disablePortal: h,
|
|
487
|
-
children: /* @__PURE__ */ $(
|
|
488
|
-
children: [!g && u ? /* @__PURE__ */ S(u, C({}, P)) : null, /* @__PURE__ */ S(
|
|
485
|
+
children: /* @__PURE__ */ $(j, C({}, b, {
|
|
486
|
+
children: [!g && u ? /* @__PURE__ */ S(u, C({}, P)) : null, /* @__PURE__ */ S(W, {
|
|
489
487
|
disableEnforceFocus: p,
|
|
490
488
|
disableAutoFocus: d,
|
|
491
489
|
disableRestoreFocus: m,
|
|
492
490
|
isEnabled: L,
|
|
493
491
|
open: I,
|
|
494
|
-
children: /* @__PURE__ */ f.cloneElement(s,
|
|
492
|
+
children: /* @__PURE__ */ f.cloneElement(s, _)
|
|
495
493
|
})]
|
|
496
494
|
}))
|
|
497
495
|
});
|
|
498
496
|
});
|
|
499
|
-
process.env.NODE_ENV !== "production" && (
|
|
497
|
+
process.env.NODE_ENV !== "production" && (ne.propTypes = {
|
|
500
498
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
501
499
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
502
500
|
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
@@ -504,7 +502,7 @@ process.env.NODE_ENV !== "production" && (re.propTypes = {
|
|
|
504
502
|
/**
|
|
505
503
|
* A single child content element.
|
|
506
504
|
*/
|
|
507
|
-
children:
|
|
505
|
+
children: ee.isRequired,
|
|
508
506
|
/**
|
|
509
507
|
* When set to true the Modal waits until a nested Transition is completed before closing.
|
|
510
508
|
* @default false
|
|
@@ -520,7 +518,7 @@ process.env.NODE_ENV !== "production" && (re.propTypes = {
|
|
|
520
518
|
* By default, it uses the body of the top-level document object,
|
|
521
519
|
* so it's simply `document.body` most of the time.
|
|
522
520
|
*/
|
|
523
|
-
container: i.oneOfType([
|
|
521
|
+
container: i.oneOfType([pe, i.func]),
|
|
524
522
|
/**
|
|
525
523
|
* If `true`, the modal will not automatically shift focus to itself when it opens, and
|
|
526
524
|
* replace it to the last focused element when it closes.
|
|
@@ -615,32 +613,34 @@ process.env.NODE_ENV !== "production" && (re.propTypes = {
|
|
|
615
613
|
root: i.elementType
|
|
616
614
|
})
|
|
617
615
|
});
|
|
618
|
-
const
|
|
619
|
-
|
|
616
|
+
const je = ({
|
|
617
|
+
children: e,
|
|
618
|
+
dialogTitle: t,
|
|
619
|
+
dialogSubtitle: o,
|
|
620
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
621
|
+
isLoading: n = !1,
|
|
622
|
+
onClose: s,
|
|
623
|
+
...r
|
|
624
|
+
}) => /* @__PURE__ */ S(
|
|
625
|
+
ne,
|
|
620
626
|
{
|
|
621
|
-
onClose:
|
|
622
|
-
slots: { backdrop:
|
|
623
|
-
...
|
|
624
|
-
className:
|
|
627
|
+
onClose: s,
|
|
628
|
+
slots: { backdrop: oe },
|
|
629
|
+
...r,
|
|
630
|
+
className: q.dialog,
|
|
625
631
|
"aria-labelledby": "alert-dialog-title",
|
|
626
632
|
"aria-describedby": "alert-dialog-description",
|
|
627
|
-
children: /* @__PURE__ */ $("section", { className:
|
|
628
|
-
!!
|
|
629
|
-
/* @__PURE__ */ S(
|
|
633
|
+
children: /* @__PURE__ */ $("section", { className: q.dialog__panel, children: [
|
|
634
|
+
!!s && /* @__PURE__ */ S(re, { handleOnClose: s, className: q.dialog__close }),
|
|
635
|
+
/* @__PURE__ */ S(se, { title: t, subTitle: o }),
|
|
630
636
|
e
|
|
631
637
|
] })
|
|
632
638
|
}
|
|
633
639
|
);
|
|
634
|
-
K.Title = ee;
|
|
635
|
-
K.Title.displayName = "Dialog.Title";
|
|
636
|
-
K.Content = ce;
|
|
637
|
-
K.Content.displayName = "Dialog.Content";
|
|
638
|
-
K.Actions = ie;
|
|
639
|
-
K.Actions.displayName = "Dialog.Actions";
|
|
640
640
|
export {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
641
|
+
$e as Actions,
|
|
642
|
+
ze as Content,
|
|
643
|
+
je as Dialog,
|
|
644
|
+
se as DialogTitle,
|
|
645
|
+
je as default
|
|
646
646
|
};
|