@tesouro/embedded-components-react 0.11.120 → 0.11.122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +32 -154
- package/dist/index.d.ts +11 -2
- package/dist/lib/ExpenseManagementWidget.d.ts +11 -2
- package/dist/lib/WidgetSuite.d.ts +11 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/ExpenseManagementWidget.js +343 -264
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/labels.js +14 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/permissions.js +6 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/useExpenseTabBadgeCounts.js +34 -19
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/useExpensesTransactions.js +100 -98
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsActionsFeature.js +27 -24
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsFeature.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/expenseStatus.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js +43 -44
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index4.js +79 -40
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index2.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index3.js +47 -46
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index4.js +78 -84
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index5.js +165 -158
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index6.js +38 -100
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index7.js +77 -54
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/AccordionItemCard/AccordionItemCard.js +213 -229
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/ExpenseStatusBadge.js +6 -8
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesScreen/ExpensesScreen.js +66 -73
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsFilterBar/ExpensesTransactionsFilterBar.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/ExpensesTransactionsTable.js +123 -80
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/FileViewer/FileViewer.js +83 -74
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/DeleteReceiptDialog/DeleteReceiptDialog.js +22 -30
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/TransactionDetails.js +176 -259
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/labels.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/BulkProgress.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/TransactionDetailsActions.js +112 -121
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/feature/dist/lib/ExpenseRequirementsWidget.js +41 -32
- package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/ui/dist/index3.js +43 -53
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/CopyAddress/CopyAddress.js +55 -0
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/UploadTray/UploadTray.js +84 -0
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/lib/UploadReceiptWidget.js +126 -73
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index2.js +14 -1
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index3.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index4.js +75 -128
- package/dist/packages/shared-ui-shadcn/dist/index.js +1399 -1302
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/badgeTones.js +0 -9
|
@@ -2,85 +2,138 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import { EmbeddedToaster as t } from "../../../../shared/ui/dist/lib/EmbeddedToaster.js";
|
|
5
|
+
import { UploadTray as e } from "../../../../shared/ui/dist/lib/UploadTray/UploadTray.js";
|
|
7
6
|
import "../../../../shared/ui/dist/index.js";
|
|
8
|
-
import { UploadReceiptToastLabels as
|
|
9
|
-
import { UploadReceiptButton as
|
|
10
|
-
import { UploadReceiptModal as
|
|
7
|
+
import { UploadReceiptToastLabels as t } from "../../../ui/dist/index2.js";
|
|
8
|
+
import { UploadReceiptButton as n } from "../../../ui/dist/index3.js";
|
|
9
|
+
import { UploadReceiptModal as r } from "../../../ui/dist/index4.js";
|
|
11
10
|
import "../../../ui/dist/index.js";
|
|
12
|
-
import { useEffect as a, useRef as o, useState as s } from "react";
|
|
11
|
+
import { useEffect as i, useImperativeHandle as a, useRef as o, useState as s } from "react";
|
|
13
12
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
14
13
|
// ../../libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/lib/UploadReceiptWidget.js
|
|
15
|
-
var u =
|
|
16
|
-
function
|
|
17
|
-
return e ? e.stillProcessing > 0 ?
|
|
14
|
+
var u = 10;
|
|
15
|
+
function d(e, n) {
|
|
16
|
+
return e ? e.stillProcessing > 0 ? t.MatchingUnfinished(e.stillProcessing) : e.total === 0 ? t.UploadedAll(n) : e.matched === e.total ? t.MatchedAll(e.matched) : t.MatchedPartial(e.matched, e.total) : t.UploadedAll(n);
|
|
18
17
|
}
|
|
19
|
-
function
|
|
20
|
-
let [v, y] = s(!1), [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}), [])
|
|
18
|
+
function f({ emailAddress: f, onFileUpload: p, onAwaitMatching: m, isUploading: h = !1, ref: g }) {
|
|
19
|
+
let [_, v] = s(!1), [y, b] = s(!1), [x, S] = s(!1), [C, w] = s(""), T = o(0), [E, D] = s([]), O = o(!0);
|
|
20
|
+
i(() => (O.current = !0, () => {
|
|
21
|
+
O.current = !1;
|
|
22
|
+
}), []);
|
|
23
|
+
let k = async (e) => {
|
|
24
|
+
if (!p || h || y || e.length === 0) return;
|
|
25
|
+
if (e.length > u) {
|
|
26
|
+
++T.current, D([]), w(t.TooManyFiles(u)), S(!0);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
let n = ++T.current;
|
|
30
|
+
b(!0), D(e.map((e) => ({
|
|
31
|
+
file: e,
|
|
32
|
+
status: "queued"
|
|
33
|
+
}))), w(t.Uploading(e.length)), S(!0), v(!1);
|
|
34
|
+
let r = 0, i = 0;
|
|
35
|
+
for (let [t, n] of e.entries()) {
|
|
36
|
+
O.current && D((e) => e.map((e, n) => n === t ? {
|
|
37
|
+
...e,
|
|
38
|
+
status: "uploading"
|
|
39
|
+
} : e));
|
|
40
|
+
try {
|
|
41
|
+
await p(n), r++, O.current && D((e) => e.map((e, n) => n === t ? {
|
|
42
|
+
...e,
|
|
43
|
+
status: "uploaded"
|
|
44
|
+
} : e));
|
|
45
|
+
} catch {
|
|
46
|
+
i++, O.current && D((e) => e.map((e, n) => n === t ? {
|
|
47
|
+
...e,
|
|
48
|
+
status: "failed"
|
|
49
|
+
} : e));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
let a;
|
|
53
|
+
try {
|
|
54
|
+
a = m?.(r);
|
|
55
|
+
} catch {
|
|
56
|
+
a = void 0;
|
|
57
|
+
}
|
|
58
|
+
if (i > 0 || r === 0) {
|
|
59
|
+
a?.catch(() => void 0), O.current && (w(r === 0 ? e.length === 1 ? t.UploadFailedSingle : t.UploadFailedAll(i) : t.UploadedPartial(r, e.length)), b(!1));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (O.current && b(!1), !O.current) {
|
|
63
|
+
a?.catch(() => void 0);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
let o = null;
|
|
67
|
+
if (a) {
|
|
68
|
+
w(t.Matching(r));
|
|
69
|
+
try {
|
|
70
|
+
o = await a;
|
|
71
|
+
} catch {}
|
|
72
|
+
}
|
|
73
|
+
O.current && n === T.current && w(d(o, r));
|
|
74
|
+
}, A = async (e) => {
|
|
75
|
+
if (!p || h || y) return;
|
|
76
|
+
let n = E[e]?.file;
|
|
77
|
+
if (!n) return;
|
|
78
|
+
let r = ++T.current;
|
|
79
|
+
b(!0);
|
|
80
|
+
let i = !1, a = () => {
|
|
81
|
+
i || (i = !0, O.current && b(!1));
|
|
82
|
+
};
|
|
83
|
+
D((t) => t.map((t, n) => n === e ? {
|
|
84
|
+
...t,
|
|
85
|
+
status: "uploading"
|
|
86
|
+
} : t));
|
|
87
|
+
try {
|
|
88
|
+
await p(n), D((t) => t.map((t, n) => n === e ? {
|
|
89
|
+
...t,
|
|
90
|
+
status: "uploaded"
|
|
91
|
+
} : t)), a();
|
|
92
|
+
let t = null;
|
|
93
|
+
try {
|
|
94
|
+
t = await m?.(1) ?? null;
|
|
95
|
+
} catch {}
|
|
96
|
+
O.current && r === T.current && w(d(t, 1));
|
|
97
|
+
} catch {
|
|
98
|
+
try {
|
|
99
|
+
(m?.(0))?.catch(() => void 0);
|
|
100
|
+
} catch {}
|
|
101
|
+
if (!O.current) return;
|
|
102
|
+
w(t.UploadFailedSingle), D((t) => t.map((t, n) => n === e ? {
|
|
103
|
+
...t,
|
|
104
|
+
status: "failed"
|
|
105
|
+
} : t));
|
|
106
|
+
} finally {
|
|
107
|
+
a();
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
return a(g, () => ({ upload: (e) => void k(e) })), /* @__PURE__ */ l("div", {
|
|
24
111
|
className: "ttw:relative",
|
|
25
|
-
children: [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
112
|
+
children: [x && /* @__PURE__ */ c(e, {
|
|
113
|
+
title: t.TrayTitle,
|
|
114
|
+
summary: C,
|
|
115
|
+
closeLabel: t.CloseTray,
|
|
116
|
+
collapseLabel: t.CollapseTray,
|
|
117
|
+
expandLabel: t.ExpandTray,
|
|
118
|
+
retryLabel: t.Retry,
|
|
119
|
+
onClose: () => S(!1),
|
|
120
|
+
items: E.map((e, n) => ({
|
|
121
|
+
id: String(n),
|
|
122
|
+
name: e.file.name,
|
|
123
|
+
status: e.status === "failed" ? t.FileFailed : e.status === "uploaded" ? t.FileUploaded : e.status === "queued" ? t.FileQueued : t.FileUploading(n + 1, E.length),
|
|
124
|
+
onRetry: e.status === "failed" && !y ? () => void A(n) : void 0
|
|
125
|
+
}))
|
|
126
|
+
}), /* @__PURE__ */ c(r, {
|
|
127
|
+
trigger: /* @__PURE__ */ c(n, {
|
|
128
|
+
onClick: () => v((e) => !e),
|
|
129
|
+
open: _
|
|
30
130
|
}),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (t.length > f) {
|
|
38
|
-
e.error(n.TooManyFiles(f), { duration: d });
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
x(!0), y(!1);
|
|
42
|
-
let r = e.loading(n.Uploading(t.length)), i = 0, a = 0;
|
|
43
|
-
for (let e of t) try {
|
|
44
|
-
await h(e), i++;
|
|
45
|
-
} catch {
|
|
46
|
-
a++;
|
|
47
|
-
}
|
|
48
|
-
let o;
|
|
49
|
-
try {
|
|
50
|
-
o = g?.(i);
|
|
51
|
-
} catch {
|
|
52
|
-
o = void 0;
|
|
53
|
-
}
|
|
54
|
-
if (a > 0 || i === 0) {
|
|
55
|
-
if (o?.catch(() => void 0), !S.current) {
|
|
56
|
-
e.dismiss(r);
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
e.error(i === 0 ? t.length === 1 ? n.UploadFailedSingle : n.UploadFailedAll(a) : n.UploadedPartial(i, t.length), {
|
|
60
|
-
id: r,
|
|
61
|
-
duration: d
|
|
62
|
-
}), x(!1);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
if (x(!1), !S.current) {
|
|
66
|
-
o?.catch(() => void 0), e.dismiss(r);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
let s = null;
|
|
70
|
-
if (o) {
|
|
71
|
-
e.loading(n.Matching(i), { id: r });
|
|
72
|
-
try {
|
|
73
|
-
s = await o;
|
|
74
|
-
} catch {}
|
|
75
|
-
}
|
|
76
|
-
S.current ? e.success(p(s, i), {
|
|
77
|
-
id: r,
|
|
78
|
-
duration: u
|
|
79
|
-
}) : e.dismiss(r);
|
|
80
|
-
},
|
|
81
|
-
isUploading: _ || b
|
|
82
|
-
})
|
|
83
|
-
]
|
|
131
|
+
open: _,
|
|
132
|
+
onClose: () => v(!1),
|
|
133
|
+
emailAddress: f,
|
|
134
|
+
onFilesSelected: k,
|
|
135
|
+
isUploading: h || y
|
|
136
|
+
})]
|
|
84
137
|
});
|
|
85
138
|
}
|
|
86
|
-
export {
|
|
139
|
+
export { f as UploadReceiptWidget };
|
|
@@ -4,7 +4,11 @@ var e = {
|
|
|
4
4
|
Subtitle: "Upload card transaction receipts and we'll automatically match them to the correct transaction.",
|
|
5
5
|
DropZonePrefix: "Drop your files here, or",
|
|
6
6
|
ClickToBrowse: "click to browse",
|
|
7
|
-
FileTypes: "PDF, PNG or JPG
|
|
7
|
+
FileTypes: "PDF, PNG or JPG, 10 files at a time",
|
|
8
|
+
TooManyFiles: "Choose up to 10 files at a time.",
|
|
9
|
+
CopyAddress: "Copy email address",
|
|
10
|
+
CopiedAddress: "Email address copied",
|
|
11
|
+
CopyFailed: "Couldn’t copy email address",
|
|
8
12
|
OrSendViaEmail: "Or send via email",
|
|
9
13
|
EmailDescription: "All receipts sent to this email address will be automatically processed and matched to expenses.",
|
|
10
14
|
CopyButton: "Copy",
|
|
@@ -17,6 +21,15 @@ function n(e) {
|
|
|
17
21
|
return e === 1 ? "1 attachment" : `${e} attachments`;
|
|
18
22
|
}
|
|
19
23
|
var r = {
|
|
24
|
+
TrayTitle: "Receipt uploads",
|
|
25
|
+
CloseTray: "Close receipt uploads",
|
|
26
|
+
CollapseTray: "Collapse receipt uploads",
|
|
27
|
+
ExpandTray: "Expand receipt uploads",
|
|
28
|
+
Retry: "Try again",
|
|
29
|
+
FileUploading: (e, t) => `Uploading ${e} of ${t}`,
|
|
30
|
+
FileUploaded: "Uploaded",
|
|
31
|
+
FileQueued: "Waiting to upload",
|
|
32
|
+
FileFailed: "Couldn’t upload",
|
|
20
33
|
Uploading: (e) => `Uploading ${n(e)}`,
|
|
21
34
|
UploadedAll: (e) => `Uploaded ${n(e)}`,
|
|
22
35
|
UploadFailedSingle: "Upload failed",
|
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
6
|
import { UploadReceiptWidgetLabels as t } from "./index2.js";
|
|
7
|
-
import { jsx as n
|
|
8
|
-
import { ChevronDown as i, ChevronUp as a } from "lucide-react";
|
|
7
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
9
8
|
// ../../libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index3.js
|
|
10
|
-
function
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
9
|
+
function r({ open: r = !1, ref: i, ...a }) {
|
|
10
|
+
return /* @__PURE__ */ n(e, {
|
|
11
|
+
...a,
|
|
12
|
+
ref: i,
|
|
13
13
|
size: "lg",
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
"aria-expanded": r,
|
|
15
|
+
"aria-haspopup": "dialog",
|
|
16
|
+
children: t.ButtonLabel
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
|
-
export {
|
|
19
|
+
export { r as UploadReceiptButton };
|
|
@@ -2,141 +2,88 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
5
|
+
import { Button as e, Heading as t, Popover as n, PopoverContent as r, PopoverTrigger as i, Tooltip as a, TooltipContent as o, TooltipProvider as s, TooltipTrigger as c } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { FileDropZone as l } from "../../../shared/ui/dist/lib/FileDropZone/FileDropZone.js";
|
|
7
|
+
import { CopyAddress as u } from "../../../shared/ui/dist/lib/CopyAddress/CopyAddress.js";
|
|
8
|
+
import "../../../shared/ui/dist/index.js";
|
|
9
|
+
import { UploadReceiptModalLabels as d } from "./index2.js";
|
|
10
|
+
import { useId as f, useState as p } from "react";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
|
+
import { X as g } from "lucide-react";
|
|
10
13
|
// ../../libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index4.js
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
function _({ open: _, onClose: v, trigger: y, emailAddress: b, onFilesSelected: x, isUploading: S = !1 }) {
|
|
15
|
+
let C = f(), [w, T] = p(), E = () => {
|
|
16
|
+
T(void 0), v();
|
|
17
|
+
};
|
|
18
|
+
return /* @__PURE__ */ h(n, {
|
|
19
|
+
open: _,
|
|
20
|
+
onOpenChange: (e) => {
|
|
21
|
+
e || E();
|
|
22
|
+
},
|
|
23
|
+
children: [y && /* @__PURE__ */ m(i, {
|
|
24
|
+
asChild: !0,
|
|
25
|
+
children: y
|
|
26
|
+
}), /* @__PURE__ */ h(r, {
|
|
27
|
+
align: "end",
|
|
28
|
+
"aria-labelledby": C,
|
|
29
|
+
className: "ttw:w-[27.5rem] ttw:max-w-[calc(100vw-2rem)] ttw:p-6",
|
|
24
30
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
/* @__PURE__ */ h("div", {
|
|
32
|
+
className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
|
|
33
|
+
children: [/* @__PURE__ */ m(t, {
|
|
34
|
+
variant: "dialog",
|
|
35
|
+
level: 2,
|
|
36
|
+
id: C,
|
|
37
|
+
children: d.Title
|
|
38
|
+
}), /* @__PURE__ */ m(s, { children: /* @__PURE__ */ h(a, { children: [/* @__PURE__ */ m(c, {
|
|
39
|
+
asChild: !0,
|
|
40
|
+
children: /* @__PURE__ */ m(e, {
|
|
41
|
+
type: "button",
|
|
42
|
+
variant: "ghost",
|
|
43
|
+
size: "icon-sm",
|
|
44
|
+
"aria-label": d.Close,
|
|
45
|
+
onClick: E,
|
|
46
|
+
children: /* @__PURE__ */ m(g, { className: "ttw:size-4" })
|
|
47
|
+
})
|
|
48
|
+
}), /* @__PURE__ */ m(o, { children: d.Close })] }) })]
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ m("p", {
|
|
51
|
+
className: "ttw:mt-1 ttw:mb-4 ttw:text-sm ttw:text-muted-foreground",
|
|
52
|
+
children: d.Subtitle
|
|
30
53
|
}),
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
|
|
33
|
-
|
|
54
|
+
/* @__PURE__ */ m(l, {
|
|
55
|
+
label: `${d.DropZonePrefix} ${d.ClickToBrowse}`,
|
|
56
|
+
rules: d.FileTypes,
|
|
57
|
+
inputLabel: d.FileInput,
|
|
58
|
+
accept: ".pdf,.png,.jpg,.jpeg",
|
|
59
|
+
multiple: !0,
|
|
60
|
+
disabled: S,
|
|
61
|
+
onFilesSelected: (e) => {
|
|
62
|
+
e.length > 10 ? T(d.TooManyFiles) : (T(void 0), x?.(e));
|
|
63
|
+
},
|
|
64
|
+
error: w
|
|
34
65
|
}),
|
|
35
|
-
|
|
36
|
-
className: "ttw:
|
|
37
|
-
children: [
|
|
38
|
-
|
|
39
|
-
children: [/* @__PURE__ */ a(l, {
|
|
40
|
-
size: 18,
|
|
41
|
-
className: "ttw:animate-spin ttw:text-primary"
|
|
42
|
-
}), /* @__PURE__ */ a("p", {
|
|
66
|
+
b && /* @__PURE__ */ h("div", {
|
|
67
|
+
className: "ttw:mt-4 ttw:flex ttw:flex-col ttw:gap-2",
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ m("p", {
|
|
43
70
|
className: "ttw:text-sm ttw:font-medium ttw:text-primary",
|
|
44
|
-
children:
|
|
45
|
-
})]
|
|
46
|
-
}), /* @__PURE__ */ a("p", {
|
|
47
|
-
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
48
|
-
children: t.ProcessingSubtitle
|
|
49
|
-
})]
|
|
50
|
-
}) : /* @__PURE__ */ o(i, { children: [
|
|
51
|
-
/* @__PURE__ */ a("p", {
|
|
52
|
-
className: "ttw:text-sm ttw:text-muted-foreground ttw:mb-5",
|
|
53
|
-
children: t.Subtitle
|
|
54
|
-
}),
|
|
55
|
-
/* @__PURE__ */ o("button", {
|
|
56
|
-
type: "button",
|
|
57
|
-
className: `ttw:mb-5 ttw:flex ttw:w-full ttw:cursor-pointer ttw:flex-col ttw:items-center ttw:rounded-xl ttw:border ttw:border-dashed ttw:p-8 ttw:text-center ${_ ? "ttw:border-primary ttw:bg-white" : "ttw:border-border ttw:bg-muted"}`,
|
|
58
|
-
onClick: () => g.current?.click(),
|
|
59
|
-
onDragOver: (e) => {
|
|
60
|
-
e.preventDefault(), v(!0);
|
|
61
|
-
},
|
|
62
|
-
onDragLeave: (e) => {
|
|
63
|
-
e.preventDefault(), v(!1);
|
|
64
|
-
},
|
|
65
|
-
onDrop: async (e) => {
|
|
66
|
-
e.preventDefault(), v(!1);
|
|
67
|
-
let t = e.dataTransfer.files ? Array.from(e.dataTransfer.files) : [];
|
|
68
|
-
t.length > 0 && await m?.(t);
|
|
69
|
-
},
|
|
70
|
-
disabled: h,
|
|
71
|
-
children: [
|
|
72
|
-
/* @__PURE__ */ a("div", {
|
|
73
|
-
className: "ttw:w-12 ttw:h-12 ttw:rounded-full ttw:bg-primary ttw:flex ttw:items-center ttw:justify-center ttw:mb-3",
|
|
74
|
-
children: /* @__PURE__ */ a(s, {
|
|
75
|
-
size: 24,
|
|
76
|
-
className: "ttw:text-white"
|
|
77
|
-
})
|
|
78
|
-
}),
|
|
79
|
-
/* @__PURE__ */ o("p", {
|
|
80
|
-
className: "ttw:text-sm ttw:text-center ttw:text-foreground",
|
|
81
|
-
children: [
|
|
82
|
-
t.DropZonePrefix,
|
|
83
|
-
" ",
|
|
84
|
-
/* @__PURE__ */ a("span", {
|
|
85
|
-
className: "ttw:text-primary ttw:cursor-pointer ttw:hover:underline",
|
|
86
|
-
children: t.ClickToBrowse
|
|
87
|
-
})
|
|
88
|
-
]
|
|
89
|
-
}),
|
|
90
|
-
/* @__PURE__ */ a("p", {
|
|
91
|
-
className: "ttw:text-xs ttw:text-muted-foreground ttw:mt-1",
|
|
92
|
-
children: t.FileTypes
|
|
93
|
-
})
|
|
94
|
-
]
|
|
95
|
-
}),
|
|
96
|
-
p ? /* @__PURE__ */ o(i, { children: [
|
|
97
|
-
/* @__PURE__ */ a("p", {
|
|
98
|
-
className: "ttw:text-sm ttw:font-medium ttw:text-primary ttw:mb-1",
|
|
99
|
-
children: t.OrSendViaEmail
|
|
71
|
+
children: d.OrSendViaEmail
|
|
100
72
|
}),
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
className: "ttw:text-
|
|
103
|
-
children:
|
|
73
|
+
/* @__PURE__ */ m("p", {
|
|
74
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
75
|
+
children: d.EmailDescription
|
|
104
76
|
}),
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}), /* @__PURE__ */ o(e, {
|
|
111
|
-
type: "button",
|
|
112
|
-
variant: "ghost",
|
|
113
|
-
size: "sm",
|
|
114
|
-
className: "ttw:flex ttw:items-center ttw:gap-1.5 ttw:text-primary ttw:text-sm ttw:font-medium ttw:transition-colors",
|
|
115
|
-
onClick: () => navigator.clipboard.writeText(p).catch(() => void 0),
|
|
116
|
-
children: [/* @__PURE__ */ a(c, { size: 14 }), t.CopyButton]
|
|
117
|
-
})]
|
|
77
|
+
/* @__PURE__ */ m(u, {
|
|
78
|
+
address: b,
|
|
79
|
+
copyLabel: d.CopyAddress,
|
|
80
|
+
copiedLabel: d.CopiedAddress,
|
|
81
|
+
failedLabel: d.CopyFailed
|
|
118
82
|
})
|
|
119
|
-
]
|
|
120
|
-
|
|
121
|
-
ref: g,
|
|
122
|
-
type: "file",
|
|
123
|
-
accept: ".pdf,.png,.jpg,.jpeg",
|
|
124
|
-
multiple: !0,
|
|
125
|
-
disabled: h,
|
|
126
|
-
"aria-label": t.FileInput,
|
|
127
|
-
className: "ttw:hidden",
|
|
128
|
-
onChange: async (e) => {
|
|
129
|
-
let t = e.target.files ? Array.from(e.target.files) : [];
|
|
130
|
-
try {
|
|
131
|
-
t.length > 0 && await m?.(t);
|
|
132
|
-
} finally {
|
|
133
|
-
e.target.value = "";
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
})
|
|
137
|
-
] })
|
|
83
|
+
]
|
|
84
|
+
})
|
|
138
85
|
]
|
|
139
|
-
})
|
|
140
|
-
})
|
|
86
|
+
})]
|
|
87
|
+
});
|
|
141
88
|
}
|
|
142
|
-
export {
|
|
89
|
+
export { _ as UploadReceiptModal };
|