@tesouro/embedded-components-react 0.5.257 → 0.5.259

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 (64) hide show
  1. package/README.md +2 -1
  2. package/dist/fixtures/index.d.ts +1 -1
  3. package/dist/index.css +109 -9
  4. package/dist/index.d.ts +41 -10
  5. package/dist/lib/ReceivablesWidget.d.ts +41 -10
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +11 -10
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +42 -94
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +91 -76
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +67 -173
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index13.js +186 -17
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index14.js +27 -0
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +28 -72
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +128 -53
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +66 -28
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +28 -34
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +24 -168
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index9.js +173 -44
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +274 -267
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +99 -95
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +1 -0
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentTerms.js +28 -25
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/preview.js +49 -43
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/unsavedChanges.js +13 -0
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +4 -4
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +2 -2
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableAttachmentUploads.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableBankAccount.js +77 -72
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +4 -4
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +363 -295
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js +1 -1
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +1 -1
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePreview.js +36 -21
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +1 -1
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js +1 -1
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +1 -1
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +12 -10
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +21 -14
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +1 -1
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +68 -64
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +383 -379
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +22 -0
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +8 -2
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +258 -1
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +2 -100
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +95 -23
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +23 -231
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +237 -3
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +3 -249
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +234 -78
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +87 -53
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +49 -349
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +359 -0
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +45 -0
  55. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +40 -40
  56. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +247 -214
  57. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +175 -147
  58. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +1 -1
  59. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  60. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js +12 -12
  61. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +2 -1
  62. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +109 -89
  63. package/package.json +1 -1
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +0 -4
@@ -1,59 +1,93 @@
1
- import { Skeleton as e, cn as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { RECEIVABLE_STATUS_CARDS_LABELS_EN as n } from "./index13.js";
3
- import { ReceivableStatusBadge as r } from "./index22.js";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
1
+ import { Button as e, Dialog as t, DialogContent as n, DialogDescription as r, DialogFooter as i, DialogHeader as a, DialogTitle as o, Input as s, Label as c, Textarea as l } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_SEND_DIALOG_LABELS_EN as u } from "./index13.js";
3
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
5
4
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js
6
- var o = 6;
7
- function s({ selected: e, onClick: n, children: r }) {
8
- return /* @__PURE__ */ i("button", {
9
- type: "button",
10
- "aria-pressed": e,
11
- onClick: n,
12
- className: t("ttw:flex ttw:w-42 ttw:shrink-0 ttw:cursor-pointer ttw:flex-col ttw:gap-2 ttw:rounded-xl ttw:border ttw:bg-card ttw:px-4 ttw:py-2 ttw:text-left ttw:transition-colors", e ? "ttw:border-primary" : "ttw:border-card ttw:hover:border-primary"),
13
- children: r
14
- });
5
+ function p({ message: e }) {
6
+ return e ? /* @__PURE__ */ d("p", {
7
+ className: "ttw:text-sm ttw:text-destructive",
8
+ children: e
9
+ }) : null;
15
10
  }
16
- function c({ view: t, onSelect: c, labels: l }) {
17
- let u = {
18
- ...n,
19
- ...l
11
+ function m({ open: m, onOpenChange: h, values: g, errors: _, inProgress: v, onChange: y, onSubmit: b, onCancel: x, labels: S }) {
12
+ let C = {
13
+ ...u,
14
+ ...S
20
15
  };
21
- return t.kind === "loading" ? /* @__PURE__ */ i("div", {
22
- className: "ttw:flex ttw:gap-2",
23
- children: Array.from({ length: o }).map((t, n) => /* @__PURE__ */ i(e, { className: "ttw:h-16.5 ttw:w-42 ttw:rounded-xl" }, n))
24
- }) : /* @__PURE__ */ a("div", {
25
- className: "ttw:mb-6 ttw:flex ttw:gap-2 ttw:overflow-x-auto ttw:[scrollbar-width:none] ttw:[&::-webkit-scrollbar]:hidden",
26
- children: [/* @__PURE__ */ a(s, {
27
- selected: t.all.selected,
28
- onClick: () => c(t.all.value),
29
- children: [/* @__PURE__ */ i("span", {
30
- className: "ttw:text-xs ttw:font-medium ttw:text-foreground",
31
- children: u.all
32
- }), /* @__PURE__ */ i("span", {
33
- className: "ttw:text-2xl ttw:font-medium ttw:leading-8 ttw:tabular-nums ttw:text-foreground",
34
- children: t.all.countLabel
35
- })]
36
- }), t.statuses.map((e) => /* @__PURE__ */ i(s, {
37
- selected: e.selected,
38
- onClick: () => c(e.value),
39
- children: /* @__PURE__ */ a("div", {
40
- className: "ttw:flex ttw:flex-col",
41
- children: [/* @__PURE__ */ a("div", {
42
- className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-2",
43
- children: [/* @__PURE__ */ i(r, {
44
- label: e.statusLabel,
45
- tone: e.statusTone
46
- }), /* @__PURE__ */ i("span", {
47
- className: "ttw:text-xs ttw:font-medium ttw:leading-4.5 ttw:tabular-nums ttw:text-foreground",
48
- children: e.countLabel
49
- })]
50
- }), /* @__PURE__ */ i("span", {
51
- className: "ttw:overflow-hidden ttw:text-ellipsis ttw:whitespace-nowrap ttw:text-2xl ttw:font-medium ttw:leading-8 ttw:tabular-nums ttw:text-foreground",
52
- children: e.amountLabel
53
- })]
54
- })
55
- }, e.value))]
16
+ return /* @__PURE__ */ d(t, {
17
+ open: m,
18
+ onOpenChange: h,
19
+ children: /* @__PURE__ */ f(n, { children: [
20
+ /* @__PURE__ */ f(a, { children: [/* @__PURE__ */ d(o, { children: C.title }), /* @__PURE__ */ d(r, { children: C.description })] }),
21
+ /* @__PURE__ */ f("div", {
22
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
23
+ children: [
24
+ _?.form && /* @__PURE__ */ d("p", {
25
+ className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
26
+ children: _.form
27
+ }),
28
+ /* @__PURE__ */ f("div", {
29
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
30
+ children: [
31
+ /* @__PURE__ */ d(c, { children: C.toLabel }),
32
+ /* @__PURE__ */ d(s, {
33
+ value: g.to,
34
+ onChange: (e) => y({ to: e.target.value })
35
+ }),
36
+ /* @__PURE__ */ d(p, { message: _?.to })
37
+ ]
38
+ }),
39
+ /* @__PURE__ */ f("div", {
40
+ className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
41
+ children: [/* @__PURE__ */ f("div", {
42
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
43
+ children: [/* @__PURE__ */ d(c, { children: C.ccLabel }), /* @__PURE__ */ d(s, {
44
+ value: g.cc,
45
+ onChange: (e) => y({ cc: e.target.value })
46
+ })]
47
+ }), /* @__PURE__ */ f("div", {
48
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
49
+ children: [/* @__PURE__ */ d(c, { children: C.bccLabel }), /* @__PURE__ */ d(s, {
50
+ value: g.bcc,
51
+ onChange: (e) => y({ bcc: e.target.value })
52
+ })]
53
+ })]
54
+ }),
55
+ /* @__PURE__ */ f("div", {
56
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
57
+ children: [
58
+ /* @__PURE__ */ d(c, { children: C.subjectLabel }),
59
+ /* @__PURE__ */ d(s, {
60
+ value: g.subject,
61
+ onChange: (e) => y({ subject: e.target.value })
62
+ }),
63
+ /* @__PURE__ */ d(p, { message: _?.subject })
64
+ ]
65
+ }),
66
+ /* @__PURE__ */ f("div", {
67
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
68
+ children: [
69
+ /* @__PURE__ */ d(c, { children: C.bodyLabel }),
70
+ /* @__PURE__ */ d(l, {
71
+ rows: 6,
72
+ value: g.body,
73
+ onChange: (e) => y({ body: e.target.value })
74
+ }),
75
+ /* @__PURE__ */ d(p, { message: _?.body })
76
+ ]
77
+ })
78
+ ]
79
+ }),
80
+ /* @__PURE__ */ f(i, { children: [/* @__PURE__ */ d(e, {
81
+ variant: "ghost",
82
+ onClick: x,
83
+ children: C.cancelButton
84
+ }), /* @__PURE__ */ d(e, {
85
+ loading: v,
86
+ onClick: b,
87
+ children: C.sendButton
88
+ })] })
89
+ ] })
56
90
  });
57
91
  }
58
92
  //#endregion
59
- export { c as ReceivableStatusCards, c as default };
93
+ export { m as ReceivableSendDialog, m as default };
@@ -1,359 +1,59 @@
1
- import { Button as e, DataTable as t, DropdownMenu as n, DropdownMenuContent as r, DropdownMenuItem as i, DropdownMenuTrigger as a, Input as o, Select as s, SelectContent as c, SelectItem as l, SelectTrigger as u, SelectValue as d, Skeleton as f, Tabs as ee, TabsList as te, TabsTrigger as p } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { EmptyState as m } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
- import { ErrorState as h } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
4
- import "../../../shared/ui/dist/index.js";
5
- import { RECEIVABLES_SCREEN_LABELS_EN as g } from "./index13.js";
6
- import { ReceivableStatusBadge as _ } from "./index22.js";
7
- import { ReceivableStatusCards as v } from "./index50.js";
8
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
9
- import { ArrowDownIcon as x, ArrowUpDownIcon as S, ArrowUpIcon as C, LockKeyholeIcon as w, MoreHorizontalIcon as T, PlusIcon as E, SearchIcon as D, SettingsIcon as O } from "lucide-react";
1
+ import { Skeleton as e, cn as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_STATUS_CARDS_LABELS_EN as n } from "./index13.js";
3
+ import { ReceivableStatusBadge as r } from "./index22.js";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
10
5
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js
11
- var k = [
12
- 10,
13
- 25,
14
- 50,
15
- 100
16
- ], A = "all";
17
- function j({ label: t, ariaLabel: n, column: r }) {
18
- let i = r.getIsSorted();
19
- return /* @__PURE__ */ b("div", {
20
- className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-inherit",
21
- children: [t, /* @__PURE__ */ y(e, {
22
- variant: "ghost",
23
- size: "icon-sm",
24
- "aria-label": n,
25
- onClick: () => r.toggleSorting(i === "asc"),
26
- children: y(i === "asc" ? C : i === "desc" ? x : S, { className: "ttw:size-4" })
27
- })]
6
+ var o = 6;
7
+ function s({ selected: e, onClick: n, children: r }) {
8
+ return /* @__PURE__ */ i("button", {
9
+ type: "button",
10
+ "aria-pressed": e,
11
+ onClick: n,
12
+ className: t("ttw:flex ttw:w-42 ttw:shrink-0 ttw:cursor-pointer ttw:flex-col ttw:gap-2 ttw:rounded-xl ttw:border ttw:bg-card ttw:px-4 ttw:py-2 ttw:text-left ttw:transition-colors", e ? "ttw:border-primary" : "ttw:border-card ttw:hover:border-primary"),
13
+ children: r
28
14
  });
29
15
  }
30
- function ne({ labels: e, searchValue: t, onSearchChange: n, statusFilter: r, statusOptions: i, onStatusFilterChange: a }) {
31
- return /* @__PURE__ */ b("div", {
32
- className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2 ttw:px-4",
33
- children: [/* @__PURE__ */ b("div", {
34
- className: "ttw:relative ttw:w-80",
35
- children: [/* @__PURE__ */ y(D, { 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__ */ y(o, {
36
- className: "ttw:pl-9",
37
- placeholder: e.searchPlaceholder,
38
- value: t,
39
- onChange: (e) => n(e.target.value)
16
+ function c({ view: t, onSelect: c, labels: l }) {
17
+ let u = {
18
+ ...n,
19
+ ...l
20
+ };
21
+ return t.kind === "loading" ? /* @__PURE__ */ i("div", {
22
+ className: "ttw:flex ttw:gap-2",
23
+ children: Array.from({ length: o }).map((t, n) => /* @__PURE__ */ i(e, { className: "ttw:h-16.5 ttw:w-42 ttw:rounded-xl" }, n))
24
+ }) : /* @__PURE__ */ a("div", {
25
+ className: "ttw:mb-6 ttw:flex ttw:gap-2 ttw:overflow-x-auto ttw:[scrollbar-width:none] ttw:[&::-webkit-scrollbar]:hidden",
26
+ children: [/* @__PURE__ */ a(s, {
27
+ selected: t.all.selected,
28
+ onClick: () => c(t.all.value),
29
+ children: [/* @__PURE__ */ i("span", {
30
+ className: "ttw:text-xs ttw:font-medium ttw:text-foreground",
31
+ children: u.all
32
+ }), /* @__PURE__ */ i("span", {
33
+ className: "ttw:text-2xl ttw:font-medium ttw:leading-8 ttw:tabular-nums ttw:text-foreground",
34
+ children: t.all.countLabel
40
35
  })]
41
- }), /* @__PURE__ */ b(s, {
42
- value: r,
43
- onValueChange: a,
44
- children: [/* @__PURE__ */ y(u, {
45
- "aria-label": e.columnStatus,
46
- className: "ttw:w-48",
47
- children: /* @__PURE__ */ y(d, {})
48
- }), /* @__PURE__ */ b(c, { children: [/* @__PURE__ */ y(l, {
49
- value: A,
50
- children: e.statusFilterAll
51
- }), i.map((t) => /* @__PURE__ */ y(l, {
52
- value: t.value,
53
- children: N(t, e.statusBadge)
54
- }, t.value))] })]
55
- })]
56
- });
57
- }
58
- function M({ enabled: e, label: t, action: n, row: r, onActionClick: a, variant: o }) {
59
- return e ? /* @__PURE__ */ y(i, {
60
- variant: o,
61
- onClick: (e) => {
62
- e.stopPropagation(), a(n, r);
63
- },
64
- children: t
65
- }) : null;
66
- }
67
- function re({ row: e }) {
68
- return e.customerState === "resolving" ? /* @__PURE__ */ y(f, { className: "ttw:h-4 ttw:w-full" }) : e.customerState === "missing" ? /* @__PURE__ */ y("span", {
69
- className: "ttw:opacity-40",
70
- children: e.customerLabel
71
- }) : /* @__PURE__ */ y("span", { children: e.customerLabel });
72
- }
73
- function N(e, t) {
74
- return t[e.value] ?? e.label;
75
- }
76
- function P({ rows: i, activeTab: o, enabledTabs: s, onTabChange: c, isLoading: l, isError: u, isAccessRestricted: d, sorting: f, onSortingChange: x, pageSize: S, onPageSizeChange: C, pageSizeOptions: D = k, pageInfo: A, hasNextPage: N, hasPrevPage: P, onNextPage: F, onPrevPage: I, searchValue: L, onSearchChange: R, statusFilter: z, statusOptions: B, onStatusFilterChange: V, statusCards: H, onStatusCardSelect: U, filterBar: W, isFiltering: G, onCreateClick: K, onTemplateSettingsClick: q, onRowClick: J, onActionClick: Y, onRetry: X, labels: Z }) {
77
- let Q = {
78
- ...g,
79
- ...Z,
80
- statusBadge: {
81
- ...g.statusBadge,
82
- ...Z?.statusBadge
83
- }
84
- }, $ = [
85
- {
86
- accessorKey: "documentLabel",
87
- enableSorting: !0,
88
- header: ({ column: e }) => /* @__PURE__ */ y(j, {
89
- column: e,
90
- label: Q.columnDocument,
91
- ariaLabel: Q.sortByDocument
92
- }),
93
- cell: ({ row: e }) => /* @__PURE__ */ b("div", {
94
- className: "ttw:flex ttw:flex-col ttw:gap-1",
95
- children: [/* @__PURE__ */ y("span", {
96
- className: "ttw:font-medium",
97
- children: e.original.documentLabel
98
- }), /* @__PURE__ */ y("span", {
99
- className: "ttw:text-xs ttw:text-muted-foreground",
100
- children: e.original.type === "credit_note" ? Q.tabCreditNotes : e.original.type === "quote" ? Q.tabQuotes : Q.tabInvoices
101
- })]
102
- }),
103
- minSize: 180
104
- },
105
- {
106
- accessorKey: "customerLabel",
107
- header: Q.columnCustomer,
108
- cell: ({ row: e }) => /* @__PURE__ */ y(re, { row: e.original }),
109
- minSize: 180
110
- },
111
- {
112
- accessorKey: "status",
113
- enableSorting: !0,
114
- header: ({ column: e }) => /* @__PURE__ */ y(j, {
115
- column: e,
116
- label: Q.columnStatus,
117
- ariaLabel: Q.sortByStatus
118
- }),
119
- cell: ({ row: e }) => /* @__PURE__ */ y(_, {
120
- status: e.original.status,
121
- tone: e.original.statusTone,
122
- labels: Q.statusBadge
123
- })
124
- },
125
- {
126
- accessorKey: "issueDateLabel",
127
- enableSorting: !0,
128
- header: ({ column: e }) => /* @__PURE__ */ y(j, {
129
- column: e,
130
- label: Q.columnIssueDate,
131
- ariaLabel: Q.sortByIssueDate
132
- })
133
- },
134
- {
135
- accessorKey: "dueDateLabel",
136
- enableSorting: !0,
137
- header: ({ column: e }) => /* @__PURE__ */ y(j, {
138
- column: e,
139
- label: Q.columnDueDate,
140
- ariaLabel: Q.sortByDueDate
141
- })
142
- },
143
- {
144
- accessorKey: "totalLabel",
145
- enableSorting: !0,
146
- header: ({ column: e }) => /* @__PURE__ */ y("div", {
147
- className: "ttw:flex ttw:justify-end",
148
- children: /* @__PURE__ */ y(j, {
149
- column: e,
150
- label: Q.columnTotal,
151
- ariaLabel: Q.sortByTotal
152
- })
153
- }),
154
- cell: ({ row: e }) => /* @__PURE__ */ y("div", {
155
- className: "ttw:text-right",
156
- children: e.original.totalLabel
157
- })
158
- },
159
- {
160
- accessorKey: "amountDueLabel",
161
- header: () => /* @__PURE__ */ y("div", {
162
- className: "ttw:text-right",
163
- children: Q.columnAmountDue
164
- }),
165
- cell: ({ row: e }) => /* @__PURE__ */ y("div", {
166
- className: "ttw:text-right",
167
- children: e.original.amountDueLabel
168
- })
169
- }
170
- ], ie = Y ? [...$, {
171
- id: "actions",
172
- header: () => /* @__PURE__ */ y("span", {
173
- className: "ttw:sr-only",
174
- children: Q.columnActions
175
- }),
176
- cell: ({ row: t }) => /* @__PURE__ */ y("div", {
177
- className: "ttw:flex ttw:justify-end",
178
- children: /* @__PURE__ */ b(n, { children: [/* @__PURE__ */ y(a, {
179
- asChild: !0,
180
- children: /* @__PURE__ */ y(e, {
181
- variant: "ghost",
182
- size: "icon-sm",
183
- "aria-label": Q.columnActions,
184
- onClick: (e) => e.stopPropagation(),
185
- children: /* @__PURE__ */ y(T, { className: "ttw:size-4" })
186
- })
187
- }), /* @__PURE__ */ b(r, {
188
- align: "end",
189
- children: [
190
- /* @__PURE__ */ y(M, {
191
- enabled: t.original.actions.edit,
192
- label: Q.actionEdit,
193
- action: "edit",
194
- row: t.original,
195
- onActionClick: Y
196
- }),
197
- /* @__PURE__ */ y(M, {
198
- enabled: t.original.actions.issue,
199
- label: Q.actionIssue,
200
- action: "issue",
201
- row: t.original,
202
- onActionClick: Y
203
- }),
204
- /* @__PURE__ */ y(M, {
205
- enabled: t.original.actions.send,
206
- label: Q.actionSend,
207
- action: "send",
208
- row: t.original,
209
- onActionClick: Y
210
- }),
211
- /* @__PURE__ */ y(M, {
212
- enabled: t.original.actions.recordPayment,
213
- label: Q.actionRecordPayment,
214
- action: "recordPayment",
215
- row: t.original,
216
- onActionClick: Y
217
- }),
218
- /* @__PURE__ */ y(M, {
219
- enabled: t.original.actions.markPaid,
220
- label: Q.actionMarkPaid,
221
- action: "markPaid",
222
- row: t.original,
223
- onActionClick: Y
224
- }),
225
- /* @__PURE__ */ y(M, {
226
- enabled: t.original.actions.markUncollectible,
227
- label: Q.actionMarkUncollectible,
228
- action: "markUncollectible",
229
- row: t.original,
230
- onActionClick: Y
231
- }),
232
- /* @__PURE__ */ y(M, {
233
- enabled: t.original.actions.accept,
234
- label: Q.actionAccept,
235
- action: "accept",
236
- row: t.original,
237
- onActionClick: Y
238
- }),
239
- /* @__PURE__ */ y(M, {
240
- enabled: t.original.actions.decline,
241
- label: Q.actionDecline,
242
- action: "decline",
243
- row: t.original,
244
- onActionClick: Y
245
- }),
246
- /* @__PURE__ */ y(M, {
247
- enabled: t.original.actions.cancel,
248
- label: Q.actionCancel,
249
- action: "cancel",
250
- row: t.original,
251
- onActionClick: Y
252
- }),
253
- /* @__PURE__ */ y(M, {
254
- enabled: t.original.actions.clone,
255
- label: Q.actionClone,
256
- action: "clone",
257
- row: t.original,
258
- onActionClick: Y
259
- }),
260
- /* @__PURE__ */ y(M, {
261
- enabled: t.original.actions.delete,
262
- label: Q.actionDelete,
263
- action: "delete",
264
- row: t.original,
265
- onActionClick: Y,
266
- variant: "destructive"
267
- })
268
- ]
269
- })] })
270
- }),
271
- size: 72
272
- }] : $;
273
- return /* @__PURE__ */ b("div", {
274
- className: "ttw:flex ttw:flex-col ttw:gap-4",
275
- children: [
276
- /* @__PURE__ */ b("div", {
277
- className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:justify-between ttw:gap-3",
278
- children: [/* @__PURE__ */ y("div", {
279
- className: "ttw:flex ttw:items-center ttw:gap-3",
280
- children: !d && /* @__PURE__ */ y(ee, {
281
- value: o,
282
- onValueChange: (e) => c(e),
283
- children: /* @__PURE__ */ b(te, { children: [
284
- s.includes("invoices") && /* @__PURE__ */ y(p, {
285
- value: "invoices",
286
- children: Q.tabInvoices
287
- }),
288
- s.includes("quotes") && /* @__PURE__ */ y(p, {
289
- value: "quotes",
290
- children: Q.tabQuotes
291
- }),
292
- s.includes("credit_notes") && /* @__PURE__ */ y(p, {
293
- value: "credit_notes",
294
- children: Q.tabCreditNotes
295
- })
296
- ] })
297
- })
298
- }), /* @__PURE__ */ b("div", {
299
- className: "ttw:flex ttw:items-center ttw:gap-2",
300
- children: [q && /* @__PURE__ */ b(e, {
301
- variant: "outline",
302
- onClick: q,
303
- children: [/* @__PURE__ */ y(O, { className: "ttw:size-4" }), Q.templateSettingsButton]
304
- }), K && /* @__PURE__ */ b(e, {
305
- onClick: K,
306
- children: [/* @__PURE__ */ y(E, { className: "ttw:size-4" }), Q.createButton]
36
+ }), t.statuses.map((e) => /* @__PURE__ */ i(s, {
37
+ selected: e.selected,
38
+ onClick: () => c(e.value),
39
+ children: /* @__PURE__ */ a("div", {
40
+ className: "ttw:flex ttw:flex-col",
41
+ children: [/* @__PURE__ */ a("div", {
42
+ className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-2",
43
+ children: [/* @__PURE__ */ i(r, {
44
+ label: e.statusLabel,
45
+ tone: e.statusTone
46
+ }), /* @__PURE__ */ i("span", {
47
+ className: "ttw:text-xs ttw:font-medium ttw:leading-4.5 ttw:tabular-nums ttw:text-foreground",
48
+ children: e.countLabel
307
49
  })]
50
+ }), /* @__PURE__ */ i("span", {
51
+ className: "ttw:overflow-hidden ttw:text-ellipsis ttw:whitespace-nowrap ttw:text-2xl ttw:font-medium ttw:leading-8 ttw:tabular-nums ttw:text-foreground",
52
+ children: e.amountLabel
308
53
  })]
309
- }),
310
- !d && H && U && /* @__PURE__ */ y(v, {
311
- view: H,
312
- onSelect: U,
313
- labels: { all: Q.statusCardsAll }
314
- }),
315
- d ? /* @__PURE__ */ y(h, {
316
- icon: /* @__PURE__ */ y(w, { className: "ttw:size-8 ttw:text-primary" }),
317
- title: Q.accessRestrictedTitle,
318
- description: Q.accessRestrictedDescription
319
- }) : u ? /* @__PURE__ */ y(h, {
320
- title: Q.errorTitle,
321
- description: Q.errorDescription,
322
- retryLabel: X ? Q.errorRetry : void 0,
323
- onRetry: X
324
- }) : /* @__PURE__ */ y(t, {
325
- columns: ie,
326
- data: i,
327
- isLoading: l,
328
- sorting: f,
329
- onSortingChange: x,
330
- pageSize: S,
331
- onPageSizeChange: C,
332
- pageSizeOptions: D,
333
- pageInfo: A,
334
- hasNextPage: N,
335
- hasPrevPage: P,
336
- onNextPage: F,
337
- onPrevPage: I,
338
- onRowClick: J,
339
- rowAriaLabel: (e) => Q.openRow(e.documentLabel),
340
- filterComponent: W ?? /* @__PURE__ */ y(ne, {
341
- labels: Q,
342
- searchValue: L,
343
- onSearchChange: R,
344
- statusFilter: z,
345
- statusOptions: B,
346
- onStatusFilterChange: V
347
- }),
348
- children: /* @__PURE__ */ y(m, {
349
- title: G ? Q.filterEmptyTitle : Q.emptyTitle,
350
- description: G ? Q.filterEmptyDescription : Q.emptyDescription,
351
- actionLabel: G ? void 0 : Q.emptyAction,
352
- onAction: G ? void 0 : K
353
- })
354
54
  })
355
- ]
55
+ }, e.value))]
356
56
  });
357
57
  }
358
58
  //#endregion
359
- export { P as ReceivablesScreen, P as default };
59
+ export { c as ReceivableStatusCards, c as default };