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