@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.
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,85 +2,138 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { toast as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
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 n } from "../../../ui/dist/index2.js";
9
- import { UploadReceiptButton as r } from "../../../ui/dist/index3.js";
10
- import { UploadReceiptModal as i } from "../../../ui/dist/index4.js";
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 = 3e3, d = 5e3, f = 10;
16
- function p(e, t) {
17
- return e ? e.stillProcessing > 0 ? n.MatchingUnfinished(e.stillProcessing) : e.total === 0 ? n.UploadedAll(t) : e.matched === e.total ? n.MatchedAll(e.matched) : n.MatchedPartial(e.matched, e.total) : n.UploadedAll(t);
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 m({ emailAddress: m, onFileUpload: h, onAwaitMatching: g, isUploading: _ = !1 }) {
20
- let [v, y] = s(!1), [b, x] = s(!1), S = o(!0);
21
- return a(() => (S.current = !0, () => {
22
- S.current = !1;
23
- }), []), /* @__PURE__ */ l("div", {
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
- /* @__PURE__ */ c(t, {}),
27
- /* @__PURE__ */ c(r, {
28
- onClick: () => y((e) => !e),
29
- open: v
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
- /* @__PURE__ */ c(i, {
32
- open: v,
33
- onClose: () => y(!1),
34
- emailAddress: m,
35
- onFilesSelected: async (t) => {
36
- if (!h || _ || b || t.length === 0) return;
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 { m as UploadReceiptWidget };
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 (max. 20MB)",
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, jsxs as r } from "react/jsx-runtime";
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 o({ onClick: o, open: s = !1 }) {
11
- return /* @__PURE__ */ r(e, {
12
- onClick: o,
9
+ function r({ open: r = !1, ref: i, ...a }) {
10
+ return /* @__PURE__ */ n(e, {
11
+ ...a,
12
+ ref: i,
13
13
  size: "lg",
14
- className: "ttw:cursor-pointer ttw:shadow-xs",
15
- children: [t.ButtonLabel, n(s ? a : i, { size: 16 })]
14
+ "aria-expanded": r,
15
+ "aria-haspopup": "dialog",
16
+ children: t.ButtonLabel
16
17
  });
17
18
  }
18
- export { o as UploadReceiptButton };
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 { UploadReceiptModalLabels as t } from "./index2.js";
7
- import { useRef as n, useState as r } from "react";
8
- import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
9
- import { CloudUpload as s, Copy as c, Loader2 as l, X as u } from "lucide-react";
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 d({ open: d, onClose: f, emailAddress: p, onFilesSelected: m, isUploading: h = !1 }) {
12
- let g = n(null), [_, v] = r(!1);
13
- return d ? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("div", {
14
- className: "ttw:fixed ttw:inset-0 ttw:z-40",
15
- onClick: f,
16
- "aria-hidden": "true"
17
- }), /* @__PURE__ */ a("div", {
18
- role: "dialog",
19
- "aria-modal": "false",
20
- "aria-label": t.Title,
21
- className: "ttw:absolute ttw:right-0 ttw:top-full ttw:z-50 ttw:mt-2 ttw:w-[27.5rem] ttw:max-w-[calc(100vw-2rem)] ttw:rounded-2xl ttw:border ttw:border-border ttw:bg-popover ttw:p-6 ttw:shadow-xl",
22
- children: /* @__PURE__ */ o("div", {
23
- className: "ttw:relative",
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__ */ a("button", {
26
- onClick: f,
27
- "aria-label": t.Close,
28
- className: "ttw:absolute ttw:top-0 ttw:right-0 ttw:text-muted-foreground ttw:hover:text-foreground ttw:transition-colors",
29
- children: /* @__PURE__ */ a(u, { size: 20 })
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__ */ a("h2", {
32
- className: "ttw:text-xl ttw:font-semibold ttw:mb-1",
33
- children: t.Title
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
- h ? /* @__PURE__ */ o("div", {
36
- className: "ttw:flex ttw:flex-col ttw:items-center ttw:py-8 ttw:gap-3 ttw:text-center",
37
- children: [/* @__PURE__ */ o("div", {
38
- className: "ttw:flex ttw:items-center ttw:gap-2",
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: t.ProcessingTitle
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__ */ a("p", {
102
- className: "ttw:text-xs ttw:text-muted-foreground ttw:mb-3",
103
- children: t.EmailDescription
73
+ /* @__PURE__ */ m("p", {
74
+ className: "ttw:text-sm ttw:text-muted-foreground",
75
+ children: d.EmailDescription
104
76
  }),
105
- /* @__PURE__ */ o("div", {
106
- className: "ttw:flex ttw:items-center ttw:justify-between ttw:border ttw:border-border ttw:rounded-lg ttw:px-3 ttw:py-2.5",
107
- children: [/* @__PURE__ */ a("span", {
108
- className: "ttw:text-sm ttw:text-foreground",
109
- children: p
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
- ] }) : null,
120
- /* @__PURE__ */ a("input", {
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
- })] }) : null;
86
+ })]
87
+ });
141
88
  }
142
- export { d as UploadReceiptModal };
89
+ export { _ as UploadReceiptModal };