@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
|
@@ -1,406 +1,798 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { useContext as
|
|
4
|
-
import { NotificationAPIContext as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
process.env.NODE_ENV !== "production" && (D.displayName = "ExclamationCircleFilled");
|
|
26
|
-
var ze = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, name: "info-circle", theme: "filled" }, Ne = function(e, n) {
|
|
27
|
-
return /* @__PURE__ */ i.createElement(E, $({}, e, {
|
|
28
|
-
ref: n,
|
|
29
|
-
icon: ze
|
|
30
|
-
}));
|
|
31
|
-
}, W = /* @__PURE__ */ i.forwardRef(Ne);
|
|
32
|
-
process.env.NODE_ENV !== "production" && (W.displayName = "InfoCircleFilled");
|
|
33
|
-
const x = (o, e, n, t, l) => ({
|
|
34
|
-
background: o,
|
|
35
|
-
border: `${V(t.lineWidth)} ${t.lineType} ${e}`,
|
|
36
|
-
[`${l}-icon`]: {
|
|
37
|
-
color: n
|
|
38
|
-
}
|
|
39
|
-
}), we = (o) => {
|
|
1
|
+
import { jsx as r, jsxs as R } from "react/jsx-runtime";
|
|
2
|
+
import * as I from "react";
|
|
3
|
+
import { useContext as oo } from "react";
|
|
4
|
+
import { NotificationAPIContext as to } from "../components/Provider/context.js";
|
|
5
|
+
import { c as m } from "./createSvgIcon.js";
|
|
6
|
+
import { g as G, a as _, s as S, h as i, m as Z, r as j, t as V, u as Y, c as L, P as t, f as q, v as eo, b as O, w as no } from "./DefaultPropsProvider.js";
|
|
7
|
+
import { u as H, B as ao } from "./ButtonBase.js";
|
|
8
|
+
import { c as P } from "./createSimplePaletteValueFilter.js";
|
|
9
|
+
import { P as ro } from "./Paper.js";
|
|
10
|
+
import { I as so } from "./IconButton.js";
|
|
11
|
+
function io(o) {
|
|
12
|
+
return _("MuiAlert", o);
|
|
13
|
+
}
|
|
14
|
+
const F = G("MuiAlert", ["root", "action", "icon", "message", "filled", "colorSuccess", "colorInfo", "colorWarning", "colorError", "filledSuccess", "filledInfo", "filledWarning", "filledError", "outlined", "outlinedSuccess", "outlinedInfo", "outlinedWarning", "outlinedError", "standard", "standardSuccess", "standardInfo", "standardWarning", "standardError"]), lo = m(/* @__PURE__ */ r("path", {
|
|
15
|
+
d: "M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"
|
|
16
|
+
}), "SuccessOutlined"), co = m(/* @__PURE__ */ r("path", {
|
|
17
|
+
d: "M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"
|
|
18
|
+
}), "ReportProblemOutlined"), po = m(/* @__PURE__ */ r("path", {
|
|
19
|
+
d: "M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
|
20
|
+
}), "ErrorOutline"), uo = m(/* @__PURE__ */ r("path", {
|
|
21
|
+
d: "M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
22
|
+
}), "InfoOutlined"), vo = m(/* @__PURE__ */ r("path", {
|
|
23
|
+
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
24
|
+
}), "Close"), go = (o) => {
|
|
40
25
|
const {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
26
|
+
variant: n,
|
|
27
|
+
color: a,
|
|
28
|
+
severity: e,
|
|
29
|
+
classes: s
|
|
30
|
+
} = o, l = {
|
|
31
|
+
root: ["root", `color${i(a || e)}`, `${n}${i(a || e)}`, `${n}`],
|
|
32
|
+
icon: ["icon"],
|
|
33
|
+
message: ["message"],
|
|
34
|
+
action: ["action"]
|
|
35
|
+
};
|
|
36
|
+
return q(l, io, s);
|
|
37
|
+
}, fo = S(ro, {
|
|
38
|
+
name: "MuiAlert",
|
|
39
|
+
slot: "Root",
|
|
40
|
+
overridesResolver: (o, n) => {
|
|
41
|
+
const {
|
|
42
|
+
ownerState: a
|
|
43
|
+
} = o;
|
|
44
|
+
return [n.root, n[a.variant], n[`${a.variant}${i(a.color || a.severity)}`]];
|
|
45
|
+
}
|
|
46
|
+
})(Z(({
|
|
47
|
+
theme: o
|
|
48
|
+
}) => {
|
|
49
|
+
const n = o.palette.mode === "light" ? j : V, a = o.palette.mode === "light" ? V : j;
|
|
56
50
|
return {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
direction: "rtl"
|
|
66
|
-
},
|
|
67
|
-
[`${e}-content`]: {
|
|
68
|
-
flex: 1,
|
|
69
|
-
minWidth: 0
|
|
70
|
-
},
|
|
71
|
-
[`${e}-icon`]: {
|
|
72
|
-
marginInlineEnd: t,
|
|
73
|
-
lineHeight: 0
|
|
74
|
-
},
|
|
75
|
-
"&-description": {
|
|
76
|
-
display: "none",
|
|
77
|
-
fontSize: c,
|
|
78
|
-
lineHeight: p
|
|
79
|
-
},
|
|
80
|
-
"&-message": {
|
|
81
|
-
color: C
|
|
82
|
-
},
|
|
83
|
-
[`&${e}-motion-leave`]: {
|
|
84
|
-
overflow: "hidden",
|
|
85
|
-
opacity: 1,
|
|
86
|
-
transition: `max-height ${n} ${m}, opacity ${n} ${m},
|
|
87
|
-
padding-top ${n} ${m}, padding-bottom ${n} ${m},
|
|
88
|
-
margin-bottom ${n} ${m}`
|
|
51
|
+
...o.typography.body2,
|
|
52
|
+
backgroundColor: "transparent",
|
|
53
|
+
display: "flex",
|
|
54
|
+
padding: "6px 16px",
|
|
55
|
+
variants: [...Object.entries(o.palette).filter(P(["light"])).map(([e]) => ({
|
|
56
|
+
props: {
|
|
57
|
+
colorSeverity: e,
|
|
58
|
+
variant: "standard"
|
|
89
59
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
60
|
+
style: {
|
|
61
|
+
color: o.vars ? o.vars.palette.Alert[`${e}Color`] : n(o.palette[e].light, 0.6),
|
|
62
|
+
backgroundColor: o.vars ? o.vars.palette.Alert[`${e}StandardBg`] : a(o.palette[e].light, 0.9),
|
|
63
|
+
[`& .${F.icon}`]: o.vars ? {
|
|
64
|
+
color: o.vars.palette.Alert[`${e}IconColor`]
|
|
65
|
+
} : {
|
|
66
|
+
color: o.palette[e].main
|
|
67
|
+
}
|
|
96
68
|
}
|
|
97
|
-
}),
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
[`${e}-icon`]: {
|
|
102
|
-
marginInlineEnd: l,
|
|
103
|
-
fontSize: v,
|
|
104
|
-
lineHeight: 0
|
|
69
|
+
})), ...Object.entries(o.palette).filter(P(["light"])).map(([e]) => ({
|
|
70
|
+
props: {
|
|
71
|
+
colorSeverity: e,
|
|
72
|
+
variant: "outlined"
|
|
105
73
|
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
74
|
+
style: {
|
|
75
|
+
color: o.vars ? o.vars.palette.Alert[`${e}Color`] : n(o.palette[e].light, 0.6),
|
|
76
|
+
border: `1px solid ${(o.vars || o).palette[e].light}`,
|
|
77
|
+
[`& .${F.icon}`]: o.vars ? {
|
|
78
|
+
color: o.vars.palette.Alert[`${e}IconColor`]
|
|
79
|
+
} : {
|
|
80
|
+
color: o.palette[e].main
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
})), ...Object.entries(o.palette).filter(P(["dark"])).map(([e]) => ({
|
|
84
|
+
props: {
|
|
85
|
+
colorSeverity: e,
|
|
86
|
+
variant: "filled"
|
|
111
87
|
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
88
|
+
style: {
|
|
89
|
+
fontWeight: o.typography.fontWeightMedium,
|
|
90
|
+
...o.vars ? {
|
|
91
|
+
color: o.vars.palette.Alert[`${e}FilledColor`],
|
|
92
|
+
backgroundColor: o.vars.palette.Alert[`${e}FilledBg`]
|
|
93
|
+
} : {
|
|
94
|
+
backgroundColor: o.palette.mode === "dark" ? o.palette[e].dark : o.palette[e].main,
|
|
95
|
+
color: o.palette.getContrastText(o.palette[e].main)
|
|
96
|
+
}
|
|
115
97
|
}
|
|
98
|
+
}))]
|
|
99
|
+
};
|
|
100
|
+
})), yo = S("div", {
|
|
101
|
+
name: "MuiAlert",
|
|
102
|
+
slot: "Icon",
|
|
103
|
+
overridesResolver: (o, n) => n.icon
|
|
104
|
+
})({
|
|
105
|
+
marginRight: 12,
|
|
106
|
+
padding: "7px 0",
|
|
107
|
+
display: "flex",
|
|
108
|
+
fontSize: 22,
|
|
109
|
+
opacity: 0.9
|
|
110
|
+
}), xo = S("div", {
|
|
111
|
+
name: "MuiAlert",
|
|
112
|
+
slot: "Message",
|
|
113
|
+
overridesResolver: (o, n) => n.message
|
|
114
|
+
})({
|
|
115
|
+
padding: "8px 0",
|
|
116
|
+
minWidth: 0,
|
|
117
|
+
overflow: "auto"
|
|
118
|
+
}), D = S("div", {
|
|
119
|
+
name: "MuiAlert",
|
|
120
|
+
slot: "Action",
|
|
121
|
+
overridesResolver: (o, n) => n.action
|
|
122
|
+
})({
|
|
123
|
+
display: "flex",
|
|
124
|
+
alignItems: "flex-start",
|
|
125
|
+
padding: "4px 0 0 16px",
|
|
126
|
+
marginLeft: "auto",
|
|
127
|
+
marginRight: -8
|
|
128
|
+
}), U = {
|
|
129
|
+
success: /* @__PURE__ */ r(lo, {
|
|
130
|
+
fontSize: "inherit"
|
|
131
|
+
}),
|
|
132
|
+
warning: /* @__PURE__ */ r(co, {
|
|
133
|
+
fontSize: "inherit"
|
|
134
|
+
}),
|
|
135
|
+
error: /* @__PURE__ */ r(po, {
|
|
136
|
+
fontSize: "inherit"
|
|
137
|
+
}),
|
|
138
|
+
info: /* @__PURE__ */ r(uo, {
|
|
139
|
+
fontSize: "inherit"
|
|
140
|
+
})
|
|
141
|
+
}, J = /* @__PURE__ */ I.forwardRef(function(n, a) {
|
|
142
|
+
const e = Y({
|
|
143
|
+
props: n,
|
|
144
|
+
name: "MuiAlert"
|
|
145
|
+
}), {
|
|
146
|
+
action: s,
|
|
147
|
+
children: l,
|
|
148
|
+
className: d,
|
|
149
|
+
closeText: u = "Close",
|
|
150
|
+
color: c,
|
|
151
|
+
components: v = {},
|
|
152
|
+
componentsProps: h = {},
|
|
153
|
+
icon: g,
|
|
154
|
+
iconMapping: B = U,
|
|
155
|
+
onClose: f,
|
|
156
|
+
role: w = "alert",
|
|
157
|
+
severity: C = "success",
|
|
158
|
+
slotProps: A = {},
|
|
159
|
+
slots: T = {},
|
|
160
|
+
variant: $ = "standard",
|
|
161
|
+
...M
|
|
162
|
+
} = e, p = {
|
|
163
|
+
...e,
|
|
164
|
+
color: c,
|
|
165
|
+
severity: C,
|
|
166
|
+
variant: $,
|
|
167
|
+
colorSeverity: c || C
|
|
168
|
+
}, y = go(p), x = {
|
|
169
|
+
slots: {
|
|
170
|
+
closeButton: v.CloseButton,
|
|
171
|
+
closeIcon: v.CloseIcon,
|
|
172
|
+
...T
|
|
116
173
|
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
borderRadius: 0
|
|
174
|
+
slotProps: {
|
|
175
|
+
...h,
|
|
176
|
+
...A
|
|
121
177
|
}
|
|
122
|
-
}
|
|
123
|
-
|
|
178
|
+
}, [b, N] = H("closeButton", {
|
|
179
|
+
elementType: so,
|
|
180
|
+
externalForwardedProps: x,
|
|
181
|
+
ownerState: p
|
|
182
|
+
}), [E, W] = H("closeIcon", {
|
|
183
|
+
elementType: vo,
|
|
184
|
+
externalForwardedProps: x,
|
|
185
|
+
ownerState: p
|
|
186
|
+
});
|
|
187
|
+
return /* @__PURE__ */ R(fo, {
|
|
188
|
+
role: w,
|
|
189
|
+
elevation: 0,
|
|
190
|
+
ownerState: p,
|
|
191
|
+
className: L(y.root, d),
|
|
192
|
+
ref: a,
|
|
193
|
+
...M,
|
|
194
|
+
children: [g !== !1 ? /* @__PURE__ */ r(yo, {
|
|
195
|
+
ownerState: p,
|
|
196
|
+
className: y.icon,
|
|
197
|
+
children: g || B[C] || U[C]
|
|
198
|
+
}) : null, /* @__PURE__ */ r(xo, {
|
|
199
|
+
ownerState: p,
|
|
200
|
+
className: y.message,
|
|
201
|
+
children: l
|
|
202
|
+
}), s != null ? /* @__PURE__ */ r(D, {
|
|
203
|
+
ownerState: p,
|
|
204
|
+
className: y.action,
|
|
205
|
+
children: s
|
|
206
|
+
}) : null, s == null && f ? /* @__PURE__ */ r(D, {
|
|
207
|
+
ownerState: p,
|
|
208
|
+
className: y.action,
|
|
209
|
+
children: /* @__PURE__ */ r(b, {
|
|
210
|
+
size: "small",
|
|
211
|
+
"aria-label": u,
|
|
212
|
+
title: u,
|
|
213
|
+
color: "inherit",
|
|
214
|
+
onClick: f,
|
|
215
|
+
...N,
|
|
216
|
+
children: /* @__PURE__ */ r(E, {
|
|
217
|
+
fontSize: "small",
|
|
218
|
+
...W
|
|
219
|
+
})
|
|
220
|
+
})
|
|
221
|
+
}) : null]
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
process.env.NODE_ENV !== "production" && (J.propTypes = {
|
|
225
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
226
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
227
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
228
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
229
|
+
/**
|
|
230
|
+
* The action to display. It renders after the message, at the end of the alert.
|
|
231
|
+
*/
|
|
232
|
+
action: t.node,
|
|
233
|
+
/**
|
|
234
|
+
* The content of the component.
|
|
235
|
+
*/
|
|
236
|
+
children: t.node,
|
|
237
|
+
/**
|
|
238
|
+
* Override or extend the styles applied to the component.
|
|
239
|
+
*/
|
|
240
|
+
classes: t.object,
|
|
241
|
+
/**
|
|
242
|
+
* @ignore
|
|
243
|
+
*/
|
|
244
|
+
className: t.string,
|
|
245
|
+
/**
|
|
246
|
+
* Override the default label for the *close popup* icon button.
|
|
247
|
+
*
|
|
248
|
+
* For localization purposes, you can use the provided [translations](https://mui.com/material-ui/guides/localization/).
|
|
249
|
+
* @default 'Close'
|
|
250
|
+
*/
|
|
251
|
+
closeText: t.string,
|
|
252
|
+
/**
|
|
253
|
+
* The color of the component. Unless provided, the value is taken from the `severity` prop.
|
|
254
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
255
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
256
|
+
*/
|
|
257
|
+
color: t.oneOfType([t.oneOf(["error", "info", "success", "warning"]), t.string]),
|
|
258
|
+
/**
|
|
259
|
+
* The components used for each slot inside.
|
|
260
|
+
*
|
|
261
|
+
* @deprecated use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
262
|
+
*
|
|
263
|
+
* @default {}
|
|
264
|
+
*/
|
|
265
|
+
components: t.shape({
|
|
266
|
+
CloseButton: t.elementType,
|
|
267
|
+
CloseIcon: t.elementType
|
|
268
|
+
}),
|
|
269
|
+
/**
|
|
270
|
+
* The extra props for the slot components.
|
|
271
|
+
* You can override the existing props or add new ones.
|
|
272
|
+
*
|
|
273
|
+
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
274
|
+
*
|
|
275
|
+
* @default {}
|
|
276
|
+
*/
|
|
277
|
+
componentsProps: t.shape({
|
|
278
|
+
closeButton: t.object,
|
|
279
|
+
closeIcon: t.object
|
|
280
|
+
}),
|
|
281
|
+
/**
|
|
282
|
+
* Override the icon displayed before the children.
|
|
283
|
+
* Unless provided, the icon is mapped to the value of the `severity` prop.
|
|
284
|
+
* Set to `false` to remove the `icon`.
|
|
285
|
+
*/
|
|
286
|
+
icon: t.node,
|
|
287
|
+
/**
|
|
288
|
+
* The component maps the `severity` prop to a range of different icons,
|
|
289
|
+
* for instance success to `<SuccessOutlined>`.
|
|
290
|
+
* If you wish to change this mapping, you can provide your own.
|
|
291
|
+
* Alternatively, you can use the `icon` prop to override the icon displayed.
|
|
292
|
+
*/
|
|
293
|
+
iconMapping: t.shape({
|
|
294
|
+
error: t.node,
|
|
295
|
+
info: t.node,
|
|
296
|
+
success: t.node,
|
|
297
|
+
warning: t.node
|
|
298
|
+
}),
|
|
299
|
+
/**
|
|
300
|
+
* Callback fired when the component requests to be closed.
|
|
301
|
+
* When provided and no `action` prop is set, a close icon button is displayed that triggers the callback when clicked.
|
|
302
|
+
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
303
|
+
*/
|
|
304
|
+
onClose: t.func,
|
|
305
|
+
/**
|
|
306
|
+
* The ARIA role attribute of the element.
|
|
307
|
+
* @default 'alert'
|
|
308
|
+
*/
|
|
309
|
+
role: t.string,
|
|
310
|
+
/**
|
|
311
|
+
* The severity of the alert. This defines the color and icon used.
|
|
312
|
+
* @default 'success'
|
|
313
|
+
*/
|
|
314
|
+
severity: t.oneOfType([t.oneOf(["error", "info", "success", "warning"]), t.string]),
|
|
315
|
+
/**
|
|
316
|
+
* The props used for each slot inside.
|
|
317
|
+
* @default {}
|
|
318
|
+
*/
|
|
319
|
+
slotProps: t.shape({
|
|
320
|
+
closeButton: t.oneOfType([t.func, t.object]),
|
|
321
|
+
closeIcon: t.oneOfType([t.func, t.object])
|
|
322
|
+
}),
|
|
323
|
+
/**
|
|
324
|
+
* The components used for each slot inside.
|
|
325
|
+
* @default {}
|
|
326
|
+
*/
|
|
327
|
+
slots: t.shape({
|
|
328
|
+
closeButton: t.elementType,
|
|
329
|
+
closeIcon: t.elementType
|
|
330
|
+
}),
|
|
331
|
+
/**
|
|
332
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
333
|
+
*/
|
|
334
|
+
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
|
|
335
|
+
/**
|
|
336
|
+
* The variant to use.
|
|
337
|
+
* @default 'standard'
|
|
338
|
+
*/
|
|
339
|
+
variant: t.oneOfType([t.oneOf(["filled", "outlined", "standard"]), t.string])
|
|
340
|
+
});
|
|
341
|
+
function bo(o) {
|
|
342
|
+
return _("MuiButton", o);
|
|
343
|
+
}
|
|
344
|
+
const z = G("MuiButton", ["root", "text", "textInherit", "textPrimary", "textSecondary", "textSuccess", "textError", "textInfo", "textWarning", "outlined", "outlinedInherit", "outlinedPrimary", "outlinedSecondary", "outlinedSuccess", "outlinedError", "outlinedInfo", "outlinedWarning", "contained", "containedInherit", "containedPrimary", "containedSecondary", "containedSuccess", "containedError", "containedInfo", "containedWarning", "disableElevation", "focusVisible", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorSuccess", "colorError", "colorInfo", "colorWarning", "textSizeSmall", "textSizeMedium", "textSizeLarge", "outlinedSizeSmall", "outlinedSizeMedium", "outlinedSizeLarge", "containedSizeSmall", "containedSizeMedium", "containedSizeLarge", "sizeMedium", "sizeSmall", "sizeLarge", "fullWidth", "startIcon", "endIcon", "icon", "iconSizeSmall", "iconSizeMedium", "iconSizeLarge"]), K = /* @__PURE__ */ I.createContext({});
|
|
345
|
+
process.env.NODE_ENV !== "production" && (K.displayName = "ButtonGroupContext");
|
|
346
|
+
const Q = /* @__PURE__ */ I.createContext(void 0);
|
|
347
|
+
process.env.NODE_ENV !== "production" && (Q.displayName = "ButtonGroupButtonContext");
|
|
348
|
+
const So = (o) => {
|
|
124
349
|
const {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
colorInfoBg: h
|
|
138
|
-
} = o;
|
|
350
|
+
color: n,
|
|
351
|
+
disableElevation: a,
|
|
352
|
+
fullWidth: e,
|
|
353
|
+
size: s,
|
|
354
|
+
variant: l,
|
|
355
|
+
classes: d
|
|
356
|
+
} = o, u = {
|
|
357
|
+
root: ["root", l, `${l}${i(n)}`, `size${i(s)}`, `${l}Size${i(s)}`, `color${i(n)}`, a && "disableElevation", e && "fullWidth"],
|
|
358
|
+
label: ["label"],
|
|
359
|
+
startIcon: ["icon", "startIcon", `iconSize${i(s)}`],
|
|
360
|
+
endIcon: ["icon", "endIcon", `iconSize${i(s)}`]
|
|
361
|
+
}, c = q(u, bo, d);
|
|
139
362
|
return {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
"&-warning": x(p, a, c, o, e),
|
|
144
|
-
"&-error": Object.assign(Object.assign({}, x(v, m, d, o, e)), {
|
|
145
|
-
[`${e}-description > pre`]: {
|
|
146
|
-
margin: 0,
|
|
147
|
-
padding: 0
|
|
148
|
-
}
|
|
149
|
-
})
|
|
150
|
-
}
|
|
363
|
+
...d,
|
|
364
|
+
// forward the focused, disabled, etc. classes to the ButtonBase
|
|
365
|
+
...c
|
|
151
366
|
};
|
|
152
|
-
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
367
|
+
}, X = [{
|
|
368
|
+
props: {
|
|
369
|
+
size: "small"
|
|
370
|
+
},
|
|
371
|
+
style: {
|
|
372
|
+
"& > *:nth-of-type(1)": {
|
|
373
|
+
fontSize: 18
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}, {
|
|
377
|
+
props: {
|
|
378
|
+
size: "medium"
|
|
379
|
+
},
|
|
380
|
+
style: {
|
|
381
|
+
"& > *:nth-of-type(1)": {
|
|
382
|
+
fontSize: 20
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}, {
|
|
386
|
+
props: {
|
|
387
|
+
size: "large"
|
|
388
|
+
},
|
|
389
|
+
style: {
|
|
390
|
+
"& > *:nth-of-type(1)": {
|
|
391
|
+
fontSize: 22
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}], Co = S(ao, {
|
|
395
|
+
shouldForwardProp: (o) => eo(o) || o === "classes",
|
|
396
|
+
name: "MuiButton",
|
|
397
|
+
slot: "Root",
|
|
398
|
+
overridesResolver: (o, n) => {
|
|
399
|
+
const {
|
|
400
|
+
ownerState: a
|
|
401
|
+
} = o;
|
|
402
|
+
return [n.root, n[a.variant], n[`${a.variant}${i(a.color)}`], n[`size${i(a.size)}`], n[`${a.variant}Size${i(a.size)}`], a.color === "inherit" && n.colorInherit, a.disableElevation && n.disableElevation, a.fullWidth && n.fullWidth];
|
|
403
|
+
}
|
|
404
|
+
})(Z(({
|
|
405
|
+
theme: o
|
|
406
|
+
}) => {
|
|
407
|
+
const n = o.palette.mode === "light" ? o.palette.grey[300] : o.palette.grey[800], a = o.palette.mode === "light" ? o.palette.grey.A100 : o.palette.grey[700];
|
|
162
408
|
return {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
409
|
+
...o.typography.button,
|
|
410
|
+
minWidth: 64,
|
|
411
|
+
padding: "6px 16px",
|
|
412
|
+
border: 0,
|
|
413
|
+
borderRadius: (o.vars || o).shape.borderRadius,
|
|
414
|
+
transition: o.transitions.create(["background-color", "box-shadow", "border-color", "color"], {
|
|
415
|
+
duration: o.transitions.duration.short
|
|
416
|
+
}),
|
|
417
|
+
"&:hover": {
|
|
418
|
+
textDecoration: "none"
|
|
419
|
+
},
|
|
420
|
+
[`&.${z.disabled}`]: {
|
|
421
|
+
color: (o.vars || o).palette.action.disabled
|
|
422
|
+
},
|
|
423
|
+
variants: [{
|
|
424
|
+
props: {
|
|
425
|
+
variant: "contained"
|
|
426
|
+
},
|
|
427
|
+
style: {
|
|
428
|
+
color: "var(--variant-containedColor)",
|
|
429
|
+
backgroundColor: "var(--variant-containedBg)",
|
|
430
|
+
boxShadow: (o.vars || o).shadows[2],
|
|
431
|
+
"&:hover": {
|
|
432
|
+
boxShadow: (o.vars || o).shadows[4],
|
|
433
|
+
// Reset on touch devices, it doesn't add specificity
|
|
434
|
+
"@media (hover: none)": {
|
|
435
|
+
boxShadow: (o.vars || o).shadows[2]
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
"&:active": {
|
|
439
|
+
boxShadow: (o.vars || o).shadows[8]
|
|
440
|
+
},
|
|
441
|
+
[`&.${z.focusVisible}`]: {
|
|
442
|
+
boxShadow: (o.vars || o).shadows[6]
|
|
443
|
+
},
|
|
444
|
+
[`&.${z.disabled}`]: {
|
|
445
|
+
color: (o.vars || o).palette.action.disabled,
|
|
446
|
+
boxShadow: (o.vars || o).shadows[0],
|
|
447
|
+
backgroundColor: (o.vars || o).palette.action.disabledBackground
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}, {
|
|
451
|
+
props: {
|
|
452
|
+
variant: "outlined"
|
|
453
|
+
},
|
|
454
|
+
style: {
|
|
455
|
+
padding: "5px 15px",
|
|
456
|
+
border: "1px solid currentColor",
|
|
457
|
+
borderColor: "var(--variant-outlinedBorder, currentColor)",
|
|
458
|
+
backgroundColor: "var(--variant-outlinedBg)",
|
|
459
|
+
color: "var(--variant-outlinedColor)",
|
|
460
|
+
[`&.${z.disabled}`]: {
|
|
461
|
+
border: `1px solid ${(o.vars || o).palette.action.disabledBackground}`
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}, {
|
|
465
|
+
props: {
|
|
466
|
+
variant: "text"
|
|
166
467
|
},
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
468
|
+
style: {
|
|
469
|
+
padding: "6px 8px",
|
|
470
|
+
color: "var(--variant-textColor)",
|
|
471
|
+
backgroundColor: "var(--variant-textBg)"
|
|
472
|
+
}
|
|
473
|
+
}, ...Object.entries(o.palette).filter(P()).map(([e]) => ({
|
|
474
|
+
props: {
|
|
475
|
+
color: e
|
|
476
|
+
},
|
|
477
|
+
style: {
|
|
478
|
+
"--variant-textColor": (o.vars || o).palette[e].main,
|
|
479
|
+
"--variant-outlinedColor": (o.vars || o).palette[e].main,
|
|
480
|
+
"--variant-outlinedBorder": o.vars ? `rgba(${o.vars.palette[e].mainChannel} / 0.5)` : O(o.palette[e].main, 0.5),
|
|
481
|
+
"--variant-containedColor": (o.vars || o).palette[e].contrastText,
|
|
482
|
+
"--variant-containedBg": (o.vars || o).palette[e].main,
|
|
483
|
+
"@media (hover: hover)": {
|
|
484
|
+
"&:hover": {
|
|
485
|
+
"--variant-containedBg": (o.vars || o).palette[e].dark,
|
|
486
|
+
"--variant-textBg": o.vars ? `rgba(${o.vars.palette[e].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : O(o.palette[e].main, o.palette.action.hoverOpacity),
|
|
487
|
+
"--variant-outlinedBorder": (o.vars || o).palette[e].main,
|
|
488
|
+
"--variant-outlinedBg": o.vars ? `rgba(${o.vars.palette[e].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : O(o.palette[e].main, o.palette.action.hoverOpacity)
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
})), {
|
|
493
|
+
props: {
|
|
494
|
+
color: "inherit"
|
|
495
|
+
},
|
|
496
|
+
style: {
|
|
497
|
+
color: "inherit",
|
|
498
|
+
borderColor: "currentColor",
|
|
499
|
+
"--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedBg : n,
|
|
500
|
+
"@media (hover: hover)": {
|
|
180
501
|
"&:hover": {
|
|
181
|
-
|
|
502
|
+
"--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedHoverBg : a,
|
|
503
|
+
"--variant-textBg": o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})` : O(o.palette.text.primary, o.palette.action.hoverOpacity),
|
|
504
|
+
"--variant-outlinedBg": o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})` : O(o.palette.text.primary, o.palette.action.hoverOpacity)
|
|
182
505
|
}
|
|
183
506
|
}
|
|
507
|
+
}
|
|
508
|
+
}, {
|
|
509
|
+
props: {
|
|
510
|
+
size: "small",
|
|
511
|
+
variant: "text"
|
|
512
|
+
},
|
|
513
|
+
style: {
|
|
514
|
+
padding: "4px 5px",
|
|
515
|
+
fontSize: o.typography.pxToRem(13)
|
|
516
|
+
}
|
|
517
|
+
}, {
|
|
518
|
+
props: {
|
|
519
|
+
size: "large",
|
|
520
|
+
variant: "text"
|
|
521
|
+
},
|
|
522
|
+
style: {
|
|
523
|
+
padding: "8px 11px",
|
|
524
|
+
fontSize: o.typography.pxToRem(15)
|
|
525
|
+
}
|
|
526
|
+
}, {
|
|
527
|
+
props: {
|
|
528
|
+
size: "small",
|
|
529
|
+
variant: "outlined"
|
|
530
|
+
},
|
|
531
|
+
style: {
|
|
532
|
+
padding: "3px 9px",
|
|
533
|
+
fontSize: o.typography.pxToRem(13)
|
|
534
|
+
}
|
|
535
|
+
}, {
|
|
536
|
+
props: {
|
|
537
|
+
size: "large",
|
|
538
|
+
variant: "outlined"
|
|
539
|
+
},
|
|
540
|
+
style: {
|
|
541
|
+
padding: "7px 21px",
|
|
542
|
+
fontSize: o.typography.pxToRem(15)
|
|
543
|
+
}
|
|
544
|
+
}, {
|
|
545
|
+
props: {
|
|
546
|
+
size: "small",
|
|
547
|
+
variant: "contained"
|
|
548
|
+
},
|
|
549
|
+
style: {
|
|
550
|
+
padding: "4px 10px",
|
|
551
|
+
fontSize: o.typography.pxToRem(13)
|
|
552
|
+
}
|
|
553
|
+
}, {
|
|
554
|
+
props: {
|
|
555
|
+
size: "large",
|
|
556
|
+
variant: "contained"
|
|
557
|
+
},
|
|
558
|
+
style: {
|
|
559
|
+
padding: "8px 22px",
|
|
560
|
+
fontSize: o.typography.pxToRem(15)
|
|
561
|
+
}
|
|
562
|
+
}, {
|
|
563
|
+
props: {
|
|
564
|
+
disableElevation: !0
|
|
184
565
|
},
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
transition: `color ${t}`,
|
|
566
|
+
style: {
|
|
567
|
+
boxShadow: "none",
|
|
188
568
|
"&:hover": {
|
|
189
|
-
|
|
569
|
+
boxShadow: "none"
|
|
570
|
+
},
|
|
571
|
+
[`&.${z.focusVisible}`]: {
|
|
572
|
+
boxShadow: "none"
|
|
573
|
+
},
|
|
574
|
+
"&:active": {
|
|
575
|
+
boxShadow: "none"
|
|
576
|
+
},
|
|
577
|
+
[`&.${z.disabled}`]: {
|
|
578
|
+
boxShadow: "none"
|
|
190
579
|
}
|
|
191
580
|
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}), Re = ae("Alert", (o) => [we(o), Oe(o), Me(o)], Be);
|
|
199
|
-
var j = function(o, e) {
|
|
200
|
-
var n = {};
|
|
201
|
-
for (var t in o) Object.prototype.hasOwnProperty.call(o, t) && e.indexOf(t) < 0 && (n[t] = o[t]);
|
|
202
|
-
if (o != null && typeof Object.getOwnPropertySymbols == "function") for (var l = 0, t = Object.getOwnPropertySymbols(o); l < t.length; l++)
|
|
203
|
-
e.indexOf(t[l]) < 0 && Object.prototype.propertyIsEnumerable.call(o, t[l]) && (n[t[l]] = o[t[l]]);
|
|
204
|
-
return n;
|
|
205
|
-
};
|
|
206
|
-
const Pe = {
|
|
207
|
-
success: k,
|
|
208
|
-
info: W,
|
|
209
|
-
error: ce,
|
|
210
|
-
warning: D
|
|
211
|
-
}, _e = (o) => {
|
|
212
|
-
const {
|
|
213
|
-
icon: e,
|
|
214
|
-
prefixCls: n,
|
|
215
|
-
type: t
|
|
216
|
-
} = o, l = Pe[t] || null;
|
|
217
|
-
return e ? ge(e, /* @__PURE__ */ i.createElement("span", {
|
|
218
|
-
className: `${n}-icon`
|
|
219
|
-
}, e), () => ({
|
|
220
|
-
className: z(`${n}-icon`, {
|
|
221
|
-
[e.props.className]: e.props.className
|
|
222
|
-
})
|
|
223
|
-
})) : /* @__PURE__ */ i.createElement(l, {
|
|
224
|
-
className: `${n}-icon`
|
|
225
|
-
});
|
|
226
|
-
}, He = (o) => {
|
|
227
|
-
const {
|
|
228
|
-
isClosable: e,
|
|
229
|
-
prefixCls: n,
|
|
230
|
-
closeIcon: t,
|
|
231
|
-
handleClose: l,
|
|
232
|
-
ariaProps: c
|
|
233
|
-
} = o, a = t === !0 || t === void 0 ? /* @__PURE__ */ i.createElement(se, null) : t;
|
|
234
|
-
return e ? /* @__PURE__ */ i.createElement("button", Object.assign({
|
|
235
|
-
type: "button",
|
|
236
|
-
onClick: l,
|
|
237
|
-
className: `${n}-close-icon`,
|
|
238
|
-
tabIndex: 0
|
|
239
|
-
}, c), a) : null;
|
|
240
|
-
}, N = /* @__PURE__ */ i.forwardRef((o, e) => {
|
|
241
|
-
const {
|
|
242
|
-
description: n,
|
|
243
|
-
prefixCls: t,
|
|
244
|
-
message: l,
|
|
245
|
-
banner: c,
|
|
246
|
-
className: a,
|
|
247
|
-
rootClassName: p,
|
|
248
|
-
style: d,
|
|
249
|
-
onMouseEnter: m,
|
|
250
|
-
onMouseLeave: v,
|
|
251
|
-
onClick: y,
|
|
252
|
-
afterClose: C,
|
|
253
|
-
showIcon: h,
|
|
254
|
-
closable: s,
|
|
255
|
-
closeText: I,
|
|
256
|
-
closeIcon: b,
|
|
257
|
-
action: w,
|
|
258
|
-
id: T
|
|
259
|
-
} = o, L = j(o, ["description", "prefixCls", "message", "banner", "className", "rootClassName", "style", "onMouseEnter", "onMouseLeave", "onClick", "afterClose", "showIcon", "closable", "closeText", "closeIcon", "action", "id"]), [O, G] = i.useState(!1);
|
|
260
|
-
process.env.NODE_ENV !== "production" && ue("Alert").deprecated(!I, "closeText", "closable.closeIcon");
|
|
261
|
-
const M = i.useRef(null);
|
|
262
|
-
i.useImperativeHandle(e, () => ({
|
|
263
|
-
nativeElement: M.current
|
|
264
|
-
}));
|
|
265
|
-
const {
|
|
266
|
-
getPrefixCls: X,
|
|
267
|
-
direction: U,
|
|
268
|
-
alert: r
|
|
269
|
-
} = i.useContext(pe), u = X("alert", t), [Y, q, J] = Re(u), K = (f) => {
|
|
270
|
-
var g;
|
|
271
|
-
G(!0), (g = o.onClose) === null || g === void 0 || g.call(o, f);
|
|
272
|
-
}, B = i.useMemo(() => o.type !== void 0 ? o.type : c ? "warning" : "info", [o.type, c]), Q = i.useMemo(() => typeof s == "object" && s.closeIcon || I ? !0 : typeof s == "boolean" ? s : b !== !1 && b !== null && b !== void 0 ? !0 : !!(r != null && r.closable), [I, b, s, r == null ? void 0 : r.closable]), R = c && h === void 0 ? !0 : h, Z = z(u, `${u}-${B}`, {
|
|
273
|
-
[`${u}-with-description`]: !!n,
|
|
274
|
-
[`${u}-no-icon`]: !R,
|
|
275
|
-
[`${u}-banner`]: !!c,
|
|
276
|
-
[`${u}-rtl`]: U === "rtl"
|
|
277
|
-
}, r == null ? void 0 : r.className, a, p, J, q), ee = Ie(L, {
|
|
278
|
-
aria: !0,
|
|
279
|
-
data: !0
|
|
280
|
-
}), oe = i.useMemo(() => {
|
|
281
|
-
var f, g;
|
|
282
|
-
return typeof s == "object" && s.closeIcon ? s.closeIcon : I || (b !== void 0 ? b : typeof (r == null ? void 0 : r.closable) == "object" && (!((f = r == null ? void 0 : r.closable) === null || f === void 0) && f.closeIcon) ? (g = r == null ? void 0 : r.closable) === null || g === void 0 ? void 0 : g.closeIcon : r == null ? void 0 : r.closeIcon);
|
|
283
|
-
}, [b, s, I, r == null ? void 0 : r.closeIcon]), ne = i.useMemo(() => {
|
|
284
|
-
const f = s ?? (r == null ? void 0 : r.closable);
|
|
285
|
-
return typeof f == "object" ? j(f, ["closeIcon"]) : {};
|
|
286
|
-
}, [s, r == null ? void 0 : r.closable]);
|
|
287
|
-
return Y(/* @__PURE__ */ i.createElement(me, {
|
|
288
|
-
visible: !O,
|
|
289
|
-
motionName: `${u}-motion`,
|
|
290
|
-
motionAppear: !1,
|
|
291
|
-
motionEnter: !1,
|
|
292
|
-
onLeaveStart: (f) => ({
|
|
293
|
-
maxHeight: f.offsetHeight
|
|
294
|
-
}),
|
|
295
|
-
onLeaveEnd: C
|
|
296
|
-
}, (f, g) => {
|
|
297
|
-
let {
|
|
298
|
-
className: te,
|
|
299
|
-
style: re
|
|
300
|
-
} = f;
|
|
301
|
-
return /* @__PURE__ */ i.createElement("div", Object.assign({
|
|
302
|
-
id: T,
|
|
303
|
-
ref: fe(M, g),
|
|
304
|
-
"data-show": !O,
|
|
305
|
-
className: z(Z, te),
|
|
306
|
-
style: Object.assign(Object.assign(Object.assign({}, r == null ? void 0 : r.style), d), re),
|
|
307
|
-
onMouseEnter: m,
|
|
308
|
-
onMouseLeave: v,
|
|
309
|
-
onClick: y,
|
|
310
|
-
role: "alert"
|
|
311
|
-
}, ee), R ? /* @__PURE__ */ i.createElement(_e, {
|
|
312
|
-
description: n,
|
|
313
|
-
icon: o.icon,
|
|
314
|
-
prefixCls: u,
|
|
315
|
-
type: B
|
|
316
|
-
}) : null, /* @__PURE__ */ i.createElement("div", {
|
|
317
|
-
className: `${u}-content`
|
|
318
|
-
}, l ? /* @__PURE__ */ i.createElement("div", {
|
|
319
|
-
className: `${u}-message`
|
|
320
|
-
}, l) : null, n ? /* @__PURE__ */ i.createElement("div", {
|
|
321
|
-
className: `${u}-description`
|
|
322
|
-
}, n) : null), w ? /* @__PURE__ */ i.createElement("div", {
|
|
323
|
-
className: `${u}-action`
|
|
324
|
-
}, w) : null, /* @__PURE__ */ i.createElement(He, {
|
|
325
|
-
isClosable: Q,
|
|
326
|
-
prefixCls: u,
|
|
327
|
-
closeIcon: oe,
|
|
328
|
-
handleClose: K,
|
|
329
|
-
ariaProps: ne
|
|
330
|
-
}));
|
|
331
|
-
}));
|
|
332
|
-
});
|
|
333
|
-
process.env.NODE_ENV !== "production" && (N.displayName = "Alert");
|
|
334
|
-
function je(o, e, n) {
|
|
335
|
-
return e = _(e), ve(o, ye() ? Reflect.construct(e, n || [], _(o).constructor) : e.apply(o, n));
|
|
336
|
-
}
|
|
337
|
-
let Ve = /* @__PURE__ */ function(o) {
|
|
338
|
-
function e() {
|
|
339
|
-
var n;
|
|
340
|
-
return be(this, e), n = je(this, e, arguments), n.state = {
|
|
341
|
-
error: void 0,
|
|
342
|
-
info: {
|
|
343
|
-
componentStack: ""
|
|
581
|
+
}, {
|
|
582
|
+
props: {
|
|
583
|
+
fullWidth: !0
|
|
584
|
+
},
|
|
585
|
+
style: {
|
|
586
|
+
width: "100%"
|
|
344
587
|
}
|
|
345
|
-
}
|
|
588
|
+
}]
|
|
589
|
+
};
|
|
590
|
+
})), zo = S("span", {
|
|
591
|
+
name: "MuiButton",
|
|
592
|
+
slot: "StartIcon",
|
|
593
|
+
overridesResolver: (o, n) => {
|
|
594
|
+
const {
|
|
595
|
+
ownerState: a
|
|
596
|
+
} = o;
|
|
597
|
+
return [n.startIcon, n[`iconSize${i(a.size)}`]];
|
|
346
598
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
599
|
+
})({
|
|
600
|
+
display: "inherit",
|
|
601
|
+
marginRight: 8,
|
|
602
|
+
marginLeft: -4,
|
|
603
|
+
variants: [{
|
|
604
|
+
props: {
|
|
605
|
+
size: "small"
|
|
606
|
+
},
|
|
607
|
+
style: {
|
|
608
|
+
marginLeft: -2
|
|
354
609
|
}
|
|
355
|
-
},
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
}, y)
|
|
377
|
-
}) : a;
|
|
610
|
+
}, ...X]
|
|
611
|
+
}), Io = S("span", {
|
|
612
|
+
name: "MuiButton",
|
|
613
|
+
slot: "EndIcon",
|
|
614
|
+
overridesResolver: (o, n) => {
|
|
615
|
+
const {
|
|
616
|
+
ownerState: a
|
|
617
|
+
} = o;
|
|
618
|
+
return [n.endIcon, n[`iconSize${i(a.size)}`]];
|
|
619
|
+
}
|
|
620
|
+
})({
|
|
621
|
+
display: "inherit",
|
|
622
|
+
marginRight: -4,
|
|
623
|
+
marginLeft: 8,
|
|
624
|
+
variants: [{
|
|
625
|
+
props: {
|
|
626
|
+
size: "small"
|
|
627
|
+
},
|
|
628
|
+
style: {
|
|
629
|
+
marginRight: -2
|
|
378
630
|
}
|
|
379
|
-
}]
|
|
380
|
-
}(
|
|
381
|
-
const
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
631
|
+
}, ...X]
|
|
632
|
+
}), k = /* @__PURE__ */ I.forwardRef(function(n, a) {
|
|
633
|
+
const e = I.useContext(K), s = I.useContext(Q), l = no(e, n), d = Y({
|
|
634
|
+
props: l,
|
|
635
|
+
name: "MuiButton"
|
|
636
|
+
}), {
|
|
637
|
+
children: u,
|
|
638
|
+
color: c = "primary",
|
|
639
|
+
component: v = "button",
|
|
640
|
+
className: h,
|
|
641
|
+
disabled: g = !1,
|
|
642
|
+
disableElevation: B = !1,
|
|
643
|
+
disableFocusRipple: f = !1,
|
|
644
|
+
endIcon: w,
|
|
645
|
+
focusVisibleClassName: C,
|
|
646
|
+
fullWidth: A = !1,
|
|
647
|
+
size: T = "medium",
|
|
648
|
+
startIcon: $,
|
|
649
|
+
type: M,
|
|
650
|
+
variant: p = "text",
|
|
651
|
+
...y
|
|
652
|
+
} = d, x = {
|
|
653
|
+
...d,
|
|
654
|
+
color: c,
|
|
655
|
+
component: v,
|
|
656
|
+
disabled: g,
|
|
657
|
+
disableElevation: B,
|
|
658
|
+
disableFocusRipple: f,
|
|
659
|
+
fullWidth: A,
|
|
660
|
+
size: T,
|
|
661
|
+
type: M,
|
|
662
|
+
variant: p
|
|
663
|
+
}, b = So(x), N = $ && /* @__PURE__ */ r(zo, {
|
|
664
|
+
className: b.startIcon,
|
|
665
|
+
ownerState: x,
|
|
666
|
+
children: $
|
|
667
|
+
}), E = w && /* @__PURE__ */ r(Io, {
|
|
668
|
+
className: b.endIcon,
|
|
669
|
+
ownerState: x,
|
|
670
|
+
children: w
|
|
671
|
+
}), W = s || "";
|
|
672
|
+
return /* @__PURE__ */ R(Co, {
|
|
673
|
+
ownerState: x,
|
|
674
|
+
className: L(e.className, b.root, h, W),
|
|
675
|
+
component: v,
|
|
676
|
+
disabled: g,
|
|
677
|
+
focusRipple: !f,
|
|
678
|
+
focusVisibleClassName: L(b.focusVisible, C),
|
|
679
|
+
ref: a,
|
|
680
|
+
type: M,
|
|
681
|
+
...y,
|
|
682
|
+
classes: b,
|
|
683
|
+
children: [N, u, E]
|
|
684
|
+
});
|
|
685
|
+
});
|
|
686
|
+
process.env.NODE_ENV !== "production" && (k.propTypes = {
|
|
687
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
688
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
689
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
690
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
691
|
+
/**
|
|
692
|
+
* The content of the component.
|
|
693
|
+
*/
|
|
694
|
+
children: t.node,
|
|
695
|
+
/**
|
|
696
|
+
* Override or extend the styles applied to the component.
|
|
697
|
+
*/
|
|
698
|
+
classes: t.object,
|
|
699
|
+
/**
|
|
700
|
+
* @ignore
|
|
701
|
+
*/
|
|
702
|
+
className: t.string,
|
|
703
|
+
/**
|
|
704
|
+
* The color of the component.
|
|
705
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
706
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
707
|
+
* @default 'primary'
|
|
708
|
+
*/
|
|
709
|
+
color: t.oneOfType([t.oneOf(["inherit", "primary", "secondary", "success", "error", "info", "warning"]), t.string]),
|
|
710
|
+
/**
|
|
711
|
+
* The component used for the root node.
|
|
712
|
+
* Either a string to use a HTML element or a component.
|
|
713
|
+
*/
|
|
714
|
+
component: t.elementType,
|
|
715
|
+
/**
|
|
716
|
+
* If `true`, the component is disabled.
|
|
717
|
+
* @default false
|
|
718
|
+
*/
|
|
719
|
+
disabled: t.bool,
|
|
720
|
+
/**
|
|
721
|
+
* If `true`, no elevation is used.
|
|
722
|
+
* @default false
|
|
723
|
+
*/
|
|
724
|
+
disableElevation: t.bool,
|
|
725
|
+
/**
|
|
726
|
+
* If `true`, the keyboard focus ripple is disabled.
|
|
727
|
+
* @default false
|
|
728
|
+
*/
|
|
729
|
+
disableFocusRipple: t.bool,
|
|
730
|
+
/**
|
|
731
|
+
* If `true`, the ripple effect is disabled.
|
|
732
|
+
*
|
|
733
|
+
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
|
|
734
|
+
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
|
735
|
+
* @default false
|
|
736
|
+
*/
|
|
737
|
+
disableRipple: t.bool,
|
|
738
|
+
/**
|
|
739
|
+
* Element placed after the children.
|
|
740
|
+
*/
|
|
741
|
+
endIcon: t.node,
|
|
742
|
+
/**
|
|
743
|
+
* @ignore
|
|
744
|
+
*/
|
|
745
|
+
focusVisibleClassName: t.string,
|
|
746
|
+
/**
|
|
747
|
+
* If `true`, the button will take up the full width of its container.
|
|
748
|
+
* @default false
|
|
749
|
+
*/
|
|
750
|
+
fullWidth: t.bool,
|
|
751
|
+
/**
|
|
752
|
+
* The URL to link to when the button is clicked.
|
|
753
|
+
* If defined, an `a` element will be used as the root node.
|
|
754
|
+
*/
|
|
755
|
+
href: t.string,
|
|
756
|
+
/**
|
|
757
|
+
* The size of the component.
|
|
758
|
+
* `small` is equivalent to the dense button styling.
|
|
759
|
+
* @default 'medium'
|
|
760
|
+
*/
|
|
761
|
+
size: t.oneOfType([t.oneOf(["small", "medium", "large"]), t.string]),
|
|
762
|
+
/**
|
|
763
|
+
* Element placed before the children.
|
|
764
|
+
*/
|
|
765
|
+
startIcon: t.node,
|
|
766
|
+
/**
|
|
767
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
768
|
+
*/
|
|
769
|
+
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
|
|
770
|
+
/**
|
|
771
|
+
* @ignore
|
|
772
|
+
*/
|
|
773
|
+
type: t.oneOfType([t.oneOf(["button", "reset", "submit"]), t.string]),
|
|
774
|
+
/**
|
|
775
|
+
* The variant to use.
|
|
776
|
+
* @default 'text'
|
|
777
|
+
*/
|
|
778
|
+
variant: t.oneOfType([t.oneOf(["contained", "outlined", "text"]), t.string])
|
|
779
|
+
});
|
|
780
|
+
const mo = m(/* @__PURE__ */ r("path", {
|
|
781
|
+
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56M12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96M4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2s.06 1.34.14 2zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56m2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8M12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96M14.34 14H9.66c-.09-.66-.16-1.32-.16-2s.07-1.35.16-2h4.68c.09.65.16 1.32.16 2s-.07 1.34-.16 2m.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56M16.36 14c.08-.66.14-1.32.14-2s-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2z"
|
|
782
|
+
}), "LanguageOutlined"), To = ({
|
|
391
783
|
hideAfterInteraction: o,
|
|
392
|
-
alertContainerStyle:
|
|
393
|
-
descriptionStyle:
|
|
394
|
-
buttonContainerStyle:
|
|
395
|
-
yesButtonStyle:
|
|
396
|
-
cancelButtonStyle:
|
|
397
|
-
description:
|
|
398
|
-
icon:
|
|
784
|
+
alertContainerStyle: n,
|
|
785
|
+
descriptionStyle: a,
|
|
786
|
+
buttonContainerStyle: e,
|
|
787
|
+
yesButtonStyle: s,
|
|
788
|
+
cancelButtonStyle: l,
|
|
789
|
+
description: d,
|
|
790
|
+
icon: u
|
|
399
791
|
}) => {
|
|
400
|
-
const
|
|
401
|
-
if (!
|
|
792
|
+
const c = oo(to);
|
|
793
|
+
if (!c)
|
|
402
794
|
return null;
|
|
403
|
-
const
|
|
795
|
+
const v = {
|
|
404
796
|
marginBottom: "10px",
|
|
405
797
|
borderRadius: "5px",
|
|
406
798
|
padding: "10px",
|
|
@@ -411,55 +803,53 @@ const Je = ({
|
|
|
411
803
|
display: "flex",
|
|
412
804
|
alignItems: "center",
|
|
413
805
|
// Align items vertically
|
|
414
|
-
...
|
|
415
|
-
},
|
|
806
|
+
...n
|
|
807
|
+
}, h = {
|
|
416
808
|
display: "flex",
|
|
417
809
|
justifyContent: "space-between",
|
|
418
810
|
alignItems: "center",
|
|
419
811
|
// Align items vertically
|
|
420
812
|
fontSize: "12px",
|
|
421
813
|
width: "100%",
|
|
422
|
-
...
|
|
423
|
-
},
|
|
814
|
+
...a
|
|
815
|
+
}, g = {
|
|
424
816
|
display: "flex",
|
|
425
817
|
alignItems: "center",
|
|
426
|
-
...
|
|
427
|
-
},
|
|
818
|
+
...e
|
|
819
|
+
}, B = {
|
|
428
820
|
marginLeft: "10px",
|
|
429
821
|
marginRight: "10px",
|
|
430
822
|
fontSize: "10px",
|
|
431
|
-
...
|
|
432
|
-
},
|
|
823
|
+
...s
|
|
824
|
+
}, f = {
|
|
433
825
|
fontSize: "10px",
|
|
434
|
-
...
|
|
826
|
+
...l
|
|
435
827
|
};
|
|
436
|
-
return /* @__PURE__ */
|
|
437
|
-
|
|
828
|
+
return /* @__PURE__ */ r(
|
|
829
|
+
J,
|
|
438
830
|
{
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
style:
|
|
443
|
-
|
|
444
|
-
/* @__PURE__ */
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
H,
|
|
831
|
+
severity: "info",
|
|
832
|
+
icon: u ?? /* @__PURE__ */ r(mo, { type: "text" }),
|
|
833
|
+
style: v,
|
|
834
|
+
children: /* @__PURE__ */ R("div", { style: h, children: [
|
|
835
|
+
/* @__PURE__ */ r("span", { children: d ?? "Would you like to enable web push notifications to stay updated?" }),
|
|
836
|
+
/* @__PURE__ */ R("div", { style: g, children: [
|
|
837
|
+
/* @__PURE__ */ r(
|
|
838
|
+
k,
|
|
448
839
|
{
|
|
449
|
-
|
|
450
|
-
style: C,
|
|
840
|
+
style: B,
|
|
451
841
|
onClick: () => {
|
|
452
|
-
o && localStorage.setItem("hideWebPushOptInMessage", "true"),
|
|
842
|
+
o && localStorage.setItem("hideWebPushOptInMessage", "true"), c.setWebPushOptIn(!0), c.setWebPushOptInMessage(!1);
|
|
453
843
|
},
|
|
454
844
|
children: "Yes"
|
|
455
845
|
}
|
|
456
846
|
),
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
-
|
|
847
|
+
/* @__PURE__ */ r(
|
|
848
|
+
k,
|
|
459
849
|
{
|
|
460
|
-
style:
|
|
850
|
+
style: f,
|
|
461
851
|
onClick: () => {
|
|
462
|
-
o && localStorage.setItem("hideWebPushOptInMessage", "true"),
|
|
852
|
+
o && localStorage.setItem("hideWebPushOptInMessage", "true"), c.setWebPushOptInMessage(!1);
|
|
463
853
|
},
|
|
464
854
|
children: "No"
|
|
465
855
|
}
|
|
@@ -470,9 +860,6 @@ const Je = ({
|
|
|
470
860
|
);
|
|
471
861
|
};
|
|
472
862
|
export {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
D as a,
|
|
476
|
-
k as b,
|
|
477
|
-
W as c
|
|
863
|
+
mo as L,
|
|
864
|
+
To as W
|
|
478
865
|
};
|