@alea-design/ui 0.4.0 → 0.5.0

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.
@@ -1,54 +1,65 @@
1
1
  "use client";
2
- import { jsx as o, jsxs as n } from "react/jsx-runtime";
3
- import { forwardRef as A, useState as C, useEffect as D, useMemo as h } from "react";
4
- import { cx as F } from "../../utils/cx.js";
5
- import { useFilter as I, Autocomplete as L, SearchField as g, Input as z, Menu as R, MenuSection as H, Header as V, Collection as q, MenuItem as B, Keyboard as G } from "react-aria-components";
6
- import { Search as J } from "lucide-react";
7
- import { DialogModal as Q, Dialog as U } from "../overlay/Overlay.js";
8
- import { Kbd as W } from "../typography/Typography.js";
9
- import { useStrings as X } from "../../i18n/strings.js";
10
- const oe = A(function({ commands: s, isOpen: c, defaultOpen: f, onOpenChange: l, motion: N, hotkey: w = !0, placeholder: m, emptyText: d, className: y, style: b, surface: v, radius: M }, S) {
11
- const i = X();
12
- m ?? (m = i.commandPlaceholder), d ?? (d = i.noResults);
13
- const [k, x] = C(f ?? !1), u = c ?? k, p = (a) => {
14
- c === void 0 && x(a), l == null || l(a);
2
+ import { jsx as n, jsxs as l } from "react/jsx-runtime";
3
+ import { forwardRef as L, useState as w, useEffect as y, useMemo as v, useRef as P } from "react";
4
+ import { cx as j } from "../../utils/cx.js";
5
+ import { useFilter as A, Autocomplete as D, SearchField as F, Input as H, Menu as O, MenuSection as V, Header as q, Collection as B, MenuItem as G, Keyboard as J } from "react-aria-components";
6
+ import { Search as Q } from "lucide-react";
7
+ import { DialogModal as U, Dialog as W } from "../overlay/Overlay.js";
8
+ import { Kbd as X } from "../typography/Typography.js";
9
+ import { useStrings as Y } from "../../i18n/strings.js";
10
+ function Z({ children: f }) {
11
+ const o = P(null), [c, m] = w(!1);
12
+ return y(() => {
13
+ const i = o.current;
14
+ if (!i) return;
15
+ const d = () => m(i.scrollHeight > i.clientHeight + 1);
16
+ if (d(), typeof ResizeObserver > "u") return;
17
+ const a = new ResizeObserver(d);
18
+ return a.observe(i), i.firstElementChild && a.observe(i.firstElementChild), () => a.disconnect();
19
+ }, []), /* @__PURE__ */ n("div", { ref: o, className: "alea-command-scroll", tabIndex: c ? 0 : void 0, children: f });
20
+ }
21
+ const oe = L(function({ commands: o, isOpen: c, defaultOpen: m, onOpenChange: i, motion: d, hotkey: a = !0, placeholder: h, emptyText: p, className: S, style: k, surface: x, radius: E }, M) {
22
+ const r = Y();
23
+ h ?? (h = r.commandPlaceholder), p ?? (p = r.noResults);
24
+ const [g, C] = w(m ?? !1), b = c ?? g, N = (s) => {
25
+ c === void 0 && C(s), i == null || i(s);
15
26
  };
16
- D(() => {
17
- if (!w) return;
18
- const a = (t) => {
19
- t.key.toLowerCase() === "k" && (t.metaKey || t.ctrlKey) && (t.preventDefault(), p(!u));
27
+ y(() => {
28
+ if (!a) return;
29
+ const s = (t) => {
30
+ t.key.toLowerCase() === "k" && (t.metaKey || t.ctrlKey) && (t.preventDefault(), N(!b));
20
31
  };
21
- return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
32
+ return window.addEventListener("keydown", s), () => window.removeEventListener("keydown", s);
22
33
  });
23
- const { contains: E } = I({ sensitivity: "base" }), K = h(() => {
24
- const a = [];
25
- for (const t of s) {
34
+ const { contains: R } = A({ sensitivity: "base" }), z = v(() => {
35
+ const s = [];
36
+ for (const t of o) {
26
37
  const e = t.group || "";
27
- let r = a.find((j) => j.id === e);
28
- r || a.push(r = { id: e, title: e, items: [] }), r.items.push(t);
38
+ let u = s.find((K) => K.id === e);
39
+ u || s.push(u = { id: e, title: e, items: [] }), u.items.push(t);
29
40
  }
30
- return a;
31
- }, [s]), P = h(() => new Map(s.map((a) => [a.id, a])), [s]);
32
- return /* @__PURE__ */ o(Q, { isOpen: u, onOpenChange: p, size: "md", className: "alea-command-overlay", motion: N, surface: v, radius: M, children: /* @__PURE__ */ o(U, { ref: S, style: b, "aria-label": i.commandPalette, hideClose: !0, className: F("alea-command", y), children: ({ close: a }) => /* @__PURE__ */ n(L, { filter: (t, e) => E(t, e), children: [
33
- /* @__PURE__ */ n(g, { "aria-label": i.searchCommands, autoFocus: !0, className: "alea-command-search", children: [
34
- /* @__PURE__ */ o(J, { size: 18, "aria-hidden": "true" }),
35
- /* @__PURE__ */ o(z, { placeholder: m, className: "alea-command-input" }),
36
- /* @__PURE__ */ o(W, { children: i.esc })
41
+ return s;
42
+ }, [o]), I = v(() => new Map(o.map((s) => [s.id, s])), [o]);
43
+ return /* @__PURE__ */ n(U, { isOpen: b, onOpenChange: N, size: "md", className: "alea-command-overlay", motion: d, surface: x, radius: E, children: /* @__PURE__ */ n(W, { ref: M, style: k, "aria-label": r.commandPalette, hideClose: !0, className: j("alea-command", S), children: ({ close: s }) => /* @__PURE__ */ l(D, { filter: (t, e) => R(t, e), children: [
44
+ /* @__PURE__ */ l(F, { "aria-label": r.searchCommands, autoFocus: !0, className: "alea-command-search", children: [
45
+ /* @__PURE__ */ n(Q, { size: 18, "aria-hidden": "true" }),
46
+ /* @__PURE__ */ n(H, { placeholder: h, className: "alea-command-input" }),
47
+ /* @__PURE__ */ n(X, { children: r.esc })
37
48
  ] }),
38
- /* @__PURE__ */ o(R, { items: K, className: "alea-command-list", onAction: (t) => {
39
- const e = P.get(t);
40
- a(), e == null || e.onAction();
41
- }, renderEmptyState: () => /* @__PURE__ */ o("p", { className: "alea-command-empty", children: d }), children: (t) => /* @__PURE__ */ n(H, { id: t.id, className: "alea-option-section", children: [
42
- t.title && /* @__PURE__ */ o(V, { className: "alea-option-header", children: t.title }),
43
- /* @__PURE__ */ o(q, { items: t.items, children: (e) => /* @__PURE__ */ n(B, { id: e.id, textValue: [e.label, ...e.keywords || []].join(" "), className: "alea-option alea-command-item", children: [
44
- e.icon && /* @__PURE__ */ o("span", { className: "alea-option-icon", "aria-hidden": "true", children: e.icon }),
45
- /* @__PURE__ */ n("span", { className: "alea-option-text", children: [
46
- /* @__PURE__ */ o("span", { slot: "label", children: e.label }),
47
- e.description && /* @__PURE__ */ o("span", { className: "alea-option-desc", slot: "description", children: e.description })
49
+ /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ n(O, { items: z, className: "alea-command-list", onAction: (t) => {
50
+ const e = I.get(t);
51
+ s(), e == null || e.onAction();
52
+ }, renderEmptyState: () => /* @__PURE__ */ n("p", { className: "alea-command-empty", children: p }), children: (t) => /* @__PURE__ */ l(V, { id: t.id, className: "alea-option-section", children: [
53
+ t.title && /* @__PURE__ */ n(q, { className: "alea-option-header", children: t.title }),
54
+ /* @__PURE__ */ n(B, { items: t.items, children: (e) => /* @__PURE__ */ l(G, { id: e.id, textValue: [e.label, ...e.keywords || []].join(" "), className: "alea-option alea-command-item", children: [
55
+ e.icon && /* @__PURE__ */ n("span", { className: "alea-option-icon", "aria-hidden": "true", children: e.icon }),
56
+ /* @__PURE__ */ l("span", { className: "alea-option-text", children: [
57
+ /* @__PURE__ */ n("span", { slot: "label", children: e.label }),
58
+ e.description && /* @__PURE__ */ n("span", { className: "alea-option-desc", slot: "description", children: e.description })
48
59
  ] }),
49
- e.shortcut && /* @__PURE__ */ o(G, { className: "alea-menu-shortcut", children: e.shortcut })
60
+ e.shortcut && /* @__PURE__ */ n(J, { className: "alea-menu-shortcut", children: e.shortcut })
50
61
  ] }) })
51
- ] }) })
62
+ ] }) }) })
52
63
  ] }) }) });
53
64
  });
54
65
  export {
@@ -0,0 +1,86 @@
1
+ import { type MotionProp } from '@alea-design/motion';
2
+ export type NotificationTone = 'info' | 'success' | 'warning' | 'danger';
3
+ export interface NotificationAction {
4
+ /** The text of the action: "View invoice". */
5
+ label: string;
6
+ /** Makes the action a link. */
7
+ href?: string;
8
+ /** Called when the action is pressed (with or without href). */
9
+ onPress?: () => void;
10
+ }
11
+ export interface NotificationItem {
12
+ /** Stable id of the notification. */
13
+ id: string;
14
+ title: string;
15
+ /** A line of detail under the title. */
16
+ description?: string;
17
+ /** When it happened; shown as a relative time ("5 minutes ago"). */
18
+ time: Date;
19
+ /** info, success, warning or danger: sets the icon and the color. */
20
+ tone: NotificationTone;
21
+ /** Read notifications are quieter and do not count in the badge. */
22
+ read: boolean;
23
+ /** One action that goes somewhere or does something. */
24
+ action?: NotificationAction;
25
+ }
26
+ /** Every text the component writes. All are optional; the defaults follow the locale (English and Spanish ship with the kit). */
27
+ export interface NotificationLabels {
28
+ /** The panel's title. */
29
+ title: string;
30
+ /** The bell's name; gets the unread count. Default "Notifications, 3 unread". */
31
+ bell: (unread: number) => string;
32
+ /** The button that marks one notification as read. */
33
+ markRead: string;
34
+ /** The button that marks all of them as read. */
35
+ markAllRead: string;
36
+ /** The button that dismisses one notification. */
37
+ dismiss: string;
38
+ /** The empty state's title. */
39
+ emptyTitle: string;
40
+ /** The empty state's line under the title. */
41
+ emptyDescription: string;
42
+ /** What screen readers hear when a new notification arrives. */
43
+ newNotification: (title: string) => string;
44
+ /** Said before the title of an unread notification, for screen readers. */
45
+ unread: string;
46
+ /** Said before the title, for screen readers, per tone. */
47
+ tones: Record<NotificationTone, string>;
48
+ }
49
+ export interface NotificationCenterProps {
50
+ /** The notifications, newest first. The component never changes them: it reports every change. */
51
+ items: NotificationItem[];
52
+ /** Called with the next list after any change (read, read all, dismiss). */
53
+ onChange?: (items: NotificationItem[]) => void;
54
+ /** Called with the notification that was marked as read. */
55
+ onMarkRead?: (item: NotificationItem) => void;
56
+ /** Called when "mark all as read" is pressed, with the notifications that were unread. */
57
+ onMarkAllRead?: (items: NotificationItem[]) => void;
58
+ /** Called with the notification that was dismissed. */
59
+ onDismiss?: (item: NotificationItem) => void;
60
+ /** Called when a notification's action is pressed. */
61
+ onAction?: (item: NotificationItem) => void;
62
+ /** Text overrides: the bell, the buttons, the empty state and the announcements. */
63
+ labels?: Partial<NotificationLabels>;
64
+ /** popover (a panel under the bell), drawer (a sheet from the bottom) or auto: a drawer on small screens. Default auto. */
65
+ presentation?: 'auto' | 'popover' | 'drawer';
66
+ /** Where the popover opens. Default bottom end. */
67
+ placement?: 'bottom' | 'bottom start' | 'bottom end' | 'top' | 'top start' | 'top end';
68
+ /** Opens or closes the panel (controlled). */
69
+ isOpen?: boolean;
70
+ /** Starts open (uncontrolled). */
71
+ defaultOpen?: boolean;
72
+ /** Called when the panel opens or closes. */
73
+ onOpenChange?: (isOpen: boolean) => void;
74
+ /** The badge shows max+ above this. Default 99. */
75
+ max?: number;
76
+ /** Announces new unread notifications to screen readers. Default true. */
77
+ announce?: boolean;
78
+ /** How the panel enters and leaves: a preset, false for none, or options. */
79
+ motion?: MotionProp;
80
+ className?: string;
81
+ }
82
+ /**
83
+ * A bell with an unread count that opens the list of notifications: read one or all, dismiss, go to the action. A panel under the bell, or a drawer on small screens.
84
+ * You own the list; every change comes back through onChange. Arrow keys move between notifications, Escape closes and focus returns to the bell, and new unread notifications are announced.
85
+ */
86
+ export declare function NotificationCenter({ items, onChange, onMarkRead, onMarkAllRead, onDismiss, onAction, labels, presentation, placement, isOpen, defaultOpen, onOpenChange, max, announce, motion, className, }: NotificationCenterProps): import("react").JSX.Element;
@@ -0,0 +1,185 @@
1
+ "use client";
2
+ import { jsxs as c, jsx as a, Fragment as ue } from "react/jsx-runtime";
3
+ import { useId as fe, useState as N, useRef as S, useEffect as V, useMemo as he, useLayoutEffect as me, useCallback as pe, useSyncExternalStore as we } from "react";
4
+ import { useLocale as Ne, DialogTrigger as xe, Dialog as ye, Heading as ve } from "react-aria-components";
5
+ import { Bell as U, CheckCheck as ge, X, CircleAlert as Se, TriangleAlert as be, CircleCheck as Ie, Info as Te, Check as Ee } from "lucide-react";
6
+ import { Presence as ke, Reveal as ze } from "@alea-design/motion";
7
+ import { cx as De } from "../../utils/cx.js";
8
+ import { useStrings as Le } from "../../i18n/strings.js";
9
+ import { IconButton as b, Button as _ } from "../button/Button.js";
10
+ import { Badge as J } from "../display/Display.js";
11
+ import { EmptyState as Pe } from "../data/Data.js";
12
+ import { Popover as $e } from "../overlay/Overlay.js";
13
+ import { Drawer as Me } from "../overlay/Drawer.js";
14
+ const Ae = { info: Te, success: Ie, warning: be, danger: Se }, Q = "(max-width: 639.98px)";
15
+ function Fe() {
16
+ const r = pe((d) => {
17
+ var s;
18
+ if (typeof window > "u" || !window.matchMedia) return () => {
19
+ };
20
+ const o = window.matchMedia(Q);
21
+ return (s = o.addEventListener) == null || s.call(o, "change", d), () => {
22
+ var l;
23
+ return (l = o.removeEventListener) == null ? void 0 : l.call(o, "change", d);
24
+ };
25
+ }, []);
26
+ return we(r, () => typeof window < "u" && window.matchMedia ? window.matchMedia(Q).matches : !1, () => !1);
27
+ }
28
+ function Be(r, d = 3e4) {
29
+ const [o, s] = N(() => Date.now());
30
+ return V(() => {
31
+ if (!r) return;
32
+ s(Date.now());
33
+ const l = window.setInterval(() => s(Date.now()), d);
34
+ return () => window.clearInterval(l);
35
+ }, [r, d]), o;
36
+ }
37
+ function Oe(r, d, o) {
38
+ const s = Math.round((r.getTime() - d) / 1e3), l = Math.abs(s), h = new Intl.RelativeTimeFormat(o, { numeric: "auto" });
39
+ return l < 45 ? h.format(0, "second") : l < 3600 ? h.format(Math.round(s / 60), "minute") : l < 86400 ? h.format(Math.round(s / 3600), "hour") : h.format(Math.round(s / 86400), "day");
40
+ }
41
+ function We({
42
+ items: r,
43
+ onChange: d,
44
+ onMarkRead: o,
45
+ onMarkAllRead: s,
46
+ onDismiss: l,
47
+ onAction: h,
48
+ labels: x,
49
+ presentation: k = "auto",
50
+ placement: W = "bottom end",
51
+ isOpen: z,
52
+ defaultOpen: Y,
53
+ onOpenChange: I,
54
+ max: y = 99,
55
+ announce: Z = !0,
56
+ motion: D,
57
+ className: q
58
+ }) {
59
+ var K;
60
+ const u = Le(), { locale: L } = Ne(), f = {
61
+ title: u.notifications,
62
+ bell: u.notificationBell,
63
+ markRead: u.markRead,
64
+ markAllRead: u.markAllRead,
65
+ dismiss: u.dismissNotification,
66
+ emptyTitle: u.notificationsEmpty,
67
+ emptyDescription: u.notificationsEmptyHint,
68
+ newNotification: u.newNotification,
69
+ unread: u.unreadNotification,
70
+ ...x,
71
+ tones: { ...u.notificationTones, ...x == null ? void 0 : x.tones }
72
+ }, P = fe(), ee = Fe(), $ = k === "drawer" || k === "auto" && ee, [te, ne] = N(Y ?? !1), M = z ?? te, ae = (t) => {
73
+ z === void 0 && ne(t), I == null || I(t);
74
+ }, re = Be(M), m = r.filter((t) => !t.read).length, A = S(null), [ie, F] = N({ text: "", n: 0 });
75
+ V(() => {
76
+ const t = A.current;
77
+ if (A.current = new Set(r.map((i) => i.id)), !t || !Z) return;
78
+ const e = r.filter((i) => !i.read && !t.has(i.id));
79
+ if (!e.length) return;
80
+ F((i) => ({ text: e.map((p) => f.newNotification(p.title)).join(". "), n: i.n + 1 }));
81
+ const n = window.setTimeout(() => F((i) => ({ ...i, text: "" })), 6e3);
82
+ return () => window.clearTimeout(n);
83
+ }, [r]);
84
+ const [B, O] = N([]), C = he(() => {
85
+ const t = r.map((n) => ({ item: n, leaving: !1 })), e = new Set(r.map((n) => n.id));
86
+ for (const n of B) e.has(n.item.id) || t.splice(Math.min(n.index, t.length), 0, { item: n.item, leaving: !0 });
87
+ return t;
88
+ }, [r, B]), T = S(null), H = S(null), [R, v] = N(null), oe = r.some((t) => t.id === R) ? R : ((K = r[0]) == null ? void 0 : K.id) ?? null, g = S(null);
89
+ me(() => {
90
+ var n;
91
+ const t = g.current;
92
+ if (!t) return;
93
+ const e = t === "empty" ? H.current : (n = T.current) == null ? void 0 : n.querySelector(`[data-nid="${CSS.escape(t)}"]`);
94
+ e && (g.current = null, e.focus());
95
+ });
96
+ const E = (t) => d == null ? void 0 : d(t), j = (t) => {
97
+ g.current = t.id, v(t.id), o == null || o(t), E(r.map((e) => e.id === t.id ? { ...e, read: !0 } : e));
98
+ }, se = () => {
99
+ const t = r.filter((e) => !e.read);
100
+ t.length && (s == null || s(t), E(r.map((e) => e.read ? e : { ...e, read: !0 })));
101
+ }, le = (t) => {
102
+ const e = r.findIndex((i) => i.id === t.id), n = r[e + 1] ?? r[e - 1];
103
+ g.current = n ? n.id : "empty", n && v(n.id), O((i) => [...i, { item: t, index: e }]), window.setTimeout(() => O((i) => i.filter((p) => p.item.id !== t.id)), 400), l == null || l(t), E(r.filter((i) => i.id !== t.id));
104
+ }, ce = (t) => {
105
+ var e, n;
106
+ (n = (e = t.action) == null ? void 0 : e.onPress) == null || n.call(e), h == null || h(t), t.read || j(t);
107
+ }, de = (t) => {
108
+ var p;
109
+ if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(t.key)) return;
110
+ const e = [...((p = T.current) == null ? void 0 : p.querySelectorAll("[data-nid]:not([data-leaving])")) ?? []];
111
+ if (!e.length) return;
112
+ const n = e.findIndex((w) => w.contains(t.target)), i = t.key === "Home" ? 0 : t.key === "End" ? e.length - 1 : t.key === "ArrowDown" ? Math.min(n + 1, e.length - 1) : Math.max(n - 1, 0);
113
+ t.preventDefault(), v(e[i].dataset.nid ?? null), e[i].focus();
114
+ }, G = /* @__PURE__ */ a(ye, { className: "alea-notifs", "aria-labelledby": P, children: ({ close: t }) => /* @__PURE__ */ c(ue, { children: [
115
+ /* @__PURE__ */ c("div", { className: "alea-notifs-head", children: [
116
+ /* @__PURE__ */ c(ve, { slot: "title", id: P, className: "alea-notifs-title", children: [
117
+ f.title,
118
+ m > 0 && /* @__PURE__ */ a(J, { tone: "accent", size: "sm", "aria-hidden": "true", children: m > y ? `${y}+` : m })
119
+ ] }),
120
+ /* @__PURE__ */ a(_, { variant: "text", size: "xs", iconStart: /* @__PURE__ */ a(ge, {}), isDisabled: m === 0, onPress: se, children: f.markAllRead }),
121
+ $ && /* @__PURE__ */ a(b, { "aria-label": u.close, size: "xs", onPress: t, children: /* @__PURE__ */ a(X, {}) })
122
+ ] }),
123
+ C.length === 0 ? /* @__PURE__ */ a("div", { className: "alea-notifs-empty", ref: H, tabIndex: -1, children: /* @__PURE__ */ a(Pe, { size: "sm", title: f.emptyTitle, description: f.emptyDescription, icon: /* @__PURE__ */ a(U, {}) }) }) : /* @__PURE__ */ a("ul", { className: "alea-notifs-list", ref: T, onKeyDown: de, children: C.map(({ item: e, leaving: n }, i) => {
124
+ const p = Ae[e.tone], w = !n && e.id === oe;
125
+ return /* @__PURE__ */ a(ke, { show: !n, exitClassName: "alea-notif-out", children: /* @__PURE__ */ a(
126
+ "li",
127
+ {
128
+ className: "alea-notif",
129
+ "data-nid": e.id,
130
+ "data-tone": e.tone,
131
+ "data-unread": e.read ? void 0 : !0,
132
+ "data-leaving": n || void 0,
133
+ tabIndex: w ? 0 : -1,
134
+ onFocus: () => !n && v(e.id),
135
+ children: /* @__PURE__ */ c(ze, { className: "alea-notif-inner", motion: "rise", delay: Math.min(i, 6) * 30, children: [
136
+ /* @__PURE__ */ a("span", { className: "alea-notif-icon", "aria-hidden": "true", children: /* @__PURE__ */ a(p, {}) }),
137
+ /* @__PURE__ */ c("div", { className: "alea-notif-body", children: [
138
+ /* @__PURE__ */ c("p", { className: "alea-notif-title", children: [
139
+ /* @__PURE__ */ c("span", { className: "alea-visually-hidden", children: [
140
+ e.read ? "" : `${f.unread}. `,
141
+ f.tones[e.tone],
142
+ ": "
143
+ ] }),
144
+ e.title
145
+ ] }),
146
+ e.description && /* @__PURE__ */ a("p", { className: "alea-notif-text", children: e.description }),
147
+ /* @__PURE__ */ c("p", { className: "alea-notif-meta", children: [
148
+ /* @__PURE__ */ a("time", { dateTime: e.time.toISOString(), title: e.time.toLocaleString(L), children: Oe(e.time, re, L) }),
149
+ e.action && /* @__PURE__ */ a(
150
+ _,
151
+ {
152
+ variant: "link",
153
+ size: "xs",
154
+ href: e.action.href,
155
+ excludeFromTabOrder: !w,
156
+ className: "alea-notif-action",
157
+ onPress: () => ce(e),
158
+ children: e.action.label
159
+ }
160
+ )
161
+ ] })
162
+ ] }),
163
+ /* @__PURE__ */ c("div", { className: "alea-notif-tools", children: [
164
+ !e.read && /* @__PURE__ */ a(b, { "aria-label": `${f.markRead}: ${e.title}`, size: "xs", excludeFromTabOrder: !w, onPress: () => j(e), children: /* @__PURE__ */ a(Ee, {}) }),
165
+ /* @__PURE__ */ a(b, { "aria-label": `${f.dismiss}: ${e.title}`, size: "xs", excludeFromTabOrder: !w, onPress: () => le(e), children: /* @__PURE__ */ a(X, {}) })
166
+ ] })
167
+ ] })
168
+ }
169
+ ) }, e.id);
170
+ }) })
171
+ ] }) });
172
+ return /* @__PURE__ */ c("span", { className: De("alea-notifs-root", q), children: [
173
+ /* @__PURE__ */ c(xe, { isOpen: M, onOpenChange: ae, children: [
174
+ /* @__PURE__ */ c("span", { className: "alea-notifs-bell", children: [
175
+ /* @__PURE__ */ a(b, { "aria-label": f.bell(m), variant: "ghost", children: /* @__PURE__ */ a(U, {}) }),
176
+ m > 0 && /* @__PURE__ */ a(J, { className: "alea-notifs-count", tone: "danger", appearance: "solid", size: "sm", "aria-hidden": "true", children: m > y ? `${y}+` : m })
177
+ ] }),
178
+ $ ? /* @__PURE__ */ a(Me, { placement: "bottom", size: 640, motion: D, className: "alea-notifs-drawer", children: G }) : /* @__PURE__ */ a($e, { placement: W, size: "lg", motion: D, className: "alea-notifs-popover", children: G })
179
+ ] }),
180
+ /* @__PURE__ */ a("span", { className: "alea-visually-hidden", role: "status", "aria-live": "polite", "aria-atomic": "true", children: ie.text })
181
+ ] });
182
+ }
183
+ export {
184
+ We as NotificationCenter
185
+ };