@notificationapi/react 1.7.0 → 1.9.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 (47) hide show
  1. package/dist/assets/Badge.js +60 -64
  2. package/dist/assets/Box.js +26 -24
  3. package/dist/assets/Button.js +22 -19
  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 +22 -18
  8. package/dist/assets/GlobalStyles.js +23 -0
  9. package/dist/assets/Grow.js +1513 -120
  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 +8 -8
  15. package/dist/assets/Popover.js +37 -36
  16. package/dist/assets/Portal.js +39 -49
  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/exactProp.js +13 -0
  22. package/dist/assets/index.js +19 -148
  23. package/dist/assets/index2.js +151 -0
  24. package/dist/assets/useControlled.js +49 -0
  25. package/dist/assets/usePreviousProps.js +10 -0
  26. package/dist/assets/useTheme.js +6 -7
  27. package/dist/assets/{useTheme2.js → useThemeWithoutDefault.js} +63 -67
  28. package/dist/assets/utils.js +4 -4
  29. package/dist/components/Notifications/Inbox.js +593 -583
  30. package/dist/components/Notifications/InboxHeader.js +360 -1754
  31. package/dist/components/Notifications/Notification.js +4 -2
  32. package/dist/components/Notifications/NotificationFeed.js +40 -32
  33. package/dist/components/Notifications/NotificationLauncher.js +90 -64
  34. package/dist/components/Notifications/NotificationPopup.js +76 -65
  35. package/dist/components/Preferences/NotificationPreferencesInline.js +57 -39
  36. package/dist/components/Preferences/NotificationPreferencesPopup.js +111 -99
  37. package/dist/components/Preferences/PreferenceInput.js +427 -414
  38. package/dist/components/Preferences/Preferences.js +329 -278
  39. package/dist/components/Provider/index.d.ts +2 -0
  40. package/dist/components/Provider/index.js +1008 -401
  41. package/dist/components/Slack/SlackConnect.js +4627 -2024
  42. package/dist/main.d.ts +2 -0
  43. package/dist/main.js +6 -3
  44. package/dist/utils/theme.d.ts +17 -0
  45. package/dist/utils/theme.js +104 -0
  46. package/package.json +1 -1
  47. package/dist/assets/dividerClasses.js +0 -56
@@ -1,21 +1,17 @@
1
- import * as x from "react";
2
- import { g as Y, e as w, s as M, h as t, m as rr, u as or, c as A, P as o, b as ar } from "./DefaultPropsProvider.js";
1
+ import * as X from "react";
2
+ import { g as Y, e as t, P as o } from "./createTheme.js";
3
+ import { g as w, s as L, m as rr, u as or, c as I, a as ar } from "./DefaultPropsProvider.js";
4
+ import { u as M } from "./usePreviousProps.js";
3
5
  import { c as nr } from "./createSimplePaletteValueFilter.js";
4
6
  import { jsxs as tr, jsx as er } from "react/jsx-runtime";
5
- import { u as F } from "./useSlotProps.js";
6
- const U = (a) => {
7
- const r = x.useRef({});
8
- return x.useEffect(() => {
9
- r.current = a;
10
- }), r.current;
11
- };
7
+ import { u as A } from "./useSlotProps.js";
12
8
  function ir(a) {
13
9
  const {
14
10
  badgeContent: r,
15
11
  invisible: n = !1,
16
12
  max: e = 99,
17
13
  showZero: l = !1
18
- } = a, d = U({
14
+ } = a, d = M({
19
15
  badgeContent: r,
20
16
  max: e
21
17
  });
@@ -33,9 +29,9 @@ function ir(a) {
33
29
  };
34
30
  }
35
31
  function sr(a) {
36
- return w("MuiBadge", a);
32
+ return Y("MuiBadge", a);
37
33
  }
38
- const s = Y("MuiBadge", [
34
+ const s = w("MuiBadge", [
39
35
  "root",
40
36
  "badge",
41
37
  "dot",
@@ -75,7 +71,7 @@ const s = Y("MuiBadge", [
75
71
  badge: ["badge", d, e && "invisible", `anchorOrigin${t(n.vertical)}${t(n.horizontal)}`, `anchorOrigin${t(n.vertical)}${t(n.horizontal)}${t(l)}`, `overlap${t(l)}`, r !== "default" && `color${t(r)}`]
76
72
  };
77
73
  return ar(i, sr, c);
78
- }, cr = M("span", {
74
+ }, cr = L("span", {
79
75
  name: "MuiBadge",
80
76
  slot: "Root",
81
77
  overridesResolver: (a, r) => r.root
@@ -85,7 +81,7 @@ const s = Y("MuiBadge", [
85
81
  // For correct alignment with the text.
86
82
  verticalAlign: "middle",
87
83
  flexShrink: 0
88
- }), pr = M("span", {
84
+ }), pr = L("span", {
89
85
  name: "MuiBadge",
90
86
  slot: "Badge",
91
87
  overridesResolver: (a, r) => {
@@ -253,13 +249,13 @@ const s = Y("MuiBadge", [
253
249
  }
254
250
  }]
255
251
  })));
256
- function L(a) {
252
+ function F(a) {
257
253
  return {
258
254
  vertical: (a == null ? void 0 : a.vertical) ?? "top",
259
255
  horizontal: (a == null ? void 0 : a.horizontal) ?? "right"
260
256
  };
261
257
  }
262
- const gr = /* @__PURE__ */ x.forwardRef(function(r, n) {
258
+ const gr = /* @__PURE__ */ X.forwardRef(function(r, n) {
263
259
  const e = or({
264
260
  props: r,
265
261
  name: "MuiBadge"
@@ -270,70 +266,70 @@ const gr = /* @__PURE__ */ x.forwardRef(function(r, n) {
270
266
  component: i,
271
267
  components: p = {},
272
268
  componentsProps: m = {},
273
- children: V,
274
- overlap: T = "rectangular",
275
- color: P = "default",
276
- invisible: W = !1,
277
- max: k = 99,
278
- badgeContent: R,
269
+ children: U,
270
+ overlap: x = "rectangular",
271
+ color: T = "default",
272
+ invisible: V = !1,
273
+ max: W = 99,
274
+ badgeContent: P,
279
275
  slots: g,
280
276
  slotProps: f,
281
- showZero: C = !1,
277
+ showZero: R = !1,
282
278
  variant: h = "standard",
283
- ...E
279
+ ...k
284
280
  } = e, {
285
- badgeContent: B,
286
- invisible: H,
287
- max: Z,
288
- displayValue: _
281
+ badgeContent: C,
282
+ invisible: E,
283
+ max: H,
284
+ displayValue: Z
289
285
  } = ir({
290
- max: k,
291
- invisible: W,
292
- badgeContent: R,
293
- showZero: C
294
- }), q = U({
295
- anchorOrigin: L(l),
296
- color: P,
297
- overlap: T,
286
+ max: W,
287
+ invisible: V,
288
+ badgeContent: P,
289
+ showZero: R
290
+ }), _ = M({
291
+ anchorOrigin: F(l),
292
+ color: T,
293
+ overlap: x,
298
294
  variant: h,
299
- badgeContent: R
300
- }), $ = H || B == null && h !== "dot", {
301
- color: G = P,
302
- overlap: J = T,
303
- anchorOrigin: K,
304
- variant: z = h
305
- } = $ ? q : e, Q = L(K), j = z !== "dot" ? _ : void 0, b = {
295
+ badgeContent: P
296
+ }), B = E || C == null && h !== "dot", {
297
+ color: q = T,
298
+ overlap: G = x,
299
+ anchorOrigin: J,
300
+ variant: $ = h
301
+ } = B ? _ : e, K = F(J), z = $ !== "dot" ? Z : void 0, b = {
306
302
  ...e,
307
- badgeContent: B,
308
- invisible: $,
309
- max: Z,
310
- displayValue: j,
311
- showZero: C,
312
- anchorOrigin: Q,
313
- color: G,
314
- overlap: J,
315
- variant: z
316
- }, N = lr(b), D = (g == null ? void 0 : g.root) ?? p.Root ?? cr, I = (g == null ? void 0 : g.badge) ?? p.Badge ?? pr, u = (f == null ? void 0 : f.root) ?? m.root, v = (f == null ? void 0 : f.badge) ?? m.badge, S = F({
317
- elementType: D,
303
+ badgeContent: C,
304
+ invisible: B,
305
+ max: H,
306
+ displayValue: z,
307
+ showZero: R,
308
+ anchorOrigin: K,
309
+ color: q,
310
+ overlap: G,
311
+ variant: $
312
+ }, j = lr(b), N = (g == null ? void 0 : g.root) ?? p.Root ?? cr, D = (g == null ? void 0 : g.badge) ?? p.Badge ?? pr, u = (f == null ? void 0 : f.root) ?? m.root, v = (f == null ? void 0 : f.badge) ?? m.badge, Q = A({
313
+ elementType: N,
318
314
  externalSlotProps: u,
319
- externalForwardedProps: E,
315
+ externalForwardedProps: k,
320
316
  additionalProps: {
321
317
  ref: n,
322
318
  as: i
323
319
  },
324
320
  ownerState: b,
325
- className: A(u == null ? void 0 : u.className, N.root, d)
326
- }), X = F({
327
- elementType: I,
321
+ className: I(u == null ? void 0 : u.className, j.root, d)
322
+ }), S = A({
323
+ elementType: D,
328
324
  externalSlotProps: v,
329
325
  ownerState: b,
330
- className: A(N.badge, v == null ? void 0 : v.className)
326
+ className: I(j.badge, v == null ? void 0 : v.className)
331
327
  });
332
- return /* @__PURE__ */ tr(D, {
333
- ...S,
334
- children: [V, /* @__PURE__ */ er(I, {
335
- ...X,
336
- children: j
328
+ return /* @__PURE__ */ tr(N, {
329
+ ...Q,
330
+ children: [U, /* @__PURE__ */ er(D, {
331
+ ...S,
332
+ children: z
337
333
  })]
338
334
  });
339
335
  });
@@ -1,39 +1,41 @@
1
- import { i as x, j as p, c as h, g as T, k as y, T as B, C as N, P as e } from "./DefaultPropsProvider.js";
1
+ import { s as u, c as x, C as h, P as e } from "./createTheme.js";
2
+ import { T } from "./DefaultPropsProvider2.js";
3
+ import { b as y, c as B, g as N } from "./DefaultPropsProvider.js";
2
4
  import * as C from "react";
3
- import { jsx as g } from "react/jsx-runtime";
4
- import { u as b } from "./useTheme2.js";
5
- import { e as j } from "./Typography.js";
6
- function v(n = {}) {
5
+ import { jsx as b } from "react/jsx-runtime";
6
+ import { u as g } from "./useTheme.js";
7
+ import { e as v } from "./Typography.js";
8
+ function E(n = {}) {
7
9
  const {
8
10
  themeId: t,
9
11
  defaultTheme: m,
10
12
  defaultClassName: a = "MuiBox-root",
11
13
  generateClassName: r
12
- } = n, c = x("div", {
14
+ } = n, c = y("div", {
13
15
  shouldForwardProp: (o) => o !== "theme" && o !== "sx" && o !== "as"
14
- })(p);
15
- return /* @__PURE__ */ C.forwardRef(function(l, f) {
16
- const s = b(m), {
16
+ })(u);
17
+ return /* @__PURE__ */ C.forwardRef(function(f, l) {
18
+ const s = g(m), {
17
19
  className: i,
18
- component: d = "div",
19
- ...u
20
- } = j(l);
21
- return /* @__PURE__ */ g(c, {
22
- as: d,
23
- ref: f,
24
- className: h(i, r ? r(a) : a),
20
+ component: p = "div",
21
+ ...d
22
+ } = v(f);
23
+ return /* @__PURE__ */ b(c, {
24
+ as: p,
25
+ ref: l,
26
+ className: B(i, r ? r(a) : a),
25
27
  theme: t && s[t] || s,
26
- ...u
28
+ ...d
27
29
  });
28
30
  });
29
31
  }
30
- const E = T("MuiBox", ["root"]), O = y(), P = v({
31
- themeId: B,
32
- defaultTheme: O,
33
- defaultClassName: E.root,
34
- generateClassName: N.generate
32
+ const O = N("MuiBox", ["root"]), P = x(), j = E({
33
+ themeId: T,
34
+ defaultTheme: P,
35
+ defaultClassName: O.root,
36
+ generateClassName: h.generate
35
37
  });
36
- process.env.NODE_ENV !== "production" && (P.propTypes = {
38
+ process.env.NODE_ENV !== "production" && (j.propTypes = {
37
39
  // ┌────────────────────────────── Warning ──────────────────────────────┐
38
40
  // │ These PropTypes are generated from the TypeScript type definitions. │
39
41
  // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
@@ -53,5 +55,5 @@ process.env.NODE_ENV !== "production" && (P.propTypes = {
53
55
  sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
54
56
  });
55
57
  export {
56
- P as B
58
+ j as B
57
59
  };
@@ -1,15 +1,17 @@
1
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";
2
+ import { g as D, e as s, n as k, o as W, P as t, b as B } from "./createTheme.js";
3
+ import { g as U, s as g, m as G, u as _, c as L, a as Z, r as X } from "./DefaultPropsProvider.js";
4
+ import { a as j, B as Y } from "./ButtonBase.js";
4
5
  import { c as h } from "./createSimplePaletteValueFilter.js";
5
6
  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";
7
+ import { jsx as r, jsxs as q } from "react/jsx-runtime";
8
+ import { P as oo } from "./Paper.js";
9
+ import { I as to } from "./IconButton.js";
10
+ import { r as eo } from "./DefaultPropsProvider2.js";
9
11
  function no(o) {
10
- return U("MuiAlert", o);
12
+ return D("MuiAlert", o);
11
13
  }
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", {
14
+ const V = U("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
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"
14
16
  }), "SuccessOutlined"), ro = m(/* @__PURE__ */ r("path", {
15
17
  d: "M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"
@@ -32,7 +34,7 @@ const V = D("MuiAlert", ["root", "action", "icon", "message", "filled", "colorSu
32
34
  action: ["action"]
33
35
  };
34
36
  return Z(c, no, i);
35
- }, po = g(to, {
37
+ }, po = g(oo, {
36
38
  name: "MuiAlert",
37
39
  slot: "Root",
38
40
  overridesResolver: (o, n) => {
@@ -174,7 +176,7 @@ const V = D("MuiAlert", ["root", "action", "icon", "message", "filled", "colorSu
174
176
  ...T
175
177
  }
176
178
  }, [v, E] = j("closeButton", {
177
- elementType: eo,
179
+ elementType: to,
178
180
  externalForwardedProps: u,
179
181
  ownerState: l
180
182
  }), [N, P] = j("closeIcon", {
@@ -182,7 +184,7 @@ const V = D("MuiAlert", ["root", "action", "icon", "message", "filled", "colorSu
182
184
  externalForwardedProps: u,
183
185
  ownerState: l
184
186
  });
185
- return /* @__PURE__ */ J(po, {
187
+ return /* @__PURE__ */ q(po, {
186
188
  role: $,
187
189
  elevation: 0,
188
190
  ownerState: l,
@@ -337,12 +339,12 @@ process.env.NODE_ENV !== "production" && (go.propTypes = {
337
339
  variant: t.oneOfType([t.oneOf(["filled", "outlined", "standard"]), t.string])
338
340
  });
339
341
  function fo(o) {
340
- return U("MuiButton", o);
342
+ return D("MuiButton", o);
341
343
  }
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");
344
+ const x = U("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"]), J = /* @__PURE__ */ S.createContext({});
345
+ process.env.NODE_ENV !== "production" && (J.displayName = "ButtonGroupContext");
346
+ const K = /* @__PURE__ */ S.createContext(void 0);
347
+ process.env.NODE_ENV !== "production" && (K.displayName = "ButtonGroupButtonContext");
346
348
  const yo = (o) => {
347
349
  const {
348
350
  color: n,
@@ -389,7 +391,7 @@ const yo = (o) => {
389
391
  fontSize: 22
390
392
  }
391
393
  }
392
- }], bo = g(oo, {
394
+ }], bo = g(Y, {
393
395
  shouldForwardProp: (o) => X(o) || o === "classes",
394
396
  name: "MuiButton",
395
397
  slot: "Root",
@@ -628,7 +630,7 @@ const yo = (o) => {
628
630
  }
629
631
  }, ...Q]
630
632
  }), Co = /* @__PURE__ */ S.forwardRef(function(n, a) {
631
- const e = S.useContext(K), i = S.useContext(q), c = Y(e, n), p = _({
633
+ const e = S.useContext(J), i = S.useContext(K), c = eo(e, n), p = _({
632
634
  props: c,
633
635
  name: "MuiButton"
634
636
  }), {
@@ -667,7 +669,7 @@ const yo = (o) => {
667
669
  ownerState: u,
668
670
  children: $
669
671
  }), P = i || "";
670
- return /* @__PURE__ */ J(bo, {
672
+ return /* @__PURE__ */ q(bo, {
671
673
  ownerState: u,
672
674
  className: L(e.className, v.root, A, P),
673
675
  component: C,
@@ -777,5 +779,6 @@ process.env.NODE_ENV !== "production" && (Co.propTypes = {
777
779
  });
778
780
  export {
779
781
  go as A,
780
- Co as B
782
+ Co as B,
783
+ lo as C
781
784
  };