@tesouro/embedded-components-react 0.2.296 → 0.2.299

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