@notificationapi/react 0.0.37 → 1.0.1
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/assets/Badge.js +456 -0
- package/dist/assets/Box.js +57 -0
- package/dist/assets/ButtonBase.js +1224 -0
- package/dist/assets/DefaultPropsProvider.js +4368 -0
- package/dist/assets/Divider.js +343 -0
- package/dist/assets/IconButton.js +225 -0
- package/dist/assets/Inbox.js +3051 -0
- package/dist/assets/InboxHeader.js +2338 -0
- package/dist/assets/Notification.js +5349 -7150
- package/dist/assets/NotificationPreferencesPopup.js +1694 -0
- package/dist/assets/Paper.js +154 -0
- package/dist/assets/Popover.js +451 -0
- package/dist/assets/Portal.js +110 -0
- package/dist/assets/PreferenceInput.js +1545 -1366
- package/dist/assets/Typography.js +292 -0
- package/dist/assets/WebPushOptInMessage.js +794 -407
- package/dist/assets/channelUtils.js +33 -65
- package/dist/assets/createSimplePaletteValueFilter.js +17 -0
- package/dist/assets/createSvgIcon.js +248 -0
- package/dist/assets/integerPropType.js +31 -0
- package/dist/assets/resolveComponentProps.js +93 -0
- package/dist/assets/style.css +1 -0
- package/dist/assets/useSlotProps.js +24 -0
- package/dist/assets/useTheme.js +10 -0
- package/dist/assets/useTheme2.js +16 -0
- package/dist/assets/utils.js +743 -0
- package/dist/components/Notifications/DefaultEmpty.d.ts +3 -0
- package/dist/components/Notifications/DefaultEmpty.js +7 -0
- package/dist/components/Notifications/Inbox.d.ts +4 -4
- package/dist/components/Notifications/Inbox.js +9 -6450
- package/dist/components/Notifications/InboxHeader.d.ts +1 -1
- package/dist/components/Notifications/InboxHeader.js +7 -53
- package/dist/components/Notifications/Notification.d.ts +3 -4
- package/dist/components/Notifications/Notification.js +6 -5
- package/dist/components/Notifications/NotificationCounter.js +16 -6
- package/dist/components/Notifications/NotificationFeed.d.ts +1 -2
- package/dist/components/Notifications/NotificationFeed.js +41 -38
- package/dist/components/Notifications/NotificationLauncher.d.ts +1 -0
- package/dist/components/Notifications/NotificationLauncher.js +100 -114
- package/dist/components/Notifications/NotificationPopup.d.ts +3 -4
- package/dist/components/Notifications/NotificationPopup.js +86 -88
- package/dist/components/Notifications/UnreadBadge.d.ts +7 -4
- package/dist/components/Notifications/UnreadBadge.js +28 -20
- package/dist/components/Notifications/interface.d.ts +0 -4
- package/dist/components/Notifications/interface.js +4 -5
- package/dist/components/Preferences/NotificationPreferencesInline.js +14 -14
- package/dist/components/Preferences/NotificationPreferencesPopup.js +7 -2068
- package/dist/components/Preferences/PreferenceInput.js +4 -3
- package/dist/components/Preferences/Preferences.js +1042 -547
- package/dist/components/Preferences/channelUtils.js +3 -4
- package/dist/components/Preferences/index.js +1 -1
- package/dist/components/Provider/context.d.ts +27 -0
- package/dist/components/Provider/context.js +7 -0
- package/dist/components/Provider/index.d.ts +2 -25
- package/dist/components/Provider/index.js +22 -24
- package/dist/components/WebPush/WebPushOptInMessage.js +3 -4
- package/dist/main.d.ts +1 -0
- package/dist/main.js +4 -4
- package/package.json +14 -12
- package/dist/assets/AntdIcon.js +0 -200
- package/dist/assets/CloseOutlined.js +0 -13
- package/dist/assets/PurePanel.js +0 -59
- package/dist/assets/RightOutlined.js +0 -13
- package/dist/assets/button.js +0 -1660
- package/dist/assets/colors.js +0 -36
- package/dist/assets/compact-item.js +0 -860
- package/dist/assets/index.js +0 -271
- package/dist/assets/index2.js +0 -647
- package/dist/assets/index3.js +0 -7527
- package/dist/assets/pickAttrs.js +0 -42
- package/dist/assets/presets.js +0 -810
- package/dist/assets/reactNode.js +0 -20821
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import * as P from "react";
|
|
2
|
+
import { g as b, a as h, s as g, m as w, u as T, c as $, b as u, e as f, P as a, f as x } from "./DefaultPropsProvider.js";
|
|
3
|
+
import { u as O } from "./useTheme.js";
|
|
4
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
5
|
+
import { c as N } from "./ButtonBase.js";
|
|
6
|
+
import { i as R } from "./integerPropType.js";
|
|
7
|
+
function j(e) {
|
|
8
|
+
return h("MuiPaper", e);
|
|
9
|
+
}
|
|
10
|
+
b("MuiPaper", ["root", "rounded", "outlined", "elevation", "elevation0", "elevation1", "elevation2", "elevation3", "elevation4", "elevation5", "elevation6", "elevation7", "elevation8", "elevation9", "elevation10", "elevation11", "elevation12", "elevation13", "elevation14", "elevation15", "elevation16", "elevation17", "elevation18", "elevation19", "elevation20", "elevation21", "elevation22", "elevation23", "elevation24"]);
|
|
11
|
+
const E = (e) => {
|
|
12
|
+
const {
|
|
13
|
+
square: o,
|
|
14
|
+
elevation: t,
|
|
15
|
+
variant: s,
|
|
16
|
+
classes: r
|
|
17
|
+
} = e, i = {
|
|
18
|
+
root: ["root", s, !o && "rounded", s === "elevation" && `elevation${t}`]
|
|
19
|
+
};
|
|
20
|
+
return x(i, j, r);
|
|
21
|
+
}, M = g("div", {
|
|
22
|
+
name: "MuiPaper",
|
|
23
|
+
slot: "Root",
|
|
24
|
+
overridesResolver: (e, o) => {
|
|
25
|
+
const {
|
|
26
|
+
ownerState: t
|
|
27
|
+
} = e;
|
|
28
|
+
return [o.root, o[t.variant], !t.square && o.rounded, t.variant === "elevation" && o[`elevation${t.elevation}`]];
|
|
29
|
+
}
|
|
30
|
+
})(w(({
|
|
31
|
+
theme: e
|
|
32
|
+
}) => ({
|
|
33
|
+
backgroundColor: (e.vars || e).palette.background.paper,
|
|
34
|
+
color: (e.vars || e).palette.text.primary,
|
|
35
|
+
transition: e.transitions.create("box-shadow"),
|
|
36
|
+
variants: [{
|
|
37
|
+
props: ({
|
|
38
|
+
ownerState: o
|
|
39
|
+
}) => !o.square,
|
|
40
|
+
style: {
|
|
41
|
+
borderRadius: e.shape.borderRadius
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
props: {
|
|
45
|
+
variant: "outlined"
|
|
46
|
+
},
|
|
47
|
+
style: {
|
|
48
|
+
border: `1px solid ${(e.vars || e).palette.divider}`
|
|
49
|
+
}
|
|
50
|
+
}, {
|
|
51
|
+
props: {
|
|
52
|
+
variant: "elevation"
|
|
53
|
+
},
|
|
54
|
+
style: {
|
|
55
|
+
boxShadow: "var(--Paper-shadow)",
|
|
56
|
+
backgroundImage: "var(--Paper-overlay)"
|
|
57
|
+
}
|
|
58
|
+
}]
|
|
59
|
+
}))), U = /* @__PURE__ */ P.forwardRef(function(o, t) {
|
|
60
|
+
var c;
|
|
61
|
+
const s = T({
|
|
62
|
+
props: o,
|
|
63
|
+
name: "MuiPaper"
|
|
64
|
+
}), r = O(), {
|
|
65
|
+
className: i,
|
|
66
|
+
component: l = "div",
|
|
67
|
+
elevation: n = 1,
|
|
68
|
+
square: m = !1,
|
|
69
|
+
variant: v = "elevation",
|
|
70
|
+
...p
|
|
71
|
+
} = s, d = {
|
|
72
|
+
...s,
|
|
73
|
+
component: l,
|
|
74
|
+
elevation: n,
|
|
75
|
+
square: m,
|
|
76
|
+
variant: v
|
|
77
|
+
}, y = E(d);
|
|
78
|
+
return process.env.NODE_ENV !== "production" && r.shadows[n] === void 0 && console.error([`MUI: The elevation provided <Paper elevation={${n}}> is not available in the theme.`, `Please make sure that \`theme.shadows[${n}]\` is defined.`].join(`
|
|
79
|
+
`)), /* @__PURE__ */ C(M, {
|
|
80
|
+
as: l,
|
|
81
|
+
ownerState: d,
|
|
82
|
+
className: $(y.root, i),
|
|
83
|
+
ref: t,
|
|
84
|
+
...p,
|
|
85
|
+
style: {
|
|
86
|
+
...v === "elevation" && {
|
|
87
|
+
"--Paper-shadow": (r.vars || r).shadows[n],
|
|
88
|
+
...r.vars && {
|
|
89
|
+
"--Paper-overlay": (c = r.vars.overlays) == null ? void 0 : c[n]
|
|
90
|
+
},
|
|
91
|
+
...!r.vars && r.palette.mode === "dark" && {
|
|
92
|
+
"--Paper-overlay": `linear-gradient(${u("#fff", f(n))}, ${u("#fff", f(n))})`
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
...p.style
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
process.env.NODE_ENV !== "production" && (U.propTypes = {
|
|
100
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
101
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
102
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
103
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
104
|
+
/**
|
|
105
|
+
* The content of the component.
|
|
106
|
+
*/
|
|
107
|
+
children: a.node,
|
|
108
|
+
/**
|
|
109
|
+
* Override or extend the styles applied to the component.
|
|
110
|
+
*/
|
|
111
|
+
classes: a.object,
|
|
112
|
+
/**
|
|
113
|
+
* @ignore
|
|
114
|
+
*/
|
|
115
|
+
className: a.string,
|
|
116
|
+
/**
|
|
117
|
+
* The component used for the root node.
|
|
118
|
+
* Either a string to use a HTML element or a component.
|
|
119
|
+
*/
|
|
120
|
+
component: a.elementType,
|
|
121
|
+
/**
|
|
122
|
+
* Shadow depth, corresponds to `dp` in the spec.
|
|
123
|
+
* It accepts values between 0 and 24 inclusive.
|
|
124
|
+
* @default 1
|
|
125
|
+
*/
|
|
126
|
+
elevation: N(R, (e) => {
|
|
127
|
+
const {
|
|
128
|
+
elevation: o,
|
|
129
|
+
variant: t
|
|
130
|
+
} = e;
|
|
131
|
+
return o > 0 && t === "outlined" ? new Error(`MUI: Combining \`elevation={${o}}\` with \`variant="${t}"\` has no effect. Either use \`elevation={0}\` or use a different \`variant\`.`) : null;
|
|
132
|
+
}),
|
|
133
|
+
/**
|
|
134
|
+
* If `true`, rounded corners are disabled.
|
|
135
|
+
* @default false
|
|
136
|
+
*/
|
|
137
|
+
square: a.bool,
|
|
138
|
+
/**
|
|
139
|
+
* @ignore
|
|
140
|
+
*/
|
|
141
|
+
style: a.object,
|
|
142
|
+
/**
|
|
143
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
144
|
+
*/
|
|
145
|
+
sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object]),
|
|
146
|
+
/**
|
|
147
|
+
* The variant to use.
|
|
148
|
+
* @default 'elevation'
|
|
149
|
+
*/
|
|
150
|
+
variant: a.oneOfType([a.oneOf(["elevation", "outlined"]), a.string])
|
|
151
|
+
});
|
|
152
|
+
export {
|
|
153
|
+
U as P
|
|
154
|
+
};
|
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
import * as p from "react";
|
|
2
|
+
import { g as ge, a as ve, s as te, u as ye, c as Y, P as e, f as be } from "./DefaultPropsProvider.js";
|
|
3
|
+
import { i as Te } from "./Inbox.js";
|
|
4
|
+
import { u as X, r as Ee, c as Oe, e as Re } from "./ButtonBase.js";
|
|
5
|
+
import { jsx as z } from "react/jsx-runtime";
|
|
6
|
+
import { M as we, o as J } from "./NotificationPreferencesPopup.js";
|
|
7
|
+
import { P as xe } from "./Paper.js";
|
|
8
|
+
import { o as K, H as Q } from "./Portal.js";
|
|
9
|
+
import { u as Ce } from "./resolveComponentProps.js";
|
|
10
|
+
import { i as Me } from "./integerPropType.js";
|
|
11
|
+
import { G as Ne } from "./InboxHeader.js";
|
|
12
|
+
function je(t, o = 166) {
|
|
13
|
+
let n;
|
|
14
|
+
function g(...R) {
|
|
15
|
+
const a = () => {
|
|
16
|
+
t.apply(this, R);
|
|
17
|
+
};
|
|
18
|
+
clearTimeout(n), n = setTimeout(a, o);
|
|
19
|
+
}
|
|
20
|
+
return g.clear = () => {
|
|
21
|
+
clearTimeout(n);
|
|
22
|
+
}, g;
|
|
23
|
+
}
|
|
24
|
+
function ze(t) {
|
|
25
|
+
return ve("MuiPopover", t);
|
|
26
|
+
}
|
|
27
|
+
ge("MuiPopover", ["root", "paper"]);
|
|
28
|
+
function Z(t, o) {
|
|
29
|
+
let n = 0;
|
|
30
|
+
return typeof o == "number" ? n = o : o === "center" ? n = t.height / 2 : o === "bottom" && (n = t.height), n;
|
|
31
|
+
}
|
|
32
|
+
function ee(t, o) {
|
|
33
|
+
let n = 0;
|
|
34
|
+
return typeof o == "number" ? n = o : o === "center" ? n = t.width / 2 : o === "right" && (n = t.width), n;
|
|
35
|
+
}
|
|
36
|
+
function oe(t) {
|
|
37
|
+
return [t.horizontal, t.vertical].map((o) => typeof o == "number" ? `${o}px` : o).join(" ");
|
|
38
|
+
}
|
|
39
|
+
function O(t) {
|
|
40
|
+
return typeof t == "function" ? t() : t;
|
|
41
|
+
}
|
|
42
|
+
const De = (t) => {
|
|
43
|
+
const {
|
|
44
|
+
classes: o
|
|
45
|
+
} = t;
|
|
46
|
+
return be({
|
|
47
|
+
root: ["root"],
|
|
48
|
+
paper: ["paper"]
|
|
49
|
+
}, ze, o);
|
|
50
|
+
}, ke = te(we, {
|
|
51
|
+
name: "MuiPopover",
|
|
52
|
+
slot: "Root",
|
|
53
|
+
overridesResolver: (t, o) => o.root
|
|
54
|
+
})({}), Se = te(xe, {
|
|
55
|
+
name: "MuiPopover",
|
|
56
|
+
slot: "Paper",
|
|
57
|
+
overridesResolver: (t, o) => o.paper
|
|
58
|
+
})({
|
|
59
|
+
position: "absolute",
|
|
60
|
+
overflowY: "auto",
|
|
61
|
+
overflowX: "hidden",
|
|
62
|
+
// So we see the popover when it's empty.
|
|
63
|
+
// It's most likely on issue on userland.
|
|
64
|
+
minWidth: 16,
|
|
65
|
+
minHeight: 16,
|
|
66
|
+
maxWidth: "calc(100% - 32px)",
|
|
67
|
+
maxHeight: "calc(100% - 32px)",
|
|
68
|
+
// We disable the focus ring for mouse, touch and keyboard users.
|
|
69
|
+
outline: 0
|
|
70
|
+
}), Ue = /* @__PURE__ */ p.forwardRef(function(o, n) {
|
|
71
|
+
const g = ye({
|
|
72
|
+
props: o,
|
|
73
|
+
name: "MuiPopover"
|
|
74
|
+
}), {
|
|
75
|
+
action: R,
|
|
76
|
+
anchorEl: a,
|
|
77
|
+
anchorOrigin: v = {
|
|
78
|
+
vertical: "top",
|
|
79
|
+
horizontal: "left"
|
|
80
|
+
},
|
|
81
|
+
anchorPosition: w,
|
|
82
|
+
anchorReference: y = "anchorEl",
|
|
83
|
+
children: ne,
|
|
84
|
+
className: re,
|
|
85
|
+
container: ie,
|
|
86
|
+
elevation: D = 8,
|
|
87
|
+
marginThreshold: l = 16,
|
|
88
|
+
open: u,
|
|
89
|
+
PaperProps: se = {},
|
|
90
|
+
slots: ae = {},
|
|
91
|
+
slotProps: E = {},
|
|
92
|
+
transformOrigin: b = {
|
|
93
|
+
vertical: "top",
|
|
94
|
+
horizontal: "left"
|
|
95
|
+
},
|
|
96
|
+
TransitionComponent: x = Ne,
|
|
97
|
+
transitionDuration: C = "auto",
|
|
98
|
+
TransitionProps: {
|
|
99
|
+
onEntering: k,
|
|
100
|
+
...S
|
|
101
|
+
} = {},
|
|
102
|
+
disableScrollLock: M = !1,
|
|
103
|
+
...le
|
|
104
|
+
} = g, h = (E == null ? void 0 : E.paper) ?? se, N = p.useRef(), j = {
|
|
105
|
+
...g,
|
|
106
|
+
anchorOrigin: v,
|
|
107
|
+
anchorReference: y,
|
|
108
|
+
elevation: D,
|
|
109
|
+
marginThreshold: l,
|
|
110
|
+
externalPaperSlotProps: h,
|
|
111
|
+
transformOrigin: b,
|
|
112
|
+
TransitionComponent: x,
|
|
113
|
+
transitionDuration: C,
|
|
114
|
+
TransitionProps: S
|
|
115
|
+
}, U = De(j), H = p.useCallback(() => {
|
|
116
|
+
if (y === "anchorPosition")
|
|
117
|
+
return process.env.NODE_ENV !== "production" && (w || console.error('MUI: You need to provide a `anchorPosition` prop when using <Popover anchorReference="anchorPosition" />.')), w;
|
|
118
|
+
const r = O(a), i = r && r.nodeType === 1 ? r : K(N.current).body, s = i.getBoundingClientRect();
|
|
119
|
+
if (process.env.NODE_ENV !== "production") {
|
|
120
|
+
const d = i.getBoundingClientRect();
|
|
121
|
+
process.env.NODE_ENV !== "test" && d.top === 0 && d.left === 0 && d.right === 0 && d.bottom === 0 && console.warn(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join(`
|
|
122
|
+
`));
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
top: s.top + Z(s, v.vertical),
|
|
126
|
+
left: s.left + ee(s, v.horizontal)
|
|
127
|
+
};
|
|
128
|
+
}, [a, v.horizontal, v.vertical, w, y]), I = p.useCallback((r) => ({
|
|
129
|
+
vertical: Z(r, b.vertical),
|
|
130
|
+
horizontal: ee(r, b.horizontal)
|
|
131
|
+
}), [b.horizontal, b.vertical]), L = p.useCallback((r) => {
|
|
132
|
+
const i = {
|
|
133
|
+
width: r.offsetWidth,
|
|
134
|
+
height: r.offsetHeight
|
|
135
|
+
}, s = I(i);
|
|
136
|
+
if (y === "none")
|
|
137
|
+
return {
|
|
138
|
+
top: null,
|
|
139
|
+
left: null,
|
|
140
|
+
transformOrigin: oe(s)
|
|
141
|
+
};
|
|
142
|
+
const d = H();
|
|
143
|
+
let m = d.top - s.vertical, P = d.left - s.horizontal;
|
|
144
|
+
const B = m + i.height, $ = P + i.width, F = J(O(a)), T = F.innerHeight - l, G = F.innerWidth - l;
|
|
145
|
+
if (l !== null && m < l) {
|
|
146
|
+
const c = m - l;
|
|
147
|
+
m -= c, s.vertical += c;
|
|
148
|
+
} else if (l !== null && B > T) {
|
|
149
|
+
const c = B - T;
|
|
150
|
+
m -= c, s.vertical += c;
|
|
151
|
+
}
|
|
152
|
+
if (process.env.NODE_ENV !== "production" && i.height > T && i.height && T && console.error(["MUI: The popover component is too tall.", `Some part of it can not be seen on the screen (${i.height - T}px).`, "Please consider adding a `max-height` to improve the user-experience."].join(`
|
|
153
|
+
`)), l !== null && P < l) {
|
|
154
|
+
const c = P - l;
|
|
155
|
+
P -= c, s.horizontal += c;
|
|
156
|
+
} else if ($ > G) {
|
|
157
|
+
const c = $ - G;
|
|
158
|
+
P -= c, s.horizontal += c;
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
top: `${Math.round(m)}px`,
|
|
162
|
+
left: `${Math.round(P)}px`,
|
|
163
|
+
transformOrigin: oe(s)
|
|
164
|
+
};
|
|
165
|
+
}, [a, y, H, I, l]), [ce, V] = p.useState(u), f = p.useCallback(() => {
|
|
166
|
+
const r = N.current;
|
|
167
|
+
if (!r)
|
|
168
|
+
return;
|
|
169
|
+
const i = L(r);
|
|
170
|
+
i.top !== null && r.style.setProperty("top", i.top), i.left !== null && (r.style.left = i.left), r.style.transformOrigin = i.transformOrigin, V(!0);
|
|
171
|
+
}, [L]);
|
|
172
|
+
p.useEffect(() => (M && window.addEventListener("scroll", f), () => window.removeEventListener("scroll", f)), [a, M, f]);
|
|
173
|
+
const pe = (r, i) => {
|
|
174
|
+
k && k(r, i), f();
|
|
175
|
+
}, fe = () => {
|
|
176
|
+
V(!1);
|
|
177
|
+
};
|
|
178
|
+
p.useEffect(() => {
|
|
179
|
+
u && f();
|
|
180
|
+
}), p.useImperativeHandle(R, () => u ? {
|
|
181
|
+
updatePosition: () => {
|
|
182
|
+
f();
|
|
183
|
+
}
|
|
184
|
+
} : null, [u, f]), p.useEffect(() => {
|
|
185
|
+
if (!u)
|
|
186
|
+
return;
|
|
187
|
+
const r = je(() => {
|
|
188
|
+
f();
|
|
189
|
+
}), i = J(a);
|
|
190
|
+
return i.addEventListener("resize", r), () => {
|
|
191
|
+
r.clear(), i.removeEventListener("resize", r);
|
|
192
|
+
};
|
|
193
|
+
}, [a, u, f]);
|
|
194
|
+
let q = C;
|
|
195
|
+
C === "auto" && !x.muiSupportAuto && (q = void 0);
|
|
196
|
+
const ue = ie || (a ? K(O(a)).body : void 0), W = {
|
|
197
|
+
slots: ae,
|
|
198
|
+
slotProps: {
|
|
199
|
+
...E,
|
|
200
|
+
paper: h
|
|
201
|
+
}
|
|
202
|
+
}, [he, A] = X("paper", {
|
|
203
|
+
elementType: Se,
|
|
204
|
+
externalForwardedProps: W,
|
|
205
|
+
additionalProps: {
|
|
206
|
+
elevation: D,
|
|
207
|
+
className: Y(U.paper, h == null ? void 0 : h.className),
|
|
208
|
+
style: ce ? h.style : {
|
|
209
|
+
...h.style,
|
|
210
|
+
opacity: 0
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
ownerState: j
|
|
214
|
+
}), [_, {
|
|
215
|
+
slotProps: de,
|
|
216
|
+
...me
|
|
217
|
+
}] = X("root", {
|
|
218
|
+
elementType: ke,
|
|
219
|
+
externalForwardedProps: W,
|
|
220
|
+
additionalProps: {
|
|
221
|
+
slotProps: {
|
|
222
|
+
backdrop: {
|
|
223
|
+
invisible: !0
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
container: ue,
|
|
227
|
+
open: u
|
|
228
|
+
},
|
|
229
|
+
ownerState: j,
|
|
230
|
+
className: Y(U.root, re)
|
|
231
|
+
}), Pe = Ce(N, A.ref);
|
|
232
|
+
return /* @__PURE__ */ z(_, {
|
|
233
|
+
...me,
|
|
234
|
+
...!Te(_) && {
|
|
235
|
+
slotProps: de,
|
|
236
|
+
disableScrollLock: M
|
|
237
|
+
},
|
|
238
|
+
...le,
|
|
239
|
+
ref: n,
|
|
240
|
+
children: /* @__PURE__ */ z(x, {
|
|
241
|
+
appear: !0,
|
|
242
|
+
in: u,
|
|
243
|
+
onEntering: pe,
|
|
244
|
+
onExited: fe,
|
|
245
|
+
timeout: q,
|
|
246
|
+
...S,
|
|
247
|
+
children: /* @__PURE__ */ z(he, {
|
|
248
|
+
...A,
|
|
249
|
+
ref: Pe,
|
|
250
|
+
children: ne
|
|
251
|
+
})
|
|
252
|
+
})
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
process.env.NODE_ENV !== "production" && (Ue.propTypes = {
|
|
256
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
257
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
258
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
259
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
260
|
+
/**
|
|
261
|
+
* A ref for imperative actions.
|
|
262
|
+
* It currently only supports updatePosition() action.
|
|
263
|
+
*/
|
|
264
|
+
action: Ee,
|
|
265
|
+
/**
|
|
266
|
+
* An HTML element, [PopoverVirtualElement](https://mui.com/material-ui/react-popover/#virtual-element),
|
|
267
|
+
* or a function that returns either.
|
|
268
|
+
* It's used to set the position of the popover.
|
|
269
|
+
*/
|
|
270
|
+
anchorEl: Oe(e.oneOfType([Q, e.func]), (t) => {
|
|
271
|
+
if (t.open && (!t.anchorReference || t.anchorReference === "anchorEl")) {
|
|
272
|
+
const o = O(t.anchorEl);
|
|
273
|
+
if (o && o.nodeType === 1) {
|
|
274
|
+
const n = o.getBoundingClientRect();
|
|
275
|
+
if (process.env.NODE_ENV !== "test" && n.top === 0 && n.left === 0 && n.right === 0 && n.bottom === 0)
|
|
276
|
+
return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join(`
|
|
277
|
+
`));
|
|
278
|
+
} else
|
|
279
|
+
return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", `It should be an Element or PopoverVirtualElement instance but it's \`${o}\` instead.`].join(`
|
|
280
|
+
`));
|
|
281
|
+
}
|
|
282
|
+
return null;
|
|
283
|
+
}),
|
|
284
|
+
/**
|
|
285
|
+
* This is the point on the anchor where the popover's
|
|
286
|
+
* `anchorEl` will attach to. This is not used when the
|
|
287
|
+
* anchorReference is 'anchorPosition'.
|
|
288
|
+
*
|
|
289
|
+
* Options:
|
|
290
|
+
* vertical: [top, center, bottom];
|
|
291
|
+
* horizontal: [left, center, right].
|
|
292
|
+
* @default {
|
|
293
|
+
* vertical: 'top',
|
|
294
|
+
* horizontal: 'left',
|
|
295
|
+
* }
|
|
296
|
+
*/
|
|
297
|
+
anchorOrigin: e.shape({
|
|
298
|
+
horizontal: e.oneOfType([e.oneOf(["center", "left", "right"]), e.number]).isRequired,
|
|
299
|
+
vertical: e.oneOfType([e.oneOf(["bottom", "center", "top"]), e.number]).isRequired
|
|
300
|
+
}),
|
|
301
|
+
/**
|
|
302
|
+
* This is the position that may be used to set the position of the popover.
|
|
303
|
+
* The coordinates are relative to the application's client area.
|
|
304
|
+
*/
|
|
305
|
+
anchorPosition: e.shape({
|
|
306
|
+
left: e.number.isRequired,
|
|
307
|
+
top: e.number.isRequired
|
|
308
|
+
}),
|
|
309
|
+
/**
|
|
310
|
+
* This determines which anchor prop to refer to when setting
|
|
311
|
+
* the position of the popover.
|
|
312
|
+
* @default 'anchorEl'
|
|
313
|
+
*/
|
|
314
|
+
anchorReference: e.oneOf(["anchorEl", "anchorPosition", "none"]),
|
|
315
|
+
/**
|
|
316
|
+
* A backdrop component. This prop enables custom backdrop rendering.
|
|
317
|
+
* @deprecated Use `slotProps.root.slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
|
|
318
|
+
* Use the `slotProps.root.slots.backdrop` prop to make your application ready for the next version of Material UI.
|
|
319
|
+
* @default styled(Backdrop, {
|
|
320
|
+
* name: 'MuiModal',
|
|
321
|
+
* slot: 'Backdrop',
|
|
322
|
+
* overridesResolver: (props, styles) => {
|
|
323
|
+
* return styles.backdrop;
|
|
324
|
+
* },
|
|
325
|
+
* })({
|
|
326
|
+
* zIndex: -1,
|
|
327
|
+
* })
|
|
328
|
+
*/
|
|
329
|
+
BackdropComponent: e.elementType,
|
|
330
|
+
/**
|
|
331
|
+
* Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
|
|
332
|
+
* @deprecated Use `slotProps.root.slotProps.backdrop` instead.
|
|
333
|
+
*/
|
|
334
|
+
BackdropProps: e.object,
|
|
335
|
+
/**
|
|
336
|
+
* The content of the component.
|
|
337
|
+
*/
|
|
338
|
+
children: e.node,
|
|
339
|
+
/**
|
|
340
|
+
* Override or extend the styles applied to the component.
|
|
341
|
+
*/
|
|
342
|
+
classes: e.object,
|
|
343
|
+
/**
|
|
344
|
+
* @ignore
|
|
345
|
+
*/
|
|
346
|
+
className: e.string,
|
|
347
|
+
/**
|
|
348
|
+
* An HTML element, component instance, or function that returns either.
|
|
349
|
+
* The `container` will passed to the Modal component.
|
|
350
|
+
*
|
|
351
|
+
* By default, it uses the body of the anchorEl's top-level document object,
|
|
352
|
+
* so it's simply `document.body` most of the time.
|
|
353
|
+
*/
|
|
354
|
+
container: e.oneOfType([Q, e.func]),
|
|
355
|
+
/**
|
|
356
|
+
* Disable the scroll lock behavior.
|
|
357
|
+
* @default false
|
|
358
|
+
*/
|
|
359
|
+
disableScrollLock: e.bool,
|
|
360
|
+
/**
|
|
361
|
+
* The elevation of the popover.
|
|
362
|
+
* @default 8
|
|
363
|
+
*/
|
|
364
|
+
elevation: Me,
|
|
365
|
+
/**
|
|
366
|
+
* Specifies how close to the edge of the window the popover can appear.
|
|
367
|
+
* If null, the popover will not be constrained by the window.
|
|
368
|
+
* @default 16
|
|
369
|
+
*/
|
|
370
|
+
marginThreshold: e.number,
|
|
371
|
+
/**
|
|
372
|
+
* Callback fired when the component requests to be closed.
|
|
373
|
+
* The `reason` parameter can optionally be used to control the response to `onClose`.
|
|
374
|
+
*/
|
|
375
|
+
onClose: e.func,
|
|
376
|
+
/**
|
|
377
|
+
* If `true`, the component is shown.
|
|
378
|
+
*/
|
|
379
|
+
open: e.bool.isRequired,
|
|
380
|
+
/**
|
|
381
|
+
* Props applied to the [`Paper`](https://mui.com/material-ui/api/paper/) element.
|
|
382
|
+
*
|
|
383
|
+
* This prop is an alias for `slotProps.paper` and will be overriden by it if both are used.
|
|
384
|
+
* @deprecated Use `slotProps.paper` instead.
|
|
385
|
+
*
|
|
386
|
+
* @default {}
|
|
387
|
+
*/
|
|
388
|
+
PaperProps: e.shape({
|
|
389
|
+
component: Re
|
|
390
|
+
}),
|
|
391
|
+
/**
|
|
392
|
+
* The props used for each slot inside.
|
|
393
|
+
* @default {}
|
|
394
|
+
*/
|
|
395
|
+
slotProps: e.shape({
|
|
396
|
+
paper: e.oneOfType([e.func, e.object]),
|
|
397
|
+
root: e.oneOfType([e.func, e.object])
|
|
398
|
+
}),
|
|
399
|
+
/**
|
|
400
|
+
* The components used for each slot inside.
|
|
401
|
+
* @default {}
|
|
402
|
+
*/
|
|
403
|
+
slots: e.shape({
|
|
404
|
+
paper: e.elementType,
|
|
405
|
+
root: e.elementType
|
|
406
|
+
}),
|
|
407
|
+
/**
|
|
408
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
409
|
+
*/
|
|
410
|
+
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
|
|
411
|
+
/**
|
|
412
|
+
* This is the point on the popover which
|
|
413
|
+
* will attach to the anchor's origin.
|
|
414
|
+
*
|
|
415
|
+
* Options:
|
|
416
|
+
* vertical: [top, center, bottom, x(px)];
|
|
417
|
+
* horizontal: [left, center, right, x(px)].
|
|
418
|
+
* @default {
|
|
419
|
+
* vertical: 'top',
|
|
420
|
+
* horizontal: 'left',
|
|
421
|
+
* }
|
|
422
|
+
*/
|
|
423
|
+
transformOrigin: e.shape({
|
|
424
|
+
horizontal: e.oneOfType([e.oneOf(["center", "left", "right"]), e.number]).isRequired,
|
|
425
|
+
vertical: e.oneOfType([e.oneOf(["bottom", "center", "top"]), e.number]).isRequired
|
|
426
|
+
}),
|
|
427
|
+
/**
|
|
428
|
+
* The component used for the transition.
|
|
429
|
+
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
430
|
+
* @default Grow
|
|
431
|
+
*/
|
|
432
|
+
TransitionComponent: e.elementType,
|
|
433
|
+
/**
|
|
434
|
+
* Set to 'auto' to automatically calculate transition time based on height.
|
|
435
|
+
* @default 'auto'
|
|
436
|
+
*/
|
|
437
|
+
transitionDuration: e.oneOfType([e.oneOf(["auto"]), e.number, e.shape({
|
|
438
|
+
appear: e.number,
|
|
439
|
+
enter: e.number,
|
|
440
|
+
exit: e.number
|
|
441
|
+
})]),
|
|
442
|
+
/**
|
|
443
|
+
* Props applied to the transition element.
|
|
444
|
+
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
445
|
+
* @default {}
|
|
446
|
+
*/
|
|
447
|
+
TransitionProps: e.object
|
|
448
|
+
});
|
|
449
|
+
export {
|
|
450
|
+
Ue as P
|
|
451
|
+
};
|