@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.
Files changed (45) 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/Inbox.js +592 -582
  29. package/dist/components/Notifications/InboxHeader.js +31 -30
  30. package/dist/components/Notifications/Notification.js +4 -2
  31. package/dist/components/Notifications/NotificationFeed.js +40 -32
  32. package/dist/components/Notifications/NotificationLauncher.js +90 -64
  33. package/dist/components/Notifications/NotificationPopup.js +76 -65
  34. package/dist/components/Preferences/NotificationPreferencesInline.js +57 -39
  35. package/dist/components/Preferences/NotificationPreferencesPopup.js +111 -99
  36. package/dist/components/Preferences/PreferenceInput.js +427 -414
  37. package/dist/components/Preferences/Preferences.js +329 -278
  38. package/dist/components/Provider/index.d.ts +2 -0
  39. package/dist/components/Provider/index.js +1008 -401
  40. package/dist/components/Slack/SlackConnect.js +8 -7
  41. package/dist/main.d.ts +2 -0
  42. package/dist/main.js +6 -3
  43. package/dist/utils/theme.d.ts +17 -0
  44. package/dist/utils/theme.js +104 -0
  45. package/package.json +1 -1
@@ -1,31 +1,18 @@
1
- import * as E from "react";
2
- import { P as t, l as C, n as N, d as B, T as w, e as W, g as D, s as M, h as u, m as _, u as G, c as R, b as V } from "./DefaultPropsProvider.js";
3
- import { jsx as p } from "react/jsx-runtime";
4
- import { G as $, u as A } from "./useTheme2.js";
5
- import { c as U } from "./createSimplePaletteValueFilter.js";
6
- function k(o) {
7
- return o == null || Object.keys(o).length === 0;
8
- }
9
- function T(o) {
10
- const {
11
- styles: r,
12
- defaultTheme: e = {}
13
- } = o;
14
- return /* @__PURE__ */ p($, {
15
- styles: typeof r == "function" ? (a) => r(k(a) ? e : a) : r
16
- });
17
- }
18
- process.env.NODE_ENV !== "production" && (T.propTypes = {
19
- defaultTheme: t.object,
20
- styles: t.oneOfType([t.array, t.string, t.object, t.func])
21
- });
1
+ import * as j from "react";
2
+ import { P as t, f as C, i as B, g as E, e as u } from "./createTheme.js";
3
+ import { d as w, g as N, s as W, m as M, u as D, c as R, a as _ } from "./DefaultPropsProvider.js";
4
+ import { jsx as l } from "react/jsx-runtime";
5
+ import { T as $ } from "./DefaultPropsProvider2.js";
6
+ import { u as A } from "./useTheme.js";
7
+ import { G } from "./GlobalStyles.js";
8
+ import { c as V } from "./createSimplePaletteValueFilter.js";
22
9
  function x({
23
- styles: o,
24
- themeId: r,
10
+ styles: r,
11
+ themeId: o,
25
12
  defaultTheme: e = {}
26
13
  }) {
27
- const n = A(e), a = typeof o == "function" ? o(r && n[r] || n) : o;
28
- return /* @__PURE__ */ p(T, {
14
+ const n = A(e), a = typeof r == "function" ? r(o && n[o] || n) : r;
15
+ return /* @__PURE__ */ l(G, {
29
16
  styles: a
30
17
  });
31
18
  }
@@ -47,47 +34,47 @@ process.env.NODE_ENV !== "production" && (x.propTypes = {
47
34
  */
48
35
  themeId: t.string
49
36
  });
50
- const H = (o) => {
37
+ const U = (r) => {
51
38
  var n;
52
- const r = {
39
+ const o = {
53
40
  systemProps: {},
54
41
  otherProps: {}
55
- }, e = ((n = o == null ? void 0 : o.theme) == null ? void 0 : n.unstable_sxConfig) ?? C;
56
- return Object.keys(o).forEach((a) => {
57
- e[a] ? r.systemProps[a] = o[a] : r.otherProps[a] = o[a];
58
- }), r;
42
+ }, e = ((n = r == null ? void 0 : r.theme) == null ? void 0 : n.unstable_sxConfig) ?? C;
43
+ return Object.keys(r).forEach((a) => {
44
+ e[a] ? o.systemProps[a] = r[a] : o.otherProps[a] = r[a];
45
+ }), o;
59
46
  };
60
- function z(o) {
47
+ function H(r) {
61
48
  const {
62
- sx: r,
49
+ sx: o,
63
50
  ...e
64
- } = o, {
51
+ } = r, {
65
52
  systemProps: n,
66
53
  otherProps: a
67
- } = H(e);
54
+ } = U(e);
68
55
  let s;
69
- return Array.isArray(r) ? s = [n, ...r] : typeof r == "function" ? s = (...l) => {
70
- const i = r(...l);
71
- return N(i) ? {
56
+ return Array.isArray(o) ? s = [n, ...o] : typeof o == "function" ? s = (...p) => {
57
+ const i = o(...p);
58
+ return B(i) ? {
72
59
  ...n,
73
60
  ...i
74
61
  } : n;
75
62
  } : s = {
76
63
  ...n,
77
- ...r
64
+ ...o
78
65
  }, {
79
66
  ...a,
80
67
  sx: s
81
68
  };
82
69
  }
83
- function v(o) {
84
- return /* @__PURE__ */ p(x, {
85
- ...o,
86
- defaultTheme: B,
87
- themeId: w
70
+ function T(r) {
71
+ return /* @__PURE__ */ l(x, {
72
+ ...r,
73
+ defaultTheme: w,
74
+ themeId: $
88
75
  });
89
76
  }
90
- process.env.NODE_ENV !== "production" && (v.propTypes = {
77
+ process.env.NODE_ENV !== "production" && (T.propTypes = {
91
78
  // ┌────────────────────────────── Warning ──────────────────────────────┐
92
79
  // │ These PropTypes are generated from the TypeScript type definitions. │
93
80
  // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
@@ -97,27 +84,27 @@ process.env.NODE_ENV !== "production" && (v.propTypes = {
97
84
  */
98
85
  styles: t.oneOfType([t.array, t.func, t.number, t.object, t.string, t.bool])
99
86
  });
100
- function et(o) {
87
+ function rt(r) {
101
88
  return function(e) {
102
89
  return (
103
90
  // Pigment CSS `globalCss` support callback with theme inside an object but `GlobalStyles` support theme as a callback value.
104
- /* @__PURE__ */ p(v, {
105
- styles: typeof o == "function" ? (n) => o({
91
+ /* @__PURE__ */ l(T, {
92
+ styles: typeof r == "function" ? (n) => r({
106
93
  theme: n,
107
94
  ...e
108
- }) : o
95
+ }) : r
109
96
  })
110
97
  );
111
98
  };
112
99
  }
113
- function F() {
114
- return z;
100
+ function I() {
101
+ return H;
115
102
  }
116
- function I(o) {
117
- return W("MuiTypography", o);
103
+ function k(r) {
104
+ return E("MuiTypography", r);
118
105
  }
119
- D("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
120
- const J = {
106
+ N("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
107
+ const z = {
121
108
  primary: !0,
122
109
  secondary: !0,
123
110
  error: !0,
@@ -127,31 +114,31 @@ const J = {
127
114
  textPrimary: !0,
128
115
  textSecondary: !0,
129
116
  textDisabled: !0
130
- }, L = F(), q = (o) => {
117
+ }, F = I(), J = (r) => {
131
118
  const {
132
- align: r,
119
+ align: o,
133
120
  gutterBottom: e,
134
121
  noWrap: n,
135
122
  paragraph: a,
136
123
  variant: s,
137
- classes: l
138
- } = o, i = {
139
- root: ["root", s, o.align !== "inherit" && `align${u(r)}`, e && "gutterBottom", n && "noWrap", a && "paragraph"]
124
+ classes: p
125
+ } = r, i = {
126
+ root: ["root", s, r.align !== "inherit" && `align${u(o)}`, e && "gutterBottom", n && "noWrap", a && "paragraph"]
140
127
  };
141
- return V(i, I, l);
142
- }, K = M("span", {
128
+ return _(i, k, p);
129
+ }, L = W("span", {
143
130
  name: "MuiTypography",
144
131
  slot: "Root",
145
- overridesResolver: (o, r) => {
132
+ overridesResolver: (r, o) => {
146
133
  const {
147
134
  ownerState: e
148
- } = o;
149
- return [r.root, e.variant && r[e.variant], e.align !== "inherit" && r[`align${u(e.align)}`], e.noWrap && r.noWrap, e.gutterBottom && r.gutterBottom, e.paragraph && r.paragraph];
135
+ } = r;
136
+ return [o.root, e.variant && o[e.variant], e.align !== "inherit" && o[`align${u(e.align)}`], e.noWrap && o.noWrap, e.gutterBottom && o.gutterBottom, e.paragraph && o.paragraph];
150
137
  }
151
- })(_(({
152
- theme: o
138
+ })(M(({
139
+ theme: r
153
140
  }) => {
154
- var r;
141
+ var o;
155
142
  return {
156
143
  margin: 0,
157
144
  variants: [{
@@ -164,24 +151,24 @@ const J = {
164
151
  lineHeight: "inherit",
165
152
  letterSpacing: "inherit"
166
153
  }
167
- }, ...Object.entries(o.typography).filter(([e, n]) => e !== "inherit" && n && typeof n == "object").map(([e, n]) => ({
154
+ }, ...Object.entries(r.typography).filter(([e, n]) => e !== "inherit" && n && typeof n == "object").map(([e, n]) => ({
168
155
  props: {
169
156
  variant: e
170
157
  },
171
158
  style: n
172
- })), ...Object.entries(o.palette).filter(U()).map(([e]) => ({
159
+ })), ...Object.entries(r.palette).filter(V()).map(([e]) => ({
173
160
  props: {
174
161
  color: e
175
162
  },
176
163
  style: {
177
- color: (o.vars || o).palette[e].main
164
+ color: (r.vars || r).palette[e].main
178
165
  }
179
- })), ...Object.entries(((r = o.palette) == null ? void 0 : r.text) || {}).filter(([, e]) => typeof e == "string").map(([e]) => ({
166
+ })), ...Object.entries(((o = r.palette) == null ? void 0 : o.text) || {}).filter(([, e]) => typeof e == "string").map(([e]) => ({
180
167
  props: {
181
168
  color: `text${u(e)}`
182
169
  },
183
170
  style: {
184
- color: (o.vars || o).palette.text[e]
171
+ color: (r.vars || r).palette.text[e]
185
172
  }
186
173
  })), {
187
174
  props: ({
@@ -227,14 +214,14 @@ const J = {
227
214
  body1: "p",
228
215
  body2: "p",
229
216
  inherit: "p"
230
- }, Q = /* @__PURE__ */ E.forwardRef(function(r, e) {
217
+ }, q = /* @__PURE__ */ j.forwardRef(function(o, e) {
231
218
  const {
232
219
  color: n,
233
220
  ...a
234
- } = G({
235
- props: r,
221
+ } = D({
222
+ props: o,
236
223
  name: "MuiTypography"
237
- }), s = !J[n], l = L({
224
+ }), s = !z[n], p = F({
238
225
  ...a,
239
226
  ...s && {
240
227
  color: n
@@ -242,29 +229,29 @@ const J = {
242
229
  }), {
243
230
  align: i = "inherit",
244
231
  className: y,
245
- component: f,
246
- gutterBottom: O = !1,
247
- noWrap: S = !1,
248
- paragraph: h = !1,
232
+ component: h,
233
+ gutterBottom: v = !1,
234
+ noWrap: O = !1,
235
+ paragraph: g = !1,
249
236
  variant: c = "body1",
250
- variantMapping: g = d,
237
+ variantMapping: f = d,
251
238
  ...m
252
- } = l, b = {
253
- ...l,
239
+ } = p, b = {
240
+ ...p,
254
241
  align: i,
255
242
  color: n,
256
243
  className: y,
257
- component: f,
258
- gutterBottom: O,
259
- noWrap: S,
260
- paragraph: h,
244
+ component: h,
245
+ gutterBottom: v,
246
+ noWrap: O,
247
+ paragraph: g,
261
248
  variant: c,
262
- variantMapping: g
263
- }, P = f || (h ? "p" : g[c] || d[c]) || "span", j = q(b);
264
- return /* @__PURE__ */ p(K, {
265
- as: P,
249
+ variantMapping: f
250
+ }, S = h || (g ? "p" : f[c] || d[c]) || "span", P = J(b);
251
+ return /* @__PURE__ */ l(L, {
252
+ as: S,
266
253
  ref: e,
267
- className: R(j.root, y),
254
+ className: R(P.root, y),
268
255
  ...m,
269
256
  ownerState: b,
270
257
  style: {
@@ -275,7 +262,7 @@ const J = {
275
262
  }
276
263
  });
277
264
  });
278
- process.env.NODE_ENV !== "production" && (Q.propTypes = {
265
+ process.env.NODE_ENV !== "production" && (q.propTypes = {
279
266
  // ┌────────────────────────────── Warning ──────────────────────────────┐
280
267
  // │ These PropTypes are generated from the TypeScript type definitions. │
281
268
  // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
@@ -362,7 +349,7 @@ process.env.NODE_ENV !== "production" && (Q.propTypes = {
362
349
  variantMapping: t.object
363
350
  });
364
351
  export {
365
- Q as T,
366
- z as e,
367
- et as g
352
+ q as T,
353
+ H as e,
354
+ rt as g
368
355
  };
@@ -1,6 +1,7 @@
1
1
  import * as h from "react";
2
- import { jsxs as I, jsx as b } from "react/jsx-runtime";
3
- import { e as w, g as C, s as T, h as z, m as N, u as O, c as R, P as e, b as j } from "./DefaultPropsProvider.js";
2
+ import { jsxs as b, jsx as I } from "react/jsx-runtime";
3
+ import { g as w, e as z, P as e } from "./createTheme.js";
4
+ import { g as C, s as T, m as N, u as O, c as R, a as j } from "./DefaultPropsProvider.js";
4
5
  function E(o) {
5
6
  return w("MuiSvgIcon", o);
6
7
  }
@@ -8,33 +9,33 @@ C("MuiSvgIcon", ["root", "colorPrimary", "colorSecondary", "colorAction", "color
8
9
  const $ = (o) => {
9
10
  const {
10
11
  color: r,
11
- fontSize: n,
12
+ fontSize: t,
12
13
  classes: s
13
- } = o, t = {
14
- root: ["root", r !== "inherit" && `color${z(r)}`, `fontSize${z(n)}`]
14
+ } = o, n = {
15
+ root: ["root", r !== "inherit" && `color${z(r)}`, `fontSize${z(t)}`]
15
16
  };
16
- return j(t, E, s);
17
+ return j(n, E, s);
17
18
  }, A = T("svg", {
18
19
  name: "MuiSvgIcon",
19
20
  slot: "Root",
20
21
  overridesResolver: (o, r) => {
21
22
  const {
22
- ownerState: n
23
+ ownerState: t
23
24
  } = o;
24
- return [r.root, n.color !== "inherit" && r[`color${z(n.color)}`], r[`fontSize${z(n.fontSize)}`]];
25
+ return [r.root, t.color !== "inherit" && r[`color${z(t.color)}`], r[`fontSize${z(t.fontSize)}`]];
25
26
  }
26
27
  })(N(({
27
28
  theme: o
28
29
  }) => {
29
- var r, n, s, t, c, u, a, g, p, d, l, m, y, f;
30
+ var r, t, s, n, c, u, a, g, p, d, l, m, y, f;
30
31
  return {
31
32
  userSelect: "none",
32
33
  width: "1em",
33
34
  height: "1em",
34
35
  display: "inline-block",
35
36
  flexShrink: 0,
36
- transition: (t = (r = o.transitions) == null ? void 0 : r.create) == null ? void 0 : t.call(r, "fill", {
37
- duration: (s = (n = (o.vars ?? o).transitions) == null ? void 0 : n.duration) == null ? void 0 : s.shorter
37
+ transition: (n = (r = o.transitions) == null ? void 0 : r.create) == null ? void 0 : n.call(r, "fill", {
38
+ duration: (s = (t = (o.vars ?? o).transitions) == null ? void 0 : t.duration) == null ? void 0 : s.shorter
38
39
  }),
39
40
  variants: [
40
41
  {
@@ -115,12 +116,12 @@ const $ = (o) => {
115
116
  }
116
117
  ]
117
118
  };
118
- })), x = /* @__PURE__ */ h.forwardRef(function(r, n) {
119
+ })), x = /* @__PURE__ */ h.forwardRef(function(r, t) {
119
120
  const s = O({
120
121
  props: r,
121
122
  name: "MuiSvgIcon"
122
123
  }), {
123
- children: t,
124
+ children: n,
124
125
  className: c,
125
126
  color: u = "inherit",
126
127
  component: a = "svg",
@@ -130,7 +131,7 @@ const $ = (o) => {
130
131
  titleAccess: l,
131
132
  viewBox: m = "0 0 24 24",
132
133
  ...y
133
- } = s, f = /* @__PURE__ */ h.isValidElement(t) && t.type === "svg", i = {
134
+ } = s, f = /* @__PURE__ */ h.isValidElement(n) && n.type === "svg", i = {
134
135
  ...s,
135
136
  color: u,
136
137
  component: a,
@@ -142,19 +143,19 @@ const $ = (o) => {
142
143
  }, S = {};
143
144
  d || (S.viewBox = m);
144
145
  const v = $(i);
145
- return /* @__PURE__ */ I(A, {
146
+ return /* @__PURE__ */ b(A, {
146
147
  as: a,
147
148
  className: R(v.root, c),
148
149
  focusable: "false",
149
150
  color: p,
150
151
  "aria-hidden": l ? void 0 : !0,
151
152
  role: l ? "img" : void 0,
152
- ref: n,
153
+ ref: t,
153
154
  ...S,
154
155
  ...y,
155
- ...f && t.props,
156
+ ...f && n.props,
156
157
  ownerState: i,
157
- children: [f ? t.props.children : t, l ? /* @__PURE__ */ b("title", {
158
+ children: [f ? n.props.children : n, l ? /* @__PURE__ */ I("title", {
158
159
  children: l
159
160
  }) : null]
160
161
  });
@@ -232,18 +233,18 @@ process.env.NODE_ENV !== "production" && (x.propTypes = {
232
233
  viewBox: e.string
233
234
  });
234
235
  x.muiName = "SvgIcon";
235
- function V(o, r) {
236
- function n(s, t) {
237
- return /* @__PURE__ */ b(x, {
236
+ function D(o, r) {
237
+ function t(s, n) {
238
+ return /* @__PURE__ */ I(x, {
238
239
  "data-testid": `${r}Icon`,
239
- ref: t,
240
+ ref: n,
240
241
  ...s,
241
242
  children: o
242
243
  });
243
244
  }
244
- return process.env.NODE_ENV !== "production" && (n.displayName = `${r}Icon`), n.muiName = x.muiName, /* @__PURE__ */ h.memo(/* @__PURE__ */ h.forwardRef(n));
245
+ return process.env.NODE_ENV !== "production" && (t.displayName = `${r}Icon`), t.muiName = x.muiName, /* @__PURE__ */ h.memo(/* @__PURE__ */ h.forwardRef(t));
245
246
  }
246
247
  export {
247
248
  x as S,
248
- V as c
249
+ D as c
249
250
  };