@tesouro/embedded-components-react 0.11.205 → 0.11.209

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 (87) hide show
  1. package/dist/experimental/BalanceHistoryWidget.d.ts +1 -1
  2. package/dist/experimental/index.d.ts +1 -1
  3. package/dist/index.css +13 -126
  4. package/dist/index.d.ts +7 -6
  5. package/dist/lib/ReceivablesWidget.d.ts +6 -5
  6. package/dist/lib/WidgetSuite.d.ts +7 -6
  7. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/BalanceHistoryWidget/labels.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableAttachmentsSection.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableCustomerSection.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +16 -18
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +186 -239
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +59 -52
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +5 -4
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentRecord.js +5 -5
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentTerms.js +1 -1
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/preview.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurringSeries.js +19 -23
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/reminders.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/statusColors.js +34 -0
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +2 -6
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +5 -1
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +16 -16
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +1 -2
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +2 -0
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +28 -27
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +18 -120
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +89 -84
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +91 -36
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +41 -2
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +2 -12
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +9 -9
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +9 -25
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +26 -208
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +209 -52
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +50 -208
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +186 -138
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +157 -12
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +10 -19
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +23 -2
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +2 -116
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +117 -3
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +3 -198
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +198 -2
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +2 -54
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +14 -19
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +22 -8
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +40 -77
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +17 -37
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +8 -18
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +61 -38
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +27 -27
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +26 -15
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +14 -6
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +19 -35
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +31 -14
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +67 -24
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +391 -84
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +2 -494
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +47 -2
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +62 -38
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +433 -61
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +176 -428
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +20 -224
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +6 -21
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +264 -0
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +2 -264
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +131 -2
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +22 -126
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +235 -23
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +3 -239
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +247 -3
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +26 -244
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js +183 -26
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +21 -194
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js +143 -21
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index62.js +2 -143
  79. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index63.js +47 -2
  80. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index.js +2 -2
  81. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index7.js +2 -31
  82. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  83. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/helpers.js +1 -1
  84. package/dist/packages/shared-ui-shadcn/dist/index.js +1554 -1544
  85. package/package.json +1 -1
  86. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +0 -7
  87. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index64.js +0 -47
@@ -1,30 +1,187 @@
1
- import { Skeleton as e, SummaryCard as t, SummaryCardGroup as n } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { LoadingRegion as r } from "../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
1
+ import { Badge as e, Button as t, DataTable as n, Skeleton as r, cn as i } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { EmptyState as a } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
+ import { ErrorState as o } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
4
+ import { DueDateText as s } from "../../../shared/ui/dist/lib/DueDateText/DueDateText.js";
3
5
  import "../../../shared/ui/dist/index.js";
4
- import { RECEIVABLE_STATUS_CARDS_LABELS_EN as i } from "./index18.js";
5
- import { jsx as a } from "react/jsx-runtime";
6
+ import { TabRowAction as c } from "./index8.js";
7
+ import { RECEIVABLES_SCREEN_LABELS_EN as l } from "./index19.js";
8
+ import { StatusBadge as u } from "./index30.js";
9
+ import { ReceivableStatusCards as d } from "./index58.js";
10
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
11
+ import { ArrowDownIcon as m, ArrowUpDownIcon as h, ArrowUpIcon as g, LockKeyholeIcon as _ } from "lucide-react";
6
12
  // ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js
7
- var o = 4;
8
- function s({ view: s, onSelect: c, labels: l }) {
9
- let u = {
10
- ...i,
11
- ...l
12
- }, d = s.kind === "loading";
13
- return /* @__PURE__ */ a(r, {
14
- isLoading: d,
15
- loadingLabel: u.loading,
16
- children: /* @__PURE__ */ a(n, {
17
- "aria-label": u.group,
18
- children: s.kind === "loading" ? Array.from({ length: o }).map((t, n) => /* @__PURE__ */ a(e, { className: "ttw:h-28 ttw:rounded-lg" }, n)) : s.cards.map((e) => /* @__PURE__ */ a(t, {
19
- label: e.label,
20
- labelTone: e.labelTone,
21
- amount: e.amountLabel,
22
- caption: e.captionLabel,
23
- selected: e.selected,
24
- disabled: e.disabled,
25
- onClick: () => c(e.value)
26
- }, e.value))
27
- })
13
+ var v = [
14
+ 10,
15
+ 25,
16
+ 50,
17
+ 100
18
+ ];
19
+ function y({ label: e, ariaLabel: n, column: r }) {
20
+ let i = r.getIsSorted();
21
+ return /* @__PURE__ */ p("div", {
22
+ className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-inherit",
23
+ children: [e, /* @__PURE__ */ f(t, {
24
+ variant: "ghost",
25
+ size: "icon-sm",
26
+ "aria-label": n,
27
+ onClick: () => r.toggleSorting(i === "asc"),
28
+ children: f(i === "asc" ? g : i === "desc" ? m : h, { className: "ttw:size-4" })
29
+ })]
28
30
  });
29
31
  }
30
- export { s as ReceivableStatusCards, s as default };
32
+ function b({ row: t }) {
33
+ if (t.customerState === "resolving") return /* @__PURE__ */ f(r, { className: "ttw:h-4 ttw:w-full" });
34
+ let n = /* @__PURE__ */ f("span", {
35
+ className: i("ttw:min-w-0", t.customerState === "missing" && "ttw:opacity-40"),
36
+ children: t.customerLabel
37
+ });
38
+ return t.recurringBadgeLabel ? /* @__PURE__ */ p("span", {
39
+ className: "ttw:flex ttw:items-center ttw:gap-2",
40
+ children: [n, /* @__PURE__ */ f(e, {
41
+ tone: "neutral",
42
+ className: "ttw:shrink-0",
43
+ children: t.recurringBadgeLabel
44
+ })]
45
+ }) : n;
46
+ }
47
+ function x({ rows: e, isLoading: t, isError: r, isAccessRestricted: i, sorting: m, onSortingChange: h, pageSize: g, onPageSizeChange: x, pageSizeOptions: S = v, pageInfo: C, hasNextPage: w, hasPrevPage: T, onNextPage: E, onPrevPage: D, statusCards: O, onStatusCardSelect: k, filterBar: A, isFiltering: j, onCreateClick: M, headerActionContainer: N, onRowClick: P, onRetry: F, labels: I }) {
48
+ let L = {
49
+ ...l,
50
+ ...I,
51
+ statusBadge: {
52
+ ...l.statusBadge,
53
+ ...I?.statusBadge
54
+ }
55
+ }, R = [
56
+ {
57
+ accessorKey: "customerLabel",
58
+ header: L.columnCustomer,
59
+ cell: ({ row: e }) => /* @__PURE__ */ f(b, { row: e.original }),
60
+ minSize: 180
61
+ },
62
+ {
63
+ accessorKey: "documentLabel",
64
+ enableSorting: !0,
65
+ header: ({ column: e }) => /* @__PURE__ */ f(y, {
66
+ column: e,
67
+ label: L.columnNumber,
68
+ ariaLabel: L.sortByNumber
69
+ })
70
+ },
71
+ {
72
+ accessorKey: "status",
73
+ enableSorting: !0,
74
+ header: ({ column: e }) => /* @__PURE__ */ f(y, {
75
+ column: e,
76
+ label: L.columnStatus,
77
+ ariaLabel: L.sortByStatus
78
+ }),
79
+ cell: ({ row: e }) => /* @__PURE__ */ f(u, {
80
+ label: e.original.statusLabel,
81
+ color: e.original.statusColor
82
+ })
83
+ },
84
+ {
85
+ accessorKey: "issueDateLabel",
86
+ enableSorting: !0,
87
+ header: ({ column: e }) => /* @__PURE__ */ f(y, {
88
+ column: e,
89
+ label: L.columnIssueDate,
90
+ ariaLabel: L.sortByIssueDate
91
+ })
92
+ },
93
+ {
94
+ accessorKey: "dueDateLabel",
95
+ enableSorting: !0,
96
+ header: ({ column: e }) => /* @__PURE__ */ f(y, {
97
+ column: e,
98
+ label: L.columnDueDate,
99
+ ariaLabel: L.sortByDueDate
100
+ }),
101
+ cell: ({ row: e }) => /* @__PURE__ */ f(s, {
102
+ label: e.original.dueDateLabel,
103
+ overdueLabel: e.original.dueDateOverdueLabel,
104
+ accessibleLabel: e.original.dueDateAccessibleLabel
105
+ })
106
+ },
107
+ {
108
+ accessorKey: "totalLabel",
109
+ enableSorting: !0,
110
+ header: ({ column: e }) => /* @__PURE__ */ f("div", {
111
+ className: "ttw:flex ttw:justify-end",
112
+ children: /* @__PURE__ */ f(y, {
113
+ column: e,
114
+ label: L.columnAmount,
115
+ ariaLabel: L.sortByAmount
116
+ })
117
+ }),
118
+ cell: ({ row: e }) => /* @__PURE__ */ f("div", {
119
+ className: "ttw:text-right ttw:tabular-nums",
120
+ children: e.original.totalLabel
121
+ })
122
+ },
123
+ {
124
+ accessorKey: "balanceDueLabel",
125
+ header: () => /* @__PURE__ */ f("div", {
126
+ className: "ttw:text-right",
127
+ children: L.columnBalanceDue
128
+ }),
129
+ cell: ({ row: e }) => /* @__PURE__ */ f("div", {
130
+ className: "ttw:text-right ttw:tabular-nums",
131
+ children: e.original.balanceDueLabel
132
+ })
133
+ }
134
+ ], z = !i && !r && !j && e.length === 0;
135
+ return /* @__PURE__ */ p("div", {
136
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
137
+ children: [
138
+ M && !z && /* @__PURE__ */ f(c, {
139
+ container: N,
140
+ label: L.createInvoiceButton,
141
+ onClick: M
142
+ }),
143
+ !i && O && k && /* @__PURE__ */ f(d, {
144
+ view: O,
145
+ onSelect: k,
146
+ labels: {
147
+ group: L.statusCardsGroup,
148
+ loading: L.statusCardsLoading
149
+ }
150
+ }),
151
+ i ? /* @__PURE__ */ f(o, {
152
+ icon: /* @__PURE__ */ f(_, { className: "ttw:size-8 ttw:text-primary" }),
153
+ title: L.accessRestrictedTitle,
154
+ description: L.accessRestrictedDescription
155
+ }) : /* @__PURE__ */ f(n, {
156
+ columns: R,
157
+ data: e,
158
+ isLoading: t,
159
+ sorting: m,
160
+ onSortingChange: h,
161
+ pageSize: g,
162
+ onPageSizeChange: x,
163
+ pageSizeOptions: S,
164
+ pageInfo: C,
165
+ hasNextPage: w,
166
+ hasPrevPage: T,
167
+ onNextPage: E,
168
+ onPrevPage: D,
169
+ onRowClick: P,
170
+ rowAriaLabel: (e) => L.openRow(e.documentLabel),
171
+ filterComponent: A,
172
+ children: r && !j ? /* @__PURE__ */ f(o, {
173
+ title: L.errorTitle,
174
+ description: L.errorDescription,
175
+ retryLabel: F ? L.errorRetry : void 0,
176
+ onRetry: F
177
+ }) : /* @__PURE__ */ f(a, {
178
+ title: j ? L.filterEmptyTitle : L.emptyTitle,
179
+ description: j ? void 0 : L.emptyDescription,
180
+ actionLabel: j ? void 0 : L.createInvoiceButton,
181
+ onAction: j ? void 0 : M
182
+ })
183
+ })
184
+ ]
185
+ });
186
+ }
187
+ export { x as ReceivablesScreen, x as default };
@@ -1,195 +1,22 @@
1
- import { Badge as e, Button as t, DataTable as n, Skeleton as r, cn as i } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { EmptyState as a } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
- import { ErrorState as o } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
4
- import { DueDateText as s } from "../../../shared/ui/dist/lib/DueDateText/DueDateText.js";
5
- import "../../../shared/ui/dist/index.js";
6
- import { ReceivableStatusBadge as c } from "../../../shared/document-status/ui/dist/index7.js";
7
- import "../../../shared/document-status/ui/dist/index.js";
8
- import { TabRowAction as l } from "./index8.js";
9
- import { RECEIVABLES_SCREEN_LABELS_EN as u } from "./index18.js";
10
- import { ReceivableStatusCards as d } from "./index59.js";
11
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
12
- import { ArrowDownIcon as m, ArrowUpDownIcon as h, ArrowUpIcon as g, LockKeyholeIcon as _ } from "lucide-react";
13
1
  // ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js
14
- var v = [
15
- 10,
16
- 25,
17
- 50,
18
- 100
19
- ];
20
- function y({ label: e, ariaLabel: n, column: r }) {
21
- let i = r.getIsSorted();
22
- return /* @__PURE__ */ p("div", {
23
- className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-inherit",
24
- children: [e, /* @__PURE__ */ f(t, {
25
- variant: "ghost",
26
- size: "icon-sm",
27
- "aria-label": n,
28
- onClick: () => r.toggleSorting(i === "asc"),
29
- children: f(i === "asc" ? g : i === "desc" ? m : h, { className: "ttw:size-4" })
30
- })]
31
- });
32
- }
33
- function b({ row: e, statusBadgeLabels: t }) {
34
- return /* @__PURE__ */ f(c, {
35
- status: e.status,
36
- variant: "filled",
37
- labels: t
38
- });
39
- }
40
- function x({ row: t }) {
41
- if (t.customerState === "resolving") return /* @__PURE__ */ f(r, { className: "ttw:h-4 ttw:w-full" });
42
- let n = /* @__PURE__ */ f("span", {
43
- className: i("ttw:min-w-0", t.customerState === "missing" && "ttw:opacity-40"),
44
- children: t.customerLabel
45
- });
46
- return t.recurringBadgeLabel ? /* @__PURE__ */ p("span", {
47
- className: "ttw:flex ttw:items-center ttw:gap-2",
48
- children: [n, /* @__PURE__ */ f(e, {
49
- tone: "neutral",
50
- className: "ttw:shrink-0",
51
- children: t.recurringBadgeLabel
52
- })]
53
- }) : n;
54
- }
55
- function S({ rows: e, isLoading: t, isError: r, isAccessRestricted: i, sorting: c, onSortingChange: m, pageSize: h, onPageSizeChange: g, pageSizeOptions: S = v, pageInfo: C, hasNextPage: w, hasPrevPage: T, onNextPage: E, onPrevPage: D, statusCards: O, onStatusCardSelect: k, filterBar: A, isFiltering: j, onCreateClick: M, headerActionContainer: N, onRowClick: P, onRetry: F, labels: I }) {
56
- let L = {
57
- ...u,
58
- ...I,
59
- statusBadge: {
60
- ...u.statusBadge,
61
- ...I?.statusBadge
62
- }
63
- }, R = [
64
- {
65
- accessorKey: "customerLabel",
66
- header: L.columnCustomer,
67
- cell: ({ row: e }) => /* @__PURE__ */ f(x, { row: e.original }),
68
- minSize: 180
69
- },
70
- {
71
- accessorKey: "documentLabel",
72
- enableSorting: !0,
73
- header: ({ column: e }) => /* @__PURE__ */ f(y, {
74
- column: e,
75
- label: L.columnNumber,
76
- ariaLabel: L.sortByNumber
77
- })
78
- },
79
- {
80
- accessorKey: "status",
81
- enableSorting: !0,
82
- header: ({ column: e }) => /* @__PURE__ */ f(y, {
83
- column: e,
84
- label: L.columnStatus,
85
- ariaLabel: L.sortByStatus
86
- }),
87
- cell: ({ row: e }) => /* @__PURE__ */ f(b, {
88
- row: e.original,
89
- statusBadgeLabels: L.statusBadge
90
- })
91
- },
92
- {
93
- accessorKey: "issueDateLabel",
94
- enableSorting: !0,
95
- header: ({ column: e }) => /* @__PURE__ */ f(y, {
96
- column: e,
97
- label: L.columnIssueDate,
98
- ariaLabel: L.sortByIssueDate
99
- })
100
- },
101
- {
102
- accessorKey: "dueDateLabel",
103
- enableSorting: !0,
104
- header: ({ column: e }) => /* @__PURE__ */ f(y, {
105
- column: e,
106
- label: L.columnDueDate,
107
- ariaLabel: L.sortByDueDate
108
- }),
109
- cell: ({ row: e }) => /* @__PURE__ */ f(s, {
110
- label: e.original.dueDateLabel,
111
- overdueLabel: e.original.dueDateOverdueLabel,
112
- accessibleLabel: e.original.dueDateAccessibleLabel
113
- })
114
- },
115
- {
116
- accessorKey: "totalLabel",
117
- enableSorting: !0,
118
- header: ({ column: e }) => /* @__PURE__ */ f("div", {
119
- className: "ttw:flex ttw:justify-end",
120
- children: /* @__PURE__ */ f(y, {
121
- column: e,
122
- label: L.columnAmount,
123
- ariaLabel: L.sortByAmount
124
- })
125
- }),
126
- cell: ({ row: e }) => /* @__PURE__ */ f("div", {
127
- className: "ttw:text-right ttw:tabular-nums",
128
- children: e.original.totalLabel
129
- })
130
- },
131
- {
132
- accessorKey: "balanceDueLabel",
133
- header: () => /* @__PURE__ */ f("div", {
134
- className: "ttw:text-right",
135
- children: L.columnBalanceDue
136
- }),
137
- cell: ({ row: e }) => /* @__PURE__ */ f("div", {
138
- className: "ttw:text-right ttw:tabular-nums",
139
- children: e.original.balanceDueLabel
140
- })
141
- }
142
- ], z = !i && !r && !j && e.length === 0;
143
- return /* @__PURE__ */ p("div", {
144
- className: "ttw:flex ttw:flex-col ttw:gap-4",
145
- children: [
146
- M && !z && /* @__PURE__ */ f(l, {
147
- container: N,
148
- label: L.createInvoiceButton,
149
- onClick: M
150
- }),
151
- !i && O && k && /* @__PURE__ */ f(d, {
152
- view: O,
153
- onSelect: k,
154
- labels: {
155
- group: L.statusCardsGroup,
156
- loading: L.statusCardsLoading
157
- }
158
- }),
159
- i ? /* @__PURE__ */ f(o, {
160
- icon: /* @__PURE__ */ f(_, { className: "ttw:size-8 ttw:text-primary" }),
161
- title: L.accessRestrictedTitle,
162
- description: L.accessRestrictedDescription
163
- }) : /* @__PURE__ */ f(n, {
164
- columns: R,
165
- data: e,
166
- isLoading: t,
167
- sorting: c,
168
- onSortingChange: m,
169
- pageSize: h,
170
- onPageSizeChange: g,
171
- pageSizeOptions: S,
172
- pageInfo: C,
173
- hasNextPage: w,
174
- hasPrevPage: T,
175
- onNextPage: E,
176
- onPrevPage: D,
177
- onRowClick: P,
178
- rowAriaLabel: (e) => L.openRow(e.documentLabel),
179
- filterComponent: A,
180
- children: r && !j ? /* @__PURE__ */ f(o, {
181
- title: L.errorTitle,
182
- description: L.errorDescription,
183
- retryLabel: F ? L.errorRetry : void 0,
184
- onRetry: F
185
- }) : /* @__PURE__ */ f(a, {
186
- title: j ? L.filterEmptyTitle : L.emptyTitle,
187
- description: j ? void 0 : L.emptyDescription,
188
- actionLabel: j ? void 0 : L.createInvoiceButton,
189
- onAction: j ? void 0 : M
190
- })
191
- })
192
- ]
193
- });
194
- }
195
- export { S as ReceivablesScreen, S as default };
2
+ var e = {
3
+ createButton: "Create recurring invoice",
4
+ columnCustomer: "Customer",
5
+ columnRepeats: "Repeats",
6
+ columnNextInvoice: "Next invoice",
7
+ columnStatus: "Status",
8
+ columnAmount: "Amount",
9
+ openRow: (e) => `View series — ${e}`,
10
+ searchPlaceholder: "Search series",
11
+ searchLabel: "Search series",
12
+ emptyTitle: "No recurring invoices",
13
+ emptyDescription: "You don’t have any recurring invoices yet.",
14
+ filterEmptyTitle: "No series found",
15
+ filterEmptyAction: "Clear filters",
16
+ errorTitle: "Couldn’t load recurring invoices",
17
+ errorDescription: "There was an error loading recurring invoices.",
18
+ errorRetry: "Try again",
19
+ accessRestrictedTitle: "Access restricted",
20
+ accessRestrictedDescription: "You don’t have permissions to view this page. Contact your system administrator for details."
21
+ };
22
+ export { e as RECURRING_SERIES_SCREEN_LABELS_EN };
@@ -1,22 +1,144 @@
1
+ import { DataTable as e, DataTableSortableHeader as t, Skeleton as n, cn as r } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { EmptyState as i } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
+ import { ErrorState as a } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
4
+ import { NoAccessState as o } from "../../../shared/ui/dist/lib/StatePanel/NoAccessState.js";
5
+ import "../../../shared/ui/dist/index.js";
6
+ import { TabRowAction as s } from "./index8.js";
7
+ import { StatusBadge as c } from "./index30.js";
8
+ import { RECURRING_SERIES_SCREEN_LABELS_EN as l } from "./index60.js";
9
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
1
10
  // ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js
2
- var e = {
3
- createButton: "Create recurring invoice",
4
- columnCustomer: "Customer",
5
- columnRepeats: "Repeats",
6
- columnNextInvoice: "Next invoice",
7
- columnStatus: "Status",
8
- columnAmount: "Amount",
9
- openRow: (e) => `View series — ${e}`,
10
- searchPlaceholder: "Search series",
11
- searchLabel: "Search series",
12
- emptyTitle: "No recurring invoices",
13
- emptyDescription: "You don’t have any recurring invoices yet.",
14
- filterEmptyTitle: "No series found",
15
- filterEmptyAction: "Clear filters",
16
- errorTitle: "Couldn’t load recurring invoices",
17
- errorDescription: "There was an error loading recurring invoices.",
18
- errorRetry: "Try again",
19
- accessRestrictedTitle: "Access restricted",
20
- accessRestrictedDescription: "You don’t have permissions to view this page. Contact your system administrator for details."
21
- };
22
- export { e as RECURRING_SERIES_SCREEN_LABELS_EN };
11
+ var f = [
12
+ 10,
13
+ 25,
14
+ 50,
15
+ 100
16
+ ], p = [];
17
+ function m({ row: e }) {
18
+ return e.customerState === "resolving" ? /* @__PURE__ */ u(n, { className: "ttw:h-4 ttw:w-full" }) : e.customerState === "missing" ? /* @__PURE__ */ u("span", {
19
+ className: "ttw:opacity-40",
20
+ children: e.customerLabel
21
+ }) : /* @__PURE__ */ u("span", { children: e.customerLabel });
22
+ }
23
+ function h({ row: e }) {
24
+ return /* @__PURE__ */ u("span", {
25
+ className: r(e.nextInvoiceMuted && "ttw:text-muted-foreground"),
26
+ children: e.nextInvoiceLabel
27
+ });
28
+ }
29
+ function g({ row: e }) {
30
+ return e.status.kind === "loading" ? /* @__PURE__ */ u(n, { className: "ttw:h-4 ttw:w-full" }) : e.status.kind === "blank" ? null : /* @__PURE__ */ u(c, {
31
+ label: e.status.label,
32
+ color: e.status.color
33
+ });
34
+ }
35
+ function _({ rows: n, isLoading: r, isError: c, isAccessRestricted: _, sorting: v, onSortingChange: y, pageSize: b, onPageSizeChange: x, pageSizeOptions: S = f, hasNextPage: C, hasPrevPage: w, onNextPage: T, onPrevPage: E, filterBar: D, isFiltering: O, onClearFilters: k, onCreateClick: A, headerActionContainer: j, onRowClick: M, onRetry: N, labels: P }) {
36
+ let F = {
37
+ ...l,
38
+ ...P
39
+ }, I = [
40
+ {
41
+ accessorKey: "customerLabel",
42
+ header: F.columnCustomer,
43
+ cell: ({ row: e }) => /* @__PURE__ */ u(m, { row: e.original }),
44
+ minSize: 180
45
+ },
46
+ {
47
+ accessorKey: "repeatsLabel",
48
+ header: F.columnRepeats
49
+ },
50
+ {
51
+ accessorKey: "nextInvoiceLabel",
52
+ header: F.columnNextInvoice,
53
+ cell: ({ row: e }) => /* @__PURE__ */ u(h, { row: e.original })
54
+ },
55
+ {
56
+ id: "status",
57
+ header: F.columnStatus,
58
+ cell: ({ row: e }) => /* @__PURE__ */ u(g, { row: e.original })
59
+ },
60
+ {
61
+ accessorKey: "amountLabel",
62
+ enableSorting: !0,
63
+ header: ({ column: e }) => /* @__PURE__ */ u("div", {
64
+ className: "ttw:flex ttw:justify-end",
65
+ children: /* @__PURE__ */ u(t, {
66
+ column: e,
67
+ title: F.columnAmount
68
+ })
69
+ }),
70
+ cell: ({ row: e }) => /* @__PURE__ */ u("div", {
71
+ className: "ttw:text-right ttw:tabular-nums",
72
+ children: e.original.amountLabel
73
+ })
74
+ }
75
+ ], L = (e) => /* @__PURE__ */ d("div", {
76
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
77
+ children: [
78
+ /* @__PURE__ */ d("div", {
79
+ className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4",
80
+ children: [/* @__PURE__ */ u("span", {
81
+ className: "ttw:min-w-0 ttw:flex-1 ttw:font-medium",
82
+ children: /* @__PURE__ */ u(m, { row: e })
83
+ }), /* @__PURE__ */ u("span", {
84
+ className: "ttw:tabular-nums",
85
+ children: e.amountLabel
86
+ })]
87
+ }),
88
+ [{
89
+ label: F.columnRepeats,
90
+ value: e.repeatsLabel
91
+ }, {
92
+ label: F.columnNextInvoice,
93
+ value: /* @__PURE__ */ u(h, { row: e })
94
+ }].map((e) => /* @__PURE__ */ d("div", {
95
+ className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4",
96
+ children: [/* @__PURE__ */ u("span", {
97
+ className: "ttw:text-muted-foreground",
98
+ children: e.label
99
+ }), /* @__PURE__ */ u("span", { children: e.value })]
100
+ }, e.label)),
101
+ /* @__PURE__ */ u("div", { children: /* @__PURE__ */ u(g, { row: e }) })
102
+ ]
103
+ }), R = !_ && !c && !O && n.length === 0;
104
+ return /* @__PURE__ */ d("div", {
105
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
106
+ children: [A && !R && /* @__PURE__ */ u(s, {
107
+ container: j,
108
+ label: F.createButton,
109
+ onClick: A
110
+ }), _ ? /* @__PURE__ */ u(o, {
111
+ title: F.accessRestrictedTitle,
112
+ description: F.accessRestrictedDescription
113
+ }) : /* @__PURE__ */ u(e, {
114
+ columns: I,
115
+ data: c ? p : n,
116
+ isLoading: r,
117
+ sorting: v,
118
+ onSortingChange: y,
119
+ pageSize: b,
120
+ onPageSizeChange: x,
121
+ pageSizeOptions: S,
122
+ hasNextPage: !c && C,
123
+ hasPrevPage: !c && w,
124
+ onNextPage: T,
125
+ onPrevPage: E,
126
+ onRowClick: M,
127
+ rowAriaLabel: (e) => F.openRow(e.customerLabel),
128
+ filterComponent: D,
129
+ renderCard: L,
130
+ children: c ? /* @__PURE__ */ u(a, {
131
+ title: F.errorTitle,
132
+ description: F.errorDescription,
133
+ retryLabel: N ? F.errorRetry : void 0,
134
+ onRetry: N
135
+ }) : /* @__PURE__ */ u(i, {
136
+ title: O ? F.filterEmptyTitle : F.emptyTitle,
137
+ description: O ? void 0 : F.emptyDescription,
138
+ actionLabel: O ? F.filterEmptyAction : F.createButton,
139
+ onAction: O ? k : A
140
+ })
141
+ })]
142
+ });
143
+ }
144
+ export { _ as RecurringSeriesScreen, _ as default };