@tesouro/embedded-components-react 0.11.122 → 0.11.124

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 (88) hide show
  1. package/README.md +6 -3
  2. package/dist/index.css +0 -10
  3. package/dist/index.d.ts +33 -6
  4. package/dist/index.js +15 -14
  5. package/dist/lib/ReceivablesWidget.d.ts +29 -6
  6. package/dist/lib/ReceivablesWidget.js +3 -1
  7. package/dist/lib/WidgetSuite.d.ts +31 -4
  8. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/BalanceHistoryWidget/BalanceHistoryWidgetFeature.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/BalanceHistoryWidget/labels.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/ui/dist/index.js +2 -2
  11. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/ui/dist/{index4.js → lib/BalanceHistoryCard/BalanceHistoryCard.js} +9 -9
  12. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/ui/dist/{index2.js → lib/BalanceHistoryCard/BalanceHistoryChart.js} +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/ui/dist/{index3.js → lib/BalanceHistoryCard/labels.js} +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +3 -1
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableAttachmentsSection.js +1 -1
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableCustomerSection.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +342 -295
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentTerms.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/preview.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/reminders.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/tabs.js +26 -0
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +1 -1
  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/mocks/labels.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +30 -26
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +18 -2
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +121 -11
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +100 -11
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +39 -27
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +2 -205
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +11 -52
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +11 -210
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +27 -159
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +203 -14
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +51 -22
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +210 -2
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +154 -111
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +15 -3
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +21 -195
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +3 -2
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +116 -53
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +3 -22
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +197 -8
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +2 -78
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +53 -39
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +20 -17
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +8 -41
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +73 -25
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +36 -17
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +17 -9
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +39 -34
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +29 -14
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +18 -24
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +8 -85
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +33 -490
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +15 -2
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +22 -42
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +82 -65
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +475 -426
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +2 -226
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +46 -21
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +69 -5
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +445 -0
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +208 -246
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +22 -2
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +5 -129
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +247 -222
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +1 -2
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +125 -242
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +23 -56
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +229 -209
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +3 -47
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +248 -0
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js +60 -0
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +2 -17
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +194 -0
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js +47 -0
  79. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +53 -117
  80. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +9 -99
  81. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +3 -40
  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/widget-suite/feature/dist/lib/WidgetSuite/WidgetSuiteProvider.js +30 -39
  84. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/sections/AccountsSection.js +2 -5
  85. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/sections/DashboardSection.js +18 -31
  86. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/mocks/widgetSuite.js +31 -34
  87. package/package.json +1 -1
  88. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +0 -27
@@ -0,0 +1,248 @@
1
+ import { Button as e, Input as t, Label as n, RadioGroup as r, RadioGroupItem as i, Switch as a, Typography as o } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_FORM_DIALOG_LABELS_EN as s } from "./index18.js";
3
+ import { Fragment as c } from "react";
4
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
5
+ import { PlusIcon as f } from "lucide-react";
6
+ // ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js
7
+ function p(e) {
8
+ e.key === "Enter" && e.preventDefault();
9
+ }
10
+ var m = "ttw:border ttw:border-border ttw:rounded-lg ttw:min-h-28 ttw:p-2.5 ttw:flex ttw:w-full ttw:flex-col ttw:gap-4 ttw:xl:w-1/2";
11
+ function h({ id: e, value: t, label: r }) {
12
+ return /* @__PURE__ */ d("li", {
13
+ className: "ttw:flex ttw:items-center ttw:gap-2",
14
+ children: [/* @__PURE__ */ u(i, {
15
+ value: t,
16
+ id: e
17
+ }), /* @__PURE__ */ u(n, {
18
+ htmlFor: e,
19
+ className: "ttw:text-sm ttw:font-normal ttw:leading-snug",
20
+ children: r
21
+ })]
22
+ });
23
+ }
24
+ function g({ idPrefix: e, options: t, selectedId: n, noneLabel: i, onSelect: a }) {
25
+ return /* @__PURE__ */ u(r, {
26
+ className: "ttw:contents",
27
+ value: n,
28
+ onValueChange: a,
29
+ children: /* @__PURE__ */ d("ul", {
30
+ className: "ttw:flex ttw:flex-col ttw:gap-3",
31
+ children: [/* @__PURE__ */ u(h, {
32
+ id: `${e}-none`,
33
+ value: "",
34
+ label: i
35
+ }), t.map((t) => /* @__PURE__ */ u(h, {
36
+ id: `${e}-${t.value}`,
37
+ value: t.value,
38
+ label: t.label
39
+ }, t.value))]
40
+ })
41
+ });
42
+ }
43
+ function _({ direction: e, directionClassName: t, labels: n }) {
44
+ return /* @__PURE__ */ d(o, {
45
+ variant: "body2",
46
+ children: [
47
+ n.reminderNumberOfDays,
48
+ " ",
49
+ /* @__PURE__ */ u("span", {
50
+ className: t,
51
+ children: e
52
+ }),
53
+ " ",
54
+ n.reminderDueDate
55
+ ]
56
+ });
57
+ }
58
+ function v({ idPrefix: n, view: r, labels: i, onSelect: a, onInputChange: s, onSave: c }) {
59
+ let { create: l } = r, f = `${n}-error`;
60
+ return /* @__PURE__ */ d("div", {
61
+ className: m,
62
+ children: [
63
+ /* @__PURE__ */ u(_, {
64
+ direction: i.reminderBefore,
65
+ directionClassName: "ttw:text-green-700 ttw:font-bold",
66
+ labels: i
67
+ }),
68
+ /* @__PURE__ */ u(g, {
69
+ idPrefix: `${n}-option`,
70
+ options: r.options,
71
+ selectedId: r.selectedId,
72
+ noneLabel: i.reminderNone,
73
+ onSelect: a
74
+ }),
75
+ l && /* @__PURE__ */ d("div", {
76
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5",
77
+ children: [
78
+ l.caption && /* @__PURE__ */ u(o, {
79
+ variant: "caption",
80
+ color: "muted",
81
+ children: l.caption
82
+ }),
83
+ /* @__PURE__ */ d("div", {
84
+ className: "ttw:flex ttw:items-center ttw:gap-2.5",
85
+ children: [
86
+ /* @__PURE__ */ u(t, {
87
+ type: "text",
88
+ inputMode: "numeric",
89
+ value: l.value,
90
+ onChange: (e) => s(e.target.value),
91
+ onKeyDown: p,
92
+ disabled: l.inputDisabled,
93
+ className: "ttw:text-right ttw:w-full ttw:p-1.5 ttw:max-w-56",
94
+ placeholder: i.reminderPlaceholder,
95
+ "aria-label": i.reminderBeforeDueInputLabel,
96
+ "aria-invalid": !!l.error,
97
+ "aria-describedby": l.error ? f : void 0
98
+ }),
99
+ /* @__PURE__ */ u(o, {
100
+ variant: "body2",
101
+ children: l.unitLabel
102
+ }),
103
+ /* @__PURE__ */ u(e, {
104
+ type: "button",
105
+ variant: "secondary",
106
+ className: "ttw:hover:brightness-95 ttw:text-secondary-foreground ttw:text-xs",
107
+ disabled: l.saveDisabled,
108
+ loading: l.isSaving,
109
+ onClick: c,
110
+ children: i.reminderSaveButton
111
+ })
112
+ ]
113
+ }),
114
+ l.error && /* @__PURE__ */ u(o, {
115
+ id: f,
116
+ variant: "caption",
117
+ color: "destructive",
118
+ children: l.error
119
+ })
120
+ ]
121
+ }),
122
+ r.warning && /* @__PURE__ */ u(o, {
123
+ variant: "body2",
124
+ className: "ttw:text-amber-700",
125
+ children: r.warning
126
+ })
127
+ ]
128
+ });
129
+ }
130
+ function y({ idPrefix: n, view: r, labels: i, onSelect: a, onTermChange: s, onAddTerm: l, onClear: h, onSave: v }) {
131
+ let { create: y } = r;
132
+ return /* @__PURE__ */ d("div", {
133
+ className: m,
134
+ children: [
135
+ /* @__PURE__ */ u(_, {
136
+ direction: i.reminderAfter,
137
+ directionClassName: "ttw:text-destructive ttw:font-bold",
138
+ labels: i
139
+ }),
140
+ /* @__PURE__ */ u(g, {
141
+ idPrefix: `${n}-option`,
142
+ options: r.options,
143
+ selectedId: r.selectedId,
144
+ noneLabel: i.reminderNone,
145
+ onSelect: a
146
+ }),
147
+ y && /* @__PURE__ */ d("div", {
148
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5",
149
+ children: [
150
+ /* @__PURE__ */ u(o, {
151
+ variant: "caption",
152
+ color: "muted",
153
+ children: y.caption
154
+ }),
155
+ /* @__PURE__ */ d("div", {
156
+ className: "ttw:flex ttw:items-center ttw:gap-2.5",
157
+ children: [y.terms.map((e, n) => /* @__PURE__ */ d(c, { children: [/* @__PURE__ */ u(t, {
158
+ type: "text",
159
+ inputMode: "numeric",
160
+ value: e.value,
161
+ onChange: (e) => s(n, e.target.value),
162
+ onKeyDown: p,
163
+ disabled: y.inputsDisabled,
164
+ className: "ttw:text-right ttw:w-15 ttw:p-1.5",
165
+ placeholder: e.showPlaceholder ? i.reminderPlaceholder : void 0,
166
+ "aria-label": e.ariaLabel
167
+ }), /* @__PURE__ */ u(o, {
168
+ variant: "body2",
169
+ children: e.unitLabel
170
+ })] }, n)), y.showAddTerm && /* @__PURE__ */ d(e, {
171
+ type: "button",
172
+ variant: "ghost",
173
+ className: "ttw:text-xs ttw:text-primary ttw:hover:text-primary",
174
+ disabled: y.addTermDisabled,
175
+ onClick: l,
176
+ children: [/* @__PURE__ */ u(f, {}), i.reminderAddTermButton]
177
+ })]
178
+ }),
179
+ /* @__PURE__ */ d("div", {
180
+ className: "ttw:flex ttw:items-center ttw:gap-2.5",
181
+ children: [/* @__PURE__ */ u(e, {
182
+ type: "button",
183
+ variant: "ghost",
184
+ className: "ttw:text-xs",
185
+ disabled: y.clearDisabled,
186
+ onClick: h,
187
+ children: i.reminderClearButton
188
+ }), /* @__PURE__ */ u(e, {
189
+ type: "button",
190
+ variant: "secondary",
191
+ className: "ttw:hover:brightness-95 ttw:text-secondary-foreground ttw:text-xs",
192
+ disabled: y.saveDisabled,
193
+ loading: y.isSaving,
194
+ onClick: v,
195
+ children: i.reminderSaveButton
196
+ })]
197
+ })
198
+ ]
199
+ })
200
+ ]
201
+ });
202
+ }
203
+ function b({ idPrefix: e, view: t, onToggle: n, onPaymentReminderSelect: r, onOverdueReminderSelect: i, onBeforeDueInputChange: c, onBeforeDueSave: f, onOverdueTermChange: p, onOverdueAddTerm: m, onOverdueClear: h, onOverdueSave: g, labels: _ }) {
204
+ let b = {
205
+ ...s,
206
+ ..._
207
+ }, { cards: x } = t;
208
+ return /* @__PURE__ */ d("section", {
209
+ className: "ttw:flex ttw:flex-col ttw:gap-6",
210
+ children: [/* @__PURE__ */ d("div", {
211
+ className: "ttw:flex ttw:items-center ttw:gap-3",
212
+ children: [/* @__PURE__ */ u(a, {
213
+ checked: t.checked,
214
+ disabled: t.toggleDisabled,
215
+ onCheckedChange: n,
216
+ "aria-label": b.remindersToggleLabel
217
+ }), /* @__PURE__ */ u(o, {
218
+ variant: "body2",
219
+ children: b.remindersDescription
220
+ })]
221
+ }), x && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("div", {
222
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:w-full ttw:xl:flex-row",
223
+ children: [x.beforeDue && /* @__PURE__ */ u(v, {
224
+ idPrefix: `${e}-before`,
225
+ view: x.beforeDue,
226
+ labels: b,
227
+ onSelect: r,
228
+ onInputChange: c,
229
+ onSave: f
230
+ }), /* @__PURE__ */ u(y, {
231
+ idPrefix: `${e}-overdue`,
232
+ view: x.overdue,
233
+ labels: b,
234
+ onSelect: i,
235
+ onTermChange: p,
236
+ onAddTerm: m,
237
+ onClear: h,
238
+ onSave: g
239
+ })]
240
+ }), /* @__PURE__ */ u(o, {
241
+ variant: "body2",
242
+ color: "muted",
243
+ className: "ttw:font-medium",
244
+ children: b.remindersLibraryNote
245
+ })] })]
246
+ });
247
+ }
248
+ export { b as ReceivableRemindersSection };
@@ -0,0 +1,60 @@
1
+ import { Skeleton as e, cn as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { ReceivableStatusBadge as n } from "../../../shared/document-status/ui/dist/index7.js";
3
+ import "../../../shared/document-status/ui/dist/index.js";
4
+ import { RECEIVABLE_STATUS_CARDS_LABELS_EN as r } from "./index18.js";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ // ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js
7
+ var o = 6;
8
+ function s({ selected: e, onClick: n, children: r }) {
9
+ return /* @__PURE__ */ i("button", {
10
+ type: "button",
11
+ "aria-pressed": e,
12
+ onClick: n,
13
+ 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"),
14
+ children: r
15
+ });
16
+ }
17
+ function c({ view: t, onSelect: c, labels: l }) {
18
+ let u = {
19
+ ...r,
20
+ ...l
21
+ };
22
+ return t.kind === "loading" ? /* @__PURE__ */ i("div", {
23
+ className: "ttw:flex ttw:gap-2",
24
+ children: Array.from({ length: o }).map((t, n) => /* @__PURE__ */ i(e, { className: "ttw:h-16.5 ttw:w-42 ttw:rounded-xl" }, n))
25
+ }) : /* @__PURE__ */ a("div", {
26
+ className: "ttw:mb-2 ttw:flex ttw:gap-2 ttw:overflow-x-auto ttw:[scrollbar-width:none] ttw:[&::-webkit-scrollbar]:hidden",
27
+ children: [/* @__PURE__ */ a(s, {
28
+ selected: t.all.selected,
29
+ onClick: () => c(t.all.value),
30
+ children: [/* @__PURE__ */ i("span", {
31
+ className: "ttw:text-xs ttw:font-medium ttw:text-foreground",
32
+ children: u.all
33
+ }), /* @__PURE__ */ i("span", {
34
+ className: "ttw:text-2xl ttw:font-medium ttw:leading-8 ttw:tabular-nums ttw:text-foreground",
35
+ children: t.all.countLabel
36
+ })]
37
+ }), t.statuses.map((e) => /* @__PURE__ */ i(s, {
38
+ selected: e.selected,
39
+ onClick: () => c(e.value),
40
+ children: /* @__PURE__ */ a("div", {
41
+ className: "ttw:flex ttw:flex-col",
42
+ children: [/* @__PURE__ */ a("div", {
43
+ className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-2",
44
+ children: [/* @__PURE__ */ i(n, {
45
+ label: e.statusLabel,
46
+ status: e.value,
47
+ variant: "filled"
48
+ }), /* @__PURE__ */ i("span", {
49
+ className: "ttw:text-xs ttw:font-medium ttw:leading-4.5 ttw:tabular-nums ttw:text-foreground",
50
+ children: e.countLabel
51
+ })]
52
+ }), /* @__PURE__ */ i("span", {
53
+ 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",
54
+ children: e.amountLabel
55
+ })]
56
+ })
57
+ }, e.value))]
58
+ });
59
+ }
60
+ export { c as ReceivableStatusCards, c as default };
@@ -1,18 +1,3 @@
1
1
  // ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js
2
- var e = {
3
- issueDescription: "The customer will be emailed a copy of the invoice with payment instructions.",
4
- toLabel: "To",
5
- subjectLabel: "Subject",
6
- messageLabel: "Message",
7
- messagePlaceholder: "e.g., Thank you for your business",
8
- attachmentsLabel: "Attachments",
9
- attachmentsCaption: "To change what files are attached to the email, you will need to update the invoice.",
10
- skipButton: "Skip",
11
- sendButton: "Send invoice",
12
- productsQuestion: "Do you want to also save these items?",
13
- productsCaption: "Saved items can be quickly added to future invoices.",
14
- productsAllLabel: "Products and services",
15
- saveItemsButton: "Save selected items",
16
- close: "Close"
17
- };
18
- export { e as RECEIVABLE_ACTIONS_MODAL_LABELS_EN };
2
+ var e = { settingsButton: "Invoice settings" };
3
+ export { e as INVOICING_TABS_LABELS_EN };
@@ -0,0 +1,194 @@
1
+ import { Button as e, DataTable as t, Skeleton as n } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { EmptyState as r } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
+ import { ErrorState as i } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
4
+ import "../../../shared/ui/dist/index.js";
5
+ import { ReceivableStatusBadge as a } from "../../../shared/document-status/ui/dist/index7.js";
6
+ import "../../../shared/document-status/ui/dist/index.js";
7
+ import { TabRowAction as o } from "./index8.js";
8
+ import { RECEIVABLES_SCREEN_LABELS_EN as s } from "./index18.js";
9
+ import { SeriesStatusChip as c } from "./index41.js";
10
+ import { ReceivableStatusCards as l } from "./index59.js";
11
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
12
+ import { ArrowDownIcon as f, ArrowUpDownIcon as p, ArrowUpIcon as m, LockKeyholeIcon as h, RefreshCwIcon as g } from "lucide-react";
13
+ // ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js
14
+ var _ = [
15
+ 10,
16
+ 25,
17
+ 50,
18
+ 100
19
+ ];
20
+ function v({ label: t, ariaLabel: n, column: r }) {
21
+ let i = r.getIsSorted();
22
+ return /* @__PURE__ */ d("div", {
23
+ className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-inherit",
24
+ children: [t, /* @__PURE__ */ u(e, {
25
+ variant: "ghost",
26
+ size: "icon-sm",
27
+ "aria-label": n,
28
+ onClick: () => r.toggleSorting(i === "asc"),
29
+ children: u(i === "asc" ? m : i === "desc" ? f : p, { className: "ttw:size-4" })
30
+ })]
31
+ });
32
+ }
33
+ function y({ row: e }) {
34
+ return e.dueDateOverdueLabel ? /* @__PURE__ */ d("div", {
35
+ className: "ttw:flex ttw:flex-col ttw:justify-center ttw:gap-1 ttw:text-destructive",
36
+ children: [/* @__PURE__ */ u("span", {
37
+ className: "ttw:text-sm ttw:leading-5",
38
+ children: e.dueDateLabel
39
+ }), /* @__PURE__ */ u("span", {
40
+ className: "ttw:text-xs ttw:leading-4.5",
41
+ children: e.dueDateOverdueLabel
42
+ })]
43
+ }) : e.dueDateLabel;
44
+ }
45
+ function b({ row: e, statusBadgeLabels: t }) {
46
+ let r = e.statusOverride;
47
+ return r ? r.kind === "loading" ? /* @__PURE__ */ u(n, { className: "ttw:h-4 ttw:w-full" }) : r.kind === "chip" ? /* @__PURE__ */ u(c, {
48
+ label: r.label,
49
+ tone: r.tone
50
+ }) : null : /* @__PURE__ */ u(a, {
51
+ status: e.status,
52
+ variant: "filled",
53
+ labels: t
54
+ });
55
+ }
56
+ function x({ row: e }) {
57
+ return e.showDocumentSyncIcon ? /* @__PURE__ */ d("span", {
58
+ className: "ttw:flex ttw:items-center ttw:gap-1",
59
+ children: [/* @__PURE__ */ u(g, {
60
+ className: "ttw:size-[1em]",
61
+ "aria-hidden": !0
62
+ }), e.documentLabel]
63
+ }) : e.documentLabel;
64
+ }
65
+ function S({ row: e }) {
66
+ return e.customerState === "resolving" ? /* @__PURE__ */ u(n, { className: "ttw:h-4 ttw:w-full" }) : e.customerState === "missing" ? /* @__PURE__ */ u("span", {
67
+ className: "ttw:opacity-40",
68
+ children: e.customerLabel
69
+ }) : /* @__PURE__ */ u("span", { children: e.customerLabel });
70
+ }
71
+ function C({ rows: e, isLoading: n, isError: a, isAccessRestricted: c, sorting: f, onSortingChange: p, pageSize: m, onPageSizeChange: g, pageSizeOptions: C = _, pageInfo: w, hasNextPage: T, hasPrevPage: E, onNextPage: D, onPrevPage: O, statusCards: k, onStatusCardSelect: A, filterBar: j, isFiltering: M, onCreateClick: N, headerActionContainer: P, onRowClick: F, onRetry: I, labels: L }) {
72
+ let R = {
73
+ ...s,
74
+ ...L,
75
+ statusBadge: {
76
+ ...s.statusBadge,
77
+ ...L?.statusBadge
78
+ }
79
+ }, z = [
80
+ {
81
+ accessorKey: "dueDateLabel",
82
+ enableSorting: !0,
83
+ header: ({ column: e }) => /* @__PURE__ */ u(v, {
84
+ column: e,
85
+ label: R.columnDueDate,
86
+ ariaLabel: R.sortByDueDate
87
+ }),
88
+ cell: ({ row: e }) => /* @__PURE__ */ u(y, { row: e.original })
89
+ },
90
+ {
91
+ accessorKey: "status",
92
+ enableSorting: !0,
93
+ header: ({ column: e }) => /* @__PURE__ */ u(v, {
94
+ column: e,
95
+ label: R.columnStatus,
96
+ ariaLabel: R.sortByStatus
97
+ }),
98
+ cell: ({ row: e }) => /* @__PURE__ */ u(b, {
99
+ row: e.original,
100
+ statusBadgeLabels: R.statusBadge
101
+ })
102
+ },
103
+ {
104
+ accessorKey: "documentLabel",
105
+ enableSorting: !0,
106
+ header: ({ column: e }) => /* @__PURE__ */ u(v, {
107
+ column: e,
108
+ label: R.columnNumber,
109
+ ariaLabel: R.sortByNumber
110
+ }),
111
+ cell: ({ row: e }) => /* @__PURE__ */ u(x, { row: e.original })
112
+ },
113
+ {
114
+ accessorKey: "customerLabel",
115
+ header: R.columnCustomer,
116
+ cell: ({ row: e }) => /* @__PURE__ */ u(S, { row: e.original }),
117
+ minSize: 180
118
+ },
119
+ {
120
+ accessorKey: "issueDateLabel",
121
+ enableSorting: !0,
122
+ header: ({ column: e }) => /* @__PURE__ */ u(v, {
123
+ column: e,
124
+ label: R.columnIssueDate,
125
+ ariaLabel: R.sortByIssueDate
126
+ })
127
+ },
128
+ {
129
+ accessorKey: "totalLabel",
130
+ enableSorting: !0,
131
+ header: ({ column: e }) => /* @__PURE__ */ u("div", {
132
+ className: "ttw:flex ttw:justify-end",
133
+ children: /* @__PURE__ */ u(v, {
134
+ column: e,
135
+ label: R.columnAmount,
136
+ ariaLabel: R.sortByAmount
137
+ })
138
+ }),
139
+ cell: ({ row: e }) => /* @__PURE__ */ u("div", {
140
+ className: "ttw:text-right",
141
+ children: e.original.totalLabel
142
+ })
143
+ }
144
+ ], B = !c && !n && !a && !M && e.length === 0;
145
+ return /* @__PURE__ */ d("div", {
146
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
147
+ children: [
148
+ N && !B && /* @__PURE__ */ u(o, {
149
+ container: P,
150
+ label: R.createInvoiceButton,
151
+ onClick: N
152
+ }),
153
+ !c && k && A && /* @__PURE__ */ u(l, {
154
+ view: k,
155
+ onSelect: A,
156
+ labels: { all: R.statusCardsAll }
157
+ }),
158
+ c ? /* @__PURE__ */ u(i, {
159
+ icon: /* @__PURE__ */ u(h, { className: "ttw:size-8 ttw:text-primary" }),
160
+ title: R.accessRestrictedTitle,
161
+ description: R.accessRestrictedDescription
162
+ }) : /* @__PURE__ */ u(t, {
163
+ columns: z,
164
+ data: e,
165
+ isLoading: n,
166
+ sorting: f,
167
+ onSortingChange: p,
168
+ pageSize: m,
169
+ onPageSizeChange: g,
170
+ pageSizeOptions: C,
171
+ pageInfo: w,
172
+ hasNextPage: T,
173
+ hasPrevPage: E,
174
+ onNextPage: D,
175
+ onPrevPage: O,
176
+ onRowClick: F,
177
+ rowAriaLabel: (e) => R.openRow(e.documentLabel),
178
+ filterComponent: j,
179
+ children: a && !M ? /* @__PURE__ */ u(i, {
180
+ title: R.errorTitle,
181
+ description: R.errorDescription,
182
+ retryLabel: I ? R.errorRetry : void 0,
183
+ onRetry: I
184
+ }) : /* @__PURE__ */ u(r, {
185
+ title: M ? R.filterEmptyTitle : R.emptyTitle,
186
+ description: M ? void 0 : R.emptyDescription,
187
+ actionLabel: M ? void 0 : R.createInvoiceButton,
188
+ onAction: M ? void 0 : N
189
+ })
190
+ })
191
+ ]
192
+ });
193
+ }
194
+ export { C as ReceivablesScreen, C as default };
@@ -0,0 +1,47 @@
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 "./index18.js";
3
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
4
+ import { XIcon as u } from "lucide-react";
5
+ // ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js
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();
15
+ },
16
+ children: /* @__PURE__ */ l(t, {
17
+ showCloseButton: !1,
18
+ children: [
19
+ /* @__PURE__ */ l("button", {
20
+ type: "button",
21
+ onClick: m,
22
+ disabled: h,
23
+ 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",
24
+ children: [/* @__PURE__ */ c(u, { className: "ttw:size-4" }), /* @__PURE__ */ c("span", {
25
+ className: "ttw:sr-only",
26
+ children: v.unsavedCloseButton
27
+ })]
28
+ }),
29
+ /* @__PURE__ */ l(i, { children: [/* @__PURE__ */ c(a, { children: v.unsavedTitle }), /* @__PURE__ */ c(n, { children: v.unsavedDescription })] }),
30
+ /* @__PURE__ */ l(r, { children: [/* @__PURE__ */ c(o, {
31
+ type: "button",
32
+ variant: "outline",
33
+ onClick: p,
34
+ disabled: h,
35
+ children: v.unsavedDiscardButton
36
+ }), /* @__PURE__ */ c(o, {
37
+ type: "button",
38
+ loading: h,
39
+ disabled: h || g,
40
+ onClick: f,
41
+ children: v.unsavedSaveDraftButton
42
+ })] })
43
+ ]
44
+ })
45
+ });
46
+ }
47
+ export { d as UnsavedInvoiceDialog, d as default };