@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,275 +2,192 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Alert as e, AlertDescription as t, Badge as n, Button as r, Dialog as ee, DialogClose as te, DialogContent as ne, DialogDescription as re, DialogFooter as i, DialogHeader as a, DialogTitle as o, Separator as s, Skeleton as c, Typography as l } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { ExpenseStatusBadge as u } from "../ExpenseStatusBadge/ExpenseStatusBadge.js";
7
- import { FileViewer as d } from "../FileViewer/FileViewer.js";
8
- import { AccordionItemCard as f } from "../AccordionItemCard/AccordionItemCard.js";
9
- import { TRANSACTION_DETAILS_LABELS_EN as ie } from "./labels.js";
10
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
11
- import { CloudUpload as ae, DollarSign as oe, Loader as g, Receipt as se, X as ce } from "lucide-react";
5
+ import { FullPageModal as e, Skeleton as ee, Typography as t } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { ErrorState as n } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
7
+ import { LoadingRegion as r } from "../../../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
8
+ import { FileDropZone as i } from "../../../../../shared/ui/dist/lib/FileDropZone/FileDropZone.js";
9
+ import "../../../../../shared/ui/dist/index.js";
10
+ import { ExpenseStatusBadge as a } from "../ExpenseStatusBadge/ExpenseStatusBadge.js";
11
+ import { FileViewer as o } from "../FileViewer/FileViewer.js";
12
+ import { AccordionItemCard as s } from "../AccordionItemCard/AccordionItemCard.js";
13
+ import { TRANSACTION_DETAILS_LABELS_EN as c } from "./labels.js";
14
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
15
+ import { Loader as f, Receipt as p } from "lucide-react";
12
16
  // ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/TransactionDetails.js
13
- var _ = 3, v = () => void 0;
14
- function y({ open: y, onClose: b, transactionId: x, transactionDate: S, statusLabel: C, statusTone: w, isRejected: T, isPendingReview: E, amount: D, merchant: O, receiptUrl: k, isLoading: A, isError: j, isClosingDisabled: M, cardLabel: N, cardName: P, cardholder: F, showCardholder: I, showPhysicalPill: L, isDescriptionRequired: R, isReceiptRequired: z, isReceiptAutoMatched: B, isReceiptActionDisabled: V, receiptButtonLabel: H, receiptButtonIcon: U, receiptButtonVariant: W, showNoReceiptWarning: G, onDeleteReceiptClick: K, onUploadClick: q, onOpenReceiptInbox: le, onSubmitWithoutReceipt: ue, onFileDrop: J, isUploading: Y, descriptionValue: X, initialDescriptionValue: de, onDescriptionChange: fe, onSaveDescription: pe, onCancelDescription: me, isSavingDescription: he, isMemoEditable: ge, memoBadgeLabel: _e, isReadingReceipt: ve, showApprovalCard: ye, hasAppliedPolicy: be, greaterThanValue: xe, lessThanValue: Se, ruleLabel: Ce, rejectionReason: we, approverName: Te, isAutoApproved: Ee, isManuallyApproved: De, showAccountingCard: Oe, glCategory: ke = "", initialGlCategory: Ae = "", glCategoryOptions: je = [], onGlCategoryChange: Me, department: Ne = "", initialDepartment: Pe = "", departmentOptions: Fe = [], onDepartmentChange: Ie, location: Le = "", initialLocation: Re = "", locationOptions: ze = [], onLocationChange: Be, onSaveAccounting: Ve, onCancelAccounting: He, isSavingAccounting: Ue, isGlCategoryDisabled: Z, isAccountingDisabled: We, glCategoryHighlight: Ge, departmentHighlight: Ke, locationHighlight: qe, showAuditHistoryCard: Je, auditHistoryRows: Ye, isLoadingAuditHistory: Xe, isAuditHistoryError: Ze, children: Qe, labels: $e, cardLabels: Q, fileViewerLabels: et, historyLabels: tt }) {
17
+ var m = 3, h = () => void 0;
18
+ function g({ open: g, onClose: _, transactionId: v, transactionDate: y, statusLabel: b, statusTone: te, isRejected: ne, isPendingReview: x, amount: S, merchant: C, receiptUrl: w, isLoading: T, isError: E, onRetry: D, isClosingDisabled: O, cardLabel: k, cardName: A, cardholder: j, showCardholder: M, showPhysicalPill: N, isDescriptionRequired: P, isReceiptRequired: F, isReceiptAutoMatched: I, isReceiptActionDisabled: L, receiptButtonLabel: R, receiptButtonIcon: z, receiptButtonVariant: B, showNoReceiptWarning: V, onDeleteReceiptClick: H, onUploadClick: U, onOpenReceiptInbox: W, onSubmitWithoutReceipt: G, onFileDrop: K, isUploading: q, descriptionValue: J, initialDescriptionValue: Y, onDescriptionChange: X, onSaveDescription: Z, onCancelDescription: re, isSavingDescription: ie, isMemoEditable: ae, memoBadgeLabel: oe, isReadingReceipt: se, showApprovalCard: ce, hasAppliedPolicy: le, greaterThanValue: ue, lessThanValue: de, ruleLabel: fe, rejectionReason: pe, approverName: me, isAutoApproved: he, isManuallyApproved: ge, showAccountingCard: _e, glCategory: ve = "", initialGlCategory: ye = "", glCategoryOptions: be = [], onGlCategoryChange: xe, department: Se = "", initialDepartment: Ce = "", departmentOptions: we = [], onDepartmentChange: Te, location: Ee = "", initialLocation: De = "", locationOptions: Oe = [], onLocationChange: ke, onSaveAccounting: Ae, onCancelAccounting: je, isSavingAccounting: Me, isGlCategoryDisabled: Ne, isAccountingDisabled: Pe, glCategoryHighlight: Fe, departmentHighlight: Ie, locationHighlight: Le, showAuditHistoryCard: Re, auditHistoryRows: ze, isLoadingAuditHistory: Be, isAuditHistoryError: Ve, children: He, labels: Ue, cardLabels: Q, fileViewerLabels: We, historyLabels: Ge }) {
15
19
  let $ = {
16
- ...ie,
17
- ...$e
20
+ ...c,
21
+ ...Ue
18
22
  };
19
- return /* @__PURE__ */ m(ee, {
20
- open: y,
23
+ return /* @__PURE__ */ u(e, {
24
+ open: g,
21
25
  onOpenChange: (e) => {
22
- !e && !M && b();
26
+ !e && !O && _();
23
27
  },
24
- children: /* @__PURE__ */ h(ne, {
25
- fullScreen: !0,
26
- showCloseButton: !1,
27
- className: "ttw:flex ttw:p-0",
28
- children: [/* @__PURE__ */ h("div", {
29
- className: "ttw:flex ttw:flex-1/2 ttw:flex-col ttw:overflow-hidden ttw:border-r ttw:border-border",
28
+ title: /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("span", {
29
+ className: "ttw:sr-only",
30
+ children: [$.screenReaderTitle, ": "]
31
+ }), T ? $.contentTitle : $.amountAtMerchant(S, C)] }),
32
+ description: $.screenReaderDescription,
33
+ submitting: O,
34
+ labels: { close: $.closeDialog },
35
+ primaryAction: T || E ? void 0 : He,
36
+ preview: /* @__PURE__ */ u("div", {
37
+ className: "ttw:flex ttw:h-full ttw:min-h-96 ttw:w-full ttw:items-stretch",
38
+ children: w ? /* @__PURE__ */ u(o, {
39
+ url: w,
40
+ className: "ttw:min-h-0 ttw:w-full",
41
+ showDeleteOption: !!H,
42
+ onDeleteClick: H,
43
+ labels: We
44
+ }) : U || K ? q ? /* @__PURE__ */ d("span", {
45
+ role: "status",
46
+ className: "ttw:flex ttw:items-center ttw:gap-2",
47
+ children: [/* @__PURE__ */ u(f, {
48
+ className: "ttw:size-4 ttw:animate-spin",
49
+ "aria-hidden": !0
50
+ }), $.uploadingReceipt]
51
+ }) : /* @__PURE__ */ u(i, {
52
+ label: `${$.dropFilesHere} ${$.clickToBrowse}`,
53
+ rules: $.acceptedFileTypes,
54
+ inputLabel: $.clickToBrowse,
55
+ disabled: T,
56
+ onBrowse: U,
57
+ onFilesSelected: (e) => {
58
+ e[0] && K?.(e[0]);
59
+ }
60
+ }) : /* @__PURE__ */ u("div", {
61
+ className: "ttw:flex ttw:size-full ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-2 ttw:rounded-md ttw:border ttw:border-dashed ttw:border-border ttw:bg-background",
62
+ children: !T && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", {
63
+ className: "ttw:flex ttw:size-11 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-muted",
64
+ children: /* @__PURE__ */ u(p, {
65
+ className: "ttw:size-5 ttw:text-muted-foreground",
66
+ "aria-hidden": !0
67
+ })
68
+ }), /* @__PURE__ */ u(t, {
69
+ variant: "body2",
70
+ color: "muted",
71
+ children: $.noReceiptAttached
72
+ })] })
73
+ })
74
+ }),
75
+ children: /* @__PURE__ */ d("div", {
76
+ className: "ttw:mx-auto ttw:flex ttw:w-full ttw:max-w-180 ttw:flex-col ttw:gap-4",
77
+ children: [!T && /* @__PURE__ */ d("div", {
78
+ className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2",
30
79
  children: [
31
- /* @__PURE__ */ h(a, {
32
- className: "ttw:h-20 ttw:flex-row ttw:items-center ttw:gap-3 ttw:px-8 ttw:py-6",
33
- children: [
34
- /* @__PURE__ */ m(o, {
35
- className: "ttw:sr-only",
36
- children: $.screenReaderTitle
37
- }),
38
- /* @__PURE__ */ m(re, {
39
- className: "ttw:sr-only",
40
- children: $.screenReaderDescription
41
- }),
42
- /* @__PURE__ */ m("div", {
43
- className: "ttw:mr-3 ttw:flex ttw:size-15 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-emerald-700/25 ttw:shadow-[0_0_40px_8px] ttw:shadow-emerald-700/25",
44
- children: /* @__PURE__ */ m("div", {
45
- className: "ttw:flex ttw:size-11 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-emerald-700 ttw:text-white",
46
- children: /* @__PURE__ */ m(oe, {
47
- className: "ttw:size-5",
48
- "aria-hidden": !0
49
- })
50
- })
51
- }),
52
- /* @__PURE__ */ m(l, {
53
- variant: "h4",
54
- children: $.contentTitle
55
- }),
56
- /* @__PURE__ */ m(s, { orientation: "vertical" }),
57
- !A && /* @__PURE__ */ m(l, {
58
- variant: "h5",
59
- className: "ttw:whitespace-nowrap",
60
- children: S
61
- }),
62
- !A && /* @__PURE__ */ m(u, {
63
- label: C,
64
- tone: w
65
- }),
66
- !A && ve && /* @__PURE__ */ h(n, {
67
- role: "status",
68
- variant: "outline",
69
- className: "ttw:border-purple-100 ttw:bg-purple-100 ttw:text-purple-700 ttw:hover:bg-purple-100",
70
- children: [/* @__PURE__ */ m(g, {
71
- className: "ttw:animate-spin",
72
- "aria-hidden": !0
73
- }), $.readingReceipt]
74
- })
75
- ]
80
+ /* @__PURE__ */ u("span", {
81
+ className: "ttw:text-sm ttw:text-muted-foreground",
82
+ children: y
76
83
  }),
77
- /* @__PURE__ */ m("div", {
78
- className: "ttw:mx-auto ttw:flex ttw:w-140 ttw:flex-1 ttw:flex-col ttw:gap-4 ttw:overflow-y-auto ttw:px-6 ttw:py-12",
79
- children: j ? /* @__PURE__ */ m(e, {
80
- variant: "destructive",
81
- children: /* @__PURE__ */ m(t, { children: $.loadFailed })
82
- }) : A ? Array.from({ length: _ }, (e, t) => /* @__PURE__ */ m(c, {
83
- width: "100%",
84
- height: 290
85
- }, t)) : /* @__PURE__ */ h(p, { children: [
86
- /* @__PURE__ */ m(l, {
87
- variant: "h2",
88
- className: "ttw:font-bold",
89
- children: $.amountAtMerchant(D, O)
90
- }),
91
- /* @__PURE__ */ m(f, {
92
- type: "requirements",
93
- title: $.requirementsCardTitle,
94
- cardLabel: N,
95
- cardName: P,
96
- cardholder: F,
97
- showCardholder: I,
98
- showPhysicalPill: L,
99
- receiptFileUrl: k,
100
- hasMissingInfo: !!(R && !X || z && !k),
101
- showNoReceiptWarning: !!G,
102
- isDescriptionRequired: R,
103
- isReceiptRequired: z,
104
- isReceiptAutoMatched: B,
105
- isReceiptActionDisabled: V,
106
- receiptButtonLabel: H,
107
- receiptButtonIcon: U,
108
- receiptButtonVariant: W,
109
- onUploadClick: q,
110
- onOpenReceiptInbox: le,
111
- onSubmitWithoutReceipt: ue,
112
- onDeleteReceipt: K,
113
- descriptionValue: X,
114
- initialDescriptionValue: de,
115
- onDescriptionChange: fe,
116
- onSaveDescription: pe,
117
- onCancelDescription: me,
118
- isSavingDescription: he,
119
- isMemoEditable: ge,
120
- memoBadgeLabel: _e,
121
- labels: Q
122
- }, `requirements-${x}`),
123
- ye && /* @__PURE__ */ m(f, {
124
- type: "approvals",
125
- title: $.approvalsCardTitle,
126
- hasAppliedPolicy: !!be,
127
- isRejected: T,
128
- isAutoApproved: !!Ee,
129
- isManuallyApproved: !!De,
130
- isPendingReview: E,
131
- rejectionReason: we,
132
- greaterThanValue: xe,
133
- lessThanValue: Se,
134
- ruleLabel: Ce,
135
- approverName: Te,
136
- labels: Q
137
- }, `approvals-${x}`),
138
- Oe && /* @__PURE__ */ m(f, {
139
- type: "accounting",
140
- title: $.accountingCardTitle,
141
- glCategory: ke,
142
- initialGlCategory: Ae,
143
- glCategoryOptions: je,
144
- onGlCategoryChange: Me ?? v,
145
- department: Ne,
146
- initialDepartment: Pe,
147
- departmentOptions: Fe,
148
- onDepartmentChange: Ie ?? v,
149
- location: Le,
150
- initialLocation: Re,
151
- locationOptions: ze,
152
- onLocationChange: Be ?? v,
153
- onSave: Ve ?? v,
154
- onCancel: He ?? v,
155
- isSaving: !!Ue,
156
- isGlCategoryDisabled: Z,
157
- isDisabled: We,
158
- glCategoryHighlight: Ge,
159
- departmentHighlight: Ke,
160
- locationHighlight: qe,
161
- labels: Q
162
- }, `accounting-${x}`),
163
- Je && /* @__PURE__ */ m(f, {
164
- type: "auditHistory",
165
- title: $.auditHistoryCardTitle,
166
- rows: Ye ?? [],
167
- isLoading: Xe,
168
- isError: Ze,
169
- historyLabels: tt
170
- }, `auditHistory-${x}`)
171
- ] })
84
+ /* @__PURE__ */ u(a, {
85
+ label: b,
86
+ tone: te
172
87
  }),
173
- /* @__PURE__ */ m(i, {
174
- className: "ttw:flex-row ttw:items-center ttw:justify-center ttw:border-t ttw:border-border ttw:p-6 ttw:sm:justify-center",
175
- children: A || j ? null : Qe
176
- })
177
- ]
178
- }), /* @__PURE__ */ h("div", {
179
- className: "ttw:relative ttw:flex ttw:flex-1/2 ttw:bg-muted ttw:px-6 ttw:py-20",
180
- children: [/* @__PURE__ */ m(te, {
181
- asChild: !0,
182
- className: "ttw:absolute ttw:right-4 ttw:top-4",
183
- children: /* @__PURE__ */ m(r, {
184
- type: "button",
185
- variant: "outline",
186
- size: "icon",
187
- "aria-label": $.closeDialog,
188
- disabled: M,
189
- children: /* @__PURE__ */ m(ce, {
190
- className: "ttw:size-4",
88
+ se && /* @__PURE__ */ d("span", {
89
+ role: "status",
90
+ className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-sm ttw:text-muted-foreground",
91
+ children: [/* @__PURE__ */ u(f, {
92
+ className: "ttw:size-4 ttw:animate-spin",
191
93
  "aria-hidden": !0
192
- })
94
+ }), $.readingReceipt]
193
95
  })
194
- }), k ? /* @__PURE__ */ m(d, {
195
- url: k,
196
- className: "ttw:h-full ttw:min-h-0 ttw:w-full",
197
- showDeleteOption: !!K,
198
- onDeleteClick: K,
199
- labels: et
200
- }) : q || J ? /* @__PURE__ */ m("button", {
201
- type: "button",
202
- disabled: A || Y,
203
- "aria-label": Y ? $.uploadingReceipt : `${$.dropFilesHere} ${$.clickToBrowse}`,
204
- onClick: () => {
205
- A || Y || q?.();
206
- },
207
- onDragOver: (e) => e.preventDefault(),
208
- onDrop: (e) => {
209
- if (A || Y) return;
210
- e.preventDefault();
211
- let t = e.dataTransfer.files[0];
212
- t && J?.(t);
213
- },
214
- className: "ttw:flex ttw:h-full ttw:w-full ttw:cursor-pointer ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-2 ttw:rounded-md ttw:border ttw:border-dashed ttw:border-border ttw:bg-background ttw:px-6 ttw:disabled:cursor-default",
215
- children: Y ? /* @__PURE__ */ h(p, { children: [
216
- /* @__PURE__ */ m(g, {
217
- className: "ttw:size-5 ttw:animate-spin ttw:text-primary",
218
- "aria-hidden": !0
219
- }),
220
- /* @__PURE__ */ m(l, {
221
- variant: "body2",
222
- component: "span",
223
- className: "ttw:font-semibold",
224
- children: $.uploadingReceipt
225
- }),
226
- /* @__PURE__ */ m(l, {
227
- variant: "body2",
228
- component: "span",
229
- color: "muted",
230
- children: $.uploadingReceiptBody
231
- })
232
- ] }) : !A && /* @__PURE__ */ h(p, { children: [
233
- /* @__PURE__ */ m("div", {
234
- className: "ttw:flex ttw:size-11 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-primary",
235
- children: /* @__PURE__ */ m(ae, {
236
- className: "ttw:size-5 ttw:text-primary-foreground",
237
- "aria-hidden": !0
238
- })
239
- }),
240
- /* @__PURE__ */ h(l, {
241
- variant: "body2",
242
- component: "span",
243
- children: [
244
- $.dropFilesHere,
245
- " ",
246
- /* @__PURE__ */ m("span", {
247
- className: "ttw:text-primary ttw:underline",
248
- children: $.clickToBrowse
249
- })
250
- ]
251
- }),
252
- /* @__PURE__ */ m(l, {
253
- variant: "caption",
254
- color: "muted",
255
- children: $.acceptedFileTypes
256
- })
257
- ] })
258
- }) : /* @__PURE__ */ m("div", {
259
- className: "ttw:flex ttw:size-full ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-2 ttw:rounded-md ttw:border ttw:border-dashed ttw:border-border ttw:bg-background",
260
- children: !A && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
261
- className: "ttw:flex ttw:size-11 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-muted",
262
- children: /* @__PURE__ */ m(se, {
263
- className: "ttw:size-5 ttw:text-muted-foreground",
264
- "aria-hidden": !0
265
- })
266
- }), /* @__PURE__ */ m(l, {
267
- variant: "body2",
268
- color: "muted",
269
- children: $.noReceiptAttached
270
- })] })
271
- })]
272
- })]
96
+ ]
97
+ }), E ? /* @__PURE__ */ u(n, {
98
+ title: $.loadFailed,
99
+ retryLabel: $.tryAgain,
100
+ onRetry: D
101
+ }) : T ? /* @__PURE__ */ u(r, {
102
+ isLoading: !0,
103
+ loadingLabel: $.loading,
104
+ children: Array.from({ length: m }, (e, t) => /* @__PURE__ */ u(ee, {
105
+ width: "100%",
106
+ height: 290
107
+ }, t))
108
+ }) : /* @__PURE__ */ d(l, { children: [
109
+ /* @__PURE__ */ u(s, {
110
+ type: "requirements",
111
+ title: $.requirementsCardTitle,
112
+ cardLabel: k,
113
+ cardName: A,
114
+ cardholder: j,
115
+ showCardholder: M,
116
+ showPhysicalPill: N,
117
+ receiptFileUrl: w,
118
+ hasMissingInfo: !!(P && !J || F && !w),
119
+ showNoReceiptWarning: !!V,
120
+ isDescriptionRequired: P,
121
+ isReceiptRequired: F,
122
+ isReceiptAutoMatched: I,
123
+ isReceiptActionDisabled: L,
124
+ receiptButtonLabel: R,
125
+ receiptButtonIcon: z,
126
+ receiptButtonVariant: B,
127
+ onUploadClick: U,
128
+ onOpenReceiptInbox: W,
129
+ onSubmitWithoutReceipt: G,
130
+ onDeleteReceipt: H,
131
+ descriptionValue: J,
132
+ initialDescriptionValue: Y,
133
+ onDescriptionChange: X,
134
+ onSaveDescription: Z,
135
+ onCancelDescription: re,
136
+ isSavingDescription: ie,
137
+ isMemoEditable: ae,
138
+ memoBadgeLabel: oe,
139
+ labels: Q
140
+ }, `requirements-${v}`),
141
+ ce && /* @__PURE__ */ u(s, {
142
+ type: "approvals",
143
+ title: $.approvalsCardTitle,
144
+ hasAppliedPolicy: !!le,
145
+ isRejected: ne,
146
+ isAutoApproved: !!he,
147
+ isManuallyApproved: !!ge,
148
+ isPendingReview: x,
149
+ rejectionReason: pe,
150
+ greaterThanValue: ue,
151
+ lessThanValue: de,
152
+ ruleLabel: fe,
153
+ approverName: me,
154
+ labels: Q
155
+ }, `approvals-${v}`),
156
+ _e && /* @__PURE__ */ u(s, {
157
+ type: "accounting",
158
+ title: $.accountingCardTitle,
159
+ glCategory: ve,
160
+ initialGlCategory: ye,
161
+ glCategoryOptions: be,
162
+ onGlCategoryChange: xe ?? h,
163
+ department: Se,
164
+ initialDepartment: Ce,
165
+ departmentOptions: we,
166
+ onDepartmentChange: Te ?? h,
167
+ location: Ee,
168
+ initialLocation: De,
169
+ locationOptions: Oe,
170
+ onLocationChange: ke ?? h,
171
+ onSave: Ae ?? h,
172
+ onCancel: je ?? h,
173
+ isSaving: !!Me,
174
+ isGlCategoryDisabled: Ne,
175
+ isDisabled: Pe,
176
+ glCategoryHighlight: Fe,
177
+ departmentHighlight: Ie,
178
+ locationHighlight: Le,
179
+ labels: Q
180
+ }, `accounting-${v}`),
181
+ Re && /* @__PURE__ */ u(s, {
182
+ type: "auditHistory",
183
+ title: $.auditHistoryCardTitle,
184
+ rows: ze ?? [],
185
+ isLoading: Be,
186
+ isError: Ve,
187
+ historyLabels: Ge
188
+ }, `auditHistory-${v}`)
189
+ ] })]
273
190
  })
274
191
  });
275
192
  }
276
- export { y as TransactionDetails, y as default };
193
+ export { g as TransactionDetails, g as default };
@@ -1,6 +1,7 @@
1
1
  // ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/labels.js
2
2
  var e = {
3
3
  screenReaderTitle: "Transaction details",
4
+ loading: "Loading expense",
4
5
  screenReaderDescription: "Review the transaction, its receipt and its approval requirements.",
5
6
  contentTitle: "Transaction",
6
7
  closeDialog: "Close transaction details",
@@ -12,10 +13,11 @@ var e = {
12
13
  noReceiptAttached: "No receipt attached",
13
14
  dropFilesHere: "Drop your files here, or",
14
15
  clickToBrowse: "click to browse",
15
- acceptedFileTypes: "SVG, PNG, JPG or GIF (max. 3MB)",
16
+ acceptedFileTypes: "PDF, PNG, JPG, GIF or SVG",
16
17
  uploadingReceipt: "Processing receipts...",
17
18
  uploadingReceiptBody: "Give us a few seconds to process your attachment.",
18
19
  readingReceipt: "Reading receipt…",
19
- loadFailed: "This transaction could not be loaded. Please try again."
20
+ loadFailed: "Couldn’t load expense",
21
+ tryAgain: "Try again"
20
22
  };
21
23
  export { e as TRANSACTION_DETAILS_LABELS_EN };
@@ -7,6 +7,7 @@ function r({ progressLabel: r, ariaLabel: i, percentComplete: a }) {
7
7
  children: [/* @__PURE__ */ t(e, {
8
8
  variant: "h5",
9
9
  color: "primary",
10
+ className: "ttw:whitespace-nowrap",
10
11
  children: r
11
12
  }), /* @__PURE__ */ t("div", {
12
13
  role: "progressbar",