@tesouro/embedded-components-react 0.7.22 → 0.7.25

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