@tesouro/embedded-components-react 0.11.120 → 0.11.123

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 (119) hide show
  1. package/README.md +6 -3
  2. package/dist/index.css +32 -161
  3. package/dist/index.d.ts +40 -8
  4. package/dist/index.js +29 -28
  5. package/dist/lib/ExpenseManagementWidget.d.ts +11 -2
  6. package/dist/lib/ReceivablesWidget.d.ts +29 -6
  7. package/dist/lib/ReceivablesWidget.js +3 -1
  8. package/dist/lib/WidgetSuite.d.ts +38 -6
  9. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/ExpenseManagementWidget.js +343 -264
  10. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/labels.js +14 -0
  11. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/permissions.js +6 -3
  12. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/useExpenseTabBadgeCounts.js +34 -19
  13. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/useExpensesTransactions.js +100 -98
  14. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsActionsFeature.js +27 -24
  15. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsFeature.js +1 -0
  16. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/expenseStatus.js +2 -2
  17. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js +43 -44
  18. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index4.js +79 -40
  19. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index2.js +10 -0
  20. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index3.js +47 -46
  21. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index4.js +78 -84
  22. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index5.js +165 -158
  23. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index6.js +38 -100
  24. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index7.js +77 -54
  25. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/AccordionItemCard/AccordionItemCard.js +213 -229
  26. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/ExpenseStatusBadge.js +6 -8
  27. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesScreen/ExpensesScreen.js +66 -73
  28. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsFilterBar/ExpensesTransactionsFilterBar.js +13 -13
  29. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/ExpensesTransactionsTable.js +123 -80
  30. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/labels.js +1 -0
  31. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/FileViewer/FileViewer.js +83 -74
  32. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/DeleteReceiptDialog/DeleteReceiptDialog.js +22 -30
  33. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/TransactionDetails.js +176 -259
  34. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/labels.js +4 -2
  35. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/BulkProgress.js +1 -0
  36. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/TransactionDetailsActions.js +112 -121
  37. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/labels.js +1 -0
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +3 -1
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableAttachmentsSection.js +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableCustomerSection.js +1 -1
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +342 -295
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentTerms.js +1 -1
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/preview.js +1 -1
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +1 -1
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/reminders.js +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/tabs.js +26 -0
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +1 -1
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +1 -1
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/mocks/labels.js +1 -1
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +30 -26
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +18 -2
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +121 -11
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +100 -11
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +39 -27
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +2 -205
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +11 -52
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +11 -210
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +27 -159
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +203 -14
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +51 -22
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +210 -2
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +154 -111
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +15 -3
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +21 -195
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +3 -2
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +116 -53
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +3 -22
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +197 -8
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +2 -78
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +53 -39
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +20 -17
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +8 -41
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +73 -25
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +36 -17
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +17 -9
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +39 -34
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +29 -14
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +18 -24
  79. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +8 -85
  80. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +33 -490
  81. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +15 -2
  82. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +22 -42
  83. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +82 -65
  84. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +475 -426
  85. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +2 -226
  86. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +46 -21
  87. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +69 -5
  88. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +445 -0
  89. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +208 -246
  90. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +22 -2
  91. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +5 -129
  92. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +247 -222
  93. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +1 -2
  94. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +125 -242
  95. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +23 -56
  96. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +229 -209
  97. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +3 -47
  98. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +248 -0
  99. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js +60 -0
  100. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +2 -17
  101. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +194 -0
  102. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js +47 -0
  103. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +53 -117
  104. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +9 -99
  105. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +3 -40
  106. package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/feature/dist/lib/ExpenseRequirementsWidget.js +41 -32
  107. package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/ui/dist/index3.js +43 -53
  108. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  109. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +3 -1
  110. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/CopyAddress/CopyAddress.js +55 -0
  111. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/UploadTray/UploadTray.js +84 -0
  112. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/lib/UploadReceiptWidget.js +126 -73
  113. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index2.js +14 -1
  114. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index3.js +9 -8
  115. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index4.js +75 -128
  116. package/dist/packages/shared-ui-shadcn/dist/index.js +1399 -1302
  117. package/package.json +1 -1
  118. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/badgeTones.js +0 -9
  119. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +0 -27
@@ -2,116 +2,110 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Button as e, Skeleton as t } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { ErrorState as n } from "../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
5
+ import { Button as e, Heading as t, Skeleton as n, Tooltip as r, TooltipContent as i, TooltipProvider as a, TooltipTrigger as o } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { EmptyState as s } from "../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
7
+ import { ErrorState as c } from "../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
8
+ import { LoadingRegion as l } from "../../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
7
9
  import "../../../../shared/ui/dist/index.js";
8
- import { ReceiptMatchLabels as r } from "./index2.js";
9
- import { ReceiptInboxItem as i } from "./index3.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
+ import { ReceiptMatchLabels as u } from "./index2.js";
11
+ import { ReceiptInboxItem as d } from "./index3.js";
12
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
13
+ import { FileText as m, X as h } from "lucide-react";
12
14
  // ../../libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index4.js
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", {
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
+ var g = 4;
16
+ function _({ embedded: n = !1, receipts: _, selectedReceiptIds: y, onSelectAll: b, onReset: x, onReceiptToggle: S, onViewAttachment: C, onDeleteReceipt: w, onReview: T, onClose: E, reviewLabel: D, isLoading: O = !1, isError: k = !1, onRetry: A, showSelectAllButton: j = !0 }) {
17
+ return /* @__PURE__ */ p("div", {
18
+ className: n ? "ttw:flex ttw:flex-col ttw:h-full" : "ttw:flex ttw:flex-col ttw:w-[440px] ttw:h-full ttw:ml-auto ttw:border-l ttw:border-border ttw:bg-card",
17
19
  children: [
18
- /* @__PURE__ */ o("div", {
20
+ n && /* @__PURE__ */ f(t, {
21
+ variant: "section",
22
+ level: 2,
23
+ children: u.InboxTitle
24
+ }),
25
+ !n && /* @__PURE__ */ p("div", {
19
26
  className: "ttw:flex ttw:items-center ttw:justify-between ttw:px-6 ttw:pt-5 ttw:pb-2",
20
- children: [/* @__PURE__ */ a("h2", {
21
- className: "ttw:text-lg ttw:font-semibold",
22
- children: x || S ? r.InboxTitle : `${r.InboxTitle} (${t.length})`
23
- }), /* @__PURE__ */ a(e, {
24
- variant: "ghost",
25
- size: "sm",
26
- className: "ttw:p-1 ttw:h-auto",
27
- onClick: y,
28
- "aria-label": r.Close,
29
- children: /* @__PURE__ */ a(l, { size: 18 })
30
- })]
27
+ children: [/* @__PURE__ */ f(t, {
28
+ variant: "section",
29
+ level: 2,
30
+ children: O || k ? u.InboxTitle : `${u.InboxTitle} (${_.length})`
31
+ }), /* @__PURE__ */ f(a, { children: /* @__PURE__ */ p(r, { children: [/* @__PURE__ */ f(o, {
32
+ asChild: !0,
33
+ children: /* @__PURE__ */ f(e, {
34
+ variant: "ghost",
35
+ size: "sm",
36
+ className: "ttw:p-1 ttw:h-auto",
37
+ onClick: E,
38
+ "aria-label": u.Close,
39
+ children: /* @__PURE__ */ f(h, { size: 18 })
40
+ })
41
+ }), /* @__PURE__ */ f(i, { children: u.Close })] }) })]
31
42
  }),
32
- /* @__PURE__ */ o("div", {
43
+ /* @__PURE__ */ p("div", {
33
44
  className: "ttw:flex ttw:items-center ttw:gap-2 ttw:px-6 ttw:py-3",
34
- children: [w && /* @__PURE__ */ a(e, {
45
+ children: [j && /* @__PURE__ */ f(e, {
35
46
  variant: "outline",
36
47
  size: "sm",
37
- onClick: p,
38
- children: r.SelectAll
39
- }), /* @__PURE__ */ a(e, {
48
+ onClick: b,
49
+ children: u.SelectAll
50
+ }), /* @__PURE__ */ f(e, {
40
51
  variant: "outline",
41
52
  size: "sm",
42
- onClick: m,
43
- children: r.Reset
53
+ onClick: x,
54
+ children: u.Reset
44
55
  })]
45
56
  }),
46
- /* @__PURE__ */ a("div", {
57
+ /* @__PURE__ */ f("div", {
47
58
  className: "ttw:flex-1 ttw:overflow-y-auto ttw:flex ttw:flex-col ttw:gap-2 ttw:px-6 ttw:py-3",
48
- children: x ? /* @__PURE__ */ o("div", {
49
- role: "status",
59
+ children: O ? /* @__PURE__ */ f(l, {
60
+ isLoading: !0,
61
+ loadingLabel: u.LoadingReceipts,
50
62
  className: "ttw:flex ttw:flex-col ttw:gap-2",
51
- children: [/* @__PURE__ */ a("span", {
52
- className: "ttw:sr-only",
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", {
61
- className: "ttw:flex ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-3 ttw:flex-1 ttw:py-12",
62
- children: [/* @__PURE__ */ a("div", {
63
- className: "ttw:w-14 ttw:h-14 ttw:rounded-full ttw:bg-muted ttw:flex ttw:items-center ttw:justify-center",
64
- children: /* @__PURE__ */ a(c, {
65
- size: 24,
66
- className: "ttw:text-muted-foreground"
67
- })
68
- }), /* @__PURE__ */ o("div", {
69
- className: "ttw:flex ttw:flex-col ttw:items-center ttw:gap-1 ttw:text-center",
70
- children: [/* @__PURE__ */ a("span", {
71
- className: "ttw:text-sm ttw:font-medium",
72
- children: r.NoReceiptsTitle
73
- }), /* @__PURE__ */ a("span", {
74
- className: "ttw:text-sm ttw:text-muted-foreground",
75
- children: r.NoReceiptsSubtitle
76
- })]
77
- })]
78
- }) : t.map((e) => /* @__PURE__ */ a(i, {
63
+ children: Array.from({ length: g }).map((e, t) => /* @__PURE__ */ f(v, {}, t))
64
+ }) : k ? /* @__PURE__ */ f(c, {
65
+ title: u.ReceiptsErrorTitle,
66
+ description: u.ReceiptsErrorSubtitle,
67
+ retryLabel: u.Retry,
68
+ onRetry: A
69
+ }) : _.length === 0 ? /* @__PURE__ */ f(s, {
70
+ icon: /* @__PURE__ */ f(m, {}),
71
+ title: u.NoReceiptsTitle,
72
+ description: u.NoReceiptsSubtitle,
73
+ className: "ttw:flex-1"
74
+ }) : _.map((e) => /* @__PURE__ */ f(d, {
79
75
  item: e,
80
- selected: d.includes(e.id),
81
- onToggle: () => h(e.id),
82
- onViewAttachment: () => g(e.id),
83
- onDelete: () => _(e.id)
76
+ selected: y.includes(e.id),
77
+ onToggle: () => S(e.id),
78
+ onViewAttachment: () => C(e.id),
79
+ onDelete: () => w(e.id)
84
80
  }, e.id))
85
81
  }),
86
- /* @__PURE__ */ o("div", {
87
- className: "ttw:flex ttw:items-center ttw:gap-3 ttw:px-6 ttw:py-4 ttw:border-t ttw:border-border",
88
- children: [/* @__PURE__ */ a(e, {
89
- variant: "outline",
90
- className: "ttw:flex-1",
91
- onClick: y,
92
- children: r.Cancel
93
- }), /* @__PURE__ */ o(e, {
94
- className: "ttw:flex-1",
95
- disabled: x || d.length === 0,
96
- onClick: v,
97
- children: [b ?? r.Review, /* @__PURE__ */ a(s, { size: 16 })]
82
+ !n && /* @__PURE__ */ p("div", {
83
+ className: "ttw:flex ttw:flex-col-reverse ttw:gap-2 ttw:px-6 ttw:py-4 ttw:border-t ttw:border-border ttw:sm:flex-row ttw:sm:justify-end",
84
+ children: [/* @__PURE__ */ f(e, {
85
+ variant: "ghost",
86
+ onClick: E,
87
+ children: u.Cancel
88
+ }), /* @__PURE__ */ f(e, {
89
+ disabled: O || y.length === 0,
90
+ onClick: T,
91
+ children: D ?? u.Review
98
92
  })]
99
93
  })
100
94
  ]
101
95
  });
102
96
  }
103
- function f() {
104
- return /* @__PURE__ */ o("div", {
97
+ function v() {
98
+ return /* @__PURE__ */ p("div", {
105
99
  className: "ttw:flex ttw:items-center ttw:gap-3 ttw:py-2",
106
100
  children: [
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", {
101
+ /* @__PURE__ */ f(n, { className: "ttw:h-4 ttw:w-4" }),
102
+ /* @__PURE__ */ f(n, { className: "ttw:h-10 ttw:w-10 ttw:rounded" }),
103
+ /* @__PURE__ */ p("div", {
110
104
  className: "ttw:flex ttw:flex-col ttw:gap-1.5 ttw:flex-1",
111
- children: [/* @__PURE__ */ a(t, { className: "ttw:h-4 ttw:w-32" }), /* @__PURE__ */ a(t, { className: "ttw:h-3 ttw:w-20" })]
105
+ children: [/* @__PURE__ */ f(n, { className: "ttw:h-4 ttw:w-32" }), /* @__PURE__ */ f(n, { className: "ttw:h-3 ttw:w-20" })]
112
106
  }),
113
- /* @__PURE__ */ a(t, { className: "ttw:h-4 ttw:w-4" })
107
+ /* @__PURE__ */ f(n, { className: "ttw:h-4 ttw:w-4" })
114
108
  ]
115
109
  });
116
110
  }
117
- export { d as ReceiptInboxStep };
111
+ export { _ as ReceiptInboxStep };
@@ -2,218 +2,225 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Button as e, Input as t, Skeleton as n } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { ErrorState as r } from "../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
5
+ import { Button as e, Checkbox as t, Heading as n, Input as r, RadioGroup as i, RadioGroupItem as a, Skeleton as o, Tooltip as s, TooltipContent as c, TooltipProvider as l, TooltipTrigger as u } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { EmptyState as d } from "../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
7
+ import { ErrorState as f } from "../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
8
+ import { LoadingRegion as p } from "../../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
7
9
  import "../../../../shared/ui/dist/index.js";
8
- import { PdfFileViewer as i } from "../../../ui/dist/lib/FileViewer/PdfFileViewer.js";
9
- import { isPdf as a } from "../../../util/dist/lib/isPdf.js";
10
+ import { PdfFileViewer as m } from "../../../ui/dist/lib/FileViewer/PdfFileViewer.js";
11
+ import { isPdf as h } from "../../../util/dist/lib/isPdf.js";
10
12
  import "../../../ui/dist/index.js";
11
- import { ReceiptMatchLabels as o } from "./index2.js";
12
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
13
- import { Check as l, DollarSign as u, Loader2 as d, Search as f, X as p, ZoomIn as m, ZoomOut as h } from "lucide-react";
13
+ import { ReceiptMatchLabels as g } from "./index2.js";
14
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
15
+ import { DollarSign as y, Search as b, X as x, ZoomIn as S, ZoomOut as C } from "lucide-react";
14
16
  // ../../libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index5.js
15
- var g = 5;
16
- function _({ receiptPreviewUrl: n, receiptFileName: i, transactions: a, selectedTransactionIds: _, 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 }) {
17
- return /* @__PURE__ */ c("div", {
17
+ var w = 5;
18
+ function T({ embedded: o = !1, receiptPreviewUrl: m, receiptFileName: h, transactions: T, selectedTransactionIds: O, allowMultipleTransactions: k = !1, searchValue: A, onSearchChange: j, onTransactionSelect: M, onConfirmMatch: N, isConfirming: P = !1, zoom: F = 1, onZoomIn: I, onZoomOut: L, canZoomIn: R = !0, canZoomOut: z = !0, showZoomControls: B = !!(m && (I || L)), onCancel: V, onClose: H, isLoading: U = !1, isError: W = !1, onRetry: G }) {
19
+ let K = T.map((e) => {
20
+ let n = O.includes(e.id);
21
+ return /* @__PURE__ */ v("label", {
22
+ className: `ttw:flex ttw:items-center ttw:gap-3 ttw:px-6 ttw:py-3 ttw:cursor-pointer ttw:transition-colors ${n ? "ttw:bg-primary/5" : "ttw:hover:bg-muted/50"}`,
23
+ children: [
24
+ k ? /* @__PURE__ */ _(t, {
25
+ checked: n,
26
+ onCheckedChange: () => M(e.id),
27
+ "aria-label": g.SelectTransaction(e.merchantName)
28
+ }) : /* @__PURE__ */ _(a, {
29
+ value: e.id,
30
+ "aria-label": g.SelectTransaction(e.merchantName),
31
+ onClick: () => {
32
+ n && M(e.id);
33
+ }
34
+ }),
35
+ /* @__PURE__ */ _("span", {
36
+ className: "ttw:min-w-0 ttw:flex-1 ttw:text-sm ttw:font-medium ttw:truncate",
37
+ children: e.merchantName
38
+ }),
39
+ /* @__PURE__ */ _("span", {
40
+ className: "ttw:w-24 ttw:text-sm ttw:text-muted-foreground ttw:shrink-0",
41
+ children: e.date
42
+ }),
43
+ /* @__PURE__ */ _("span", {
44
+ className: "ttw:min-w-20 ttw:whitespace-nowrap ttw:text-sm ttw:font-medium ttw:tabular-nums ttw:text-right ttw:shrink-0",
45
+ children: e.formattedAmount
46
+ })
47
+ ]
48
+ }, e.id);
49
+ });
50
+ return /* @__PURE__ */ v("div", {
18
51
  className: "ttw:flex ttw:w-full ttw:h-full",
19
- children: [/* @__PURE__ */ c("div", {
52
+ children: [!o && /* @__PURE__ */ v("div", {
20
53
  className: "ttw:w-110 ttw:ml-auto ttw:bg-muted ttw:relative ttw:flex ttw:items-center ttw:justify-center ttw:overflow-hidden",
21
- children: [n && /* @__PURE__ */ s(y, {
22
- url: n,
23
- fileName: i,
24
- zoom: E
25
- }), j && /* @__PURE__ */ c("div", {
26
- className: "ttw:absolute ttw:bottom-4 ttw:left-4 ttw:z-10 ttw:flex ttw:items-center ttw:border ttw:rounded-[14px] ttw:border-border ttw:bg-card",
54
+ children: [m && /* @__PURE__ */ _(D, {
55
+ url: m,
56
+ fileName: h,
57
+ zoom: F
58
+ }), B && /* @__PURE__ */ _(l, { children: /* @__PURE__ */ v("div", {
59
+ className: "ttw:absolute ttw:bottom-4 ttw:left-4 ttw:z-10 ttw:flex ttw:items-center ttw:border ttw:rounded-lg ttw:border-border ttw:bg-card",
27
60
  children: [
28
- /* @__PURE__ */ s(e, {
29
- variant: "ghost",
30
- size: "icon-sm",
31
- onClick: O,
32
- disabled: !O || !A,
33
- "aria-label": o.ZoomOut,
34
- className: "ttw:rounded-none ttw:rounded-tl-[14px] ttw:rounded-bl-[14px]",
35
- children: /* @__PURE__ */ s(h, { className: "ttw:size-4" })
36
- }),
37
- /* @__PURE__ */ s("div", { className: "ttw:w-px ttw:self-stretch ttw:bg-border" }),
38
- /* @__PURE__ */ s(e, {
39
- variant: "ghost",
40
- size: "icon-sm",
41
- onClick: D,
42
- disabled: !D || !k,
43
- "aria-label": o.ZoomIn,
44
- className: "ttw:rounded-none ttw:rounded-tr-[14px] ttw:rounded-br-[14px]",
45
- children: /* @__PURE__ */ s(m, { className: "ttw:size-4" })
46
- })
61
+ /* @__PURE__ */ v(s, { children: [/* @__PURE__ */ _(u, {
62
+ asChild: !0,
63
+ children: /* @__PURE__ */ _(e, {
64
+ variant: "ghost",
65
+ size: "icon-sm",
66
+ onClick: L,
67
+ disabled: !L || !z,
68
+ "aria-label": g.ZoomOut,
69
+ className: "ttw:rounded-none ttw:rounded-tl-lg ttw:rounded-bl-lg",
70
+ children: /* @__PURE__ */ _(C, { className: "ttw:size-4" })
71
+ })
72
+ }), /* @__PURE__ */ _(c, { children: g.ZoomOut })] }),
73
+ /* @__PURE__ */ _("div", { className: "ttw:w-px ttw:self-stretch ttw:bg-border" }),
74
+ /* @__PURE__ */ v(s, { children: [/* @__PURE__ */ _(u, {
75
+ asChild: !0,
76
+ children: /* @__PURE__ */ _(e, {
77
+ variant: "ghost",
78
+ size: "icon-sm",
79
+ onClick: I,
80
+ disabled: !I || !R,
81
+ "aria-label": g.ZoomIn,
82
+ className: "ttw:rounded-none ttw:rounded-tr-lg ttw:rounded-br-lg",
83
+ children: /* @__PURE__ */ _(S, { className: "ttw:size-4" })
84
+ })
85
+ }), /* @__PURE__ */ _(c, { children: g.ZoomIn })] })
47
86
  ]
48
- })]
49
- }), /* @__PURE__ */ c("div", {
50
- className: "ttw:flex ttw:flex-col ttw:w-110 ttw:h-full ttw:border-l ttw:border-border ttw:bg-card",
87
+ }) })]
88
+ }), /* @__PURE__ */ v("div", {
89
+ className: o ? "ttw:flex ttw:flex-col ttw:w-full ttw:h-full" : "ttw:flex ttw:flex-col ttw:w-110 ttw:h-full ttw:border-l ttw:border-border ttw:bg-card",
51
90
  children: [
52
- /* @__PURE__ */ c("div", {
91
+ o && /* @__PURE__ */ _(n, {
92
+ variant: "section",
93
+ level: 2,
94
+ children: g.TransactionsTitle
95
+ }),
96
+ !o && /* @__PURE__ */ v("div", {
53
97
  className: "ttw:flex ttw:items-center ttw:justify-between ttw:px-6 ttw:pt-5 ttw:pb-2",
54
- children: [/* @__PURE__ */ s("h2", {
55
- className: "ttw:text-lg ttw:font-semibold",
56
- children: o.TransactionsTitle
57
- }), /* @__PURE__ */ s(e, {
58
- variant: "ghost",
59
- size: "sm",
60
- className: "ttw:p-1 ttw:h-auto",
61
- onClick: N,
62
- "aria-label": o.Close,
63
- children: /* @__PURE__ */ s(p, { size: 18 })
64
- })]
98
+ children: [/* @__PURE__ */ _(n, {
99
+ variant: "section",
100
+ level: 2,
101
+ children: g.TransactionsTitle
102
+ }), /* @__PURE__ */ _(l, { children: /* @__PURE__ */ v(s, { children: [/* @__PURE__ */ _(u, {
103
+ asChild: !0,
104
+ children: /* @__PURE__ */ _(e, {
105
+ variant: "ghost",
106
+ size: "sm",
107
+ className: "ttw:p-1 ttw:h-auto",
108
+ onClick: H,
109
+ "aria-label": g.Close,
110
+ children: /* @__PURE__ */ _(x, { size: 18 })
111
+ })
112
+ }), /* @__PURE__ */ _(c, { children: g.Close })] }) })]
65
113
  }),
66
- /* @__PURE__ */ s("div", {
114
+ /* @__PURE__ */ _("div", {
67
115
  className: "ttw:px-6 ttw:py-3",
68
- children: /* @__PURE__ */ c("div", {
116
+ children: /* @__PURE__ */ v("div", {
69
117
  className: "ttw:relative",
70
- children: [/* @__PURE__ */ s(f, {
118
+ children: [/* @__PURE__ */ _(b, {
71
119
  size: 16,
72
120
  className: "ttw:absolute ttw:left-3 ttw:top-1/2 ttw:-translate-y-1/2 ttw:text-muted-foreground"
73
- }), /* @__PURE__ */ s(t, {
74
- value: x,
75
- onChange: (e) => S(e.target.value),
76
- placeholder: o.SearchPlaceholder,
121
+ }), /* @__PURE__ */ _(r, {
122
+ value: A,
123
+ onChange: (e) => j(e.target.value),
124
+ placeholder: g.SearchPlaceholder,
77
125
  className: "ttw:pl-9!"
78
126
  })]
79
127
  })
80
128
  }),
81
- /* @__PURE__ */ c("div", {
129
+ /* @__PURE__ */ v("div", {
82
130
  className: "ttw:flex ttw:items-center ttw:gap-3 ttw:px-6 ttw:py-2 ttw:bg-muted/40",
83
131
  children: [
84
- /* @__PURE__ */ s("span", {
132
+ /* @__PURE__ */ _("span", {
85
133
  className: "ttw:w-4 ttw:shrink-0",
86
134
  "aria-hidden": !0
87
135
  }),
88
- /* @__PURE__ */ s("span", {
136
+ /* @__PURE__ */ _("span", {
89
137
  className: "ttw:flex-1 ttw:text-xs ttw:font-medium ttw:text-muted-foreground",
90
- children: o.Merchant
138
+ children: g.Merchant
91
139
  }),
92
- /* @__PURE__ */ s("span", {
140
+ /* @__PURE__ */ _("span", {
93
141
  className: "ttw:w-24 ttw:text-xs ttw:font-medium ttw:text-muted-foreground",
94
- children: o.Date
142
+ children: g.Date
95
143
  }),
96
- /* @__PURE__ */ s("span", {
97
- className: "ttw:w-20 ttw:text-xs ttw:font-medium ttw:text-muted-foreground ttw:text-right",
98
- children: o.Amount
144
+ /* @__PURE__ */ _("span", {
145
+ className: "ttw:min-w-20 ttw:text-xs ttw:font-medium ttw:text-muted-foreground ttw:text-right",
146
+ children: g.Amount
99
147
  })
100
148
  ]
101
149
  }),
102
- /* @__PURE__ */ c("div", {
150
+ /* @__PURE__ */ v("div", {
103
151
  className: "ttw:flex-1 ttw:overflow-y-auto",
104
152
  children: [
105
- P && /* @__PURE__ */ c("div", {
106
- role: "status",
107
- children: [/* @__PURE__ */ s("span", {
108
- className: "ttw:sr-only",
109
- children: o.LoadingTransactions
110
- }), Array.from({ length: g }).map((e, t) => /* @__PURE__ */ s(v, {}, t))]
153
+ U && /* @__PURE__ */ _(p, {
154
+ isLoading: !0,
155
+ loadingLabel: g.LoadingTransactions,
156
+ children: Array.from({ length: w }).map((e, t) => /* @__PURE__ */ _(E, {}, t))
111
157
  }),
112
- !P && F && /* @__PURE__ */ s(r, {
113
- title: o.TransactionsErrorTitle,
114
- description: o.TransactionsErrorSubtitle,
115
- retryLabel: o.Retry,
116
- onRetry: I
158
+ !U && W && /* @__PURE__ */ _(f, {
159
+ title: g.TransactionsErrorTitle,
160
+ description: g.TransactionsErrorSubtitle,
161
+ retryLabel: g.Retry,
162
+ onRetry: G
117
163
  }),
118
- !P && !F && a.length === 0 && /* @__PURE__ */ c("div", {
119
- className: "ttw:flex ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-3 ttw:h-full ttw:py-12",
120
- children: [/* @__PURE__ */ s("div", {
121
- className: "ttw:w-14 ttw:h-14 ttw:rounded-full ttw:bg-muted ttw:flex ttw:items-center ttw:justify-center",
122
- children: /* @__PURE__ */ s(u, {
123
- size: 24,
124
- className: "ttw:text-muted-foreground"
125
- })
126
- }), /* @__PURE__ */ c("div", {
127
- className: "ttw:flex ttw:flex-col ttw:items-center ttw:gap-1 ttw:text-center ttw:px-6",
128
- children: [/* @__PURE__ */ s("span", {
129
- className: "ttw:text-sm ttw:font-medium",
130
- children: o.NoTransactionsTitle
131
- }), /* @__PURE__ */ s("span", {
132
- className: "ttw:text-sm ttw:text-muted-foreground",
133
- children: o.NoTransactionsSubtitle
134
- })]
135
- })]
164
+ !U && !W && T.length === 0 && /* @__PURE__ */ _(d, {
165
+ icon: /* @__PURE__ */ _(y, {}),
166
+ title: g.NoTransactionsTitle,
167
+ description: g.NoTransactionsSubtitle,
168
+ className: "ttw:h-full"
136
169
  }),
137
- !P && !F && a.map((e) => {
138
- let t = _.includes(e.id);
139
- return /* @__PURE__ */ c("label", {
140
- className: `ttw:flex ttw:items-center ttw:gap-3 ttw:px-6 ttw:py-3 ttw:cursor-pointer ttw:transition-colors ${t ? "ttw:bg-primary/5" : "ttw:hover:bg-muted/50"}`,
141
- children: [
142
- /* @__PURE__ */ s("input", {
143
- type: b ? "checkbox" : "radio",
144
- name: b ? void 0 : "receipt-match-transaction",
145
- checked: t,
146
- onChange: () => {
147
- (b || !t) && C(e.id);
148
- },
149
- onClick: () => {
150
- !b && t && C(e.id);
151
- },
152
- "aria-label": `Select transaction from ${e.merchantName}`,
153
- className: "ttw:h-4 ttw:w-4 ttw:border ttw:border-input ttw:accent-primary ttw:cursor-pointer ttw:shrink-0"
154
- }),
155
- /* @__PURE__ */ s("span", {
156
- className: "ttw:flex-1 ttw:text-sm ttw:font-medium ttw:truncate",
157
- children: e.merchantName
158
- }),
159
- /* @__PURE__ */ s("span", {
160
- className: "ttw:w-24 ttw:text-sm ttw:text-muted-foreground ttw:shrink-0",
161
- children: e.date
162
- }),
163
- /* @__PURE__ */ s("span", {
164
- className: "ttw:w-20 ttw:text-sm ttw:font-medium ttw:tabular-nums ttw:text-right ttw:shrink-0",
165
- children: e.formattedAmount
166
- })
167
- ]
168
- }, e.id);
169
- })
170
+ !U && !W && T.length > 0 && (k ? /* @__PURE__ */ _("div", {
171
+ role: "group",
172
+ "aria-label": g.TransactionsTitle,
173
+ children: K
174
+ }) : /* @__PURE__ */ _(i, {
175
+ "aria-label": g.TransactionsTitle,
176
+ value: O[0] ?? "",
177
+ onValueChange: M,
178
+ className: "ttw:grid-cols-[minmax(0,1fr)] ttw:gap-0",
179
+ children: K
180
+ }))
170
181
  ]
171
182
  }),
172
- /* @__PURE__ */ c("div", {
173
- className: "ttw:flex ttw:items-center ttw:gap-3 ttw:px-6 ttw:py-4 ttw:border-t ttw:border-border",
174
- children: [/* @__PURE__ */ s(e, {
175
- variant: "outline",
176
- className: "ttw:flex-1",
177
- onClick: M,
178
- children: o.Back
179
- }), /* @__PURE__ */ c(e, {
180
- className: "ttw:flex-1",
181
- disabled: _.length === 0 || T,
182
- onClick: w,
183
- children: [T ? /* @__PURE__ */ s(d, {
184
- size: 16,
185
- className: "ttw:animate-spin"
186
- }) : /* @__PURE__ */ s(l, { size: 16 }), o.ConfirmMatch]
183
+ !o && /* @__PURE__ */ v("div", {
184
+ className: "ttw:flex ttw:flex-col-reverse ttw:gap-2 ttw:px-6 ttw:py-4 ttw:border-t ttw:border-border ttw:sm:flex-row ttw:sm:justify-end",
185
+ children: [/* @__PURE__ */ _(e, {
186
+ variant: "ghost",
187
+ onClick: V,
188
+ children: g.Back
189
+ }), /* @__PURE__ */ _(e, {
190
+ disabled: O.length === 0 || P,
191
+ onClick: N,
192
+ loading: P,
193
+ children: g.ConfirmMatch
187
194
  })]
188
195
  })
189
196
  ]
190
197
  })]
191
198
  });
192
199
  }
193
- function v() {
194
- return /* @__PURE__ */ c("div", {
200
+ function E() {
201
+ return /* @__PURE__ */ v("div", {
195
202
  className: "ttw:flex ttw:items-center ttw:gap-3 ttw:px-6 ttw:py-3",
196
203
  children: [
197
- /* @__PURE__ */ s(n, { className: "ttw:h-4 ttw:w-4" }),
198
- /* @__PURE__ */ s(n, { className: "ttw:h-4 ttw:flex-1" }),
199
- /* @__PURE__ */ s(n, { className: "ttw:h-4 ttw:w-20" }),
200
- /* @__PURE__ */ s(n, { className: "ttw:h-4 ttw:w-16" })
204
+ /* @__PURE__ */ _(o, { className: "ttw:h-4 ttw:w-4" }),
205
+ /* @__PURE__ */ _(o, { className: "ttw:h-4 ttw:flex-1" }),
206
+ /* @__PURE__ */ _(o, { className: "ttw:h-4 ttw:w-20" }),
207
+ /* @__PURE__ */ _(o, { className: "ttw:h-4 ttw:w-16" })
201
208
  ]
202
209
  });
203
210
  }
204
- function y({ url: e, fileName: t, zoom: n }) {
205
- return a(e, t) ? /* @__PURE__ */ s("div", {
211
+ function D({ url: e, fileName: t, zoom: n }) {
212
+ return h(e, t) ? /* @__PURE__ */ _("div", {
206
213
  className: "ttw:absolute ttw:inset-0 ttw:overflow-auto",
207
- children: /* @__PURE__ */ s(i, {
214
+ children: /* @__PURE__ */ _(m, {
208
215
  url: e,
209
216
  scale: n,
210
- title: o.ReceiptPdfPreviewTitle
217
+ title: g.ReceiptPdfPreviewTitle
211
218
  })
212
- }) : /* @__PURE__ */ s("img", {
219
+ }) : /* @__PURE__ */ _("img", {
213
220
  src: e,
214
- alt: o.ReceiptImageAlt,
221
+ alt: g.ReceiptImageAlt,
215
222
  className: "ttw:max-h-full ttw:max-w-full ttw:object-contain ttw:transition-transform",
216
223
  style: { transform: `scale(${n})` }
217
224
  });
218
225
  }
219
- export { _ as TransactionsMatchStep };
226
+ export { D as ReceiptPreview, T as TransactionsMatchStep };