@tesouro/embedded-components-react 0.11.169 → 0.11.172

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 (49) hide show
  1. package/README.md +10 -6
  2. package/dist/index.d.ts +15 -4
  3. package/dist/lib/BillPayWidget.d.ts +9 -4
  4. package/dist/lib/ReceivablesWidget.d.ts +6 -0
  5. package/dist/lib/WidgetSuite.d.ts +6 -0
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +75 -66
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +62 -53
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +44 -38
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +331 -326
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +10 -8
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +190 -187
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +12 -19
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +25 -23
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +4 -7
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +23 -24
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +5 -5
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +196 -187
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +8 -5
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index8.js +20 -18
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +11 -15
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +313 -324
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +46 -38
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +2 -2
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +4 -8
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +1 -1
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +45 -22
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +5 -27
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +32 -2
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +2 -29
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/index.js +7 -6
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/lib/resolveBillDueDate.js +22 -0
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +116 -98
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +99 -92
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +7 -1
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurringSeries.js +15 -24
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +59 -69
  39. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +7 -5
  41. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/DateDisclosure/DateDisclosure.js +28 -0
  42. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/DueDateText/DueDateText.js +19 -0
  43. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/index.js +28 -27
  44. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/dueDateDisplay.js +23 -0
  45. package/package.json +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +0 -2
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +0 -6
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +0 -33
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +0 -2
@@ -1,291 +1,288 @@
1
- import { Button as e, ContextMenuItem as t, DataTable as n, DataTableSortableHeader as r, Input as i, Separator as a, Skeleton as ee, Tabs as o, TabsContent as s, TabsList as c, TabsTrigger as te, Tooltip as ne, TooltipContent as l, TooltipProvider as u, TooltipTrigger as d } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { EmptyState as f } from "../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
- import { ErrorState as re } from "../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
1
+ import { Button as e, ContextMenuItem as t, DataTable as n, DataTableSortableHeader as r, Input as i, Separator as a, Skeleton as ee, Tabs as o, TabsContent as s, TabsList as c, TabsTrigger as te, Tooltip as ne, TooltipContent as re, TooltipProvider as ie, TooltipTrigger as ae } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { EmptyState as l } from "../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
+ import { ErrorState as oe } from "../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
4
+ import { DateDisclosure as se } from "../../../../shared/ui/dist/lib/DateDisclosure/DateDisclosure.js";
5
+ import { DueDateText as ce } from "../../../../shared/ui/dist/lib/DueDateText/DueDateText.js";
4
6
  import "../../../../shared/ui/dist/index.js";
5
- import { BillStatusBadge as ie } from "../../../../shared/document-status/ui/dist/index4.js";
7
+ import { BillStatusBadge as le } from "../../../../shared/document-status/ui/dist/index4.js";
6
8
  import "../../../../shared/document-status/ui/dist/index.js";
7
- import { BillDuplicateIcon as ae } from "../../../ui/dist/index6.js";
8
- import { BillDuplicateWarning as oe } from "../../../ui/dist/index8.js";
9
- import { BillOverflowMenu as se } from "../../../ui/dist/index11.js";
10
- import { getAcceptedBillUploadFiles as ce } from "../../../ui/dist/index17.js";
11
- import { DateDisclosure as le } from "../../../ui/dist/index20.js";
12
- import { DueDateValue as ue } from "../../../ui/dist/index22.js";
9
+ import { BillDuplicateIcon as ue } from "../../../ui/dist/index6.js";
10
+ import { BillDuplicateWarning as de } from "../../../ui/dist/index8.js";
11
+ import { BillOverflowMenu as fe } from "../../../ui/dist/index11.js";
12
+ import { getAcceptedBillUploadFiles as pe } from "../../../ui/dist/index17.js";
13
13
  import "../../../ui/dist/index.js";
14
- import { AddBillPanel as p } from "./index3.js";
14
+ import { AddBillPanel as u } from "./index3.js";
15
15
  import "./index4.js";
16
- import { BillsFilterBar as de } from "./index10.js";
16
+ import { BillsFilterBar as me } from "./index10.js";
17
17
  import "./index11.js";
18
- import { MissingValue as m } from "./index13.js";
18
+ import { MissingValue as d } from "./index13.js";
19
19
  import "./index14.js";
20
- import { NoValue as h } from "./index16.js";
20
+ import { NoValue as f } from "./index16.js";
21
21
  import "./index17.js";
22
- import { BILLS_SCREEN_LABELS_EN as g, BILLS_SCREEN_UPLOAD_ACCEPT as _ } from "./index18.js";
23
- import { BillColumn as v } from "./index19.js";
24
- import { Fragment as fe, useMemo as y, useState as pe } from "react";
25
- import { Fragment as me, jsx as b, jsxs as x } from "react/jsx-runtime";
26
- import { PaperclipIcon as he, PlusIcon as ge, SearchIcon as _e, SettingsIcon as ve, UploadIcon as ye } from "lucide-react";
22
+ import { BILLS_SCREEN_LABELS_EN as p, BILLS_SCREEN_UPLOAD_ACCEPT as m } from "./index18.js";
23
+ import { BillColumn as h } from "./index19.js";
24
+ import { Fragment as he, useMemo as g, useState as ge } from "react";
25
+ import { createPortal as _e } from "react-dom";
26
+ import { Fragment as ve, jsx as _, jsxs as v } from "react/jsx-runtime";
27
+ import { PaperclipIcon as ye, SearchIcon as be, UploadIcon as xe } from "lucide-react";
27
28
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js
28
- var be = [
29
+ var Se = [
29
30
  10,
30
31
  25,
31
32
  50,
32
33
  100
33
- ], xe = 240;
34
- function Se(e, t) {
34
+ ], Ce = 240;
35
+ function we(e, t) {
35
36
  return e === "resolving" ? t.vendorResolving : e === "unavailable" ? t.vendorUnavailable : t.missingValue.missing;
36
37
  }
37
- var Ce = 40, we = 56, Te = [
38
- v.Vendor,
39
- v.InvoiceNumber,
40
- v.Attachment,
41
- v.IssueDate,
42
- v.DueDate,
43
- v.ScheduledDate,
44
- v.PaidDate,
45
- v.Status,
46
- v.AmountDue,
47
- v.AmountScheduled,
48
- v.AmountPaid,
49
- v.TotalAmount,
50
- v.AddedOn
51
- ], S = [
52
- v.Vendor,
53
- v.Attachment,
54
- v.DueDate,
55
- v.Status,
56
- v.AmountDue,
57
- v.AddedOn
38
+ var y = 40, Te = 56, Ee = [
39
+ h.Vendor,
40
+ h.InvoiceNumber,
41
+ h.Attachment,
42
+ h.IssueDate,
43
+ h.DueDate,
44
+ h.ScheduledDate,
45
+ h.PaidDate,
46
+ h.Status,
47
+ h.AmountDue,
48
+ h.AmountScheduled,
49
+ h.AmountPaid,
50
+ h.TotalAmount,
51
+ h.AddedOn
52
+ ], b = [
53
+ h.Vendor,
54
+ h.Attachment,
55
+ h.DueDate,
56
+ h.Status,
57
+ h.AmountDue,
58
+ h.AddedOn
58
59
  ];
59
- function C({ rows: C, isLoading: w, isError: T, sorting: Ee, onSortingChange: De, pageSize: Oe, onPageSizeChange: ke, pageSizeOptions: E = be, pageInfo: Ae, hasNextPage: D, hasPrevPage: O, onNextPage: je, onPrevPage: Me, filterTabs: k, selectedFilterTabId: A, onFilterTabChange: Ne, searchValue: Pe, onSearchChange: Fe, filters: j, visibleColumns: M = S, keepsColumnOrder: N = !1, isSortable: P = !0, cellTestIds: F, isSearchActive: I, showAddPanelWhenEmpty: Ie, emptyState: L, onCreateClick: R, onSettingsClick: z, onRetry: B, onFilesSelected: V, maxFiles: H, onEnterManually: U, uploadStatus: W, uploadErrorMessage: G, emailAddress: K, onCopyEmail: q, labels: J, duplicateWarning: Le, duplicateReviewControl: Y }) {
60
- let X = y(() => ({
61
- ...g,
62
- ...J,
60
+ function x({ rows: x, isLoading: S, isError: De, sorting: Oe, onSortingChange: ke, pageSize: Ae, onPageSizeChange: je, pageSizeOptions: C = Se, pageInfo: Me, hasNextPage: w, hasPrevPage: T, onNextPage: Ne, onPrevPage: Pe, filterTabs: E, selectedFilterTabId: D, onFilterTabChange: Fe, searchValue: Ie, onSearchChange: Le, filters: O, visibleColumns: k = b, keepsColumnOrder: A = !1, isSortable: j = !0, cellTestIds: M, isSearchActive: N, showAddPanelWhenEmpty: Re, emptyState: P, onCreateClick: F, headerActionContainer: I, onRetry: L, onFilesSelected: R, maxFiles: z, onEnterManually: B, uploadStatus: V, uploadErrorMessage: H, emailAddress: U, onCopyEmail: W, labels: G, duplicateWarning: K, duplicateReviewControl: q }) {
61
+ let J = g(() => ({
62
+ ...p,
63
+ ...G,
63
64
  statusBadge: {
64
- ...g.statusBadge,
65
- ...J?.statusBadge
65
+ ...p.statusBadge,
66
+ ...G?.statusBadge
66
67
  },
67
68
  addBill: {
68
- ...g.addBill,
69
- ...J?.addBill,
69
+ ...p.addBill,
70
+ ...G?.addBill,
70
71
  dropzone: {
71
- ...g.addBill.dropzone,
72
- ...J?.addBill?.dropzone
72
+ ...p.addBill.dropzone,
73
+ ...G?.addBill?.dropzone
73
74
  }
74
75
  },
75
76
  sortableHeader: {
76
- ...g.sortableHeader,
77
- ...J?.sortableHeader
77
+ ...p.sortableHeader,
78
+ ...G?.sortableHeader
78
79
  },
79
80
  missingValue: {
80
- ...g.missingValue,
81
- ...J?.missingValue
81
+ ...p.missingValue,
82
+ ...G?.missingValue
82
83
  },
83
84
  noValue: {
84
- ...g.noValue,
85
- ...J?.noValue
86
- },
87
- dueDate: {
88
- ...g.dueDate,
89
- ...J?.dueDate
85
+ ...p.noValue,
86
+ ...G?.noValue
90
87
  }
91
- }), [J]), Re = C.some((e) => e.menu?.items.length), [ze, Z] = pe(!1), Q = !!V, Be = (e) => Array.from(e.dataTransfer.types).includes("Files"), Ve = (e) => {
92
- Q && Be(e) && (e.preventDefault(), Z(!0));
88
+ }), [G]), Y = x.some((e) => e.menu?.items.length), [ze, X] = ge(!1), Z = !!R, Be = (e) => Array.from(e.dataTransfer.types).includes("Files"), Ve = (e) => {
89
+ Z && Be(e) && (e.preventDefault(), X(!0));
93
90
  }, He = (e) => {
94
- Q && Be(e) && (e.preventDefault(), e.dataTransfer.dropEffect = "copy", Z(!0));
91
+ Z && Be(e) && (e.preventDefault(), e.dataTransfer.dropEffect = "copy", X(!0));
95
92
  }, Ue = (e) => {
96
- !e.currentTarget.contains(e.relatedTarget) && Q && Z(!1);
93
+ !e.currentTarget.contains(e.relatedTarget) && Z && X(!1);
97
94
  }, We = (e) => {
98
- if (!Q) return;
99
- e.preventDefault(), Z(!1);
100
- let t = e.dataTransfer.files ? Array.from(e.dataTransfer.files) : [], n = ce(t, _, H !== 1);
101
- n.length && V?.(n);
102
- }, Ge = y(() => {
103
- let e = (e) => P ? function({ column: t }) {
104
- return /* @__PURE__ */ b(r, {
95
+ if (!Z) return;
96
+ e.preventDefault(), X(!1);
97
+ let t = e.dataTransfer.files ? Array.from(e.dataTransfer.files) : [], n = pe(t, m, z !== 1);
98
+ n.length && R?.(n);
99
+ }, Ge = g(() => {
100
+ let e = (e) => j ? function({ column: t }) {
101
+ return /* @__PURE__ */ _(r, {
105
102
  column: t,
106
103
  title: e,
107
- labels: X.sortableHeader
104
+ labels: J.sortableHeader
108
105
  });
109
- } : e, t = (e, t, n = /* @__PURE__ */ b(m, { labels: X.missingValue }), r) => function({ row: i }) {
110
- let a = r && i.original[r] ? /* @__PURE__ */ b(m, { labels: X.missingValue }) : n;
111
- return /* @__PURE__ */ b("span", {
106
+ } : e, t = (e, t, n = /* @__PURE__ */ _(d, { labels: J.missingValue }), r) => function({ row: i }) {
107
+ let a = r && i.original[r] ? /* @__PURE__ */ _(d, { labels: J.missingValue }) : n;
108
+ return /* @__PURE__ */ _("span", {
112
109
  className: "ttw:whitespace-nowrap",
113
- "data-testid": F?.[t],
110
+ "data-testid": M?.[t],
114
111
  children: i.original[e] || a
115
112
  });
116
- }, n = t("invoiceNumberLabel", v.InvoiceNumber), i = function({ row: e }) {
117
- return /* @__PURE__ */ b("span", {
113
+ }, n = t("invoiceNumberLabel", h.InvoiceNumber), i = function({ row: e }) {
114
+ return /* @__PURE__ */ _("span", {
118
115
  className: "ttw:whitespace-nowrap",
119
- "data-testid": F?.[v.DueDate],
120
- children: /* @__PURE__ */ b(ue, {
121
- value: e.original.dueDateLabel || /* @__PURE__ */ b(m, { labels: X.missingValue }),
122
- tone: e.original.dueDateTone,
123
- labels: X.dueDate
116
+ "data-testid": M?.[h.DueDate],
117
+ children: /* @__PURE__ */ _(ce, {
118
+ label: e.original.dueDateLabel || /* @__PURE__ */ _(d, { labels: J.missingValue }),
119
+ overdueLabel: e.original.dueDateOverdueLabel,
120
+ accessibleLabel: e.original.dueDateAccessibleLabel
124
121
  })
125
122
  });
126
- }, a = (e, t, n = /* @__PURE__ */ b(m, { labels: X.missingValue }), r) => function({ row: i }) {
127
- let a = r && i.original[r] ? /* @__PURE__ */ b(m, { labels: X.missingValue }) : n;
128
- return /* @__PURE__ */ b("div", {
123
+ }, a = (e, t, n = /* @__PURE__ */ _(d, { labels: J.missingValue }), r) => function({ row: i }) {
124
+ let a = r && i.original[r] ? /* @__PURE__ */ _(d, { labels: J.missingValue }) : n;
125
+ return /* @__PURE__ */ _("div", {
129
126
  className: "ttw:text-right ttw:whitespace-nowrap",
130
- "data-testid": F?.[t],
127
+ "data-testid": M?.[t],
131
128
  children: i.original[e] || a
132
129
  });
133
- }, o = /* @__PURE__ */ b(h, { labels: X.noValue });
130
+ }, o = /* @__PURE__ */ _(f, { labels: J.noValue });
134
131
  function s({ row: e }) {
135
- let t = e.original.scheduledDateIsGap ? /* @__PURE__ */ b(m, { labels: X.missingValue }) : o, n = e.original.scheduledDateLabel, r = e.original.scheduledDateExact;
136
- return /* @__PURE__ */ b("span", {
132
+ let t = e.original.scheduledDateIsGap ? /* @__PURE__ */ _(d, { labels: J.missingValue }) : o, n = e.original.scheduledDateLabel, r = e.original.scheduledDateExact;
133
+ return /* @__PURE__ */ _("span", {
137
134
  className: "ttw:whitespace-nowrap",
138
- "data-testid": F?.[v.ScheduledDate],
139
- children: n && r ? /* @__PURE__ */ b(le, {
135
+ "data-testid": M?.[h.ScheduledDate],
136
+ children: n && r ? /* @__PURE__ */ _(se, {
140
137
  date: r,
141
138
  children: n
142
139
  }) : n || t
143
140
  });
144
141
  }
145
142
  let c = (e) => function() {
146
- return /* @__PURE__ */ b("div", {
143
+ return /* @__PURE__ */ _("div", {
147
144
  className: "ttw:text-right",
148
145
  children: e
149
146
  });
150
147
  };
151
148
  return {
152
- [v.Vendor]: {
149
+ [h.Vendor]: {
153
150
  accessorKey: "vendorLabel",
154
- enableSorting: P,
155
- minSize: xe,
156
- header: e(X.columnVendor),
151
+ enableSorting: j,
152
+ minSize: Ce,
153
+ header: e(J.columnVendor),
157
154
  cell: ({ row: e }) => {
158
- let t = e.original.rowNote ? /* @__PURE__ */ b("span", {
155
+ let t = e.original.rowNote ? /* @__PURE__ */ _("span", {
159
156
  className: "ttw:sr-only",
160
157
  children: ` ${e.original.rowNote}`
161
158
  }) : null;
162
- return !e.original.vendorLabel && e.original.vendorLookup === "resolving" ? /* @__PURE__ */ x("div", {
163
- "data-testid": F?.[v.Vendor],
164
- children: [/* @__PURE__ */ b(ee, {
159
+ return !e.original.vendorLabel && e.original.vendorLookup === "resolving" ? /* @__PURE__ */ v("div", {
160
+ "data-testid": M?.[h.Vendor],
161
+ children: [/* @__PURE__ */ _(ee, {
165
162
  className: "ttw:h-4 ttw:w-32",
166
163
  "aria-hidden": !0
167
164
  }), t]
168
- }) : /* @__PURE__ */ x("span", {
165
+ }) : /* @__PURE__ */ v("span", {
169
166
  className: "ttw:inline-flex ttw:items-center ttw:gap-2",
170
- "data-testid": F?.[v.Vendor],
171
- children: [e.original.vendorLabel || (e.original.vendorLookup === "unavailable" ? /* @__PURE__ */ b(h, { labels: { none: X.vendorUnavailable } }) : /* @__PURE__ */ b(m, { labels: X.missingValue })), t]
167
+ "data-testid": M?.[h.Vendor],
168
+ children: [e.original.vendorLabel || (e.original.vendorLookup === "unavailable" ? /* @__PURE__ */ _(f, { labels: { none: J.vendorUnavailable } }) : /* @__PURE__ */ _(d, { labels: J.missingValue })), t]
172
169
  });
173
170
  }
174
171
  },
175
- [v.InvoiceNumber]: {
172
+ [h.InvoiceNumber]: {
176
173
  accessorKey: "invoiceNumberLabel",
177
174
  enableSorting: !1,
178
- header: () => X.columnInvoiceNumber,
179
- cell: (e) => e.row.original.marker === "duplicate" ? /* @__PURE__ */ x("span", {
175
+ header: () => J.columnInvoiceNumber,
176
+ cell: (e) => e.row.original.marker === "duplicate" ? /* @__PURE__ */ v("span", {
180
177
  className: "ttw:relative",
181
- children: [/* @__PURE__ */ b(ae, { className: "ttw:absolute ttw:top-1/2 ttw:right-full ttw:mr-1 ttw:-translate-y-1/2 ttw:text-warning" }), n(e)]
178
+ children: [/* @__PURE__ */ _(ue, { className: "ttw:absolute ttw:top-1/2 ttw:right-full ttw:mr-1 ttw:-translate-y-1/2 ttw:text-warning" }), n(e)]
182
179
  }) : n(e)
183
180
  },
184
- [v.Attachment]: {
181
+ [h.Attachment]: {
185
182
  accessorKey: "attachment",
186
183
  enableSorting: !1,
187
- size: Ce,
188
- minSize: Ce,
189
- header: () => /* @__PURE__ */ b("span", {
184
+ size: y,
185
+ minSize: y,
186
+ header: () => /* @__PURE__ */ _("span", {
190
187
  className: "ttw:sr-only",
191
- children: X.columnAttachment
188
+ children: J.columnAttachment
192
189
  }),
193
- cell: ({ row: e }) => e.original.attachment ? /* @__PURE__ */ b("div", {
190
+ cell: ({ row: e }) => e.original.attachment ? /* @__PURE__ */ _("div", {
194
191
  className: "ttw:flex ttw:justify-center",
195
- "data-testid": F?.[v.Attachment],
196
- children: /* @__PURE__ */ b(u, { children: /* @__PURE__ */ x(ne, { children: [/* @__PURE__ */ b(d, {
192
+ "data-testid": M?.[h.Attachment],
193
+ children: /* @__PURE__ */ _(ie, { children: /* @__PURE__ */ v(ne, { children: [/* @__PURE__ */ _(ae, {
197
194
  type: "button",
198
195
  className: "ttw:inline-flex ttw:cursor-default",
199
196
  "aria-label": e.original.attachment.label,
200
197
  onClick: (e) => e.stopPropagation(),
201
- children: /* @__PURE__ */ b(he, { className: "ttw:size-3.5 ttw:shrink-0 ttw:text-muted-foreground" })
202
- }), /* @__PURE__ */ b(l, { children: e.original.attachment.label })] }) })
198
+ children: /* @__PURE__ */ _(ye, { className: "ttw:size-3.5 ttw:shrink-0 ttw:text-muted-foreground" })
199
+ }), /* @__PURE__ */ _(re, { children: e.original.attachment.label })] }) })
203
200
  }) : null
204
201
  },
205
- [v.IssueDate]: {
202
+ [h.IssueDate]: {
206
203
  accessorKey: "issueDateLabel",
207
- enableSorting: P,
208
- header: e(X.columnIssueDate),
209
- cell: t("issueDateLabel", v.IssueDate)
204
+ enableSorting: j,
205
+ header: e(J.columnIssueDate),
206
+ cell: t("issueDateLabel", h.IssueDate)
210
207
  },
211
- [v.DueDate]: {
208
+ [h.DueDate]: {
212
209
  accessorKey: "dueDateLabel",
213
- enableSorting: P,
214
- header: e(X.columnDueDate),
210
+ enableSorting: j,
211
+ header: e(J.columnDueDate),
215
212
  cell: i
216
213
  },
217
- [v.ScheduledDate]: {
214
+ [h.ScheduledDate]: {
218
215
  accessorKey: "scheduledDateLabel",
219
- enableSorting: P,
220
- header: e(X.columnScheduledDate),
216
+ enableSorting: j,
217
+ header: e(J.columnScheduledDate),
221
218
  cell: s
222
219
  },
223
- [v.PaidDate]: {
220
+ [h.PaidDate]: {
224
221
  accessorKey: "paidDateLabel",
225
222
  enableSorting: !1,
226
- header: X.columnPaidDate,
227
- cell: t("paidDateLabel", v.PaidDate)
223
+ header: J.columnPaidDate,
224
+ cell: t("paidDateLabel", h.PaidDate)
228
225
  },
229
- [v.Status]: {
226
+ [h.Status]: {
230
227
  accessorKey: "status",
231
228
  enableSorting: !1,
232
- header: X.columnStatus,
233
- cell: ({ row: e }) => /* @__PURE__ */ b("div", {
229
+ header: J.columnStatus,
230
+ cell: ({ row: e }) => /* @__PURE__ */ _("div", {
234
231
  className: "ttw:flex ttw:items-center ttw:gap-1",
235
- "data-testid": F?.[v.Status],
236
- children: /* @__PURE__ */ b(ie, {
232
+ "data-testid": M?.[h.Status],
233
+ children: /* @__PURE__ */ _(le, {
237
234
  status: e.original.status,
238
235
  tone: e.original.statusTone,
239
- labels: X.statusBadge
236
+ labels: J.statusBadge
240
237
  })
241
238
  })
242
239
  },
243
- [v.AmountDue]: {
240
+ [h.AmountDue]: {
244
241
  accessorKey: "amountDueLabel",
245
242
  enableSorting: !1,
246
- header: c(X.columnAmountDue),
247
- cell: a("amountDueLabel", v.AmountDue)
243
+ header: c(J.columnAmountDue),
244
+ cell: a("amountDueLabel", h.AmountDue)
248
245
  },
249
- [v.AmountScheduled]: {
246
+ [h.AmountScheduled]: {
250
247
  accessorKey: "amountScheduledLabel",
251
248
  enableSorting: !1,
252
- header: c(X.columnAmountScheduled),
253
- cell: a("amountScheduledLabel", v.AmountScheduled)
249
+ header: c(J.columnAmountScheduled),
250
+ cell: a("amountScheduledLabel", h.AmountScheduled)
254
251
  },
255
- [v.AmountPaid]: {
252
+ [h.AmountPaid]: {
256
253
  accessorKey: "amountPaidLabel",
257
254
  enableSorting: !1,
258
- header: c(X.columnAmountPaid),
259
- cell: a("amountPaidLabel", v.AmountPaid, o, "amountPaidIsGap")
255
+ header: c(J.columnAmountPaid),
256
+ cell: a("amountPaidLabel", h.AmountPaid, o, "amountPaidIsGap")
260
257
  },
261
- [v.TotalAmount]: {
258
+ [h.TotalAmount]: {
262
259
  accessorKey: "totalAmountLabel",
263
260
  enableSorting: !1,
264
- header: c(X.columnTotalAmount),
265
- cell: a("totalAmountLabel", v.TotalAmount)
261
+ header: c(J.columnTotalAmount),
262
+ cell: a("totalAmountLabel", h.TotalAmount)
266
263
  },
267
- [v.AddedOn]: {
264
+ [h.AddedOn]: {
268
265
  accessorKey: "addedOnLabel",
269
- enableSorting: P,
270
- header: e(X.columnAddedOn),
271
- cell: t("addedOnLabel", v.AddedOn)
266
+ enableSorting: j,
267
+ header: e(J.columnAddedOn),
268
+ cell: t("addedOnLabel", h.AddedOn)
272
269
  }
273
270
  };
274
271
  }, [
275
- X,
276
- F,
277
- P
278
- ]), Ke = y(() => [...(N ? M : Te.filter((e) => M.includes(e))).map((e) => Ge[e]), ...Re ? [{
272
+ J,
273
+ M,
274
+ j
275
+ ]), Ke = g(() => [...(A ? k : Ee.filter((e) => k.includes(e))).map((e) => Ge[e]), ...Y ? [{
279
276
  id: "actions",
280
277
  enableSorting: !1,
281
- size: we,
282
- header: () => /* @__PURE__ */ b("span", {
278
+ size: Te,
279
+ header: () => /* @__PURE__ */ _("span", {
283
280
  className: "ttw:sr-only",
284
- children: X.columnActions
281
+ children: J.columnActions
285
282
  }),
286
- cell: ({ row: e }) => e.original.menu?.items.length ? /* @__PURE__ */ b("div", {
283
+ cell: ({ row: e }) => e.original.menu?.items.length ? /* @__PURE__ */ _("div", {
287
284
  className: "ttw:flex ttw:justify-end",
288
- children: /* @__PURE__ */ b(se, {
285
+ children: /* @__PURE__ */ _(fe, {
289
286
  actions: e.original.menu.items.map((e) => ({
290
287
  ...e,
291
288
  variant: "ghost"
@@ -296,175 +293,167 @@ function C({ rows: C, isLoading: w, isError: T, sorting: Ee, onSortingChange: De
296
293
  }) : null
297
294
  }] : []], [
298
295
  Ge,
299
- Re,
300
- N,
301
- X,
302
- M
303
- ]), qe = !!(R && V) && !w && !T && !I && C.length === 0 && Ie === !0, $ = /* @__PURE__ */ x("div", {
296
+ Y,
297
+ A,
298
+ J,
299
+ k
300
+ ]), qe = !!(F && R) && !S && !De && !N && x.length === 0 && Re === !0, Q = F ? /* @__PURE__ */ _(e, {
301
+ onClick: F,
302
+ children: J.createButton
303
+ }) : null, $ = /* @__PURE__ */ v("div", {
304
304
  className: "ttw:relative ttw:w-80",
305
- children: [/* @__PURE__ */ b(_e, { className: "ttw:pointer-events-none ttw:absolute ttw:left-3 ttw:top-1/2 ttw:size-4 ttw:-translate-y-1/2 ttw:text-muted-foreground" }), /* @__PURE__ */ b(i, {
305
+ children: [/* @__PURE__ */ _(be, { className: "ttw:pointer-events-none ttw:absolute ttw:left-3 ttw:top-1/2 ttw:size-4 ttw:-translate-y-1/2 ttw:text-muted-foreground" }), /* @__PURE__ */ _(i, {
306
306
  className: "ttw:pl-9",
307
307
  type: "search",
308
- "aria-label": X.searchLabel,
309
- placeholder: X.searchPlaceholder,
310
- value: Pe,
311
- onChange: (e) => Fe(e.target.value)
308
+ "aria-label": J.searchLabel,
309
+ placeholder: J.searchPlaceholder,
310
+ value: Ie,
311
+ onChange: (e) => Le(e.target.value)
312
312
  })]
313
- }), Je = j ? /* @__PURE__ */ b(de, {
314
- ...j,
313
+ }), Je = O ? /* @__PURE__ */ _(me, {
314
+ ...O,
315
315
  className: "ttw:px-4",
316
316
  searchSlot: $
317
- }) : /* @__PURE__ */ b("div", {
317
+ }) : /* @__PURE__ */ _("div", {
318
318
  className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2 ttw:px-4",
319
319
  children: $
320
320
  });
321
- return /* @__PURE__ */ x("div", {
321
+ return /* @__PURE__ */ v("div", {
322
322
  className: "ttw:flex ttw:flex-col ttw:gap-3",
323
- children: [Le ? /* @__PURE__ */ b(oe, {
324
- message: Le,
325
- children: Y ? /* @__PURE__ */ b(e, {
326
- type: "button",
327
- variant: "outline",
328
- size: "sm",
329
- className: "ttw:bg-background ttw:text-foreground ttw:hover:bg-muted",
330
- onClick: Y.onReview,
331
- children: Y.reviewLabel
332
- }) : null
333
- }) : null, /* @__PURE__ */ x(o, {
334
- value: A,
335
- onValueChange: Ne,
336
- className: "ttw:flex ttw:flex-col ttw:gap-4",
337
- children: [/* @__PURE__ */ x("div", {
338
- className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:justify-between ttw:gap-3",
339
- children: [/* @__PURE__ */ b(c, {
340
- variant: "pills",
341
- "aria-label": X.filterTabsLabel,
342
- children: k.map((e) => /* @__PURE__ */ x(fe, { children: [e.startsGroup ? /* @__PURE__ */ b(a, {
343
- orientation: "vertical",
344
- className: "ttw:mx-1 ttw:data-[orientation=vertical]:h-4"
345
- }) : null, /* @__PURE__ */ b(te, {
346
- value: e.id,
347
- count: e.badge,
348
- countTone: e.tone,
349
- className: "ttw:min-w-28",
350
- children: /* @__PURE__ */ b("span", {
351
- className: e.tone === "warning" ? "ttw:text-warning-foreground" : void 0,
352
- children: e.label
353
- })
354
- })] }, e.id))
355
- }), /* @__PURE__ */ x("div", {
356
- className: "ttw:flex ttw:items-center ttw:gap-2",
357
- children: [z ? /* @__PURE__ */ b(u, { children: /* @__PURE__ */ x(ne, { children: [/* @__PURE__ */ b(d, {
358
- asChild: !0,
359
- children: /* @__PURE__ */ b(e, {
360
- variant: "outline",
361
- size: "icon",
362
- "aria-label": X.settingsButton,
363
- onClick: z,
364
- children: /* @__PURE__ */ b(ve, { className: "ttw:size-4" })
365
- })
366
- }), /* @__PURE__ */ b(l, { children: X.settingsButton })] }) }) : null, R ? /* @__PURE__ */ x(e, {
367
- onClick: R,
368
- children: [/* @__PURE__ */ b(ge, { className: "ttw:size-4" }), X.createButton]
369
- }) : null]
370
- })]
371
- }), (() => {
372
- let e = T ? /* @__PURE__ */ b(re, {
373
- title: X.errorTitle,
374
- description: X.errorDescription,
375
- retryLabel: B ? X.errorRetry : void 0,
376
- onRetry: B
377
- }) : qe && R && V ? /* @__PURE__ */ b("div", {
378
- className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card",
379
- children: K && q ? /* @__PURE__ */ b(p, {
380
- emailAddress: K,
381
- onCopyEmail: q,
382
- onFilesSelected: V,
383
- accept: _,
384
- maxFiles: H,
385
- uploadStatus: W,
386
- uploadErrorMessage: G,
387
- onEnterManually: U ?? R,
388
- labels: X.addBill
389
- }) : /* @__PURE__ */ b(p, {
390
- onFilesSelected: V,
391
- accept: _,
392
- maxFiles: H,
393
- uploadStatus: W,
394
- uploadErrorMessage: G,
395
- onEnterManually: U ?? R,
396
- labels: X.addBill
397
- })
398
- }) : /* @__PURE__ */ x("div", {
399
- className: "ttw:relative",
400
- onDragEnter: Ve,
401
- onDragOver: He,
402
- onDragLeave: Ue,
403
- onDrop: We,
404
- children: [/* @__PURE__ */ b(n, {
405
- columns: Ke,
406
- data: C,
407
- getRowId: (e) => e.rowKey,
408
- animatesNewRows: !0,
409
- isLoading: w,
410
- sorting: Ee,
411
- onSortingChange: De,
412
- pageSize: Oe,
413
- onPageSizeChange: ke,
414
- pageSizeOptions: E,
415
- showPagination: E.length > 1 || D || O,
416
- pageInfo: Ae,
417
- hasNextPage: D,
418
- hasPrevPage: O,
419
- onNextPage: je,
420
- onPrevPage: Me,
421
- onRowClick: (e) => e.onOpen(),
422
- rowAriaLabel: (e) => X.openRow(e.vendorLabel || Se(e.vendorLookup, X)),
423
- rowGroup: (e) => e.group ? {
424
- key: e.group.key,
425
- label: e.group.label,
426
- tone: "warning",
427
- icon: /* @__PURE__ */ b(ae, {}),
428
- title: e.group.title,
429
- meta: e.group.meta,
430
- collapse: e.group.collapse
431
- } : void 0,
432
- rowContextMenu: (e) => e.menu?.items.length ? /* @__PURE__ */ b(me, { children: e.menu.items.map((e) => {
433
- let n = e.icon;
434
- return /* @__PURE__ */ x(t, {
435
- disabled: e.disabled,
436
- onClick: e.onSelect,
437
- children: [n ? /* @__PURE__ */ b(n, { className: "ttw:size-4" }) : null, e.label]
438
- }, e.id);
439
- }) }) : void 0,
440
- filterComponent: Je,
441
- children: I ? /* @__PURE__ */ b(f, {
442
- title: X.filteredEmptyTitle,
443
- description: X.filteredEmptyDescription
444
- }) : L ? /* @__PURE__ */ b(f, {
445
- title: L.title,
446
- description: L.description
447
- }) : void 0
448
- }), ze ? /* @__PURE__ */ b("div", {
449
- className: "ttw:pointer-events-none ttw:absolute ttw:inset-0 ttw:z-20 ttw:flex ttw:items-center ttw:justify-center ttw:rounded-xl ttw:border-2 ttw:border-dashed ttw:border-primary ttw:bg-background/85 ttw:backdrop-blur-[1px]",
450
- children: /* @__PURE__ */ x("div", {
451
- className: "ttw:flex ttw:items-center ttw:gap-3 ttw:rounded-lg ttw:border ttw:bg-card ttw:px-4 ttw:py-3 ttw:shadow-sm",
452
- children: [/* @__PURE__ */ b(ye, { className: "ttw:size-5 ttw:text-muted-foreground" }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
453
- className: "ttw:text-sm ttw:font-medium",
454
- children: X.tableDropzoneTitle
455
- }), /* @__PURE__ */ b("p", {
456
- className: "ttw:text-xs ttw:text-muted-foreground",
457
- children: H === void 0 ? X.addBill.dropzone.fileTypesHint : `${X.addBill.dropzone.fileTypesHint} · ${X.addBill.dropzone.fileCountHint(H)}`
458
- })] })]
323
+ children: [
324
+ K ? /* @__PURE__ */ _(de, {
325
+ message: K,
326
+ children: q ? /* @__PURE__ */ _(e, {
327
+ type: "button",
328
+ variant: "outline",
329
+ size: "sm",
330
+ className: "ttw:bg-background ttw:text-foreground ttw:hover:bg-muted",
331
+ onClick: q.onReview,
332
+ children: q.reviewLabel
333
+ }) : null
334
+ }) : null,
335
+ /* @__PURE__ */ v(o, {
336
+ value: D,
337
+ onValueChange: Fe,
338
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
339
+ children: [/* @__PURE__ */ v("div", {
340
+ className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:justify-between ttw:gap-3",
341
+ children: [/* @__PURE__ */ _(c, {
342
+ variant: "pills",
343
+ "aria-label": J.filterTabsLabel,
344
+ children: E.map((e) => /* @__PURE__ */ v(he, { children: [e.startsGroup ? /* @__PURE__ */ _(a, {
345
+ orientation: "vertical",
346
+ className: "ttw:mx-1 ttw:data-[orientation=vertical]:h-4"
347
+ }) : null, /* @__PURE__ */ _(te, {
348
+ value: e.id,
349
+ count: e.badge,
350
+ countTone: e.tone,
351
+ className: "ttw:min-w-28",
352
+ children: /* @__PURE__ */ _("span", {
353
+ className: e.tone === "warning" ? "ttw:text-warning-foreground" : void 0,
354
+ children: e.label
355
+ })
356
+ })] }, e.id))
357
+ }), I === void 0 ? Q : null]
358
+ }), (() => {
359
+ let e = De ? /* @__PURE__ */ _(oe, {
360
+ title: J.errorTitle,
361
+ description: J.errorDescription,
362
+ retryLabel: L ? J.errorRetry : void 0,
363
+ onRetry: L
364
+ }) : qe && F && R ? /* @__PURE__ */ _("div", {
365
+ className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card",
366
+ children: U && W ? /* @__PURE__ */ _(u, {
367
+ emailAddress: U,
368
+ onCopyEmail: W,
369
+ onFilesSelected: R,
370
+ accept: m,
371
+ maxFiles: z,
372
+ uploadStatus: V,
373
+ uploadErrorMessage: H,
374
+ onEnterManually: B ?? F,
375
+ labels: J.addBill
376
+ }) : /* @__PURE__ */ _(u, {
377
+ onFilesSelected: R,
378
+ accept: m,
379
+ maxFiles: z,
380
+ uploadStatus: V,
381
+ uploadErrorMessage: H,
382
+ onEnterManually: B ?? F,
383
+ labels: J.addBill
459
384
  })
460
- }) : null]
461
- });
462
- return k.map((t) => /* @__PURE__ */ b(s, {
463
- value: t.id,
464
- children: t.id === A ? e : null
465
- }, t.id));
466
- })()]
467
- })]
385
+ }) : /* @__PURE__ */ v("div", {
386
+ className: "ttw:relative",
387
+ onDragEnter: Ve,
388
+ onDragOver: He,
389
+ onDragLeave: Ue,
390
+ onDrop: We,
391
+ children: [/* @__PURE__ */ _(n, {
392
+ columns: Ke,
393
+ data: x,
394
+ getRowId: (e) => e.rowKey,
395
+ animatesNewRows: !0,
396
+ isLoading: S,
397
+ sorting: Oe,
398
+ onSortingChange: ke,
399
+ pageSize: Ae,
400
+ onPageSizeChange: je,
401
+ pageSizeOptions: C,
402
+ showPagination: C.length > 1 || w || T,
403
+ pageInfo: Me,
404
+ hasNextPage: w,
405
+ hasPrevPage: T,
406
+ onNextPage: Ne,
407
+ onPrevPage: Pe,
408
+ onRowClick: (e) => e.onOpen(),
409
+ rowAriaLabel: (e) => J.openRow(e.vendorLabel || we(e.vendorLookup, J)),
410
+ rowGroup: (e) => e.group ? {
411
+ key: e.group.key,
412
+ label: e.group.label,
413
+ tone: "warning",
414
+ icon: /* @__PURE__ */ _(ue, {}),
415
+ title: e.group.title,
416
+ meta: e.group.meta,
417
+ collapse: e.group.collapse
418
+ } : void 0,
419
+ rowContextMenu: (e) => e.menu?.items.length ? /* @__PURE__ */ _(ve, { children: e.menu.items.map((e) => {
420
+ let n = e.icon;
421
+ return /* @__PURE__ */ v(t, {
422
+ disabled: e.disabled,
423
+ onClick: e.onSelect,
424
+ children: [n ? /* @__PURE__ */ _(n, { className: "ttw:size-4" }) : null, e.label]
425
+ }, e.id);
426
+ }) }) : void 0,
427
+ filterComponent: Je,
428
+ children: N ? /* @__PURE__ */ _(l, {
429
+ title: J.filteredEmptyTitle,
430
+ description: J.filteredEmptyDescription
431
+ }) : P ? /* @__PURE__ */ _(l, {
432
+ title: P.title,
433
+ description: P.description
434
+ }) : void 0
435
+ }), ze ? /* @__PURE__ */ _("div", {
436
+ className: "ttw:pointer-events-none ttw:absolute ttw:inset-0 ttw:z-20 ttw:flex ttw:items-center ttw:justify-center ttw:rounded-xl ttw:border-2 ttw:border-dashed ttw:border-primary ttw:bg-background/85 ttw:backdrop-blur-[1px]",
437
+ children: /* @__PURE__ */ v("div", {
438
+ className: "ttw:flex ttw:items-center ttw:gap-3 ttw:rounded-lg ttw:border ttw:bg-card ttw:px-4 ttw:py-3 ttw:shadow-sm",
439
+ children: [/* @__PURE__ */ _(xe, { className: "ttw:size-5 ttw:text-muted-foreground" }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
440
+ className: "ttw:text-sm ttw:font-medium",
441
+ children: J.tableDropzoneTitle
442
+ }), /* @__PURE__ */ _("p", {
443
+ className: "ttw:text-xs ttw:text-muted-foreground",
444
+ children: z === void 0 ? J.addBill.dropzone.fileTypesHint : `${J.addBill.dropzone.fileTypesHint} · ${J.addBill.dropzone.fileCountHint(z)}`
445
+ })] })]
446
+ })
447
+ }) : null]
448
+ });
449
+ return E.map((t) => /* @__PURE__ */ _(s, {
450
+ value: t.id,
451
+ children: t.id === D ? e : null
452
+ }, t.id));
453
+ })()]
454
+ }),
455
+ I && Q ? _e(Q, I) : null
456
+ ]
468
457
  });
469
458
  }
470
- export { C as BillsScreen, C as default, S as DEFAULT_BILL_COLUMNS };
459
+ export { x as BillsScreen, x as default, b as DEFAULT_BILL_COLUMNS };