@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
@@ -1,122 +1,58 @@
1
- import { Button as e, DialogDescription as t, DialogFooter as n, DialogHeader as r, DialogTitle as i, Input as a, Label as o, Textarea as s, Typography as c } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
3
- import { Check as f, Send as p } from "lucide-react";
1
+ import { Button as e, Tabs as t, TabsContent as n, TabsList as r, TabsTrigger as i, Tooltip as a, TooltipContent as o, TooltipProvider as s, TooltipTrigger as c } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { INVOICING_TABS_LABELS_EN as l } from "./index6.js";
3
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
4
+ import { CogIcon as f } from "lucide-react";
4
5
  // ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js
5
- function m({ idPrefix: m, view: h, onSubjectChange: g, onMessageChange: _, onSkip: v, onSend: y, labels: b }) {
6
- let x = `${m}-subject`, S = `${m}-message`;
7
- return /* @__PURE__ */ d(l, { children: [
8
- /* @__PURE__ */ u(r, {
9
- className: "ttw:border-b ttw:border-border ttw:p-6",
10
- children: /* @__PURE__ */ d("div", {
11
- className: "ttw:flex ttw:items-center ttw:gap-4",
12
- children: [/* @__PURE__ */ u("span", {
13
- className: "ttw:flex ttw:size-10 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-full ttw:border ttw:border-emerald-200 ttw:bg-emerald-50",
14
- children: h.icon === "send" ? /* @__PURE__ */ u(p, { className: "ttw:size-6 ttw:text-green-700" }) : /* @__PURE__ */ u(f, { className: "ttw:size-6 ttw:text-green-700" })
6
+ function p({ headerStart: p, tabs: m, selectedTabId: h, onTabChange: g, onSettingsClick: _, actionContainerRef: v, labels: y }) {
7
+ let b = {
8
+ ...l,
9
+ ...y
10
+ };
11
+ return /* @__PURE__ */ d("div", {
12
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
13
+ children: [p && /* @__PURE__ */ u("div", {
14
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
15
+ children: p
16
+ }), /* @__PURE__ */ d(t, {
17
+ value: h,
18
+ onValueChange: g,
19
+ className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-4",
20
+ children: [/* @__PURE__ */ d("div", {
21
+ className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4",
22
+ children: [/* @__PURE__ */ u(r, {
23
+ variant: "underline",
24
+ children: m.map((e) => /* @__PURE__ */ u(i, {
25
+ value: e.id,
26
+ children: e.label
27
+ }, e.id))
15
28
  }), /* @__PURE__ */ d("div", {
16
- className: "ttw:flex ttw:flex-col ttw:gap-1",
17
- children: [/* @__PURE__ */ u(i, { children: h.title }), /* @__PURE__ */ u(t, {
18
- className: "ttw:text-xs",
19
- children: b.issueDescription
29
+ className: "ttw:flex ttw:items-center ttw:gap-2",
30
+ children: [_ && /* @__PURE__ */ u(s, { children: /* @__PURE__ */ d(a, { children: [/* @__PURE__ */ u(c, {
31
+ asChild: !0,
32
+ children: /* @__PURE__ */ u(e, {
33
+ type: "button",
34
+ variant: "ghost",
35
+ size: "icon",
36
+ "aria-label": b.settingsButton,
37
+ onClick: _,
38
+ children: /* @__PURE__ */ u(f, {
39
+ className: "ttw:size-4",
40
+ "aria-hidden": !0
41
+ })
42
+ })
43
+ }), /* @__PURE__ */ u(o, {
44
+ sideOffset: 4,
45
+ children: b.settingsButton
46
+ })] }) }), /* @__PURE__ */ u("div", {
47
+ ref: v,
48
+ className: "ttw:contents"
20
49
  })]
21
50
  })]
22
- })
23
- }),
24
- /* @__PURE__ */ d("div", {
25
- className: "ttw:flex ttw:flex-col ttw:gap-2 ttw:p-6",
26
- children: [
27
- /* @__PURE__ */ d("div", {
28
- className: "ttw:flex ttw:items-center ttw:gap-4",
29
- children: [/* @__PURE__ */ u(c, {
30
- variant: "body2",
31
- color: "muted",
32
- className: "ttw:w-16 ttw:shrink-0",
33
- children: b.toLabel
34
- }), /* @__PURE__ */ u(c, {
35
- variant: "body2",
36
- children: h.recipient
37
- })]
38
- }),
39
- /* @__PURE__ */ d("div", {
40
- className: "ttw:flex ttw:items-center ttw:gap-4",
41
- children: [/* @__PURE__ */ u(o, {
42
- htmlFor: x,
43
- className: "ttw:w-16 ttw:shrink-0 ttw:font-normal ttw:text-muted-foreground",
44
- children: b.subjectLabel
45
- }), /* @__PURE__ */ u(a, {
46
- id: x,
47
- className: "ttw:flex-1",
48
- value: h.subject,
49
- onChange: (e) => g(e.target.value),
50
- disabled: h.inProgress
51
- })]
52
- }),
53
- /* @__PURE__ */ d("div", {
54
- className: "ttw:flex ttw:items-start ttw:gap-4",
55
- children: [/* @__PURE__ */ u(o, {
56
- htmlFor: S,
57
- className: "ttw:w-16 ttw:shrink-0 ttw:pt-2 ttw:font-normal ttw:text-muted-foreground",
58
- children: b.messageLabel
59
- }), /* @__PURE__ */ u(s, {
60
- id: S,
61
- className: "ttw:flex-1",
62
- value: h.message,
63
- onChange: (e) => _(e.target.value),
64
- placeholder: b.messagePlaceholder,
65
- disabled: h.inProgress
66
- })]
67
- }),
68
- h.attachments.length > 0 && /* @__PURE__ */ d("div", {
69
- className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pl-20",
70
- children: [/* @__PURE__ */ d("div", {
71
- className: "ttw:flex ttw:flex-col",
72
- children: [/* @__PURE__ */ u(c, {
73
- variant: "body2",
74
- color: "muted",
75
- children: b.attachmentsLabel
76
- }), /* @__PURE__ */ u(c, {
77
- variant: "caption",
78
- color: "muted",
79
- children: b.attachmentsCaption
80
- })]
81
- }), /* @__PURE__ */ u("ul", {
82
- className: "ttw:flex ttw:flex-col ttw:gap-2.5",
83
- children: h.attachments.map((e) => /* @__PURE__ */ d("li", {
84
- className: "ttw:rounded-lg ttw:bg-muted ttw:px-2 ttw:py-1 ttw:text-sm ttw:font-medium",
85
- children: [
86
- e.name,
87
- " ",
88
- /* @__PURE__ */ d("span", {
89
- className: "ttw:text-muted-foreground",
90
- children: [
91
- "(",
92
- e.sizeLabel,
93
- ")"
94
- ]
95
- })
96
- ]
97
- }, e.id))
98
- })]
99
- })
100
- ]
101
- }),
102
- /* @__PURE__ */ d(n, {
103
- className: "ttw:flex ttw:flex-row ttw:gap-4 ttw:border-t ttw:border-border ttw:p-6",
104
- children: [/* @__PURE__ */ u(e, {
105
- type: "button",
106
- variant: "outline",
107
- className: "ttw:flex-1 ttw:border-border",
108
- disabled: h.inProgress,
109
- onClick: v,
110
- children: h.dismissLabel
111
- }), /* @__PURE__ */ u(e, {
112
- type: "button",
113
- className: "ttw:flex-1",
114
- disabled: h.sendDisabled,
115
- loading: h.inProgress,
116
- onClick: y,
117
- children: b.sendButton
118
- })]
119
- })
120
- ] });
51
+ }), m.map((e) => /* @__PURE__ */ u(n, {
52
+ value: e.id,
53
+ children: e.content
54
+ }, e.id))]
55
+ })]
56
+ });
121
57
  }
122
- export { m as ReceivableActionsModalIssueStep };
58
+ export { p as InvoicingTabs, p as default };
@@ -1,101 +1,11 @@
1
- import { Button as e, Checkbox as t, DialogFooter as n, DialogHeader as r, DialogTitle as i, Separator as a, Typography as o } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
3
- import { Check as u } from "lucide-react";
1
+ import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { createPortal as t } from "react-dom";
3
+ import { jsx as n } from "react/jsx-runtime";
4
4
  // ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js
5
- function d({ view: d, onToggleItem: f, onToggleAll: p, onAllSelectedChange: m, onSkip: h, onSave: g, labels: _ }) {
6
- return /* @__PURE__ */ l(s, { children: [
7
- /* @__PURE__ */ c(r, {
8
- className: "ttw:border-b ttw:border-border ttw:p-6",
9
- children: /* @__PURE__ */ l(i, {
10
- className: "ttw:flex ttw:flex-row ttw:items-center ttw:gap-4",
11
- children: [/* @__PURE__ */ c("span", {
12
- className: "ttw:flex ttw:size-10 ttw:items-center ttw:justify-center ttw:rounded-full ttw:border ttw:border-emerald-200 ttw:bg-emerald-50",
13
- children: /* @__PURE__ */ c(u, { className: "ttw:size-6 ttw:text-green-700" })
14
- }), d.title]
15
- })
16
- }),
17
- /* @__PURE__ */ l("div", {
18
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:p-6",
19
- children: [/* @__PURE__ */ l("div", {
20
- className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-1.5",
21
- children: [/* @__PURE__ */ l("div", {
22
- className: "ttw:flex ttw:min-w-0 ttw:flex-col ttw:gap-1",
23
- children: [/* @__PURE__ */ c(o, {
24
- variant: "h4",
25
- children: _.productsQuestion
26
- }), /* @__PURE__ */ c(o, {
27
- variant: "caption",
28
- color: "muted",
29
- children: _.productsCaption
30
- })]
31
- }), /* @__PURE__ */ c(e, {
32
- type: "button",
33
- variant: "ghost",
34
- className: "ttw:shrink-0 ttw:text-primary ttw:hover:text-primary",
35
- disabled: d.inProgress,
36
- onClick: p,
37
- children: d.toggleAllLabel
38
- })]
39
- }), /* @__PURE__ */ l("ul", {
40
- className: "ttw:flex ttw:flex-col ttw:gap-3",
41
- children: [
42
- /* @__PURE__ */ l("li", {
43
- className: "ttw:flex ttw:items-center ttw:gap-2",
44
- children: [/* @__PURE__ */ c(t, {
45
- checked: d.allSelected,
46
- onCheckedChange: (e) => m(e === !0),
47
- disabled: d.inProgress || d.items.length === 0,
48
- "aria-label": _.productsAllLabel
49
- }), /* @__PURE__ */ c(o, {
50
- variant: "body2",
51
- className: "ttw:font-semibold",
52
- children: _.productsAllLabel
53
- })]
54
- }),
55
- /* @__PURE__ */ c("li", { children: /* @__PURE__ */ c(a, {}) }),
56
- d.items.map((e) => /* @__PURE__ */ l("li", {
57
- className: "ttw:flex ttw:items-start ttw:gap-2",
58
- children: [/* @__PURE__ */ c(t, {
59
- checked: e.selected,
60
- onCheckedChange: () => f(e.key),
61
- disabled: d.inProgress,
62
- "aria-label": e.name
63
- }), /* @__PURE__ */ l("div", {
64
- className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:gap-1",
65
- children: [/* @__PURE__ */ c(o, {
66
- variant: "caption",
67
- className: "ttw:truncate",
68
- title: e.name,
69
- children: e.name
70
- }), /* @__PURE__ */ c(o, {
71
- variant: "caption",
72
- color: "muted",
73
- className: "ttw:truncate",
74
- children: e.priceLabel
75
- })]
76
- })]
77
- }, e.key))
78
- ]
79
- })]
80
- }),
81
- /* @__PURE__ */ l(n, {
82
- className: "ttw:flex ttw:flex-row ttw:gap-4 ttw:border-t ttw:border-border ttw:p-6",
83
- children: [/* @__PURE__ */ c(e, {
84
- type: "button",
85
- variant: "outline",
86
- className: "ttw:flex-1 ttw:border-border",
87
- disabled: d.inProgress,
88
- onClick: h,
89
- children: _.skipButton
90
- }), /* @__PURE__ */ c(e, {
91
- type: "button",
92
- className: "ttw:flex-1",
93
- disabled: d.saveDisabled,
94
- loading: d.inProgress,
95
- onClick: g,
96
- children: _.saveItemsButton
97
- })]
98
- })
99
- ] });
5
+ function r({ container: r, label: i, onClick: a }) {
6
+ return r ? t(/* @__PURE__ */ n(e, {
7
+ onClick: a,
8
+ children: i
9
+ }), r) : null;
100
10
  }
101
- export { d as ReceivableActionsModalProductsStep };
11
+ export { r as TabRowAction, r as default };
@@ -1,40 +1,3 @@
1
- import { Dialog as e, DialogContent as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { RECEIVABLE_ACTIONS_MODAL_LABELS_EN as n } from "./index6.js";
3
- import { ReceivableActionsModalIssueStep as r } from "./index7.js";
4
- import { ReceivableActionsModalProductsStep as i } from "./index8.js";
5
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
- // ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js
7
- function s({ idPrefix: s, open: c, view: l, onSkip: u, onSubjectChange: d, onMessageChange: f, onSend: p, onToggleItem: m, onToggleAll: h, onAllSelectedChange: g, onSaveItems: _, labels: v }) {
8
- let y = {
9
- ...n,
10
- ...v
11
- };
12
- return /* @__PURE__ */ a(e, {
13
- open: c && !!l,
14
- onOpenChange: (e) => {
15
- e || u();
16
- },
17
- children: /* @__PURE__ */ o(t, {
18
- className: "ttw:gap-0 ttw:p-0 ttw:max-w-178 ttw:sm:max-w-178",
19
- labels: { close: y.close },
20
- children: [l?.step === "issue" && /* @__PURE__ */ a(r, {
21
- idPrefix: s,
22
- view: l,
23
- onSubjectChange: d,
24
- onMessageChange: f,
25
- onSkip: u,
26
- onSend: p,
27
- labels: y
28
- }), l?.step === "products" && /* @__PURE__ */ a(i, {
29
- view: l,
30
- onToggleItem: m,
31
- onToggleAll: h,
32
- onAllSelectedChange: g,
33
- onSkip: u,
34
- onSave: _,
35
- labels: y
36
- })]
37
- })
38
- });
39
- }
40
- export { s as ReceivableActionsModal };
1
+ import "./index6.js";
2
+ import "./index7.js";
3
+ import "./index8.js";
@@ -13,63 +13,72 @@ import { ExpenseRequirementsAnalyticsEvent as c, WIDGET_NAME as l } from "./anal
13
13
  import { ExpenseRequirementsWidgetLabels as u, FieldConfigLabels as d } from "../../../ui/dist/index2.js";
14
14
  import { RequirementCard as f } from "../../../ui/dist/index3.js";
15
15
  import "../../../ui/dist/index.js";
16
- import { useEffect as p } from "react";
17
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
18
- import { FileText as _, ReceiptText as v } from "lucide-react";
16
+ import { useEffect as p, useState as m } from "react";
17
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
18
+ import { FileText as v, ReceiptText as y } from "lucide-react";
19
19
  // ../../libs/tesouro-embedded-components-react/shared/expense-requirements/feature/dist/lib/ExpenseRequirementsWidget.js
20
- var y = {
21
- receipt_id: /* @__PURE__ */ h(v, { size: 20 }),
22
- description: /* @__PURE__ */ h(_, { size: 20 })
23
- }, b = {
20
+ var b = {
21
+ receipt_id: /* @__PURE__ */ g(y, { size: 20 }),
22
+ description: /* @__PURE__ */ g(v, { size: 20 })
23
+ }, x = {
24
24
  receipt_id: { label: d.Receipt },
25
25
  description: { label: d.DescriptionMemo }
26
26
  };
27
- function x() {
27
+ function S() {
28
28
  let i = r();
29
29
  p(() => {
30
30
  i(c.Mounted);
31
31
  }, [i]);
32
- let { requirements: l, requirementsKey: d, lastSavedRequirementsKey: _, hasLoadedRequirements: v, status: x, isLoading: S, loadRequirements: C, saveRequirements: w, resetRequirements: T, updateRequirement: E, updateAmount: D } = s();
32
+ let { requirements: l, requirementsKey: d, lastSavedRequirementsKey: v, hasLoadedRequirements: y, status: S, isLoading: C, loadRequirements: w, saveRequirements: T, resetRequirements: E, updateRequirement: D, updateAmount: O } = s();
33
33
  p(() => {
34
- C();
35
- }, [C]), p(() => {
36
- x === "success" ? t.success(u.Saved) : x === "error" && t.error(u.FailedToSave);
37
- }, [x]);
38
- let O = v && d !== _, k = S || x === "saving";
39
- return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(n, {}), /* @__PURE__ */ g("div", {
34
+ w();
35
+ }, [w]), p(() => {
36
+ S === "success" ? t.success(u.Saved) : S === "error" && t.error(u.FailedToSave);
37
+ }, [S]);
38
+ let [k, A] = m({}), j = (e) => {
39
+ let t = l[e].amount, n = k[e];
40
+ return n !== void 0 && (n === "" || n === "." ? void 0 : Number(n)) === t ? n : t === void 0 ? "" : String(t);
41
+ }, M = (e, t) => {
42
+ /^\d*(?:\.\d{0,2})?$/.test(t) && (A((n) => ({
43
+ ...n,
44
+ [e]: t
45
+ })), O(e, t === "" || t === "." ? void 0 : Number(t)));
46
+ }, N = y && d !== v, P = C || S === "saving";
47
+ return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(n, {}), /* @__PURE__ */ _("div", {
40
48
  className: "ttw:flex ttw:flex-col ttw:gap-3",
41
- children: [o.map((e) => /* @__PURE__ */ h(f, {
42
- label: b[e].label,
43
- icon: y[e],
49
+ children: [o.map((e) => /* @__PURE__ */ g(f, {
50
+ label: x[e].label,
51
+ icon: b[e],
44
52
  required: l[e].required,
45
- onChange: (t) => E(e, t),
46
- disabled: k,
53
+ onChange: (t) => D(e, t),
54
+ disabled: P,
47
55
  amount: a.has(e) ? l[e].amount : void 0,
48
- onAmountChange: a.has(e) ? (t) => D(e, t) : void 0
49
- }, e)), /* @__PURE__ */ g("div", {
56
+ amountText: j(e),
57
+ onAmountTextChange: a.has(e) ? (t) => M(e, t) : void 0
58
+ }, e)), /* @__PURE__ */ _("div", {
50
59
  className: "ttw:mt-4 ttw:flex ttw:justify-end ttw:gap-2",
51
- children: [/* @__PURE__ */ h(e, {
60
+ children: [/* @__PURE__ */ g(e, {
52
61
  variant: "ghost",
53
62
  size: "sm",
54
- onClick: T,
55
- disabled: !O || k,
63
+ onClick: E,
64
+ disabled: !N || P,
56
65
  children: u.Cancel
57
- }), /* @__PURE__ */ h(e, {
66
+ }), /* @__PURE__ */ g(e, {
58
67
  size: "sm",
59
- onClick: () => void w(),
60
- disabled: !O || k,
68
+ onClick: () => void T(),
69
+ disabled: !N || P,
61
70
  children: u.Save
62
71
  })]
63
72
  })]
64
73
  })] });
65
74
  }
66
- function S({ token: e, orgId: t, widgetToken: n, organizationId: r, ...a } = {}) {
67
- return /* @__PURE__ */ h(i, {
75
+ function C({ token: e, orgId: t, widgetToken: n, organizationId: r, ...a } = {}) {
76
+ return /* @__PURE__ */ g(i, {
68
77
  ...a,
69
78
  widgetName: l,
70
79
  widgetToken: n === void 0 ? e : n,
71
80
  organizationId: r === void 0 ? t : r,
72
- children: /* @__PURE__ */ h(x, {})
81
+ children: /* @__PURE__ */ g(S, {})
73
82
  });
74
83
  }
75
- export { S as ExpenseRequirementsWidget };
84
+ export { C as ExpenseRequirementsWidget };
@@ -2,72 +2,62 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Input as e, Switch as t } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { RequirementCardLabels as n } from "./index2.js";
7
- import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ import { Checkbox as e, FieldRequirement as t, Label as n } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { AmountInput as r } from "../../../ui/dist/lib/AmountInput/AmountInput.js";
7
+ import "../../../ui/dist/index.js";
8
+ import { RequirementCardLabels as i } from "./index2.js";
9
+ import { useId as a } from "react";
10
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
8
11
  // ../../libs/tesouro-embedded-components-react/shared/expense-requirements/ui/dist/index3.js
9
- function o({ label: o, icon: s, required: c, onChange: l, disabled: u, amount: d, onAmountChange: f }) {
10
- return /* @__PURE__ */ a("div", {
11
- className: "ttw:border ttw:border-border ttw:rounded-lg ttw:p-4",
12
- children: [/* @__PURE__ */ a("div", {
12
+ function l({ label: l, required: u, onChange: d, disabled: f, amount: p, amountText: m = "", onAmountTextChange: h }) {
13
+ let g = a();
14
+ return /* @__PURE__ */ c("div", {
15
+ className: "ttw:rounded-lg ttw:bg-muted ttw:p-4",
16
+ children: [/* @__PURE__ */ c("div", {
13
17
  className: "ttw:flex ttw:items-center ttw:justify-between",
14
- children: [/* @__PURE__ */ a("div", {
18
+ children: [/* @__PURE__ */ s("div", {
15
19
  className: "ttw:flex ttw:items-center ttw:gap-3",
16
- children: [/* @__PURE__ */ i("div", {
17
- className: "ttw:bg-indigo-500 ttw:rounded-lg ttw:p-2 ttw:text-white ttw:flex ttw:items-center ttw:justify-center",
18
- children: s
19
- }), /* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("span", {
20
+ children: /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("span", {
20
21
  className: "ttw:font-semibold ttw:text-sm ttw:block",
21
- children: o
22
- }), /* @__PURE__ */ i("span", {
22
+ children: l
23
+ }), /* @__PURE__ */ s("span", {
23
24
  className: "ttw:text-xs ttw:text-muted-foreground",
24
- children: c ? d === void 0 ? n.RequiredForAllExpenses : /* @__PURE__ */ a(r, { children: [
25
- n.RequiredForExpensesOver,
25
+ children: u ? p === void 0 ? i.RequiredForAllExpenses : /* @__PURE__ */ c(o, { children: [
26
+ i.RequiredForExpensesOver,
26
27
  " ",
27
- /* @__PURE__ */ a("span", {
28
+ /* @__PURE__ */ c("span", {
28
29
  className: "ttw:font-semibold",
29
- children: ["$", d.toLocaleString()]
30
+ children: ["$", p.toLocaleString()]
30
31
  })
31
- ] }) : n.NotRequired
32
- })] })]
33
- }), /* @__PURE__ */ a("div", {
32
+ ] }) : i.NotRequired
33
+ })] })
34
+ }), /* @__PURE__ */ c("div", {
34
35
  className: "ttw:flex ttw:items-center ttw:gap-2",
35
- children: [/* @__PURE__ */ i("span", {
36
+ children: [/* @__PURE__ */ s("span", {
36
37
  className: "ttw:text-xs ttw:font-medium ttw:text-muted-foreground",
37
- children: c ? n.Required : n.NotRequired
38
- }), /* @__PURE__ */ i(t, {
39
- "aria-label": o,
40
- checked: c,
41
- onCheckedChange: l,
42
- disabled: u
38
+ children: u ? i.Required : i.NotRequired
39
+ }), /* @__PURE__ */ s(e, {
40
+ "aria-label": l,
41
+ checked: u,
42
+ onCheckedChange: (e) => d(e === !0),
43
+ disabled: f
43
44
  })]
44
45
  })]
45
- }), f !== void 0 && c && /* @__PURE__ */ a("div", {
46
- className: `ttw:mt-3 ttw:w-[300px]${u ? " ttw:opacity-50" : ""}`,
47
- children: [/* @__PURE__ */ i("span", {
48
- className: "ttw:block ttw:text-xs ttw:text-muted-foreground ttw:mb-1",
49
- children: n.GreaterThan
50
- }), /* @__PURE__ */ a("div", {
51
- className: "ttw:relative",
52
- children: [/* @__PURE__ */ i("span", {
53
- className: "ttw:absolute ttw:left-3 ttw:top-1/2 ttw:-translate-y-1/2 ttw:text-sm ttw:text-muted-foreground ttw:pointer-events-none",
54
- children: "$"
55
- }), /* @__PURE__ */ i(e, {
56
- type: "number",
57
- min: 0,
58
- value: d ?? "",
59
- onChange: (e) => {
60
- if (e.target.value === "") f(void 0);
61
- else {
62
- let t = Number(e.target.value);
63
- isFinite(t) && f(t);
64
- }
65
- },
66
- disabled: u,
67
- className: "ttw:pl-6 ttw:disabled:cursor-not-allowed"
68
- })]
46
+ }), h !== void 0 && u && /* @__PURE__ */ c("div", {
47
+ className: `ttw:mt-3 ttw:w-[300px]${f ? " ttw:opacity-50" : ""}`,
48
+ children: [/* @__PURE__ */ s(n, {
49
+ htmlFor: g,
50
+ requirement: t.Optional,
51
+ className: "ttw:mb-2",
52
+ children: i.GreaterThan
53
+ }), /* @__PURE__ */ s(r, {
54
+ id: g,
55
+ value: m,
56
+ currencySymbol: "$",
57
+ onValueChange: h,
58
+ disabled: f
69
59
  })]
70
60
  })]
71
61
  });
72
62
  }
73
- export { o as RequirementCard };
63
+ export { l as RequirementCard };
@@ -1,5 +1,5 @@
1
1
  // ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.11.120", n = "eb4cdf62248a5e3dc94184717c9173554c8ab6ff", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.11.123", n = "f4fe4e0b8f432c4bf3b2cb4cef6bf8b6117d3e5a", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -32,4 +32,6 @@ import { OnboardingShell as T } from "./lib/OnboardingShell/OnboardingShell.js";
32
32
  import { SectionHeading as E } from "./lib/SectionHeading/SectionHeading.js";
33
33
  import { ConsentBlock as D } from "./lib/ConsentBlock/ConsentBlock.js";
34
34
  import { FileDropZone as O } from "./lib/FileDropZone/FileDropZone.js";
35
- export { p as AddTile, y as AmountInput, D as ConsentBlock, g as ERROR_STATE_ID, e as EmbeddedToaster, h as EmptyState, _ as ErrorState, O as FileDropZone, l as HostIsolationScope, S as InlineErrorAlert, u as Link, b as LoadingRegion, x as MaskedAccountNumber, v as NoAccessState, T as OnboardingShell, C as PAGINATION_FOOTER_LABELS_EN, w as PaginationFooter, E as SectionHeading, m as StatePanel, t as ToastNameMessage, n as UIFramework, i as UIProvider, f as WidgetContainer, d as WidgetFrame, a as registerDesignSystemEnsurer, o as registerUIRenderers, r as resolveUIFramework, s as useDesignSystemEnsurer, c as useFrameworkRenderer };
35
+ import { CopyAddress as k } from "./lib/CopyAddress/CopyAddress.js";
36
+ import { UploadTray as A } from "./lib/UploadTray/UploadTray.js";
37
+ export { p as AddTile, y as AmountInput, D as ConsentBlock, k as CopyAddress, g as ERROR_STATE_ID, e as EmbeddedToaster, h as EmptyState, _ as ErrorState, O as FileDropZone, l as HostIsolationScope, S as InlineErrorAlert, u as Link, b as LoadingRegion, x as MaskedAccountNumber, v as NoAccessState, T as OnboardingShell, C as PAGINATION_FOOTER_LABELS_EN, w as PaginationFooter, E as SectionHeading, m as StatePanel, t as ToastNameMessage, n as UIFramework, i as UIProvider, A as UploadTray, f as WidgetContainer, d as WidgetFrame, a as registerDesignSystemEnsurer, o as registerUIRenderers, r as resolveUIFramework, s as useDesignSystemEnsurer, c as useFrameworkRenderer };
@@ -0,0 +1,55 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { Button as e, Tooltip as t, TooltipContent as n, TooltipProvider as r, TooltipTrigger as i } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { InlineErrorAlert as a } from "../InlineErrorAlert/InlineErrorAlert.js";
7
+ import { useEffect as o, useState as s } from "react";
8
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
+ import { Check as u, Copy as d } from "lucide-react";
10
+ // ../../libs/tesouro-embedded-components-react/shared/ui/dist/lib/CopyAddress/CopyAddress.js
11
+ function f({ address: f, copyLabel: p, copiedLabel: m, failedLabel: h }) {
12
+ let [g, _] = s(!1), [v, y] = s(!1);
13
+ o(() => {
14
+ if (!g) return;
15
+ let e = window.setTimeout(() => _(!1), 2e3);
16
+ return () => window.clearTimeout(e);
17
+ }, [g]);
18
+ let b = async () => {
19
+ try {
20
+ await navigator.clipboard.writeText(f), y(!1), _(!0);
21
+ } catch {
22
+ _(!1), y(!0);
23
+ }
24
+ };
25
+ return /* @__PURE__ */ l("div", {
26
+ className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-2",
27
+ children: [
28
+ /* @__PURE__ */ l("div", {
29
+ className: "ttw:flex ttw:w-full ttw:items-center ttw:gap-2 ttw:rounded-md ttw:border ttw:border-border ttw:p-3",
30
+ children: [/* @__PURE__ */ c("span", {
31
+ title: f,
32
+ className: "ttw:min-w-0 ttw:flex-1 ttw:truncate ttw:text-sm",
33
+ children: f
34
+ }), /* @__PURE__ */ c(r, { children: /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c(i, {
35
+ asChild: !0,
36
+ children: /* @__PURE__ */ c(e, {
37
+ type: "button",
38
+ variant: "ghost",
39
+ size: "icon-sm",
40
+ "aria-label": g ? m : p,
41
+ onClick: () => void b(),
42
+ children: c(g ? u : d, { className: "ttw:size-4" })
43
+ })
44
+ }), /* @__PURE__ */ c(n, { children: g ? m : p })] }) })]
45
+ }),
46
+ v && /* @__PURE__ */ c(a, { children: h }),
47
+ /* @__PURE__ */ c("span", {
48
+ role: "status",
49
+ className: "ttw:sr-only",
50
+ children: g ? m : ""
51
+ })
52
+ ]
53
+ });
54
+ }
55
+ export { f as CopyAddress };