@notificationapi/react 0.0.37 → 1.0.1
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 +456 -0
- package/dist/assets/Box.js +57 -0
- package/dist/assets/ButtonBase.js +1224 -0
- package/dist/assets/DefaultPropsProvider.js +4368 -0
- package/dist/assets/Divider.js +343 -0
- package/dist/assets/IconButton.js +225 -0
- package/dist/assets/Inbox.js +3051 -0
- package/dist/assets/InboxHeader.js +2338 -0
- package/dist/assets/Notification.js +5349 -7150
- package/dist/assets/NotificationPreferencesPopup.js +1694 -0
- package/dist/assets/Paper.js +154 -0
- package/dist/assets/Popover.js +451 -0
- package/dist/assets/Portal.js +110 -0
- package/dist/assets/PreferenceInput.js +1545 -1366
- package/dist/assets/Typography.js +292 -0
- package/dist/assets/WebPushOptInMessage.js +794 -407
- package/dist/assets/channelUtils.js +33 -65
- package/dist/assets/createSimplePaletteValueFilter.js +17 -0
- package/dist/assets/createSvgIcon.js +248 -0
- package/dist/assets/integerPropType.js +31 -0
- package/dist/assets/resolveComponentProps.js +93 -0
- package/dist/assets/style.css +1 -0
- package/dist/assets/useSlotProps.js +24 -0
- package/dist/assets/useTheme.js +10 -0
- package/dist/assets/useTheme2.js +16 -0
- package/dist/assets/utils.js +743 -0
- package/dist/components/Notifications/DefaultEmpty.d.ts +3 -0
- package/dist/components/Notifications/DefaultEmpty.js +7 -0
- package/dist/components/Notifications/Inbox.d.ts +4 -4
- package/dist/components/Notifications/Inbox.js +9 -6450
- package/dist/components/Notifications/InboxHeader.d.ts +1 -1
- package/dist/components/Notifications/InboxHeader.js +7 -53
- package/dist/components/Notifications/Notification.d.ts +3 -4
- package/dist/components/Notifications/Notification.js +6 -5
- package/dist/components/Notifications/NotificationCounter.js +16 -6
- package/dist/components/Notifications/NotificationFeed.d.ts +1 -2
- package/dist/components/Notifications/NotificationFeed.js +41 -38
- package/dist/components/Notifications/NotificationLauncher.d.ts +1 -0
- package/dist/components/Notifications/NotificationLauncher.js +100 -114
- package/dist/components/Notifications/NotificationPopup.d.ts +3 -4
- package/dist/components/Notifications/NotificationPopup.js +86 -88
- package/dist/components/Notifications/UnreadBadge.d.ts +7 -4
- package/dist/components/Notifications/UnreadBadge.js +28 -20
- package/dist/components/Notifications/interface.d.ts +0 -4
- package/dist/components/Notifications/interface.js +4 -5
- package/dist/components/Preferences/NotificationPreferencesInline.js +14 -14
- package/dist/components/Preferences/NotificationPreferencesPopup.js +7 -2068
- package/dist/components/Preferences/PreferenceInput.js +4 -3
- package/dist/components/Preferences/Preferences.js +1042 -547
- package/dist/components/Preferences/channelUtils.js +3 -4
- package/dist/components/Preferences/index.js +1 -1
- package/dist/components/Provider/context.d.ts +27 -0
- package/dist/components/Provider/context.js +7 -0
- package/dist/components/Provider/index.d.ts +2 -25
- package/dist/components/Provider/index.js +22 -24
- package/dist/components/WebPush/WebPushOptInMessage.js +3 -4
- package/dist/main.d.ts +1 -0
- package/dist/main.js +4 -4
- package/package.json +14 -12
- package/dist/assets/AntdIcon.js +0 -200
- package/dist/assets/CloseOutlined.js +0 -13
- package/dist/assets/PurePanel.js +0 -59
- package/dist/assets/RightOutlined.js +0 -13
- package/dist/assets/button.js +0 -1660
- package/dist/assets/colors.js +0 -36
- package/dist/assets/compact-item.js +0 -860
- package/dist/assets/index.js +0 -271
- package/dist/assets/index2.js +0 -647
- package/dist/assets/index3.js +0 -7527
- package/dist/assets/pickAttrs.js +0 -42
- package/dist/assets/presets.js +0 -810
- package/dist/assets/reactNode.js +0 -20821
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { P as c } from "./DefaultPropsProvider.js";
|
|
2
|
+
import { c as m, a as f } from "./ButtonBase.js";
|
|
3
|
+
import * as u from "react";
|
|
4
|
+
import { r as P } from "./utils.js";
|
|
5
|
+
import { u as h, s as d } from "./resolveComponentProps.js";
|
|
6
|
+
function v(e) {
|
|
7
|
+
const {
|
|
8
|
+
prototype: n = {}
|
|
9
|
+
} = e;
|
|
10
|
+
return !!n.isReactComponent;
|
|
11
|
+
}
|
|
12
|
+
function E(e, n, r, t, s) {
|
|
13
|
+
const o = e[n], i = s || n;
|
|
14
|
+
if (o == null || // When server-side rendering React doesn't warn either.
|
|
15
|
+
// This is not an accurate check for SSR.
|
|
16
|
+
// This is only in place for Emotion compat.
|
|
17
|
+
// TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
|
|
18
|
+
typeof window > "u")
|
|
19
|
+
return null;
|
|
20
|
+
let a;
|
|
21
|
+
const l = o.type;
|
|
22
|
+
return typeof l == "function" && !v(l) && (a = "Did you accidentally use a plain function component for an element instead?"), a !== void 0 ? new Error(`Invalid ${t} \`${i}\` supplied to \`${r}\`. Expected an element that can hold a ref. ${a} For more information see https://mui.com/r/caveat-with-refs-guide`) : null;
|
|
23
|
+
}
|
|
24
|
+
const w = m(c.element, E);
|
|
25
|
+
w.isRequired = m(c.element.isRequired, E);
|
|
26
|
+
const N = "exact-prop: ";
|
|
27
|
+
function T(e) {
|
|
28
|
+
return process.env.NODE_ENV === "production" ? e : {
|
|
29
|
+
...e,
|
|
30
|
+
[N]: (n) => {
|
|
31
|
+
const r = Object.keys(n).filter((t) => !e.hasOwnProperty(t));
|
|
32
|
+
return r.length > 0 ? new Error(`The following props are not supported: ${r.map((t) => `\`${t}\``).join(", ")}. Please remove them.`) : null;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function g(e, n, r, t, s) {
|
|
37
|
+
if (process.env.NODE_ENV === "production")
|
|
38
|
+
return null;
|
|
39
|
+
const o = e[n], i = s || n;
|
|
40
|
+
return o == null ? null : o && o.nodeType !== 1 ? new Error(`Invalid ${t} \`${i}\` supplied to \`${r}\`. Expected an HTMLElement.`) : null;
|
|
41
|
+
}
|
|
42
|
+
function x(e) {
|
|
43
|
+
return e && e.ownerDocument || document;
|
|
44
|
+
}
|
|
45
|
+
function R(e) {
|
|
46
|
+
var n;
|
|
47
|
+
return parseInt(u.version, 10) >= 19 ? ((n = e == null ? void 0 : e.props) == null ? void 0 : n.ref) || null : (e == null ? void 0 : e.ref) || null;
|
|
48
|
+
}
|
|
49
|
+
function $(e) {
|
|
50
|
+
return typeof e == "function" ? e() : e;
|
|
51
|
+
}
|
|
52
|
+
const p = /* @__PURE__ */ u.forwardRef(function(n, r) {
|
|
53
|
+
const {
|
|
54
|
+
children: t,
|
|
55
|
+
container: s,
|
|
56
|
+
disablePortal: o = !1
|
|
57
|
+
} = n, [i, a] = u.useState(null), l = h(/* @__PURE__ */ u.isValidElement(t) ? R(t) : null, r);
|
|
58
|
+
if (f(() => {
|
|
59
|
+
o || a($(s) || document.body);
|
|
60
|
+
}, [s, o]), f(() => {
|
|
61
|
+
if (i && !o)
|
|
62
|
+
return d(r, i), () => {
|
|
63
|
+
d(r, null);
|
|
64
|
+
};
|
|
65
|
+
}, [r, i, o]), o) {
|
|
66
|
+
if (/* @__PURE__ */ u.isValidElement(t)) {
|
|
67
|
+
const y = {
|
|
68
|
+
ref: l
|
|
69
|
+
};
|
|
70
|
+
return /* @__PURE__ */ u.cloneElement(t, y);
|
|
71
|
+
}
|
|
72
|
+
return t;
|
|
73
|
+
}
|
|
74
|
+
return i && /* @__PURE__ */ P.createPortal(t, i);
|
|
75
|
+
});
|
|
76
|
+
process.env.NODE_ENV !== "production" && (p.propTypes = {
|
|
77
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
78
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
79
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
80
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
81
|
+
/**
|
|
82
|
+
* The children to render into the `container`.
|
|
83
|
+
*/
|
|
84
|
+
children: c.node,
|
|
85
|
+
/**
|
|
86
|
+
* An HTML element or function that returns one.
|
|
87
|
+
* The `container` will have the portal children appended to it.
|
|
88
|
+
*
|
|
89
|
+
* You can also provide a callback, which is called in a React layout effect.
|
|
90
|
+
* This lets you set the container from a ref, and also makes server-side rendering possible.
|
|
91
|
+
*
|
|
92
|
+
* By default, it uses the body of the top-level document object,
|
|
93
|
+
* so it's simply `document.body` most of the time.
|
|
94
|
+
*/
|
|
95
|
+
container: c.oneOfType([g, c.func]),
|
|
96
|
+
/**
|
|
97
|
+
* The `children` will be under the DOM hierarchy of the parent component.
|
|
98
|
+
* @default false
|
|
99
|
+
*/
|
|
100
|
+
disablePortal: c.bool
|
|
101
|
+
});
|
|
102
|
+
process.env.NODE_ENV !== "production" && (p.propTypes = T(p.propTypes));
|
|
103
|
+
export {
|
|
104
|
+
g as H,
|
|
105
|
+
p as P,
|
|
106
|
+
T as a,
|
|
107
|
+
w as e,
|
|
108
|
+
R as g,
|
|
109
|
+
x as o
|
|
110
|
+
};
|