@tesouro/embedded-components-react 0.11.119 → 0.11.122

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/index.css +32 -154
  2. package/dist/index.d.ts +11 -2
  3. package/dist/lib/ExpenseManagementWidget.d.ts +11 -2
  4. package/dist/lib/WidgetSuite.d.ts +11 -2
  5. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/ExpenseManagementWidget.js +343 -264
  6. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/labels.js +14 -0
  7. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/permissions.js +6 -3
  8. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/useExpenseTabBadgeCounts.js +34 -19
  9. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/useExpensesTransactions.js +100 -98
  10. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsActionsFeature.js +27 -24
  11. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsFeature.js +1 -0
  12. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/expenseStatus.js +2 -2
  13. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js +43 -44
  14. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index4.js +79 -40
  15. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index2.js +10 -0
  16. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index3.js +47 -46
  17. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index4.js +78 -84
  18. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index5.js +165 -158
  19. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index6.js +38 -100
  20. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index7.js +77 -54
  21. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/AccordionItemCard/AccordionItemCard.js +213 -229
  22. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/ExpenseStatusBadge.js +6 -8
  23. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesScreen/ExpensesScreen.js +66 -73
  24. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsFilterBar/ExpensesTransactionsFilterBar.js +13 -13
  25. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/ExpensesTransactionsTable.js +123 -80
  26. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/labels.js +1 -0
  27. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/FileViewer/FileViewer.js +83 -74
  28. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/DeleteReceiptDialog/DeleteReceiptDialog.js +22 -30
  29. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/TransactionDetails.js +176 -259
  30. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/labels.js +4 -2
  31. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/BulkProgress.js +1 -0
  32. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/TransactionDetailsActions.js +112 -121
  33. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/labels.js +1 -0
  34. package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/feature/dist/lib/ExpenseRequirementsWidget.js +41 -32
  35. package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/ui/dist/index3.js +43 -53
  36. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  37. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +3 -1
  38. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/CopyAddress/CopyAddress.js +55 -0
  39. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/UploadTray/UploadTray.js +84 -0
  40. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/lib/UploadReceiptWidget.js +126 -73
  41. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index2.js +14 -1
  42. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index3.js +9 -8
  43. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index4.js +75 -128
  44. package/dist/packages/shared-ui-shadcn/dist/index.js +1399 -1302
  45. package/package.json +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/badgeTones.js +0 -9
@@ -2,142 +2,133 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Alert as e, AlertDescription as t, Button as n, Field as r, FieldLabel as i, Input as a, cn as o } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { TRANSACTION_DETAILS_ACTIONS_LABELS_EN as s } from "./labels.js";
7
- import { BulkProgress as c } from "./BulkProgress.js";
8
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
9
- import { ArrowLeft as d, ArrowRight as f, Check as p, Loader2 as m, Send as h, X as g } from "lucide-react";
5
+ import { Button as e, FieldError as t, FieldLabel as n, Input as r, cn as i } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { InlineErrorAlert as a } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
7
+ import "../../../../../shared/ui/dist/index.js";
8
+ import { TRANSACTION_DETAILS_ACTIONS_LABELS_EN as o } from "./labels.js";
9
+ import { BulkProgress as s } from "./BulkProgress.js";
10
+ import { useEffect as c, useRef as l } from "react";
11
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
10
12
  // ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/TransactionDetailsActions.js
11
- function _({ actions: _, onClose: v, isLoading: y, isRejectMode: b, reasonValue: x, onReasonChange: S, isSubmitDisabled: C, isConfirmRejectionDisabled: w, showNoReceiptField: T, showNoReceiptRequiredMarker: E, isBulkMode: D, currentItem: O, totalItems: k, percentComplete: A, hasActionError: j, labels: M }) {
12
- let N = {
13
- ...s,
14
- ...M
15
- }, P = D ? "ttw:w-fit" : "ttw:flex-1/2", F = D ? /* @__PURE__ */ l(c, {
16
- progressLabel: N.bulkProgress(O, k),
17
- ariaLabel: N.bulkProgressAriaLabel,
18
- percentComplete: A
19
- }) : null, I = /* @__PURE__ */ u(n, {
13
+ function p({ actions: p, onClose: m, isLoading: h, isRejectMode: g, reasonValue: _, reasonError: v, onReasonChange: y, isSubmitDisabled: b, isConfirmRejectionDisabled: x, showNoReceiptField: S, showNoReceiptRequiredMarker: C, isBulkMode: w, currentItem: T, totalItems: E, percentComplete: D, hasActionError: O, labels: k }) {
14
+ let A = {
15
+ ...o,
16
+ ...k
17
+ }, j = l(null);
18
+ c(() => {
19
+ v && j.current?.focus();
20
+ }, [v]);
21
+ let M = "ttw:w-full ttw:sm:w-auto", N = w ? /* @__PURE__ */ d(s, {
22
+ progressLabel: A.bulkProgress(T, E),
23
+ ariaLabel: A.bulkProgressAriaLabel,
24
+ percentComplete: D
25
+ }) : null, P = /* @__PURE__ */ d(e, {
20
26
  type: "button",
21
27
  variant: "outline",
22
- className: "ttw:w-full",
23
- onClick: v,
24
- children: [/* @__PURE__ */ l(d, {
25
- className: "ttw:size-4",
26
- "aria-hidden": !0
27
- }), N.returnToExpenses]
28
- }), L = (e, t, n) => /* @__PURE__ */ u(r, { children: [/* @__PURE__ */ u(i, {
29
- htmlFor: e,
30
- className: "ttw:gap-0",
31
- children: [t, n && /* @__PURE__ */ l("span", {
32
- className: "ttw:inline-block ttw:-translate-y-0.5 ttw:text-sm ttw:font-normal ttw:text-destructive",
33
- children: N.requiredMarker
34
- })]
35
- }), /* @__PURE__ */ l(a, {
36
- id: e,
37
- name: e,
38
- value: x,
39
- onChange: S
40
- })] }), R = (e, t) => /* @__PURE__ */ u("div", {
41
- className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-2",
42
- children: [T && L("submitReason", N.noReceiptReasonLabel, E), /* @__PURE__ */ u("div", {
43
- className: "ttw:flex ttw:w-full ttw:items-center ttw:justify-between ttw:gap-2",
44
- children: [F, /* @__PURE__ */ u("div", {
45
- className: o("ttw:flex ttw:items-center ttw:gap-2", D ? "ttw:w-fit" : "ttw:w-full"),
46
- children: [/* @__PURE__ */ l(n, {
47
- type: "button",
48
- variant: "outline",
49
- className: P,
50
- onClick: v,
51
- children: N.cancel
52
- }), /* @__PURE__ */ u(n, {
53
- type: "button",
54
- className: P,
55
- disabled: C,
56
- onClick: t,
57
- children: [e, y ? /* @__PURE__ */ l(m, {
58
- className: "ttw:size-4 ttw:animate-spin",
59
- "aria-hidden": !0
60
- }) : /* @__PURE__ */ l(h, {
61
- className: "ttw:size-4",
62
- "aria-hidden": !0
63
- })]
28
+ className: "ttw:w-auto ttw:self-end",
29
+ onClick: m,
30
+ children: A.returnToExpenses
31
+ }), F = (e, i, a, o) => /* @__PURE__ */ f("div", {
32
+ className: "ttw:grid ttw:w-full ttw:grid-cols-[minmax(0,28rem)_1fr] ttw:items-center ttw:gap-x-4 ttw:gap-y-1",
33
+ children: [
34
+ /* @__PURE__ */ f(n, {
35
+ htmlFor: e,
36
+ className: "ttw:gap-0",
37
+ children: [i, a && /* @__PURE__ */ d("span", {
38
+ className: "ttw:inline-block ttw:-translate-y-0.5 ttw:text-sm ttw:font-normal ttw:text-foreground",
39
+ children: A.requiredMarker
64
40
  })]
41
+ }),
42
+ /* @__PURE__ */ d("span", { "aria-hidden": !0 }),
43
+ /* @__PURE__ */ d(r, {
44
+ ref: j,
45
+ id: e,
46
+ name: e,
47
+ value: _,
48
+ onChange: y,
49
+ "aria-invalid": v || void 0,
50
+ "aria-describedby": v ? `${e}-error` : void 0
51
+ }),
52
+ /* @__PURE__ */ f("div", {
53
+ className: "ttw:flex ttw:items-center ttw:justify-end ttw:gap-2",
54
+ children: [N, o]
55
+ }),
56
+ v && /* @__PURE__ */ d(t, {
57
+ id: `${e}-error`,
58
+ className: "ttw:col-start-1",
59
+ children: A.reasonRequired
60
+ })
61
+ ]
62
+ }), I = (t, n) => {
63
+ let r = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(e, {
64
+ type: "button",
65
+ variant: "ghost",
66
+ className: "ttw:w-auto",
67
+ onClick: m,
68
+ children: A.cancel
69
+ }), /* @__PURE__ */ d(e, {
70
+ type: "button",
71
+ className: "ttw:w-auto",
72
+ disabled: b,
73
+ loading: h,
74
+ onClick: n,
75
+ children: t
76
+ })] });
77
+ return S ? F("submitReason", A.noReceiptReasonLabel, C, r) : /* @__PURE__ */ f("div", {
78
+ className: "ttw:flex ttw:w-full ttw:items-center ttw:justify-between ttw:gap-2",
79
+ children: [N, /* @__PURE__ */ d("div", {
80
+ className: "ttw:flex ttw:flex-1 ttw:items-center ttw:justify-end ttw:gap-2",
81
+ children: r
65
82
  })]
66
- })]
67
- });
68
- return /* @__PURE__ */ u("div", {
69
- className: o("ttw:flex ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-2", D ? "ttw:w-full ttw:px-0" : "ttw:w-140 ttw:px-6"),
70
- children: [j && /* @__PURE__ */ l(e, {
71
- variant: "destructive",
72
- className: "ttw:w-full",
73
- children: /* @__PURE__ */ l(t, { children: N.actionFailed })
74
- }), (() => {
75
- switch (_.kind) {
76
- case "submit": return R(_.submitLabel, _.onSubmit);
83
+ });
84
+ };
85
+ return /* @__PURE__ */ f("div", {
86
+ className: i("ttw:flex ttw:w-full ttw:flex-col ttw:items-stretch ttw:gap-2"),
87
+ children: [O && /* @__PURE__ */ d(a, { children: A.actionFailed }), (() => {
88
+ switch (p.kind) {
89
+ case "submit": return I(p.submitLabel, p.onSubmit);
77
90
  case "review": {
78
- let { approveLabel: e, confirmRejectionLabel: t, onApprove: r, onReject: i, onToggleRejectMode: a } = _;
79
- return b ? /* @__PURE__ */ u("div", {
80
- className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-2",
81
- children: [L("rejectionReason", N.rejectionReasonLabel, !0), /* @__PURE__ */ u("div", {
82
- className: "ttw:flex ttw:w-full ttw:items-center ttw:justify-between ttw:gap-2",
83
- children: [F, /* @__PURE__ */ u("div", {
84
- className: o("ttw:flex ttw:items-center ttw:gap-2", D ? "ttw:w-fit" : "ttw:w-full"),
85
- children: [/* @__PURE__ */ l(n, {
86
- type: "button",
87
- variant: "outline",
88
- className: P,
89
- disabled: y,
90
- onClick: a,
91
- children: N.cancel
92
- }), /* @__PURE__ */ u(n, {
93
- type: "button",
94
- variant: "destructive",
95
- className: P,
96
- disabled: w,
97
- onClick: i,
98
- children: [t, y ? /* @__PURE__ */ l(m, {
99
- className: "ttw:size-4 ttw:animate-spin",
100
- "aria-hidden": !0
101
- }) : /* @__PURE__ */ l(f, {
102
- className: "ttw:size-4",
103
- "aria-hidden": !0
104
- })]
105
- })]
106
- })]
107
- })]
108
- }) : /* @__PURE__ */ u("div", {
91
+ let { approveLabel: t, confirmRejectionLabel: n, onApprove: r, onReject: a, onToggleRejectMode: o } = p;
92
+ return g ? F("rejectionReason", A.rejectionReasonLabel, !0, /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(e, {
93
+ type: "button",
94
+ variant: "ghost",
95
+ className: "ttw:w-auto",
96
+ disabled: h,
97
+ onClick: o,
98
+ children: A.cancel
99
+ }), /* @__PURE__ */ d(e, {
100
+ type: "button",
101
+ variant: "destructive",
102
+ className: "ttw:w-auto",
103
+ disabled: x,
104
+ loading: h,
105
+ onClick: a,
106
+ children: n
107
+ })] })) : /* @__PURE__ */ f("div", {
109
108
  className: "ttw:flex ttw:w-full ttw:items-center ttw:justify-between ttw:gap-2",
110
- children: [F, /* @__PURE__ */ u("div", {
111
- className: o("ttw:flex ttw:items-center ttw:gap-2", D ? "ttw:w-fit" : "ttw:w-full"),
112
- children: [/* @__PURE__ */ u(n, {
109
+ children: [N, /* @__PURE__ */ f("div", {
110
+ className: i("ttw:flex ttw:flex-col-reverse ttw:items-stretch ttw:gap-2 ttw:sm:flex-row ttw:sm:items-center ttw:sm:justify-end ttw:w-full"),
111
+ children: [/* @__PURE__ */ d(e, {
113
112
  type: "button",
114
- variant: "outline",
115
- className: o(P, "ttw:border-destructive ttw:text-destructive"),
116
- disabled: y,
117
- onClick: a,
118
- children: [/* @__PURE__ */ l(g, {
119
- className: "ttw:size-4",
120
- "aria-hidden": !0
121
- }), N.reject]
122
- }), /* @__PURE__ */ u(n, {
113
+ variant: "secondary",
114
+ className: M,
115
+ disabled: h,
116
+ onClick: o,
117
+ children: A.reject
118
+ }), /* @__PURE__ */ d(e, {
123
119
  type: "button",
124
- className: o(P, "ttw:bg-emerald-600 ttw:text-white ttw:hover:bg-emerald-700"),
125
- disabled: y,
120
+ className: M,
121
+ disabled: h,
122
+ loading: h,
126
123
  onClick: r,
127
- children: [y ? /* @__PURE__ */ l(m, {
128
- className: "ttw:size-4 ttw:animate-spin",
129
- "aria-hidden": !0
130
- }) : /* @__PURE__ */ l(p, {
131
- className: "ttw:size-4",
132
- "aria-hidden": !0
133
- }), e]
124
+ children: t
134
125
  })]
135
126
  })]
136
127
  });
137
128
  }
138
- default: return I;
129
+ default: return P;
139
130
  }
140
131
  })()]
141
132
  });
142
133
  }
143
- export { _ as TransactionDetailsActions, _ as default };
134
+ export { p as TransactionDetailsActions, p as default };
@@ -12,6 +12,7 @@ var e = {
12
12
  rejectionReasonLabel: "Reason for rejection",
13
13
  noReceiptReasonLabel: "Reason for submitting without a receipt",
14
14
  requiredMarker: "*",
15
+ reasonRequired: "Enter a reason.",
15
16
  bulkProgress: (e, t) => `Review ${e}/${t}`,
16
17
  bulkProgressAriaLabel: "Review progress",
17
18
  actionFailed: "That action could not be completed. Please try again."
@@ -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.119", n = "536f3bad67c534abca0ad028b2c7c72f6e27b875", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.11.122", n = "7601ef0c6d391954e9c7d0f5ab29a19e9258cc30", 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 };
@@ -0,0 +1,84 @@
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, usePortalContainer as a } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { useState as o } from "react";
7
+ import { createPortal as s } from "react-dom";
8
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
+ import { ChevronDown as u, ChevronUp as d, X as f } from "lucide-react";
10
+ // ../../libs/tesouro-embedded-components-react/shared/ui/dist/lib/UploadTray/UploadTray.js
11
+ function p({ title: p, items: m, summary: h, closeLabel: g, collapseLabel: _, expandLabel: v, retryLabel: y, onClose: b }) {
12
+ let [x, S] = o(!1), C = a();
13
+ return typeof document > "u" ? null : s(/* @__PURE__ */ l("section", {
14
+ "aria-label": p,
15
+ className: "ttw:fixed ttw:bottom-4 ttw:right-4 ttw:z-50 ttw:flex ttw:max-h-[calc(100dvh-2rem)] ttw:w-80 ttw:max-w-[calc(100vw-2rem)] ttw:flex-col ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:shadow-md",
16
+ children: [
17
+ /* @__PURE__ */ l("div", {
18
+ className: "ttw:flex ttw:items-center ttw:gap-2",
19
+ children: [/* @__PURE__ */ c("span", {
20
+ className: "ttw:flex-1 ttw:text-sm ttw:font-semibold",
21
+ children: p
22
+ }), /* @__PURE__ */ l(r, { children: [/* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c(i, {
23
+ asChild: !0,
24
+ children: /* @__PURE__ */ c(e, {
25
+ type: "button",
26
+ variant: "ghost",
27
+ size: "icon-sm",
28
+ "aria-expanded": !x,
29
+ "aria-label": x ? v : _,
30
+ onClick: () => S((e) => !e),
31
+ children: c(x ? d : u, { className: "ttw:size-4" })
32
+ })
33
+ }), /* @__PURE__ */ c(n, { children: x ? v : _ })] }), /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c(i, {
34
+ asChild: !0,
35
+ children: /* @__PURE__ */ c(e, {
36
+ type: "button",
37
+ variant: "ghost",
38
+ size: "icon-sm",
39
+ "aria-label": g,
40
+ onClick: b,
41
+ children: /* @__PURE__ */ c(f, { className: "ttw:size-4" })
42
+ })
43
+ }), /* @__PURE__ */ c(n, { children: g })] })] })]
44
+ }),
45
+ h && /* @__PURE__ */ c("p", {
46
+ role: "status",
47
+ className: "ttw:mt-2 ttw:text-sm ttw:text-muted-foreground",
48
+ children: h
49
+ }),
50
+ !x && /* @__PURE__ */ c("ul", {
51
+ className: "ttw:mt-3 ttw:flex ttw:min-h-0 ttw:flex-col ttw:gap-3 ttw:overflow-y-auto",
52
+ children: m.map((t) => /* @__PURE__ */ l("li", {
53
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
54
+ children: [
55
+ /* @__PURE__ */ l("div", {
56
+ className: "ttw:flex ttw:items-center ttw:gap-2",
57
+ children: [/* @__PURE__ */ c("span", {
58
+ className: "ttw:min-w-0 ttw:flex-1 ttw:truncate ttw:text-sm",
59
+ title: t.name,
60
+ children: t.name
61
+ }), t.onRetry && /* @__PURE__ */ c(e, {
62
+ variant: "ghost",
63
+ size: "sm",
64
+ onClick: t.onRetry,
65
+ children: y
66
+ })]
67
+ }),
68
+ /* @__PURE__ */ c("span", {
69
+ className: "ttw:text-xs ttw:text-muted-foreground",
70
+ children: t.status
71
+ }),
72
+ t.progress !== void 0 && /* @__PURE__ */ c("progress", {
73
+ "aria-label": t.name,
74
+ value: t.progress,
75
+ max: 100,
76
+ className: "ttw:w-full"
77
+ })
78
+ ]
79
+ }, t.id))
80
+ })
81
+ ]
82
+ }), C ?? document.body);
83
+ }
84
+ export { p as UploadTray };