@tesouro/embedded-components-react 0.11.120 → 0.11.122

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 (46) hide show
  1. package/dist/index.css +32 -154
  2. package/dist/index.d.ts +11 -2
  3. package/dist/lib/ExpenseManagementWidget.d.ts +11 -2
  4. package/dist/lib/WidgetSuite.d.ts +11 -2
  5. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/ExpenseManagementWidget.js +343 -264
  6. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/labels.js +14 -0
  7. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/permissions.js +6 -3
  8. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/useExpenseTabBadgeCounts.js +34 -19
  9. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/useExpensesTransactions.js +100 -98
  10. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsActionsFeature.js +27 -24
  11. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsFeature.js +1 -0
  12. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/expenseStatus.js +2 -2
  13. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js +43 -44
  14. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index4.js +79 -40
  15. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index2.js +10 -0
  16. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index3.js +47 -46
  17. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index4.js +78 -84
  18. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index5.js +165 -158
  19. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index6.js +38 -100
  20. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index7.js +77 -54
  21. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/AccordionItemCard/AccordionItemCard.js +213 -229
  22. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/ExpenseStatusBadge.js +6 -8
  23. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesScreen/ExpensesScreen.js +66 -73
  24. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsFilterBar/ExpensesTransactionsFilterBar.js +13 -13
  25. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/ExpensesTransactionsTable.js +123 -80
  26. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/labels.js +1 -0
  27. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/FileViewer/FileViewer.js +83 -74
  28. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/DeleteReceiptDialog/DeleteReceiptDialog.js +22 -30
  29. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/TransactionDetails.js +176 -259
  30. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/labels.js +4 -2
  31. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/BulkProgress.js +1 -0
  32. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/TransactionDetailsActions.js +112 -121
  33. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/labels.js +1 -0
  34. package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/feature/dist/lib/ExpenseRequirementsWidget.js +41 -32
  35. package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/ui/dist/index3.js +43 -53
  36. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  37. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +3 -1
  38. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/CopyAddress/CopyAddress.js +55 -0
  39. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/UploadTray/UploadTray.js +84 -0
  40. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/lib/UploadReceiptWidget.js +126 -73
  41. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index2.js +14 -1
  42. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index3.js +9 -8
  43. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index4.js +75 -128
  44. package/dist/packages/shared-ui-shadcn/dist/index.js +1399 -1302
  45. package/package.json +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/badgeTones.js +0 -9
@@ -2,107 +2,45 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Button as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
5
+ import { ResultScreen as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
6
  import { ReceiptMatchLabels as t } from "./index2.js";
7
- import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
8
- import { Check as a } from "lucide-react";
7
+ import { jsx as n } from "react/jsx-runtime";
8
+ import { Check as r } from "lucide-react";
9
9
  // ../../libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index6.js
10
- function o({ matchedTransactions: o, primaryLabel: c, onPrimary: l }) {
11
- let u = o ?? [], d = u.length === 1, f = u[0];
12
- return /* @__PURE__ */ i("div", {
13
- className: "ttw:flex ttw:flex-col ttw:w-[440px] ttw:h-full ttw:ml-auto ttw:border-l ttw:border-border ttw:bg-white",
14
- children: [/* @__PURE__ */ i("div", {
15
- className: "ttw:flex-1 ttw:overflow-y-auto ttw:flex ttw:flex-col ttw:px-6 ttw:pt-12 ttw:pb-6 ttw:gap-6",
16
- children: [
17
- /* @__PURE__ */ r("div", {
18
- className: "ttw:self-center ttw:w-16 ttw:h-16 ttw:rounded-full ttw:bg-emerald-700/25 ttw:flex ttw:items-center ttw:justify-center",
19
- children: /* @__PURE__ */ r("div", {
20
- className: "ttw:w-12 ttw:h-12 ttw:rounded-full ttw:bg-emerald-700 ttw:flex ttw:items-center ttw:justify-center",
21
- children: /* @__PURE__ */ r(a, {
22
- size: 22,
23
- className: "ttw:text-white",
24
- strokeWidth: 2.5
25
- })
26
- })
27
- }),
28
- /* @__PURE__ */ i("div", {
29
- className: "ttw:flex ttw:flex-col ttw:gap-2 ttw:text-center",
30
- children: [/* @__PURE__ */ r("h2", {
31
- className: "ttw:text-xl ttw:font-semibold",
32
- children: t.MatchConfirmedTitle
33
- }), f && /* @__PURE__ */ r("p", {
34
- className: "ttw:text-sm ttw:text-muted-foreground",
35
- children: d ? /* @__PURE__ */ i(n, { children: [
36
- t.MatchConfirmedSubtitle,
37
- " ",
38
- /* @__PURE__ */ r("strong", { children: f.merchant }),
39
- "."
40
- ] }) : /* @__PURE__ */ i(n, { children: [
41
- t.MatchConfirmedMultipleSubtitle,
42
- " ",
43
- /* @__PURE__ */ r("strong", { children: t.MatchConfirmedMultipleTransactionsSuffix(u.length) })
44
- ] })
45
- })]
46
- }),
47
- u.length > 0 && /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("div", { className: "ttw:border-t ttw:border-border" }), /* @__PURE__ */ r("div", {
48
- className: "ttw:w-full ttw:flex ttw:flex-col ttw:gap-4",
49
- children: u.map((e, n) => /* @__PURE__ */ i("div", {
50
- className: "ttw:flex ttw:flex-col ttw:gap-2",
51
- children: [/* @__PURE__ */ r("span", {
52
- className: "ttw:text-sm ttw:font-semibold",
53
- children: d ? t.TransactionDetailsHeading : t.TransactionNDetailsHeading(n + 1)
54
- }), /* @__PURE__ */ i("div", {
55
- className: "ttw:rounded-xl ttw:bg-muted/50 ttw:p-2",
56
- children: [
57
- /* @__PURE__ */ r(s, {
58
- label: t.Merchant,
59
- value: e.merchant
60
- }),
61
- e.orderId && /* @__PURE__ */ r(s, {
62
- label: t.OrderId,
63
- value: e.orderId
64
- }),
65
- /* @__PURE__ */ r(s, {
66
- label: t.Location,
67
- value: e.location
68
- }),
69
- /* @__PURE__ */ r(s, {
70
- label: t.Date,
71
- value: e.date
72
- }),
73
- /* @__PURE__ */ r(s, {
74
- label: t.Time,
75
- value: e.time
76
- }),
77
- e.formattedAmount && /* @__PURE__ */ r(s, {
78
- label: t.Amount,
79
- value: e.formattedAmount
80
- })
81
- ]
82
- })]
83
- }, `${e.merchant}-${e.date}-${e.time}-${n}`))
84
- })] })
85
- ]
86
- }), /* @__PURE__ */ r("div", {
87
- className: "ttw:px-6 ttw:py-4 ttw:border-t ttw:border-border",
88
- children: /* @__PURE__ */ r(e, {
89
- className: "ttw:w-full",
90
- onClick: l,
91
- children: c
92
- })
93
- })]
10
+ function i({ matchedTransactions: i = [], primaryLabel: a, onPrimary: o }) {
11
+ let s = i[0], c = s ? i.length === 1 ? `${t.MatchConfirmedSubtitle} ${s.merchant}.` : `${t.MatchConfirmedMultipleSubtitle} ${t.MatchConfirmedMultipleTransactionsSuffix(i.length)}` : void 0, l = i.flatMap((e) => [
12
+ {
13
+ label: t.Merchant,
14
+ value: e.merchant
15
+ },
16
+ ...e.orderId ? [{
17
+ label: t.OrderId,
18
+ value: e.orderId
19
+ }] : [],
20
+ {
21
+ label: t.Location,
22
+ value: e.location
23
+ },
24
+ {
25
+ label: t.Date,
26
+ value: e.date
27
+ },
28
+ {
29
+ label: t.Time,
30
+ value: e.time
31
+ },
32
+ ...e.formattedAmount ? [{
33
+ label: t.Amount,
34
+ value: e.formattedAmount
35
+ }] : []
36
+ ]);
37
+ return /* @__PURE__ */ n(e, {
38
+ icon: /* @__PURE__ */ n(r, {}),
39
+ title: t.MatchConfirmedTitle,
40
+ description: c,
41
+ details: l,
42
+ onDone: o,
43
+ labels: { done: a }
94
44
  });
95
45
  }
96
- function s({ label: e, value: t }) {
97
- return /* @__PURE__ */ i("div", {
98
- className: "ttw:flex ttw:justify-between ttw:items-start ttw:gap-6 ttw:px-4 ttw:py-2.5",
99
- children: [/* @__PURE__ */ r("span", {
100
- className: "ttw:text-sm ttw:text-muted-foreground ttw:shrink-0",
101
- children: e
102
- }), /* @__PURE__ */ r("span", {
103
- className: "ttw:text-sm ttw:font-medium ttw:text-right",
104
- children: t
105
- })]
106
- });
107
- }
108
- export { o as MatchConfirmationStep };
46
+ export { i as MatchConfirmationStep };
@@ -7,71 +7,94 @@ import { ReceiptMatchLabels as i } from "./index2.js";
7
7
  import { ReceiptInboxStep as a } from "./index4.js";
8
8
  import { TransactionsMatchStep as o } from "./index5.js";
9
9
  import { MatchConfirmationStep as s } from "./index6.js";
10
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
10
+ import { useState as c } from "react";
11
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
11
12
  // ../../libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index7.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, 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
- receipts: p,
15
- selectedReceiptIds: m,
16
- onSelectAll: h,
17
- onReset: g,
18
- onReceiptToggle: _,
19
- onViewAttachment: v,
20
- onDeleteReceipt: y,
21
- onReview: b,
22
- onClose: d,
23
- reviewLabel: q,
24
- isLoading: x,
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,
46
- onClose: d,
47
- isLoading: D,
48
- isError: O,
49
- onRetry: k
50
- }, Z = {
51
- matchedTransactions: U,
52
- primaryLabel: W,
53
- onPrimary: G
13
+ function d({ open: d, onClose: f, step: p, receipts: m, selectedReceiptIds: h, onSelectAll: g, onReset: _, onReceiptToggle: v, onViewAttachment: y, onDeleteReceipt: b, onFilesDropped: x, onReview: S, isReceiptsLoading: C, isReceiptsError: w, onRetryReceipts: T, receiptPreviewUrl: E, receiptFileName: D, transactions: O, isTransactionsLoading: k, isTransactionsError: ee, onRetryTransactions: A, selectedTransactionIds: j, allowMultipleTransactions: M, searchValue: N, onSearchChange: P, onTransactionSelect: F, onConfirmMatch: I, isConfirming: L, zoom: R, onZoomIn: z, onZoomOut: B, canZoomIn: V, canZoomOut: H, showZoomControls: U, matchedTransactions: W, primaryLabel: G, onPrimary: K, onCancel: q, reviewLabel: J, showSelectAllButton: Y }) {
14
+ let [X, Z] = c(!1), Q = {
15
+ receipts: m,
16
+ selectedReceiptIds: h,
17
+ onSelectAll: g,
18
+ onReset: _,
19
+ onReceiptToggle: v,
20
+ onViewAttachment: y,
21
+ onDeleteReceipt: b,
22
+ onReview: S,
23
+ onClose: f,
24
+ reviewLabel: J,
25
+ isLoading: C,
26
+ isError: w,
27
+ onRetry: T,
28
+ showSelectAllButton: Y
29
+ }, $ = {
30
+ receiptPreviewUrl: E,
31
+ receiptFileName: D,
32
+ transactions: O,
33
+ selectedTransactionIds: j,
34
+ allowMultipleTransactions: M,
35
+ searchValue: N,
36
+ onSearchChange: P,
37
+ onTransactionSelect: F,
38
+ onConfirmMatch: I,
39
+ isConfirming: L,
40
+ zoom: R,
41
+ onZoomIn: z,
42
+ onZoomOut: B,
43
+ canZoomIn: V,
44
+ canZoomOut: H,
45
+ showZoomControls: U,
46
+ onCancel: q,
47
+ onClose: f,
48
+ isLoading: k,
49
+ isError: ee,
50
+ onRetry: A
54
51
  };
55
- return /* @__PURE__ */ c(e, {
56
- open: u,
57
- onOpenChange: d,
58
- children: /* @__PURE__ */ l(t, {
52
+ return /* @__PURE__ */ l(e, {
53
+ open: d,
54
+ onOpenChange: f,
55
+ children: /* @__PURE__ */ u(t, {
59
56
  showCloseButton: !1,
60
- className: `ttw:flex ttw:p-0 ttw:max-w-none ttw:rounded-none ttw:border-0 ttw:fixed ttw:inset-y-0 ttw:right-0 ttw:top-0 ttw:left-auto ttw:h-screen ttw:translate-x-0 ttw:translate-y-0 ttw:transition ttw:ease-in-out ttw:data-[state=open]:duration-500 ttw:data-[state=closed]:duration-300 ttw:data-[state=open]:slide-in-from-right ttw:data-[state=closed]:slide-out-to-right ttw:data-[state=open]:zoom-in-100 ttw:data-[state=closed]:zoom-out-100 ${f === 2 ? "ttw:w-[880px]" : "ttw:w-[440px]"}`,
57
+ className: `ttw:flex ttw:p-0 ttw:max-w-none ttw:rounded-none ttw:border-0 ttw:fixed ttw:inset-y-0 ttw:right-0 ttw:top-0 ttw:left-auto ttw:h-screen ttw:translate-x-0 ttw:translate-y-0 ttw:transition ttw:ease-in-out ttw:data-[state=open]:duration-500 ttw:data-[state=closed]:duration-300 ttw:data-[state=open]:slide-in-from-right ttw:data-[state=closed]:slide-out-to-right ttw:data-[state=open]:zoom-in-100 ttw:data-[state=closed]:zoom-out-100 ${p === 2 ? "ttw:w-[880px]" : "ttw:w-[440px]"}`,
61
58
  children: [
62
- /* @__PURE__ */ c(r, {
59
+ /* @__PURE__ */ l(r, {
63
60
  className: "ttw:sr-only",
64
61
  children: i.DialogTitle
65
62
  }),
66
- /* @__PURE__ */ c(n, {
63
+ /* @__PURE__ */ l(n, {
67
64
  className: "ttw:sr-only",
68
65
  children: i.DialogDescription
69
66
  }),
70
- f === 1 && /* @__PURE__ */ c(a, { ...Y }),
71
- f === 2 && /* @__PURE__ */ c(o, { ...X }),
72
- f === 3 && /* @__PURE__ */ c(s, { ...Z })
67
+ p === 1 && /* @__PURE__ */ u("div", {
68
+ className: "ttw:relative ttw:h-full ttw:w-full",
69
+ onDragOver: (e) => {
70
+ x && Array.from(e.dataTransfer.types).includes("Files") && (e.preventDefault(), Z(!0));
71
+ },
72
+ onDragLeave: (e) => {
73
+ e.currentTarget.contains(e.relatedTarget) || Z(!1);
74
+ },
75
+ onDrop: (e) => {
76
+ x && Array.from(e.dataTransfer.types).includes("Files") && (e.preventDefault(), Z(!1), x(Array.from(e.dataTransfer.files)));
77
+ },
78
+ children: [X && /* @__PURE__ */ l("div", {
79
+ role: "status",
80
+ className: "ttw:pointer-events-none ttw:absolute ttw:inset-0 ttw:z-10 ttw:flex ttw:items-center ttw:justify-center ttw:rounded-lg ttw:border-2 ttw:border-dashed ttw:border-primary ttw:bg-background/90",
81
+ children: /* @__PURE__ */ u("div", {
82
+ className: "ttw:rounded-lg ttw:bg-muted ttw:p-4 ttw:text-center",
83
+ children: [/* @__PURE__ */ l("p", { children: i.DropReceipts }), /* @__PURE__ */ l("p", {
84
+ className: "ttw:text-sm ttw:text-muted-foreground",
85
+ children: i.DropReceiptRules
86
+ })]
87
+ })
88
+ }), /* @__PURE__ */ l(a, { ...Q })]
89
+ }),
90
+ p === 2 && /* @__PURE__ */ l(o, { ...$ }),
91
+ p === 3 && /* @__PURE__ */ l(s, {
92
+ matchedTransactions: W,
93
+ primaryLabel: G,
94
+ onPrimary: K
95
+ })
73
96
  ]
74
97
  })
75
98
  });
76
99
  }
77
- export { i as ReceiptMatchLabels, u as ReceiptMatchSidebar };
100
+ export { i as ReceiptMatchLabels, d as ReceiptMatchSidebar };