@alfadocs/ui-kit 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/_chunks/{combobox-DCNXqbC7.js → combobox-BLWruOxK.js} +74 -75
  2. package/dist/_chunks/{freemium-paywall-CnvceDav.js → freemium-paywall-CrVefV0M.js} +2 -2
  3. package/dist/_chunks/{link-8QmFjIz2.js → link-BcYW1eNM.js} +48 -32
  4. package/dist/_chunks/{message-card-ChCX9Iv6.js → message-card-DjvsB_3U.js} +12 -12
  5. package/dist/_chunks/{message-tray-n8q9ITXI.js → message-tray-BbnAzlLH.js} +23 -23
  6. package/dist/_chunks/{notification-card-hBlPN1-c.js → notification-card-uTPEvAQS.js} +21 -21
  7. package/dist/_chunks/{notification-tray-C5cnXbl9.js → notification-tray-PGtMqXbP.js} +56 -56
  8. package/dist/_chunks/{payment-form-C3vT_npe.js → payment-form-B_BdHwjb.js} +21 -21
  9. package/dist/_chunks/transaction-chip-DE6DITun.js +196 -0
  10. package/dist/agent-catalog.json +15 -1
  11. package/dist/components/combobox/index.js +1 -1
  12. package/dist/components/freemium-paywall/index.js +1 -1
  13. package/dist/components/index.d.ts +1 -0
  14. package/dist/components/link/index.js +1 -1
  15. package/dist/components/link/link.d.ts +1 -0
  16. package/dist/components/message-card/index.js +1 -1
  17. package/dist/components/message-tray/index.js +1 -1
  18. package/dist/components/notification-card/index.js +1 -1
  19. package/dist/components/notification-tray/index.js +1 -1
  20. package/dist/components/payment-form/index.js +1 -1
  21. package/dist/components/transaction-chip/index.d.ts +3 -0
  22. package/dist/components/transaction-chip/index.js +5 -0
  23. package/dist/components/transaction-chip/transaction-chip.d.ts +30 -0
  24. package/dist/i18n/config.js +36 -0
  25. package/dist/i18n/resources.d.ts +36 -0
  26. package/dist/index.js +33 -31
  27. package/dist/locales/de.json +12 -0
  28. package/dist/locales/en.json +12 -0
  29. package/dist/locales/it.json +12 -0
  30. package/dist/tokens.css +1 -1
  31. package/package.json +1 -1
@@ -6,8 +6,8 @@ import { useTranslation as W } from "react-i18next";
6
6
  import { I as ue } from "./icon-button-C4CGcYuz.js";
7
7
  import { B as _ } from "./button-DD_0Xdmr.js";
8
8
  import { S as U } from "./separator-CYU_bGFn.js";
9
- import { S as g } from "./skeleton-CZbwyJAA.js";
10
- import { M as pe } from "./message-card-ChCX9Iv6.js";
9
+ import { S as f } from "./skeleton-CZbwyJAA.js";
10
+ import { M as pe } from "./message-card-DjvsB_3U.js";
11
11
  import { u as ge } from "./registry-C9nwlNyL.js";
12
12
  import { M as Y } from "./mail-C8irm52s.js";
13
13
  const fe = {
@@ -162,12 +162,12 @@ function R() {
162
162
  "aria-hidden": "true",
163
163
  className: "ds:flex ds:items-start ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)]",
164
164
  children: [
165
- /* @__PURE__ */ s(g, { variant: "circular", size: "sm" }),
165
+ /* @__PURE__ */ s(f, { variant: "circular", size: "sm" }),
166
166
  /* @__PURE__ */ c("div", { className: "ds:flex-1 ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
167
- /* @__PURE__ */ s(g, { variant: "text", size: "md", width: "60%" }),
168
- /* @__PURE__ */ s(g, { variant: "text", size: "sm", width: "80%" }),
169
- /* @__PURE__ */ s(g, { variant: "text", size: "sm", width: "95%" }),
170
- /* @__PURE__ */ s(g, { variant: "text", size: "sm", width: "30%" })
167
+ /* @__PURE__ */ s(f, { variant: "text", size: "md", width: "60%" }),
168
+ /* @__PURE__ */ s(f, { variant: "text", size: "sm", width: "80%" }),
169
+ /* @__PURE__ */ s(f, { variant: "text", size: "sm", width: "95%" }),
170
+ /* @__PURE__ */ s(f, { variant: "text", size: "sm", width: "30%" })
171
171
  ] })
172
172
  ]
173
173
  }
@@ -202,10 +202,10 @@ const Te = oe(
202
202
  items: t,
203
203
  unreadCount: T,
204
204
  open: k,
205
- onOpenChange: f,
205
+ onOpenChange: v,
206
206
  onItemClick: u,
207
207
  onDismiss: p,
208
- onMarkRead: v,
208
+ onMarkRead: y,
209
209
  onMarkAllRead: C,
210
210
  loading: G = !1,
211
211
  maxVisible: J,
@@ -218,12 +218,12 @@ const Te = oe(
218
218
  ...D
219
219
  }, ee) => {
220
220
  var A;
221
- const { t: d } = W(), N = k !== void 0, [se, ae] = q(!1), z = N ? k : se, y = F(
221
+ const { t: d } = W(), N = k !== void 0, [se, ae] = q(!1), z = N ? k : se, h = F(
222
222
  (e) => {
223
- N || ae(e), f == null || f(e);
223
+ N || ae(e), v == null || v(e);
224
224
  },
225
- [N, f]
226
- ), [h, I] = q(
225
+ [N, v]
226
+ ), [g, I] = q(
227
227
  () => t.map((e) => ({ item: e, leaving: !1 }))
228
228
  ), K = F(() => {
229
229
  if (typeof window > "u") return 200;
@@ -246,12 +246,12 @@ const Te = oe(
246
246
  return o;
247
247
  });
248
248
  }, [t]), H(() => {
249
- if (!h.some((n) => n.leaving)) return;
249
+ if (!g.some((n) => n.leaving)) return;
250
250
  const e = K(), r = setTimeout(() => {
251
251
  I((n) => n.filter((o) => !o.leaving));
252
252
  }, e);
253
253
  return () => clearTimeout(r);
254
- }, [h, K]);
254
+ }, [g, K]);
255
255
  const M = m(null), O = m((A = t[0]) == null ? void 0 : A.id);
256
256
  H(() => {
257
257
  var n;
@@ -279,8 +279,8 @@ const Te = oe(
279
279
  P.current = z;
280
280
  const ie = le(
281
281
  () => ({
282
- open: () => y(!0),
283
- close: () => y(!1),
282
+ open: () => h(!0),
283
+ close: () => h(!1),
284
284
  isOpen: () => P.current,
285
285
  getItems: () => l.current.map((e) => ({ id: e.id, read: !!e.read })),
286
286
  getUnreadCount: () => V.current ?? l.current.filter((e) => !e.read).length,
@@ -290,14 +290,14 @@ const Te = oe(
290
290
  },
291
291
  markRead: (e) => {
292
292
  const r = l.current.find((n) => n.id === e);
293
- r && (v == null || v(r));
293
+ r && (y == null || y(r));
294
294
  },
295
295
  dismiss: (e) => {
296
296
  const r = l.current.find((n) => n.id === e);
297
297
  r && (p == null || p(r));
298
298
  }
299
299
  }),
300
- [y, u, v, p]
300
+ [h, u, y, p]
301
301
  ), B = m(null);
302
302
  return me(ee, () => B.current, []), ge(fe, ie, a), /* @__PURE__ */ s(
303
303
  "div",
@@ -307,7 +307,7 @@ const Te = oe(
307
307
  "data-component-id": a,
308
308
  className: [ve({ size: w }), $].filter(Boolean).join(" "),
309
309
  ...D,
310
- children: /* @__PURE__ */ c(b.Root, { open: z, onOpenChange: y, children: [
310
+ children: /* @__PURE__ */ c(b.Root, { open: z, onOpenChange: h, children: [
311
311
  /* @__PURE__ */ s(b.Trigger, { asChild: !0, children: /* @__PURE__ */ s(
312
312
  ue,
313
313
  {
@@ -364,14 +364,14 @@ const Te = oe(
364
364
  /* @__PURE__ */ s(
365
365
  "div",
366
366
  {
367
- role: "list",
367
+ role: g.length > 0 ? "list" : void 0,
368
368
  "data-max-visible": J,
369
369
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:overflow-y-auto ds:pt-[var(--spacing-xs)] ds:flex-1 ds:sm:flex-none ds:sm:[max-block-size:var(--message-tray-max-block-size,26rem)]",
370
370
  children: G ? /* @__PURE__ */ c(L, { children: [
371
371
  /* @__PURE__ */ s(R, {}),
372
372
  /* @__PURE__ */ s(R, {}),
373
373
  /* @__PURE__ */ s(R, {})
374
- ] }) : h.length === 0 ? /* @__PURE__ */ s(be, {}) : h.map(({ item: e, leaving: r }) => /* @__PURE__ */ s(
374
+ ] }) : g.length === 0 ? /* @__PURE__ */ s(be, {}) : g.map(({ item: e, leaving: r }) => /* @__PURE__ */ s(
375
375
  pe,
376
376
  {
377
377
  item: e,
@@ -411,4 +411,4 @@ export {
411
411
  Te as M,
412
412
  fe as m
413
413
  };
414
- //# sourceMappingURL=message-tray-n8q9ITXI.js.map
414
+ //# sourceMappingURL=message-tray-BbnAzlLH.js.map
@@ -1,12 +1,12 @@
1
1
  import { jsx as a, jsxs as n } from "react/jsx-runtime";
2
2
  import { forwardRef as M, useMemo as P, useState as R, useRef as B, useCallback as L } from "react";
3
- import { c as U } from "./index-D2ZczOXr.js";
4
- import { useTranslation as W } from "react-i18next";
5
- import { I as E } from "./icon-button-C4CGcYuz.js";
3
+ import { c as D } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as U } from "react-i18next";
5
+ import { I as W } from "./icon-button-C4CGcYuz.js";
6
6
  import { B as N } from "./button-DD_0Xdmr.js";
7
- import { T as H } from "./timestamp-BV2lC-wV.js";
8
- import { X } from "./x-CCcI3eJp.js";
9
- const q = U(
7
+ import { T as E } from "./timestamp-BV2lC-wV.js";
8
+ import { X as H } from "./x-CCcI3eJp.js";
9
+ const X = D(
10
10
  [
11
11
  "ds:relative ds:flex ds:gap-[var(--spacing-sm)]",
12
12
  "ds:rounded-[var(--radius-sm)]",
@@ -73,10 +73,10 @@ const q = U(
73
73
  "ds:focus-visible:after:outline-offset-[length:var(--focus-ring-offset)]",
74
74
  "ds:forced-colors:focus-visible:after:outline-[CanvasText]"
75
75
  ].join(" ");
76
- function G(e) {
76
+ function q(e) {
77
77
  return /^(https?:\/\/(?!\/)|\/(?!\/)|#)/.test(e);
78
78
  }
79
- const J = M(
79
+ const G = M(
80
80
  ({
81
81
  item: e,
82
82
  variant: r = "compact",
@@ -89,7 +89,7 @@ const J = M(
89
89
  className: z,
90
90
  ...T
91
91
  }, K) => {
92
- const { t: u, i18n: v } = W(), S = P(() => {
92
+ const { t: u, i18n: v } = U(), S = P(() => {
93
93
  const s = new Date(e.createdAt);
94
94
  return Number.isNaN(s.getTime()) ? "" : new Intl.DateTimeFormat(v.language, {
95
95
  dateStyle: "medium",
@@ -112,7 +112,7 @@ const J = M(
112
112
  time: S,
113
113
  unreadSuffix: I,
114
114
  defaultValue: "{{title}}, {{time}}{{unreadSuffix}}"
115
- }), p = !!e.url && G(e.url), i = /* @__PURE__ */ a(
115
+ }), p = !!e.url && q(e.url), i = /* @__PURE__ */ a(
116
116
  "span",
117
117
  {
118
118
  className: [
@@ -130,7 +130,7 @@ const J = M(
130
130
  "aria-label": x,
131
131
  className: C + " ds:contents",
132
132
  onClick: (s) => {
133
- s.defaultPrevented || s.metaKey || s.ctrlKey || s.shiftKey || t(e);
133
+ s.defaultPrevented || s.metaKey || s.ctrlKey || s.shiftKey || (s.preventDefault(), t(e));
134
134
  },
135
135
  children: i
136
136
  }
@@ -149,7 +149,7 @@ const J = M(
149
149
  href: e.url,
150
150
  className: "ds:text-[color:var(--foreground)] ds:no-underline ds:hover:underline ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
151
151
  onClick: (s) => {
152
- s.defaultPrevented || s.metaKey || s.ctrlKey || s.shiftKey || t(e);
152
+ s.defaultPrevented || s.metaKey || s.ctrlKey || s.shiftKey || (s.preventDefault(), t(e));
153
153
  },
154
154
  children: i
155
155
  }
@@ -163,7 +163,7 @@ const J = M(
163
163
  "data-read": e.read ? "true" : "false",
164
164
  "data-leaving": g ? "true" : void 0,
165
165
  "aria-hidden": g || void 0,
166
- className: q({ variant: r, size: k, state: F, className: z }),
166
+ className: X({ variant: r, size: k, state: F, className: z }),
167
167
  ...T,
168
168
  children: [
169
169
  e.icon ? /* @__PURE__ */ a(
@@ -191,7 +191,7 @@ const J = M(
191
191
  ] }),
192
192
  e.description ? /* @__PURE__ */ a("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)] ds:[overflow:hidden] ds:[display:-webkit-box] ds:[-webkit-box-orient:vertical] ds:[-webkit-line-clamp:2] ds:break-words", children: e.description }) : null,
193
193
  /* @__PURE__ */ a(
194
- H,
194
+ E,
195
195
  {
196
196
  value: e.createdAt,
197
197
  shape: "chip",
@@ -212,7 +212,7 @@ const J = M(
212
212
  {
213
213
  href: e.url,
214
214
  onClick: (s) => {
215
- s.defaultPrevented || s.metaKey || s.ctrlKey || s.shiftKey || t == null || t(e);
215
+ s.defaultPrevented || s.metaKey || s.ctrlKey || s.shiftKey || (s.preventDefault(), t == null || t(e));
216
216
  },
217
217
  children: l
218
218
  }
@@ -232,9 +232,9 @@ const J = M(
232
232
  ] }) : null
233
233
  ] }),
234
234
  r === "compact" && d ? /* @__PURE__ */ a("span", { className: "ds:relative ds:z-[1] ds:opacity-0 ds:group-hover:opacity-100 ds:group-focus-within:opacity-100 ds:transition-opacity ds:motion-reduce:transition-none", children: /* @__PURE__ */ a(
235
- E,
235
+ W,
236
236
  {
237
- icon: /* @__PURE__ */ a(X, {}),
237
+ icon: /* @__PURE__ */ a(H, {}),
238
238
  intent: "ghost",
239
239
  size: "sm",
240
240
  "aria-label": u(
@@ -249,9 +249,9 @@ const J = M(
249
249
  );
250
250
  }
251
251
  );
252
- J.displayName = "NotificationCard";
252
+ G.displayName = "NotificationCard";
253
253
  export {
254
- J as N,
255
- G as i
254
+ G as N,
255
+ q as i
256
256
  };
257
- //# sourceMappingURL=notification-card-hBlPN1-c.js.map
257
+ //# sourceMappingURL=notification-card-uTPEvAQS.js.map
@@ -1,13 +1,13 @@
1
- import { jsx as t, jsxs as c, Fragment as E } from "react/jsx-runtime";
2
- import { forwardRef as de, useState as q, useCallback as F, useLayoutEffect as ce, useEffect as H, useRef as f, useMemo as le, useImperativeHandle as fe } from "react";
1
+ import { jsx as t, jsxs as c, Fragment as q } from "react/jsx-runtime";
2
+ import { forwardRef as de, useState as F, useCallback as H, useLayoutEffect as ce, useEffect as U, useRef as f, useMemo as le, useImperativeHandle as fe } from "react";
3
3
  import * as x from "@radix-ui/react-popover";
4
4
  import { c as C } from "./index-D2ZczOXr.js";
5
- import { useTranslation as Y } from "react-i18next";
5
+ import { useTranslation as G } from "react-i18next";
6
6
  import { I as ue } from "./icon-button-C4CGcYuz.js";
7
- import { B as U } from "./button-DD_0Xdmr.js";
8
- import { S as W } from "./separator-CYU_bGFn.js";
7
+ import { B as W } from "./button-DD_0Xdmr.js";
8
+ import { S as Y } from "./separator-CYU_bGFn.js";
9
9
  import { S as N } from "./skeleton-CZbwyJAA.js";
10
- import { N as pe } from "./notification-card-hBlPN1-c.js";
10
+ import { N as pe } from "./notification-card-uTPEvAQS.js";
11
11
  import { u as me } from "./registry-C9nwlNyL.js";
12
12
  import { c as ge } from "./createLucideIcon-CrFbzy84.js";
13
13
  /**
@@ -25,7 +25,7 @@ const ve = [
25
25
  key: "11g9vi"
26
26
  }
27
27
  ]
28
- ], G = ge("bell", ve), ye = {
28
+ ], J = ge("bell", ve), ye = {
29
29
  id: "notification-tray",
30
30
  capabilities: ["open", "close", "select_single", "dismiss"],
31
31
  state: {
@@ -199,7 +199,7 @@ function R() {
199
199
  );
200
200
  }
201
201
  function Te() {
202
- const { t: i } = Y();
202
+ const { t: i } = G();
203
203
  return /* @__PURE__ */ c(
204
204
  "div",
205
205
  {
@@ -212,7 +212,7 @@ function Te() {
212
212
  {
213
213
  "aria-hidden": "true",
214
214
  className: "ds:inline-flex ds:items-center ds:justify-center ds:size-10 ds:rounded-[var(--radius-full)] ds:bg-[color:var(--muted)] ds:text-[color:var(--muted-foreground)] ds:[&>svg]:size-5",
215
- children: /* @__PURE__ */ t(G, {})
215
+ children: /* @__PURE__ */ t(J, {})
216
216
  }
217
217
  ),
218
218
  /* @__PURE__ */ t("p", { className: "type-title-item ds:text-[color:var(--foreground)]", children: i("ui.notificationTray.noNotifications", "No notifications") }),
@@ -230,14 +230,14 @@ const we = de(
230
230
  items: a,
231
231
  unseenCount: b,
232
232
  open: S,
233
- onOpenChange: m,
233
+ onOpenChange: g,
234
234
  onItemClick: u,
235
235
  onDismiss: p,
236
- onMarkRead: g,
236
+ onMarkRead: v,
237
237
  onMarkAllRead: I,
238
- loading: J = !1,
238
+ loading: j = !1,
239
239
  maxVisible: M,
240
- viewAllLabel: j,
240
+ viewAllLabel: K,
241
241
  onViewAll: Q,
242
242
  align: X = "end",
243
243
  side: Z = "bottom",
@@ -245,15 +245,15 @@ const we = de(
245
245
  className: $,
246
246
  ...D
247
247
  }, ee) => {
248
- var L;
249
- const { t: r } = Y(), w = S !== void 0, [te, ie] = q(!1), z = w ? S : te, v = F(
248
+ var _;
249
+ const { t: r } = G(), w = S !== void 0, [te, ie] = F(!1), z = w ? S : te, y = H(
250
250
  (e) => {
251
- w || ie(e), m == null || m(e);
251
+ w || ie(e), g == null || g(e);
252
252
  },
253
- [w, m]
254
- ), [y, K] = q(
253
+ [w, g]
254
+ ), [m, O] = F(
255
255
  () => a.map((e) => ({ item: e, leaving: !1 }))
256
- ), O = F(() => {
256
+ ), V = H(() => {
257
257
  if (typeof window > "u") return 200;
258
258
  const e = window.getComputedStyle(document.documentElement).getPropertyValue("--animation-duration");
259
259
  if (!e) return 200;
@@ -261,11 +261,11 @@ const we = de(
261
261
  return Number.isFinite(s) ? n.endsWith("ms") ? s : s * 1e3 : 200;
262
262
  }, []);
263
263
  ce(() => {
264
- K((e) => {
264
+ O((e) => {
265
265
  const n = new Set(a.map((o) => o.id)), s = new Set(e.map((o) => o.item.id)), d = e.map((o) => {
266
266
  if (n.has(o.item.id)) {
267
- const _ = a.find((re) => re.id === o.item.id);
268
- return _ ? { item: _, leaving: !1 } : { ...o, leaving: !0 };
267
+ const E = a.find((re) => re.id === o.item.id);
268
+ return E ? { item: E, leaving: !1 } : { ...o, leaving: !0 };
269
269
  }
270
270
  return { ...o, leaving: !0 };
271
271
  });
@@ -273,17 +273,17 @@ const we = de(
273
273
  s.has(o.id) || d.push({ item: o, leaving: !1 });
274
274
  return d;
275
275
  });
276
- }, [a]), H(() => {
277
- if (!y.some((s) => s.leaving)) return;
278
- const e = O(), n = setTimeout(() => {
279
- K((s) => s.filter((d) => !d.leaving));
276
+ }, [a]), U(() => {
277
+ if (!m.some((s) => s.leaving)) return;
278
+ const e = V(), n = setTimeout(() => {
279
+ O((s) => s.filter((d) => !d.leaving));
280
280
  }, e);
281
281
  return () => clearTimeout(n);
282
- }, [y, O]);
283
- const k = f(null), V = f((L = a[0]) == null ? void 0 : L.id);
284
- H(() => {
282
+ }, [m, V]);
283
+ const k = f(null), A = f((_ = a[0]) == null ? void 0 : _.id);
284
+ U(() => {
285
285
  var s;
286
- const e = (s = a[0]) == null ? void 0 : s.id, n = V.current;
286
+ const e = (s = a[0]) == null ? void 0 : s.id, n = A.current;
287
287
  if (n && e && n !== e && k.current) {
288
288
  const d = a[0];
289
289
  d && !d.read && (k.current.textContent = r(
@@ -294,7 +294,7 @@ const we = de(
294
294
  }
295
295
  ));
296
296
  }
297
- V.current = e;
297
+ A.current = e;
298
298
  }, [a, r]);
299
299
  const h = b ?? 0, ae = h > 0 ? r("ui.notificationTray.triggerLabel", {
300
300
  count: h,
@@ -307,45 +307,45 @@ const we = de(
307
307
  r("ui.notificationTray.badgeCountOverflow", "99+")
308
308
  ), se = xe({ size: T }), l = f(a);
309
309
  l.current = a;
310
- const A = f(b);
311
- A.current = b;
312
- const B = f(z);
313
- B.current = z;
310
+ const B = f(b);
311
+ B.current = b;
312
+ const P = f(z);
313
+ P.current = z;
314
314
  const oe = le(
315
315
  () => ({
316
- open: () => v(!0),
317
- close: () => v(!1),
318
- isOpen: () => B.current,
316
+ open: () => y(!0),
317
+ close: () => y(!1),
318
+ isOpen: () => P.current,
319
319
  getItems: () => l.current.map((e) => ({ id: e.id, read: !!e.read })),
320
- getUnreadCount: () => A.current ?? l.current.filter((e) => !e.read).length,
320
+ getUnreadCount: () => B.current ?? l.current.filter((e) => !e.read).length,
321
321
  selectItem: (e) => {
322
322
  const n = l.current.find((s) => s.id === e);
323
323
  n && (u == null || u(n));
324
324
  },
325
325
  markRead: (e) => {
326
326
  const n = l.current.find((s) => s.id === e);
327
- n && (g == null || g(n));
327
+ n && (v == null || v(n));
328
328
  },
329
329
  dismiss: (e) => {
330
330
  const n = l.current.find((s) => s.id === e);
331
331
  n && (p == null || p(n));
332
332
  }
333
333
  }),
334
- [v, u, g, p]
335
- ), P = f(null);
336
- return fe(ee, () => P.current, []), me(ye, oe, i), /* @__PURE__ */ t(
334
+ [y, u, v, p]
335
+ ), L = f(null);
336
+ return fe(ee, () => L.current, []), me(ye, oe, i), /* @__PURE__ */ t(
337
337
  "div",
338
338
  {
339
- ref: P,
339
+ ref: L,
340
340
  "data-component": "notification-tray",
341
341
  "data-component-id": i,
342
342
  className: [he({ size: T }), $].filter(Boolean).join(" "),
343
343
  ...D,
344
- children: /* @__PURE__ */ c(x.Root, { open: z, onOpenChange: v, children: [
344
+ children: /* @__PURE__ */ c(x.Root, { open: z, onOpenChange: y, children: [
345
345
  /* @__PURE__ */ t(x.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
346
346
  ue,
347
347
  {
348
- icon: /* @__PURE__ */ t(G, {}),
348
+ icon: /* @__PURE__ */ t(J, {}),
349
349
  intent: "outline",
350
350
  size: T === "sm" ? "sm" : "md",
351
351
  "aria-label": ae,
@@ -384,7 +384,7 @@ const we = de(
384
384
  /* @__PURE__ */ c("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:pb-[var(--spacing-xs)]", children: [
385
385
  /* @__PURE__ */ t("h3", { className: "ds:m-0 type-title-card ds:text-[color:var(--foreground)]", children: r("ui.notificationTray.panelTitle", "Notifications") }),
386
386
  I && a.some((e) => !e.read) ? /* @__PURE__ */ t(
387
- U,
387
+ W,
388
388
  {
389
389
  intent: "link",
390
390
  size: "sm",
@@ -394,18 +394,18 @@ const we = de(
394
394
  }
395
395
  ) : null
396
396
  ] }),
397
- /* @__PURE__ */ t(W, {}),
397
+ /* @__PURE__ */ t(Y, {}),
398
398
  /* @__PURE__ */ t(
399
399
  "div",
400
400
  {
401
- role: "list",
401
+ role: j || m.length === 0 ? void 0 : "list",
402
402
  "data-max-visible": M,
403
403
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:overflow-y-auto ds:pt-[var(--spacing-xs)] ds:flex-1 ds:sm:flex-none ds:sm:[max-block-size:var(--notification-tray-max-block-size,24rem)]",
404
- children: J ? /* @__PURE__ */ c(E, { children: [
404
+ children: j ? /* @__PURE__ */ c(q, { children: [
405
405
  /* @__PURE__ */ t(R, {}),
406
406
  /* @__PURE__ */ t(R, {}),
407
407
  /* @__PURE__ */ t(R, {})
408
- ] }) : y.length === 0 ? /* @__PURE__ */ t(Te, {}) : y.map(({ item: e, leaving: n }) => /* @__PURE__ */ t(
408
+ ] }) : m.length === 0 ? /* @__PURE__ */ t(Te, {}) : m.map(({ item: e, leaving: n }) => /* @__PURE__ */ t(
409
409
  pe,
410
410
  {
411
411
  item: e,
@@ -419,16 +419,16 @@ const we = de(
419
419
  ))
420
420
  }
421
421
  ),
422
- j ? /* @__PURE__ */ c(E, { children: [
423
- /* @__PURE__ */ t(W, {}),
422
+ K ? /* @__PURE__ */ c(q, { children: [
423
+ /* @__PURE__ */ t(Y, {}),
424
424
  /* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-xs)]", children: /* @__PURE__ */ t(
425
- U,
425
+ W,
426
426
  {
427
427
  intent: "link",
428
428
  size: "sm",
429
429
  onClick: Q,
430
430
  className: "ds:w-full ds:justify-center",
431
- children: j
431
+ children: K
432
432
  }
433
433
  ) })
434
434
  ] }) : null
@@ -445,4 +445,4 @@ export {
445
445
  we as N,
446
446
  ye as n
447
447
  };
448
- //# sourceMappingURL=notification-tray-C5cnXbl9.js.map
448
+ //# sourceMappingURL=notification-tray-PGtMqXbP.js.map
@@ -82,7 +82,7 @@ function be(r, n) {
82
82
  i.disconnect(), a.removeEventListener("change", e), f.removeEventListener("change", e);
83
83
  };
84
84
  }
85
- const ge = {
85
+ const ye = {
86
86
  id: "payment-form",
87
87
  capabilities: ["submit"],
88
88
  state: {},
@@ -108,7 +108,7 @@ const ge = {
108
108
  description: "Sourced from the id prop."
109
109
  }
110
110
  }
111
- }, ye = /* @__PURE__ */ new Set([
111
+ }, ge = /* @__PURE__ */ new Set([
112
112
  "BIF",
113
113
  "CLP",
114
114
  "DJF",
@@ -128,7 +128,7 @@ const ge = {
128
128
  "XPF"
129
129
  ]);
130
130
  function $(r, n, s) {
131
- const e = n.toUpperCase(), i = ye.has(e) ? r : r / 100;
131
+ const e = n.toUpperCase(), i = ge.has(e) ? r : r / 100;
132
132
  try {
133
133
  return new Intl.NumberFormat(s, {
134
134
  style: "currency",
@@ -233,9 +233,9 @@ function xe(r) {
233
233
  returnUrl: a,
234
234
  onSuccess: f,
235
235
  onError: N
236
- } = r, { t: o } = q(), k = le(), S = me(), y = oe(), b = j(
237
- () => `pay-${y.replace(/[^a-zA-Z0-9-_]/g, "")}`,
238
- [y]
236
+ } = r, { t: o } = q(), k = le(), S = me(), g = oe(), b = j(
237
+ () => `pay-${g.replace(/[^a-zA-Z0-9-_]/g, "")}`,
238
+ [g]
239
239
  ), F = `${b}-payment`, L = `${b}-address`, v = `${b}-error`, [u, h] = E(!1), [A, P] = E(!1), [w, x] = E(null), [U, d] = E(""), c = V(f), l = V(N);
240
240
  R(() => {
241
241
  c.current = f, l.current = N;
@@ -254,22 +254,22 @@ function xe(r) {
254
254
  return;
255
255
  }
256
256
  try {
257
- const g = await k.confirmPayment({
257
+ const y = await k.confirmPayment({
258
258
  elements: S,
259
259
  confirmParams: C ? { return_url: C } : {},
260
260
  redirect: "if_required"
261
261
  });
262
- if (g.error) {
263
- const M = g.error.code ?? "generic", I = he(M), te = X(g.error.message ?? "");
262
+ if (y.error) {
263
+ const M = y.error.code ?? "generic", I = he(M), te = X(y.error.message ?? "");
264
264
  x(I), d(o(I)), (H = l.current) == null || H.call(l, {
265
265
  code: M,
266
266
  translatedMessage: te || o(I)
267
267
  });
268
268
  return;
269
269
  }
270
- g.paymentIntent && ((O = c.current) == null || O.call(c, g.paymentIntent.id));
271
- } catch (g) {
272
- const M = g instanceof Error ? g.message : "", I = X(M);
270
+ y.paymentIntent && ((O = c.current) == null || O.call(c, y.paymentIntent.id));
271
+ } catch (y) {
272
+ const M = y instanceof Error ? y.message : "", I = X(M);
273
273
  x("payment.error.generic"), d(o("payment.error.generic")), (K = l.current) == null || K.call(l, {
274
274
  code: "unexpected",
275
275
  translatedMessage: I || o("payment.error.generic")
@@ -441,13 +441,13 @@ const ke = se(
441
441
  locale: o,
442
442
  ariaLabel: k,
443
443
  returnUrl: S,
444
- stripePromise: y,
444
+ stripePromise: g,
445
445
  className: b
446
446
  }, F) => {
447
- const { i18n: L } = q(), v = Ne(o ?? L.language ?? "en"), [u, h] = E(y ?? null);
447
+ const { i18n: L } = q(), v = Ne(o ?? L.language ?? "en"), [u, h] = E(g ?? null);
448
448
  R(() => {
449
- if (y !== void 0) {
450
- h(y);
449
+ if (g !== void 0) {
450
+ h(g);
451
451
  return;
452
452
  }
453
453
  if (!s) {
@@ -455,7 +455,7 @@ const ke = se(
455
455
  return;
456
456
  }
457
457
  h(de(s));
458
- }, [y, s]);
458
+ }, [g, s]);
459
459
  const [A, P] = E(
460
460
  () => B()
461
461
  );
@@ -477,7 +477,7 @@ const ke = se(
477
477
  }),
478
478
  []
479
479
  );
480
- ae(F, () => w.current, []), fe(ge, x, r);
480
+ ae(F, () => w.current, []), fe(ye, x, r);
481
481
  const U = j(
482
482
  () => ({
483
483
  clientSecret: n,
@@ -551,7 +551,7 @@ function Se(r) {
551
551
  }
552
552
  )
553
553
  ] }),
554
- i ? /* @__PURE__ */ m("div", { className: T(), children: [
554
+ i ? /* @__PURE__ */ m("div", { className: T(), "data-testid": "payment-address", children: [
555
555
  /* @__PURE__ */ t("span", { className: _(), children: a("payment.billingAddress") }),
556
556
  /* @__PURE__ */ t(
557
557
  "div",
@@ -584,7 +584,7 @@ export {
584
584
  X as b,
585
585
  he as c,
586
586
  $ as f,
587
- ge as p,
587
+ ye as p,
588
588
  ee as s
589
589
  };
590
- //# sourceMappingURL=payment-form-C3vT_npe.js.map
590
+ //# sourceMappingURL=payment-form-B_BdHwjb.js.map