@tesouro/embedded-components-react 0.7.45 → 0.7.46

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 (95) hide show
  1. package/dist/index.d.ts +29 -39
  2. package/dist/lib/CounterpartsWidget.d.ts +29 -22
  3. package/dist/lib/CounterpartsWidgetPublic.d.ts +29 -22
  4. package/dist/lib/CustomersWidget.d.ts +29 -22
  5. package/dist/lib/ReceivablesWidget.d.ts +1 -0
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +12 -12
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +15 -15
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +9 -9
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +30 -30
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +3 -2
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +7 -6
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +3 -2
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +9 -8
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +5 -4
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index48.js +1 -1
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index49.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +3 -2
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +40 -40
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +3 -2
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +8 -7
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +9 -13
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +7 -10
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +76 -11
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +1 -1
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +27 -9
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +2 -76
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +30 -0
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +1 -1
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +5 -27
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +32 -2
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +2 -30
  36. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +73 -77
  37. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +8 -25
  38. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +197 -208
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +9 -9
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/auditHistory/labels.js +2 -2
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +1 -1
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +2 -2
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +22 -23
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +10 -24
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +53 -37
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +21 -53
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +8 -21
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +77 -8
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +31 -69
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +17 -38
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +40 -17
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +26 -38
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +18 -27
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +8 -18
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +35 -9
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +14 -36
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +26 -14
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +84 -23
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +487 -80
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +2 -494
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +48 -2
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +62 -38
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +438 -61
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +207 -431
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +20 -222
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +6 -21
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +265 -0
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +2 -265
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +131 -2
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +22 -125
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +235 -23
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +3 -240
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +249 -3
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +54 -242
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +221 -51
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +38 -222
  77. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index.js +8 -0
  78. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index2.js +14 -0
  79. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index3.js +13 -0
  80. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index4.js +18 -0
  81. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index5.js +2 -0
  82. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index6.js +20 -0
  83. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index7.js +32 -0
  84. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index8.js +2 -0
  85. package/dist/libs/tesouro-embedded-components-react/{bill-pay-widget → shared/document-status}/util/dist/lib/derivePayableStatus.js +23 -10
  86. package/dist/libs/tesouro-embedded-components-react/shared/document-status/util/dist/lib/receivableFilledTone.js +22 -0
  87. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  88. package/package.json +1 -1
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +0 -18
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +0 -2
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +0 -7
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +0 -34
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +0 -2
  94. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +0 -8
  95. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +0 -45
@@ -1,60 +1,230 @@
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 "./index14.js";
3
- import { ReceivableStatusBadge as r } from "./index25.js";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
1
+ import { Button as e, DataTable as t, Skeleton as n, Tooltip as r, TooltipContent as i, TooltipProvider as a, TooltipTrigger as o } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { EmptyState as s } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
+ import { ErrorState as c } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
4
+ import "../../../shared/ui/dist/index.js";
5
+ import { ReceivableStatusBadge as l } from "../../../shared/document-status/ui/dist/index7.js";
6
+ import "../../../shared/document-status/ui/dist/index.js";
7
+ import { RECEIVABLES_SCREEN_LABELS_EN as u } from "./index14.js";
8
+ import { SeriesStatusChip as d } from "./index37.js";
9
+ import { ReceivableStatusCards as f } from "./index55.js";
10
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
11
+ import { ArrowDownIcon as h, ArrowUpDownIcon as g, ArrowUpIcon as _, CogIcon as v, LockKeyholeIcon as y, RefreshCwIcon as b } from "lucide-react";
5
12
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.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
13
+ var x = [
14
+ 10,
15
+ 25,
16
+ 50,
17
+ 100
18
+ ];
19
+ function S({ label: t, ariaLabel: n, column: r }) {
20
+ let i = r.getIsSorted();
21
+ return /* @__PURE__ */ m("div", {
22
+ className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-inherit",
23
+ children: [t, /* @__PURE__ */ p(e, {
24
+ variant: "ghost",
25
+ size: "icon-sm",
26
+ "aria-label": n,
27
+ onClick: () => r.toggleSorting(i === "asc"),
28
+ children: p(i === "asc" ? _ : i === "desc" ? h : g, { className: "ttw:size-4" })
29
+ })]
14
30
  });
15
31
  }
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-2 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
- status: e.value,
46
- variant: "filled"
47
- }), /* @__PURE__ */ i("span", {
48
- className: "ttw:text-xs ttw:font-medium ttw:leading-4.5 ttw:tabular-nums ttw:text-foreground",
49
- children: e.countLabel
32
+ function C({ row: e }) {
33
+ return e.dueDateOverdueLabel ? /* @__PURE__ */ m("div", {
34
+ className: "ttw:flex ttw:flex-col ttw:justify-center ttw:gap-1 ttw:text-destructive",
35
+ children: [/* @__PURE__ */ p("span", {
36
+ className: "ttw:text-sm ttw:leading-5",
37
+ children: e.dueDateLabel
38
+ }), /* @__PURE__ */ p("span", {
39
+ className: "ttw:text-xs ttw:leading-4.5",
40
+ children: e.dueDateOverdueLabel
41
+ })]
42
+ }) : e.dueDateLabel;
43
+ }
44
+ function w({ row: e, statusBadgeLabels: t }) {
45
+ let r = e.statusOverride;
46
+ return r ? r.kind === "loading" ? /* @__PURE__ */ p(n, { className: "ttw:h-4 ttw:w-full" }) : r.kind === "chip" ? /* @__PURE__ */ p(d, {
47
+ label: r.label,
48
+ tone: r.tone
49
+ }) : null : /* @__PURE__ */ p(l, {
50
+ status: e.status,
51
+ variant: "filled",
52
+ labels: t
53
+ });
54
+ }
55
+ function T({ row: e }) {
56
+ return e.showDocumentSyncIcon ? /* @__PURE__ */ m("span", {
57
+ className: "ttw:flex ttw:items-center ttw:gap-1",
58
+ children: [/* @__PURE__ */ p(b, {
59
+ className: "ttw:size-[1em]",
60
+ "aria-hidden": !0
61
+ }), e.documentLabel]
62
+ }) : e.documentLabel;
63
+ }
64
+ function E({ row: e }) {
65
+ return e.customerState === "resolving" ? /* @__PURE__ */ p(n, { className: "ttw:h-4 ttw:w-full" }) : e.customerState === "missing" ? /* @__PURE__ */ p("span", {
66
+ className: "ttw:opacity-40",
67
+ children: e.customerLabel
68
+ }) : /* @__PURE__ */ p("span", { children: e.customerLabel });
69
+ }
70
+ function D({ rows: n, isLoading: l, isError: d, isAccessRestricted: h, sorting: g, onSortingChange: _, pageSize: b, onPageSizeChange: D, pageSizeOptions: O = x, pageInfo: k, hasNextPage: A, hasPrevPage: j, onNextPage: M, onPrevPage: N, statusCards: P, onStatusCardSelect: F, filterBar: I, isFiltering: L, headerStart: R, bankAttribution: z, onCreateClick: B, onSettingsClick: V, onRowClick: H, onRetry: U, labels: W }) {
71
+ let G = {
72
+ ...u,
73
+ ...W,
74
+ statusBadge: {
75
+ ...u.statusBadge,
76
+ ...W?.statusBadge
77
+ }
78
+ }, K = [
79
+ {
80
+ accessorKey: "dueDateLabel",
81
+ enableSorting: !0,
82
+ header: ({ column: e }) => /* @__PURE__ */ p(S, {
83
+ column: e,
84
+ label: G.columnDueDate,
85
+ ariaLabel: G.sortByDueDate
86
+ }),
87
+ cell: ({ row: e }) => /* @__PURE__ */ p(C, { row: e.original })
88
+ },
89
+ {
90
+ accessorKey: "status",
91
+ enableSorting: !0,
92
+ header: ({ column: e }) => /* @__PURE__ */ p(S, {
93
+ column: e,
94
+ label: G.columnStatus,
95
+ ariaLabel: G.sortByStatus
96
+ }),
97
+ cell: ({ row: e }) => /* @__PURE__ */ p(w, {
98
+ row: e.original,
99
+ statusBadgeLabels: G.statusBadge
100
+ })
101
+ },
102
+ {
103
+ accessorKey: "documentLabel",
104
+ enableSorting: !0,
105
+ header: ({ column: e }) => /* @__PURE__ */ p(S, {
106
+ column: e,
107
+ label: G.columnNumber,
108
+ ariaLabel: G.sortByNumber
109
+ }),
110
+ cell: ({ row: e }) => /* @__PURE__ */ p(T, { row: e.original })
111
+ },
112
+ {
113
+ accessorKey: "customerLabel",
114
+ header: G.columnCustomer,
115
+ cell: ({ row: e }) => /* @__PURE__ */ p(E, { row: e.original }),
116
+ minSize: 180
117
+ },
118
+ {
119
+ accessorKey: "issueDateLabel",
120
+ enableSorting: !0,
121
+ header: ({ column: e }) => /* @__PURE__ */ p(S, {
122
+ column: e,
123
+ label: G.columnIssueDate,
124
+ ariaLabel: G.sortByIssueDate
125
+ })
126
+ },
127
+ {
128
+ accessorKey: "totalLabel",
129
+ enableSorting: !0,
130
+ header: ({ column: e }) => /* @__PURE__ */ p("div", {
131
+ className: "ttw:flex ttw:justify-end",
132
+ children: /* @__PURE__ */ p(S, {
133
+ column: e,
134
+ label: G.columnAmount,
135
+ ariaLabel: G.sortByAmount
136
+ })
137
+ }),
138
+ cell: ({ row: e }) => /* @__PURE__ */ p("div", {
139
+ className: "ttw:text-right",
140
+ children: e.original.totalLabel
141
+ })
142
+ }
143
+ ];
144
+ return /* @__PURE__ */ m("div", {
145
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
146
+ children: [
147
+ /* @__PURE__ */ m("div", {
148
+ className: "ttw:flex ttw:justify-between ttw:gap-4",
149
+ children: [/* @__PURE__ */ m("div", {
150
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
151
+ children: [R, z && /* @__PURE__ */ m("div", {
152
+ className: "ttw:flex ttw:items-center ttw:gap-2",
153
+ children: [/* @__PURE__ */ p("span", {
154
+ className: "ttw:text-muted-foreground",
155
+ children: G.bankAttributionPrefix
156
+ }), /* @__PURE__ */ p("img", {
157
+ width: 120,
158
+ src: z.logoSrc,
159
+ alt: z.logoAlt
160
+ })]
161
+ })]
162
+ }), /* @__PURE__ */ m("div", {
163
+ className: "ttw:flex ttw:items-center ttw:gap-2",
164
+ children: [V && /* @__PURE__ */ p(a, { children: /* @__PURE__ */ m(r, { children: [/* @__PURE__ */ p(o, {
165
+ asChild: !0,
166
+ children: /* @__PURE__ */ p(e, {
167
+ type: "button",
168
+ variant: "outline",
169
+ size: "lg",
170
+ className: "ttw:w-11 ttw:rounded-xl",
171
+ "aria-label": G.settingsButton,
172
+ onClick: V,
173
+ children: /* @__PURE__ */ p(v, {
174
+ className: "ttw:size-4.5",
175
+ "aria-hidden": !0
176
+ })
177
+ })
178
+ }), /* @__PURE__ */ p(i, {
179
+ sideOffset: 4,
180
+ children: G.settingsButton
181
+ })] }) }), B && /* @__PURE__ */ p(e, {
182
+ size: "lg",
183
+ onClick: B,
184
+ children: G.createInvoiceButton
50
185
  })]
51
- }), /* @__PURE__ */ i("span", {
52
- 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",
53
- children: e.amountLabel
54
186
  })]
187
+ }),
188
+ !h && P && F && /* @__PURE__ */ p(f, {
189
+ view: P,
190
+ onSelect: F,
191
+ labels: { all: G.statusCardsAll }
192
+ }),
193
+ h ? /* @__PURE__ */ p(c, {
194
+ icon: /* @__PURE__ */ p(y, { className: "ttw:size-8 ttw:text-primary" }),
195
+ title: G.accessRestrictedTitle,
196
+ description: G.accessRestrictedDescription
197
+ }) : /* @__PURE__ */ p(t, {
198
+ columns: K,
199
+ data: n,
200
+ isLoading: l,
201
+ sorting: g,
202
+ onSortingChange: _,
203
+ pageSize: b,
204
+ onPageSizeChange: D,
205
+ pageSizeOptions: O,
206
+ pageInfo: k,
207
+ hasNextPage: A,
208
+ hasPrevPage: j,
209
+ onNextPage: M,
210
+ onPrevPage: N,
211
+ onRowClick: H,
212
+ rowAriaLabel: (e) => G.openRow(e.documentLabel),
213
+ filterComponent: I,
214
+ children: d && !L ? /* @__PURE__ */ p(c, {
215
+ title: G.errorTitle,
216
+ description: G.errorDescription,
217
+ retryLabel: U ? G.errorRetry : void 0,
218
+ onRetry: U
219
+ }) : /* @__PURE__ */ p(s, {
220
+ title: L ? G.filterEmptyTitle : G.emptyTitle,
221
+ description: L ? void 0 : G.emptyDescription,
222
+ actionLabel: L ? void 0 : G.createInvoiceButton,
223
+ onAction: L ? void 0 : B
224
+ })
55
225
  })
56
- }, e.value))]
226
+ ]
57
227
  });
58
228
  }
59
229
  //#endregion
60
- export { c as ReceivableStatusCards, c as default };
230
+ export { D as ReceivablesScreen, D as default };
@@ -1,229 +1,45 @@
1
- import { Button as e, DataTable as t, Skeleton as n, Tooltip as r, TooltipContent as i, TooltipProvider as a, TooltipTrigger as o } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { EmptyState as s } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
- import { ErrorState as c } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
4
- import "../../../shared/ui/dist/index.js";
5
- import { RECEIVABLES_SCREEN_LABELS_EN as l } from "./index14.js";
6
- import { ReceivableStatusBadge as u } from "./index25.js";
7
- import { SeriesStatusChip as d } from "./index38.js";
8
- import { ReceivableStatusCards as f } from "./index56.js";
9
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
10
- import { ArrowDownIcon as h, ArrowUpDownIcon as g, ArrowUpIcon as _, CogIcon as v, LockKeyholeIcon as y, RefreshCwIcon as b } from "lucide-react";
1
+ import { AlertDialog as e, AlertDialogContent as t, AlertDialogDescription as n, AlertDialogFooter as r, AlertDialogHeader as i, AlertDialogTitle as a, Button as o } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { UNSAVED_INVOICE_DIALOG_LABELS_EN as s } from "./index14.js";
3
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
4
+ import { XIcon as u } from "lucide-react";
11
5
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js
12
- var x = [
13
- 10,
14
- 25,
15
- 50,
16
- 100
17
- ];
18
- function S({ label: t, ariaLabel: n, column: r }) {
19
- let i = r.getIsSorted();
20
- return /* @__PURE__ */ m("div", {
21
- className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-inherit",
22
- children: [t, /* @__PURE__ */ p(e, {
23
- variant: "ghost",
24
- size: "icon-sm",
25
- "aria-label": n,
26
- onClick: () => r.toggleSorting(i === "asc"),
27
- children: p(i === "asc" ? _ : i === "desc" ? h : g, { className: "ttw:size-4" })
28
- })]
29
- });
30
- }
31
- function C({ row: e }) {
32
- return e.dueDateOverdueLabel ? /* @__PURE__ */ m("div", {
33
- className: "ttw:flex ttw:flex-col ttw:justify-center ttw:gap-1 ttw:text-destructive",
34
- children: [/* @__PURE__ */ p("span", {
35
- className: "ttw:text-sm ttw:leading-5",
36
- children: e.dueDateLabel
37
- }), /* @__PURE__ */ p("span", {
38
- className: "ttw:text-xs ttw:leading-4.5",
39
- children: e.dueDateOverdueLabel
40
- })]
41
- }) : e.dueDateLabel;
42
- }
43
- function w({ row: e, statusBadgeLabels: t }) {
44
- let r = e.statusOverride;
45
- return r ? r.kind === "loading" ? /* @__PURE__ */ p(n, { className: "ttw:h-4 ttw:w-full" }) : r.kind === "chip" ? /* @__PURE__ */ p(d, {
46
- label: r.label,
47
- tone: r.tone
48
- }) : null : /* @__PURE__ */ p(u, {
49
- status: e.status,
50
- variant: "filled",
51
- labels: t
52
- });
53
- }
54
- function T({ row: e }) {
55
- return e.showDocumentSyncIcon ? /* @__PURE__ */ m("span", {
56
- className: "ttw:flex ttw:items-center ttw:gap-1",
57
- children: [/* @__PURE__ */ p(b, {
58
- className: "ttw:size-[1em]",
59
- "aria-hidden": !0
60
- }), e.documentLabel]
61
- }) : e.documentLabel;
62
- }
63
- function E({ row: e }) {
64
- return e.customerState === "resolving" ? /* @__PURE__ */ p(n, { className: "ttw:h-4 ttw:w-full" }) : e.customerState === "missing" ? /* @__PURE__ */ p("span", {
65
- className: "ttw:opacity-40",
66
- children: e.customerLabel
67
- }) : /* @__PURE__ */ p("span", { children: e.customerLabel });
68
- }
69
- function D({ rows: n, isLoading: u, isError: d, isAccessRestricted: h, sorting: g, onSortingChange: _, pageSize: b, onPageSizeChange: D, pageSizeOptions: O = x, pageInfo: k, hasNextPage: A, hasPrevPage: j, onNextPage: M, onPrevPage: N, statusCards: P, onStatusCardSelect: F, filterBar: I, isFiltering: L, headerStart: R, bankAttribution: z, onCreateClick: B, onSettingsClick: V, onRowClick: H, onRetry: U, labels: W }) {
70
- let G = {
71
- ...l,
72
- ...W,
73
- statusBadge: {
74
- ...l.statusBadge,
75
- ...W?.statusBadge
76
- }
77
- }, K = [
78
- {
79
- accessorKey: "dueDateLabel",
80
- enableSorting: !0,
81
- header: ({ column: e }) => /* @__PURE__ */ p(S, {
82
- column: e,
83
- label: G.columnDueDate,
84
- ariaLabel: G.sortByDueDate
85
- }),
86
- cell: ({ row: e }) => /* @__PURE__ */ p(C, { row: e.original })
6
+ function d({ open: d, onSaveDraft: f, onDiscard: p, onCancel: m, isSaving: h, isSaveDraftDisabled: g, labels: _ }) {
7
+ let v = {
8
+ ...s,
9
+ ..._
10
+ };
11
+ return /* @__PURE__ */ c(e, {
12
+ open: d,
13
+ onOpenChange: (e) => {
14
+ !e && !h && m();
87
15
  },
88
- {
89
- accessorKey: "status",
90
- enableSorting: !0,
91
- header: ({ column: e }) => /* @__PURE__ */ p(S, {
92
- column: e,
93
- label: G.columnStatus,
94
- ariaLabel: G.sortByStatus
95
- }),
96
- cell: ({ row: e }) => /* @__PURE__ */ p(w, {
97
- row: e.original,
98
- statusBadgeLabels: G.statusBadge
99
- })
100
- },
101
- {
102
- accessorKey: "documentLabel",
103
- enableSorting: !0,
104
- header: ({ column: e }) => /* @__PURE__ */ p(S, {
105
- column: e,
106
- label: G.columnNumber,
107
- ariaLabel: G.sortByNumber
108
- }),
109
- cell: ({ row: e }) => /* @__PURE__ */ p(T, { row: e.original })
110
- },
111
- {
112
- accessorKey: "customerLabel",
113
- header: G.columnCustomer,
114
- cell: ({ row: e }) => /* @__PURE__ */ p(E, { row: e.original }),
115
- minSize: 180
116
- },
117
- {
118
- accessorKey: "issueDateLabel",
119
- enableSorting: !0,
120
- header: ({ column: e }) => /* @__PURE__ */ p(S, {
121
- column: e,
122
- label: G.columnIssueDate,
123
- ariaLabel: G.sortByIssueDate
124
- })
125
- },
126
- {
127
- accessorKey: "totalLabel",
128
- enableSorting: !0,
129
- header: ({ column: e }) => /* @__PURE__ */ p("div", {
130
- className: "ttw:flex ttw:justify-end",
131
- children: /* @__PURE__ */ p(S, {
132
- column: e,
133
- label: G.columnAmount,
134
- ariaLabel: G.sortByAmount
135
- })
136
- }),
137
- cell: ({ row: e }) => /* @__PURE__ */ p("div", {
138
- className: "ttw:text-right",
139
- children: e.original.totalLabel
140
- })
141
- }
142
- ];
143
- return /* @__PURE__ */ m("div", {
144
- className: "ttw:flex ttw:flex-col ttw:gap-4",
145
- children: [
146
- /* @__PURE__ */ m("div", {
147
- className: "ttw:flex ttw:justify-between ttw:gap-4",
148
- children: [/* @__PURE__ */ m("div", {
149
- className: "ttw:flex ttw:flex-col ttw:gap-2",
150
- children: [R, z && /* @__PURE__ */ m("div", {
151
- className: "ttw:flex ttw:items-center ttw:gap-2",
152
- children: [/* @__PURE__ */ p("span", {
153
- className: "ttw:text-muted-foreground",
154
- children: G.bankAttributionPrefix
155
- }), /* @__PURE__ */ p("img", {
156
- width: 120,
157
- src: z.logoSrc,
158
- alt: z.logoAlt
159
- })]
160
- })]
161
- }), /* @__PURE__ */ m("div", {
162
- className: "ttw:flex ttw:items-center ttw:gap-2",
163
- children: [V && /* @__PURE__ */ p(a, { children: /* @__PURE__ */ m(r, { children: [/* @__PURE__ */ p(o, {
164
- asChild: !0,
165
- children: /* @__PURE__ */ p(e, {
166
- type: "button",
167
- variant: "outline",
168
- size: "lg",
169
- className: "ttw:w-11 ttw:rounded-xl",
170
- "aria-label": G.settingsButton,
171
- onClick: V,
172
- children: /* @__PURE__ */ p(v, {
173
- className: "ttw:size-4.5",
174
- "aria-hidden": !0
175
- })
176
- })
177
- }), /* @__PURE__ */ p(i, {
178
- sideOffset: 4,
179
- children: G.settingsButton
180
- })] }) }), B && /* @__PURE__ */ p(e, {
181
- size: "lg",
182
- onClick: B,
183
- children: G.createInvoiceButton
184
- })]
16
+ children: /* @__PURE__ */ l(t, { children: [
17
+ /* @__PURE__ */ l("button", {
18
+ type: "button",
19
+ onClick: m,
20
+ disabled: h,
21
+ className: "ttw:absolute ttw:right-4 ttw:top-4 ttw:cursor-pointer ttw:rounded-sm ttw:opacity-70 ttw:ring-offset-background ttw:transition-opacity ttw:hover:opacity-100 ttw:focus:outline-hidden ttw:focus:ring-2 ttw:focus:ring-ring ttw:focus:ring-offset-2 ttw:disabled:pointer-events-none",
22
+ children: [/* @__PURE__ */ c(u, { className: "ttw:size-4" }), /* @__PURE__ */ c("span", {
23
+ className: "ttw:sr-only",
24
+ children: v.unsavedCloseButton
185
25
  })]
186
26
  }),
187
- !h && P && F && /* @__PURE__ */ p(f, {
188
- view: P,
189
- onSelect: F,
190
- labels: { all: G.statusCardsAll }
191
- }),
192
- h ? /* @__PURE__ */ p(c, {
193
- icon: /* @__PURE__ */ p(y, { className: "ttw:size-8 ttw:text-primary" }),
194
- title: G.accessRestrictedTitle,
195
- description: G.accessRestrictedDescription
196
- }) : /* @__PURE__ */ p(t, {
197
- columns: K,
198
- data: n,
199
- isLoading: u,
200
- sorting: g,
201
- onSortingChange: _,
202
- pageSize: b,
203
- onPageSizeChange: D,
204
- pageSizeOptions: O,
205
- pageInfo: k,
206
- hasNextPage: A,
207
- hasPrevPage: j,
208
- onNextPage: M,
209
- onPrevPage: N,
210
- onRowClick: H,
211
- rowAriaLabel: (e) => G.openRow(e.documentLabel),
212
- filterComponent: I,
213
- children: d && !L ? /* @__PURE__ */ p(c, {
214
- title: G.errorTitle,
215
- description: G.errorDescription,
216
- retryLabel: U ? G.errorRetry : void 0,
217
- onRetry: U
218
- }) : /* @__PURE__ */ p(s, {
219
- title: L ? G.filterEmptyTitle : G.emptyTitle,
220
- description: L ? void 0 : G.emptyDescription,
221
- actionLabel: L ? void 0 : G.createInvoiceButton,
222
- onAction: L ? void 0 : B
223
- })
224
- })
225
- ]
27
+ /* @__PURE__ */ l(i, { children: [/* @__PURE__ */ c(a, { children: v.unsavedTitle }), /* @__PURE__ */ c(n, { children: v.unsavedDescription })] }),
28
+ /* @__PURE__ */ l(r, { children: [/* @__PURE__ */ c(o, {
29
+ type: "button",
30
+ variant: "outline",
31
+ onClick: p,
32
+ disabled: h,
33
+ children: v.unsavedDiscardButton
34
+ }), /* @__PURE__ */ c(o, {
35
+ type: "button",
36
+ loading: h,
37
+ disabled: h || g,
38
+ onClick: f,
39
+ children: v.unsavedSaveDraftButton
40
+ })] })
41
+ ] })
226
42
  });
227
43
  }
228
44
  //#endregion
229
- export { D as ReceivablesScreen, D as default };
45
+ export { d as UnsavedInvoiceDialog, d as default };
@@ -0,0 +1,8 @@
1
+ import { BILL_STATUS_BADGE_LABELS_EN as e } from "./index2.js";
2
+ import { BILL_STATUS_TONE_CLASS_NAME as t } from "./index3.js";
3
+ import { BillStatusBadge as n } from "./index4.js";
4
+ import "./index5.js";
5
+ import { RECEIVABLE_STATUS_BADGE_LABELS_EN as r } from "./index6.js";
6
+ import { ReceivableStatusBadge as i } from "./index7.js";
7
+ import "./index8.js";
8
+ export { e as BILL_STATUS_BADGE_LABELS_EN, t as BILL_STATUS_TONE_CLASS_NAME, n as BillStatusBadge, r as RECEIVABLE_STATUS_BADGE_LABELS_EN, i as ReceivableStatusBadge };
@@ -0,0 +1,14 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index2.js
2
+ var e = {
3
+ draft: "Draft",
4
+ ready_to_submit: "Ready to submit",
5
+ pending_approval: "Pending review",
6
+ ready_to_pay: "Ready to pay",
7
+ scheduled: "Scheduled",
8
+ paid: "Paid",
9
+ canceled: "Cancelled",
10
+ rejected: "Rejected",
11
+ unknown: "Unknown"
12
+ };
13
+ //#endregion
14
+ export { e as BILL_STATUS_BADGE_LABELS_EN };
@@ -0,0 +1,13 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index3.js
2
+ var e = {
3
+ accent: "ttw:border-violet-100 ttw:bg-violet-100 ttw:text-violet-700 ttw:hover:bg-violet-100",
4
+ committed: "ttw:border-cyan-200 ttw:bg-cyan-50 ttw:text-cyan-700 ttw:hover:bg-cyan-50",
5
+ danger: "ttw:border-destructive/20 ttw:bg-destructive/20 ttw:text-destructive ttw:hover:bg-destructive/20",
6
+ info: "ttw:border-blue-100 ttw:bg-blue-100 ttw:text-blue-700 ttw:hover:bg-blue-100",
7
+ neutral: "ttw:border-border ttw:bg-muted ttw:text-foreground ttw:hover:bg-muted",
8
+ settled: "ttw:border-border ttw:bg-background ttw:text-green-900 ttw:hover:bg-background",
9
+ success: "ttw:border-green-100 ttw:bg-green-100 ttw:text-green-700 ttw:hover:bg-green-100",
10
+ warning: "ttw:border-amber-100 ttw:bg-amber-100 ttw:text-amber-700 ttw:hover:bg-amber-100"
11
+ };
12
+ //#endregion
13
+ export { e as BILL_STATUS_TONE_CLASS_NAME };
@@ -0,0 +1,18 @@
1
+ import { Badge as e, cn as t } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { BILL_STATUS_BADGE_LABELS_EN as n } from "./index2.js";
3
+ import { BILL_STATUS_TONE_CLASS_NAME as r } from "./index3.js";
4
+ import { jsxs as i } from "react/jsx-runtime";
5
+ //#region ../../libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index4.js
6
+ function a({ status: a, label: o, tone: s, labels: c, icon: l }) {
7
+ let u = {
8
+ ...n,
9
+ ...c
10
+ }, d = o ?? (a ? u[a] : u.unknown);
11
+ return /* @__PURE__ */ i(e, {
12
+ variant: "outline",
13
+ className: t(l && "ttw:gap-1", r[s]),
14
+ children: [l, d]
15
+ });
16
+ }
17
+ //#endregion
18
+ export { a as BillStatusBadge, a as default };
@@ -0,0 +1,2 @@
1
+ import "./index2.js";
2
+ import "./index4.js";
@@ -0,0 +1,20 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index6.js
2
+ var e = {
3
+ draft: "Draft",
4
+ issuing: "Issuing",
5
+ issued: "Issued",
6
+ failed: "Failed",
7
+ accepted: "Accepted",
8
+ expired: "Expired",
9
+ declined: "Declined",
10
+ recurring: "Recurring",
11
+ partially_paid: "Partially paid",
12
+ paid: "Paid",
13
+ overdue: "Overdue",
14
+ uncollectible: "Uncollectible",
15
+ canceled: "Canceled",
16
+ deleted: "Deleted",
17
+ unknown: "Unknown"
18
+ };
19
+ //#endregion
20
+ export { e as RECEIVABLE_STATUS_BADGE_LABELS_EN };