@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
@@ -3,16 +3,17 @@ import * as c from "react";
3
3
  import { useContext as at, useState as ge, useCallback as Ro, useEffect as ko } from "react";
4
4
  import { NotificationAPIContext as it } from "../Provider/context.js";
5
5
  import { B as Re } from "../../assets/Box.js";
6
- import { P as e, g as X, e as J, h as _, s as E, m as K, u as ee, c as Z, b as Q, N as Uo, K as ne, w as bo, a as Ke, O as lt } from "../../assets/DefaultPropsProvider.js";
6
+ import { P as e, g as J, e as _, u as Uo, k as bo, a as Ke } from "../../assets/createTheme.js";
7
+ import { g as X, s as E, m as K, u as ee, c as Z, a as Q, r as ne, f as lt } from "../../assets/DefaultPropsProvider.js";
7
8
  import { c as Ue } from "../../assets/createSimplePaletteValueFilter.js";
8
- import { k as Vo, c as Ho } from "../../assets/useTheme2.js";
9
- import { b as We, e as ct, r as Me, c as dt, B as ut } from "../../assets/ButtonBase.js";
9
+ import { k as Vo, c as Ho } from "../../assets/useThemeWithoutDefault.js";
10
+ import { d as We, e as ct, r as Me, c as dt, B as ut } from "../../assets/ButtonBase.js";
10
11
  import { A as io, B as ke } from "../../assets/Button.js";
11
12
  import { u as Ve, f as He, F as qo, S as lo } from "../../assets/Stack.js";
12
13
  import { g as pt, T as Ge } from "../../assets/Typography.js";
13
14
  import { i as To, a as co, L as ft, b as Mo } from "../../assets/List.js";
14
- import { r as yo } from "../../assets/index.js";
15
- import { u as mt } from "../../assets/Grow.js";
15
+ import { r as yo } from "../../assets/index2.js";
16
+ import { u as mt } from "../../assets/index.js";
16
17
  import { d as bt, P as yt, a as gt } from "../../assets/Popover.js";
17
18
  import { o as po, g as ht } from "../../assets/Modal.js";
18
19
  import { u as Ee } from "../../assets/resolveComponentProps.js";
@@ -4637,7 +4638,7 @@ process.env.NODE_ENV !== "production" && (wo.propTypes = {
4637
4638
  variant: e.oneOf(["filled", "outlined", "standard"])
4638
4639
  });
4639
4640
  wo.muiName = "Select";
4640
- function er({
4641
+ function or({
4641
4642
  description: o = "Connect your Slack workspace to receive notifications directly in Slack.",
4642
4643
  connectButtonText: t = "Connect Slack",
4643
4644
  editButtonText: n = "Edit Channel",
@@ -4849,5 +4850,5 @@ function er({
4849
4850
  ] }) : null;
4850
4851
  }
4851
4852
  export {
4852
- er as SlackConnect
4853
+ or as SlackConnect
4853
4854
  };
package/dist/main.d.ts CHANGED
@@ -3,3 +3,5 @@ export { NotificationPreferencesInline, NotificationPreferencesPopup } from './c
3
3
  export { NotificationAPIProvider } from './components/Provider';
4
4
  export { SlackConnect } from './components/Slack';
5
5
  export { createDebugLogger, type DebugLogger } from './utils/debug';
6
+ export type { NotificationAPITheme, NotificationAPIThemeMode, NotificationAPIThemeColors } from './utils/theme';
7
+ export { createNotificationAPITheme, getThemeColors } from './utils/theme';
package/dist/main.js CHANGED
@@ -5,8 +5,9 @@ import { NotificationCounter as p } from "./components/Notifications/Notificatio
5
5
  import { NotificationPreferencesPopup as m } from "./components/Preferences/NotificationPreferencesPopup.js";
6
6
  import { NotificationPreferencesInline as N } from "./components/Preferences/NotificationPreferencesInline.js";
7
7
  import { NotificationAPIProvider as u } from "./components/Provider/index.js";
8
- import { SlackConnect as d } from "./components/Slack/SlackConnect.js";
8
+ import { SlackConnect as h } from "./components/Slack/SlackConnect.js";
9
9
  import { createDebugLogger as s } from "./utils/debug.js";
10
+ import { createNotificationAPITheme as I, getThemeColors as d } from "./utils/theme.js";
10
11
  export {
11
12
  u as NotificationAPIProvider,
12
13
  p as NotificationCounter,
@@ -15,6 +16,8 @@ export {
15
16
  i as NotificationPopup,
16
17
  N as NotificationPreferencesInline,
17
18
  m as NotificationPreferencesPopup,
18
- d as SlackConnect,
19
- s as createDebugLogger
19
+ h as SlackConnect,
20
+ s as createDebugLogger,
21
+ I as createNotificationAPITheme,
22
+ d as getThemeColors
20
23
  };
@@ -0,0 +1,17 @@
1
+ import { Theme } from '@mui/material/styles';
2
+ export type NotificationAPIThemeMode = 'light' | 'dark';
3
+ export type NotificationAPIThemeColors = {
4
+ background?: string;
5
+ paper?: string;
6
+ text?: string;
7
+ textSecondary?: string;
8
+ border?: string;
9
+ icon?: string;
10
+ divider?: string;
11
+ };
12
+ export type NotificationAPITheme = NotificationAPIThemeMode | {
13
+ mode?: NotificationAPIThemeMode;
14
+ colors?: NotificationAPIThemeColors;
15
+ } | Theme;
16
+ export declare function createNotificationAPITheme(theme: NotificationAPITheme): Theme;
17
+ export declare function getThemeColors(theme: Theme): Required<NotificationAPIThemeColors>;
@@ -0,0 +1,104 @@
1
+ import { c } from "../assets/createTheme.js";
2
+ const d = {
3
+ background: "#ffffff",
4
+ paper: "#ffffff",
5
+ text: "#000000",
6
+ textSecondary: "#666666",
7
+ border: "#dcdcdc",
8
+ icon: "#000000",
9
+ divider: "#e0e0e0"
10
+ }, a = {
11
+ background: "#1e1e1e",
12
+ paper: "#2d2d2d",
13
+ text: "#ffffff",
14
+ textSecondary: "#b0b0b0",
15
+ border: "#404040",
16
+ icon: "#ffffff",
17
+ divider: "#404040"
18
+ };
19
+ function n(r) {
20
+ if (r && typeof r == "object" && "palette" in r)
21
+ return r;
22
+ let t = "light", e = {};
23
+ r === "dark" || r === "light" ? t = r : r && typeof r == "object" && (t = r.mode || "light", e = r.colors || {});
24
+ const o = { ...t === "dark" ? a : d, ...e }, i = {
25
+ palette: {
26
+ mode: t,
27
+ background: {
28
+ default: o.background,
29
+ paper: o.paper
30
+ },
31
+ text: {
32
+ primary: o.text,
33
+ secondary: o.textSecondary
34
+ },
35
+ divider: o.divider
36
+ },
37
+ components: {
38
+ MuiPaper: {
39
+ styleOverrides: {
40
+ root: {
41
+ backgroundColor: o.paper,
42
+ color: o.text
43
+ }
44
+ }
45
+ },
46
+ MuiPopover: {
47
+ styleOverrides: {
48
+ paper: {
49
+ backgroundColor: o.paper,
50
+ color: o.text
51
+ }
52
+ }
53
+ },
54
+ MuiDialog: {
55
+ styleOverrides: {
56
+ paper: {
57
+ backgroundColor: o.paper,
58
+ color: o.text
59
+ }
60
+ }
61
+ },
62
+ MuiList: {
63
+ styleOverrides: {
64
+ root: {
65
+ backgroundColor: o.paper,
66
+ color: o.text
67
+ }
68
+ }
69
+ },
70
+ MuiListItem: {
71
+ styleOverrides: {
72
+ root: {
73
+ backgroundColor: o.paper,
74
+ color: o.text
75
+ }
76
+ }
77
+ },
78
+ MuiDivider: {
79
+ styleOverrides: {
80
+ root: {
81
+ borderColor: o.divider
82
+ }
83
+ }
84
+ }
85
+ }
86
+ };
87
+ return c(i);
88
+ }
89
+ function f(r) {
90
+ const e = r.palette.mode === "dark" ? a : d;
91
+ return {
92
+ background: r.palette.background.default || e.background,
93
+ paper: r.palette.background.paper || e.paper,
94
+ text: r.palette.text.primary || e.text,
95
+ textSecondary: r.palette.text.secondary || e.textSecondary,
96
+ border: e.border,
97
+ icon: e.icon,
98
+ divider: r.palette.divider || e.divider
99
+ };
100
+ }
101
+ export {
102
+ n as createNotificationAPITheme,
103
+ f as getThemeColors
104
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@notificationapi/react",
3
3
  "private": false,
4
- "version": "1.7.0",
4
+ "version": "1.8.0",
5
5
  "type": "module",
6
6
  "overrides": {
7
7
  "esbuild": "^0.25.0",