@tesouro/embedded-components-react 0.11.65 → 0.11.68

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