@tesouro/embedded-components-react 0.5.42 → 0.5.43

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.
@@ -155,14 +155,16 @@ function y({ preSelectedIds: p, onClose: y, targetTransactionId: b, onSingleTran
155
155
  x,
156
156
  y,
157
157
  Q
158
- ]), ge = s((e) => {
158
+ ]), ge = s(() => {
159
+ V.refetch();
160
+ }, [V.refetch]), _e = s((e) => {
159
161
  F(e);
160
- }, []), _e = s((e) => {
162
+ }, []), ve = s((e) => {
161
163
  L((t) => {
162
164
  let n = t.find((t) => t.id === e), r = Y.find((t) => t.id === e);
163
165
  return n ? [] : r ? [r] : [];
164
166
  });
165
- }, [Y]), ve = s(async () => {
167
+ }, [Y]), ye = s(async () => {
166
168
  if (I.length === 0 || !X) return;
167
169
  let t = I, n = (e) => ({
168
170
  merchant: e.merchant_name,
@@ -193,11 +195,13 @@ function y({ preSelectedIds: p, onClose: y, targetTransactionId: b, onSingleTran
193
195
  I,
194
196
  X,
195
197
  U
196
- ]), ye = s(() => {
198
+ ]), be = s(() => {
199
+ H.refetch();
200
+ }, [H.refetch]), xe = s(() => {
197
201
  B((e) => Math.min(e + _, g));
198
- }, []), be = s(() => {
202
+ }, []), Se = s(() => {
199
203
  B((e) => Math.max(e - _, h));
200
- }, []), xe = s(() => {
204
+ }, []), Ce = s(() => {
201
205
  let e = O + 1;
202
206
  if (e < M.length) {
203
207
  k(e), Q(), D(2);
@@ -209,7 +213,7 @@ function y({ preSelectedIds: p, onClose: y, targetTransactionId: b, onSingleTran
209
213
  M.length,
210
214
  Q,
211
215
  y
212
- ]), Se = s(() => {
216
+ ]), we = s(() => {
213
217
  if (A.length > 0) {
214
218
  let e = new Set(A.map((e) => e.receiptId));
215
219
  N((t) => t.filter((t) => !e.has(t)));
@@ -227,27 +231,31 @@ function y({ preSelectedIds: p, onClose: y, targetTransactionId: b, onSingleTran
227
231
  onDeleteReceipt: $,
228
232
  onReview: he,
229
233
  isReceiptsLoading: V.isLoading || C && !S,
234
+ isReceiptsError: V.isError,
235
+ onRetryReceipts: ge,
230
236
  showSelectAllButton: !b,
231
237
  receiptPreviewUrl: oe,
232
238
  receiptFileName: se,
233
239
  transactions: ae,
234
240
  isTransactionsLoading: H.isLoading,
241
+ isTransactionsError: H.isError,
242
+ onRetryTransactions: be,
235
243
  selectedTransactionIds: R,
236
244
  allowMultipleTransactions: v,
237
245
  searchValue: P,
238
- onSearchChange: ge,
239
- onTransactionSelect: _e,
240
- onConfirmMatch: ve,
246
+ onSearchChange: _e,
247
+ onTransactionSelect: ve,
248
+ onConfirmMatch: ye,
241
249
  isConfirming: U.isPending,
242
250
  zoom: z,
243
- onZoomIn: ye,
244
- onZoomOut: be,
251
+ onZoomIn: xe,
252
+ onZoomOut: Se,
245
253
  canZoomIn: z < g,
246
254
  canZoomOut: z > h,
247
255
  matchedTransactions: le,
248
256
  primaryLabel: ue,
249
- onPrimary: xe,
250
- onCancel: Se,
257
+ onPrimary: Ce,
258
+ onCancel: we,
251
259
  reviewLabel: ce
252
260
  };
253
261
  }
@@ -3,109 +3,116 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { Button as e, Skeleton as t } from "../../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { ReceiptMatchLabels as n } from "./labels.js";
7
- import { ReceiptInboxItem as r } from "./ReceiptInboxItem.js";
8
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
9
- import { ArrowRight as o, FileText as s, X as c } from "lucide-react";
6
+ import { ErrorState as n } from "../../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
7
+ import "../../../../../../shared/ui/dist/index.js";
8
+ import { ReceiptMatchLabels as r } from "./labels.js";
9
+ import { ReceiptInboxItem as i } from "./ReceiptInboxItem.js";
10
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
11
+ import { ArrowRight as s, FileText as c, X as l } from "lucide-react";
10
12
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ReceiptMatchWidget/lib/ReceiptInboxStep.js
11
- var l = 4;
12
- function u({ receipts: t, selectedReceiptIds: u, onSelectAll: f, onReset: p, onReceiptToggle: m, onViewAttachment: h, onDeleteReceipt: g, onReview: _, onClose: v, reviewLabel: y, isLoading: b = !1, showSelectAllButton: x = !0 }) {
13
- return /* @__PURE__ */ a("div", {
13
+ var u = 4;
14
+ function d({ receipts: t, selectedReceiptIds: d, onSelectAll: p, onReset: m, onReceiptToggle: h, onViewAttachment: g, onDeleteReceipt: _, onReview: v, onClose: y, reviewLabel: b, isLoading: x = !1, isError: S = !1, onRetry: C, showSelectAllButton: w = !0 }) {
15
+ return /* @__PURE__ */ o("div", {
14
16
  className: "ttw:flex ttw:flex-col ttw:w-[440px] ttw:h-full ttw:ml-auto ttw:border-l ttw:border-border ttw:bg-white",
15
17
  children: [
16
- /* @__PURE__ */ a("div", {
18
+ /* @__PURE__ */ o("div", {
17
19
  className: "ttw:flex ttw:items-center ttw:justify-between ttw:px-6 ttw:pt-5 ttw:pb-2",
18
- children: [/* @__PURE__ */ i("h2", {
20
+ children: [/* @__PURE__ */ a("h2", {
19
21
  className: "ttw:text-lg ttw:font-semibold",
20
- children: b ? n.InboxTitle : `${n.InboxTitle} (${t.length})`
21
- }), /* @__PURE__ */ i(e, {
22
+ children: x || S ? r.InboxTitle : `${r.InboxTitle} (${t.length})`
23
+ }), /* @__PURE__ */ a(e, {
22
24
  variant: "ghost",
23
25
  size: "sm",
24
26
  className: "ttw:p-1 ttw:h-auto",
25
- onClick: v,
26
- "aria-label": n.Close,
27
- children: /* @__PURE__ */ i(c, { size: 18 })
27
+ onClick: y,
28
+ "aria-label": r.Close,
29
+ children: /* @__PURE__ */ a(l, { size: 18 })
28
30
  })]
29
31
  }),
30
- /* @__PURE__ */ a("div", {
32
+ /* @__PURE__ */ o("div", {
31
33
  className: "ttw:flex ttw:items-center ttw:gap-2 ttw:px-6 ttw:py-3",
32
- children: [x && /* @__PURE__ */ i(e, {
34
+ children: [w && /* @__PURE__ */ a(e, {
33
35
  variant: "outline",
34
36
  size: "sm",
35
- onClick: f,
36
- children: n.SelectAll
37
- }), /* @__PURE__ */ i(e, {
37
+ onClick: p,
38
+ children: r.SelectAll
39
+ }), /* @__PURE__ */ a(e, {
38
40
  variant: "outline",
39
41
  size: "sm",
40
- onClick: p,
41
- children: n.Reset
42
+ onClick: m,
43
+ children: r.Reset
42
44
  })]
43
45
  }),
44
- /* @__PURE__ */ i("div", {
46
+ /* @__PURE__ */ a("div", {
45
47
  className: "ttw:flex-1 ttw:overflow-y-auto ttw:flex ttw:flex-col ttw:gap-2 ttw:px-6 ttw:py-3",
46
- children: b ? /* @__PURE__ */ a("div", {
48
+ children: x ? /* @__PURE__ */ o("div", {
47
49
  role: "status",
48
50
  className: "ttw:flex ttw:flex-col ttw:gap-2",
49
- children: [/* @__PURE__ */ i("span", {
51
+ children: [/* @__PURE__ */ a("span", {
50
52
  className: "ttw:sr-only",
51
- children: n.LoadingReceipts
52
- }), Array.from({ length: l }).map((e, t) => /* @__PURE__ */ i(d, {}, t))]
53
- }) : t.length === 0 ? /* @__PURE__ */ a("div", {
53
+ children: r.LoadingReceipts
54
+ }), Array.from({ length: u }).map((e, t) => /* @__PURE__ */ a(f, {}, t))]
55
+ }) : S ? /* @__PURE__ */ a(n, {
56
+ title: r.ReceiptsErrorTitle,
57
+ description: r.ReceiptsErrorSubtitle,
58
+ retryLabel: r.Retry,
59
+ onRetry: C
60
+ }) : t.length === 0 ? /* @__PURE__ */ o("div", {
54
61
  className: "ttw:flex ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-3 ttw:flex-1 ttw:py-12",
55
- children: [/* @__PURE__ */ i("div", {
62
+ children: [/* @__PURE__ */ a("div", {
56
63
  className: "ttw:w-14 ttw:h-14 ttw:rounded-full ttw:bg-muted ttw:flex ttw:items-center ttw:justify-center",
57
- children: /* @__PURE__ */ i(s, {
64
+ children: /* @__PURE__ */ a(c, {
58
65
  size: 24,
59
66
  className: "ttw:text-muted-foreground"
60
67
  })
61
- }), /* @__PURE__ */ a("div", {
68
+ }), /* @__PURE__ */ o("div", {
62
69
  className: "ttw:flex ttw:flex-col ttw:items-center ttw:gap-1 ttw:text-center",
63
- children: [/* @__PURE__ */ i("span", {
70
+ children: [/* @__PURE__ */ a("span", {
64
71
  className: "ttw:text-sm ttw:font-medium",
65
- children: n.NoReceiptsTitle
66
- }), /* @__PURE__ */ i("span", {
72
+ children: r.NoReceiptsTitle
73
+ }), /* @__PURE__ */ a("span", {
67
74
  className: "ttw:text-sm ttw:text-muted-foreground",
68
- children: n.NoReceiptsSubtitle
75
+ children: r.NoReceiptsSubtitle
69
76
  })]
70
77
  })]
71
- }) : t.map((e) => /* @__PURE__ */ i(r, {
78
+ }) : t.map((e) => /* @__PURE__ */ a(i, {
72
79
  item: e,
73
- selected: u.includes(e.id),
74
- onToggle: () => m(e.id),
75
- onViewAttachment: () => h(e.id),
76
- onDelete: () => g(e.id)
80
+ selected: d.includes(e.id),
81
+ onToggle: () => h(e.id),
82
+ onViewAttachment: () => g(e.id),
83
+ onDelete: () => _(e.id)
77
84
  }, e.id))
78
85
  }),
79
- /* @__PURE__ */ a("div", {
86
+ /* @__PURE__ */ o("div", {
80
87
  className: "ttw:flex ttw:items-center ttw:gap-3 ttw:px-6 ttw:py-4 ttw:border-t ttw:border-border",
81
- children: [/* @__PURE__ */ i(e, {
88
+ children: [/* @__PURE__ */ a(e, {
82
89
  variant: "outline",
83
90
  className: "ttw:flex-1",
84
- onClick: v,
85
- children: n.Cancel
86
- }), /* @__PURE__ */ a(e, {
91
+ onClick: y,
92
+ children: r.Cancel
93
+ }), /* @__PURE__ */ o(e, {
87
94
  className: "ttw:flex-1",
88
- disabled: b || u.length === 0,
89
- onClick: _,
90
- children: [y ?? n.Review, /* @__PURE__ */ i(o, { size: 16 })]
95
+ disabled: x || d.length === 0,
96
+ onClick: v,
97
+ children: [b ?? r.Review, /* @__PURE__ */ a(s, { size: 16 })]
91
98
  })]
92
99
  })
93
100
  ]
94
101
  });
95
102
  }
96
- function d() {
97
- return /* @__PURE__ */ a("div", {
103
+ function f() {
104
+ return /* @__PURE__ */ o("div", {
98
105
  className: "ttw:flex ttw:items-center ttw:gap-3 ttw:py-2",
99
106
  children: [
100
- /* @__PURE__ */ i(t, { className: "ttw:h-4 ttw:w-4" }),
101
- /* @__PURE__ */ i(t, { className: "ttw:h-10 ttw:w-10 ttw:rounded" }),
102
- /* @__PURE__ */ a("div", {
107
+ /* @__PURE__ */ a(t, { className: "ttw:h-4 ttw:w-4" }),
108
+ /* @__PURE__ */ a(t, { className: "ttw:h-10 ttw:w-10 ttw:rounded" }),
109
+ /* @__PURE__ */ o("div", {
103
110
  className: "ttw:flex ttw:flex-col ttw:gap-1.5 ttw:flex-1",
104
- children: [/* @__PURE__ */ i(t, { className: "ttw:h-4 ttw:w-32" }), /* @__PURE__ */ i(t, { className: "ttw:h-3 ttw:w-20" })]
111
+ children: [/* @__PURE__ */ a(t, { className: "ttw:h-4 ttw:w-32" }), /* @__PURE__ */ a(t, { className: "ttw:h-3 ttw:w-20" })]
105
112
  }),
106
- /* @__PURE__ */ i(t, { className: "ttw:h-4 ttw:w-4" })
113
+ /* @__PURE__ */ a(t, { className: "ttw:h-4 ttw:w-4" })
107
114
  ]
108
115
  });
109
116
  }
110
117
  //#endregion
111
- export { u as ReceiptInboxStep };
118
+ export { d as ReceiptInboxStep };
@@ -9,8 +9,8 @@ import { TransactionsMatchStep as o } from "./TransactionsMatchStep.js";
9
9
  import { MatchConfirmationStep as s } from "./MatchConfirmationStep.js";
10
10
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
11
11
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ReceiptMatchWidget/lib/ReceiptMatchSidebar.js
12
- function u({ open: u, onClose: d, step: f, receipts: p, selectedReceiptIds: m, onSelectAll: h, onReset: g, onReceiptToggle: _, onViewAttachment: v, onDeleteReceipt: y, onReview: b, isReceiptsLoading: x, receiptPreviewUrl: S, receiptFileName: C, transactions: w, isTransactionsLoading: T, selectedTransactionIds: E, allowMultipleTransactions: D, searchValue: O, onSearchChange: k, onTransactionSelect: A, onConfirmMatch: j, isConfirming: M, zoom: N, onZoomIn: P, onZoomOut: F, canZoomIn: I, canZoomOut: L, showZoomControls: R, matchedTransactions: z, primaryLabel: B, onPrimary: V, onCancel: H, reviewLabel: U, showSelectAllButton: W }) {
13
- let G = {
12
+ function u({ open: u, onClose: d, step: f, receipts: p, selectedReceiptIds: m, onSelectAll: h, onReset: g, onReceiptToggle: _, onViewAttachment: v, onDeleteReceipt: y, onReview: b, isReceiptsLoading: x, isReceiptsError: S, onRetryReceipts: C, receiptPreviewUrl: w, receiptFileName: T, transactions: E, isTransactionsLoading: D, isTransactionsError: O, onRetryTransactions: k, selectedTransactionIds: A, allowMultipleTransactions: j, searchValue: M, onSearchChange: N, onTransactionSelect: P, onConfirmMatch: F, isConfirming: I, zoom: L, onZoomIn: R, onZoomOut: z, canZoomIn: B, canZoomOut: V, showZoomControls: H, matchedTransactions: U, primaryLabel: W, onPrimary: G, onCancel: K, reviewLabel: q, showSelectAllButton: J }) {
13
+ let Y = {
14
14
  receipts: p,
15
15
  selectedReceiptIds: m,
16
16
  onSelectAll: h,
@@ -20,33 +20,37 @@ function u({ open: u, onClose: d, step: f, receipts: p, selectedReceiptIds: m, o
20
20
  onDeleteReceipt: y,
21
21
  onReview: b,
22
22
  onClose: d,
23
- reviewLabel: U,
23
+ reviewLabel: q,
24
24
  isLoading: x,
25
- showSelectAllButton: W
26
- }, K = {
27
- receiptPreviewUrl: S,
28
- receiptFileName: C,
29
- transactions: w,
30
- selectedTransactionIds: E,
31
- allowMultipleTransactions: D,
32
- searchValue: O,
33
- onSearchChange: k,
34
- onTransactionSelect: A,
35
- onConfirmMatch: j,
36
- isConfirming: M,
37
- zoom: N,
38
- onZoomIn: P,
39
- onZoomOut: F,
40
- canZoomIn: I,
41
- canZoomOut: L,
42
- showZoomControls: R,
43
- onCancel: H,
25
+ isError: S,
26
+ onRetry: C,
27
+ showSelectAllButton: J
28
+ }, X = {
29
+ receiptPreviewUrl: w,
30
+ receiptFileName: T,
31
+ transactions: E,
32
+ selectedTransactionIds: A,
33
+ allowMultipleTransactions: j,
34
+ searchValue: M,
35
+ onSearchChange: N,
36
+ onTransactionSelect: P,
37
+ onConfirmMatch: F,
38
+ isConfirming: I,
39
+ zoom: L,
40
+ onZoomIn: R,
41
+ onZoomOut: z,
42
+ canZoomIn: B,
43
+ canZoomOut: V,
44
+ showZoomControls: H,
45
+ onCancel: K,
44
46
  onClose: d,
45
- isLoading: T
46
- }, q = {
47
- matchedTransactions: z,
48
- primaryLabel: B,
49
- onPrimary: V
47
+ isLoading: D,
48
+ isError: O,
49
+ onRetry: k
50
+ }, Z = {
51
+ matchedTransactions: U,
52
+ primaryLabel: W,
53
+ onPrimary: G
50
54
  };
51
55
  return /* @__PURE__ */ c(e, {
52
56
  open: u,
@@ -63,9 +67,9 @@ function u({ open: u, onClose: d, step: f, receipts: p, selectedReceiptIds: m, o
63
67
  className: "ttw:sr-only",
64
68
  children: i.DialogDescription
65
69
  }),
66
- f === 1 && /* @__PURE__ */ c(a, { ...G }),
67
- f === 2 && /* @__PURE__ */ c(o, { ...K }),
68
- f === 3 && /* @__PURE__ */ c(s, { ...q })
70
+ f === 1 && /* @__PURE__ */ c(a, { ...Y }),
71
+ f === 2 && /* @__PURE__ */ c(o, { ...X }),
72
+ f === 3 && /* @__PURE__ */ c(s, { ...Z })
69
73
  ]
70
74
  })
71
75
  });
@@ -3,153 +3,161 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { Button as e, Input as t, Skeleton as n } from "../../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { ReceiptMatchLabels as r } from "./labels.js";
7
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
8
- import { Check as o, DollarSign as s, Loader2 as c, Search as l, X as u, ZoomIn as d, ZoomOut as f } from "lucide-react";
6
+ import { ErrorState as r } from "../../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
7
+ import "../../../../../../shared/ui/dist/index.js";
8
+ import { ReceiptMatchLabels as i } from "./labels.js";
9
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
10
+ import { Check as s, DollarSign as c, Loader2 as l, Search as u, X as d, ZoomIn as f, ZoomOut as p } from "lucide-react";
9
11
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ReceiptMatchWidget/lib/TransactionsMatchStep.js
10
- var p = 5;
11
- function m({ receiptPreviewUrl: n, receiptFileName: m, transactions: g, selectedTransactionIds: v, allowMultipleTransactions: y = !1, searchValue: b, onSearchChange: x, onTransactionSelect: S, onConfirmMatch: C, isConfirming: w = !1, zoom: T = 1, onZoomIn: E, onZoomOut: D, canZoomIn: O = !0, canZoomOut: k = !0, showZoomControls: A = !!(n && (E || D)), onCancel: j, onClose: M, isLoading: N = !1 }) {
12
- return /* @__PURE__ */ a("div", {
12
+ var m = 5;
13
+ function h({ receiptPreviewUrl: n, receiptFileName: h, transactions: _, selectedTransactionIds: y, allowMultipleTransactions: b = !1, searchValue: x, onSearchChange: S, onTransactionSelect: C, onConfirmMatch: w, isConfirming: T = !1, zoom: E = 1, onZoomIn: D, onZoomOut: O, canZoomIn: k = !0, canZoomOut: A = !0, showZoomControls: j = !!(n && (D || O)), onCancel: M, onClose: N, isLoading: P = !1, isError: F = !1, onRetry: I }) {
14
+ return /* @__PURE__ */ o("div", {
13
15
  className: "ttw:flex ttw:w-full ttw:h-full",
14
- children: [/* @__PURE__ */ a("div", {
16
+ children: [/* @__PURE__ */ o("div", {
15
17
  className: "ttw:w-110 ttw:ml-auto ttw:bg-muted ttw:relative ttw:flex ttw:items-center ttw:justify-center ttw:overflow-hidden",
16
- children: [n && /* @__PURE__ */ i(_, {
18
+ children: [n && /* @__PURE__ */ a(v, {
17
19
  url: n,
18
- fileName: m,
19
- zoom: T
20
- }), A && /* @__PURE__ */ a("div", {
20
+ fileName: h,
21
+ zoom: E
22
+ }), j && /* @__PURE__ */ o("div", {
21
23
  className: "ttw:absolute ttw:bottom-4 ttw:left-4 ttw:flex ttw:items-center ttw:border ttw:rounded-[14px] ttw:border-border ttw:bg-card",
22
24
  children: [
23
- /* @__PURE__ */ i(e, {
25
+ /* @__PURE__ */ a(e, {
24
26
  variant: "ghost",
25
27
  size: "icon-sm",
26
- onClick: D,
27
- disabled: !D || !k,
28
- "aria-label": r.ZoomOut,
28
+ onClick: O,
29
+ disabled: !O || !A,
30
+ "aria-label": i.ZoomOut,
29
31
  className: "ttw:rounded-none ttw:rounded-tl-[14px] ttw:rounded-bl-[14px]",
30
- children: /* @__PURE__ */ i(f, { className: "ttw:size-4" })
32
+ children: /* @__PURE__ */ a(p, { className: "ttw:size-4" })
31
33
  }),
32
- /* @__PURE__ */ i("div", { className: "ttw:w-px ttw:self-stretch ttw:bg-border" }),
33
- /* @__PURE__ */ i(e, {
34
+ /* @__PURE__ */ a("div", { className: "ttw:w-px ttw:self-stretch ttw:bg-border" }),
35
+ /* @__PURE__ */ a(e, {
34
36
  variant: "ghost",
35
37
  size: "icon-sm",
36
- onClick: E,
37
- disabled: !E || !O,
38
- "aria-label": r.ZoomIn,
38
+ onClick: D,
39
+ disabled: !D || !k,
40
+ "aria-label": i.ZoomIn,
39
41
  className: "ttw:rounded-none ttw:rounded-tr-[14px] ttw:rounded-br-[14px]",
40
- children: /* @__PURE__ */ i(d, { className: "ttw:size-4" })
42
+ children: /* @__PURE__ */ a(f, { className: "ttw:size-4" })
41
43
  })
42
44
  ]
43
45
  })]
44
- }), /* @__PURE__ */ a("div", {
46
+ }), /* @__PURE__ */ o("div", {
45
47
  className: "ttw:flex ttw:flex-col ttw:w-110 ttw:h-full ttw:border-l ttw:border-border ttw:bg-card",
46
48
  children: [
47
- /* @__PURE__ */ a("div", {
49
+ /* @__PURE__ */ o("div", {
48
50
  className: "ttw:flex ttw:items-center ttw:justify-between ttw:px-6 ttw:pt-5 ttw:pb-2",
49
- children: [/* @__PURE__ */ i("h2", {
51
+ children: [/* @__PURE__ */ a("h2", {
50
52
  className: "ttw:text-lg ttw:font-semibold",
51
- children: r.TransactionsTitle
52
- }), /* @__PURE__ */ i(e, {
53
+ children: i.TransactionsTitle
54
+ }), /* @__PURE__ */ a(e, {
53
55
  variant: "ghost",
54
56
  size: "sm",
55
57
  className: "ttw:p-1 ttw:h-auto",
56
- onClick: M,
57
- "aria-label": r.Close,
58
- children: /* @__PURE__ */ i(u, { size: 18 })
58
+ onClick: N,
59
+ "aria-label": i.Close,
60
+ children: /* @__PURE__ */ a(d, { size: 18 })
59
61
  })]
60
62
  }),
61
- /* @__PURE__ */ i("div", {
63
+ /* @__PURE__ */ a("div", {
62
64
  className: "ttw:px-6 ttw:py-3",
63
- children: /* @__PURE__ */ a("div", {
65
+ children: /* @__PURE__ */ o("div", {
64
66
  className: "ttw:relative",
65
- children: [/* @__PURE__ */ i(l, {
67
+ children: [/* @__PURE__ */ a(u, {
66
68
  size: 16,
67
69
  className: "ttw:absolute ttw:left-3 ttw:top-1/2 ttw:-translate-y-1/2 ttw:text-muted-foreground"
68
- }), /* @__PURE__ */ i(t, {
69
- value: b,
70
- onChange: (e) => x(e.target.value),
71
- placeholder: r.SearchPlaceholder,
70
+ }), /* @__PURE__ */ a(t, {
71
+ value: x,
72
+ onChange: (e) => S(e.target.value),
73
+ placeholder: i.SearchPlaceholder,
72
74
  className: "ttw:pl-9"
73
75
  })]
74
76
  })
75
77
  }),
76
- /* @__PURE__ */ a("div", {
78
+ /* @__PURE__ */ o("div", {
77
79
  className: "ttw:flex ttw:items-center ttw:gap-3 ttw:px-6 ttw:py-2 ttw:bg-muted/40",
78
80
  children: [
79
- /* @__PURE__ */ i("span", {
81
+ /* @__PURE__ */ a("span", {
80
82
  className: "ttw:w-4 ttw:shrink-0",
81
83
  "aria-hidden": !0
82
84
  }),
83
- /* @__PURE__ */ i("span", {
85
+ /* @__PURE__ */ a("span", {
84
86
  className: "ttw:flex-1 ttw:text-xs ttw:font-medium ttw:text-muted-foreground",
85
- children: r.Merchant
87
+ children: i.Merchant
86
88
  }),
87
- /* @__PURE__ */ i("span", {
89
+ /* @__PURE__ */ a("span", {
88
90
  className: "ttw:w-24 ttw:text-xs ttw:font-medium ttw:text-muted-foreground",
89
- children: r.Date
91
+ children: i.Date
90
92
  }),
91
- /* @__PURE__ */ i("span", {
93
+ /* @__PURE__ */ a("span", {
92
94
  className: "ttw:w-20 ttw:text-xs ttw:font-medium ttw:text-muted-foreground ttw:text-right",
93
- children: r.Amount
95
+ children: i.Amount
94
96
  })
95
97
  ]
96
98
  }),
97
- /* @__PURE__ */ a("div", {
99
+ /* @__PURE__ */ o("div", {
98
100
  className: "ttw:flex-1 ttw:overflow-y-auto",
99
101
  children: [
100
- N && /* @__PURE__ */ a("div", {
102
+ P && /* @__PURE__ */ o("div", {
101
103
  role: "status",
102
- children: [/* @__PURE__ */ i("span", {
104
+ children: [/* @__PURE__ */ a("span", {
103
105
  className: "ttw:sr-only",
104
- children: r.LoadingTransactions
105
- }), Array.from({ length: p }).map((e, t) => /* @__PURE__ */ i(h, {}, t))]
106
+ children: i.LoadingTransactions
107
+ }), Array.from({ length: m }).map((e, t) => /* @__PURE__ */ a(g, {}, t))]
108
+ }),
109
+ !P && F && /* @__PURE__ */ a(r, {
110
+ title: i.TransactionsErrorTitle,
111
+ description: i.TransactionsErrorSubtitle,
112
+ retryLabel: i.Retry,
113
+ onRetry: I
106
114
  }),
107
- !N && g.length === 0 && /* @__PURE__ */ a("div", {
115
+ !P && !F && _.length === 0 && /* @__PURE__ */ o("div", {
108
116
  className: "ttw:flex ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-3 ttw:h-full ttw:py-12",
109
- children: [/* @__PURE__ */ i("div", {
117
+ children: [/* @__PURE__ */ a("div", {
110
118
  className: "ttw:w-14 ttw:h-14 ttw:rounded-full ttw:bg-muted ttw:flex ttw:items-center ttw:justify-center",
111
- children: /* @__PURE__ */ i(s, {
119
+ children: /* @__PURE__ */ a(c, {
112
120
  size: 24,
113
121
  className: "ttw:text-muted-foreground"
114
122
  })
115
- }), /* @__PURE__ */ a("div", {
123
+ }), /* @__PURE__ */ o("div", {
116
124
  className: "ttw:flex ttw:flex-col ttw:items-center ttw:gap-1 ttw:text-center ttw:px-6",
117
- children: [/* @__PURE__ */ i("span", {
125
+ children: [/* @__PURE__ */ a("span", {
118
126
  className: "ttw:text-sm ttw:font-medium",
119
- children: r.NoTransactionsTitle
120
- }), /* @__PURE__ */ i("span", {
127
+ children: i.NoTransactionsTitle
128
+ }), /* @__PURE__ */ a("span", {
121
129
  className: "ttw:text-sm ttw:text-muted-foreground",
122
- children: r.NoTransactionsSubtitle
130
+ children: i.NoTransactionsSubtitle
123
131
  })]
124
132
  })]
125
133
  }),
126
- !N && g.map((e) => {
127
- let t = v.includes(e.id);
128
- return /* @__PURE__ */ a("label", {
134
+ !P && !F && _.map((e) => {
135
+ let t = y.includes(e.id);
136
+ return /* @__PURE__ */ o("label", {
129
137
  className: `ttw:flex ttw:items-center ttw:gap-3 ttw:px-6 ttw:py-3 ttw:cursor-pointer ttw:transition-colors ${t ? "ttw:bg-blue-50" : "ttw:hover:bg-muted/50"}`,
130
138
  children: [
131
- /* @__PURE__ */ i("input", {
132
- type: y ? "checkbox" : "radio",
133
- name: y ? void 0 : "receipt-match-transaction",
139
+ /* @__PURE__ */ a("input", {
140
+ type: b ? "checkbox" : "radio",
141
+ name: b ? void 0 : "receipt-match-transaction",
134
142
  checked: t,
135
143
  onChange: () => {
136
- (y || !t) && S(e.id);
144
+ (b || !t) && C(e.id);
137
145
  },
138
146
  onClick: () => {
139
- !y && t && S(e.id);
147
+ !b && t && C(e.id);
140
148
  },
141
149
  "aria-label": `Select transaction from ${e.merchantName}`,
142
150
  className: "ttw:h-4 ttw:w-4 ttw:border ttw:border-input ttw:accent-primary ttw:cursor-pointer ttw:shrink-0"
143
151
  }),
144
- /* @__PURE__ */ i("span", {
152
+ /* @__PURE__ */ a("span", {
145
153
  className: "ttw:flex-1 ttw:text-sm ttw:font-medium ttw:truncate",
146
154
  children: e.merchantName
147
155
  }),
148
- /* @__PURE__ */ i("span", {
156
+ /* @__PURE__ */ a("span", {
149
157
  className: "ttw:w-24 ttw:text-sm ttw:text-muted-foreground ttw:shrink-0",
150
158
  children: e.date
151
159
  }),
152
- /* @__PURE__ */ i("span", {
160
+ /* @__PURE__ */ a("span", {
153
161
  className: "ttw:w-20 ttw:text-sm ttw:font-medium ttw:tabular-nums ttw:text-right ttw:shrink-0",
154
162
  children: e.formattedAmount
155
163
  })
@@ -158,56 +166,56 @@ function m({ receiptPreviewUrl: n, receiptFileName: m, transactions: g, selected
158
166
  })
159
167
  ]
160
168
  }),
161
- /* @__PURE__ */ a("div", {
169
+ /* @__PURE__ */ o("div", {
162
170
  className: "ttw:flex ttw:items-center ttw:gap-3 ttw:px-6 ttw:py-4 ttw:border-t ttw:border-border",
163
- children: [/* @__PURE__ */ i(e, {
171
+ children: [/* @__PURE__ */ a(e, {
164
172
  variant: "outline",
165
173
  className: "ttw:flex-1",
166
- onClick: j,
167
- children: r.Back
168
- }), /* @__PURE__ */ a(e, {
174
+ onClick: M,
175
+ children: i.Back
176
+ }), /* @__PURE__ */ o(e, {
169
177
  className: "ttw:flex-1",
170
- disabled: v.length === 0 || w,
171
- onClick: C,
172
- children: [w ? /* @__PURE__ */ i(c, {
178
+ disabled: y.length === 0 || T,
179
+ onClick: w,
180
+ children: [T ? /* @__PURE__ */ a(l, {
173
181
  size: 16,
174
182
  className: "ttw:animate-spin"
175
- }) : /* @__PURE__ */ i(o, { size: 16 }), r.ConfirmMatch]
183
+ }) : /* @__PURE__ */ a(s, { size: 16 }), i.ConfirmMatch]
176
184
  })]
177
185
  })
178
186
  ]
179
187
  })]
180
188
  });
181
189
  }
182
- function h() {
183
- return /* @__PURE__ */ a("div", {
190
+ function g() {
191
+ return /* @__PURE__ */ o("div", {
184
192
  className: "ttw:flex ttw:items-center ttw:gap-3 ttw:px-6 ttw:py-3",
185
193
  children: [
186
- /* @__PURE__ */ i(n, { className: "ttw:h-4 ttw:w-4" }),
187
- /* @__PURE__ */ i(n, { className: "ttw:h-4 ttw:flex-1" }),
188
- /* @__PURE__ */ i(n, { className: "ttw:h-4 ttw:w-20" }),
189
- /* @__PURE__ */ i(n, { className: "ttw:h-4 ttw:w-16" })
194
+ /* @__PURE__ */ a(n, { className: "ttw:h-4 ttw:w-4" }),
195
+ /* @__PURE__ */ a(n, { className: "ttw:h-4 ttw:flex-1" }),
196
+ /* @__PURE__ */ a(n, { className: "ttw:h-4 ttw:w-20" }),
197
+ /* @__PURE__ */ a(n, { className: "ttw:h-4 ttw:w-16" })
190
198
  ]
191
199
  });
192
200
  }
193
- function g(e, t) {
201
+ function _(e, t) {
194
202
  let n = t ?? e.split(/[?#]/)[0];
195
203
  return /\.pdf$/i.test(n);
196
204
  }
197
- function _({ url: e, fileName: t, zoom: n }) {
198
- return g(e, t) ? /* @__PURE__ */ i("iframe", {
205
+ function v({ url: e, fileName: t, zoom: n }) {
206
+ return _(e, t) ? /* @__PURE__ */ a("iframe", {
199
207
  src: `${e}#toolbar=0&navpanes=0&scrollbar=0`,
200
- title: r.ReceiptPdfPreviewTitle,
208
+ title: i.ReceiptPdfPreviewTitle,
201
209
  sandbox: "",
202
210
  referrerPolicy: "no-referrer",
203
211
  className: "ttw:w-full ttw:h-full ttw:border-0 ttw:transition-transform",
204
212
  style: { transform: `scale(${n})` }
205
- }) : /* @__PURE__ */ i("img", {
213
+ }) : /* @__PURE__ */ a("img", {
206
214
  src: e,
207
- alt: r.ReceiptImageAlt,
215
+ alt: i.ReceiptImageAlt,
208
216
  className: "ttw:max-h-full ttw:max-w-full ttw:object-contain ttw:transition-transform",
209
217
  style: { transform: `scale(${n})` }
210
218
  });
211
219
  }
212
220
  //#endregion
213
- export { m as TransactionsMatchStep };
221
+ export { h as TransactionsMatchStep };
@@ -34,6 +34,11 @@ var e = {
34
34
  NoReceiptsSubtitle: "Upload a receipt to get started.",
35
35
  NoTransactionsTitle: "No transactions without receipt",
36
36
  NoTransactionsSubtitle: "Go directly to transactions to modify receipt data if necessary.",
37
+ ReceiptsErrorTitle: "Could not load receipts",
38
+ ReceiptsErrorSubtitle: "Something went wrong while fetching your receipts. Please try again.",
39
+ TransactionsErrorTitle: "Could not load transactions",
40
+ TransactionsErrorSubtitle: "Something went wrong while fetching your transactions. Please try again.",
41
+ Retry: "Try again",
37
42
  MatchConfirmedTitle: "Match confirmed",
38
43
  MatchConfirmedSubtitle: "Your receipt has been matched to",
39
44
  LoadingReceipts: "Loading receipts",
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.5.42", n = "e834dd92d19a1bb4056ae118b2f402334ac433e2", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.43", n = "009427f64667543ac1de525aa94cd01bab485873", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.5.42",
3
+ "version": "0.5.43",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {