@edusight/notification-widget 1.0.33 → 1.0.35
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/README.md +38 -23
- package/dist/{components-Cfc2kMlt.js → components-Dq8aSwWR.js} +10 -4
- package/dist/{components-Cfc2kMlt.js.map → components-Dq8aSwWR.js.map} +1 -1
- package/dist/{components-CFhP5nWW.cjs → components-dwdMDd9K.cjs} +10 -9
- package/dist/{components-CFhP5nWW.cjs.map → components-dwdMDd9K.cjs.map} +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.esm.js +88 -85
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,32 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
A modern, accessible React notification center widget built with clean architecture principles, featuring real-time updates, comprehensive notification management, and SDK dependency injection.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
5
|
+
## Version 1.0.35 Features
|
|
6
|
+
|
|
7
|
+
- **Refactored Architecture** - Clean architecture with dependency injection and separation of concerns
|
|
8
|
+
- **SDK Integration** - Direct integration with @edusight/notification-sdk using dependency injection pattern
|
|
9
|
+
- **Performance Optimized** - Code splitting, memoization, and optimized bundle size (<25KB gzipped)
|
|
10
|
+
- **Enhanced Accessibility** - WCAG 2.1 AA compliance with improved keyboard navigation
|
|
11
|
+
- **Dynamic Theming** - Runtime theme switching with dark mode support
|
|
12
|
+
- **Responsive Design** - Mobile-first approach with responsive breakpoints
|
|
13
|
+
- **Error Boundaries** - Comprehensive error handling with fallback components
|
|
14
|
+
- **Real-time Sync** - WebSocket integration with fallback polling and cross-tab synchronization
|
|
15
|
+
- **Comprehensive Testing** - Unit, integration, and accessibility tests with >90% coverage
|
|
16
16
|
|
|
17
17
|
## Features
|
|
18
18
|
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
19
|
+
- **Real-time Updates** - WebSocket integration with automatic reconnection and fallback polling
|
|
20
|
+
- **Responsive Design** - Works seamlessly on desktop, tablet, and mobile
|
|
21
|
+
- **Full CRUD Operations** - Mark as read/unread, archive, delete with optimistic updates
|
|
22
|
+
- **Customizable UI** - Dynamic theme support with CSS variables
|
|
23
|
+
- **SDK Integration** - Direct integration with @edusight/notification-sdk using dependency injection
|
|
24
|
+
- **Accessibility** - Full WCAG 2.1 compliance with keyboard navigation
|
|
25
|
+
- **Performance** - Lazy loading, memoization, and optimized re-renders
|
|
26
|
+
- **Multi-tenant** - Built-in tenant and environment scoping
|
|
27
|
+
- **Error Boundaries** - Component-level error boundaries with fallback UI
|
|
28
|
+
- **Live Preferences** - Real-time preference management with debounced saving
|
|
29
|
+
- **Cross-tab Sync** - Synchronization across multiple browser tabs
|
|
30
|
+
- **Clean Architecture** - Separation of concerns with dependency injection pattern
|
|
31
31
|
|
|
32
32
|
## Installation
|
|
33
33
|
|
|
@@ -53,6 +53,21 @@ import '@edusight/notification-widget/styles';
|
|
|
53
53
|
import '@edusight/notification-widget/styles.css';
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
### Custom Selectors
|
|
57
|
+
|
|
58
|
+
Each widget section exposes `mx-widget-*` hooks so host apps can override colors or spacing without touching the bundled CSS:
|
|
59
|
+
|
|
60
|
+
| Attribute | Target |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| `data-mx-widget="root"` | Widget shell/bell container |
|
|
63
|
+
| `data-mx-widget="popover"` | Notifications popover root |
|
|
64
|
+
| `data-mx-widget="tabs"` | Tab navigation bar |
|
|
65
|
+
| `data-mx-widget="item"` | Individual notification item |
|
|
66
|
+
| `data-mx-widget="action"` | Primary/secondary action buttons |
|
|
67
|
+
| `data-mx-widget="bell"` | Bell button itself |
|
|
68
|
+
|
|
69
|
+
Use these selectors in your global CSS to align the widget with your design system (for example `.mx-widget-root { background-color: #fff; }`). No need to import the widget CSS if you only rely on the shared CSS variables.
|
|
70
|
+
|
|
56
71
|
## Quick Start
|
|
57
72
|
|
|
58
73
|
### Basic Setup with NotificationWidget
|
|
@@ -135,6 +135,7 @@ const Fe = ({
|
|
|
135
135
|
focus:outline-none focus:ring-1 focus:ring-[var(--widget-primary)] focus:ring-offset-1
|
|
136
136
|
disabled:opacity-70 disabled:cursor-not-allowed
|
|
137
137
|
w-10 h-10
|
|
138
|
+
mx-widget-bell
|
|
138
139
|
${n}
|
|
139
140
|
`,
|
|
140
141
|
onClick: r,
|
|
@@ -144,6 +145,7 @@ const Fe = ({
|
|
|
144
145
|
"aria-expanded": !1,
|
|
145
146
|
"aria-haspopup": "dialog",
|
|
146
147
|
"data-testid": "bell-component",
|
|
148
|
+
"data-mx-widget": "bell",
|
|
147
149
|
children: [
|
|
148
150
|
/* @__PURE__ */ i("div", { className: "relative inline-flex items-center justify-center text-align-center", children: [
|
|
149
151
|
/* @__PURE__ */ t(ve, { className: "w-6 h-6" }),
|
|
@@ -334,7 +336,7 @@ const P = ({
|
|
|
334
336
|
"div",
|
|
335
337
|
{
|
|
336
338
|
className: `
|
|
337
|
-
relative group flex items-start gap-3 px-4 py-3 border-b border-border-light
|
|
339
|
+
mx-widget-item relative group flex items-start gap-3 px-4 py-3 border-b border-border-light
|
|
338
340
|
transition-all duration-200
|
|
339
341
|
bg-widget-background hover:bg-widget-hover
|
|
340
342
|
min-w-[20rem]
|
|
@@ -344,6 +346,7 @@ const P = ({
|
|
|
344
346
|
onMouseLeave: () => o(!1),
|
|
345
347
|
"data-testid": "notification-item",
|
|
346
348
|
"data-notification-id": e.id,
|
|
349
|
+
"data-mx-widget": "item",
|
|
347
350
|
children: [
|
|
348
351
|
a && /* @__PURE__ */ t("div", { className: "flex-shrink-0 pt-0.5", children: /* @__PURE__ */ t(
|
|
349
352
|
"input",
|
|
@@ -381,6 +384,7 @@ const P = ({
|
|
|
381
384
|
px-3 py-1.5 rounded-md text-sm font-medium transition-colors
|
|
382
385
|
${b === 0 ? "bg-[var(--widget-primary)] text-[var(--widget-text)] hover:bg-[var(--widget-primary-hover)] shadow-sm" : "bg-transparent text-[var(--widget-text-secondary)] hover:bg-[var(--widget-bg-hover)] border border-[var(--widget-border)]"}
|
|
383
386
|
`,
|
|
387
|
+
"data-mx-widget": "action",
|
|
384
388
|
children: c.label
|
|
385
389
|
},
|
|
386
390
|
b
|
|
@@ -861,10 +865,11 @@ const P = ({
|
|
|
861
865
|
"div",
|
|
862
866
|
{
|
|
863
867
|
className: `
|
|
864
|
-
flex items-center gap-1 overflow-x-auto widget-scrollbar border-b border-[var(--widget-border)] px-2 py-1.5 bg-[var(--widget-background)]
|
|
868
|
+
mx-widget-tabs flex items-center gap-1 overflow-x-auto widget-scrollbar border-b border-[var(--widget-border)] px-2 py-1.5 bg-[var(--widget-background)]
|
|
865
869
|
${s}
|
|
866
870
|
`,
|
|
867
871
|
role: "tablist",
|
|
872
|
+
"data-mx-widget": "tabs",
|
|
868
873
|
children: o.map((h) => {
|
|
869
874
|
const f = r === h.id;
|
|
870
875
|
return /* @__PURE__ */ i(
|
|
@@ -1405,7 +1410,7 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ i(
|
|
|
1405
1410
|
{
|
|
1406
1411
|
ref: c,
|
|
1407
1412
|
className: `
|
|
1408
|
-
absolute top-full mt-2 ${oe[a]}
|
|
1413
|
+
mx-widget-popover absolute top-full mt-2 ${oe[a]}
|
|
1409
1414
|
w-[var(--widget-popover-width,400px)] max-h-[var(--widget-popover-max-height,580px)]
|
|
1410
1415
|
border border-[var(--widget-border)] rounded-2xl overflow-hidden
|
|
1411
1416
|
shadow-[var(--widget-shadow-xl)] bg-[var(--widget-background)]
|
|
@@ -1418,6 +1423,7 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ i(
|
|
|
1418
1423
|
"aria-modal": "true",
|
|
1419
1424
|
"aria-label": "Notifications",
|
|
1420
1425
|
"data-testid": "inbox-popover",
|
|
1426
|
+
"data-mx-widget": "popover",
|
|
1421
1427
|
children: [
|
|
1422
1428
|
/* @__PURE__ */ i("div", { className: "flex-shrink-0 flex items-center justify-between px-4 py-3 border-b border-[var(--widget-border)] bg-[var(--widget-background)]", children: [
|
|
1423
1429
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ t("h2", { className: "text-base font-semibold text-[var(--widget-text)]", children: n === "notifications" ? "Notifications" : "Preferences" }) }),
|
|
@@ -1535,4 +1541,4 @@ export {
|
|
|
1535
1541
|
Ke as S,
|
|
1536
1542
|
Ue as a
|
|
1537
1543
|
};
|
|
1538
|
-
//# sourceMappingURL=components-
|
|
1544
|
+
//# sourceMappingURL=components-Dq8aSwWR.js.map
|