@alfadocs/ui-kit 0.2.0 → 0.2.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.
Files changed (35) hide show
  1. package/dist/_chunks/{chat-input-DOlsB1fm.js → chat-input-Bov-gkwP.js} +40 -38
  2. package/dist/_chunks/{combobox-DCNXqbC7.js → combobox-BLWruOxK.js} +74 -75
  3. package/dist/_chunks/{freemium-paywall-CnvceDav.js → freemium-paywall-CrVefV0M.js} +2 -2
  4. package/dist/_chunks/{leo-sidebar-CfEY-xi2.js → leo-sidebar-kHO45M6C.js} +2 -2
  5. package/dist/_chunks/{link-8QmFjIz2.js → link-BcYW1eNM.js} +48 -32
  6. package/dist/_chunks/{message-card-ChCX9Iv6.js → message-card-DjvsB_3U.js} +12 -12
  7. package/dist/_chunks/{message-tray-n8q9ITXI.js → message-tray-BbnAzlLH.js} +23 -23
  8. package/dist/_chunks/{notification-card-hBlPN1-c.js → notification-card-uTPEvAQS.js} +21 -21
  9. package/dist/_chunks/{notification-tray-C5cnXbl9.js → notification-tray-PGtMqXbP.js} +56 -56
  10. package/dist/_chunks/{payment-form-C3vT_npe.js → payment-form-B_BdHwjb.js} +21 -21
  11. package/dist/_chunks/transaction-chip-DE6DITun.js +196 -0
  12. package/dist/agent-catalog.json +15 -1
  13. package/dist/components/chat-input/index.js +1 -1
  14. package/dist/components/combobox/index.js +1 -1
  15. package/dist/components/freemium-paywall/index.js +1 -1
  16. package/dist/components/index.d.ts +1 -0
  17. package/dist/components/link/index.js +1 -1
  18. package/dist/components/link/link.d.ts +1 -0
  19. package/dist/components/message-card/index.js +1 -1
  20. package/dist/components/message-tray/index.js +1 -1
  21. package/dist/components/notification-card/index.js +1 -1
  22. package/dist/components/notification-tray/index.js +1 -1
  23. package/dist/components/payment-form/index.js +1 -1
  24. package/dist/components/transaction-chip/index.d.ts +3 -0
  25. package/dist/components/transaction-chip/index.js +5 -0
  26. package/dist/components/transaction-chip/transaction-chip.d.ts +30 -0
  27. package/dist/i18n/config.js +36 -0
  28. package/dist/i18n/resources.d.ts +36 -0
  29. package/dist/index.js +34 -32
  30. package/dist/locales/de.json +12 -0
  31. package/dist/locales/en.json +12 -0
  32. package/dist/locales/it.json +12 -0
  33. package/dist/patterns/leo-assistant/index.js +1 -1
  34. package/dist/tokens.css +1 -1
  35. package/package.json +1 -1
@@ -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
@@ -0,0 +1,196 @@
1
+ import { jsxs as z, jsx as s } from "react/jsx-runtime";
2
+ import { forwardRef as N } from "react";
3
+ import { c as l } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as T } from "react-i18next";
5
+ import { C as M } from "./check-DPdL_Sm7.js";
6
+ import { c as t } from "./createLucideIcon-CrFbzy84.js";
7
+ import { F as _ } from "./file-text-DSNuv2B8.js";
8
+ /**
9
+ * @license lucide-react v1.8.0 - ISC
10
+ *
11
+ * This source code is licensed under the ISC license.
12
+ * See the LICENSE file in the root directory of this source tree.
13
+ */
14
+ const I = [
15
+ ["path", { d: "M17 7 7 17", key: "15tmo1" }],
16
+ ["path", { d: "M17 17H7V7", key: "1org7z" }]
17
+ ], C = t("arrow-down-left", I);
18
+ /**
19
+ * @license lucide-react v1.8.0 - ISC
20
+ *
21
+ * This source code is licensed under the ISC license.
22
+ * See the LICENSE file in the root directory of this source tree.
23
+ */
24
+ const A = [
25
+ ["path", { d: "M7 7h10v10", key: "1tivn9" }],
26
+ ["path", { d: "M7 17 17 7", key: "1vkiza" }]
27
+ ], E = t("arrow-up-right", A);
28
+ /**
29
+ * @license lucide-react v1.8.0 - ISC
30
+ *
31
+ * This source code is licensed under the ISC license.
32
+ * See the LICENSE file in the root directory of this source tree.
33
+ */
34
+ const L = [
35
+ ["path", { d: "M16 14v2.2l1.6 1", key: "fo4ql5" }],
36
+ ["path", { d: "M16 2v4", key: "4m81vk" }],
37
+ ["path", { d: "M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5", key: "1osxxc" }],
38
+ ["path", { d: "M3 10h5", key: "r794hk" }],
39
+ ["path", { d: "M8 2v4", key: "1cmpym" }],
40
+ ["circle", { cx: "16", cy: "16", r: "6", key: "qoo3c4" }]
41
+ ], R = t("calendar-clock", L), S = {
42
+ debt: "debt",
43
+ credit: "credit",
44
+ "to-invoice": "toInvoice",
45
+ "to-deliver": "toDeliver",
46
+ settled: "settled"
47
+ }, V = {
48
+ debt: C,
49
+ credit: E,
50
+ "to-invoice": _,
51
+ "to-deliver": R,
52
+ settled: M
53
+ }, F = {
54
+ debt: "−",
55
+ credit: "+",
56
+ "to-invoice": "",
57
+ "to-deliver": "",
58
+ settled: ""
59
+ }, D = {
60
+ debt: -1,
61
+ credit: 1,
62
+ "to-invoice": 1,
63
+ "to-deliver": 1,
64
+ settled: 1
65
+ }, U = "EUR", j = l(
66
+ [
67
+ "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
68
+ "ds:rounded-[var(--radius-full)] ds:border",
69
+ "ds:whitespace-nowrap ds:align-middle",
70
+ "ds:focus-visible:outline-none",
71
+ "ds:focus-visible:ring-[length:var(--focus-ring-width)]",
72
+ "ds:focus-visible:ring-[color:var(--ring)]",
73
+ "ds:focus-visible:ring-offset-[length:var(--focus-ring-offset)]"
74
+ ].join(" "),
75
+ {
76
+ variants: {
77
+ state: {
78
+ // Text uses the deeper `*-foreground` token (matching Badge / Tag) so
79
+ // small chip text clears WCAG AA (4.5:1) against the 10% tinted
80
+ // background. The surface and border use the lighter alias.
81
+ debt: "ds:bg-destructive/10 ds:text-[color:var(--error-foreground)] ds:border-destructive/20",
82
+ credit: "ds:bg-success/10 ds:text-[color:var(--success-foreground)] ds:border-success/20",
83
+ // The orange "to-invoice" tint has no kit-wide semantic alias — see
84
+ // src/tokens/index.css §Transaction-chip-scoped tokens. The component
85
+ // owns the alias because the customer-anchored "Da fatturare" orange
86
+ // is distinct from `--warning` (yellow) and from `--destructive`.
87
+ "to-invoice": "ds:bg-transaction-chip-to-invoice/10 ds:text-[color:var(--transaction-chip-to-invoice-foreground)] ds:border-transaction-chip-to-invoice/20",
88
+ "to-deliver": "ds:bg-info/10 ds:text-[color:var(--info-foreground)] ds:border-info/20",
89
+ settled: "ds:bg-muted/30 ds:text-muted-foreground ds:border-muted/40"
90
+ },
91
+ size: {
92
+ // Heights tuned for table-cell density (sm), default app surfaces (md),
93
+ // and header / summary cards (lg). `--type-eyebrow-size` flows into the
94
+ // optional label span, keeping its typography in step with the chip.
95
+ sm: "ds:h-5 ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-sm)] ds:text-[length:var(--font-size-2xs)] ds:[--type-eyebrow-size:var(--font-size-2xs)]",
96
+ md: "ds:h-6 ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:text-[length:var(--font-size-xs)] ds:[--type-eyebrow-size:var(--font-size-2xs)]",
97
+ lg: "ds:h-7 ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-md)] ds:text-[length:var(--font-size-sm)] ds:[--type-eyebrow-size:var(--font-size-xs)]"
98
+ },
99
+ bold: {
100
+ // `settled` is the terminal resting state — see compound variant below.
101
+ true: "ds:font-semibold",
102
+ false: "ds:font-medium"
103
+ }
104
+ },
105
+ defaultVariants: {
106
+ state: "debt",
107
+ size: "md",
108
+ bold: !0
109
+ },
110
+ compoundVariants: [
111
+ // `settled` always renders at the lighter weight, regardless of the
112
+ // resolved default. Mirrors PR #523's follow-up where the resting branch
113
+ // dropped from bold to medium to recede visually.
114
+ { state: "settled", class: "ds:font-medium" }
115
+ ]
116
+ }
117
+ ), $ = l(
118
+ "ds:shrink-0 ds:[&>svg]:block ds:rtl:[&>svg]:-scale-x-100",
119
+ {
120
+ variants: {
121
+ size: {
122
+ sm: "ds:[&>svg]:size-3",
123
+ md: "ds:[&>svg]:size-3.5",
124
+ lg: "ds:[&>svg]:size-4"
125
+ }
126
+ },
127
+ defaultVariants: { size: "md" }
128
+ }
129
+ ), q = N(
130
+ ({
131
+ state: e,
132
+ amount: v,
133
+ currency: o = U,
134
+ locale: m,
135
+ size: r = "md",
136
+ showLabel: p = !1,
137
+ className: f,
138
+ "aria-label": u,
139
+ ...g
140
+ }, h) => {
141
+ const { t: a, i18n: b } = T(), i = m ?? b.language ?? "en", y = V[e], n = F[e], d = Math.abs(v), x = new Intl.NumberFormat(i, {
142
+ style: "currency",
143
+ currency: o,
144
+ signDisplay: "never"
145
+ }).format(d), c = a(`ui.financial.state.${S[e]}`), k = new Intl.NumberFormat(i, {
146
+ style: "currency",
147
+ currency: o,
148
+ signDisplay: e === "debt" ? "always" : "auto"
149
+ }).format(d * D[e]), w = u ?? a("ui.financial.aria.label", {
150
+ state: c,
151
+ amount: k
152
+ });
153
+ return /* @__PURE__ */ z(
154
+ "span",
155
+ {
156
+ ref: h,
157
+ role: "img",
158
+ "aria-label": w,
159
+ "data-component": "transaction-chip",
160
+ "data-state": e,
161
+ className: j({
162
+ state: e,
163
+ size: r,
164
+ bold: e !== "settled",
165
+ className: f
166
+ }),
167
+ ...g,
168
+ children: [
169
+ /* @__PURE__ */ s("span", { "aria-hidden": "true", className: $({ size: r }), children: /* @__PURE__ */ s(y, {}) }),
170
+ p && /* @__PURE__ */ s("span", { "aria-hidden": "true", className: "type-eyebrow", children: c }),
171
+ n && /* @__PURE__ */ s(
172
+ "span",
173
+ {
174
+ "aria-hidden": "true",
175
+ className: "ds:[font-variant-numeric:var(--font-feature-tabular)]",
176
+ children: n
177
+ }
178
+ ),
179
+ /* @__PURE__ */ s(
180
+ "span",
181
+ {
182
+ "aria-hidden": "true",
183
+ className: "ds:[font-variant-numeric:var(--font-feature-tabular)]",
184
+ children: x
185
+ }
186
+ )
187
+ ]
188
+ }
189
+ );
190
+ }
191
+ );
192
+ q.displayName = "TransactionChip";
193
+ export {
194
+ q as T
195
+ };
196
+ //# sourceMappingURL=transaction-chip-DE6DITun.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "0.2.0",
3
+ "packageVersion": "0.2.2",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -3773,6 +3773,20 @@
3773
3773
  }
3774
3774
  }
3775
3775
  },
3776
+ {
3777
+ "kind": "component",
3778
+ "id": "transaction-chip",
3779
+ "capabilities": [],
3780
+ "state": [],
3781
+ "actions": [],
3782
+ "domHooks": {
3783
+ "root": {
3784
+ "attr": "data-component",
3785
+ "value": "transaction-chip",
3786
+ "description": "Marks the element as a kit TransactionChip."
3787
+ }
3788
+ }
3789
+ },
3776
3790
  {
3777
3791
  "kind": "component",
3778
3792
  "id": "transcript-panel",
@@ -1,4 +1,4 @@
1
- import { C as n, c as p } from "../../_chunks/chat-input-DOlsB1fm.js";
1
+ import { C as n, c as p } from "../../_chunks/chat-input-Bov-gkwP.js";
2
2
  export {
3
3
  n as ChatInput,
4
4
  p as chatInputAgent
@@ -1,4 +1,4 @@
1
- import { C as b, c as s, a as t, b as m, d as n, e as r } from "../../_chunks/combobox-DCNXqbC7.js";
1
+ import { C as b, c as s, a as t, b as m, d as n, e as r } from "../../_chunks/combobox-BLWruOxK.js";
2
2
  export {
3
3
  b as Combobox,
4
4
  s as comboboxAgent,
@@ -1,4 +1,4 @@
1
- import { F as m, f as l } from "../../_chunks/freemium-paywall-CnvceDav.js";
1
+ import { F as m, f as l } from "../../_chunks/freemium-paywall-CrVefV0M.js";
2
2
  export {
3
3
  m as FreemiumPaywall,
4
4
  l as freemiumPaywallAgent
@@ -114,6 +114,7 @@ export * from './rich-text-editor';
114
114
  export * from './signature-capture';
115
115
  export * from './slot-grid';
116
116
  export * from './tooth-scheme';
117
+ export * from './transaction-chip';
117
118
  export * from './workflow';
118
119
  export * from '../patterns/leo-assistant';
119
120
  export * from '../patterns/patient-shell';
@@ -1,4 +1,4 @@
1
- import { L } from "../../_chunks/link-8QmFjIz2.js";
1
+ import { L } from "../../_chunks/link-BcYW1eNM.js";
2
2
  export {
3
3
  L as Link
4
4
  };
@@ -12,6 +12,7 @@ import { type VariantProps } from 'class-variance-authority';
12
12
  declare const linkVariants: (props?: ({
13
13
  intent?: "default" | "inverted" | "subtle" | null | undefined;
14
14
  weight?: "strong" | "normal" | null | undefined;
15
+ hasIcon?: "yes" | "no" | null | undefined;
15
16
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
16
17
  export interface LinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>, VariantProps<typeof linkVariants> {
17
18
  /** Anchor target. Required — the whole point of the component. */
@@ -1,4 +1,4 @@
1
- import { M as a, i as r } from "../../_chunks/message-card-ChCX9Iv6.js";
1
+ import { M as a, i as r } from "../../_chunks/message-card-DjvsB_3U.js";
2
2
  import { m } from "../../_chunks/message-card.agent-4IeIgrnJ.js";
3
3
  export {
4
4
  a as MessageCard,
@@ -1,4 +1,4 @@
1
- import { M as s, m as r } from "../../_chunks/message-tray-n8q9ITXI.js";
1
+ import { M as s, m as r } from "../../_chunks/message-tray-BbnAzlLH.js";
2
2
  export {
3
3
  s as MessageTray,
4
4
  r as messageTrayAgent
@@ -1,4 +1,4 @@
1
- import { N as a, i as t } from "../../_chunks/notification-card-hBlPN1-c.js";
1
+ import { N as a, i as t } from "../../_chunks/notification-card-uTPEvAQS.js";
2
2
  import { n as f } from "../../_chunks/notification-card.agent-Rqt3ofk9.js";
3
3
  export {
4
4
  a as NotificationCard,