@notificationapi/react 1.6.2 → 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.
Files changed (57) hide show
  1. package/dist/assets/Badge.js +4 -3
  2. package/dist/assets/Box.js +26 -24
  3. package/dist/assets/Button.js +20 -18
  4. package/dist/assets/ButtonBase.js +193 -185
  5. package/dist/assets/DefaultPropsProvider.js +416 -4199
  6. package/dist/assets/DefaultPropsProvider2.js +992 -0
  7. package/dist/assets/Divider.js +2 -1
  8. package/dist/assets/GlobalStyles.js +23 -0
  9. package/dist/assets/Grow.js +87 -92
  10. package/dist/assets/IconButton.js +8 -7
  11. package/dist/assets/List.js +12 -11
  12. package/dist/assets/Modal.js +18 -17
  13. package/dist/assets/Notification.js +787 -770
  14. package/dist/assets/Paper.js +6 -6
  15. package/dist/assets/Popover.js +38 -37
  16. package/dist/assets/Portal.js +38 -48
  17. package/dist/assets/Stack.js +32 -30
  18. package/dist/assets/Typography.js +84 -97
  19. package/dist/assets/createSvgIcon.js +25 -24
  20. package/dist/assets/createTheme.js +2828 -0
  21. package/dist/assets/dividerClasses.js +16 -15
  22. package/dist/assets/exactProp.js +13 -0
  23. package/dist/assets/index.js +19 -148
  24. package/dist/assets/index2.js +151 -0
  25. package/dist/assets/useTheme.js +6 -7
  26. package/dist/assets/{useTheme2.js → useThemeWithoutDefault.js} +63 -67
  27. package/dist/assets/utils.js +2 -2
  28. package/dist/components/Notifications/DefaultEmpty.d.ts +0 -1
  29. package/dist/components/Notifications/Inbox.d.ts +0 -1
  30. package/dist/components/Notifications/Inbox.js +592 -582
  31. package/dist/components/Notifications/InboxHeader.js +31 -30
  32. package/dist/components/Notifications/Notification.d.ts +0 -1
  33. package/dist/components/Notifications/Notification.js +4 -2
  34. package/dist/components/Notifications/NotificationCounter.d.ts +0 -1
  35. package/dist/components/Notifications/NotificationFeed.d.ts +0 -1
  36. package/dist/components/Notifications/NotificationFeed.js +40 -32
  37. package/dist/components/Notifications/NotificationLauncher.d.ts +0 -1
  38. package/dist/components/Notifications/NotificationLauncher.js +90 -64
  39. package/dist/components/Notifications/NotificationPopup.d.ts +0 -1
  40. package/dist/components/Notifications/NotificationPopup.js +76 -65
  41. package/dist/components/Notifications/UnreadBadge.d.ts +0 -1
  42. package/dist/components/Preferences/NotificationPreferencesInline.js +57 -39
  43. package/dist/components/Preferences/NotificationPreferencesPopup.js +111 -99
  44. package/dist/components/Preferences/PreferenceInput.d.ts +0 -1
  45. package/dist/components/Preferences/PreferenceInput.js +427 -414
  46. package/dist/components/Preferences/Preferences.js +329 -278
  47. package/dist/components/Preferences/channelUtils.d.ts +0 -1
  48. package/dist/components/Provider/context.d.ts +0 -1
  49. package/dist/components/Provider/index.d.ts +4 -2
  50. package/dist/components/Provider/index.js +986 -375
  51. package/dist/components/Slack/SlackConnect.js +8 -7
  52. package/dist/components/WebPush/WebPushOptInMessage.d.ts +0 -1
  53. package/dist/main.d.ts +2 -1
  54. package/dist/main.js +6 -3
  55. package/dist/utils/theme.d.ts +17 -0
  56. package/dist/utils/theme.js +104 -0
  57. package/package.json +7 -3
@@ -1,23 +1,24 @@
1
1
  import * as n from "react";
2
- import { g as h, e as g } from "./DefaultPropsProvider.js";
3
- let r = 0;
2
+ import { g as h } from "./DefaultPropsProvider.js";
3
+ import { g } from "./createTheme.js";
4
+ let l = 0;
4
5
  function m(e) {
5
6
  const [t, o] = n.useState(e), s = e || t;
6
7
  return n.useEffect(() => {
7
- t == null && (r += 1, o(`mui-${r}`));
8
+ t == null && (l += 1, o(`mui-${l}`));
8
9
  }, [t]), s;
9
10
  }
10
11
  const p = {
11
12
  ...n
12
13
  }, u = p.useId;
13
- function b(e) {
14
+ function v(e) {
14
15
  if (u !== void 0) {
15
16
  const t = u();
16
17
  return e ?? t;
17
18
  }
18
19
  return m(e);
19
20
  }
20
- function v({
21
+ function C({
21
22
  controlled: e,
22
23
  default: t,
23
24
  name: o,
@@ -32,25 +33,25 @@ function v({
32
33
  `));
33
34
  }, [s, o, e]);
34
35
  const {
35
- current: l
36
+ current: r
36
37
  } = n.useRef(t);
37
38
  n.useEffect(() => {
38
- !i && !Object.is(l, t) && console.error([`MUI: A component is changing the default ${s} state of an uncontrolled ${o} after being initialized. To suppress this warning opt to use a controlled ${o}.`].join(`
39
+ !i && !Object.is(r, t) && console.error([`MUI: A component is changing the default ${s} state of an uncontrolled ${o} after being initialized. To suppress this warning opt to use a controlled ${o}.`].join(`
39
40
  `));
40
41
  }, [JSON.stringify(t)]);
41
42
  }
42
- const f = n.useCallback((l) => {
43
- i || a(l);
43
+ const f = n.useCallback((r) => {
44
+ i || a(r);
44
45
  }, []);
45
46
  return [d, f];
46
47
  }
47
- function C(e) {
48
+ function $(e) {
48
49
  return g("MuiDivider", e);
49
50
  }
50
- const $ = h("MuiDivider", ["root", "absolute", "fullWidth", "inset", "middle", "flexItem", "light", "vertical", "withChildren", "withChildrenVertical", "textAlignRight", "textAlignLeft", "wrapper", "wrapperVertical"]);
51
+ const w = h("MuiDivider", ["root", "absolute", "fullWidth", "inset", "middle", "flexItem", "light", "vertical", "withChildren", "withChildrenVertical", "textAlignRight", "textAlignLeft", "wrapper", "wrapperVertical"]);
51
52
  export {
52
- v as a,
53
- $ as d,
54
- C as g,
55
- b as u
53
+ C as a,
54
+ w as d,
55
+ $ as g,
56
+ v as u
56
57
  };
@@ -0,0 +1,13 @@
1
+ const n = "exact-prop: ​";
2
+ function p(e) {
3
+ return process.env.NODE_ENV === "production" ? e : {
4
+ ...e,
5
+ [n]: (o) => {
6
+ const t = Object.keys(o).filter((r) => !e.hasOwnProperty(r));
7
+ return t.length > 0 ? new Error(`The following props are not supported: ${t.map((r) => `\`${r}\``).join(", ")}. Please remove them.`) : null;
8
+ }
9
+ };
10
+ }
11
+ export {
12
+ p as e
13
+ };
@@ -1,151 +1,22 @@
1
- var P = { exports: {} }, e = {};
2
- /**
3
- * @license React
4
- * react-is.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */
11
- var d;
12
- function y() {
13
- if (d) return e;
14
- d = 1;
15
- var n = Symbol.for("react.transitional.element"), R = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), i = Symbol.for("react.consumer"), u = Symbol.for("react.context"), a = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), l = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), C = Symbol.for("react.client.reference");
16
- function o(r) {
17
- if (typeof r == "object" && r !== null) {
18
- var m = r.$$typeof;
19
- switch (m) {
20
- case n:
21
- switch (r = r.type, r) {
22
- case T:
23
- case f:
24
- case s:
25
- case E:
26
- case c:
27
- return r;
28
- default:
29
- switch (r = r && r.$$typeof, r) {
30
- case u:
31
- case a:
32
- case _:
33
- case l:
34
- return r;
35
- case i:
36
- return r;
37
- default:
38
- return m;
39
- }
40
- }
41
- case R:
42
- return m;
43
- }
44
- }
45
- }
46
- return e.ContextConsumer = i, e.ContextProvider = u, e.Element = n, e.ForwardRef = a, e.Fragment = T, e.Lazy = _, e.Memo = l, e.Portal = R, e.Profiler = f, e.StrictMode = s, e.Suspense = E, e.SuspenseList = c, e.isContextConsumer = function(r) {
47
- return o(r) === i;
48
- }, e.isContextProvider = function(r) {
49
- return o(r) === u;
50
- }, e.isElement = function(r) {
51
- return typeof r == "object" && r !== null && r.$$typeof === n;
52
- }, e.isForwardRef = function(r) {
53
- return o(r) === a;
54
- }, e.isFragment = function(r) {
55
- return o(r) === T;
56
- }, e.isLazy = function(r) {
57
- return o(r) === _;
58
- }, e.isMemo = function(r) {
59
- return o(r) === l;
60
- }, e.isPortal = function(r) {
61
- return o(r) === R;
62
- }, e.isProfiler = function(r) {
63
- return o(r) === f;
64
- }, e.isStrictMode = function(r) {
65
- return o(r) === s;
66
- }, e.isSuspense = function(r) {
67
- return o(r) === E;
68
- }, e.isSuspenseList = function(r) {
69
- return o(r) === c;
70
- }, e.isValidElementType = function(r) {
71
- return typeof r == "string" || typeof r == "function" || r === T || r === f || r === s || r === E || r === c || r === S || typeof r == "object" && r !== null && (r.$$typeof === _ || r.$$typeof === l || r.$$typeof === u || r.$$typeof === i || r.$$typeof === a || r.$$typeof === C || r.getModuleId !== void 0);
72
- }, e.typeOf = o, e;
1
+ import * as t from "react";
2
+ import { P as o } from "./createTheme.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ const r = /* @__PURE__ */ t.createContext();
5
+ function u({
6
+ value: e,
7
+ ...s
8
+ }) {
9
+ return /* @__PURE__ */ n(r.Provider, {
10
+ value: e ?? !0,
11
+ ...s
12
+ });
73
13
  }
74
- var t = {};
75
- /**
76
- * @license React
77
- * react-is.development.js
78
- *
79
- * Copyright (c) Meta Platforms, Inc. and affiliates.
80
- *
81
- * This source code is licensed under the MIT license found in the
82
- * LICENSE file in the root directory of this source tree.
83
- */
84
- var A;
85
- function p() {
86
- return A || (A = 1, process.env.NODE_ENV !== "production" && function() {
87
- function n(r) {
88
- if (typeof r == "object" && r !== null) {
89
- var m = r.$$typeof;
90
- switch (m) {
91
- case R:
92
- switch (r = r.type, r) {
93
- case s:
94
- case i:
95
- case f:
96
- case c:
97
- case l:
98
- return r;
99
- default:
100
- switch (r = r && r.$$typeof, r) {
101
- case a:
102
- case E:
103
- case S:
104
- case _:
105
- return r;
106
- case u:
107
- return r;
108
- default:
109
- return m;
110
- }
111
- }
112
- case T:
113
- return m;
114
- }
115
- }
116
- }
117
- var R = Symbol.for("react.transitional.element"), T = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), u = Symbol.for("react.consumer"), a = Symbol.for("react.context"), E = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), l = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), o = Symbol.for("react.client.reference");
118
- t.ContextConsumer = u, t.ContextProvider = a, t.Element = R, t.ForwardRef = E, t.Fragment = s, t.Lazy = S, t.Memo = _, t.Portal = T, t.Profiler = i, t.StrictMode = f, t.Suspense = c, t.SuspenseList = l, t.isContextConsumer = function(r) {
119
- return n(r) === u;
120
- }, t.isContextProvider = function(r) {
121
- return n(r) === a;
122
- }, t.isElement = function(r) {
123
- return typeof r == "object" && r !== null && r.$$typeof === R;
124
- }, t.isForwardRef = function(r) {
125
- return n(r) === E;
126
- }, t.isFragment = function(r) {
127
- return n(r) === s;
128
- }, t.isLazy = function(r) {
129
- return n(r) === S;
130
- }, t.isMemo = function(r) {
131
- return n(r) === _;
132
- }, t.isPortal = function(r) {
133
- return n(r) === T;
134
- }, t.isProfiler = function(r) {
135
- return n(r) === i;
136
- }, t.isStrictMode = function(r) {
137
- return n(r) === f;
138
- }, t.isSuspense = function(r) {
139
- return n(r) === c;
140
- }, t.isSuspenseList = function(r) {
141
- return n(r) === l;
142
- }, t.isValidElementType = function(r) {
143
- return typeof r == "string" || typeof r == "function" || r === s || r === i || r === f || r === c || r === l || r === C || typeof r == "object" && r !== null && (r.$$typeof === S || r.$$typeof === _ || r.$$typeof === a || r.$$typeof === u || r.$$typeof === E || r.$$typeof === o || r.getModuleId !== void 0);
144
- }, t.typeOf = n;
145
- }()), t;
146
- }
147
- process.env.NODE_ENV === "production" ? P.exports = y() : P.exports = p();
148
- var Y = P.exports;
14
+ process.env.NODE_ENV !== "production" && (u.propTypes = {
15
+ children: o.node,
16
+ value: o.bool
17
+ });
18
+ const l = () => t.useContext(r) ?? !1;
149
19
  export {
150
- Y as r
20
+ u as R,
21
+ l as u
151
22
  };
@@ -0,0 +1,151 @@
1
+ var P = { exports: {} }, e = {};
2
+ /**
3
+ * @license React
4
+ * react-is.production.js
5
+ *
6
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */
11
+ var d;
12
+ function y() {
13
+ if (d) return e;
14
+ d = 1;
15
+ var n = Symbol.for("react.transitional.element"), R = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), i = Symbol.for("react.consumer"), u = Symbol.for("react.context"), a = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), l = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), C = Symbol.for("react.client.reference");
16
+ function o(r) {
17
+ if (typeof r == "object" && r !== null) {
18
+ var m = r.$$typeof;
19
+ switch (m) {
20
+ case n:
21
+ switch (r = r.type, r) {
22
+ case T:
23
+ case f:
24
+ case s:
25
+ case E:
26
+ case c:
27
+ return r;
28
+ default:
29
+ switch (r = r && r.$$typeof, r) {
30
+ case u:
31
+ case a:
32
+ case _:
33
+ case l:
34
+ return r;
35
+ case i:
36
+ return r;
37
+ default:
38
+ return m;
39
+ }
40
+ }
41
+ case R:
42
+ return m;
43
+ }
44
+ }
45
+ }
46
+ return e.ContextConsumer = i, e.ContextProvider = u, e.Element = n, e.ForwardRef = a, e.Fragment = T, e.Lazy = _, e.Memo = l, e.Portal = R, e.Profiler = f, e.StrictMode = s, e.Suspense = E, e.SuspenseList = c, e.isContextConsumer = function(r) {
47
+ return o(r) === i;
48
+ }, e.isContextProvider = function(r) {
49
+ return o(r) === u;
50
+ }, e.isElement = function(r) {
51
+ return typeof r == "object" && r !== null && r.$$typeof === n;
52
+ }, e.isForwardRef = function(r) {
53
+ return o(r) === a;
54
+ }, e.isFragment = function(r) {
55
+ return o(r) === T;
56
+ }, e.isLazy = function(r) {
57
+ return o(r) === _;
58
+ }, e.isMemo = function(r) {
59
+ return o(r) === l;
60
+ }, e.isPortal = function(r) {
61
+ return o(r) === R;
62
+ }, e.isProfiler = function(r) {
63
+ return o(r) === f;
64
+ }, e.isStrictMode = function(r) {
65
+ return o(r) === s;
66
+ }, e.isSuspense = function(r) {
67
+ return o(r) === E;
68
+ }, e.isSuspenseList = function(r) {
69
+ return o(r) === c;
70
+ }, e.isValidElementType = function(r) {
71
+ return typeof r == "string" || typeof r == "function" || r === T || r === f || r === s || r === E || r === c || r === S || typeof r == "object" && r !== null && (r.$$typeof === _ || r.$$typeof === l || r.$$typeof === u || r.$$typeof === i || r.$$typeof === a || r.$$typeof === C || r.getModuleId !== void 0);
72
+ }, e.typeOf = o, e;
73
+ }
74
+ var t = {};
75
+ /**
76
+ * @license React
77
+ * react-is.development.js
78
+ *
79
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
80
+ *
81
+ * This source code is licensed under the MIT license found in the
82
+ * LICENSE file in the root directory of this source tree.
83
+ */
84
+ var A;
85
+ function p() {
86
+ return A || (A = 1, process.env.NODE_ENV !== "production" && function() {
87
+ function n(r) {
88
+ if (typeof r == "object" && r !== null) {
89
+ var m = r.$$typeof;
90
+ switch (m) {
91
+ case R:
92
+ switch (r = r.type, r) {
93
+ case s:
94
+ case i:
95
+ case f:
96
+ case c:
97
+ case l:
98
+ return r;
99
+ default:
100
+ switch (r = r && r.$$typeof, r) {
101
+ case a:
102
+ case E:
103
+ case S:
104
+ case _:
105
+ return r;
106
+ case u:
107
+ return r;
108
+ default:
109
+ return m;
110
+ }
111
+ }
112
+ case T:
113
+ return m;
114
+ }
115
+ }
116
+ }
117
+ var R = Symbol.for("react.transitional.element"), T = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), u = Symbol.for("react.consumer"), a = Symbol.for("react.context"), E = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), l = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), o = Symbol.for("react.client.reference");
118
+ t.ContextConsumer = u, t.ContextProvider = a, t.Element = R, t.ForwardRef = E, t.Fragment = s, t.Lazy = S, t.Memo = _, t.Portal = T, t.Profiler = i, t.StrictMode = f, t.Suspense = c, t.SuspenseList = l, t.isContextConsumer = function(r) {
119
+ return n(r) === u;
120
+ }, t.isContextProvider = function(r) {
121
+ return n(r) === a;
122
+ }, t.isElement = function(r) {
123
+ return typeof r == "object" && r !== null && r.$$typeof === R;
124
+ }, t.isForwardRef = function(r) {
125
+ return n(r) === E;
126
+ }, t.isFragment = function(r) {
127
+ return n(r) === s;
128
+ }, t.isLazy = function(r) {
129
+ return n(r) === S;
130
+ }, t.isMemo = function(r) {
131
+ return n(r) === _;
132
+ }, t.isPortal = function(r) {
133
+ return n(r) === T;
134
+ }, t.isProfiler = function(r) {
135
+ return n(r) === i;
136
+ }, t.isStrictMode = function(r) {
137
+ return n(r) === f;
138
+ }, t.isSuspense = function(r) {
139
+ return n(r) === c;
140
+ }, t.isSuspenseList = function(r) {
141
+ return n(r) === l;
142
+ }, t.isValidElementType = function(r) {
143
+ return typeof r == "string" || typeof r == "function" || r === s || r === i || r === f || r === c || r === l || r === C || typeof r == "object" && r !== null && (r.$$typeof === S || r.$$typeof === _ || r.$$typeof === a || r.$$typeof === u || r.$$typeof === E || r.$$typeof === o || r.getModuleId !== void 0);
144
+ }, t.typeOf = n;
145
+ }()), t;
146
+ }
147
+ process.env.NODE_ENV === "production" ? P.exports = y() : P.exports = p();
148
+ var Y = P.exports;
149
+ export {
150
+ Y as r
151
+ };
@@ -1,10 +1,9 @@
1
- import * as o from "react";
2
- import { T as r, d as s } from "./DefaultPropsProvider.js";
3
- import { u as t } from "./useTheme2.js";
4
- function a() {
5
- const e = t(s);
6
- return process.env.NODE_ENV !== "production" && o.useDebugValue(e), e[r] || e;
1
+ import { b as m } from "./createTheme.js";
2
+ import { u as t } from "./useThemeWithoutDefault.js";
3
+ const r = m();
4
+ function u(e = r) {
5
+ return t(e);
7
6
  }
8
7
  export {
9
- a as u
8
+ u
10
9
  };