@tesouro/embedded-components-react 0.7.45 → 0.7.47

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 (106) hide show
  1. package/dist/index.d.ts +33 -39
  2. package/dist/lib/CounterpartsWidget.d.ts +33 -22
  3. package/dist/lib/CounterpartsWidgetPublic.d.ts +33 -22
  4. package/dist/lib/CustomersWidget.d.ts +31 -22
  5. package/dist/lib/ReceivablesWidget.d.ts +3 -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/index31.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +40 -42
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +1 -3
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +9 -9
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +30 -30
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +3 -2
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +7 -6
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +3 -2
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +9 -8
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +5 -4
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index48.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index49.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +3 -2
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +40 -40
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +3 -2
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +1 -1
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +8 -7
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +9 -13
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +7 -10
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +76 -11
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +1 -1
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +27 -9
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +2 -76
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +30 -0
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +1 -1
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +5 -27
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +32 -2
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +2 -30
  39. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +73 -77
  40. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +9 -26
  41. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +44 -44
  42. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +197 -208
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +9 -9
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/auditHistory/labels.js +2 -2
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +2 -2
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +22 -23
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +10 -24
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +53 -37
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +21 -53
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +8 -21
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +77 -8
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +31 -69
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +17 -38
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +40 -17
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +26 -38
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +18 -27
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +8 -18
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +35 -9
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +14 -36
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +26 -14
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +84 -23
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +487 -80
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +2 -494
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +48 -2
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +62 -38
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +438 -61
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +207 -431
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +20 -222
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +6 -21
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +265 -0
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +2 -265
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +131 -2
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +22 -125
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +235 -23
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +3 -240
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +249 -3
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +54 -242
  79. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +221 -51
  80. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +38 -222
  81. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +13 -13
  82. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +1 -1
  83. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +85 -84
  84. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +238 -241
  85. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +2 -0
  86. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +6 -5
  87. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index5.js +2 -0
  88. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index.js +8 -0
  89. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index2.js +14 -0
  90. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index3.js +13 -0
  91. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index4.js +18 -0
  92. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index5.js +2 -0
  93. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index6.js +20 -0
  94. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index7.js +32 -0
  95. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index8.js +2 -0
  96. package/dist/libs/tesouro-embedded-components-react/{bill-pay-widget → shared/document-status}/util/dist/lib/derivePayableStatus.js +23 -10
  97. package/dist/libs/tesouro-embedded-components-react/shared/document-status/util/dist/lib/receivableFilledTone.js +22 -0
  98. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  99. package/package.json +1 -1
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +0 -18
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +0 -2
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +0 -7
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +0 -34
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +0 -2
  105. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +0 -8
  106. 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 };
@@ -353,21 +353,21 @@ function Y(e) {
353
353
  function X(e) {
354
354
  return /^[\d\s-]+$/.test(e) && e.replace(/\D/g, "").length === 9;
355
355
  }
356
- function Z(e, t, n = i, r = "customer", a = !1) {
357
- let o = {};
358
- e.entityType === "organization" ? e.legalName.trim().length === 0 && (o.legalName = n.legalNameRequired) : (e.firstName.trim().length === 0 && (o.firstName = n.firstNameRequired), e.lastName.trim().length === 0 && (o.lastName = n.lastNameRequired)), e.email.trim().length === 0 ? o.email = n.emailRequired : W(e.email.trim()) || (o.email = n.emailInvalid);
359
- let s = e.phone.trim();
360
- s && !Y(s) && (o.phone = n.phoneInvalid);
361
- let c = e.taxId.trim();
362
- if (c && !X(c) && (o.taxId = n.taxIdInvalid), t === "create" && r === "vendor" || k(e.address)) {
363
- let t = G(e.address, n);
364
- K(t) && (o.address = t);
356
+ function Z(e, t = i, n = "customer", r = !1) {
357
+ let a = {};
358
+ e.entityType === "organization" ? e.legalName.trim().length === 0 && (a.legalName = t.legalNameRequired) : (e.firstName.trim().length === 0 && (a.firstName = t.firstNameRequired), e.lastName.trim().length === 0 && (a.lastName = t.lastNameRequired)), e.email.trim().length === 0 ? a.email = t.emailRequired : W(e.email.trim()) || (a.email = t.emailInvalid);
359
+ let o = e.phone.trim();
360
+ o && !Y(o) && (a.phone = t.phoneInvalid);
361
+ let s = e.taxId.trim();
362
+ if (s && !X(s) && (a.taxId = t.taxIdInvalid), n === "vendor" || k(e.address)) {
363
+ let n = G(e.address, t);
364
+ K(n) && (a.address = n);
365
365
  }
366
- if (r === "vendor" && (a || I(e))) {
367
- let t = J(e.bankAccount, n);
368
- K(t) && (o.bankAccount = t);
366
+ if (n === "vendor" && (r || I(e))) {
367
+ let n = J(e.bankAccount, t);
368
+ K(n) && (a.bankAccount = n);
369
369
  }
370
- return o;
370
+ return a;
371
371
  }
372
372
  function Q(e, t, n) {
373
373
  if (!n) return e;
@@ -10,7 +10,7 @@ var e = {
10
10
  addressLine1Required: "Address line 1 is required",
11
11
  cityRequired: "City is required",
12
12
  stateRequired: "State is required",
13
- postalCodeRequired: "ZIP code is required",
13
+ postalCodeRequired: "Postal code is required",
14
14
  accountHolderNameRequired: "Account holder name is required",
15
15
  routingNumberInvalid: "Enter a valid 9-digit ABA routing number",
16
16
  accountNumberInvalid: "Enter a valid account number",