@notificationapi/react 1.4.1 → 1.5.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/assets/Badge.js +1 -1
- package/dist/assets/Box.js +13 -13
- package/dist/assets/Button.js +781 -0
- package/dist/assets/ButtonBase.js +409 -622
- package/dist/assets/DefaultPropsProvider.js +220 -215
- package/dist/assets/Divider.js +105 -154
- package/dist/assets/Grow.js +201 -0
- package/dist/assets/IconButton.js +1 -1
- package/dist/assets/List.js +142 -0
- package/dist/assets/Modal.js +1094 -0
- package/dist/assets/Notification.js +71 -71
- package/dist/assets/Paper.js +1 -1
- package/dist/assets/Popover.js +8 -6
- package/dist/assets/Portal.js +2 -2
- package/dist/assets/Stack.js +216 -0
- package/dist/assets/Typography.js +193 -117
- package/dist/assets/WebPushOptInMessage.js +40 -814
- package/dist/assets/createSvgIcon.js +5 -5
- package/dist/assets/dividerClasses.js +56 -0
- package/dist/assets/index.js +151 -0
- package/dist/assets/useTheme2.js +253 -11
- package/dist/assets/utils.js +4 -4
- package/dist/components/Notifications/Inbox.js +2927 -9
- package/dist/components/Notifications/InboxHeader.js +2146 -7
- package/dist/components/Notifications/NotificationFeed.js +13 -13
- package/dist/components/Notifications/NotificationLauncher.js +2 -2
- package/dist/components/Notifications/NotificationPopup.js +7 -7
- package/dist/components/Preferences/NotificationPreferencesPopup.js +608 -7
- package/dist/components/Preferences/PreferenceInput.js +1451 -6
- package/dist/components/Preferences/Preferences.js +368 -515
- package/dist/components/Preferences/index.js +1 -1
- package/dist/components/Provider/index.js +226 -202
- package/dist/components/Slack/SlackConnect.d.ts +12 -0
- package/dist/components/Slack/SlackConnect.js +4826 -0
- package/dist/components/Slack/index.d.ts +1 -0
- package/dist/components/Slack/index.js +4 -0
- package/dist/components/WebPush/WebPushOptInMessage.js +3 -2
- package/dist/main.d.ts +1 -0
- package/dist/main.js +5 -3
- package/package.json +4 -4
- package/dist/assets/Inbox.js +0 -3061
- package/dist/assets/InboxHeader.js +0 -2338
- package/dist/assets/NotificationPreferencesPopup.js +0 -1694
- package/dist/assets/PreferenceInput.js +0 -1657
|
@@ -0,0 +1,781 @@
|
|
|
1
|
+
import * as S from "react";
|
|
2
|
+
import { g as D, e as U, s as g, h as s, m as G, I as k, J as W, u as _, c as L, P as t, b as Z, K as X, a as B, r as Y } from "./DefaultPropsProvider.js";
|
|
3
|
+
import { a as j, B as oo } from "./ButtonBase.js";
|
|
4
|
+
import { c as h } from "./createSimplePaletteValueFilter.js";
|
|
5
|
+
import { c as m } from "./createSvgIcon.js";
|
|
6
|
+
import { jsx as r, jsxs as J } from "react/jsx-runtime";
|
|
7
|
+
import { P as to } from "./Paper.js";
|
|
8
|
+
import { I as eo } from "./IconButton.js";
|
|
9
|
+
function no(o) {
|
|
10
|
+
return U("MuiAlert", o);
|
|
11
|
+
}
|
|
12
|
+
const V = D("MuiAlert", ["root", "action", "icon", "message", "filled", "colorSuccess", "colorInfo", "colorWarning", "colorError", "filledSuccess", "filledInfo", "filledWarning", "filledError", "outlined", "outlinedSuccess", "outlinedInfo", "outlinedWarning", "outlinedError", "standard", "standardSuccess", "standardInfo", "standardWarning", "standardError"]), ao = m(/* @__PURE__ */ r("path", {
|
|
13
|
+
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"
|
|
14
|
+
}), "SuccessOutlined"), ro = m(/* @__PURE__ */ r("path", {
|
|
15
|
+
d: "M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"
|
|
16
|
+
}), "ReportProblemOutlined"), so = m(/* @__PURE__ */ r("path", {
|
|
17
|
+
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"
|
|
18
|
+
}), "ErrorOutline"), io = m(/* @__PURE__ */ r("path", {
|
|
19
|
+
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"
|
|
20
|
+
}), "InfoOutlined"), lo = m(/* @__PURE__ */ r("path", {
|
|
21
|
+
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"
|
|
22
|
+
}), "Close"), co = (o) => {
|
|
23
|
+
const {
|
|
24
|
+
variant: n,
|
|
25
|
+
color: a,
|
|
26
|
+
severity: e,
|
|
27
|
+
classes: i
|
|
28
|
+
} = o, c = {
|
|
29
|
+
root: ["root", `color${s(a || e)}`, `${n}${s(a || e)}`, `${n}`],
|
|
30
|
+
icon: ["icon"],
|
|
31
|
+
message: ["message"],
|
|
32
|
+
action: ["action"]
|
|
33
|
+
};
|
|
34
|
+
return Z(c, no, i);
|
|
35
|
+
}, po = g(to, {
|
|
36
|
+
name: "MuiAlert",
|
|
37
|
+
slot: "Root",
|
|
38
|
+
overridesResolver: (o, n) => {
|
|
39
|
+
const {
|
|
40
|
+
ownerState: a
|
|
41
|
+
} = o;
|
|
42
|
+
return [n.root, n[a.variant], n[`${a.variant}${s(a.color || a.severity)}`]];
|
|
43
|
+
}
|
|
44
|
+
})(G(({
|
|
45
|
+
theme: o
|
|
46
|
+
}) => {
|
|
47
|
+
const n = o.palette.mode === "light" ? k : W, a = o.palette.mode === "light" ? W : k;
|
|
48
|
+
return {
|
|
49
|
+
...o.typography.body2,
|
|
50
|
+
backgroundColor: "transparent",
|
|
51
|
+
display: "flex",
|
|
52
|
+
padding: "6px 16px",
|
|
53
|
+
variants: [...Object.entries(o.palette).filter(h(["light"])).map(([e]) => ({
|
|
54
|
+
props: {
|
|
55
|
+
colorSeverity: e,
|
|
56
|
+
variant: "standard"
|
|
57
|
+
},
|
|
58
|
+
style: {
|
|
59
|
+
color: o.vars ? o.vars.palette.Alert[`${e}Color`] : n(o.palette[e].light, 0.6),
|
|
60
|
+
backgroundColor: o.vars ? o.vars.palette.Alert[`${e}StandardBg`] : a(o.palette[e].light, 0.9),
|
|
61
|
+
[`& .${V.icon}`]: o.vars ? {
|
|
62
|
+
color: o.vars.palette.Alert[`${e}IconColor`]
|
|
63
|
+
} : {
|
|
64
|
+
color: o.palette[e].main
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
})), ...Object.entries(o.palette).filter(h(["light"])).map(([e]) => ({
|
|
68
|
+
props: {
|
|
69
|
+
colorSeverity: e,
|
|
70
|
+
variant: "outlined"
|
|
71
|
+
},
|
|
72
|
+
style: {
|
|
73
|
+
color: o.vars ? o.vars.palette.Alert[`${e}Color`] : n(o.palette[e].light, 0.6),
|
|
74
|
+
border: `1px solid ${(o.vars || o).palette[e].light}`,
|
|
75
|
+
[`& .${V.icon}`]: o.vars ? {
|
|
76
|
+
color: o.vars.palette.Alert[`${e}IconColor`]
|
|
77
|
+
} : {
|
|
78
|
+
color: o.palette[e].main
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
})), ...Object.entries(o.palette).filter(h(["dark"])).map(([e]) => ({
|
|
82
|
+
props: {
|
|
83
|
+
colorSeverity: e,
|
|
84
|
+
variant: "filled"
|
|
85
|
+
},
|
|
86
|
+
style: {
|
|
87
|
+
fontWeight: o.typography.fontWeightMedium,
|
|
88
|
+
...o.vars ? {
|
|
89
|
+
color: o.vars.palette.Alert[`${e}FilledColor`],
|
|
90
|
+
backgroundColor: o.vars.palette.Alert[`${e}FilledBg`]
|
|
91
|
+
} : {
|
|
92
|
+
backgroundColor: o.palette.mode === "dark" ? o.palette[e].dark : o.palette[e].main,
|
|
93
|
+
color: o.palette.getContrastText(o.palette[e].main)
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}))]
|
|
97
|
+
};
|
|
98
|
+
})), uo = g("div", {
|
|
99
|
+
name: "MuiAlert",
|
|
100
|
+
slot: "Icon",
|
|
101
|
+
overridesResolver: (o, n) => n.icon
|
|
102
|
+
})({
|
|
103
|
+
marginRight: 12,
|
|
104
|
+
padding: "7px 0",
|
|
105
|
+
display: "flex",
|
|
106
|
+
fontSize: 22,
|
|
107
|
+
opacity: 0.9
|
|
108
|
+
}), vo = g("div", {
|
|
109
|
+
name: "MuiAlert",
|
|
110
|
+
slot: "Message",
|
|
111
|
+
overridesResolver: (o, n) => n.message
|
|
112
|
+
})({
|
|
113
|
+
padding: "8px 0",
|
|
114
|
+
minWidth: 0,
|
|
115
|
+
overflow: "auto"
|
|
116
|
+
}), F = g("div", {
|
|
117
|
+
name: "MuiAlert",
|
|
118
|
+
slot: "Action",
|
|
119
|
+
overridesResolver: (o, n) => n.action
|
|
120
|
+
})({
|
|
121
|
+
display: "flex",
|
|
122
|
+
alignItems: "flex-start",
|
|
123
|
+
padding: "4px 0 0 16px",
|
|
124
|
+
marginLeft: "auto",
|
|
125
|
+
marginRight: -8
|
|
126
|
+
}), H = {
|
|
127
|
+
success: /* @__PURE__ */ r(ao, {
|
|
128
|
+
fontSize: "inherit"
|
|
129
|
+
}),
|
|
130
|
+
warning: /* @__PURE__ */ r(ro, {
|
|
131
|
+
fontSize: "inherit"
|
|
132
|
+
}),
|
|
133
|
+
error: /* @__PURE__ */ r(so, {
|
|
134
|
+
fontSize: "inherit"
|
|
135
|
+
}),
|
|
136
|
+
info: /* @__PURE__ */ r(io, {
|
|
137
|
+
fontSize: "inherit"
|
|
138
|
+
})
|
|
139
|
+
}, go = /* @__PURE__ */ S.forwardRef(function(n, a) {
|
|
140
|
+
const e = _({
|
|
141
|
+
props: n,
|
|
142
|
+
name: "MuiAlert"
|
|
143
|
+
}), {
|
|
144
|
+
action: i,
|
|
145
|
+
children: c,
|
|
146
|
+
className: p,
|
|
147
|
+
closeText: f = "Close",
|
|
148
|
+
color: y,
|
|
149
|
+
components: C = {},
|
|
150
|
+
componentsProps: A = {},
|
|
151
|
+
icon: z,
|
|
152
|
+
iconMapping: M = H,
|
|
153
|
+
onClose: I,
|
|
154
|
+
role: $ = "alert",
|
|
155
|
+
severity: b = "success",
|
|
156
|
+
slotProps: T = {},
|
|
157
|
+
slots: R = {},
|
|
158
|
+
variant: O = "standard",
|
|
159
|
+
...w
|
|
160
|
+
} = e, l = {
|
|
161
|
+
...e,
|
|
162
|
+
color: y,
|
|
163
|
+
severity: b,
|
|
164
|
+
variant: O,
|
|
165
|
+
colorSeverity: y || b
|
|
166
|
+
}, d = co(l), u = {
|
|
167
|
+
slots: {
|
|
168
|
+
closeButton: C.CloseButton,
|
|
169
|
+
closeIcon: C.CloseIcon,
|
|
170
|
+
...R
|
|
171
|
+
},
|
|
172
|
+
slotProps: {
|
|
173
|
+
...A,
|
|
174
|
+
...T
|
|
175
|
+
}
|
|
176
|
+
}, [v, E] = j("closeButton", {
|
|
177
|
+
elementType: eo,
|
|
178
|
+
externalForwardedProps: u,
|
|
179
|
+
ownerState: l
|
|
180
|
+
}), [N, P] = j("closeIcon", {
|
|
181
|
+
elementType: lo,
|
|
182
|
+
externalForwardedProps: u,
|
|
183
|
+
ownerState: l
|
|
184
|
+
});
|
|
185
|
+
return /* @__PURE__ */ J(po, {
|
|
186
|
+
role: $,
|
|
187
|
+
elevation: 0,
|
|
188
|
+
ownerState: l,
|
|
189
|
+
className: L(d.root, p),
|
|
190
|
+
ref: a,
|
|
191
|
+
...w,
|
|
192
|
+
children: [z !== !1 ? /* @__PURE__ */ r(uo, {
|
|
193
|
+
ownerState: l,
|
|
194
|
+
className: d.icon,
|
|
195
|
+
children: z || M[b] || H[b]
|
|
196
|
+
}) : null, /* @__PURE__ */ r(vo, {
|
|
197
|
+
ownerState: l,
|
|
198
|
+
className: d.message,
|
|
199
|
+
children: c
|
|
200
|
+
}), i != null ? /* @__PURE__ */ r(F, {
|
|
201
|
+
ownerState: l,
|
|
202
|
+
className: d.action,
|
|
203
|
+
children: i
|
|
204
|
+
}) : null, i == null && I ? /* @__PURE__ */ r(F, {
|
|
205
|
+
ownerState: l,
|
|
206
|
+
className: d.action,
|
|
207
|
+
children: /* @__PURE__ */ r(v, {
|
|
208
|
+
size: "small",
|
|
209
|
+
"aria-label": f,
|
|
210
|
+
title: f,
|
|
211
|
+
color: "inherit",
|
|
212
|
+
onClick: I,
|
|
213
|
+
...E,
|
|
214
|
+
children: /* @__PURE__ */ r(N, {
|
|
215
|
+
fontSize: "small",
|
|
216
|
+
...P
|
|
217
|
+
})
|
|
218
|
+
})
|
|
219
|
+
}) : null]
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
process.env.NODE_ENV !== "production" && (go.propTypes = {
|
|
223
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
224
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
225
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
226
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
227
|
+
/**
|
|
228
|
+
* The action to display. It renders after the message, at the end of the alert.
|
|
229
|
+
*/
|
|
230
|
+
action: t.node,
|
|
231
|
+
/**
|
|
232
|
+
* The content of the component.
|
|
233
|
+
*/
|
|
234
|
+
children: t.node,
|
|
235
|
+
/**
|
|
236
|
+
* Override or extend the styles applied to the component.
|
|
237
|
+
*/
|
|
238
|
+
classes: t.object,
|
|
239
|
+
/**
|
|
240
|
+
* @ignore
|
|
241
|
+
*/
|
|
242
|
+
className: t.string,
|
|
243
|
+
/**
|
|
244
|
+
* Override the default label for the *close popup* icon button.
|
|
245
|
+
*
|
|
246
|
+
* For localization purposes, you can use the provided [translations](https://mui.com/material-ui/guides/localization/).
|
|
247
|
+
* @default 'Close'
|
|
248
|
+
*/
|
|
249
|
+
closeText: t.string,
|
|
250
|
+
/**
|
|
251
|
+
* The color of the component. Unless provided, the value is taken from the `severity` prop.
|
|
252
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
253
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
254
|
+
*/
|
|
255
|
+
color: t.oneOfType([t.oneOf(["error", "info", "success", "warning"]), t.string]),
|
|
256
|
+
/**
|
|
257
|
+
* The components used for each slot inside.
|
|
258
|
+
*
|
|
259
|
+
* @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.
|
|
260
|
+
*
|
|
261
|
+
* @default {}
|
|
262
|
+
*/
|
|
263
|
+
components: t.shape({
|
|
264
|
+
CloseButton: t.elementType,
|
|
265
|
+
CloseIcon: t.elementType
|
|
266
|
+
}),
|
|
267
|
+
/**
|
|
268
|
+
* The extra props for the slot components.
|
|
269
|
+
* You can override the existing props or add new ones.
|
|
270
|
+
*
|
|
271
|
+
* @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.
|
|
272
|
+
*
|
|
273
|
+
* @default {}
|
|
274
|
+
*/
|
|
275
|
+
componentsProps: t.shape({
|
|
276
|
+
closeButton: t.object,
|
|
277
|
+
closeIcon: t.object
|
|
278
|
+
}),
|
|
279
|
+
/**
|
|
280
|
+
* Override the icon displayed before the children.
|
|
281
|
+
* Unless provided, the icon is mapped to the value of the `severity` prop.
|
|
282
|
+
* Set to `false` to remove the `icon`.
|
|
283
|
+
*/
|
|
284
|
+
icon: t.node,
|
|
285
|
+
/**
|
|
286
|
+
* The component maps the `severity` prop to a range of different icons,
|
|
287
|
+
* for instance success to `<SuccessOutlined>`.
|
|
288
|
+
* If you wish to change this mapping, you can provide your own.
|
|
289
|
+
* Alternatively, you can use the `icon` prop to override the icon displayed.
|
|
290
|
+
*/
|
|
291
|
+
iconMapping: t.shape({
|
|
292
|
+
error: t.node,
|
|
293
|
+
info: t.node,
|
|
294
|
+
success: t.node,
|
|
295
|
+
warning: t.node
|
|
296
|
+
}),
|
|
297
|
+
/**
|
|
298
|
+
* Callback fired when the component requests to be closed.
|
|
299
|
+
* When provided and no `action` prop is set, a close icon button is displayed that triggers the callback when clicked.
|
|
300
|
+
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
301
|
+
*/
|
|
302
|
+
onClose: t.func,
|
|
303
|
+
/**
|
|
304
|
+
* The ARIA role attribute of the element.
|
|
305
|
+
* @default 'alert'
|
|
306
|
+
*/
|
|
307
|
+
role: t.string,
|
|
308
|
+
/**
|
|
309
|
+
* The severity of the alert. This defines the color and icon used.
|
|
310
|
+
* @default 'success'
|
|
311
|
+
*/
|
|
312
|
+
severity: t.oneOfType([t.oneOf(["error", "info", "success", "warning"]), t.string]),
|
|
313
|
+
/**
|
|
314
|
+
* The props used for each slot inside.
|
|
315
|
+
* @default {}
|
|
316
|
+
*/
|
|
317
|
+
slotProps: t.shape({
|
|
318
|
+
closeButton: t.oneOfType([t.func, t.object]),
|
|
319
|
+
closeIcon: t.oneOfType([t.func, t.object])
|
|
320
|
+
}),
|
|
321
|
+
/**
|
|
322
|
+
* The components used for each slot inside.
|
|
323
|
+
* @default {}
|
|
324
|
+
*/
|
|
325
|
+
slots: t.shape({
|
|
326
|
+
closeButton: t.elementType,
|
|
327
|
+
closeIcon: t.elementType
|
|
328
|
+
}),
|
|
329
|
+
/**
|
|
330
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
331
|
+
*/
|
|
332
|
+
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
|
|
333
|
+
/**
|
|
334
|
+
* The variant to use.
|
|
335
|
+
* @default 'standard'
|
|
336
|
+
*/
|
|
337
|
+
variant: t.oneOfType([t.oneOf(["filled", "outlined", "standard"]), t.string])
|
|
338
|
+
});
|
|
339
|
+
function fo(o) {
|
|
340
|
+
return U("MuiButton", o);
|
|
341
|
+
}
|
|
342
|
+
const x = D("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__ */ S.createContext({});
|
|
343
|
+
process.env.NODE_ENV !== "production" && (K.displayName = "ButtonGroupContext");
|
|
344
|
+
const q = /* @__PURE__ */ S.createContext(void 0);
|
|
345
|
+
process.env.NODE_ENV !== "production" && (q.displayName = "ButtonGroupButtonContext");
|
|
346
|
+
const yo = (o) => {
|
|
347
|
+
const {
|
|
348
|
+
color: n,
|
|
349
|
+
disableElevation: a,
|
|
350
|
+
fullWidth: e,
|
|
351
|
+
size: i,
|
|
352
|
+
variant: c,
|
|
353
|
+
classes: p
|
|
354
|
+
} = o, f = {
|
|
355
|
+
root: ["root", c, `${c}${s(n)}`, `size${s(i)}`, `${c}Size${s(i)}`, `color${s(n)}`, a && "disableElevation", e && "fullWidth"],
|
|
356
|
+
label: ["label"],
|
|
357
|
+
startIcon: ["icon", "startIcon", `iconSize${s(i)}`],
|
|
358
|
+
endIcon: ["icon", "endIcon", `iconSize${s(i)}`]
|
|
359
|
+
}, y = Z(f, fo, p);
|
|
360
|
+
return {
|
|
361
|
+
...p,
|
|
362
|
+
// forward the focused, disabled, etc. classes to the ButtonBase
|
|
363
|
+
...y
|
|
364
|
+
};
|
|
365
|
+
}, Q = [{
|
|
366
|
+
props: {
|
|
367
|
+
size: "small"
|
|
368
|
+
},
|
|
369
|
+
style: {
|
|
370
|
+
"& > *:nth-of-type(1)": {
|
|
371
|
+
fontSize: 18
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}, {
|
|
375
|
+
props: {
|
|
376
|
+
size: "medium"
|
|
377
|
+
},
|
|
378
|
+
style: {
|
|
379
|
+
"& > *:nth-of-type(1)": {
|
|
380
|
+
fontSize: 20
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}, {
|
|
384
|
+
props: {
|
|
385
|
+
size: "large"
|
|
386
|
+
},
|
|
387
|
+
style: {
|
|
388
|
+
"& > *:nth-of-type(1)": {
|
|
389
|
+
fontSize: 22
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}], bo = g(oo, {
|
|
393
|
+
shouldForwardProp: (o) => X(o) || o === "classes",
|
|
394
|
+
name: "MuiButton",
|
|
395
|
+
slot: "Root",
|
|
396
|
+
overridesResolver: (o, n) => {
|
|
397
|
+
const {
|
|
398
|
+
ownerState: a
|
|
399
|
+
} = o;
|
|
400
|
+
return [n.root, n[a.variant], n[`${a.variant}${s(a.color)}`], n[`size${s(a.size)}`], n[`${a.variant}Size${s(a.size)}`], a.color === "inherit" && n.colorInherit, a.disableElevation && n.disableElevation, a.fullWidth && n.fullWidth];
|
|
401
|
+
}
|
|
402
|
+
})(G(({
|
|
403
|
+
theme: o
|
|
404
|
+
}) => {
|
|
405
|
+
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];
|
|
406
|
+
return {
|
|
407
|
+
...o.typography.button,
|
|
408
|
+
minWidth: 64,
|
|
409
|
+
padding: "6px 16px",
|
|
410
|
+
border: 0,
|
|
411
|
+
borderRadius: (o.vars || o).shape.borderRadius,
|
|
412
|
+
transition: o.transitions.create(["background-color", "box-shadow", "border-color", "color"], {
|
|
413
|
+
duration: o.transitions.duration.short
|
|
414
|
+
}),
|
|
415
|
+
"&:hover": {
|
|
416
|
+
textDecoration: "none"
|
|
417
|
+
},
|
|
418
|
+
[`&.${x.disabled}`]: {
|
|
419
|
+
color: (o.vars || o).palette.action.disabled
|
|
420
|
+
},
|
|
421
|
+
variants: [{
|
|
422
|
+
props: {
|
|
423
|
+
variant: "contained"
|
|
424
|
+
},
|
|
425
|
+
style: {
|
|
426
|
+
color: "var(--variant-containedColor)",
|
|
427
|
+
backgroundColor: "var(--variant-containedBg)",
|
|
428
|
+
boxShadow: (o.vars || o).shadows[2],
|
|
429
|
+
"&:hover": {
|
|
430
|
+
boxShadow: (o.vars || o).shadows[4],
|
|
431
|
+
// Reset on touch devices, it doesn't add specificity
|
|
432
|
+
"@media (hover: none)": {
|
|
433
|
+
boxShadow: (o.vars || o).shadows[2]
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
"&:active": {
|
|
437
|
+
boxShadow: (o.vars || o).shadows[8]
|
|
438
|
+
},
|
|
439
|
+
[`&.${x.focusVisible}`]: {
|
|
440
|
+
boxShadow: (o.vars || o).shadows[6]
|
|
441
|
+
},
|
|
442
|
+
[`&.${x.disabled}`]: {
|
|
443
|
+
color: (o.vars || o).palette.action.disabled,
|
|
444
|
+
boxShadow: (o.vars || o).shadows[0],
|
|
445
|
+
backgroundColor: (o.vars || o).palette.action.disabledBackground
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}, {
|
|
449
|
+
props: {
|
|
450
|
+
variant: "outlined"
|
|
451
|
+
},
|
|
452
|
+
style: {
|
|
453
|
+
padding: "5px 15px",
|
|
454
|
+
border: "1px solid currentColor",
|
|
455
|
+
borderColor: "var(--variant-outlinedBorder, currentColor)",
|
|
456
|
+
backgroundColor: "var(--variant-outlinedBg)",
|
|
457
|
+
color: "var(--variant-outlinedColor)",
|
|
458
|
+
[`&.${x.disabled}`]: {
|
|
459
|
+
border: `1px solid ${(o.vars || o).palette.action.disabledBackground}`
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}, {
|
|
463
|
+
props: {
|
|
464
|
+
variant: "text"
|
|
465
|
+
},
|
|
466
|
+
style: {
|
|
467
|
+
padding: "6px 8px",
|
|
468
|
+
color: "var(--variant-textColor)",
|
|
469
|
+
backgroundColor: "var(--variant-textBg)"
|
|
470
|
+
}
|
|
471
|
+
}, ...Object.entries(o.palette).filter(h()).map(([e]) => ({
|
|
472
|
+
props: {
|
|
473
|
+
color: e
|
|
474
|
+
},
|
|
475
|
+
style: {
|
|
476
|
+
"--variant-textColor": (o.vars || o).palette[e].main,
|
|
477
|
+
"--variant-outlinedColor": (o.vars || o).palette[e].main,
|
|
478
|
+
"--variant-outlinedBorder": o.vars ? `rgba(${o.vars.palette[e].mainChannel} / 0.5)` : B(o.palette[e].main, 0.5),
|
|
479
|
+
"--variant-containedColor": (o.vars || o).palette[e].contrastText,
|
|
480
|
+
"--variant-containedBg": (o.vars || o).palette[e].main,
|
|
481
|
+
"@media (hover: hover)": {
|
|
482
|
+
"&:hover": {
|
|
483
|
+
"--variant-containedBg": (o.vars || o).palette[e].dark,
|
|
484
|
+
"--variant-textBg": o.vars ? `rgba(${o.vars.palette[e].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : B(o.palette[e].main, o.palette.action.hoverOpacity),
|
|
485
|
+
"--variant-outlinedBorder": (o.vars || o).palette[e].main,
|
|
486
|
+
"--variant-outlinedBg": o.vars ? `rgba(${o.vars.palette[e].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : B(o.palette[e].main, o.palette.action.hoverOpacity)
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
})), {
|
|
491
|
+
props: {
|
|
492
|
+
color: "inherit"
|
|
493
|
+
},
|
|
494
|
+
style: {
|
|
495
|
+
color: "inherit",
|
|
496
|
+
borderColor: "currentColor",
|
|
497
|
+
"--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedBg : n,
|
|
498
|
+
"@media (hover: hover)": {
|
|
499
|
+
"&:hover": {
|
|
500
|
+
"--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedHoverBg : a,
|
|
501
|
+
"--variant-textBg": o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})` : B(o.palette.text.primary, o.palette.action.hoverOpacity),
|
|
502
|
+
"--variant-outlinedBg": o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})` : B(o.palette.text.primary, o.palette.action.hoverOpacity)
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}, {
|
|
507
|
+
props: {
|
|
508
|
+
size: "small",
|
|
509
|
+
variant: "text"
|
|
510
|
+
},
|
|
511
|
+
style: {
|
|
512
|
+
padding: "4px 5px",
|
|
513
|
+
fontSize: o.typography.pxToRem(13)
|
|
514
|
+
}
|
|
515
|
+
}, {
|
|
516
|
+
props: {
|
|
517
|
+
size: "large",
|
|
518
|
+
variant: "text"
|
|
519
|
+
},
|
|
520
|
+
style: {
|
|
521
|
+
padding: "8px 11px",
|
|
522
|
+
fontSize: o.typography.pxToRem(15)
|
|
523
|
+
}
|
|
524
|
+
}, {
|
|
525
|
+
props: {
|
|
526
|
+
size: "small",
|
|
527
|
+
variant: "outlined"
|
|
528
|
+
},
|
|
529
|
+
style: {
|
|
530
|
+
padding: "3px 9px",
|
|
531
|
+
fontSize: o.typography.pxToRem(13)
|
|
532
|
+
}
|
|
533
|
+
}, {
|
|
534
|
+
props: {
|
|
535
|
+
size: "large",
|
|
536
|
+
variant: "outlined"
|
|
537
|
+
},
|
|
538
|
+
style: {
|
|
539
|
+
padding: "7px 21px",
|
|
540
|
+
fontSize: o.typography.pxToRem(15)
|
|
541
|
+
}
|
|
542
|
+
}, {
|
|
543
|
+
props: {
|
|
544
|
+
size: "small",
|
|
545
|
+
variant: "contained"
|
|
546
|
+
},
|
|
547
|
+
style: {
|
|
548
|
+
padding: "4px 10px",
|
|
549
|
+
fontSize: o.typography.pxToRem(13)
|
|
550
|
+
}
|
|
551
|
+
}, {
|
|
552
|
+
props: {
|
|
553
|
+
size: "large",
|
|
554
|
+
variant: "contained"
|
|
555
|
+
},
|
|
556
|
+
style: {
|
|
557
|
+
padding: "8px 22px",
|
|
558
|
+
fontSize: o.typography.pxToRem(15)
|
|
559
|
+
}
|
|
560
|
+
}, {
|
|
561
|
+
props: {
|
|
562
|
+
disableElevation: !0
|
|
563
|
+
},
|
|
564
|
+
style: {
|
|
565
|
+
boxShadow: "none",
|
|
566
|
+
"&:hover": {
|
|
567
|
+
boxShadow: "none"
|
|
568
|
+
},
|
|
569
|
+
[`&.${x.focusVisible}`]: {
|
|
570
|
+
boxShadow: "none"
|
|
571
|
+
},
|
|
572
|
+
"&:active": {
|
|
573
|
+
boxShadow: "none"
|
|
574
|
+
},
|
|
575
|
+
[`&.${x.disabled}`]: {
|
|
576
|
+
boxShadow: "none"
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}, {
|
|
580
|
+
props: {
|
|
581
|
+
fullWidth: !0
|
|
582
|
+
},
|
|
583
|
+
style: {
|
|
584
|
+
width: "100%"
|
|
585
|
+
}
|
|
586
|
+
}]
|
|
587
|
+
};
|
|
588
|
+
})), xo = g("span", {
|
|
589
|
+
name: "MuiButton",
|
|
590
|
+
slot: "StartIcon",
|
|
591
|
+
overridesResolver: (o, n) => {
|
|
592
|
+
const {
|
|
593
|
+
ownerState: a
|
|
594
|
+
} = o;
|
|
595
|
+
return [n.startIcon, n[`iconSize${s(a.size)}`]];
|
|
596
|
+
}
|
|
597
|
+
})({
|
|
598
|
+
display: "inherit",
|
|
599
|
+
marginRight: 8,
|
|
600
|
+
marginLeft: -4,
|
|
601
|
+
variants: [{
|
|
602
|
+
props: {
|
|
603
|
+
size: "small"
|
|
604
|
+
},
|
|
605
|
+
style: {
|
|
606
|
+
marginLeft: -2
|
|
607
|
+
}
|
|
608
|
+
}, ...Q]
|
|
609
|
+
}), So = g("span", {
|
|
610
|
+
name: "MuiButton",
|
|
611
|
+
slot: "EndIcon",
|
|
612
|
+
overridesResolver: (o, n) => {
|
|
613
|
+
const {
|
|
614
|
+
ownerState: a
|
|
615
|
+
} = o;
|
|
616
|
+
return [n.endIcon, n[`iconSize${s(a.size)}`]];
|
|
617
|
+
}
|
|
618
|
+
})({
|
|
619
|
+
display: "inherit",
|
|
620
|
+
marginRight: -4,
|
|
621
|
+
marginLeft: 8,
|
|
622
|
+
variants: [{
|
|
623
|
+
props: {
|
|
624
|
+
size: "small"
|
|
625
|
+
},
|
|
626
|
+
style: {
|
|
627
|
+
marginRight: -2
|
|
628
|
+
}
|
|
629
|
+
}, ...Q]
|
|
630
|
+
}), Co = /* @__PURE__ */ S.forwardRef(function(n, a) {
|
|
631
|
+
const e = S.useContext(K), i = S.useContext(q), c = Y(e, n), p = _({
|
|
632
|
+
props: c,
|
|
633
|
+
name: "MuiButton"
|
|
634
|
+
}), {
|
|
635
|
+
children: f,
|
|
636
|
+
color: y = "primary",
|
|
637
|
+
component: C = "button",
|
|
638
|
+
className: A,
|
|
639
|
+
disabled: z = !1,
|
|
640
|
+
disableElevation: M = !1,
|
|
641
|
+
disableFocusRipple: I = !1,
|
|
642
|
+
endIcon: $,
|
|
643
|
+
focusVisibleClassName: b,
|
|
644
|
+
fullWidth: T = !1,
|
|
645
|
+
size: R = "medium",
|
|
646
|
+
startIcon: O,
|
|
647
|
+
type: w,
|
|
648
|
+
variant: l = "text",
|
|
649
|
+
...d
|
|
650
|
+
} = p, u = {
|
|
651
|
+
...p,
|
|
652
|
+
color: y,
|
|
653
|
+
component: C,
|
|
654
|
+
disabled: z,
|
|
655
|
+
disableElevation: M,
|
|
656
|
+
disableFocusRipple: I,
|
|
657
|
+
fullWidth: T,
|
|
658
|
+
size: R,
|
|
659
|
+
type: w,
|
|
660
|
+
variant: l
|
|
661
|
+
}, v = yo(u), E = O && /* @__PURE__ */ r(xo, {
|
|
662
|
+
className: v.startIcon,
|
|
663
|
+
ownerState: u,
|
|
664
|
+
children: O
|
|
665
|
+
}), N = $ && /* @__PURE__ */ r(So, {
|
|
666
|
+
className: v.endIcon,
|
|
667
|
+
ownerState: u,
|
|
668
|
+
children: $
|
|
669
|
+
}), P = i || "";
|
|
670
|
+
return /* @__PURE__ */ J(bo, {
|
|
671
|
+
ownerState: u,
|
|
672
|
+
className: L(e.className, v.root, A, P),
|
|
673
|
+
component: C,
|
|
674
|
+
disabled: z,
|
|
675
|
+
focusRipple: !I,
|
|
676
|
+
focusVisibleClassName: L(v.focusVisible, b),
|
|
677
|
+
ref: a,
|
|
678
|
+
type: w,
|
|
679
|
+
...d,
|
|
680
|
+
classes: v,
|
|
681
|
+
children: [E, f, N]
|
|
682
|
+
});
|
|
683
|
+
});
|
|
684
|
+
process.env.NODE_ENV !== "production" && (Co.propTypes = {
|
|
685
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
686
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
687
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
688
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
689
|
+
/**
|
|
690
|
+
* The content of the component.
|
|
691
|
+
*/
|
|
692
|
+
children: t.node,
|
|
693
|
+
/**
|
|
694
|
+
* Override or extend the styles applied to the component.
|
|
695
|
+
*/
|
|
696
|
+
classes: t.object,
|
|
697
|
+
/**
|
|
698
|
+
* @ignore
|
|
699
|
+
*/
|
|
700
|
+
className: t.string,
|
|
701
|
+
/**
|
|
702
|
+
* The color of the component.
|
|
703
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
704
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
705
|
+
* @default 'primary'
|
|
706
|
+
*/
|
|
707
|
+
color: t.oneOfType([t.oneOf(["inherit", "primary", "secondary", "success", "error", "info", "warning"]), t.string]),
|
|
708
|
+
/**
|
|
709
|
+
* The component used for the root node.
|
|
710
|
+
* Either a string to use a HTML element or a component.
|
|
711
|
+
*/
|
|
712
|
+
component: t.elementType,
|
|
713
|
+
/**
|
|
714
|
+
* If `true`, the component is disabled.
|
|
715
|
+
* @default false
|
|
716
|
+
*/
|
|
717
|
+
disabled: t.bool,
|
|
718
|
+
/**
|
|
719
|
+
* If `true`, no elevation is used.
|
|
720
|
+
* @default false
|
|
721
|
+
*/
|
|
722
|
+
disableElevation: t.bool,
|
|
723
|
+
/**
|
|
724
|
+
* If `true`, the keyboard focus ripple is disabled.
|
|
725
|
+
* @default false
|
|
726
|
+
*/
|
|
727
|
+
disableFocusRipple: t.bool,
|
|
728
|
+
/**
|
|
729
|
+
* If `true`, the ripple effect is disabled.
|
|
730
|
+
*
|
|
731
|
+
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
|
|
732
|
+
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
|
733
|
+
* @default false
|
|
734
|
+
*/
|
|
735
|
+
disableRipple: t.bool,
|
|
736
|
+
/**
|
|
737
|
+
* Element placed after the children.
|
|
738
|
+
*/
|
|
739
|
+
endIcon: t.node,
|
|
740
|
+
/**
|
|
741
|
+
* @ignore
|
|
742
|
+
*/
|
|
743
|
+
focusVisibleClassName: t.string,
|
|
744
|
+
/**
|
|
745
|
+
* If `true`, the button will take up the full width of its container.
|
|
746
|
+
* @default false
|
|
747
|
+
*/
|
|
748
|
+
fullWidth: t.bool,
|
|
749
|
+
/**
|
|
750
|
+
* The URL to link to when the button is clicked.
|
|
751
|
+
* If defined, an `a` element will be used as the root node.
|
|
752
|
+
*/
|
|
753
|
+
href: t.string,
|
|
754
|
+
/**
|
|
755
|
+
* The size of the component.
|
|
756
|
+
* `small` is equivalent to the dense button styling.
|
|
757
|
+
* @default 'medium'
|
|
758
|
+
*/
|
|
759
|
+
size: t.oneOfType([t.oneOf(["small", "medium", "large"]), t.string]),
|
|
760
|
+
/**
|
|
761
|
+
* Element placed before the children.
|
|
762
|
+
*/
|
|
763
|
+
startIcon: t.node,
|
|
764
|
+
/**
|
|
765
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
766
|
+
*/
|
|
767
|
+
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
|
|
768
|
+
/**
|
|
769
|
+
* @ignore
|
|
770
|
+
*/
|
|
771
|
+
type: t.oneOfType([t.oneOf(["button", "reset", "submit"]), t.string]),
|
|
772
|
+
/**
|
|
773
|
+
* The variant to use.
|
|
774
|
+
* @default 'text'
|
|
775
|
+
*/
|
|
776
|
+
variant: t.oneOfType([t.oneOf(["contained", "outlined", "text"]), t.string])
|
|
777
|
+
});
|
|
778
|
+
export {
|
|
779
|
+
go as A,
|
|
780
|
+
Co as B
|
|
781
|
+
};
|