@tesouro/embedded-components-react 0.7.21 → 0.7.24

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 (35) hide show
  1. package/dist/fixtures/index.d.ts +5 -1
  2. package/dist/index.d.ts +9 -1
  3. package/dist/lib/CounterpartsWidget.d.ts +9 -1
  4. package/dist/lib/CounterpartsWidgetPublic.d.ts +9 -1
  5. package/dist/lib/CustomersWidget.d.ts +9 -1
  6. package/dist/lib/ReceivablesWidget.d.ts +9 -1
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +50 -51
  10. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +4 -2
  11. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +1 -1
  12. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +72 -128
  14. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +183 -38
  15. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +503 -193
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +57 -55
  17. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +14 -14
  18. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +114 -102
  19. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +12 -11
  20. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +534 -7
  21. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +7 -179
  22. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +179 -6
  23. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +3 -1
  24. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index14.js +4 -28
  25. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +28 -4
  26. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index16.js +4 -0
  27. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +10 -2
  28. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index7.js +140 -55
  29. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js +53 -47
  30. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +51 -539
  31. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js +6 -3
  32. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +584 -549
  33. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  34. package/package.json +1 -1
  35. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +0 -520
@@ -1,550 +1,62 @@
1
- import { Button as e, Checkbox as t, FieldRequirement as n, Input as r, Label as i, RequiredFieldsLegend as a, Separator as o, Typography as s, mergeRequiredFieldsLegendLabels as c } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { COUNTERPART_FORM_SHEET_LABELS_EN as l } from "./index2.js";
3
- import { FieldError as u } from "./index4.js";
4
- import { AchFieldGroup as d } from "./index5.js";
5
- import { AddressFieldGroup as f } from "./index6.js";
6
- import { CounterpartTypeChooser as p } from "./index7.js";
7
- import { FormSheet as m } from "./index8.js";
8
- import { useEffect as h, useId as g, useRef as _ } from "react";
9
- import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
10
- import { Plus as x } from "lucide-react";
1
+ import { Button as e, Sheet as t, SheetContent as n, SheetDescription as r, SheetFooter as i, SheetHeader as a, SheetTitle as o } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { useId as s } from "react";
3
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
11
4
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js
12
- var S = {
13
- entityType: !0,
14
- title: !0,
15
- profileHeading: !0,
16
- addressHeading: !0,
17
- taxId: !0,
18
- address: !0,
19
- bankAccount: !0
20
- };
21
- function C({ show: e, sectionsToExpand: t }) {
22
- return {
23
- isAddressShown: e.address === !0 || e.address === "collapsible",
24
- isAddressExpanded: e.address === !0 || t?.address === !0
25
- };
26
- }
27
- function w(e) {
28
- return typeof e == "string" ? +!!e : !e || typeof e != "object" ? 0 : Object.values(e).reduce((e, t) => e + w(t), 0);
29
- }
30
- function T(e) {
31
- let t = _(null), n = _(e);
32
- return h(() => {
33
- if (e === n.current) return;
34
- let r = n.current;
35
- n.current = e, !(w(e) < w(r)) && (t.current?.querySelector("[aria-invalid=\"true\"]"))?.focus();
36
- }, [e]), t;
37
- }
38
- function E(e) {
39
- let t = {
40
- ...l.fieldMarkers,
41
- ...e?.fieldMarkers
42
- };
43
- return {
44
- ...l,
45
- ...e,
46
- fieldMarkers: t,
47
- address: {
48
- ...l.address,
49
- ...e?.address,
50
- fieldMarkers: {
51
- ...t,
52
- ...e?.address?.fieldMarkers
53
- }
54
- },
55
- requiredFieldsLegend: c(t, e?.requiredFieldsLegend),
56
- ach: {
57
- ...l.ach,
58
- ...e?.accountHolderNameLabel !== void 0 && { accountHolderName: e.accountHolderNameLabel },
59
- ...e?.routingNumberLabel !== void 0 && { routingNumber: e.routingNumberLabel },
60
- ...e?.accountNumberLabel !== void 0 && { accountNumber: e.accountNumberLabel },
61
- ...e?.ach,
62
- fieldMarkers: {
63
- ...t,
64
- ...e?.ach?.fieldMarkers
65
- }
66
- }
67
- };
68
- }
69
- function D({ open: c, onOpenChange: l, mode: h, counterpartMode: _ = "customer", values: w, errors: D, stateOptions: O, inProgress: k, submitDisabled: A, onChange: j, onAddressChange: M, onBankAccountChange: N, onSubmit: P, onCancel: F, sections: I, sectionsToExpand: L, onAddressExpand: R, labels: z }) {
70
- let B = E(z), V = {
71
- ...S,
72
- ...I
73
- }, H = g(), U = w.entityType === "organization", W = _ === "customer", G = _ === "vendor", { isAddressShown: K, isAddressExpanded: q } = C({
74
- show: V,
75
- sectionsToExpand: L
76
- }), J = T(D), Y = h === "edit" ? W ? B.editTitleCustomer : B.editTitleVendor : W ? B.createTitleCustomer : B.createTitleVendor, X = h === "create" ? W ? B.createDescriptionCustomer : B.createDescriptionVendor : void 0, Z = W ? B.customerTypeHeading : B.vendorTypeHeading, Q = W ? B.customerTaxIdHelp : B.vendorTaxIdHelp;
77
- return /* @__PURE__ */ y(m, {
78
- open: c,
79
- onOpenChange: l,
80
- title: Y,
81
- description: X,
82
- formError: D?.form,
83
- inProgress: k,
84
- submitDisabled: A,
85
- submitLabel: h === "edit" ? B.saveButton : B.createButton,
86
- cancelLabel: B.cancelButton,
87
- onSubmit: P,
88
- onCancel: F,
89
- children: /* @__PURE__ */ b("div", {
90
- ref: J,
91
- style: { display: "contents" },
5
+ function u({ open: u, onOpenChange: d, title: f, description: p, formError: m, inProgress: h, submitDisabled: g, initialFocusId: _, submitLabel: v, cancelLabel: y, onSubmit: b, onCancel: x, children: S }) {
6
+ let C = s();
7
+ return /* @__PURE__ */ c(t, {
8
+ open: u,
9
+ onOpenChange: d,
10
+ children: /* @__PURE__ */ l(n, {
11
+ className: "ttw:w-150 ttw:sm:max-w-150 ttw:overflow-y-auto",
12
+ onOpenAutoFocus: (e) => {
13
+ let t = _ ? document.getElementById(_) : null;
14
+ t && (e.preventDefault(), t.focus());
15
+ },
92
16
  children: [
93
- /* @__PURE__ */ y(a, { labels: B.requiredFieldsLegend }),
94
- h === "create" && /* @__PURE__ */ y(p, {
95
- value: w.entityType,
96
- onChange: (e) => j({ entityType: e }),
97
- variant: "pills",
98
- labels: {
99
- heading: Z,
100
- organization: B.businessTypeOption,
101
- organizationHint: B.businessTypeHint,
102
- individual: B.personTypeOption,
103
- individualHint: B.personTypeHint
104
- }
105
- }),
106
- V.profileHeading && /* @__PURE__ */ y(s, {
107
- variant: "body2",
108
- className: "ttw:font-semibold",
109
- children: B.profileHeading
110
- }),
111
- U ? /* @__PURE__ */ b("div", {
112
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
113
- children: [
114
- /* @__PURE__ */ y(i, {
115
- htmlFor: `${H}-legal-name`,
116
- requirement: n.Required,
117
- labels: B.fieldMarkers,
118
- children: B.businessNameLabel
119
- }),
120
- /* @__PURE__ */ y(r, {
121
- id: `${H}-legal-name`,
122
- autoFocus: !0,
123
- value: w.legalName,
124
- "aria-required": !0,
125
- "aria-invalid": !!D?.legalName,
126
- onChange: (e) => j({ legalName: e.target.value })
127
- }),
128
- /* @__PURE__ */ y(u, { message: D?.legalName })
129
- ]
130
- }) : /* @__PURE__ */ b("div", {
131
- className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
132
- children: [/* @__PURE__ */ b("div", {
133
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
134
- children: [
135
- /* @__PURE__ */ y(i, {
136
- htmlFor: `${H}-first-name`,
137
- requirement: n.Required,
138
- labels: B.fieldMarkers,
139
- children: B.firstNameLabel
140
- }),
141
- /* @__PURE__ */ y(r, {
142
- id: `${H}-first-name`,
143
- autoFocus: !0,
144
- value: w.firstName,
145
- "aria-required": !0,
146
- "aria-invalid": !!D?.firstName,
147
- onChange: (e) => j({ firstName: e.target.value })
148
- }),
149
- /* @__PURE__ */ y(u, { message: D?.firstName })
150
- ]
151
- }), /* @__PURE__ */ b("div", {
152
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
153
- children: [
154
- /* @__PURE__ */ y(i, {
155
- htmlFor: `${H}-last-name`,
156
- requirement: n.Required,
157
- labels: B.fieldMarkers,
158
- children: B.lastNameLabel
159
- }),
160
- /* @__PURE__ */ y(r, {
161
- id: `${H}-last-name`,
162
- value: w.lastName,
163
- "aria-required": !0,
164
- "aria-invalid": !!D?.lastName,
165
- onChange: (e) => j({ lastName: e.target.value })
166
- }),
167
- /* @__PURE__ */ y(u, { message: D?.lastName })
168
- ]
17
+ /* @__PURE__ */ l(a, {
18
+ className: "ttw:border-b ttw:border-border",
19
+ children: [/* @__PURE__ */ c(o, {
20
+ className: "ttw:text-2xl",
21
+ children: f
22
+ }), /* @__PURE__ */ c(r, {
23
+ className: p ? void 0 : "ttw:sr-only",
24
+ children: p ?? f
169
25
  })]
170
26
  }),
171
- !U && V.title && /* @__PURE__ */ b("div", {
172
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
173
- children: [/* @__PURE__ */ y(i, {
174
- htmlFor: `${H}-title`,
175
- requirement: n.Optional,
176
- labels: B.fieldMarkers,
177
- children: B.titleLabel
178
- }), /* @__PURE__ */ y(r, {
179
- id: `${H}-title`,
180
- value: w.title,
181
- onChange: (e) => j({ title: e.target.value })
182
- })]
183
- }),
184
- /* @__PURE__ */ b("div", {
185
- className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
186
- children: [/* @__PURE__ */ b("div", {
187
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
188
- children: [
189
- /* @__PURE__ */ y(i, {
190
- htmlFor: `${H}-email`,
191
- requirement: n.Required,
192
- labels: B.fieldMarkers,
193
- children: B.emailLabel
194
- }),
195
- /* @__PURE__ */ y(r, {
196
- id: `${H}-email`,
197
- type: "email",
198
- value: w.email,
199
- "aria-required": !0,
200
- "aria-invalid": !!D?.email,
201
- onChange: (e) => j({ email: e.target.value })
202
- }),
203
- /* @__PURE__ */ y(u, { message: D?.email })
204
- ]
205
- }), /* @__PURE__ */ b("div", {
206
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
207
- children: [
208
- /* @__PURE__ */ y(i, {
209
- htmlFor: `${H}-phone`,
210
- requirement: n.Optional,
211
- labels: B.fieldMarkers,
212
- children: B.phoneLabel
213
- }),
214
- /* @__PURE__ */ y(r, {
215
- id: `${H}-phone`,
216
- value: w.phone,
217
- "aria-invalid": !!D?.phone,
218
- onChange: (e) => j({ phone: e.target.value })
219
- }),
220
- /* @__PURE__ */ y(u, { message: D?.phone })
221
- ]
222
- })]
223
- }),
224
- V.taxId && /* @__PURE__ */ b("div", {
225
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
226
- children: [
227
- /* @__PURE__ */ y(i, {
228
- htmlFor: `${H}-tax-id`,
229
- requirement: n.Optional,
230
- labels: B.fieldMarkers,
231
- children: B.taxIdLabel
232
- }),
233
- /* @__PURE__ */ y(r, {
234
- id: `${H}-tax-id`,
235
- value: w.taxId,
236
- "aria-invalid": !!D?.taxId,
237
- onChange: (e) => j({ taxId: e.target.value })
238
- }),
239
- /* @__PURE__ */ y(u, { message: D?.taxId }),
240
- /* @__PURE__ */ y(s, {
241
- variant: "caption",
242
- className: "ttw:text-muted-foreground",
243
- children: Q
244
- })
245
- ]
246
- }),
247
- W && /* @__PURE__ */ b(i, {
248
- htmlFor: `${H}-reminders`,
249
- className: "ttw:flex ttw:items-start ttw:gap-3 ttw:rounded-md ttw:border ttw:p-3",
250
- children: [/* @__PURE__ */ y(t, {
251
- id: `${H}-reminders`,
252
- checked: w.remindersEnabled,
253
- onCheckedChange: (e) => j({ remindersEnabled: e === !0 })
254
- }), /* @__PURE__ */ b("span", {
255
- className: "ttw:flex ttw:flex-col ttw:gap-0.5",
256
- children: [/* @__PURE__ */ y("span", {
257
- className: "ttw:text-sm ttw:font-medium",
258
- children: B.paymentRemindersLabel
259
- }), /* @__PURE__ */ y("span", {
260
- className: "ttw:text-sm ttw:text-muted-foreground",
261
- children: B.paymentRemindersDescription
262
- })]
263
- })]
27
+ /* @__PURE__ */ c("form", {
28
+ id: C,
29
+ onSubmit: (e) => {
30
+ e.preventDefault(), e.stopPropagation(), b();
31
+ },
32
+ children: /* @__PURE__ */ l("div", {
33
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-6 ttw:pt-8 ttw:pb-6",
34
+ children: [m && /* @__PURE__ */ c("p", {
35
+ role: "alert",
36
+ className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
37
+ children: m
38
+ }), S]
39
+ })
264
40
  }),
265
- K && /* @__PURE__ */ b(v, { children: [V.addressHeading && /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(o, { className: "ttw:my-1" }), /* @__PURE__ */ b("div", {
266
- className: "ttw:flex ttw:flex-col ttw:gap-1",
267
- children: [/* @__PURE__ */ y(s, {
268
- variant: "body2",
269
- className: "ttw:font-semibold",
270
- children: B.addressHeading
271
- }), W && /* @__PURE__ */ y(s, {
272
- variant: "body2",
273
- className: "ttw:text-muted-foreground",
274
- children: B.customerAddressDescription
41
+ /* @__PURE__ */ l(i, {
42
+ className: "ttw:flex ttw:flex-row ttw:justify-end ttw:gap-2",
43
+ children: [/* @__PURE__ */ c(e, {
44
+ type: "button",
45
+ variant: "ghost",
46
+ size: "lg",
47
+ onClick: x,
48
+ children: y
49
+ }), /* @__PURE__ */ c(e, {
50
+ type: "submit",
51
+ form: C,
52
+ size: "lg",
53
+ disabled: h || g,
54
+ children: v
275
55
  })]
276
- })] }), q ? /* @__PURE__ */ y(f, {
277
- idPrefix: `${H}-address`,
278
- values: w.address,
279
- errors: D?.address,
280
- stateOptions: O,
281
- onChange: M,
282
- labels: B.address
283
- }) : /* @__PURE__ */ b(e, {
284
- type: "button",
285
- variant: "link",
286
- className: "ttw:w-fit ttw:px-0",
287
- onClick: R,
288
- children: [/* @__PURE__ */ y(x, { className: "ttw:size-4" }), B.addAddress]
289
- })] }),
290
- G && V.bankAccount && /* @__PURE__ */ b(v, { children: [
291
- /* @__PURE__ */ y(o, { className: "ttw:my-1" }),
292
- /* @__PURE__ */ b("div", {
293
- className: "ttw:flex ttw:flex-col ttw:gap-1",
294
- children: [/* @__PURE__ */ y(s, {
295
- variant: "body2",
296
- className: "ttw:font-semibold",
297
- children: B.paymentMethodsHeading
298
- }), /* @__PURE__ */ y(s, {
299
- variant: "body2",
300
- className: "ttw:text-muted-foreground",
301
- children: B.paymentMethodsDescription
302
- })]
303
- }),
304
- /* @__PURE__ */ y(d, {
305
- idPrefix: `${H}-ach`,
306
- values: w.bankAccount,
307
- errors: D?.bankAccount,
308
- onChange: (e) => N?.(e),
309
- labels: B.ach
310
- })
311
- ] })
56
+ })
312
57
  ]
313
58
  })
314
59
  });
315
60
  }
316
- function O({ mode: a, counterpartMode: c = "customer", values: l, errors: m, stateOptions: h, onChange: _, onAddressChange: w, onBankAccountChange: D, sections: O, sectionsToExpand: k, onAddressExpand: A, labels: j }) {
317
- let M = E(j), N = {
318
- ...S,
319
- ...O
320
- }, P = g(), F = l.entityType === "organization", I = c === "customer", L = c === "vendor", { isAddressShown: R, isAddressExpanded: z } = C({
321
- show: N,
322
- sectionsToExpand: k
323
- }), B = T(m), V = I ? M.customerTypeHeading : M.vendorTypeHeading, H = I ? M.customerTaxIdHelp : M.vendorTaxIdHelp;
324
- return /* @__PURE__ */ b("div", {
325
- ref: B,
326
- style: { display: "contents" },
327
- children: [
328
- a === "create" && N.entityType && /* @__PURE__ */ y(p, {
329
- value: l.entityType,
330
- onChange: (e) => _({ entityType: e }),
331
- variant: "pills",
332
- labels: {
333
- heading: V,
334
- organization: M.businessTypeOption,
335
- organizationHint: M.businessTypeHint,
336
- individual: M.personTypeOption,
337
- individualHint: M.personTypeHint
338
- }
339
- }),
340
- N.profileHeading && /* @__PURE__ */ y(s, {
341
- variant: "body2",
342
- className: "ttw:font-semibold",
343
- children: M.profileHeading
344
- }),
345
- F ? /* @__PURE__ */ b("div", {
346
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
347
- children: [
348
- /* @__PURE__ */ y(i, {
349
- htmlFor: `${P}-legal-name`,
350
- requirement: n.Required,
351
- labels: M.fieldMarkers,
352
- children: M.businessNameLabel
353
- }),
354
- /* @__PURE__ */ y(r, {
355
- id: `${P}-legal-name`,
356
- autoFocus: !0,
357
- value: l.legalName,
358
- "aria-required": !0,
359
- "aria-invalid": !!m?.legalName,
360
- onChange: (e) => _({ legalName: e.target.value })
361
- }),
362
- /* @__PURE__ */ y(u, { message: m?.legalName })
363
- ]
364
- }) : /* @__PURE__ */ b("div", {
365
- className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
366
- children: [/* @__PURE__ */ b("div", {
367
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
368
- children: [
369
- /* @__PURE__ */ y(i, {
370
- htmlFor: `${P}-first-name`,
371
- requirement: n.Required,
372
- labels: M.fieldMarkers,
373
- children: M.firstNameLabel
374
- }),
375
- /* @__PURE__ */ y(r, {
376
- id: `${P}-first-name`,
377
- autoFocus: !0,
378
- value: l.firstName,
379
- "aria-required": !0,
380
- "aria-invalid": !!m?.firstName,
381
- onChange: (e) => _({ firstName: e.target.value })
382
- }),
383
- /* @__PURE__ */ y(u, { message: m?.firstName })
384
- ]
385
- }), /* @__PURE__ */ b("div", {
386
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
387
- children: [
388
- /* @__PURE__ */ y(i, {
389
- htmlFor: `${P}-last-name`,
390
- requirement: n.Required,
391
- labels: M.fieldMarkers,
392
- children: M.lastNameLabel
393
- }),
394
- /* @__PURE__ */ y(r, {
395
- id: `${P}-last-name`,
396
- value: l.lastName,
397
- "aria-required": !0,
398
- "aria-invalid": !!m?.lastName,
399
- onChange: (e) => _({ lastName: e.target.value })
400
- }),
401
- /* @__PURE__ */ y(u, { message: m?.lastName })
402
- ]
403
- })]
404
- }),
405
- !F && N.title && /* @__PURE__ */ b("div", {
406
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
407
- children: [/* @__PURE__ */ y(i, {
408
- htmlFor: `${P}-title`,
409
- requirement: n.Optional,
410
- labels: M.fieldMarkers,
411
- children: M.titleLabel
412
- }), /* @__PURE__ */ y(r, {
413
- id: `${P}-title`,
414
- value: l.title,
415
- onChange: (e) => _({ title: e.target.value })
416
- })]
417
- }),
418
- /* @__PURE__ */ b("div", {
419
- className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
420
- children: [/* @__PURE__ */ b("div", {
421
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
422
- children: [
423
- /* @__PURE__ */ y(i, {
424
- htmlFor: `${P}-email`,
425
- requirement: n.Required,
426
- labels: M.fieldMarkers,
427
- children: M.emailLabel
428
- }),
429
- /* @__PURE__ */ y(r, {
430
- id: `${P}-email`,
431
- type: "email",
432
- value: l.email,
433
- "aria-required": !0,
434
- "aria-invalid": !!m?.email,
435
- onChange: (e) => _({ email: e.target.value })
436
- }),
437
- /* @__PURE__ */ y(u, { message: m?.email })
438
- ]
439
- }), /* @__PURE__ */ b("div", {
440
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
441
- children: [
442
- /* @__PURE__ */ y(i, {
443
- htmlFor: `${P}-phone`,
444
- requirement: n.Optional,
445
- labels: M.fieldMarkers,
446
- children: M.phoneLabel
447
- }),
448
- /* @__PURE__ */ y(r, {
449
- id: `${P}-phone`,
450
- value: l.phone,
451
- "aria-invalid": !!m?.phone,
452
- onChange: (e) => _({ phone: e.target.value })
453
- }),
454
- /* @__PURE__ */ y(u, { message: m?.phone })
455
- ]
456
- })]
457
- }),
458
- N.taxId && /* @__PURE__ */ b("div", {
459
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
460
- children: [
461
- /* @__PURE__ */ y(i, {
462
- htmlFor: `${P}-tax-id`,
463
- requirement: n.Optional,
464
- labels: M.fieldMarkers,
465
- children: M.taxIdLabel
466
- }),
467
- /* @__PURE__ */ y(r, {
468
- id: `${P}-tax-id`,
469
- value: l.taxId,
470
- "aria-invalid": !!m?.taxId,
471
- onChange: (e) => _({ taxId: e.target.value })
472
- }),
473
- /* @__PURE__ */ y(u, { message: m?.taxId }),
474
- /* @__PURE__ */ y(s, {
475
- variant: "caption",
476
- className: "ttw:text-muted-foreground",
477
- children: H
478
- })
479
- ]
480
- }),
481
- I && /* @__PURE__ */ b(i, {
482
- htmlFor: `${P}-reminders`,
483
- className: "ttw:flex ttw:items-start ttw:gap-3 ttw:rounded-md ttw:border ttw:p-3",
484
- children: [/* @__PURE__ */ y(t, {
485
- id: `${P}-reminders`,
486
- checked: l.remindersEnabled,
487
- onCheckedChange: (e) => _({ remindersEnabled: e === !0 })
488
- }), /* @__PURE__ */ b("span", {
489
- className: "ttw:flex ttw:flex-col ttw:gap-0.5",
490
- children: [/* @__PURE__ */ y("span", {
491
- className: "ttw:text-sm ttw:font-medium",
492
- children: M.paymentRemindersLabel
493
- }), /* @__PURE__ */ y("span", {
494
- className: "ttw:text-sm ttw:text-muted-foreground",
495
- children: M.paymentRemindersDescription
496
- })]
497
- })]
498
- }),
499
- R && /* @__PURE__ */ b(v, { children: [N.addressHeading && /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(o, { className: "ttw:my-1" }), /* @__PURE__ */ b("div", {
500
- className: "ttw:flex ttw:flex-col ttw:gap-1",
501
- children: [/* @__PURE__ */ y(s, {
502
- variant: "body2",
503
- className: "ttw:font-semibold",
504
- children: M.addressHeading
505
- }), I && /* @__PURE__ */ y(s, {
506
- variant: "body2",
507
- className: "ttw:text-muted-foreground",
508
- children: M.customerAddressDescription
509
- })]
510
- })] }), z ? /* @__PURE__ */ y(f, {
511
- idPrefix: `${P}-address`,
512
- values: l.address,
513
- errors: m?.address,
514
- stateOptions: h,
515
- onChange: w,
516
- labels: M.address
517
- }) : /* @__PURE__ */ b(e, {
518
- type: "button",
519
- variant: "link",
520
- className: "ttw:w-fit ttw:px-0",
521
- onClick: A,
522
- children: [/* @__PURE__ */ y(x, { className: "ttw:size-4" }), M.addAddress]
523
- })] }),
524
- L && N.bankAccount && /* @__PURE__ */ b(v, { children: [
525
- /* @__PURE__ */ y(o, { className: "ttw:my-1" }),
526
- /* @__PURE__ */ b("div", {
527
- className: "ttw:flex ttw:flex-col ttw:gap-1",
528
- children: [/* @__PURE__ */ y(s, {
529
- variant: "body2",
530
- className: "ttw:font-semibold",
531
- children: M.paymentMethodsHeading
532
- }), /* @__PURE__ */ y(s, {
533
- variant: "body2",
534
- className: "ttw:text-muted-foreground",
535
- children: M.paymentMethodsDescription
536
- })]
537
- }),
538
- /* @__PURE__ */ y(d, {
539
- idPrefix: `${P}-ach`,
540
- values: l.bankAccount,
541
- errors: m?.bankAccount,
542
- onChange: (e) => D?.(e),
543
- labels: M.ach
544
- })
545
- ] })
546
- ]
547
- });
548
- }
549
61
  //#endregion
550
- export { O as CounterpartFormFields, D as CounterpartFormSheet, D as default, w as countErrors, T as useFocusFirstInvalidField };
62
+ export { u as FormSheet, u as default };
@@ -55,10 +55,13 @@ function m({ enabled: n } = {}) {
55
55
  });
56
56
  c(b, v);
57
57
  let x = l(() => {
58
- if (b.data) return {
59
- data: b.data.pages.flatMap((e) => e.data ?? []),
58
+ if (!b.data) return;
59
+ let e = b.data.pages.flatMap((e) => e.data ?? []);
60
+ return {
61
+ data: e,
60
62
  next_pagination_token: void 0,
61
- prev_pagination_token: void 0
63
+ prev_pagination_token: void 0,
64
+ total_count: e.length
62
65
  };
63
66
  }, [b.data]);
64
67
  return {