@notificationapi/react 1.7.0 → 1.8.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 +4 -3
- package/dist/assets/Box.js +26 -24
- package/dist/assets/Button.js +20 -18
- package/dist/assets/ButtonBase.js +193 -185
- package/dist/assets/DefaultPropsProvider.js +416 -4199
- package/dist/assets/DefaultPropsProvider2.js +992 -0
- package/dist/assets/Divider.js +2 -1
- package/dist/assets/GlobalStyles.js +23 -0
- package/dist/assets/Grow.js +87 -92
- package/dist/assets/IconButton.js +8 -7
- package/dist/assets/List.js +12 -11
- package/dist/assets/Modal.js +18 -17
- package/dist/assets/Notification.js +787 -770
- package/dist/assets/Paper.js +6 -6
- package/dist/assets/Popover.js +38 -37
- package/dist/assets/Portal.js +38 -48
- package/dist/assets/Stack.js +32 -30
- package/dist/assets/Typography.js +84 -97
- package/dist/assets/createSvgIcon.js +25 -24
- package/dist/assets/createTheme.js +2828 -0
- package/dist/assets/dividerClasses.js +16 -15
- package/dist/assets/exactProp.js +13 -0
- package/dist/assets/index.js +19 -148
- package/dist/assets/index2.js +151 -0
- package/dist/assets/useTheme.js +6 -7
- package/dist/assets/{useTheme2.js → useThemeWithoutDefault.js} +63 -67
- package/dist/assets/utils.js +2 -2
- package/dist/components/Notifications/Inbox.js +592 -582
- package/dist/components/Notifications/InboxHeader.js +31 -30
- package/dist/components/Notifications/Notification.js +4 -2
- package/dist/components/Notifications/NotificationFeed.js +40 -32
- package/dist/components/Notifications/NotificationLauncher.js +90 -64
- package/dist/components/Notifications/NotificationPopup.js +76 -65
- package/dist/components/Preferences/NotificationPreferencesInline.js +57 -39
- package/dist/components/Preferences/NotificationPreferencesPopup.js +111 -99
- package/dist/components/Preferences/PreferenceInput.js +427 -414
- package/dist/components/Preferences/Preferences.js +329 -278
- package/dist/components/Provider/index.d.ts +2 -0
- package/dist/components/Provider/index.js +1008 -401
- package/dist/components/Slack/SlackConnect.js +8 -7
- package/dist/main.d.ts +2 -0
- package/dist/main.js +6 -3
- package/dist/utils/theme.d.ts +17 -0
- package/dist/utils/theme.js +104 -0
- package/package.json +1 -1
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import { jsx as i, jsxs as $ } from "react/jsx-runtime";
|
|
2
2
|
import * as c from "react";
|
|
3
|
-
import { useContext as
|
|
4
|
-
import { Preferences as
|
|
5
|
-
import { NotificationAPIContext as
|
|
6
|
-
import { W as
|
|
7
|
-
import {
|
|
8
|
-
import { u as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
import { useContext as eo } from "react";
|
|
4
|
+
import { Preferences as ro } from "./Preferences.js";
|
|
5
|
+
import { NotificationAPIContext as to } from "../Provider/context.js";
|
|
6
|
+
import { W as ao } from "../../assets/WebPushOptInMessage.js";
|
|
7
|
+
import { getThemeColors as so } from "../../utils/theme.js";
|
|
8
|
+
import { u as j } from "../../assets/ButtonBase.js";
|
|
9
|
+
import { g as k, e as u, P as o } from "../../assets/createTheme.js";
|
|
10
|
+
import { g as T, s as f, m as E, u as S, c as g, a as P } from "../../assets/DefaultPropsProvider.js";
|
|
11
|
+
import { B as io, M as no, F as lo } from "../../assets/Modal.js";
|
|
12
|
+
import { P as F } from "../../assets/Paper.js";
|
|
13
|
+
import { u as po } from "../../assets/dividerClasses.js";
|
|
14
|
+
import { T as co } from "../../assets/Typography.js";
|
|
15
|
+
function uo(r) {
|
|
16
|
+
return k("MuiDialog", r);
|
|
15
17
|
}
|
|
16
|
-
const D =
|
|
18
|
+
const D = T("MuiDialog", ["root", "scrollPaper", "scrollBody", "container", "paper", "paperScrollPaper", "paperScrollBody", "paperWidthFalse", "paperWidthXs", "paperWidthSm", "paperWidthMd", "paperWidthLg", "paperWidthXl", "paperFullWidth", "paperFullScreen"]), w = /* @__PURE__ */ c.createContext({});
|
|
17
19
|
process.env.NODE_ENV !== "production" && (w.displayName = "DialogContext");
|
|
18
|
-
const
|
|
20
|
+
const fo = f(io, {
|
|
19
21
|
name: "MuiDialog",
|
|
20
22
|
slot: "Backdrop",
|
|
21
23
|
overrides: (r, e) => e.backdrop
|
|
22
24
|
})({
|
|
23
25
|
// Improve scrollable dialog support.
|
|
24
26
|
zIndex: -1
|
|
25
|
-
}),
|
|
27
|
+
}), mo = (r) => {
|
|
26
28
|
const {
|
|
27
29
|
classes: e,
|
|
28
30
|
scroll: t,
|
|
@@ -34,8 +36,8 @@ const uo = f(io, {
|
|
|
34
36
|
container: ["container", `scroll${u(t)}`],
|
|
35
37
|
paper: ["paper", `paperScroll${u(t)}`, `paperWidth${u(String(a))}`, s && "paperFullWidth", n && "paperFullScreen"]
|
|
36
38
|
};
|
|
37
|
-
return P(l,
|
|
38
|
-
},
|
|
39
|
+
return P(l, uo, e);
|
|
40
|
+
}, go = f(no, {
|
|
39
41
|
name: "MuiDialog",
|
|
40
42
|
slot: "Root",
|
|
41
43
|
overridesResolver: (r, e) => e.root
|
|
@@ -44,7 +46,7 @@ const uo = f(io, {
|
|
|
44
46
|
// Use !important to override the Modal inline-style.
|
|
45
47
|
position: "absolute !important"
|
|
46
48
|
}
|
|
47
|
-
}),
|
|
49
|
+
}), bo = f("div", {
|
|
48
50
|
name: "MuiDialog",
|
|
49
51
|
slot: "Container",
|
|
50
52
|
overridesResolver: (r, e) => {
|
|
@@ -86,7 +88,7 @@ const uo = f(io, {
|
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
}]
|
|
89
|
-
}),
|
|
91
|
+
}), xo = f(F, {
|
|
90
92
|
name: "MuiDialog",
|
|
91
93
|
slot: "Paper",
|
|
92
94
|
overridesResolver: (r, e) => {
|
|
@@ -95,7 +97,7 @@ const uo = f(io, {
|
|
|
95
97
|
} = r;
|
|
96
98
|
return [e.paper, e[`scrollPaper${u(t.scroll)}`], e[`paperWidth${u(String(t.maxWidth))}`], t.fullWidth && e.paperFullWidth, t.fullScreen && e.paperFullScreen];
|
|
97
99
|
}
|
|
98
|
-
})(
|
|
100
|
+
})(E(({
|
|
99
101
|
theme: r
|
|
100
102
|
}) => ({
|
|
101
103
|
margin: 32,
|
|
@@ -178,11 +180,11 @@ const uo = f(io, {
|
|
|
178
180
|
}
|
|
179
181
|
}
|
|
180
182
|
}]
|
|
181
|
-
}))),
|
|
183
|
+
}))), I = /* @__PURE__ */ c.forwardRef(function(e, t) {
|
|
182
184
|
const a = S({
|
|
183
185
|
props: e,
|
|
184
186
|
name: "MuiDialog"
|
|
185
|
-
}), s =
|
|
187
|
+
}), s = j(), n = {
|
|
186
188
|
enter: s.transitions.duration.enteringScreen,
|
|
187
189
|
exit: s.transitions.duration.leavingScreen
|
|
188
190
|
}, {
|
|
@@ -190,88 +192,88 @@ const uo = f(io, {
|
|
|
190
192
|
"aria-labelledby": p,
|
|
191
193
|
"aria-modal": m = !0,
|
|
192
194
|
BackdropComponent: x,
|
|
193
|
-
BackdropProps:
|
|
194
|
-
children:
|
|
195
|
-
className:
|
|
195
|
+
BackdropProps: V,
|
|
196
|
+
children: Y,
|
|
197
|
+
className: _,
|
|
196
198
|
disableEscapeKeyDown: W = !1,
|
|
197
|
-
fullScreen:
|
|
198
|
-
fullWidth:
|
|
199
|
-
maxWidth:
|
|
199
|
+
fullScreen: z = !1,
|
|
200
|
+
fullWidth: K = !1,
|
|
201
|
+
maxWidth: L = "sm",
|
|
200
202
|
onBackdropClick: M,
|
|
201
203
|
onClick: N,
|
|
202
|
-
onClose:
|
|
204
|
+
onClose: h,
|
|
203
205
|
open: O,
|
|
204
|
-
PaperComponent:
|
|
206
|
+
PaperComponent: X = F,
|
|
205
207
|
PaperProps: R = {},
|
|
206
|
-
scroll:
|
|
207
|
-
TransitionComponent:
|
|
208
|
+
scroll: H = "paper",
|
|
209
|
+
TransitionComponent: q = lo,
|
|
208
210
|
transitionDuration: B = n,
|
|
209
|
-
TransitionProps:
|
|
210
|
-
...
|
|
211
|
+
TransitionProps: G,
|
|
212
|
+
...J
|
|
211
213
|
} = a, b = {
|
|
212
214
|
...a,
|
|
213
215
|
disableEscapeKeyDown: W,
|
|
214
|
-
fullScreen:
|
|
215
|
-
fullWidth:
|
|
216
|
-
maxWidth:
|
|
217
|
-
scroll:
|
|
218
|
-
},
|
|
216
|
+
fullScreen: z,
|
|
217
|
+
fullWidth: K,
|
|
218
|
+
maxWidth: L,
|
|
219
|
+
scroll: H
|
|
220
|
+
}, y = mo(b), v = c.useRef(), Q = (d) => {
|
|
219
221
|
v.current = d.target === d.currentTarget;
|
|
220
|
-
},
|
|
221
|
-
N && N(d), v.current && (v.current = null, M && M(d),
|
|
222
|
-
}, C =
|
|
222
|
+
}, Z = (d) => {
|
|
223
|
+
N && N(d), v.current && (v.current = null, M && M(d), h && h(d, "backdropClick"));
|
|
224
|
+
}, C = po(p), oo = c.useMemo(() => ({
|
|
223
225
|
titleId: C
|
|
224
226
|
}), [C]);
|
|
225
|
-
return /* @__PURE__ */ i(
|
|
226
|
-
className: g(
|
|
227
|
+
return /* @__PURE__ */ i(go, {
|
|
228
|
+
className: g(y.root, _),
|
|
227
229
|
closeAfterTransition: !0,
|
|
228
230
|
components: {
|
|
229
|
-
Backdrop:
|
|
231
|
+
Backdrop: fo
|
|
230
232
|
},
|
|
231
233
|
componentsProps: {
|
|
232
234
|
backdrop: {
|
|
233
235
|
transitionDuration: B,
|
|
234
236
|
as: x,
|
|
235
|
-
...
|
|
237
|
+
...V
|
|
236
238
|
}
|
|
237
239
|
},
|
|
238
240
|
disableEscapeKeyDown: W,
|
|
239
|
-
onClose:
|
|
241
|
+
onClose: h,
|
|
240
242
|
open: O,
|
|
241
243
|
ref: t,
|
|
242
|
-
onClick:
|
|
244
|
+
onClick: Z,
|
|
243
245
|
ownerState: b,
|
|
244
|
-
...
|
|
245
|
-
children: /* @__PURE__ */ i(
|
|
246
|
+
...J,
|
|
247
|
+
children: /* @__PURE__ */ i(q, {
|
|
246
248
|
appear: !0,
|
|
247
249
|
in: O,
|
|
248
250
|
timeout: B,
|
|
249
251
|
role: "presentation",
|
|
250
|
-
...
|
|
251
|
-
children: /* @__PURE__ */ i(
|
|
252
|
-
className: g(
|
|
253
|
-
onMouseDown:
|
|
252
|
+
...G,
|
|
253
|
+
children: /* @__PURE__ */ i(bo, {
|
|
254
|
+
className: g(y.container),
|
|
255
|
+
onMouseDown: Q,
|
|
254
256
|
ownerState: b,
|
|
255
|
-
children: /* @__PURE__ */ i(
|
|
256
|
-
as:
|
|
257
|
+
children: /* @__PURE__ */ i(xo, {
|
|
258
|
+
as: X,
|
|
257
259
|
elevation: 24,
|
|
258
260
|
role: "dialog",
|
|
259
261
|
"aria-describedby": l,
|
|
260
262
|
"aria-labelledby": C,
|
|
261
263
|
"aria-modal": m,
|
|
262
264
|
...R,
|
|
263
|
-
className: g(
|
|
265
|
+
className: g(y.paper, R.className),
|
|
264
266
|
ownerState: b,
|
|
265
267
|
children: /* @__PURE__ */ i(w.Provider, {
|
|
266
|
-
value:
|
|
267
|
-
children:
|
|
268
|
+
value: oo,
|
|
269
|
+
children: Y
|
|
268
270
|
})
|
|
269
271
|
})
|
|
270
272
|
})
|
|
271
273
|
})
|
|
272
274
|
});
|
|
273
275
|
});
|
|
274
|
-
process.env.NODE_ENV !== "production" && (
|
|
276
|
+
process.env.NODE_ENV !== "production" && (I.propTypes = {
|
|
275
277
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
276
278
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
277
279
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
@@ -409,22 +411,22 @@ process.env.NODE_ENV !== "production" && (F.propTypes = {
|
|
|
409
411
|
*/
|
|
410
412
|
TransitionProps: o.object
|
|
411
413
|
});
|
|
412
|
-
function
|
|
413
|
-
return
|
|
414
|
+
function ho(r) {
|
|
415
|
+
return k("MuiDialogContent", r);
|
|
414
416
|
}
|
|
415
|
-
|
|
417
|
+
T("MuiDialogContent", ["root", "dividers"]);
|
|
416
418
|
function yo(r) {
|
|
417
|
-
return
|
|
419
|
+
return k("MuiDialogTitle", r);
|
|
418
420
|
}
|
|
419
|
-
const
|
|
421
|
+
const vo = T("MuiDialogTitle", ["root"]), Co = (r) => {
|
|
420
422
|
const {
|
|
421
423
|
classes: e,
|
|
422
424
|
dividers: t
|
|
423
425
|
} = r;
|
|
424
426
|
return P({
|
|
425
427
|
root: ["root", t && "dividers"]
|
|
426
|
-
},
|
|
427
|
-
},
|
|
428
|
+
}, ho, e);
|
|
429
|
+
}, Do = f("div", {
|
|
428
430
|
name: "MuiDialogContent",
|
|
429
431
|
slot: "Root",
|
|
430
432
|
overridesResolver: (r, e) => {
|
|
@@ -433,7 +435,7 @@ const ho = k("MuiDialogTitle", ["root"]), vo = (r) => {
|
|
|
433
435
|
} = r;
|
|
434
436
|
return [e.root, t.dividers && e.dividers];
|
|
435
437
|
}
|
|
436
|
-
})(
|
|
438
|
+
})(E(({
|
|
437
439
|
theme: r
|
|
438
440
|
}) => ({
|
|
439
441
|
flex: "1 1 auto",
|
|
@@ -455,12 +457,12 @@ const ho = k("MuiDialogTitle", ["root"]), vo = (r) => {
|
|
|
455
457
|
ownerState: e
|
|
456
458
|
}) => !e.dividers,
|
|
457
459
|
style: {
|
|
458
|
-
[`.${
|
|
460
|
+
[`.${vo.root} + &`]: {
|
|
459
461
|
paddingTop: 0
|
|
460
462
|
}
|
|
461
463
|
}
|
|
462
464
|
}]
|
|
463
|
-
}))),
|
|
465
|
+
}))), U = /* @__PURE__ */ c.forwardRef(function(e, t) {
|
|
464
466
|
const a = S({
|
|
465
467
|
props: e,
|
|
466
468
|
name: "MuiDialogContent"
|
|
@@ -471,15 +473,15 @@ const ho = k("MuiDialogTitle", ["root"]), vo = (r) => {
|
|
|
471
473
|
} = a, p = {
|
|
472
474
|
...a,
|
|
473
475
|
dividers: n
|
|
474
|
-
}, m =
|
|
475
|
-
return /* @__PURE__ */ i(
|
|
476
|
+
}, m = Co(p);
|
|
477
|
+
return /* @__PURE__ */ i(Do, {
|
|
476
478
|
className: g(m.root, s),
|
|
477
479
|
ownerState: p,
|
|
478
480
|
ref: t,
|
|
479
481
|
...l
|
|
480
482
|
});
|
|
481
483
|
});
|
|
482
|
-
process.env.NODE_ENV !== "production" && (
|
|
484
|
+
process.env.NODE_ENV !== "production" && (U.propTypes = {
|
|
483
485
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
484
486
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
485
487
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
@@ -506,21 +508,21 @@ process.env.NODE_ENV !== "production" && (I.propTypes = {
|
|
|
506
508
|
*/
|
|
507
509
|
sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
|
|
508
510
|
});
|
|
509
|
-
const
|
|
511
|
+
const ko = (r) => {
|
|
510
512
|
const {
|
|
511
513
|
classes: e
|
|
512
514
|
} = r;
|
|
513
515
|
return P({
|
|
514
516
|
root: ["root"]
|
|
515
517
|
}, yo, e);
|
|
516
|
-
},
|
|
518
|
+
}, To = f(co, {
|
|
517
519
|
name: "MuiDialogTitle",
|
|
518
520
|
slot: "Root",
|
|
519
521
|
overridesResolver: (r, e) => e.root
|
|
520
522
|
})({
|
|
521
523
|
padding: "16px 24px",
|
|
522
524
|
flex: "0 0 auto"
|
|
523
|
-
}),
|
|
525
|
+
}), A = /* @__PURE__ */ c.forwardRef(function(e, t) {
|
|
524
526
|
const a = S({
|
|
525
527
|
props: e,
|
|
526
528
|
name: "MuiDialogTitle"
|
|
@@ -528,10 +530,10 @@ const Do = (r) => {
|
|
|
528
530
|
className: s,
|
|
529
531
|
id: n,
|
|
530
532
|
...l
|
|
531
|
-
} = a, p = a, m =
|
|
533
|
+
} = a, p = a, m = ko(p), {
|
|
532
534
|
titleId: x = n
|
|
533
535
|
} = c.useContext(w);
|
|
534
|
-
return /* @__PURE__ */ i(
|
|
536
|
+
return /* @__PURE__ */ i(To, {
|
|
535
537
|
component: "h2",
|
|
536
538
|
className: g(m.root, s),
|
|
537
539
|
ownerState: p,
|
|
@@ -541,7 +543,7 @@ const Do = (r) => {
|
|
|
541
543
|
...l
|
|
542
544
|
});
|
|
543
545
|
});
|
|
544
|
-
process.env.NODE_ENV !== "production" && (
|
|
546
|
+
process.env.NODE_ENV !== "production" && (A.propTypes = {
|
|
545
547
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
546
548
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
547
549
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
@@ -567,44 +569,54 @@ process.env.NODE_ENV !== "production" && (U.propTypes = {
|
|
|
567
569
|
*/
|
|
568
570
|
sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
|
|
569
571
|
});
|
|
570
|
-
function
|
|
571
|
-
const e =
|
|
572
|
+
function Io(r) {
|
|
573
|
+
const e = eo(to), t = j(), a = so(t);
|
|
572
574
|
if (!e)
|
|
573
575
|
return null;
|
|
574
|
-
const
|
|
576
|
+
const s = {
|
|
575
577
|
open: r.open === void 0 ? !0 : r.open,
|
|
576
578
|
onClose: r.onClose || (() => {
|
|
577
579
|
}),
|
|
578
580
|
collapse: r.collapse === void 0 ? !1 : r.collapse
|
|
579
581
|
};
|
|
580
582
|
return /* @__PURE__ */ $(
|
|
581
|
-
|
|
583
|
+
I,
|
|
582
584
|
{
|
|
583
|
-
open:
|
|
584
|
-
onClose:
|
|
585
|
+
open: s.open,
|
|
586
|
+
onClose: s.onClose,
|
|
585
587
|
maxWidth: "sm",
|
|
586
588
|
fullWidth: !0,
|
|
587
589
|
PaperProps: {
|
|
588
|
-
style: {
|
|
590
|
+
style: {
|
|
591
|
+
borderRadius: 8,
|
|
592
|
+
backgroundColor: a.paper,
|
|
593
|
+
color: a.text
|
|
594
|
+
}
|
|
589
595
|
},
|
|
590
|
-
"aria-hidden": !
|
|
596
|
+
"aria-hidden": !s.open,
|
|
591
597
|
scroll: "body",
|
|
592
598
|
children: [
|
|
593
|
-
/* @__PURE__ */ i(
|
|
594
|
-
/* @__PURE__ */ $(
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
599
|
+
/* @__PURE__ */ i(A, { sx: { color: a.text }, children: "Notification Preferences" }),
|
|
600
|
+
/* @__PURE__ */ $(
|
|
601
|
+
U,
|
|
602
|
+
{
|
|
603
|
+
sx: { backgroundColor: a.paper, color: a.text },
|
|
604
|
+
children: [
|
|
605
|
+
/* @__PURE__ */ i(ro, {}),
|
|
606
|
+
e.webPushOptInMessage && /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
|
|
607
|
+
ao,
|
|
608
|
+
{
|
|
609
|
+
hideAfterInteraction: !1,
|
|
610
|
+
descriptionStyle: { fontSize: 12 }
|
|
611
|
+
}
|
|
612
|
+
) })
|
|
613
|
+
]
|
|
614
|
+
}
|
|
615
|
+
)
|
|
604
616
|
]
|
|
605
617
|
}
|
|
606
618
|
);
|
|
607
619
|
}
|
|
608
620
|
export {
|
|
609
|
-
|
|
621
|
+
Io as NotificationPreferencesPopup
|
|
610
622
|
};
|