@tesouro/embedded-components-react 0.7.28 → 0.7.29

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 (34) hide show
  1. package/dist/index.d.ts +1 -12
  2. package/dist/lib/CounterpartsWidget.d.ts +1 -12
  3. package/dist/lib/CounterpartsWidgetPublic.d.ts +1 -12
  4. package/dist/lib/CustomersWidget.d.ts +0 -2
  5. package/dist/lib/ReceivablesWidget.d.ts +0 -2
  6. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +59 -38
  7. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js +137 -0
  8. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +86 -182
  9. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +116 -0
  10. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +16 -16
  11. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +51 -108
  12. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useRebaseOnRefresh.js +33 -0
  13. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +40 -39
  14. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +2 -65
  16. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +37 -181
  17. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +193 -502
  18. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +520 -0
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +2 -0
  20. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index.js +3 -3
  21. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js +31 -55
  22. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -11
  23. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +98 -163
  24. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +1 -3
  25. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +37 -32
  26. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +86 -93
  27. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +2 -0
  28. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +42 -173
  29. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +3 -12
  30. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index5.js +16 -16
  31. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +42 -42
  32. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +117 -125
  33. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  34. package/package.json +1 -1
@@ -6,119 +6,62 @@ import { getStateOptions as e } from "../../../../../shared/util/dist/lib/usStat
6
6
  import { useWidgetConfig as t, useWidgetError as n, useWidgetLoading as r } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
7
7
  import "../../../../../shared/feature/dist/index.js";
8
8
  import { COUNTERPART_MESSAGE_LABELS_EN as i } from "../../../../../shared/counterpart-management/feature/dist/lib/labels.js";
9
- import { addressResponseToFormValues as a, counterpartToFormValues as o, hasSelectedText as s } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
10
- import { useAddressForm as c } from "../../../../../shared/counterpart-management/feature/dist/lib/useAddressForm.js";
11
- import { useCounterpartForm as l } from "../../../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
12
- import { useDeleteController as u } from "../../../../../shared/counterpart-management/feature/dist/lib/useDeleteController.js";
13
- import { useBankAccountForm as d } from "../../../../../shared/counterpart-management/feature/dist/lib/subEntityForms.js";
9
+ import { hasSelectedText as a } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
14
10
  import "../../../../../shared/counterpart-management/feature/dist/index.js";
15
- import { getCounterpartPermissions as f } from "./permissions.js";
16
- import { useCounterpartsTable as p } from "./useCounterpartsTable.js";
17
- import { useCounterpartDetailsSheetView as m } from "./useCounterpartDetailsSheetView.js";
18
- import { COUNTERPART_DETAILS_SHEET_LABELS_EN as h } from "../../../../ui/dist/index2.js";
11
+ import { getCounterpartPermissions as o } from "./permissions.js";
12
+ import { COUNTERPART_DETAILS_SHEET_LABELS_EN as s } from "../../../../ui/dist/index2.js";
19
13
  import "../../../../ui/dist/index.js";
20
- import { useCallback as g, useEffect as _, useMemo as v, useState as y } from "react";
14
+ import { useCounterpartsTable as c } from "./useCounterpartsTable.js";
15
+ import { useCounterpartDetailsActions as l } from "./useCounterpartDetailsActions.js";
16
+ import { useCounterpartDetailsSheetView as u } from "./useCounterpartDetailsSheetView.js";
17
+ import { useCallback as d, useEffect as f, useMemo as p, useState as m } from "react";
21
18
  //#region ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js
22
- var b = {
23
- line1: "",
24
- line2: "",
25
- city: "",
26
- state: "",
27
- postalCode: ""
28
- };
29
- function x(e, t) {
30
- return e.line1 === t.line1 && e.line2 === t.line2 && e.city === t.city && e.state === t.state && e.postalCode === t.postalCode;
31
- }
32
- function S({ counterpartType: S, detailsLabels: C, messageLabels: w }) {
33
- let { initResponse: T, widgetToken: E } = t(), D = r(), O = n(), k = v(() => ({
19
+ function h({ counterpartType: h, detailsLabels: g, messageLabels: _ }) {
20
+ let { initResponse: v, widgetToken: y } = t(), b = r(), x = n(), S = p(() => ({
34
21
  ...i,
35
- ...w
36
- }), [w]), A = v(() => ({
37
- ...h,
38
- ...C
39
- }), [C]), j = S === "customer", M = v(() => e(), []), N = v(() => f(T?.scopes), [T?.scopes]), P = !(!E || T || O) || D && !T, [F, I] = y(), [L, R] = y("none"), z = N.canRead ? F : void 0;
40
- _(() => {
41
- N.canRead || (I(void 0), R("none"));
42
- }, [N.canRead]);
43
- let B = p({
44
- isCustomer: j,
45
- enabled: N.canRead,
46
- messages: k
47
- }), { details: V, detailsSheetView: H } = m({
48
- selectedId: z,
49
- isCustomer: j,
50
- enabled: N.canRead,
51
- detailsText: A
52
- }), U = l({
53
- view: L,
54
- setView: R,
55
- selectedId: z,
56
- setSelectedId: I,
57
- messages: k,
58
- counterpartType: S,
59
- counterpart: V.counterpart,
60
- primaryAddress: j && L === "edit" ? void 0 : V.primaryAddress,
61
- includeBankAccount: L === "create"
62
- }), W = d({
63
- items: V.bankAccounts,
64
- selectedId: z,
65
- messages: k
66
- }), G = c({
67
- selectedId: z,
68
- primaryAddress: V.primaryAddress,
69
- messages: k
70
- }), K = u({
71
- selectedId: z,
72
- setSelectedId: I,
73
- detailsView: V.detailsView,
74
- messages: k
75
- }), q = v(() => {
76
- if (!V.counterpart) return !1;
77
- let e = o(V.counterpart, V.primaryAddress), t = U.values;
78
- return t.legalName !== e.legalName || t.firstName !== e.firstName || t.lastName !== e.lastName || t.email !== e.email || t.phone !== e.phone || t.taxId !== e.taxId || t.remindersEnabled !== e.remindersEnabled || !j && !x(t.address, e.address);
79
- }, [
80
- V.counterpart,
81
- V.primaryAddress,
82
- U.values,
83
- j
84
- ]), J = v(() => !x(G.values, V.primaryAddress ? a(V.primaryAddress) : b), [G.values, V.primaryAddress]), { close: Y } = G, { openEdit: X, setValues: Z } = U;
22
+ ..._
23
+ }), [_]), C = p(() => ({
24
+ ...s,
25
+ ...g
26
+ }), [g]), w = h === "customer", T = p(() => e(), []), E = p(() => o(v?.scopes), [v?.scopes]), D = !(!y || v || x) || b && !v, [O, k] = m(), [A, j] = m("none"), M = E.canRead ? O : void 0;
27
+ f(() => {
28
+ E.canRead || (k(void 0), j("none"));
29
+ }, [E.canRead]);
30
+ let N = c({
31
+ isCustomer: w,
32
+ enabled: E.canRead,
33
+ messages: S
34
+ }), { details: P, detailsSheetView: F } = u({
35
+ selectedId: M,
36
+ isCustomer: w,
37
+ enabled: E.canRead,
38
+ detailsText: C
39
+ }), I = l({
40
+ counterpartType: h,
41
+ selectedId: M,
42
+ setSelectedId: k,
43
+ view: A,
44
+ setView: j,
45
+ details: P,
46
+ messages: S
47
+ }), { closeAddress: L } = I;
85
48
  return {
86
- stateOptions: M,
87
- isEditDirty: q,
88
- isAddressDirty: J,
89
- selectedId: z,
90
- view: L,
91
- table: B,
92
- details: V,
93
- detailsSheetView: H,
94
- permissions: N,
95
- isPermissionLoading: P,
96
- form: U,
97
- bank: W,
98
- address: G,
99
- del: K,
100
- handleRowClick: g((e) => {
101
- N.canRead && !s() && (Y(), I(e.id), R("none"));
102
- }, [N.canRead, Y]),
103
- closeDetails: g(() => {
104
- Y(), I(void 0);
105
- }, [Y]),
106
- handleEditProfile: g(() => {
107
- if (!j) {
108
- Y(), X();
109
- return;
110
- }
111
- X(), Z((e) => ({
112
- ...e,
113
- address: b
114
- }));
115
- }, [
116
- Y,
117
- X,
118
- Z,
119
- j
120
- ])
49
+ stateOptions: T,
50
+ selectedId: M,
51
+ view: A,
52
+ table: N,
53
+ details: P,
54
+ detailsSheetView: F,
55
+ permissions: E,
56
+ isPermissionLoading: D,
57
+ actions: I,
58
+ handleRowClick: d((e) => {
59
+ E.canRead && !a() && (L(), k(e.id), j("none"));
60
+ }, [E.canRead, L]),
61
+ closeDetails: d(() => {
62
+ L(), k(void 0);
63
+ }, [L])
121
64
  };
122
65
  }
123
66
  //#endregion
124
- export { S as useCounterpartsWidget };
67
+ export { h as useCounterpartsWidget };
@@ -0,0 +1,33 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useState as e } from "react";
6
+ //#region ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useRebaseOnRefresh.js
7
+ function t(e) {
8
+ return typeof e == "object" && !!e && !Array.isArray(e);
9
+ }
10
+ function n(e, r) {
11
+ return e === r ? !0 : !t(e) || !t(r) ? !1 : [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(r)])].every((t) => n(e[t], r[t]));
12
+ }
13
+ function r(e, i, a) {
14
+ if (t(e) && t(i) && t(a)) {
15
+ let t = { ...e };
16
+ for (let n of Object.keys(a)) t[n] = r(e[n], i[n], a[n]);
17
+ return t;
18
+ }
19
+ return n(e, i) ? a : e;
20
+ }
21
+ function i(e, t, n) {
22
+ return r(e, t, n);
23
+ }
24
+ function a({ open: t, seed: r, setValues: a }) {
25
+ let [o, s] = e(void 0), c = t ? r : void 0;
26
+ if (!c || !o) {
27
+ o !== c && s(c);
28
+ return;
29
+ }
30
+ n(o, c) || (s(c), a((e) => i(e, o, c)));
31
+ }
32
+ //#endregion
33
+ export { i as rebaseFormValues, a as useRebaseOnRefresh };
@@ -1,27 +1,27 @@
1
- import { formatMoney as e } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
1
+ import { formatMoney as e, isAchCompatibleBankAccount as t } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
2
2
  import "../../../../../shared/counterpart-management/feature/dist/index.js";
3
3
  //#region ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js
4
- function t(e) {
4
+ function n(e) {
5
5
  if (!e) return "";
6
6
  let t = [...e], n = t.flatMap((e, t) => /\d/.test(e) ? [t] : []);
7
7
  if (n.length <= 4) return "••••";
8
8
  let r = /* @__PURE__ */ new Set([...n.slice(0, 2), ...n.slice(-2)]);
9
9
  return t.map((e, t) => /\d/.test(e) && !r.has(t) ? "•" : e).join("");
10
10
  }
11
- var n = /* @__PURE__ */ new Set([
11
+ var r = /* @__PURE__ */ new Set([
12
12
  "new",
13
13
  "approve_in_progress",
14
14
  "waiting_to_be_paid",
15
15
  "partially_paid"
16
16
  ]);
17
- function r(e, t) {
18
- if (!t || !e || !n.has(e)) return !1;
19
- let r = /* @__PURE__ */ new Date();
20
- r.setUTCHours(0, 0, 0, 0);
17
+ function i(e, t) {
18
+ if (!t || !e || !r.has(e)) return !1;
19
+ let n = /* @__PURE__ */ new Date();
20
+ n.setUTCHours(0, 0, 0, 0);
21
21
  let i = new Date(t);
22
- return i.setUTCHours(0, 0, 0, 0), i.getTime() < r.getTime();
22
+ return i.setUTCHours(0, 0, 0, 0), i.getTime() < n.getTime();
23
23
  }
24
- var i = {
24
+ var a = {
25
25
  draft: ["billStatusDraft", "billNeutral"],
26
26
  new: ["billStatusReadyToSubmit", "billAccent"],
27
27
  approve_in_progress: ["billStatusPendingApproval", "billInfo"],
@@ -30,7 +30,7 @@ var i = {
30
30
  paid: ["billStatusPaid", "billSettled"],
31
31
  canceled: ["billStatusCanceled", "billNeutral"],
32
32
  rejected: ["billStatusRejected", "billDanger"]
33
- }, a = {
33
+ }, o = {
34
34
  draft: ["receivableStatusDraft", "invoiceNeutral"],
35
35
  recurring: ["receivableStatusRecurring", "invoiceNeutral"],
36
36
  issuing: ["receivableStatusIssuing", "invoiceCyan"],
@@ -46,53 +46,54 @@ var i = {
46
46
  declined: ["receivableStatusDeclined", "invoiceDanger"],
47
47
  deleted: ["receivableStatusDeleted", "invoiceDanger"]
48
48
  };
49
- function o(e, t, n) {
50
- let [r, o] = (t === "bill" ? i : a)[e ?? ""] ?? ["receivableStatusUnknown", t === "bill" ? "billNeutral" : "invoiceNeutral"];
49
+ function s(e, t, n) {
50
+ let [r, i] = (t === "bill" ? a : o)[e ?? ""] ?? ["receivableStatusUnknown", t === "bill" ? "billNeutral" : "invoiceNeutral"];
51
51
  return {
52
52
  statusLabel: n[r],
53
- statusTone: o
53
+ statusTone: i
54
54
  };
55
55
  }
56
- var s = new Intl.DateTimeFormat(void 0, {
56
+ var c = new Intl.DateTimeFormat(void 0, {
57
57
  day: "2-digit",
58
58
  month: "short",
59
59
  year: "numeric"
60
60
  });
61
- function c(e) {
61
+ function l(e) {
62
62
  if (!e) return "";
63
63
  let t = new Date(e);
64
- return Number.isNaN(t.getTime()) ? "" : s.format(t);
64
+ return Number.isNaN(t.getTime()) ? "" : c.format(t);
65
65
  }
66
- function l(t, n, i) {
66
+ function u(t, n, r) {
67
67
  return (t ?? []).map((t) => {
68
- let a = t.status ?? void 0, s = n === "bill" && r(a, t.due_date), l = o(a, n, i);
68
+ let a = t.status ?? void 0, o = n === "bill" && i(a, t.due_date), c = s(a, n, r);
69
69
  return {
70
70
  id: t.id,
71
71
  amountLabel: e(t.total_amount ?? 0, t.currency ?? void 0),
72
- dateLabel: c(t.issued_at ?? t.issue_date ?? t.created_at),
73
- ...l,
74
- isOverdue: s
72
+ dateLabel: l(t.issued_at ?? t.issue_date ?? t.created_at),
73
+ ...c,
74
+ isOverdue: o
75
75
  };
76
76
  });
77
77
  }
78
- function u(e) {
78
+ function d(e) {
79
79
  return e ? `•••• ${e.slice(-4)}` : "";
80
80
  }
81
- function d(e, t) {
82
- if (e) return {
83
- id: e.id,
84
- title: t,
85
- accountHolderLabel: e.account_holder_name ?? "",
86
- accountNumberLabel: u(e.account_number),
87
- routingNumberLabel: e.routing_number ?? "",
88
- isIncomplete: !(e.account_holder_name && e.account_number && e.routing_number)
81
+ function f(e, n) {
82
+ let r = e?.find(t);
83
+ if (r) return {
84
+ id: r.id,
85
+ title: n,
86
+ accountHolderLabel: r.account_holder_name ?? "",
87
+ accountNumberLabel: d(r.account_number),
88
+ routingNumberLabel: r.routing_number ?? "",
89
+ isIncomplete: !(r.account_holder_name && r.account_number && r.routing_number)
89
90
  };
90
91
  }
91
- function f(e, t) {
92
+ function p(e, t) {
92
93
  if (!t) return e;
93
94
  let n = t.address;
94
95
  return {
95
- ...m({
96
+ ...h({
96
97
  editingAddressHeading: t.title,
97
98
  addingAddressHeading: t.title,
98
99
  cancelButton: t.cancelButton,
@@ -109,21 +110,21 @@ function f(e, t) {
109
110
  ...e
110
111
  };
111
112
  }
112
- function p(e) {
113
+ function m(e) {
113
114
  return e ? {
114
115
  fieldMarkers: e.fieldMarkers,
115
116
  addressFieldMarkers: e.address?.fieldMarkers,
116
117
  requiredFieldsLegend: e.requiredFieldsLegend
117
118
  } : {};
118
119
  }
119
- function m(e) {
120
+ function h(e) {
120
121
  return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
121
122
  }
122
- function h(e) {
123
+ function g(e) {
123
124
  if (!e) return {};
124
125
  let t = e.address;
125
126
  return {
126
- labels: m({
127
+ labels: h({
127
128
  editingCustomerDetailsHeading: e.editTitleCustomer,
128
129
  editingVendorDetailsHeading: e.editTitleVendor,
129
130
  firstNameLabel: e.firstNameLabel,
@@ -155,7 +156,7 @@ function h(e) {
155
156
  requiredFieldsLegend: e.requiredFieldsLegend
156
157
  };
157
158
  }
158
- var g = {
159
+ var _ = {
159
160
  firstName: "firstName",
160
161
  lastName: "lastName",
161
162
  businessName: "legalName",
@@ -163,7 +164,7 @@ var g = {
163
164
  phone: "phone",
164
165
  taxId: "taxId"
165
166
  };
166
- function _(e, t, n, r) {
167
+ function v(e, t, n, r) {
167
168
  let i = e === "vendor", a = t.entityType === "individual";
168
169
  return {
169
170
  heading: i ? r.editingVendorDetailsHeading : r.editingCustomerDetailsHeading,
@@ -209,4 +210,4 @@ function _(e, t, n, r) {
209
210
  };
210
211
  }
211
212
  //#endregion
212
- export { g as EDIT_FORM_FIELD_KEYS, p as addressFormLabelOverrides, _ as buildCounterpartEditFormView, d as buildPaymentMethodView, l as buildRecentDocumentRows, h as editFormLabelOverrides, c as formatDetailsDate, t as maskTaxId, f as withAddressLabelOverrides };
213
+ export { _ as EDIT_FORM_FIELD_KEYS, m as addressFormLabelOverrides, v as buildCounterpartEditFormView, f as buildPaymentMethodView, u as buildRecentDocumentRows, g as editFormLabelOverrides, l as formatDetailsDate, n as maskTaxId, p as withAddressLabelOverrides };
@@ -1,4 +1,4 @@
1
1
  import { COUNTERPART_DETAILS_SHEET_LABELS_EN as e } from "./index2.js";
2
2
  import { CounterpartsScreen as t } from "./index3.js";
3
- import { CounterpartDetailsSheet as n } from "./index6.js";
3
+ import { CounterpartDetailsSheet as n } from "./index7.js";
4
4
  export { e as COUNTERPART_DETAILS_SHEET_LABELS_EN, n as CounterpartDetailsSheet, t as CounterpartsScreen };
@@ -1,9 +1,5 @@
1
- import { Button as e, LABEL_LABELS_EN as t, RequiredFieldsLegend as n, Spinner as r, Typography as i, mergeRequiredFieldsLegendLabels as a } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { CounterpartAddressFields as o } from "../../../shared/counterpart-management/ui/dist/index7.js";
3
- import "../../../shared/counterpart-management/ui/dist/index.js";
4
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
5
1
  //#region ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js
6
- function l(e, t) {
2
+ function e(e, t) {
7
3
  return {
8
4
  line1: e.streetAddressLabel,
9
5
  line2: e.addressLine2Label,
@@ -16,64 +12,5 @@ function l(e, t) {
16
12
  fieldMarkers: t
17
13
  };
18
14
  }
19
- function u({ form: u, labels: d }) {
20
- let f = {
21
- ...t,
22
- ...u.fieldMarkers
23
- };
24
- return /* @__PURE__ */ c("form", {
25
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-[10px] ttw:border ttw:border-border ttw:bg-muted ttw:p-4",
26
- onSubmit: (e) => {
27
- e.preventDefault(), u.onSubmit();
28
- },
29
- children: [/* @__PURE__ */ c("div", {
30
- className: "ttw:flex ttw:flex-col ttw:gap-4",
31
- children: [
32
- /* @__PURE__ */ s("div", {
33
- className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3 ttw:border-b ttw:border-border ttw:pt-6 ttw:pb-7",
34
- children: /* @__PURE__ */ s(i, {
35
- variant: "body1",
36
- className: "ttw:font-medium",
37
- children: u.hasExistingAddress ? d.editingAddressHeading : d.addingAddressHeading
38
- })
39
- }),
40
- /* @__PURE__ */ s(n, { labels: a(f, u.requiredFieldsLegend) }),
41
- u.formError && /* @__PURE__ */ s(i, {
42
- variant: "body2",
43
- color: "destructive",
44
- role: "alert",
45
- children: u.formError
46
- }),
47
- /* @__PURE__ */ s(o, {
48
- idPrefix: "counterpart-address-form",
49
- values: u.values,
50
- errors: u.errors,
51
- stateOptions: u.stateOptions,
52
- disabled: u.inProgress,
53
- onChange: u.onChange,
54
- labels: l(d, {
55
- ...f,
56
- ...u.addressFieldMarkers
57
- })
58
- })
59
- ]
60
- }), /* @__PURE__ */ c("div", {
61
- className: "ttw:flex ttw:justify-end ttw:gap-4 ttw:pt-6",
62
- children: [/* @__PURE__ */ s(e, {
63
- type: "button",
64
- variant: "outline",
65
- className: "ttw:w-fit ttw:border-border",
66
- disabled: u.inProgress,
67
- onClick: u.onCancel,
68
- children: d.cancelButton
69
- }), /* @__PURE__ */ c(e, {
70
- type: "submit",
71
- className: "ttw:w-fit",
72
- disabled: u.inProgress || u.submitDisabled,
73
- children: [u.inProgress && /* @__PURE__ */ s(r, {}), d.saveButton]
74
- })]
75
- })]
76
- });
77
- }
78
15
  //#endregion
79
- export { u as CounterpartAddressForm, l as addressFieldLabels };
16
+ export { e as addressFieldLabels };