@tesouro/embedded-components-react 0.7.21 → 0.7.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/fixtures/index.d.ts +5 -1
  2. package/dist/index.d.ts +9 -1
  3. package/dist/lib/CounterpartsWidget.d.ts +9 -1
  4. package/dist/lib/CounterpartsWidgetPublic.d.ts +9 -1
  5. package/dist/lib/CustomersWidget.d.ts +9 -1
  6. package/dist/lib/ReceivablesWidget.d.ts +9 -1
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +50 -51
  10. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +4 -2
  11. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +1 -1
  12. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +72 -128
  14. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +183 -38
  15. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +503 -193
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +57 -55
  17. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +14 -14
  18. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +114 -102
  19. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +12 -11
  20. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +534 -7
  21. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +7 -179
  22. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +179 -6
  23. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +3 -1
  24. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index14.js +4 -28
  25. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +28 -4
  26. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index16.js +4 -0
  27. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +10 -2
  28. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index7.js +140 -55
  29. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js +53 -47
  30. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +51 -539
  31. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js +6 -3
  32. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +584 -549
  33. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  34. package/package.json +1 -1
  35. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +0 -520
@@ -1196,6 +1196,10 @@ type DocumentVerificationTextAttemptOutput = {
1196
1196
  * When the text was requested (UTC).
1197
1197
  */
1198
1198
  attemptedAt: string;
1199
+ /**
1200
+ * Whether the destination for this text attempt matched `applicationPhoneNumber`.
1201
+ */
1202
+ isApplicationPhoneNumber?: null | boolean;
1199
1203
  /**
1200
1204
  * The last four digits of the number the text was requested for.
1201
1205
  */
@@ -4166,7 +4170,7 @@ type TransactionResponse = {
4166
4170
  */
4167
4171
  entity_id: string;
4168
4172
  /**
4169
- * ID of the entity user who made the transaction, if applicable.
4173
+ * ID of the entity user who owns the transaction. Must be an active or invited user of the organization. When omitted and the request is made as an entity user, the caller becomes the owner; an explicit null leaves the transaction unowned. A caller limited to their own transactions may only name themselves or one of their direct reportees, and becomes the owner when the field is null.
4170
4174
  */
4171
4175
  entity_user_id?: string | null;
4172
4176
  /**
package/dist/index.d.ts CHANGED
@@ -4361,7 +4361,12 @@ interface CounterpartFormSheetLabels {
4361
4361
  titleLabel: string;
4362
4362
  emailLabel: string;
4363
4363
  phoneLabel: string;
4364
+ /** Used by the inline fields; the sheet prefers the SSN/EIN keys and falls back to this. */
4364
4365
  taxIdLabel: string;
4366
+ taxIdSsnLabel: string;
4367
+ taxIdEinLabel: string;
4368
+ taxIdSsnPlaceholder: string;
4369
+ taxIdEinPlaceholder: string;
4365
4370
  customerTaxIdHelp: string;
4366
4371
  vendorTaxIdHelp: string;
4367
4372
  paymentRemindersLabel: string;
@@ -4382,7 +4387,10 @@ interface CounterpartFormSheetLabels {
4382
4387
  accountNumberLabel?: string;
4383
4388
  addAddress: string;
4384
4389
  cancelButton: string;
4385
- createButton: string;
4390
+ /** @deprecated Superseded by `createButtonCustomer` / `createButtonVendor`. */
4391
+ createButton?: string;
4392
+ createButtonCustomer: string;
4393
+ createButtonVendor: string;
4386
4394
  saveButton: string;
4387
4395
  address: AddressFieldGroupLabels;
4388
4396
  ach: AchFieldGroupLabels;
@@ -704,7 +704,12 @@ interface CounterpartFormSheetLabels {
704
704
  titleLabel: string;
705
705
  emailLabel: string;
706
706
  phoneLabel: string;
707
+ /** Used by the inline fields; the sheet prefers the SSN/EIN keys and falls back to this. */
707
708
  taxIdLabel: string;
709
+ taxIdSsnLabel: string;
710
+ taxIdEinLabel: string;
711
+ taxIdSsnPlaceholder: string;
712
+ taxIdEinPlaceholder: string;
708
713
  customerTaxIdHelp: string;
709
714
  vendorTaxIdHelp: string;
710
715
  paymentRemindersLabel: string;
@@ -725,7 +730,10 @@ interface CounterpartFormSheetLabels {
725
730
  accountNumberLabel?: string;
726
731
  addAddress: string;
727
732
  cancelButton: string;
728
- createButton: string;
733
+ /** @deprecated Superseded by `createButtonCustomer` / `createButtonVendor`. */
734
+ createButton?: string;
735
+ createButtonCustomer: string;
736
+ createButtonVendor: string;
729
737
  saveButton: string;
730
738
  address: AddressFieldGroupLabels;
731
739
  ach: AchFieldGroupLabels;
@@ -704,7 +704,12 @@ interface CounterpartFormSheetLabels {
704
704
  titleLabel: string;
705
705
  emailLabel: string;
706
706
  phoneLabel: string;
707
+ /** Used by the inline fields; the sheet prefers the SSN/EIN keys and falls back to this. */
707
708
  taxIdLabel: string;
709
+ taxIdSsnLabel: string;
710
+ taxIdEinLabel: string;
711
+ taxIdSsnPlaceholder: string;
712
+ taxIdEinPlaceholder: string;
708
713
  customerTaxIdHelp: string;
709
714
  vendorTaxIdHelp: string;
710
715
  paymentRemindersLabel: string;
@@ -725,7 +730,10 @@ interface CounterpartFormSheetLabels {
725
730
  accountNumberLabel?: string;
726
731
  addAddress: string;
727
732
  cancelButton: string;
728
- createButton: string;
733
+ /** @deprecated Superseded by `createButtonCustomer` / `createButtonVendor`. */
734
+ createButton?: string;
735
+ createButtonCustomer: string;
736
+ createButtonVendor: string;
729
737
  saveButton: string;
730
738
  address: AddressFieldGroupLabels;
731
739
  ach: AchFieldGroupLabels;
@@ -705,7 +705,12 @@ interface CounterpartFormSheetLabels {
705
705
  titleLabel: string;
706
706
  emailLabel: string;
707
707
  phoneLabel: string;
708
+ /** Used by the inline fields; the sheet prefers the SSN/EIN keys and falls back to this. */
708
709
  taxIdLabel: string;
710
+ taxIdSsnLabel: string;
711
+ taxIdEinLabel: string;
712
+ taxIdSsnPlaceholder: string;
713
+ taxIdEinPlaceholder: string;
709
714
  customerTaxIdHelp: string;
710
715
  vendorTaxIdHelp: string;
711
716
  paymentRemindersLabel: string;
@@ -726,7 +731,10 @@ interface CounterpartFormSheetLabels {
726
731
  accountNumberLabel?: string;
727
732
  addAddress: string;
728
733
  cancelButton: string;
729
- createButton: string;
734
+ /** @deprecated Superseded by `createButtonCustomer` / `createButtonVendor`. */
735
+ createButton?: string;
736
+ createButtonCustomer: string;
737
+ createButtonVendor: string;
730
738
  saveButton: string;
731
739
  address: AddressFieldGroupLabels;
732
740
  ach: AchFieldGroupLabels;
@@ -793,7 +793,12 @@ interface CounterpartFormSheetLabels {
793
793
  titleLabel: string;
794
794
  emailLabel: string;
795
795
  phoneLabel: string;
796
+ /** Used by the inline fields; the sheet prefers the SSN/EIN keys and falls back to this. */
796
797
  taxIdLabel: string;
798
+ taxIdSsnLabel: string;
799
+ taxIdEinLabel: string;
800
+ taxIdSsnPlaceholder: string;
801
+ taxIdEinPlaceholder: string;
797
802
  customerTaxIdHelp: string;
798
803
  vendorTaxIdHelp: string;
799
804
  paymentRemindersLabel: string;
@@ -814,7 +819,10 @@ interface CounterpartFormSheetLabels {
814
819
  accountNumberLabel?: string;
815
820
  addAddress: string;
816
821
  cancelButton: string;
817
- createButton: string;
822
+ /** @deprecated Superseded by `createButtonCustomer` / `createButtonVendor`. */
823
+ createButton?: string;
824
+ createButtonCustomer: string;
825
+ createButtonVendor: string;
818
826
  saveButton: string;
819
827
  address: AddressFieldGroupLabels;
820
828
  ach: AchFieldGroupLabels;
@@ -5,7 +5,7 @@
5
5
  import { Button as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
6
  import { getStateOptions as t } from "../../../../shared/util/dist/lib/usStates.js";
7
7
  import { AchFieldGroup as n } from "../../../../shared/counterpart-management/ui/dist/index5.js";
8
- import { CounterpartFormFields as r, countErrors as i, useFocusFirstInvalidField as a } from "../../../../shared/counterpart-management/ui/dist/index9.js";
8
+ import { CounterpartFormFields as r, countErrors as i, useFocusFirstInvalidField as a } from "../../../../shared/counterpart-management/ui/dist/index10.js";
9
9
  import "../../../../shared/counterpart-management/ui/dist/index.js";
10
10
  import { VendorSearchCombobox as o } from "../../ui/dist/index24.js";
11
11
  import "../../ui/dist/index.js";
@@ -7,7 +7,7 @@ import "../../../../../shared/feature/dist/index.js";
7
7
  import { getCounterpartPermissions as t } from "./permissions.js";
8
8
  import { useCounterpartDetailsSheetView as n } from "./useCounterpartDetailsSheetView.js";
9
9
  import { COUNTERPART_DETAILS_SHEET_LABELS_EN as r } from "../../../../ui/dist/index2.js";
10
- import { CounterpartDetailsSheet as i } from "../../../../ui/dist/index7.js";
10
+ import { CounterpartDetailsSheet as i } from "../../../../ui/dist/index6.js";
11
11
  import "../../../../ui/dist/index.js";
12
12
  import { useMemo as a } from "react";
13
13
  import { jsx as o } from "react/jsx-runtime";
@@ -7,32 +7,33 @@ import "../../../../../shared/ui/dist/index.js";
7
7
  import { useAnalyticsTrack as t } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
8
8
  import { WidgetProvider as n } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
9
9
  import "../../../../../shared/feature/dist/index.js";
10
- import { CounterpartFormSheet as r } from "../../../../../shared/counterpart-management/ui/dist/index9.js";
11
- import { BankAccountFormSheet as i } from "../../../../../shared/counterpart-management/ui/dist/index11.js";
12
- import { ConfirmDeleteDialog as a } from "../../../../../shared/counterpart-management/ui/dist/index14.js";
10
+ import { CounterpartFormSheet as r } from "../../../../../shared/counterpart-management/ui/dist/index10.js";
11
+ import { BankAccountFormSheet as i } from "../../../../../shared/counterpart-management/ui/dist/index12.js";
12
+ import { ConfirmDeleteDialog as a } from "../../../../../shared/counterpart-management/ui/dist/index15.js";
13
+ import { buildCounterpartFormTaxIdField as o } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
13
14
  import "../../../../../shared/counterpart-management/feature/dist/index.js";
14
- import { CounterpartsWidgetAnalyticsEvent as o, WIDGET_NAME as s } from "../analytics/events.js";
15
- import { PAGE_SIZE_OPTIONS as c } from "./constants.js";
16
- import { EDIT_FORM_FIELD_KEYS as l, addressFormLabelOverrides as u, buildCounterpartEditFormView as d, editFormLabelOverrides as f, withAddressLabelOverrides as p } from "./viewModels.js";
17
- import { COUNTERPART_DETAILS_SHEET_LABELS_EN as m } from "../../../../ui/dist/index2.js";
18
- import { CounterpartsScreen as h } from "../../../../ui/dist/index3.js";
19
- import { CounterpartDetailsSheet as g } from "../../../../ui/dist/index7.js";
15
+ import { CounterpartsWidgetAnalyticsEvent as s, WIDGET_NAME as c } from "../analytics/events.js";
16
+ import { PAGE_SIZE_OPTIONS as l } from "./constants.js";
17
+ import { EDIT_FORM_FIELD_KEYS as u, addressFormLabelOverrides as d, buildCounterpartEditFormView as f, editFormLabelOverrides as p, withAddressLabelOverrides as m } from "./viewModels.js";
18
+ import { COUNTERPART_DETAILS_SHEET_LABELS_EN as h } from "../../../../ui/dist/index2.js";
19
+ import { CounterpartsScreen as g } from "../../../../ui/dist/index3.js";
20
+ import { CounterpartDetailsSheet as _ } from "../../../../ui/dist/index6.js";
20
21
  import "../../../../ui/dist/index.js";
21
- import { useCounterpartsWidget as _ } from "./useCounterpartsWidget.js";
22
- import { useEffect as v, useMemo as y } from "react";
23
- import { Fragment as ee, jsx as b, jsxs as x } from "react/jsx-runtime";
22
+ import { useCounterpartsWidget as v } from "./useCounterpartsWidget.js";
23
+ import { useEffect as ee, useMemo as y } from "react";
24
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
24
25
  //#region ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js
25
- function S({ counterpartType: n, pageSizeOptions: s = c, onViewAllDocuments: S, onCreateDocument: C, screenLabels: w, formLabels: T, detailsLabels: E, bankAccountLabels: D, addressLabels: O, deleteLabels: k, messageLabels: A }) {
26
- let j = t();
27
- v(() => {
28
- j(o.Mounted);
29
- }, [j]);
30
- let { stateOptions: M, isEditDirty: N, isAddressDirty: P, selectedId: F, view: I, table: L, details: R, detailsSheetView: z, permissions: B, isPermissionLoading: V, form: H, bank: U, address: W, del: G, handleRowClick: K, closeDetails: q, handleEditProfile: J } = _({
26
+ function C({ counterpartType: n, pageSizeOptions: c = l, onViewAllDocuments: C, onCreateDocument: w, screenLabels: T, formLabels: E, detailsLabels: D, bankAccountLabels: O, addressLabels: k, deleteLabels: A, messageLabels: j }) {
27
+ let M = t();
28
+ ee(() => {
29
+ M(s.Mounted);
30
+ }, [M]);
31
+ let { stateOptions: N, isEditDirty: P, isAddressDirty: te, selectedId: F, view: I, table: L, details: R, detailsSheetView: z, permissions: B, isPermissionLoading: V, form: H, bank: U, address: W, del: G, handleRowClick: K, closeDetails: q, handleEditProfile: J } = v({
31
32
  counterpartType: n,
32
- detailsLabels: E,
33
- messageLabels: A
34
- }), Y = y(() => p(E, O), [O, E]), X = y(() => u(O), [O]), Z = y(() => f(T), [T]), Q = y(() => I === "edit" ? d(n, H.values, H.errors, {
35
- ...m,
33
+ detailsLabels: D,
34
+ messageLabels: j
35
+ }), Y = y(() => m(D, k), [k, D]), X = y(() => d(k), [k]), Z = y(() => p(E), [E]), Q = y(() => I === "edit" ? f(n, H.values, H.errors, {
36
+ ...h,
36
37
  ...Y,
37
38
  ...Z.labels
38
39
  }) : void 0, [
@@ -46,9 +47,9 @@ function S({ counterpartType: n, pageSizeOptions: s = c, onViewAllDocuments: S,
46
47
  id: F,
47
48
  name: z.name
48
49
  } : void 0, [z, F]);
49
- return /* @__PURE__ */ x(ee, { children: [
50
- /* @__PURE__ */ b(e, {}),
51
- /* @__PURE__ */ b(h, {
50
+ return /* @__PURE__ */ S(b, { children: [
51
+ /* @__PURE__ */ x(e, {}),
52
+ /* @__PURE__ */ x(g, {
52
53
  mode: n,
53
54
  counterparts: L.rows,
54
55
  isLoading: V || L.isLoading,
@@ -57,7 +58,7 @@ function S({ counterpartType: n, pageSizeOptions: s = c, onViewAllDocuments: S,
57
58
  onSortingChange: L.onSortingChange,
58
59
  pageSize: L.pageSize,
59
60
  onPageSizeChange: L.onPageSizeChange,
60
- pageSizeOptions: s,
61
+ pageSizeOptions: c,
61
62
  hasNextPage: L.hasNextPage,
62
63
  hasPrevPage: L.hasPrevPage,
63
64
  onNextPage: L.onNextPage,
@@ -72,11 +73,11 @@ function S({ counterpartType: n, pageSizeOptions: s = c, onViewAllDocuments: S,
72
73
  onCreateClick: B.canCreate ? H.openCreate : () => void 0,
73
74
  onRowClick: K,
74
75
  onRetry: L.onRetry,
75
- labels: w,
76
+ labels: T,
76
77
  emptyStateTestId: "counterparts-widget-empty-state",
77
78
  accessRestrictedTestId: "counterparts-widget-access-restricted"
78
79
  }),
79
- /* @__PURE__ */ b(r, {
80
+ /* @__PURE__ */ x(r, {
80
81
  open: I === "create",
81
82
  onOpenChange: (e) => {
82
83
  e || H.close();
@@ -85,7 +86,8 @@ function S({ counterpartType: n, pageSizeOptions: s = c, onViewAllDocuments: S,
85
86
  counterpartMode: n,
86
87
  values: H.values,
87
88
  errors: H.errors,
88
- stateOptions: M,
89
+ stateOptions: N,
90
+ taxIdField: o(H.values.entityType, n, E),
89
91
  inProgress: H.isSubmitting,
90
92
  submitDisabled: H.isSubmitting,
91
93
  onChange: (e) => H.setValues((t) => ({
@@ -108,12 +110,9 @@ function S({ counterpartType: n, pageSizeOptions: s = c, onViewAllDocuments: S,
108
110
  })),
109
111
  onSubmit: H.submit,
110
112
  onCancel: H.close,
111
- sections: { address: "collapsible" },
112
- sectionsToExpand: H.sectionsToExpand,
113
- onAddressExpand: H.expandAddress,
114
- labels: T
113
+ labels: E
115
114
  }),
116
- /* @__PURE__ */ b(g, {
115
+ /* @__PURE__ */ x(_, {
117
116
  open: F !== void 0 && (I === "none" || I === "edit"),
118
117
  onOpenChange: (e) => {
119
118
  e || q();
@@ -132,8 +131,8 @@ function S({ counterpartType: n, pageSizeOptions: s = c, onViewAllDocuments: S,
132
131
  onEditAddress: W.openEdit,
133
132
  onAddBankAccount: U.form.openCreate,
134
133
  onEditBankAccount: U.form.openEdit,
135
- onViewAllDocuments: S && $ ? () => S($) : void 0,
136
- onCreateDocument: C && $ ? () => C($) : void 0,
134
+ onViewAllDocuments: C && $ ? () => C($) : void 0,
135
+ onCreateDocument: w && $ ? () => w($) : void 0,
137
136
  onDeleteBankAccount: (e) => G.requestDelete({
138
137
  kind: "bankAccount",
139
138
  id: e,
@@ -142,12 +141,12 @@ function S({ counterpartType: n, pageSizeOptions: s = c, onViewAllDocuments: S,
142
141
  editForm: Q && {
143
142
  ...Q,
144
143
  ...Z,
145
- stateOptions: M,
144
+ stateOptions: N,
146
145
  inProgress: H.isSubmitting,
147
- submitDisabled: !N,
146
+ submitDisabled: !P,
148
147
  onFieldChange: (e, t) => H.setValues((n) => ({
149
148
  ...n,
150
- [l[e]]: t
149
+ [u[e]]: t
151
150
  })),
152
151
  onRemindersChange: (e) => H.setValues((t) => ({
153
152
  ...t,
@@ -167,9 +166,9 @@ function S({ counterpartType: n, pageSizeOptions: s = c, onViewAllDocuments: S,
167
166
  hasExistingAddress: !!R.primaryAddress,
168
167
  values: W.values,
169
168
  errors: W.errors,
170
- stateOptions: M,
169
+ stateOptions: N,
171
170
  inProgress: W.isPending,
172
- submitDisabled: !P,
171
+ submitDisabled: !te,
173
172
  formError: W.formError,
174
173
  ...X,
175
174
  onChange: (e) => W.setValues((t) => ({
@@ -181,7 +180,7 @@ function S({ counterpartType: n, pageSizeOptions: s = c, onViewAllDocuments: S,
181
180
  } : void 0,
182
181
  labels: Y
183
182
  }),
184
- /* @__PURE__ */ b(i, {
183
+ /* @__PURE__ */ x(i, {
185
184
  open: U.form.sheet.open,
186
185
  onOpenChange: (e) => {
187
186
  e || U.form.close();
@@ -197,9 +196,9 @@ function S({ counterpartType: n, pageSizeOptions: s = c, onViewAllDocuments: S,
197
196
  })),
198
197
  onSubmit: U.form.submit,
199
198
  onCancel: U.form.close,
200
- labels: D
199
+ labels: O
201
200
  }),
202
- /* @__PURE__ */ b(a, {
201
+ /* @__PURE__ */ x(a, {
203
202
  open: G.target !== null,
204
203
  onOpenChange: (e) => {
205
204
  e || G.close();
@@ -209,28 +208,28 @@ function S({ counterpartType: n, pageSizeOptions: s = c, onViewAllDocuments: S,
209
208
  isDeleting: G.isDeleting,
210
209
  onConfirm: G.confirm,
211
210
  onCancel: G.close,
212
- labels: k
211
+ labels: A
213
212
  })
214
213
  ] });
215
214
  }
216
- function C({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: o, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, passThrough: h, ...g }) {
217
- return /* @__PURE__ */ b(n, {
218
- widgetName: h === !0 && e === void 0 && t === void 0 ? void 0 : s,
215
+ function w({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: o, implementation: s, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, passThrough: h, ...g }) {
216
+ return /* @__PURE__ */ x(n, {
217
+ widgetName: h === !0 && e === void 0 && t === void 0 ? void 0 : c,
219
218
  baseUrl: e,
220
219
  widgetToken: t,
221
220
  organizationId: r,
222
221
  configClient: i,
223
222
  gatewayRouting: a,
224
223
  linkComponent: o,
225
- implementation: c,
224
+ implementation: s,
226
225
  uiFramework: l,
227
226
  errorFallback: u,
228
227
  onError: d,
229
228
  analytics: f,
230
229
  disclosuresAcceptance: p,
231
230
  providerLabels: m,
232
- children: /* @__PURE__ */ b(S, { ...g }, g.counterpartType)
231
+ children: /* @__PURE__ */ x(C, { ...g }, g.counterpartType)
233
232
  });
234
233
  }
235
234
  //#endregion
236
- export { C as CounterpartsWidget, C as default };
235
+ export { w as CounterpartsWidget, w as default };
@@ -131,8 +131,10 @@ function h(e) {
131
131
  businessNameLabel: e.businessNameLabel,
132
132
  rowEmail: e.emailLabel,
133
133
  rowPhone: e.phoneLabel,
134
- rowTaxIdSsn: e.taxIdLabel,
135
- rowTaxIdEin: e.taxIdLabel,
134
+ rowTaxIdSsn: e.taxIdSsnLabel ?? e.taxIdLabel,
135
+ rowTaxIdEin: e.taxIdEinLabel ?? e.taxIdLabel,
136
+ taxIdSsnPlaceholder: e.taxIdSsnPlaceholder,
137
+ taxIdEinPlaceholder: e.taxIdEinPlaceholder,
136
138
  customerTaxIdHelp: e.customerTaxIdHelp,
137
139
  vendorTaxIdHelp: e.vendorTaxIdHelp,
138
140
  remindersCheckboxLabel: e.paymentRemindersLabel,
@@ -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 "./index7.js";
3
+ import { CounterpartDetailsSheet as n } from "./index6.js";
4
4
  export { e as COUNTERPART_DETAILS_SHEET_LABELS_EN, n as CounterpartDetailsSheet, t as CounterpartsScreen };
@@ -124,7 +124,7 @@ var e = {
124
124
  businessNameLabel: "Business name",
125
125
  remindersCheckboxLabel: "Payment reminders",
126
126
  remindersCheckboxDescription: "Send automatic reminders for unpaid customer invoices.",
127
- taxIdSsnPlaceholder: "e.g., 034-56-78890",
127
+ taxIdSsnPlaceholder: "e.g., 034-56-7890",
128
128
  taxIdEinPlaceholder: "e.g., 12-3456789",
129
129
  editingAddressHeading: "Editing address",
130
130
  addingAddressHeading: "Adding address",
@@ -1,135 +1,79 @@
1
- import { Field as e, FieldContent as t, FieldError as n, FieldLabel as r, Input as i, Select as a, SelectContent as o, SelectItem as s, SelectTrigger as c, SelectValue as l } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
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";
3
5
  //#region ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js
4
- var p = "US";
5
- function m(e) {
6
- return e ? [{ message: e }] : void 0;
6
+ function l(e, t) {
7
+ return {
8
+ line1: e.streetAddressLabel,
9
+ line2: e.addressLine2Label,
10
+ city: e.cityLabel,
11
+ state: e.stateLabel,
12
+ statePlaceholder: e.statePlaceholder,
13
+ postalCode: e.postalCodeLabel,
14
+ country: e.countryLabel,
15
+ countryValue: e.countryUnitedStates,
16
+ fieldMarkers: t
17
+ };
7
18
  }
8
- function h({ idPrefix: h, values: g, errors: _, stateOptions: v, disabled: y, onChange: b, labels: x, fieldMarkers: S }) {
9
- let C = {
10
- line1: `${h}-line1`,
11
- line2: `${h}-line2`,
12
- city: `${h}-city`,
13
- state: `${h}-state`,
14
- postalCode: `${h}-postal-code`,
15
- country: `${h}-country`
19
+ function u({ form: u, labels: d }) {
20
+ let f = {
21
+ ...t,
22
+ ...u.fieldMarkers
16
23
  };
17
- return /* @__PURE__ */ f(u, { children: [
18
- /* @__PURE__ */ f("div", {
19
- className: "ttw:flex ttw:gap-4",
20
- children: [/* @__PURE__ */ d(e, { children: /* @__PURE__ */ f(t, { children: [
21
- /* @__PURE__ */ d(r, {
22
- htmlFor: C.line1,
23
- requirement: "required",
24
- labels: S,
25
- children: x.streetAddressLabel
26
- }),
27
- /* @__PURE__ */ d(i, {
28
- id: C.line1,
29
- "aria-required": !0,
30
- className: "ttw:bg-background",
31
- value: g.line1,
32
- disabled: y,
33
- "aria-invalid": !!_?.line1 || void 0,
34
- onChange: (e) => b({ line1: e.target.value })
35
- }),
36
- /* @__PURE__ */ d(n, { errors: m(_?.line1) })
37
- ] }) }), /* @__PURE__ */ d(e, { children: /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d(r, {
38
- htmlFor: C.line2,
39
- requirement: "optional",
40
- labels: S,
41
- children: x.addressLine2Label
42
- }), /* @__PURE__ */ d(i, {
43
- id: C.line2,
44
- className: "ttw:bg-background",
45
- value: g.line2,
46
- disabled: y,
47
- onChange: (e) => b({ line2: e.target.value })
48
- })] }) })]
49
- }),
50
- /* @__PURE__ */ f("div", {
51
- className: "ttw:flex ttw:gap-4",
52
- children: [/* @__PURE__ */ d(e, { children: /* @__PURE__ */ f(t, { children: [
53
- /* @__PURE__ */ d(r, {
54
- htmlFor: C.city,
55
- requirement: "required",
56
- labels: S,
57
- children: x.cityLabel
58
- }),
59
- /* @__PURE__ */ d(i, {
60
- id: C.city,
61
- "aria-required": !0,
62
- className: "ttw:bg-background",
63
- value: g.city,
64
- disabled: y,
65
- "aria-invalid": !!_?.city || void 0,
66
- onChange: (e) => b({ city: e.target.value })
67
- }),
68
- /* @__PURE__ */ d(n, { errors: m(_?.city) })
69
- ] }) }), /* @__PURE__ */ d(e, { children: /* @__PURE__ */ f(t, { children: [
70
- /* @__PURE__ */ d(r, {
71
- htmlFor: C.state,
72
- requirement: "required",
73
- labels: S,
74
- children: x.stateLabel
75
- }),
76
- /* @__PURE__ */ f(a, {
77
- value: g.state || void 0,
78
- disabled: y,
79
- onValueChange: (e) => b({ state: e }),
80
- children: [/* @__PURE__ */ d(c, {
81
- id: C.state,
82
- "aria-required": !0,
83
- className: "ttw:w-full ttw:bg-background",
84
- "aria-invalid": !!_?.state || void 0,
85
- children: /* @__PURE__ */ d(l, { placeholder: x.statePlaceholder })
86
- }), /* @__PURE__ */ d(o, { children: v.map((e) => /* @__PURE__ */ d(s, {
87
- value: e.value,
88
- children: e.label
89
- }, e.value)) })]
90
- }),
91
- /* @__PURE__ */ d(n, { errors: m(_?.state) })
92
- ] }) })]
93
- }),
94
- /* @__PURE__ */ f("div", {
95
- className: "ttw:flex ttw:gap-4",
96
- children: [/* @__PURE__ */ d(e, { children: /* @__PURE__ */ f(t, { children: [
97
- /* @__PURE__ */ d(r, {
98
- htmlFor: C.postalCode,
99
- requirement: "required",
100
- labels: S,
101
- children: x.postalCodeLabel
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
+ })
102
39
  }),
103
- /* @__PURE__ */ d(i, {
104
- id: C.postalCode,
105
- "aria-required": !0,
106
- className: "ttw:bg-background",
107
- value: g.postalCode,
108
- disabled: y,
109
- "aria-invalid": !!_?.postalCode || void 0,
110
- onChange: (e) => b({ postalCode: e.target.value })
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
111
46
  }),
112
- /* @__PURE__ */ d(n, { errors: m(_?.postalCode) })
113
- ] }) }), /* @__PURE__ */ d(e, { children: /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d(r, {
114
- htmlFor: C.country,
115
- requirement: "required",
116
- labels: S,
117
- children: x.countryLabel
118
- }), /* @__PURE__ */ f(a, {
119
- value: p,
120
- disabled: !0,
121
- children: [/* @__PURE__ */ d(c, {
122
- id: C.country,
123
- "aria-required": !0,
124
- className: "ttw:w-full ttw:bg-background",
125
- children: /* @__PURE__ */ d(l, {})
126
- }), /* @__PURE__ */ d(o, { children: /* @__PURE__ */ d(s, {
127
- value: p,
128
- children: x.countryUnitedStates
129
- }) })]
130
- })] }) })]
131
- })
132
- ] });
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
+ });
133
77
  }
134
78
  //#endregion
135
- export { h as CounterpartAddressFields };
79
+ export { u as CounterpartAddressForm, l as addressFieldLabels };