@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,292 @@
|
|
|
1
|
+
import * as P from "react";
|
|
2
|
+
import { o as O, p as S, a as j, g as C, s as B, h as c, m as w, P as r, u as W, c as M, f as R } from "./DefaultPropsProvider.js";
|
|
3
|
+
import { jsx as A } from "react/jsx-runtime";
|
|
4
|
+
import { c as N } from "./createSimplePaletteValueFilter.js";
|
|
5
|
+
const D = (e) => {
|
|
6
|
+
var a;
|
|
7
|
+
const o = {
|
|
8
|
+
systemProps: {},
|
|
9
|
+
otherProps: {}
|
|
10
|
+
}, t = ((a = e == null ? void 0 : e.theme) == null ? void 0 : a.unstable_sxConfig) ?? O;
|
|
11
|
+
return Object.keys(e).forEach((n) => {
|
|
12
|
+
t[n] ? o.systemProps[n] = e[n] : o.otherProps[n] = e[n];
|
|
13
|
+
}), o;
|
|
14
|
+
};
|
|
15
|
+
function E(e) {
|
|
16
|
+
const {
|
|
17
|
+
sx: o,
|
|
18
|
+
...t
|
|
19
|
+
} = e, {
|
|
20
|
+
systemProps: a,
|
|
21
|
+
otherProps: n
|
|
22
|
+
} = D(t);
|
|
23
|
+
let s;
|
|
24
|
+
return Array.isArray(o) ? s = [a, ...o] : typeof o == "function" ? s = (...p) => {
|
|
25
|
+
const i = o(...p);
|
|
26
|
+
return S(i) ? {
|
|
27
|
+
...a,
|
|
28
|
+
...i
|
|
29
|
+
} : a;
|
|
30
|
+
} : s = {
|
|
31
|
+
...a,
|
|
32
|
+
...o
|
|
33
|
+
}, {
|
|
34
|
+
...n,
|
|
35
|
+
sx: s
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function U() {
|
|
39
|
+
return E;
|
|
40
|
+
}
|
|
41
|
+
function $(e) {
|
|
42
|
+
return j("MuiTypography", e);
|
|
43
|
+
}
|
|
44
|
+
C("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
|
|
45
|
+
const V = {
|
|
46
|
+
primary: !0,
|
|
47
|
+
secondary: !0,
|
|
48
|
+
error: !0,
|
|
49
|
+
info: !0,
|
|
50
|
+
success: !0,
|
|
51
|
+
warning: !0,
|
|
52
|
+
textPrimary: !0,
|
|
53
|
+
textSecondary: !0,
|
|
54
|
+
textDisabled: !0
|
|
55
|
+
}, _ = U(), k = (e) => {
|
|
56
|
+
const {
|
|
57
|
+
align: o,
|
|
58
|
+
gutterBottom: t,
|
|
59
|
+
noWrap: a,
|
|
60
|
+
paragraph: n,
|
|
61
|
+
variant: s,
|
|
62
|
+
classes: p
|
|
63
|
+
} = e, i = {
|
|
64
|
+
root: ["root", s, e.align !== "inherit" && `align${c(o)}`, t && "gutterBottom", a && "noWrap", n && "paragraph"]
|
|
65
|
+
};
|
|
66
|
+
return R(i, $, p);
|
|
67
|
+
}, z = B("span", {
|
|
68
|
+
name: "MuiTypography",
|
|
69
|
+
slot: "Root",
|
|
70
|
+
overridesResolver: (e, o) => {
|
|
71
|
+
const {
|
|
72
|
+
ownerState: t
|
|
73
|
+
} = e;
|
|
74
|
+
return [o.root, t.variant && o[t.variant], t.align !== "inherit" && o[`align${c(t.align)}`], t.noWrap && o.noWrap, t.gutterBottom && o.gutterBottom, t.paragraph && o.paragraph];
|
|
75
|
+
}
|
|
76
|
+
})(w(({
|
|
77
|
+
theme: e
|
|
78
|
+
}) => {
|
|
79
|
+
var o;
|
|
80
|
+
return {
|
|
81
|
+
margin: 0,
|
|
82
|
+
variants: [{
|
|
83
|
+
props: {
|
|
84
|
+
variant: "inherit"
|
|
85
|
+
},
|
|
86
|
+
style: {
|
|
87
|
+
// Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
|
|
88
|
+
font: "inherit",
|
|
89
|
+
lineHeight: "inherit",
|
|
90
|
+
letterSpacing: "inherit"
|
|
91
|
+
}
|
|
92
|
+
}, ...Object.entries(e.typography).filter(([t, a]) => t !== "inherit" && a && typeof a == "object").map(([t, a]) => ({
|
|
93
|
+
props: {
|
|
94
|
+
variant: t
|
|
95
|
+
},
|
|
96
|
+
style: a
|
|
97
|
+
})), ...Object.entries(e.palette).filter(N()).map(([t]) => ({
|
|
98
|
+
props: {
|
|
99
|
+
color: t
|
|
100
|
+
},
|
|
101
|
+
style: {
|
|
102
|
+
color: (e.vars || e).palette[t].main
|
|
103
|
+
}
|
|
104
|
+
})), ...Object.entries(((o = e.palette) == null ? void 0 : o.text) || {}).filter(([, t]) => typeof t == "string").map(([t]) => ({
|
|
105
|
+
props: {
|
|
106
|
+
color: `text${c(t)}`
|
|
107
|
+
},
|
|
108
|
+
style: {
|
|
109
|
+
color: (e.vars || e).palette.text[t]
|
|
110
|
+
}
|
|
111
|
+
})), {
|
|
112
|
+
props: ({
|
|
113
|
+
ownerState: t
|
|
114
|
+
}) => t.align !== "inherit",
|
|
115
|
+
style: {
|
|
116
|
+
textAlign: "var(--Typography-textAlign)"
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
props: ({
|
|
120
|
+
ownerState: t
|
|
121
|
+
}) => t.noWrap,
|
|
122
|
+
style: {
|
|
123
|
+
overflow: "hidden",
|
|
124
|
+
textOverflow: "ellipsis",
|
|
125
|
+
whiteSpace: "nowrap"
|
|
126
|
+
}
|
|
127
|
+
}, {
|
|
128
|
+
props: ({
|
|
129
|
+
ownerState: t
|
|
130
|
+
}) => t.gutterBottom,
|
|
131
|
+
style: {
|
|
132
|
+
marginBottom: "0.35em"
|
|
133
|
+
}
|
|
134
|
+
}, {
|
|
135
|
+
props: ({
|
|
136
|
+
ownerState: t
|
|
137
|
+
}) => t.paragraph,
|
|
138
|
+
style: {
|
|
139
|
+
marginBottom: 16
|
|
140
|
+
}
|
|
141
|
+
}]
|
|
142
|
+
};
|
|
143
|
+
})), b = {
|
|
144
|
+
h1: "h1",
|
|
145
|
+
h2: "h2",
|
|
146
|
+
h3: "h3",
|
|
147
|
+
h4: "h4",
|
|
148
|
+
h5: "h5",
|
|
149
|
+
h6: "h6",
|
|
150
|
+
subtitle1: "h6",
|
|
151
|
+
subtitle2: "h6",
|
|
152
|
+
body1: "p",
|
|
153
|
+
body2: "p",
|
|
154
|
+
inherit: "p"
|
|
155
|
+
}, F = /* @__PURE__ */ P.forwardRef(function(o, t) {
|
|
156
|
+
const {
|
|
157
|
+
color: a,
|
|
158
|
+
...n
|
|
159
|
+
} = W({
|
|
160
|
+
props: o,
|
|
161
|
+
name: "MuiTypography"
|
|
162
|
+
}), s = !V[a], p = _({
|
|
163
|
+
...n,
|
|
164
|
+
...s && {
|
|
165
|
+
color: a
|
|
166
|
+
}
|
|
167
|
+
}), {
|
|
168
|
+
align: i = "inherit",
|
|
169
|
+
className: h,
|
|
170
|
+
component: y,
|
|
171
|
+
gutterBottom: x = !1,
|
|
172
|
+
noWrap: d = !1,
|
|
173
|
+
paragraph: g = !1,
|
|
174
|
+
variant: l = "body1",
|
|
175
|
+
variantMapping: u = b,
|
|
176
|
+
...f
|
|
177
|
+
} = p, m = {
|
|
178
|
+
...p,
|
|
179
|
+
align: i,
|
|
180
|
+
color: a,
|
|
181
|
+
className: h,
|
|
182
|
+
component: y,
|
|
183
|
+
gutterBottom: x,
|
|
184
|
+
noWrap: d,
|
|
185
|
+
paragraph: g,
|
|
186
|
+
variant: l,
|
|
187
|
+
variantMapping: u
|
|
188
|
+
}, v = y || (g ? "p" : u[l] || b[l]) || "span", T = k(m);
|
|
189
|
+
return /* @__PURE__ */ A(z, {
|
|
190
|
+
as: v,
|
|
191
|
+
ref: t,
|
|
192
|
+
className: M(T.root, h),
|
|
193
|
+
...f,
|
|
194
|
+
ownerState: m,
|
|
195
|
+
style: {
|
|
196
|
+
...i !== "inherit" && {
|
|
197
|
+
"--Typography-textAlign": i
|
|
198
|
+
},
|
|
199
|
+
...f.style
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
process.env.NODE_ENV !== "production" && (F.propTypes = {
|
|
204
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
205
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
206
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
207
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
208
|
+
/**
|
|
209
|
+
* Set the text-align on the component.
|
|
210
|
+
* @default 'inherit'
|
|
211
|
+
*/
|
|
212
|
+
align: r.oneOf(["center", "inherit", "justify", "left", "right"]),
|
|
213
|
+
/**
|
|
214
|
+
* The content of the component.
|
|
215
|
+
*/
|
|
216
|
+
children: r.node,
|
|
217
|
+
/**
|
|
218
|
+
* Override or extend the styles applied to the component.
|
|
219
|
+
*/
|
|
220
|
+
classes: r.object,
|
|
221
|
+
/**
|
|
222
|
+
* @ignore
|
|
223
|
+
*/
|
|
224
|
+
className: r.string,
|
|
225
|
+
/**
|
|
226
|
+
* The color of the component.
|
|
227
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
228
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
229
|
+
*/
|
|
230
|
+
color: r.oneOfType([r.oneOf(["primary", "secondary", "success", "error", "info", "warning", "textPrimary", "textSecondary", "textDisabled"]), r.string]),
|
|
231
|
+
/**
|
|
232
|
+
* The component used for the root node.
|
|
233
|
+
* Either a string to use a HTML element or a component.
|
|
234
|
+
*/
|
|
235
|
+
component: r.elementType,
|
|
236
|
+
/**
|
|
237
|
+
* If `true`, the text will have a bottom margin.
|
|
238
|
+
* @default false
|
|
239
|
+
*/
|
|
240
|
+
gutterBottom: r.bool,
|
|
241
|
+
/**
|
|
242
|
+
* If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
|
|
243
|
+
*
|
|
244
|
+
* Note that text overflow can only happen with block or inline-block level elements
|
|
245
|
+
* (the element needs to have a width in order to overflow).
|
|
246
|
+
* @default false
|
|
247
|
+
*/
|
|
248
|
+
noWrap: r.bool,
|
|
249
|
+
/**
|
|
250
|
+
* If `true`, the element will be a paragraph element.
|
|
251
|
+
* @default false
|
|
252
|
+
* @deprecated Use the `component` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
253
|
+
*/
|
|
254
|
+
paragraph: r.bool,
|
|
255
|
+
/**
|
|
256
|
+
* @ignore
|
|
257
|
+
*/
|
|
258
|
+
style: r.object,
|
|
259
|
+
/**
|
|
260
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
261
|
+
*/
|
|
262
|
+
sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object]),
|
|
263
|
+
/**
|
|
264
|
+
* Applies the theme typography styles.
|
|
265
|
+
* @default 'body1'
|
|
266
|
+
*/
|
|
267
|
+
variant: r.oneOfType([r.oneOf(["body1", "body2", "button", "caption", "h1", "h2", "h3", "h4", "h5", "h6", "inherit", "overline", "subtitle1", "subtitle2"]), r.string]),
|
|
268
|
+
/**
|
|
269
|
+
* The component maps the variant prop to a range of different HTML element types.
|
|
270
|
+
* For instance, subtitle1 to `<h6>`.
|
|
271
|
+
* If you wish to change that mapping, you can provide your own.
|
|
272
|
+
* Alternatively, you can use the `component` prop.
|
|
273
|
+
* @default {
|
|
274
|
+
* h1: 'h1',
|
|
275
|
+
* h2: 'h2',
|
|
276
|
+
* h3: 'h3',
|
|
277
|
+
* h4: 'h4',
|
|
278
|
+
* h5: 'h5',
|
|
279
|
+
* h6: 'h6',
|
|
280
|
+
* subtitle1: 'h6',
|
|
281
|
+
* subtitle2: 'h6',
|
|
282
|
+
* body1: 'p',
|
|
283
|
+
* body2: 'p',
|
|
284
|
+
* inherit: 'p',
|
|
285
|
+
* }
|
|
286
|
+
*/
|
|
287
|
+
variantMapping: r.object
|
|
288
|
+
});
|
|
289
|
+
export {
|
|
290
|
+
F as T,
|
|
291
|
+
E as e
|
|
292
|
+
};
|