@tesouro/embedded-components-react 0.7.44 → 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 (108) hide show
  1. package/dist/index.d.ts +30 -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/LinkedAccountsWidget.d.ts +1 -0
  6. package/dist/lib/ReceivablesWidget.d.ts +1 -0
  7. package/dist/lib/WidgetSuite.d.ts +1 -0
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +12 -12
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +15 -15
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +9 -9
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +30 -30
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +3 -2
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +7 -6
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +3 -2
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +9 -8
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +5 -4
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index48.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index49.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +3 -2
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +40 -40
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +3 -2
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +8 -7
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +9 -13
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +7 -10
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +76 -11
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +1 -1
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +27 -9
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +2 -76
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +30 -0
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +1 -1
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +5 -27
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +32 -2
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +2 -30
  38. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index.js +1 -2
  39. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +36 -36
  40. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +73 -77
  41. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +8 -25
  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/linked-accounts-widget/feature/dist/lib/forms.js +2 -1
  82. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/permissions.js +8 -7
  83. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +200 -191
  84. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/mocks/linkedAccounts.js +87 -79
  85. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index15.js +1 -0
  86. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index5.js +10 -0
  87. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +11 -10
  88. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/organization/useOrganizationQuery.js +24 -0
  89. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index.js +8 -0
  90. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index2.js +14 -0
  91. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index3.js +13 -0
  92. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index4.js +18 -0
  93. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index5.js +2 -0
  94. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index6.js +20 -0
  95. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index7.js +32 -0
  96. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index8.js +2 -0
  97. package/dist/libs/tesouro-embedded-components-react/{bill-pay-widget → shared/document-status}/util/dist/lib/derivePayableStatus.js +23 -10
  98. package/dist/libs/tesouro-embedded-components-react/shared/document-status/util/dist/lib/receivableFilledTone.js +22 -0
  99. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  100. package/package.json +1 -1
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +0 -18
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +0 -2
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +0 -7
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +0 -34
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +0 -2
  106. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index7.js +0 -25
  107. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +0 -8
  108. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +0 -45
@@ -1,3 +1,249 @@
1
- import "./index13.js";
2
- import "./index51.js";
3
- import "./index53.js";
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 "./index14.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
+ //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.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
+ //#endregion
249
+ export { b as ReceivableRemindersSection };
@@ -1,249 +1,61 @@
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 "./index14.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";
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 "./index14.js";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
6
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.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
- })
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
41
15
  });
42
16
  }
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
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
239
36
  })]
240
- }), /* @__PURE__ */ u(o, {
241
- variant: "body2",
242
- color: "muted",
243
- className: "ttw:font-medium",
244
- children: b.remindersLibraryNote
245
- })] })]
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))]
246
58
  });
247
59
  }
248
60
  //#endregion
249
- export { b as ReceivableRemindersSection };
61
+ export { c as ReceivableStatusCards, c as default };