@edusight/notification-widget 1.0.31 → 1.0.33

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.
@@ -59,13 +59,13 @@ function I(e) {
59
59
  return e;
60
60
  }
61
61
  function me(e, r, a) {
62
- return r = fe(r), r in e ? Object.defineProperty(e, r, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = a, e;
62
+ return r = ge(r), r in e ? Object.defineProperty(e, r, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = a, e;
63
63
  }
64
- function fe(e) {
65
- var r = ge(e, "string");
64
+ function ge(e) {
65
+ var r = fe(e, "string");
66
66
  return typeof r == "symbol" ? r : r + "";
67
67
  }
68
- function ge(e, r) {
68
+ function fe(e, r) {
69
69
  if (typeof e != "object" || !e) return e;
70
70
  var a = e[Symbol.toPrimitive];
71
71
  if (a !== void 0) {
@@ -91,7 +91,7 @@ function pe(e) {
91
91
  attr: n,
92
92
  size: s,
93
93
  title: o
94
- } = e, h = ue(e, ce), g = s || a.size || "1em", m;
94
+ } = e, h = ue(e, ce), f = s || a.size || "1em", m;
95
95
  return a.className && (m = a.className), e.className && (m = (m ? m + " " : "") + e.className), /* @__PURE__ */ z.createElement("svg", T({
96
96
  stroke: "currentColor",
97
97
  fill: "currentColor",
@@ -101,8 +101,8 @@ function pe(e) {
101
101
  style: I(I({
102
102
  color: e.color || a.color
103
103
  }, a.style), e.style),
104
- height: g,
105
- width: g,
104
+ height: f,
105
+ width: f,
106
106
  xmlns: "http://www.w3.org/2000/svg"
107
107
  }), o && /* @__PURE__ */ z.createElement("title", null, o), e.children);
108
108
  };
@@ -120,7 +120,7 @@ const Fe = ({
120
120
  }) => {
121
121
  const o = (d) => d === 0 ? "" : d > 99 ? "99+" : d.toString(), h = (d) => {
122
122
  s || (d.key === "Enter" || d.key === " ") && (d.preventDefault(), r());
123
- }, g = o(e), m = e > 0;
123
+ }, f = o(e), m = e > 0;
124
124
  return /* @__PURE__ */ i(
125
125
  "button",
126
126
  {
@@ -145,7 +145,7 @@ const Fe = ({
145
145
  "aria-haspopup": "dialog",
146
146
  "data-testid": "bell-component",
147
147
  children: [
148
- /* @__PURE__ */ i("div", { className: "relative inline-flex items-center justify-center", children: [
148
+ /* @__PURE__ */ i("div", { className: "relative inline-flex items-center justify-center text-align-center", children: [
149
149
  /* @__PURE__ */ t(ve, { className: "w-6 h-6" }),
150
150
  m && /* @__PURE__ */ t(
151
151
  "span",
@@ -155,16 +155,17 @@ const Fe = ({
155
155
  flex items-center justify-center\r
156
156
  w-[16px] h-[16px]\r
157
157
  text-[10px] font-bold leading-none\r
158
- text-white bg-red-500\r
158
+ text-[var(--widget-text)] bg-red-500\r
159
159
  rounded-full\r
160
160
  border border-white dark:border-gray-900\r
161
161
  shadow-sm\r
162
162
  pointer-events-none\r
163
+ text-align-center\r
163
164
  `,
164
165
  "aria-hidden": "true",
165
166
  "data-testid": "unread-badge",
166
167
  style: { marginTop: "-25px", marginRight: "-25px" },
167
- children: g
168
+ children: f
168
169
  }
169
170
  )
170
171
  ] }),
@@ -242,7 +243,7 @@ const P = ({
242
243
  position: a = "top",
243
244
  delay: n = 200
244
245
  }) => {
245
- const [s, o] = k(!1), [h, g] = k({ x: 0, y: 0 }), m = j(null), d = j(null), y = () => {
246
+ const [s, o] = k(!1), [h, f] = k({ x: 0, y: 0 }), m = j(null), d = j(null), y = () => {
246
247
  m.current && clearTimeout(m.current), m.current = setTimeout(() => {
247
248
  if (d.current) {
248
249
  const v = d.current.getBoundingClientRect();
@@ -261,7 +262,7 @@ const P = ({
261
262
  l = v.right + 8, u = v.top + v.height / 2;
262
263
  break;
263
264
  }
264
- g({ x: l, y: u }), o(!0);
265
+ f({ x: l, y: u }), o(!0);
265
266
  }
266
267
  }, n);
267
268
  }, c = () => {
@@ -284,16 +285,16 @@ const P = ({
284
285
  "div",
285
286
  {
286
287
  className: `
287
- fixed z-50 px-2 py-1 text-xs font-medium text-white rounded-md pointer-events-none
288
- bg-[var(--widget-text)] shadow-lg
289
- ${{
288
+ fixed z-50 px-2 py-1 text-xs font-medium text-[var(--widget-text)] rounded-md pointer-events-none
289
+ bg-[var(--widget-text)] shadow-lg
290
+ ${{
290
291
  top: "-translate-x-1/2 -translate-y-full",
291
292
  bottom: "-translate-x-1/2 translate-y-0",
292
293
  left: "-translate-x-full -translate-y-1/2",
293
294
  right: "translate-x-0 -translate-y-1/2"
294
295
  }[a]}
295
- animate-in fade-in-0 zoom-in-95 duration-200
296
- `,
296
+ animate-in fade-in-0 zoom-in-95 duration-200
297
+ `,
297
298
  style: {
298
299
  left: `${h.x}px`,
299
300
  top: `${h.y}px`
@@ -324,7 +325,7 @@ const P = ({
324
325
  onSelectionChange: a,
325
326
  isSelected: n = !1
326
327
  }) => {
327
- const [s, o] = k(!1), h = Number.isNaN(e.timestamp.getTime()), g = h ? void 0 : e.timestamp.toISOString(), m = He(e.timestamp), d = (c) => {
328
+ const [s, o] = k(!1), h = Number.isNaN(e.timestamp.getTime()), f = h ? void 0 : e.timestamp.toISOString(), m = He(e.timestamp), d = (c) => {
328
329
  r && r(e.id, c), o(!1);
329
330
  }, y = () => {
330
331
  a && a(!n);
@@ -363,7 +364,7 @@ const P = ({
363
364
  "aria-hidden": "true",
364
365
  loading: "lazy"
365
366
  }
366
- ) : /* @__PURE__ */ t("div", { className: "w-10 h-10 rounded-full bg-gradient-to-br from-widget-primary to-widget-primary-hover flex items-center justify-center shadow-sm", children: /* @__PURE__ */ t("span", { className: "text-white font-semibold text-base", children: e.subject.charAt(0).toUpperCase() }) }) }),
367
+ ) : /* @__PURE__ */ t("div", { className: "w-10 h-10 rounded-full bg-gradient-to-br from-widget-primary to-widget-primary-hover flex items-center justify-center shadow-sm", children: /* @__PURE__ */ t("span", { className: "text-[var(--widget-text)] font-semibold text-base", children: e.subject.charAt(0).toUpperCase() }) }) }),
367
368
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
368
369
  /* @__PURE__ */ i("div", { className: "flex items-start justify-between gap-2 mb-0.5", children: [
369
370
  /* @__PURE__ */ t("h3", { className: `text-sm leading-5 text-[var(--widget-text)] ${e.isRead ? "font-medium" : "font-semibold"}`, children: e.subject }),
@@ -378,14 +379,14 @@ const P = ({
378
379
  },
379
380
  className: `
380
381
  px-3 py-1.5 rounded-md text-sm font-medium transition-colors
381
- ${b === 0 ? "bg-[var(--widget-primary)] text-white 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)]"}
382
+ ${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)]"}
382
383
  `,
383
384
  children: c.label
384
385
  },
385
386
  b
386
387
  )) }),
387
388
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between min-h-[20px]", children: [
388
- /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ t("time", { className: "text-xs text-[var(--widget-text-tertiary)]", dateTime: g, children: m }) }),
389
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ t("time", { className: "text-xs text-[var(--widget-text-tertiary)]", dateTime: f, children: m }) }),
389
390
  /* @__PURE__ */ i(
390
391
  "div",
391
392
  {
@@ -473,7 +474,7 @@ const P = ({
473
474
  onClearSelection: o,
474
475
  className: h = ""
475
476
  }) => {
476
- const [g, m] = k(!1), [d, y] = k(null), c = e.length, b = async (v, l) => {
477
+ const [f, m] = k(!1), [d, y] = k(null), c = e.length, b = async (v, l) => {
477
478
  if (c !== 0) {
478
479
  m(!0), y(null);
479
480
  try {
@@ -527,7 +528,7 @@ const P = ({
527
528
  {
528
529
  type: "button",
529
530
  onClick: () => b(r),
530
- disabled: g,
531
+ disabled: f,
531
532
  className: "inline-flex items-center px-2 py-1 text-xs font-medium text-blue-700 bg-white border border-blue-300 rounded hover:bg-blue-50 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
532
533
  "data-testid": "bulk-mark-read",
533
534
  children: [
@@ -541,7 +542,7 @@ const P = ({
541
542
  {
542
543
  type: "button",
543
544
  onClick: () => b(a),
544
- disabled: g,
545
+ disabled: f,
545
546
  className: "inline-flex items-center px-2 py-1 text-xs font-medium text-blue-700 bg-white border border-blue-300 rounded hover:bg-blue-50 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
546
547
  "data-testid": "bulk-mark-unread",
547
548
  children: [
@@ -555,7 +556,7 @@ const P = ({
555
556
  {
556
557
  type: "button",
557
558
  onClick: () => b(n),
558
- disabled: g,
559
+ disabled: f,
559
560
  className: "inline-flex items-center px-2 py-1 text-xs font-medium text-text-secondary bg-white border border-border rounded hover:bg-widget-hover focus:outline-none focus:ring-2 focus:ring-text-secondary disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
560
561
  "data-testid": "bulk-archive",
561
562
  children: [
@@ -571,7 +572,7 @@ const P = ({
571
572
  onClick: () => {
572
573
  window.confirm(`Are you sure you want to delete ${c} notification${c !== 1 ? "s" : ""}? This action cannot be undone.`) && b(s);
573
574
  },
574
- disabled: g,
575
+ disabled: f,
575
576
  className: "inline-flex items-center px-2 py-1 text-xs font-medium text-[var(--widget-error)] bg-white border border-[var(--widget-error)]/30 rounded hover:bg-[var(--widget-error)]/10 focus:outline-none focus:ring-2 focus:ring-[var(--widget-error)] disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
576
577
  "data-testid": "bulk-delete",
577
578
  children: [
@@ -585,7 +586,7 @@ const P = ({
585
586
  {
586
587
  type: "button",
587
588
  onClick: o,
588
- disabled: g,
589
+ disabled: f,
589
590
  className: "inline-flex items-center px-1 py-1 text-xs font-medium text-text-secondary hover:text-text-primary focus:outline-none focus:ring-2 focus:ring-text-secondary disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
590
591
  "data-testid": "clear-selection",
591
592
  "aria-label": "Clear selection",
@@ -594,7 +595,7 @@ const P = ({
594
595
  )
595
596
  ] })
596
597
  ] }),
597
- g && /* @__PURE__ */ i("div", { className: "mt-2 flex items-center gap-2", children: [
598
+ f && /* @__PURE__ */ i("div", { className: "mt-2 flex items-center gap-2", children: [
598
599
  /* @__PURE__ */ t("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--widget-primary)]" }),
599
600
  /* @__PURE__ */ t(
600
601
  "span",
@@ -643,16 +644,16 @@ const P = ({
643
644
  selectedNotifications: s = [],
644
645
  onSelectionChange: o,
645
646
  onSelectAll: h,
646
- onLoadMore: g,
647
+ onLoadMore: f,
647
648
  hasMore: m = !1,
648
649
  className: d = ""
649
650
  }) => {
650
651
  const y = j(null), c = j(null), [b, v] = k(!1);
651
652
  D(() => {
652
- if (!(!g || !m || b))
653
+ if (!(!f || !m || b))
653
654
  return y.current = new IntersectionObserver(
654
- (f) => {
655
- f[0].isIntersecting && m && !b && (v(!0), g(), setTimeout(() => v(!1), 500));
655
+ (g) => {
656
+ g[0].isIntersecting && m && !b && (v(!0), f(), setTimeout(() => v(!1), 500));
656
657
  },
657
658
  {
658
659
  root: null,
@@ -662,16 +663,16 @@ const P = ({
662
663
  ), c.current && y.current.observe(c.current), () => {
663
664
  y.current && y.current.disconnect();
664
665
  };
665
- }, [g, m, b]);
666
- const l = S(async (f, p) => {
666
+ }, [f, m, b]);
667
+ const l = S(async (g, p) => {
667
668
  try {
668
- p.handler && await p.handler(f), n && p.type && n(f, p);
669
+ p.handler && await p.handler(g), n && p.type && n(g, p);
669
670
  } catch {
670
671
  }
671
- }, [n]), u = S((f, p) => {
672
- o && o(f, p);
672
+ }, [n]), u = S((g, p) => {
673
+ o && o(g, p);
673
674
  }, [o]);
674
- return r && e.length === 0 ? /* @__PURE__ */ t("div", { className: `flex flex-col h-full bg-widget-background ${d}`, children: /* @__PURE__ */ t(Y, { count: 5 }) }) : a ? /* @__PURE__ */ t("div", { className: `flex flex-col h-full bg-widget-background ${d}`, children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center flex-1 py-12", children: /* @__PURE__ */ t(
675
+ return r && e.length === 0 ? /* @__PURE__ */ t("div", { className: `flex flex-col h-full bg-widget-background min-w-[20rem] ${d}`, children: /* @__PURE__ */ t(Y, { count: 5 }) }) : a ? /* @__PURE__ */ t("div", { className: `flex flex-col h-full bg-widget-background min-w-[20rem] ${d}`, children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center flex-1 py-12", children: /* @__PURE__ */ t(
675
676
  J,
676
677
  {
677
678
  title: "Error Loading Notifications",
@@ -695,7 +696,7 @@ const P = ({
695
696
  }
696
697
  )
697
698
  }
698
- ) }) }) : e.length === 0 ? /* @__PURE__ */ t("div", { className: `flex flex-col h-full bg-widget-background ${d}`, children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center flex-1 py-12", children: /* @__PURE__ */ t(
699
+ ) }) }) : e.length === 0 ? /* @__PURE__ */ t("div", { className: `flex flex-col h-full bg-widget-background min-w-[20rem] ${d}`, children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center flex-1 py-12", children: /* @__PURE__ */ t(
699
700
  J,
700
701
  {
701
702
  title: "No Notifications",
@@ -719,19 +720,19 @@ const P = ({
719
720
  }
720
721
  )
721
722
  }
722
- ) }) }) : /* @__PURE__ */ i("div", { className: `flex flex-col h-full ${d}`, children: [
723
+ ) }) }) : /* @__PURE__ */ i("div", { className: `flex flex-col h-full min-w-[20rem] ${d}`, children: [
723
724
  h && n && /* @__PURE__ */ t(
724
725
  Te,
725
726
  {
726
727
  selectedNotifications: s,
727
- onMarkAllAsRead: async (f) => {
728
+ onMarkAllAsRead: async (g) => {
728
729
  try {
729
- for (const p of f)
730
+ for (const p of g)
730
731
  n(p, { type: "mark_read", label: "Mark as read", handler: async () => {
731
732
  } });
732
733
  return {
733
734
  success: !0,
734
- processedCount: f.length,
735
+ processedCount: g.length,
735
736
  failedCount: 0,
736
737
  errors: []
737
738
  };
@@ -739,19 +740,19 @@ const P = ({
739
740
  return {
740
741
  success: !1,
741
742
  processedCount: 0,
742
- failedCount: f.length,
743
+ failedCount: g.length,
743
744
  errors: [{ notificationId: "", error: p }]
744
745
  };
745
746
  }
746
747
  },
747
- onMarkAllAsUnread: async (f) => {
748
+ onMarkAllAsUnread: async (g) => {
748
749
  try {
749
- for (const p of f)
750
+ for (const p of g)
750
751
  n(p, { type: "mark_unread", label: "Mark as unread", handler: async () => {
751
752
  } });
752
753
  return {
753
754
  success: !0,
754
- processedCount: f.length,
755
+ processedCount: g.length,
755
756
  failedCount: 0,
756
757
  errors: []
757
758
  };
@@ -759,19 +760,19 @@ const P = ({
759
760
  return {
760
761
  success: !1,
761
762
  processedCount: 0,
762
- failedCount: f.length,
763
+ failedCount: g.length,
763
764
  errors: [{ notificationId: "", error: p }]
764
765
  };
765
766
  }
766
767
  },
767
- onArchiveAll: async (f) => {
768
+ onArchiveAll: async (g) => {
768
769
  try {
769
- for (const p of f)
770
+ for (const p of g)
770
771
  n(p, { type: "archive", label: "Archive", handler: async () => {
771
772
  } });
772
773
  return {
773
774
  success: !0,
774
- processedCount: f.length,
775
+ processedCount: g.length,
775
776
  failedCount: 0,
776
777
  errors: []
777
778
  };
@@ -779,19 +780,19 @@ const P = ({
779
780
  return {
780
781
  success: !1,
781
782
  processedCount: 0,
782
- failedCount: f.length,
783
+ failedCount: g.length,
783
784
  errors: [{ notificationId: "", error: p }]
784
785
  };
785
786
  }
786
787
  },
787
- onDeleteAll: async (f) => {
788
+ onDeleteAll: async (g) => {
788
789
  try {
789
- for (const p of f)
790
+ for (const p of g)
790
791
  n(p, { type: "delete", label: "Delete", handler: async () => {
791
792
  } });
792
793
  return {
793
794
  success: !0,
794
- processedCount: f.length,
795
+ processedCount: g.length,
795
796
  failedCount: 0,
796
797
  errors: []
797
798
  };
@@ -799,7 +800,7 @@ const P = ({
799
800
  return {
800
801
  success: !1,
801
802
  processedCount: 0,
802
- failedCount: f.length,
803
+ failedCount: g.length,
803
804
  errors: [{ notificationId: "", error: p }]
804
805
  };
805
806
  }
@@ -808,15 +809,15 @@ const P = ({
808
809
  }
809
810
  ),
810
811
  /* @__PURE__ */ t("div", { className: "flex-1", children: /* @__PURE__ */ i("div", { children: [
811
- e.map((f) => /* @__PURE__ */ t(
812
+ e.map((g) => /* @__PURE__ */ t(
812
813
  Ee,
813
814
  {
814
- notification: f,
815
+ notification: g,
815
816
  onActionClick: l,
816
- isSelected: s.includes(f.id),
817
- onSelectionChange: o ? (p) => u(f.id, p) : void 0
817
+ isSelected: s.includes(g.id),
818
+ onSelectionChange: o ? (p) => u(g.id, p) : void 0
818
819
  },
819
- f.id
820
+ g.id
820
821
  )),
821
822
  m && /* @__PURE__ */ t("div", { ref: c, className: "py-2", children: b && /* @__PURE__ */ t(Y, { count: 3 }) })
822
823
  ] }) })
@@ -829,7 +830,7 @@ const P = ({
829
830
  className: s = ""
830
831
  }) => {
831
832
  const o = Z(() => {
832
- const h = e.length, g = e.filter((c) => !c.isRead).length, m = /* @__PURE__ */ new Map();
833
+ const h = e.length, f = e.filter((c) => !c.isRead).length, m = /* @__PURE__ */ new Map();
833
834
  e.forEach((c) => {
834
835
  c.tags.forEach((b) => {
835
836
  m.set(b, (m.get(b) || 0) + 1);
@@ -845,7 +846,7 @@ const P = ({
845
846
  {
846
847
  id: "unread",
847
848
  label: "Unread",
848
- count: g,
849
+ count: f,
849
850
  icon: /* @__PURE__ */ t(ie, { className: "w-4 h-4" })
850
851
  }
851
852
  ], y = Array.from(m.entries()).sort(([, c], [, b]) => b - c).slice(0, 5).map(([c, b]) => ({
@@ -860,40 +861,30 @@ const P = ({
860
861
  "div",
861
862
  {
862
863
  className: `
863
- flex items-center gap-1 overflow-x-auto widget-scrollbar border-b border-[var(--widget-border)] px-2 py-1.5
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)]
864
865
  ${s}
865
866
  `,
866
- style: { backgroundColor: "var(--widget-background)" },
867
867
  role: "tablist",
868
868
  children: o.map((h) => {
869
- const g = r === h.id;
869
+ const f = r === h.id;
870
870
  return /* @__PURE__ */ i(
871
871
  "button",
872
872
  {
873
873
  onClick: () => a(h.id),
874
874
  className: `
875
875
  flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-medium transition-all whitespace-nowrap outline-none focus:ring-2 focus:ring-offset-1
876
- ${g ? "shadow-sm" : "tab-inactive"}
876
+ ${f ? "shadow-sm bg-[var(--widget-primary)] text-[var(--widget-text)]" : "tab-inactive text-[var(--widget-text-secondary)]"}
877
877
  `,
878
- style: g ? {
879
- backgroundColor: "var(--widget-primary)",
880
- color: "#ffffff"
881
- } : {
882
- color: "var(--widget-text-secondary)"
883
- },
884
878
  role: "tab",
885
- "aria-selected": g,
879
+ "aria-selected": f,
886
880
  "data-testid": `tab-${h.id}`,
887
881
  children: [
888
- h.icon && /* @__PURE__ */ t("span", { style: { color: g ? "#ffffff" : "var(--widget-text-tertiary)" }, children: h.icon }),
882
+ h.icon && /* @__PURE__ */ t("span", { className: f ? "text-[var(--widget-text)]" : "text-[var(--widget-text-tertiary)]", children: h.icon }),
889
883
  /* @__PURE__ */ t("span", { children: h.label }),
890
884
  h.count !== void 0 && h.count > 0 && /* @__PURE__ */ i(
891
885
  "span",
892
886
  {
893
- className: "ml-1 text-[10px] font-semibold",
894
- style: {
895
- color: g ? "#ffffff" : "var(--widget-text-tertiary)"
896
- },
887
+ className: `ml-1 text-[10px] font-semibold ${f ? "text-[var(--widget-text)]" : "text-[var(--widget-text-tertiary)]"}`,
897
888
  children: [
898
889
  "(",
899
890
  h.count > 99 ? "99+" : h.count,
@@ -928,27 +919,25 @@ const P = ({
928
919
  role: "switch",
929
920
  "aria-checked": a,
930
921
  disabled: s,
931
- className: `
932
- relative inline-flex h-5 w-9 flex-shrink-0 rounded-full border-2 border-transparent
933
- transition-colors duration-200 ease-in-out
934
- focus:outline-none focus:ring-2 focus:ring-widget-primary focus:ring-offset-2
935
- ${a ? "bg-widget-primary" : "bg-gray-300 dark:bg-gray-600"}
936
- ${s ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
937
- `,
922
+ className: `relative inline-flex h-5 w-9 flex-shrink-0 rounded-full border-2 border-transparent
923
+ transition-colors duration-200 ease-in-out
924
+ focus:outline-none focus:ring-2 focus:ring-widget-primary focus:ring-offset-2
925
+ ${a ? "bg-widget-primary" : "bg-gray-300 dark:bg-gray-600"}
926
+ ${s ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
927
+ `,
938
928
  onClick: () => !s && n(!a),
939
929
  children: /* @__PURE__ */ t(
940
930
  "span",
941
931
  {
942
- className: `
943
- pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow-md ring-0
944
- transition duration-200 ease-in-out
945
- ${a ? "translate-x-4" : "translate-x-0"}
946
- `
932
+ className: `pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow-md ring-0
933
+ transition duration-200 ease-in-out
934
+ ${a ? "translate-x-4" : "translate-x-0"}
935
+ `
947
936
  }
948
937
  )
949
938
  }
950
939
  )
951
- ] }), Oe = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], $e = ({
940
+ ] }), $e = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], Oe = ({
952
941
  preferences: e,
953
942
  onPreferenceChange: r,
954
943
  isLoading: a
@@ -956,7 +945,7 @@ const P = ({
956
945
  const [n, s] = k({
957
946
  global: !0,
958
947
  schedule: !1
959
- }), [o, h] = k({}), g = (l) => {
948
+ }), [o, h] = k({}), f = (l) => {
960
949
  s((u) => ({ ...u, [l]: !u[l] }));
961
950
  }, m = (l) => {
962
951
  h((u) => ({ ...u, [l]: !u[l] }));
@@ -964,8 +953,8 @@ const P = ({
964
953
  r(`channels.${l}`, u);
965
954
  }, y = (l, u) => {
966
955
  r(`subscriptions.${l}.enabled`, u);
967
- }, c = (l, u, f) => {
968
- r(`subscriptions.${l}.channels.${u}`, f);
956
+ }, c = (l, u, g) => {
957
+ r(`subscriptions.${l}.channels.${u}`, g);
969
958
  }, b = (l) => {
970
959
  const u = [...e.deliverySchedule.weekdays];
971
960
  u[l] = !u[l], r("deliverySchedule.weekdays", u);
@@ -983,7 +972,7 @@ const P = ({
983
972
  return null;
984
973
  }
985
974
  };
986
- return /* @__PURE__ */ i("div", { className: "h-full overflow-y-auto widget-scrollbar p-2", style: { backgroundColor: "var(--widget-background)" }, "data-testid": "preferences-view", children: [
975
+ return /* @__PURE__ */ i("div", { className: "h-full overflow-y-auto widget-scrollbar p-2 bg-[var(--widget-background)]", "data-testid": "preferences-view", children: [
987
976
  a && /* @__PURE__ */ t("div", { className: "absolute inset-0 bg-[var(--widget-bg)]/75 backdrop-blur-sm flex items-center justify-center z-10", children: /* @__PURE__ */ t("div", { className: "w-8 h-8 border-2 border-[var(--widget-primary)] border-t-transparent rounded-full animate-spin" }) }),
988
977
  /* @__PURE__ */ i("div", { className: "space-y-2", children: [
989
978
  /* @__PURE__ */ i("div", { className: "border border-[var(--widget-border)] rounded-lg overflow-hidden", children: [
@@ -991,7 +980,7 @@ const P = ({
991
980
  "button",
992
981
  {
993
982
  type: "button",
994
- onClick: () => g("global"),
983
+ onClick: () => f("global"),
995
984
  className: "w-full flex items-center justify-between px-2 py-1.5 bg-[var(--widget-bg-secondary)] hover:bg-[var(--widget-bg-hover)] transition-colors",
996
985
  children: [
997
986
  /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
@@ -1002,7 +991,7 @@ const P = ({
1002
991
  ]
1003
992
  }
1004
993
  ),
1005
- n.global && /* @__PURE__ */ i("div", { className: "px-2 pb-1.5 divide-y divide-border-light", style: { backgroundColor: "var(--widget-background)" }, children: [
994
+ n.global && /* @__PURE__ */ i("div", { className: "px-2 pb-1.5 divide-y divide-border-light bg-[var(--widget-background)]", children: [
1006
995
  /* @__PURE__ */ t(
1007
996
  M,
1008
997
  {
@@ -1038,12 +1027,12 @@ const P = ({
1038
1027
  )
1039
1028
  ] })
1040
1029
  ] }),
1041
- /* @__PURE__ */ i("div", { className: "border border-[var(--widget-border)] rounded-lg overflow-hidden", style: { backgroundColor: "var(--widget-background)" }, children: [
1030
+ /* @__PURE__ */ i("div", { className: "border border-[var(--widget-border)] rounded-lg overflow-hidden bg-[var(--widget-background)]", children: [
1042
1031
  /* @__PURE__ */ i(
1043
1032
  "button",
1044
1033
  {
1045
1034
  type: "button",
1046
- onClick: () => g("schedule"),
1035
+ onClick: () => f("schedule"),
1047
1036
  className: "w-full flex items-center justify-between px-2 py-1.5 bg-[var(--widget-bg-secondary)] hover:bg-[var(--widget-bg-hover)] transition-colors",
1048
1037
  children: [
1049
1038
  /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
@@ -1073,25 +1062,25 @@ const P = ({
1073
1062
  ]
1074
1063
  }
1075
1064
  ),
1076
- n.schedule && /* @__PURE__ */ i("div", { className: "px-2 py-1.5 space-y-2 animate-in slide-in-from-top-2 duration-200", style: { backgroundColor: "var(--widget-background)" }, children: [
1065
+ n.schedule && /* @__PURE__ */ i("div", { className: "px-2 py-1.5 space-y-2 animate-in slide-in-from-top-2 duration-200 bg-[var(--widget-background)]", children: [
1077
1066
  /* @__PURE__ */ t("div", { className: "text-sm text-[var(--widget-text-secondary)]", children: "Allow notifications between:" }),
1078
1067
  /* @__PURE__ */ i("div", { className: "grid grid-cols-[auto_1fr_auto_auto] gap-x-4 gap-y-3 items-center", children: [
1079
1068
  /* @__PURE__ */ t("div", { className: "col-span-2 text-xs font-semibold text-[var(--widget-text-tertiary)] pl-1", children: "Days" }),
1080
1069
  /* @__PURE__ */ t("div", { className: "text-xs font-semibold text-[var(--widget-text-tertiary)] w-[88px]", children: "From" }),
1081
1070
  /* @__PURE__ */ t("div", { className: "text-xs font-semibold text-[var(--widget-text-tertiary)] w-[88px]", children: "To" }),
1082
- Oe.map((l, u) => {
1083
- const f = e.deliverySchedule.weekdays[u];
1071
+ $e.map((l, u) => {
1072
+ const g = e.deliverySchedule.weekdays[u];
1084
1073
  return /* @__PURE__ */ i(z.Fragment, { children: [
1085
1074
  /* @__PURE__ */ t("div", { className: "flex items-center h-8", children: /* @__PURE__ */ t(
1086
1075
  M,
1087
1076
  {
1088
1077
  id: `day-${u}`,
1089
- checked: f,
1078
+ checked: g,
1090
1079
  onChange: () => b(u),
1091
1080
  disabled: a
1092
1081
  }
1093
1082
  ) }),
1094
- /* @__PURE__ */ t("div", { className: `text-sm ${f ? "text-text-primary" : "text-text-tertiary"}`, children: l }),
1083
+ /* @__PURE__ */ t("div", { className: `text-sm ${g ? "text-text-primary" : "text-text-tertiary"}`, children: l }),
1095
1084
  /* @__PURE__ */ t("div", { className: "w-[88px]", children: /* @__PURE__ */ t(
1096
1085
  "input",
1097
1086
  {
@@ -1099,7 +1088,7 @@ const P = ({
1099
1088
  className: "w-full px-2 py-1 bg-widget-background border border-border rounded text-sm text-text-primary focus:outline-none focus:ring-1 focus:ring-widget-primary disabled:opacity-50 disabled:bg-widget-hover",
1100
1089
  value: e.deliverySchedule.quietHours.start,
1101
1090
  onChange: (p) => r("deliverySchedule.quietHours.start", p.target.value),
1102
- disabled: a || !f
1091
+ disabled: a || !g
1103
1092
  }
1104
1093
  ) }),
1105
1094
  /* @__PURE__ */ t("div", { className: "w-[88px]", children: /* @__PURE__ */ t(
@@ -1109,7 +1098,7 @@ const P = ({
1109
1098
  className: "w-full px-2 py-1 bg-widget-background border border-border rounded text-sm text-text-primary focus:outline-none focus:ring-1 focus:ring-widget-primary disabled:opacity-50 disabled:bg-widget-hover",
1110
1099
  value: e.deliverySchedule.quietHours.end,
1111
1100
  onChange: (p) => r("deliverySchedule.quietHours.end", p.target.value),
1112
- disabled: a || !f
1101
+ disabled: a || !g
1113
1102
  }
1114
1103
  ) })
1115
1104
  ] }, l);
@@ -1141,7 +1130,7 @@ const P = ({
1141
1130
  ]
1142
1131
  }
1143
1132
  ),
1144
- o[l.workflowId] && l.enabled && /* @__PURE__ */ i("div", { className: "px-2 pb-1.5 divide-y divide-border-light", style: { backgroundColor: "var(--widget-background)" }, children: [
1133
+ o[l.workflowId] && l.enabled && /* @__PURE__ */ i("div", { className: "px-2 pb-1.5 divide-y divide-border-light bg-[var(--widget-background)]", children: [
1145
1134
  /* @__PURE__ */ t(
1146
1135
  M,
1147
1136
  {
@@ -1357,12 +1346,12 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ i(
1357
1346
  onViewChange: s,
1358
1347
  notifications: o,
1359
1348
  onNotificationAction: h,
1360
- preferences: g,
1349
+ preferences: f,
1361
1350
  onPreferenceChange: m,
1362
1351
  isPreferencesLoading: d = !1,
1363
1352
  size: y = "medium"
1364
1353
  }) => {
1365
- const c = j(null), b = j(null), [v, l] = k("all"), [u, f] = k([]), [p, A] = k(""), _ = S(() => {
1354
+ const c = j(null), b = j(null), [v, l] = k("all"), [u, g] = k([]), [p, A] = k(""), _ = S(() => {
1366
1355
  const x = window.__notificationSDK?.config, N = window.__notificationSDK?.client;
1367
1356
  if (!x || !N) return null;
1368
1357
  const { tenantId: C, environmentId: H, subscriberId: W } = x;
@@ -1377,9 +1366,9 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ i(
1377
1366
  } catch (C) {
1378
1367
  return { success: !1, processedCount: 0, failedCount: x.length, errors: [{ notificationId: "", error: C }] };
1379
1368
  }
1380
- }, [_]), le = Z(() => De(o, v, p), [o, v, p]), O = S((x) => {
1369
+ }, [_]), le = Z(() => De(o, v, p), [o, v, p]), $ = S((x) => {
1381
1370
  c.current && !c.current.contains(x.target) && r();
1382
- }, [r]), $ = S((x) => {
1371
+ }, [r]), O = S((x) => {
1383
1372
  x.key === "Escape" && r();
1384
1373
  }, [r]), L = S((x) => {
1385
1374
  if (!(!e || !c.current) && x.key === "Tab") {
@@ -1391,13 +1380,13 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ i(
1391
1380
  x.shiftKey ? document.activeElement === C && (H.focus(), x.preventDefault()) : document.activeElement === H && (C.focus(), x.preventDefault());
1392
1381
  }
1393
1382
  }, [e]);
1394
- if (D(() => (e ? (b.current = document.activeElement, document.addEventListener("mousedown", O), document.addEventListener("keydown", $), document.addEventListener("keydown", L), setTimeout(() => {
1383
+ if (D(() => (e ? (b.current = document.activeElement, document.addEventListener("mousedown", $), document.addEventListener("keydown", O), document.addEventListener("keydown", L), setTimeout(() => {
1395
1384
  c.current?.querySelector(
1396
1385
  'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
1397
1386
  )?.focus();
1398
- }, 0)) : (b.current && b.current.focus(), l("all"), f([]), A("")), () => {
1399
- document.removeEventListener("mousedown", O), document.removeEventListener("keydown", $), document.removeEventListener("keydown", L);
1400
- }), [e, O, $, L]), !e) return null;
1387
+ }, 0)) : (b.current && b.current.focus(), l("all"), g([]), A("")), () => {
1388
+ document.removeEventListener("mousedown", $), document.removeEventListener("keydown", O), document.removeEventListener("keydown", L);
1389
+ }), [e, $, O, L]), !e) return null;
1401
1390
  const oe = {
1402
1391
  left: "left-0 origin-top-left",
1403
1392
  right: "right-0 origin-top-right"
@@ -1419,20 +1408,19 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ i(
1419
1408
  absolute top-full mt-2 ${oe[a]}
1420
1409
  w-[var(--widget-popover-width,400px)] max-h-[var(--widget-popover-max-height,580px)]
1421
1410
  border border-[var(--widget-border)] rounded-2xl overflow-hidden
1422
- shadow-[var(--widget-shadow-xl)]
1411
+ shadow-[var(--widget-shadow-xl)] bg-[var(--widget-background)]
1423
1412
  z-50 flex flex-col
1424
1413
  animate-in fade-in-0 zoom-in-95 duration-200
1425
1414
  max-sm:fixed max-sm:inset-x-4 max-sm:top-16 max-sm:bottom-4
1426
1415
  max-sm:w-auto max-sm:max-w-none max-sm:max-h-[calc(100vh-120px)]
1427
1416
  `,
1428
- style: { backgroundColor: "var(--widget-background)" },
1429
1417
  role: "dialog",
1430
1418
  "aria-modal": "true",
1431
1419
  "aria-label": "Notifications",
1432
1420
  "data-testid": "inbox-popover",
1433
1421
  children: [
1434
- /* @__PURE__ */ i("div", { className: "flex-shrink-0 flex items-center justify-between px-4 py-3 border-b border-[var(--widget-border)]", style: { backgroundColor: "var(--widget-background)" }, children: [
1435
- /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ t("h2", { className: "text-base font-semibold", style: { color: "var(--widget-text)" }, children: n === "notifications" ? "Notifications" : "Preferences" }) }),
1422
+ /* @__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
+ /* @__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" }) }),
1436
1424
  /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
1437
1425
  n === "notifications" && /* @__PURE__ */ t(
1438
1426
  "button",
@@ -1470,7 +1458,7 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ i(
1470
1458
  ] })
1471
1459
  ] }),
1472
1460
  n === "notifications" ? /* @__PURE__ */ i(E, { children: [
1473
- /* @__PURE__ */ t("div", { className: "flex-shrink-0 px-4 py-2.5 border-b border-[var(--widget-border)]", style: { backgroundColor: "var(--widget-background)" }, children: /* @__PURE__ */ i("div", { className: "relative", children: [
1461
+ /* @__PURE__ */ t("div", { className: "flex-shrink-0 px-4 py-2.5 border-b border-[var(--widget-border)] bg-[var(--widget-background)]", children: /* @__PURE__ */ i("div", { className: "relative", children: [
1474
1462
  /* @__PURE__ */ t("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: /* @__PURE__ */ t(we, { className: "w-5 h-5 text-[var(--widget-text-tertiary)]" }) }),
1475
1463
  /* @__PURE__ */ t(
1476
1464
  "input",
@@ -1502,14 +1490,14 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ i(
1502
1490
  size: y
1503
1491
  }
1504
1492
  ),
1505
- /* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto widget-scrollbar", style: { backgroundColor: "var(--widget-background)", maxHeight: "calc(var(--widget-popover-max-height) - 200px)" }, children: /* @__PURE__ */ t(Q, { fallback: /* @__PURE__ */ t(Le, {}), children: /* @__PURE__ */ t(
1493
+ /* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto widget-scrollbar bg-[var(--widget-background)] max-h-[calc(var(--widget-popover-max-height)-200px)]", children: /* @__PURE__ */ t(Q, { fallback: /* @__PURE__ */ t(Le, {}), children: /* @__PURE__ */ t(
1506
1494
  Ie,
1507
1495
  {
1508
1496
  notifications: le,
1509
1497
  onNotificationAction: h
1510
1498
  }
1511
1499
  ) }) }),
1512
- F > 0 && /* @__PURE__ */ t("div", { className: "flex-shrink-0 px-4 py-2.5 border-t border-[var(--widget-border)]", style: { backgroundColor: "var(--widget-bg-hover)" }, children: /* @__PURE__ */ t(
1500
+ F > 0 && /* @__PURE__ */ t("div", { className: "flex-shrink-0 px-4 py-2.5 border-t border-[var(--widget-border)] bg-[var(--widget-bg-hover)]", children: /* @__PURE__ */ t(
1513
1501
  "button",
1514
1502
  {
1515
1503
  type: "button",
@@ -1522,10 +1510,10 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ i(
1522
1510
  children: "Mark all as read"
1523
1511
  }
1524
1512
  ) })
1525
- ] }) : /* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto widget-scrollbar", children: /* @__PURE__ */ t(Q, { fallback: /* @__PURE__ */ t(X, {}), children: g && m ? /* @__PURE__ */ t(
1526
- $e,
1513
+ ] }) : /* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto widget-scrollbar", children: /* @__PURE__ */ t(Q, { fallback: /* @__PURE__ */ t(X, {}), children: f && m ? /* @__PURE__ */ t(
1514
+ Oe,
1527
1515
  {
1528
- preferences: g,
1516
+ preferences: f,
1529
1517
  onPreferenceChange: m,
1530
1518
  isLoading: d,
1531
1519
  onBack: () => s("notifications")
@@ -1543,8 +1531,8 @@ export {
1543
1531
  qe as L,
1544
1532
  We as M,
1545
1533
  Ee as N,
1546
- $e as P,
1534
+ Oe as P,
1547
1535
  Ke as S,
1548
1536
  Ue as a
1549
1537
  };
1550
- //# sourceMappingURL=components-D8XxiFEB.js.map
1538
+ //# sourceMappingURL=components-Cfc2kMlt.js.map