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