@nubisco/ui 4.1.1 → 4.1.2

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.
@@ -6,22 +6,23 @@ import { t as i } from "./Skeleton-CC7LVdxd.js";
6
6
  import { t as a } from "./NotificationCenterItem-ZkLsiQIV.js";
7
7
  import { Fragment as o, Teleport as s, Transition as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as ee, createTextVNode as te, createVNode as m, defineComponent as h, mergeProps as ne, nextTick as g, normalizeClass as re, normalizeStyle as _, onBeforeUnmount as ie, openBlock as v, ref as y, renderList as ae, renderSlot as b, toDisplayString as x, unref as oe, useId as se, useSlots as ce, watch as S, withCtx as C } from "vue";
8
8
  import { regular as le } from "@nubisco/ui/icons/warning-circle";
9
+ import * as ue from "@nubisco/ui/icons/bell";
9
10
  //#region src/components/NotificationCenter.vue?vue&type=script&setup=true&lang.ts
10
- var ue = {
11
+ var de = {
11
12
  key: 0,
12
13
  class: "nb-notification-center__badge",
13
14
  "aria-hidden": "true"
14
- }, de = ["aria-describedby", "aria-busy"], fe = { class: "nb-notification-center__header" }, pe = {
15
+ }, fe = ["aria-describedby", "aria-busy"], pe = { class: "nb-notification-center__header" }, me = {
15
16
  class: "nb-notification-center__sr",
16
17
  role: "status"
17
- }, me = { class: "nb-notification-center__stale-text" }, he = { class: "nb-notification-center__sr" }, ge = ["tabindex"], _e = {
18
+ }, he = { class: "nb-notification-center__stale-text" }, ge = { class: "nb-notification-center__sr" }, _e = ["tabindex"], ve = {
18
19
  key: 4,
19
20
  class: "nb-notification-center__empty"
20
- }, ve = {
21
+ }, ye = {
21
22
  key: 5,
22
23
  class: "nb-notification-center__footer"
23
24
  }, w = /* @__PURE__ */ new Set(), T = 8, E = 8, D = 96, O = 88, k = 200;
24
- function ye(e, { align: t, width: n, maxHeight: r, viewport: i }) {
25
+ function be(e, { align: t, width: n, maxHeight: r, viewport: i }) {
25
26
  let a = t === "start" ? e.left : e.left + e.width - n, o = Math.min(Math.max(a, E), Math.max(E, i.width - n - E)), s = e.top + e.height, c = i.height - s - T - E, l = e.top - T - E, u = c < k && l > c ? "top" : "bottom", d = Math.max(O, u === "top" ? l : c), f = Math.max(O, Math.min(r, d - D)), p = Math.min(r + D, d);
26
27
  return {
27
28
  top: u === "top" ? Math.max(E, e.top - T - p) : s + T,
@@ -30,7 +31,7 @@ function ye(e, { align: t, width: n, maxHeight: r, viewport: i }) {
30
31
  maxListHeight: f
31
32
  };
32
33
  }
33
- function be(e, t) {
34
+ function xe(e, t) {
34
35
  return e.left <= t.width && e.left + e.width >= 0 && e.top <= t.height && e.top + e.height >= 0;
35
36
  }
36
37
  //#endregion
@@ -95,7 +96,7 @@ var A = /* @__PURE__ */ h({
95
96
  type: Boolean,
96
97
  default: !1
97
98
  },
98
- icon: { default: "bell" },
99
+ icon: { default: void 0 },
99
100
  locale: { default: void 0 },
100
101
  unreadLabel: { default: "Unread" },
101
102
  readLabel: { default: "Read" },
@@ -113,328 +114,328 @@ var A = /* @__PURE__ */ h({
113
114
  "retry"
114
115
  ],
115
116
  setup(h, { expose: T, emit: E }) {
116
- let D = h, O = E, k = ce(), A = `nb-notification-center-${se()}`, xe = `${A}-title`, Se = `${A}-trigger`, j = `${A}-error`, M = y(null), Ce = y(null), N = y(null), P = y(null), we = y(!1), F = l(() => D.open === void 0 ? we.value : D.open), I = l(() => typeof D.unreadCount == "number" ? Math.max(0, D.unreadCount) : D.items.filter((e) => !e.read).length), Te = l(() => I.value > D.maxCount ? `${D.maxCount}+` : String(I.value)), Ee = l(() => I.value > 0 ? `${D.label}, ${D.formatUnread(I.value)}` : D.label), De = l(() => {
117
+ let D = h, O = l(() => D.icon ?? ue), k = E, A = ce(), j = `nb-notification-center-${se()}`, Se = `${j}-title`, Ce = `${j}-trigger`, M = `${j}-error`, N = y(null), we = y(null), P = y(null), F = y(null), Te = y(!1), I = l(() => D.open === void 0 ? Te.value : D.open), L = l(() => typeof D.unreadCount == "number" ? Math.max(0, D.unreadCount) : D.items.filter((e) => !e.read).length), Ee = l(() => L.value > D.maxCount ? `${D.maxCount}+` : String(L.value)), De = l(() => L.value > 0 ? `${D.label}, ${D.formatUnread(L.value)}` : D.label), Oe = l(() => {
117
118
  if (typeof D.itemCount == "number") return Math.max(0, D.itemCount);
118
- if (!k.default) return D.items.length;
119
- }), Oe = l(() => (De.value ?? 0) > 0), L = l(() => {
119
+ if (!A.default) return D.items.length;
120
+ }), ke = l(() => (Oe.value ?? 0) > 0), R = l(() => {
120
121
  if (D.loading) return "loading";
121
- let e = De.value;
122
+ let e = Oe.value;
122
123
  return D.error && (e === void 0 || e === 0) ? "error" : e === void 0 || e > 0 ? "list" : "empty";
123
- }), ke = l(() => D.error && !D.loading && L.value === "list" && Oe.value);
124
+ }), Ae = l(() => D.error && !D.loading && R.value === "list" && ke.value);
124
125
  y(!1), S(() => [
125
- F.value,
126
- !!k.default,
126
+ I.value,
127
+ !!A.default,
127
128
  D.itemCount
128
129
  ], ([e, t, n]) => {}, { immediate: !0 });
129
- function R() {
130
- O("retry");
130
+ function z() {
131
+ k("retry");
131
132
  }
132
- let Ae = l(() => ({
133
- id: Se,
133
+ let je = l(() => ({
134
+ id: Ce,
134
135
  "aria-haspopup": "dialog",
135
- "aria-expanded": F.value ? "true" : "false",
136
- "aria-controls": F.value ? A : void 0,
137
- "aria-label": Ee.value,
136
+ "aria-expanded": I.value ? "true" : "false",
137
+ "aria-controls": I.value ? j : void 0,
138
+ "aria-label": De.value,
138
139
  disabled: D.disabled || void 0
139
- })), je = l(() => ({
140
+ })), Me = l(() => ({
140
141
  type: "button",
141
- disabled: I.value === 0 && !D.markAllPending,
142
+ disabled: L.value === 0 && !D.markAllPending,
142
143
  "aria-disabled": D.markAllPending ? "true" : void 0,
143
144
  "aria-busy": D.markAllPending ? "true" : void 0,
144
- onClick: Qe
145
- })), Me = l(() => ke.value || L.value === "error" ? j : void 0);
146
- function Ne(e) {
145
+ onClick: $e
146
+ })), Ne = l(() => Ae.value || R.value === "error" ? M : void 0);
147
+ function Pe(e) {
147
148
  if (!e) {
148
- N.value = null;
149
+ P.value = null;
149
150
  return;
150
151
  }
151
152
  let t = e instanceof HTMLElement ? e : e.$el;
152
- N.value = t instanceof HTMLElement ? t : null;
153
+ P.value = t instanceof HTMLElement ? t : null;
153
154
  }
154
- let z = y({
155
+ let B = y({
155
156
  top: 0,
156
157
  left: 0,
157
158
  side: "bottom",
158
159
  maxListHeight: D.maxHeight
159
160
  });
160
- function Pe() {
161
+ function Fe() {
161
162
  return {
162
163
  width: window.innerWidth,
163
164
  height: window.innerHeight
164
165
  };
165
166
  }
166
- function B() {
167
- let e = M.value?.getBoundingClientRect();
168
- e && (z.value = ye(e, {
167
+ function V() {
168
+ let e = N.value?.getBoundingClientRect();
169
+ e && (B.value = be(e, {
169
170
  align: D.align,
170
171
  width: D.width,
171
172
  maxHeight: D.maxHeight,
172
- viewport: Pe()
173
+ viewport: Fe()
173
174
  }));
174
175
  }
175
- let Fe = l(() => ({
176
- top: `${Math.round(z.value.top)}px`,
177
- left: `${Math.round(z.value.left)}px`,
176
+ let Ie = l(() => ({
177
+ top: `${Math.round(B.value.top)}px`,
178
+ left: `${Math.round(B.value.left)}px`,
178
179
  width: `${D.width}px`
179
- })), Ie = l(() => ({ maxHeight: `${Math.round(z.value.maxListHeight)}px` })), Le = l(() => ({
180
+ })), Le = l(() => ({ maxHeight: `${Math.round(B.value.maxListHeight)}px` })), Re = l(() => ({
180
181
  "nb-notification-center__panel--start": D.align === "start",
181
- "nb-notification-center__panel--above": z.value.side === "top"
182
+ "nb-notification-center__panel--above": B.value.side === "top"
182
183
  }));
183
- function Re(e) {
184
- D.open === void 0 && (we.value = e), O("update:open", e);
184
+ function ze(e) {
185
+ D.open === void 0 && (Te.value = e), k("update:open", e);
185
186
  }
186
- function V() {
187
- D.disabled || F.value || (B(), Re(!0), O("open"));
187
+ function H() {
188
+ D.disabled || I.value || (V(), ze(!0), k("open"));
188
189
  }
189
- function H(e = {}) {
190
- if (!F.value) return;
191
- let t = P.value?.contains(document.activeElement);
192
- Re(!1), O("close"), (e.restoreFocus ?? t) && g(ze);
190
+ function U(e = {}) {
191
+ if (!I.value) return;
192
+ let t = F.value?.contains(document.activeElement);
193
+ ze(!1), k("close"), (e.restoreFocus ?? t) && g(Be);
193
194
  }
194
- function ze() {
195
- let e = N.value;
195
+ function Be() {
196
+ let e = P.value;
196
197
  if (e?.isConnected) {
197
198
  e.focus();
198
199
  return;
199
200
  }
200
- (M.value?.querySelector(J))?.focus();
201
+ (N.value?.querySelector(Y))?.focus();
201
202
  }
202
- function U() {
203
- F.value ? H({ restoreFocus: !0 }) : V();
203
+ function W() {
204
+ I.value ? U({ restoreFocus: !0 }) : H();
204
205
  }
205
- let W = y(0), Be = new Set([
206
+ let G = y(0), Ve = new Set([
206
207
  "button",
207
208
  "link",
208
209
  "menuitem",
209
210
  "option"
210
211
  ]);
211
- function Ve(e) {
212
+ function He(e) {
212
213
  if (e.tagName === "BUTTON") return !e.hasAttribute("disabled");
213
214
  if (e.tagName === "A") return e.hasAttribute("href");
214
215
  let t = e.getAttribute("role");
215
- return t !== null && Be.has(t);
216
+ return t !== null && Ve.has(t);
216
217
  }
217
- function G() {
218
- return P.value ? Array.from(P.value.querySelectorAll("[data-nb-notification-item]")).filter((e) => !!Ve(e)) : [];
218
+ function K() {
219
+ return F.value ? Array.from(F.value.querySelectorAll("[data-nb-notification-item]")).filter((e) => !!He(e)) : [];
219
220
  }
220
- let He = y(void 0);
221
- function Ue(e) {
222
- let t = Ce.value;
223
- He.value = t && t.childElementCount > 0 && e.length === 0 ? 0 : void 0;
221
+ let Ue = y(void 0);
222
+ function We(e) {
223
+ let t = we.value;
224
+ Ue.value = t && t.childElementCount > 0 && e.length === 0 ? 0 : void 0;
224
225
  }
225
- function K(e) {
226
- let t = G();
227
- Ue(t), t.length && (W.value = Math.min(Math.max(e, 0), t.length - 1), t.forEach((e, t) => {
228
- e.setAttribute("tabindex", t === W.value ? "0" : "-1");
226
+ function q(e) {
227
+ let t = K();
228
+ We(t), t.length && (G.value = Math.min(Math.max(e, 0), t.length - 1), t.forEach((e, t) => {
229
+ e.setAttribute("tabindex", t === G.value ? "0" : "-1");
229
230
  }));
230
231
  }
231
- function q(e) {
232
- let t = G();
232
+ function J(e) {
233
+ let t = K();
233
234
  if (!t.length) return !1;
234
235
  let n = Math.min(Math.max(e, 0), t.length - 1);
235
- return K(n), t[n]?.focus(), !0;
236
+ return q(n), t[n]?.focus(), !0;
236
237
  }
237
- function We(e) {
238
+ function Ge(e) {
238
239
  let t = e.target?.closest("[data-nb-notification-item]");
239
240
  if (!t) return;
240
- let n = G().indexOf(t);
241
- n >= 0 && K(n);
241
+ let n = K().indexOf(t);
242
+ n >= 0 && q(n);
242
243
  }
243
- let J = "a[href]:not([tabindex=\"-1\"]), button:not([disabled]):not([tabindex=\"-1\"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex=\"0\"]";
244
- function Ge(e) {
244
+ let Y = "a[href]:not([tabindex=\"-1\"]), button:not([disabled]):not([tabindex=\"-1\"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex=\"0\"]";
245
+ function Ke(e) {
245
246
  return !!e?.closest?.("input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]");
246
247
  }
247
- function Ke(e) {
248
- let t = G(), n = e.target?.closest("[data-nb-notification-item]"), r = n ? t.indexOf(n) : -1;
248
+ function qe(e) {
249
+ let t = K(), n = e.target?.closest("[data-nb-notification-item]"), r = n ? t.indexOf(n) : -1;
249
250
  if (e.key === "Escape") {
250
- if (!qe(e)) return;
251
- e.preventDefault(), e.stopPropagation(), H({ restoreFocus: !0 });
251
+ if (!Je(e)) return;
252
+ e.preventDefault(), e.stopPropagation(), U({ restoreFocus: !0 });
252
253
  return;
253
254
  }
254
255
  if (e.key === "Tab") {
255
- Je(e);
256
+ Ye(e);
256
257
  return;
257
258
  }
258
- if (!Ge(e.target)) switch (e.key) {
259
+ if (!Ke(e.target)) switch (e.key) {
259
260
  case "ArrowDown":
260
- q(r < 0 ? 0 : r + 1) && e.preventDefault();
261
+ J(r < 0 ? 0 : r + 1) && e.preventDefault();
261
262
  break;
262
263
  case "ArrowUp":
263
- q(r < 0 ? t.length - 1 : r - 1) && e.preventDefault();
264
+ J(r < 0 ? t.length - 1 : r - 1) && e.preventDefault();
264
265
  break;
265
266
  case "Home":
266
- r >= 0 && (e.preventDefault(), q(0));
267
+ r >= 0 && (e.preventDefault(), J(0));
267
268
  break;
268
269
  case "End":
269
- r >= 0 && (e.preventDefault(), q(t.length - 1));
270
+ r >= 0 && (e.preventDefault(), J(t.length - 1));
270
271
  break;
271
272
  default: break;
272
273
  }
273
274
  }
274
- function qe(e) {
275
+ function Je(e) {
275
276
  if (e.defaultPrevented) return !1;
276
277
  let t = (e.target ?? document.activeElement)?.closest?.("[aria-modal=\"true\"]");
277
- return !(t && t !== P.value);
278
+ return !(t && t !== F.value);
278
279
  }
279
- function Je(e) {
280
- let t = P.value;
280
+ function Ye(e) {
281
+ let t = F.value;
281
282
  if (!t) return;
282
- let n = Array.from(t.querySelectorAll(J)), r = document.activeElement, i = n[0], a = n[n.length - 1], o = !n.length || r === i || !t.contains(r), s = !n.length || r === a;
283
+ let n = Array.from(t.querySelectorAll(Y)), r = document.activeElement, i = n[0], a = n[n.length - 1], o = !n.length || r === i || !t.contains(r), s = !n.length || r === a;
283
284
  if (e.shiftKey ? !o : !s) return;
284
285
  e.preventDefault();
285
- let c = e.shiftKey ? N.value : Ye();
286
- H({ restoreFocus: !1 }), g(() => {
287
- c?.isConnected ? c.focus() : ze();
286
+ let c = e.shiftKey ? P.value : Xe();
287
+ U({ restoreFocus: !1 }), g(() => {
288
+ c?.isConnected ? c.focus() : Be();
288
289
  });
289
290
  }
290
- function Ye() {
291
- let e = N.value;
291
+ function Xe() {
292
+ let e = P.value;
292
293
  if (!e) return null;
293
- let t = Array.from(document.querySelectorAll(J)).filter((e) => !P.value?.contains(e)).filter((e) => e.tabIndex >= 0), n = t.indexOf(e);
294
+ let t = Array.from(document.querySelectorAll(Y)).filter((e) => !F.value?.contains(e)).filter((e) => e.tabIndex >= 0), n = t.indexOf(e);
294
295
  return n < 0 ? null : t[n + 1] ?? null;
295
296
  }
296
- function Xe(e, t) {
297
- O("select", e, t), D.closeOnSelect && H({ restoreFocus: !1 });
297
+ function Ze(e, t) {
298
+ k("select", e, t), D.closeOnSelect && U({ restoreFocus: !1 });
298
299
  }
299
- function Ze(e) {
300
- if (!k.default) return;
300
+ function Qe(e) {
301
+ if (!A.default) return;
301
302
  let t = e.target?.closest("[data-nb-notification-item]");
302
- if (t && Ve(t)) {
303
+ if (t && He(t)) {
303
304
  if (e.type === "keydown") {
304
305
  let n = e.key;
305
306
  if (n !== "Enter" && n !== " " || t.tagName === "BUTTON" || t.tagName === "A") return;
306
307
  e.preventDefault();
307
308
  }
308
- O("select", null, e), D.closeOnSelect && H({ restoreFocus: !1 });
309
+ k("select", null, e), D.closeOnSelect && U({ restoreFocus: !1 });
309
310
  }
310
311
  }
311
- function Qe() {
312
- D.markAllPending || O("mark-all-read");
312
+ function $e() {
313
+ D.markAllPending || k("mark-all-read");
313
314
  }
314
- function Y(e) {
315
+ function et(e) {
315
316
  let t = e.target;
316
- M.value?.contains(t) || P.value?.contains(t) || H({ restoreFocus: !1 });
317
+ N.value?.contains(t) || F.value?.contains(t) || U({ restoreFocus: !1 });
317
318
  }
318
- function $e(e) {
319
- e.key === "Escape" && (P.value?.contains(document.activeElement) || qe(e) && H({ restoreFocus: M.value?.contains(document.activeElement) ?? !1 }));
319
+ function tt(e) {
320
+ e.key === "Escape" && (F.value?.contains(document.activeElement) || Je(e) && U({ restoreFocus: N.value?.contains(document.activeElement) ?? !1 }));
320
321
  }
321
322
  let X = 0;
322
323
  function Z() {
323
- !F.value || X || (X = requestAnimationFrame(() => {
324
- X = 0, tt();
324
+ !I.value || X || (X = requestAnimationFrame(() => {
325
+ X = 0, rt();
325
326
  }));
326
327
  }
327
- function et() {
328
+ function nt() {
328
329
  X &&= (cancelAnimationFrame(X), 0);
329
330
  }
330
- function tt() {
331
- if (!F.value) return;
332
- let e = M.value?.getBoundingClientRect();
333
- if (e && !be(e, Pe())) {
334
- H({ restoreFocus: !1 });
331
+ function rt() {
332
+ if (!I.value) return;
333
+ let e = N.value?.getBoundingClientRect();
334
+ if (e && !xe(e, Fe())) {
335
+ U({ restoreFocus: !1 });
335
336
  return;
336
337
  }
337
- B();
338
+ V();
338
339
  }
339
340
  function Q() {
340
- D.closeOnNavigate && H({ restoreFocus: !1 });
341
+ D.closeOnNavigate && U({ restoreFocus: !1 });
341
342
  }
342
- function nt() {
343
+ function it() {
343
344
  return window.navigation;
344
345
  }
345
- function rt() {
346
- document.addEventListener("mousedown", Y), document.addEventListener("keydown", $e), window.addEventListener("resize", Z), window.addEventListener("scroll", Z, !0), window.addEventListener("popstate", Q), window.addEventListener("hashchange", Q), nt()?.addEventListener("navigate", Q);
346
+ function at() {
347
+ document.addEventListener("mousedown", et), document.addEventListener("keydown", tt), window.addEventListener("resize", Z), window.addEventListener("scroll", Z, !0), window.addEventListener("popstate", Q), window.addEventListener("hashchange", Q), it()?.addEventListener("navigate", Q);
347
348
  }
348
- function it() {
349
- et(), document.removeEventListener("mousedown", Y), document.removeEventListener("keydown", $e), window.removeEventListener("resize", Z), window.removeEventListener("scroll", Z, !0), window.removeEventListener("popstate", Q), window.removeEventListener("hashchange", Q), nt()?.removeEventListener("navigate", Q);
349
+ function ot() {
350
+ nt(), document.removeEventListener("mousedown", et), document.removeEventListener("keydown", tt), window.removeEventListener("resize", Z), window.removeEventListener("scroll", Z, !0), window.removeEventListener("popstate", Q), window.removeEventListener("hashchange", Q), it()?.removeEventListener("navigate", Q);
350
351
  }
351
- let $ = () => H({ restoreFocus: !1 });
352
- return S(F, (e) => {
352
+ let $ = () => U({ restoreFocus: !1 });
353
+ return S(I, (e) => {
353
354
  if (e) {
354
355
  for (let e of [...w]) e !== $ && e();
355
- w.add($), rt(), g(() => {
356
- B(), K(0), q(0) || P.value?.focus();
356
+ w.add($), at(), g(() => {
357
+ V(), q(0), J(0) || F.value?.focus();
357
358
  });
358
- } else w.delete($), it(), W.value = 0;
359
- }), S(() => [D.items.length, L.value], () => {
360
- F.value && g(() => K(W.value));
359
+ } else w.delete($), ot(), G.value = 0;
360
+ }), S(() => [D.items.length, R.value], () => {
361
+ I.value && g(() => q(G.value));
361
362
  }), ie(() => {
362
- it(), w.delete($);
363
- let e = P.value;
363
+ ot(), w.delete($);
364
+ let e = F.value;
364
365
  e?.isConnected && e.remove();
365
366
  }), T({
366
- show: V,
367
- close: H,
368
- toggle: U,
369
- isOpen: F,
370
- unreadCount: I
367
+ show: H,
368
+ close: U,
369
+ toggle: W,
370
+ isOpen: I,
371
+ unreadCount: L
371
372
  }), (l, g) => (v(), f("div", {
372
373
  ref_key: "rootRef",
373
- ref: M,
374
+ ref: N,
374
375
  class: "nb-notification-center"
375
376
  }, [b(l.$slots, "trigger", {
376
- open: F.value,
377
- toggle: U,
378
- show: V,
379
- close: H,
380
- unreadCount: I.value,
381
- badge: Te.value,
382
- panelId: A,
383
- triggerProps: Ae.value,
384
- setTriggerRef: Ne
377
+ open: I.value,
378
+ toggle: W,
379
+ show: H,
380
+ close: U,
381
+ unreadCount: L.value,
382
+ badge: Ee.value,
383
+ panelId: j,
384
+ triggerProps: je.value,
385
+ setTriggerRef: Pe
385
386
  }, () => [p("button", ne({
386
- ref: Ne,
387
+ ref: Pe,
387
388
  type: "button",
388
- class: ["nb-notification-center__trigger", { "nb-notification-center__trigger--active": F.value }]
389
- }, Ae.value, { onClick: U }), [m(e, {
390
- name: h.icon,
389
+ class: ["nb-notification-center__trigger", { "nb-notification-center__trigger--active": I.value }]
390
+ }, je.value, { onClick: W }), [m(e, {
391
+ name: O.value,
391
392
  size: 18
392
- }, null, 8, ["name"]), I.value > 0 ? (v(), f("span", ue, x(Te.value), 1)) : d("", !0)], 16)]), (v(), u(s, { to: "body" }, [m(c, { name: "nb-notification-center-pop" }, {
393
- default: C(() => [F.value ? (v(), f("div", {
393
+ }, null, 8, ["name"]), L.value > 0 ? (v(), f("span", de, x(Ee.value), 1)) : d("", !0)], 16)]), (v(), u(s, { to: "body" }, [m(c, { name: "nb-notification-center-pop" }, {
394
+ default: C(() => [I.value ? (v(), f("div", {
394
395
  key: 0,
395
- id: A,
396
+ id: j,
396
397
  ref_key: "panelRef",
397
- ref: P,
398
- class: re(["nb-notification-center__panel", Le.value]),
399
- style: _(Fe.value),
398
+ ref: F,
399
+ class: re(["nb-notification-center__panel", Re.value]),
400
+ style: _(Ie.value),
400
401
  role: "dialog",
401
402
  tabindex: "-1",
402
- "aria-labelledby": xe,
403
- "aria-describedby": Me.value,
403
+ "aria-labelledby": Se,
404
+ "aria-describedby": Ne.value,
404
405
  "aria-busy": h.loading ? "true" : void 0,
405
- onKeydown: Ke,
406
- onFocusin: We
406
+ onKeydown: qe,
407
+ onFocusin: Ge
407
408
  }, [
408
- p("div", fe, [
409
+ p("div", pe, [
409
410
  p("h2", {
410
- id: xe,
411
+ id: Se,
411
412
  class: "nb-notification-center__title"
412
413
  }, x(h.label), 1),
413
414
  b(l.$slots, "header-start", {
414
- close: H,
415
- unreadCount: I.value
415
+ close: U,
416
+ unreadCount: L.value
416
417
  }),
417
418
  b(l.$slots, "header-actions", {
418
- close: H,
419
- unreadCount: I.value,
420
- markAllRead: Qe,
419
+ close: U,
420
+ unreadCount: L.value,
421
+ markAllRead: $e,
421
422
  markAllPending: h.markAllPending,
422
- markAllProps: je.value,
423
+ markAllProps: Me.value,
423
424
  markAllText: h.markAllPending ? h.markAllPendingLabel : h.markAllLabel
424
425
  }, () => [h.showMarkAll ? (v(), f("button", ne({
425
426
  key: 0,
426
427
  class: "nb-notification-center__mark-all"
427
- }, je.value), [h.markAllPending ? (v(), u(r, {
428
+ }, Me.value), [h.markAllPending ? (v(), u(r, {
428
429
  key: 0,
429
430
  size: "xs",
430
431
  tone: "inherit",
431
432
  decorative: ""
432
433
  })) : d("", !0), te(" " + x(h.markAllPending ? h.markAllPendingLabel : h.markAllLabel), 1)], 16)) : d("", !0)])
433
434
  ]),
434
- p("span", pe, x(h.markAllPending ? h.markAllPendingLabel : ""), 1),
435
- ke.value ? (v(), f("div", {
435
+ p("span", me, x(h.markAllPending ? h.markAllPendingLabel : ""), 1),
436
+ Ae.value ? (v(), f("div", {
436
437
  key: 0,
437
- id: j,
438
+ id: M,
438
439
  class: "nb-notification-center__stale",
439
440
  role: "status"
440
441
  }, [
@@ -443,31 +444,31 @@ var A = /* @__PURE__ */ h({
443
444
  size: 14,
444
445
  "aria-hidden": "true"
445
446
  }, null, 8, ["name"]),
446
- p("span", me, x(h.errorStaleLabel), 1),
447
+ p("span", he, x(h.errorStaleLabel), 1),
447
448
  h.showRetry ? (v(), f("button", {
448
449
  key: 0,
449
450
  type: "button",
450
451
  class: "nb-notification-center__retry",
451
- onClick: R
452
+ onClick: z
452
453
  }, x(h.retryLabel), 1)) : d("", !0)
453
454
  ])) : d("", !0),
454
- L.value === "loading" ? (v(), f("div", {
455
+ R.value === "loading" ? (v(), f("div", {
455
456
  key: 1,
456
457
  class: "nb-notification-center__loading",
457
458
  role: "status",
458
- style: _(Ie.value)
459
- }, [p("span", he, x(h.loadingLabel), 1), (v(), f(o, null, ae(3, (e) => m(i, {
459
+ style: _(Le.value)
460
+ }, [p("span", ge, x(h.loadingLabel), 1), (v(), f(o, null, ae(3, (e) => m(i, {
460
461
  key: e,
461
462
  variant: "text",
462
463
  type: "body-sm",
463
464
  lines: 2,
464
465
  "last-line-width": "60%"
465
- })), 64))], 4)) : L.value === "error" ? (v(), f("div", {
466
+ })), 64))], 4)) : R.value === "error" ? (v(), f("div", {
466
467
  key: 2,
467
- id: j,
468
+ id: M,
468
469
  class: "nb-notification-center__error",
469
470
  role: "alert"
470
- }, [b(l.$slots, "error", { retry: R }, () => [m(t, {
471
+ }, [b(l.$slots, "error", { retry: z }, () => [m(t, {
471
472
  size: "sm",
472
473
  kind: "error",
473
474
  title: h.errorTitle,
@@ -477,24 +478,24 @@ var A = /* @__PURE__ */ h({
477
478
  fn: C(() => [m(n, {
478
479
  size: "sm",
479
480
  variant: "secondary",
480
- onClick: R
481
+ onClick: z
481
482
  }, {
482
483
  default: C(() => [te(x(h.retryLabel), 1)]),
483
484
  _: 1
484
485
  })]),
485
486
  key: "0"
486
- } : void 0]), 1032, ["title", "description"])])])) : L.value === "list" ? (v(), f("ul", {
487
+ } : void 0]), 1032, ["title", "description"])])])) : R.value === "list" ? (v(), f("ul", {
487
488
  key: 3,
488
489
  ref_key: "listRef",
489
- ref: Ce,
490
+ ref: we,
490
491
  class: "nb-notification-center__list",
491
492
  role: "list",
492
- tabindex: He.value,
493
- style: _(Ie.value),
494
- onClick: Ze,
495
- onKeydown: Ze
493
+ tabindex: Ue.value,
494
+ style: _(Le.value),
495
+ onClick: Qe,
496
+ onKeydown: Qe
496
497
  }, [b(l.$slots, "default", {
497
- close: H,
498
+ close: U,
498
499
  items: h.items
499
500
  }, () => [(v(!0), f(o, null, ae(h.items, (e) => (v(), u(a, {
500
501
  key: e.id,
@@ -510,7 +511,7 @@ var A = /* @__PURE__ */ h({
510
511
  locale: h.locale,
511
512
  "unread-label": h.unreadLabel,
512
513
  "read-label": h.readLabel,
513
- onSelect: (t) => Xe(e, t)
514
+ onSelect: (t) => Ze(e, t)
514
515
  }, null, 8, [
515
516
  "title",
516
517
  "body",
@@ -525,9 +526,9 @@ var A = /* @__PURE__ */ h({
525
526
  "unread-label",
526
527
  "read-label",
527
528
  "onSelect"
528
- ]))), 128))])], 44, ge)) : L.value === "empty" ? (v(), f("div", _e, [b(l.$slots, "empty", {}, () => [m(t, {
529
+ ]))), 128))])], 44, _e)) : R.value === "empty" ? (v(), f("div", ve, [b(l.$slots, "empty", {}, () => [m(t, {
529
530
  size: "sm",
530
- icon: h.icon,
531
+ icon: O.value,
531
532
  title: h.emptyTitle,
532
533
  description: h.emptyDescription
533
534
  }, null, 8, [
@@ -535,8 +536,8 @@ var A = /* @__PURE__ */ h({
535
536
  "title",
536
537
  "description"
537
538
  ])])])) : d("", !0),
538
- l.$slots.footer ? (v(), f("div", ve, [b(l.$slots, "footer", { close: H })])) : d("", !0)
539
- ], 46, de)) : d("", !0)]),
539
+ l.$slots.footer ? (v(), f("div", ye, [b(l.$slots, "footer", { close: U })])) : d("", !0)
540
+ ], 46, fe)) : d("", !0)]),
540
541
  _: 3
541
542
  })]))], 512));
542
543
  }