@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.
- 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/DefaultEmpty.d.ts +0 -1
- package/dist/components/Notifications/Inbox.d.ts +0 -1
- package/dist/components/Notifications/Inbox.js +592 -582
- package/dist/components/Notifications/InboxHeader.js +31 -30
- package/dist/components/Notifications/Notification.d.ts +0 -1
- package/dist/components/Notifications/Notification.js +4 -2
- package/dist/components/Notifications/NotificationCounter.d.ts +0 -1
- package/dist/components/Notifications/NotificationFeed.d.ts +0 -1
- package/dist/components/Notifications/NotificationFeed.js +40 -32
- package/dist/components/Notifications/NotificationLauncher.d.ts +0 -1
- package/dist/components/Notifications/NotificationLauncher.js +90 -64
- package/dist/components/Notifications/NotificationPopup.d.ts +0 -1
- package/dist/components/Notifications/NotificationPopup.js +76 -65
- package/dist/components/Notifications/UnreadBadge.d.ts +0 -1
- package/dist/components/Preferences/NotificationPreferencesInline.js +57 -39
- package/dist/components/Preferences/NotificationPreferencesPopup.js +111 -99
- package/dist/components/Preferences/PreferenceInput.d.ts +0 -1
- package/dist/components/Preferences/PreferenceInput.js +427 -414
- package/dist/components/Preferences/Preferences.js +329 -278
- package/dist/components/Preferences/channelUtils.d.ts +0 -1
- package/dist/components/Provider/context.d.ts +0 -1
- package/dist/components/Provider/index.d.ts +4 -2
- package/dist/components/Provider/index.js +986 -375
- package/dist/components/Slack/SlackConnect.js +8 -7
- package/dist/components/WebPush/WebPushOptInMessage.d.ts +0 -1
- package/dist/main.d.ts +2 -1
- package/dist/main.js +6 -3
- package/dist/utils/theme.d.ts +17 -0
- package/dist/utils/theme.js +104 -0
- package/package.json +7 -3
|
@@ -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
|
|
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/
|
|
9
|
-
import {
|
|
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/
|
|
15
|
-
import { u as mt } from "../../assets/
|
|
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
|
|
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
|
-
|
|
4853
|
+
or as SlackConnect
|
|
4853
4854
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
1
|
export { NotificationFeed, NotificationPopup, NotificationLauncher, NotificationCounter } from './components/Notifications';
|
|
3
2
|
export { NotificationPreferencesInline, NotificationPreferencesPopup } from './components/Preferences';
|
|
4
3
|
export { NotificationAPIProvider } from './components/Provider';
|
|
5
4
|
export { SlackConnect } from './components/Slack';
|
|
6
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
|
|
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
|
-
|
|
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.
|
|
4
|
+
"version": "1.8.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"overrides": {
|
|
7
7
|
"esbuild": "^0.25.0",
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
49
49
|
"eslint-plugin-react-refresh": "^0.4.6",
|
|
50
50
|
"faker-js": "^1.0.0",
|
|
51
|
-
"glob": "^
|
|
51
|
+
"glob": "^11.1.0",
|
|
52
52
|
"prettier": "^3.3.3",
|
|
53
53
|
"typescript": "^5.2.2",
|
|
54
54
|
"vite": "^5.4.21",
|
|
55
|
-
"vite-plugin-dts": "^
|
|
55
|
+
"vite-plugin-dts": "^4.5.4",
|
|
56
56
|
"vite-plugin-lib-inject-css": "^2.1.1"
|
|
57
57
|
},
|
|
58
58
|
"main": "dist/main.js",
|
|
@@ -61,6 +61,10 @@
|
|
|
61
61
|
"dist"
|
|
62
62
|
],
|
|
63
63
|
"sideEffects": false,
|
|
64
|
+
"repository": {
|
|
65
|
+
"type": "git",
|
|
66
|
+
"url": "https://github.com/notificationapi-com/notificationapi-react-client-sdk"
|
|
67
|
+
},
|
|
64
68
|
"dependencies": {
|
|
65
69
|
"@emotion/react": "^11.14.0",
|
|
66
70
|
"@emotion/styled": "^11.14.0",
|