@notificationapi/react 0.0.36 → 1.0.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 (72) hide show
  1. package/dist/assets/Badge.js +456 -0
  2. package/dist/assets/Box.js +57 -0
  3. package/dist/assets/ButtonBase.js +1224 -0
  4. package/dist/assets/DefaultPropsProvider.js +4368 -0
  5. package/dist/assets/Divider.js +343 -0
  6. package/dist/assets/IconButton.js +225 -0
  7. package/dist/assets/Inbox.js +3051 -0
  8. package/dist/assets/InboxHeader.js +2338 -0
  9. package/dist/assets/Notification.js +5349 -7150
  10. package/dist/assets/NotificationPreferencesPopup.js +1694 -0
  11. package/dist/assets/Paper.js +154 -0
  12. package/dist/assets/Popover.js +451 -0
  13. package/dist/assets/Portal.js +110 -0
  14. package/dist/assets/PreferenceInput.js +1545 -1366
  15. package/dist/assets/Typography.js +292 -0
  16. package/dist/assets/WebPushOptInMessage.js +794 -407
  17. package/dist/assets/channelUtils.js +33 -65
  18. package/dist/assets/createSimplePaletteValueFilter.js +17 -0
  19. package/dist/assets/createSvgIcon.js +248 -0
  20. package/dist/assets/integerPropType.js +31 -0
  21. package/dist/assets/main.css +1 -0
  22. package/dist/assets/resolveComponentProps.js +93 -0
  23. package/dist/assets/useSlotProps.js +24 -0
  24. package/dist/assets/useTheme.js +10 -0
  25. package/dist/assets/useTheme2.js +16 -0
  26. package/dist/assets/utils.js +743 -0
  27. package/dist/components/Notifications/DefaultEmpty.d.ts +3 -0
  28. package/dist/components/Notifications/DefaultEmpty.js +7 -0
  29. package/dist/components/Notifications/Inbox.d.ts +4 -4
  30. package/dist/components/Notifications/Inbox.js +9 -6450
  31. package/dist/components/Notifications/InboxHeader.d.ts +1 -1
  32. package/dist/components/Notifications/InboxHeader.js +7 -53
  33. package/dist/components/Notifications/Notification.d.ts +3 -4
  34. package/dist/components/Notifications/Notification.js +6 -5
  35. package/dist/components/Notifications/NotificationCounter.js +16 -6
  36. package/dist/components/Notifications/NotificationFeed.d.ts +1 -2
  37. package/dist/components/Notifications/NotificationFeed.js +41 -38
  38. package/dist/components/Notifications/NotificationLauncher.d.ts +1 -0
  39. package/dist/components/Notifications/NotificationLauncher.js +100 -114
  40. package/dist/components/Notifications/NotificationPopup.d.ts +3 -4
  41. package/dist/components/Notifications/NotificationPopup.js +86 -88
  42. package/dist/components/Notifications/UnreadBadge.d.ts +7 -4
  43. package/dist/components/Notifications/UnreadBadge.js +28 -20
  44. package/dist/components/Notifications/interface.d.ts +0 -4
  45. package/dist/components/Notifications/interface.js +4 -5
  46. package/dist/components/Preferences/NotificationPreferencesInline.js +14 -14
  47. package/dist/components/Preferences/NotificationPreferencesPopup.js +7 -2068
  48. package/dist/components/Preferences/PreferenceInput.js +4 -3
  49. package/dist/components/Preferences/Preferences.js +1042 -547
  50. package/dist/components/Preferences/channelUtils.js +3 -4
  51. package/dist/components/Preferences/index.js +1 -1
  52. package/dist/components/Provider/context.d.ts +27 -0
  53. package/dist/components/Provider/context.js +7 -0
  54. package/dist/components/Provider/index.d.ts +2 -25
  55. package/dist/components/Provider/index.js +90 -82
  56. package/dist/components/WebPush/WebPushOptInMessage.js +3 -4
  57. package/dist/main.d.ts +1 -0
  58. package/dist/main.js +5 -5
  59. package/package.json +25 -9
  60. package/dist/assets/AntdIcon.js +0 -200
  61. package/dist/assets/CloseOutlined.js +0 -13
  62. package/dist/assets/PurePanel.js +0 -59
  63. package/dist/assets/RightOutlined.js +0 -13
  64. package/dist/assets/button.js +0 -1660
  65. package/dist/assets/colors.js +0 -36
  66. package/dist/assets/compact-item.js +0 -860
  67. package/dist/assets/index.js +0 -271
  68. package/dist/assets/index2.js +0 -647
  69. package/dist/assets/index3.js +0 -7527
  70. package/dist/assets/pickAttrs.js +0 -42
  71. package/dist/assets/presets.js +0 -810
  72. package/dist/assets/reactNode.js +0 -20821
@@ -1,200 +0,0 @@
1
- import { w as L, d as b, _ as c, g as U, I, u as W, e as N, f as R, c as q, b as h, a as F, h as G } from "./presets.js";
2
- import * as d from "react";
3
- import x, { useContext as H, useEffect as J } from "react";
4
- function S(n) {
5
- var o;
6
- return n == null || (o = n.getRootNode) === null || o === void 0 ? void 0 : o.call(n);
7
- }
8
- function K(n) {
9
- return S(n) instanceof ShadowRoot;
10
- }
11
- function M(n) {
12
- return K(n) ? S(n) : null;
13
- }
14
- function Q(n) {
15
- return n.replace(/-(.)/g, function(o, e) {
16
- return e.toUpperCase();
17
- });
18
- }
19
- function V(n, o) {
20
- L(n, "[@ant-design/icons] ".concat(o));
21
- }
22
- function _(n) {
23
- return b(n) === "object" && typeof n.name == "string" && typeof n.theme == "string" && (b(n.icon) === "object" || typeof n.icon == "function");
24
- }
25
- function k() {
26
- var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
27
- return Object.keys(n).reduce(function(o, e) {
28
- var r = n[e];
29
- switch (e) {
30
- case "class":
31
- o.className = r, delete o.class;
32
- break;
33
- default:
34
- delete o[e], o[Q(e)] = r;
35
- }
36
- return o;
37
- }, {});
38
- }
39
- function p(n, o, e) {
40
- return e ? /* @__PURE__ */ x.createElement(n.tag, c(c({
41
- key: o
42
- }, k(n.attrs)), e), (n.children || []).map(function(r, t) {
43
- return p(r, "".concat(o, "-").concat(n.tag, "-").concat(t));
44
- })) : /* @__PURE__ */ x.createElement(n.tag, c({
45
- key: o
46
- }, k(n.attrs)), (n.children || []).map(function(r, t) {
47
- return p(r, "".concat(o, "-").concat(n.tag, "-").concat(t));
48
- }));
49
- }
50
- function z(n) {
51
- return U(n)[0];
52
- }
53
- function E(n) {
54
- return n ? Array.isArray(n) ? n : [n] : [];
55
- }
56
- var X = `
57
- .anticon {
58
- display: inline-flex;
59
- align-items: center;
60
- color: inherit;
61
- font-style: normal;
62
- line-height: 0;
63
- text-align: center;
64
- text-transform: none;
65
- vertical-align: -0.125em;
66
- text-rendering: optimizeLegibility;
67
- -webkit-font-smoothing: antialiased;
68
- -moz-osx-font-smoothing: grayscale;
69
- }
70
-
71
- .anticon > * {
72
- line-height: 1;
73
- }
74
-
75
- .anticon svg {
76
- display: inline-block;
77
- }
78
-
79
- .anticon::before {
80
- display: none;
81
- }
82
-
83
- .anticon .anticon-icon {
84
- display: block;
85
- }
86
-
87
- .anticon[tabindex] {
88
- cursor: pointer;
89
- }
90
-
91
- .anticon-spin::before,
92
- .anticon-spin {
93
- display: inline-block;
94
- -webkit-animation: loadingCircle 1s infinite linear;
95
- animation: loadingCircle 1s infinite linear;
96
- }
97
-
98
- @-webkit-keyframes loadingCircle {
99
- 100% {
100
- -webkit-transform: rotate(360deg);
101
- transform: rotate(360deg);
102
- }
103
- }
104
-
105
- @keyframes loadingCircle {
106
- 100% {
107
- -webkit-transform: rotate(360deg);
108
- transform: rotate(360deg);
109
- }
110
- }
111
- `, Y = function(o) {
112
- var e = H(I), r = e.csp, t = e.prefixCls, i = X;
113
- t && (i = i.replace(/anticon/g, t)), J(function() {
114
- var l = o.current, s = M(l);
115
- W(i, "@ant-design-icons", {
116
- prepend: !0,
117
- csp: r,
118
- attachTo: s
119
- });
120
- }, []);
121
- }, Z = ["icon", "className", "onClick", "style", "primaryColor", "secondaryColor"], f = {
122
- primaryColor: "#333",
123
- secondaryColor: "#E6E6E6",
124
- calculated: !1
125
- };
126
- function nn(n) {
127
- var o = n.primaryColor, e = n.secondaryColor;
128
- f.primaryColor = o, f.secondaryColor = e || z(o), f.calculated = !!e;
129
- }
130
- function on() {
131
- return c({}, f);
132
- }
133
- var u = function(o) {
134
- var e = o.icon, r = o.className, t = o.onClick, i = o.style, l = o.primaryColor, s = o.secondaryColor, y = N(o, Z), C = d.useRef(), m = f;
135
- if (l && (m = {
136
- primaryColor: l,
137
- secondaryColor: s || z(l)
138
- }), Y(C), V(_(e), "icon should be icon definiton, but got ".concat(e)), !_(e))
139
- return null;
140
- var a = e;
141
- return a && typeof a.icon == "function" && (a = c(c({}, a), {}, {
142
- icon: a.icon(m.primaryColor, m.secondaryColor)
143
- })), p(a.icon, "svg-".concat(a.name), c(c({
144
- className: r,
145
- onClick: t,
146
- style: i,
147
- "data-icon": a.name,
148
- width: "1em",
149
- height: "1em",
150
- fill: "currentColor",
151
- "aria-hidden": "true"
152
- }, y), {}, {
153
- ref: C
154
- }));
155
- };
156
- u.displayName = "IconReact";
157
- u.getTwoToneColors = on;
158
- u.setTwoToneColors = nn;
159
- function $(n) {
160
- var o = E(n), e = R(o, 2), r = e[0], t = e[1];
161
- return u.setTwoToneColors({
162
- primaryColor: r,
163
- secondaryColor: t
164
- });
165
- }
166
- function en() {
167
- var n = u.getTwoToneColors();
168
- return n.calculated ? [n.primaryColor, n.secondaryColor] : n.primaryColor;
169
- }
170
- var rn = ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"];
171
- $(G.primary);
172
- var T = /* @__PURE__ */ d.forwardRef(function(n, o) {
173
- var e = n.className, r = n.icon, t = n.spin, i = n.rotate, l = n.tabIndex, s = n.onClick, y = n.twoToneColor, C = N(n, rn), m = d.useContext(I), a = m.prefixCls, g = a === void 0 ? "anticon" : a, j = m.rootClassName, A = q(j, g, h(h({}, "".concat(g, "-").concat(r.name), !!r.name), "".concat(g, "-spin"), !!t || r.name === "loading"), e), v = l;
174
- v === void 0 && s && (v = -1);
175
- var P = i ? {
176
- msTransform: "rotate(".concat(i, "deg)"),
177
- transform: "rotate(".concat(i, "deg)")
178
- } : void 0, B = E(y), w = R(B, 2), O = w[0], D = w[1];
179
- return /* @__PURE__ */ d.createElement("span", F({
180
- role: "img",
181
- "aria-label": r.name
182
- }, C, {
183
- ref: o,
184
- tabIndex: v,
185
- onClick: s,
186
- className: A
187
- }), /* @__PURE__ */ d.createElement(u, {
188
- icon: r,
189
- primaryColor: O,
190
- secondaryColor: D,
191
- style: P
192
- }));
193
- });
194
- T.displayName = "AntdIcon";
195
- T.getTwoToneColor = en;
196
- T.setTwoToneColor = $;
197
- export {
198
- T as I,
199
- M as g
200
- };
@@ -1,13 +0,0 @@
1
- import { a as l } from "./presets.js";
2
- import * as e from "react";
3
- import { I as o } from "./AntdIcon.js";
4
- var t = { icon: { tag: "svg", attrs: { "fill-rule": "evenodd", viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, name: "close", theme: "outlined" }, r = function(a, c) {
5
- return /* @__PURE__ */ e.createElement(o, l({}, a, {
6
- ref: c,
7
- icon: t
8
- }));
9
- }, n = /* @__PURE__ */ e.forwardRef(r);
10
- process.env.NODE_ENV !== "production" && (n.displayName = "CloseOutlined");
11
- export {
12
- n as R
13
- };
@@ -1,59 +0,0 @@
1
- import * as e from "react";
2
- import { u as x } from "./compact-item.js";
3
- import { C as j, a as w } from "./reactNode.js";
4
- function y(n) {
5
- return (i) => /* @__PURE__ */ e.createElement(j, {
6
- theme: {
7
- token: {
8
- motion: !1,
9
- zIndexPopupBase: 0
10
- }
11
- }
12
- }, /* @__PURE__ */ e.createElement(n, Object.assign({}, i)));
13
- }
14
- const W = (n, i, R, z) => y((r) => {
15
- const {
16
- prefixCls: p,
17
- style: f
18
- } = r, o = e.useRef(null), [d, g] = e.useState(0), [m, P] = e.useState(0), [a, v] = x(!1, {
19
- value: r.open
20
- }), {
21
- getPrefixCls: C
22
- } = e.useContext(w), b = C("select", p);
23
- e.useEffect(() => {
24
- if (v(!0), typeof ResizeObserver < "u") {
25
- const l = new ResizeObserver((t) => {
26
- const s = t[0].target;
27
- g(s.offsetHeight + 8), P(s.offsetWidth);
28
- }), c = setInterval(() => {
29
- var t;
30
- const s = `.${b}-dropdown`, u = (t = o.current) === null || t === void 0 ? void 0 : t.querySelector(s);
31
- u && (clearInterval(c), l.observe(u));
32
- }, 10);
33
- return () => {
34
- clearInterval(c), l.disconnect();
35
- };
36
- }
37
- }, []);
38
- let h = Object.assign(Object.assign({}, r), {
39
- style: Object.assign(Object.assign({}, f), {
40
- margin: 0
41
- }),
42
- open: a,
43
- visible: a,
44
- getPopupContainer: () => o.current
45
- });
46
- const O = {
47
- paddingBottom: d,
48
- position: "relative",
49
- minWidth: m
50
- };
51
- return /* @__PURE__ */ e.createElement("div", {
52
- ref: o,
53
- style: O
54
- }, /* @__PURE__ */ e.createElement(n, Object.assign({}, h)));
55
- });
56
- export {
57
- W as g,
58
- y as w
59
- };
@@ -1,13 +0,0 @@
1
- import { a as r } from "./presets.js";
2
- import * as t from "react";
3
- import { I as i } from "./AntdIcon.js";
4
- var o = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, name: "right", theme: "outlined" }, n = function(e, a) {
5
- return /* @__PURE__ */ t.createElement(i, r({}, e, {
6
- ref: a,
7
- icon: o
8
- }));
9
- }, c = /* @__PURE__ */ t.forwardRef(n);
10
- process.env.NODE_ENV !== "production" && (c.displayName = "RightOutlined");
11
- export {
12
- c as R
13
- };