@tesouro/embedded-components-react 0.5.270 → 0.5.272

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 (55) hide show
  1. package/dist/index.css +17 -0
  2. package/dist/index.d.ts +19 -0
  3. package/dist/index.js +4 -4
  4. package/dist/lib/BankAccountOnboardingWidget.d.ts +19 -0
  5. package/dist/lib/BankAccountOnboardingWidget.js +4 -4
  6. package/dist/lib/WidgetSuite.d.ts +19 -0
  7. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/AdditionalOwnersStep.js +94 -73
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +7 -7
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BusinessDetailsStep.js +71 -57
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/PersonalDetailsStep.js +61 -46
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/additionalOwnerDraft.js +22 -24
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/applicationStatusView.js +2 -2
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/businessDetailsPanelMapping.js +28 -32
  14. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/draftApplicationMapping.js +3 -3
  15. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/fieldErrors.js +40 -0
  16. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/labels.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/personalDetailsPanelMapping.js +2 -2
  18. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/stepSchemas.js +26 -21
  19. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +18 -18
  20. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index10.js +6 -58
  21. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index11.js +57 -31
  22. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index12.js +31 -38
  23. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index13.js +27 -26
  24. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index14.js +34 -91
  25. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index15.js +96 -12
  26. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index16.js +14 -2
  27. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index17.js +0 -2
  28. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index18.js +4 -185
  29. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +269 -25
  30. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index20.js +28 -21
  31. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index21.js +21 -68
  32. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +59 -225
  33. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index23.js +338 -26
  34. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index24.js +29 -26
  35. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index25.js +26 -74
  36. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index26.js +71 -82
  37. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +85 -8
  38. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +8 -57
  39. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index29.js +57 -9
  40. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index3.js +34 -261
  41. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index30.js +9 -62
  42. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index31.js +64 -0
  43. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index4.js +331 -2
  44. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index5.js +2 -48
  45. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index6.js +53 -139
  46. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index7.js +146 -50
  47. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index8.js +50 -28
  48. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index9.js +35 -6
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js +22 -18
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +8 -4
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/invalidation.js +3 -3
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/reconcileSubmittedForApprovalQueries.js +1 -1
  53. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  54. package/dist/packages/shared-ui-shadcn/dist/index.js +14 -9
  55. package/package.json +1 -1
package/dist/index.css CHANGED
@@ -4697,6 +4697,9 @@
4697
4697
  .ttw\:last\:border-b-transparent:last-child {
4698
4698
  border-bottom-color: transparent;
4699
4699
  }
4700
+ .ttw\:focus-within\:border-destructive:focus-within {
4701
+ border-color: var(--ttw-destructive);
4702
+ }
4700
4703
  .ttw\:focus-within\:border-ring:focus-within {
4701
4704
  border-color: var(--ttw-ring);
4702
4705
  }
@@ -4704,6 +4707,12 @@
4704
4707
  --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
4705
4708
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
4706
4709
  }
4710
+ .ttw\:focus-within\:ring-destructive\/20:focus-within {
4711
+ --tw-ring-color: var(--ttw-destructive);
4712
+ @supports (color: color-mix(in lab, red, red)) {
4713
+ --tw-ring-color: color-mix(in oklab, var(--ttw-destructive) 20%, transparent);
4714
+ }
4715
+ }
4707
4716
  .ttw\:focus-within\:ring-ring\/50:focus-within {
4708
4717
  --tw-ring-color: var(--ttw-ring);
4709
4718
  @supports (color: color-mix(in lab, red, red)) {
@@ -4776,6 +4785,14 @@
4776
4785
  .ttw\:hover\:bg-cyan-50:hover {
4777
4786
  background-color: var(--ttw-color-cyan-50);
4778
4787
  }
4788
+ .ttw\:hover\:bg-destructive\/5:hover {
4789
+ background-color: var(--ttw-destructive);
4790
+ }
4791
+ @supports (color: color-mix(in lab, red, red)) {
4792
+ .ttw\:hover\:bg-destructive\/5:hover {
4793
+ background-color: color-mix(in oklab, var(--ttw-destructive) 5%, transparent);
4794
+ }
4795
+ }
4779
4796
  .ttw\:hover\:bg-destructive\/10:hover {
4780
4797
  background-color: var(--ttw-destructive);
4781
4798
  }
package/dist/index.d.ts CHANGED
@@ -1739,11 +1739,19 @@ interface AdditionalOwnersLabels {
1739
1739
  state: string;
1740
1740
  statePlaceholder: string;
1741
1741
  zipCode: string;
1742
+ zipCodeInvalid: string;
1742
1743
  mobilePhoneNumber: string;
1743
1744
  mobilePhoneNumberInvalid: string;
1744
1745
  ownershipPercentage: string;
1745
1746
  ownershipPercentagePlaceholder: string;
1746
1747
  ownershipPercentageMinError: string;
1748
+ ownershipPercentageMaxError: string;
1749
+ /** Shown under a required field the user left blank. */
1750
+ requiredFieldError: string;
1751
+ /** Shown under a filled-in field that fails a rule with no message of its own. */
1752
+ invalidFieldError: string;
1753
+ /** Shown on an owners-list row whose saved details are incomplete or invalid. */
1754
+ ownerIncompleteError: string;
1747
1755
  /** Required-field marker appended to field labels (e.g. ` *`). */
1748
1756
  requiredFieldMarker: string;
1749
1757
  /** Suffix shown after ownership percentage inputs (e.g. `%`). */
@@ -1767,8 +1775,13 @@ interface BusinessDetailsLabels {
1767
1775
  state: string;
1768
1776
  statePlaceholder: string;
1769
1777
  zipCode: string;
1778
+ zipCodeInvalid: string;
1770
1779
  companyPhoneNumber: string;
1771
1780
  companyPhoneNumberInvalid: string;
1781
+ /** Shown under a required field the user left blank. */
1782
+ requiredFieldError: string;
1783
+ /** Shown under a filled-in field that fails a rule with no message of its own. */
1784
+ invalidFieldError: string;
1772
1785
  companyStructure: string;
1773
1786
  companyStructurePlaceholder: string;
1774
1787
  website: string;
@@ -1816,9 +1829,15 @@ interface PersonalDetailsLabels {
1816
1829
  state: string;
1817
1830
  statePlaceholder: string;
1818
1831
  zipCode: string;
1832
+ zipCodeInvalid: string;
1819
1833
  mobilePhoneNumber: string;
1820
1834
  mobilePhoneNumberInvalid: string;
1821
1835
  workEmail: string;
1836
+ workEmailInvalid: string;
1837
+ /** Shown under a required field the user left blank. */
1838
+ requiredFieldError: string;
1839
+ /** Shown under a filled-in field that fails a rule with no message of its own. */
1840
+ invalidFieldError: string;
1822
1841
  ownsOver25Question: string;
1823
1842
  ownsOver25SummaryLabel: string;
1824
1843
  ownsOver25Yes: string;
package/dist/index.js CHANGED
@@ -37,10 +37,10 @@ import { TRANSFERS_WIDGET_LABELS_EN as q } from "./libs/tesouro-embedded-compone
37
37
  import { TransfersWidget as J } from "./libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetFeature.js";
38
38
  import { ACCEPT_DISCLOSURES_WIDGET_LABELS_EN as Y } from "./libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/labels.js";
39
39
  import { AcceptDisclosuresWidget as X } from "./libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js";
40
- import { ADDITIONAL_OWNERS_LABELS_EN as Z } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index5.js";
41
- import { BUSINESS_DETAILS_LABELS_EN as Q } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index7.js";
42
- import { PERSONAL_DETAILS_LABELS_EN as $ } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index8.js";
43
- import { RESULT_LABELS_EN as ee } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index15.js";
40
+ import { ADDITIONAL_OWNERS_LABELS_EN as Z } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index6.js";
41
+ import { BUSINESS_DETAILS_LABELS_EN as Q } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index8.js";
42
+ import { PERSONAL_DETAILS_LABELS_EN as $ } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index9.js";
43
+ import { RESULT_LABELS_EN as ee } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index16.js";
44
44
  import { APPLICATION_STATUS_LABELS_EN as te } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/labels.js";
45
45
  import { BankAccountOnboardingWidget as ne } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js";
46
46
  import { WidgetSuite as re } from "./libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/WidgetSuite.js";
@@ -807,11 +807,19 @@ interface AdditionalOwnersLabels {
807
807
  state: string;
808
808
  statePlaceholder: string;
809
809
  zipCode: string;
810
+ zipCodeInvalid: string;
810
811
  mobilePhoneNumber: string;
811
812
  mobilePhoneNumberInvalid: string;
812
813
  ownershipPercentage: string;
813
814
  ownershipPercentagePlaceholder: string;
814
815
  ownershipPercentageMinError: string;
816
+ ownershipPercentageMaxError: string;
817
+ /** Shown under a required field the user left blank. */
818
+ requiredFieldError: string;
819
+ /** Shown under a filled-in field that fails a rule with no message of its own. */
820
+ invalidFieldError: string;
821
+ /** Shown on an owners-list row whose saved details are incomplete or invalid. */
822
+ ownerIncompleteError: string;
815
823
  /** Required-field marker appended to field labels (e.g. ` *`). */
816
824
  requiredFieldMarker: string;
817
825
  /** Suffix shown after ownership percentage inputs (e.g. `%`). */
@@ -835,8 +843,13 @@ interface BusinessDetailsLabels {
835
843
  state: string;
836
844
  statePlaceholder: string;
837
845
  zipCode: string;
846
+ zipCodeInvalid: string;
838
847
  companyPhoneNumber: string;
839
848
  companyPhoneNumberInvalid: string;
849
+ /** Shown under a required field the user left blank. */
850
+ requiredFieldError: string;
851
+ /** Shown under a filled-in field that fails a rule with no message of its own. */
852
+ invalidFieldError: string;
840
853
  companyStructure: string;
841
854
  companyStructurePlaceholder: string;
842
855
  website: string;
@@ -884,9 +897,15 @@ interface PersonalDetailsLabels {
884
897
  state: string;
885
898
  statePlaceholder: string;
886
899
  zipCode: string;
900
+ zipCodeInvalid: string;
887
901
  mobilePhoneNumber: string;
888
902
  mobilePhoneNumberInvalid: string;
889
903
  workEmail: string;
904
+ workEmailInvalid: string;
905
+ /** Shown under a required field the user left blank. */
906
+ requiredFieldError: string;
907
+ /** Shown under a filled-in field that fails a rule with no message of its own. */
908
+ invalidFieldError: string;
890
909
  ownsOver25Question: string;
891
910
  ownsOver25SummaryLabel: string;
892
911
  ownsOver25Yes: string;
@@ -1,7 +1,7 @@
1
- import { ADDITIONAL_OWNERS_LABELS_EN as e } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index5.js";
2
- import { BUSINESS_DETAILS_LABELS_EN as t } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index7.js";
3
- import { PERSONAL_DETAILS_LABELS_EN as n } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index8.js";
4
- import { RESULT_LABELS_EN as r } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index15.js";
1
+ import { ADDITIONAL_OWNERS_LABELS_EN as e } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index6.js";
2
+ import { BUSINESS_DETAILS_LABELS_EN as t } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index8.js";
3
+ import { PERSONAL_DETAILS_LABELS_EN as n } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index9.js";
4
+ import { RESULT_LABELS_EN as r } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index16.js";
5
5
  import "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js";
6
6
  import { APPLICATION_STATUS_LABELS_EN as i } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/labels.js";
7
7
  import { BankAccountOnboardingWidget as a } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js";
@@ -861,11 +861,19 @@ interface AdditionalOwnersLabels {
861
861
  state: string;
862
862
  statePlaceholder: string;
863
863
  zipCode: string;
864
+ zipCodeInvalid: string;
864
865
  mobilePhoneNumber: string;
865
866
  mobilePhoneNumberInvalid: string;
866
867
  ownershipPercentage: string;
867
868
  ownershipPercentagePlaceholder: string;
868
869
  ownershipPercentageMinError: string;
870
+ ownershipPercentageMaxError: string;
871
+ /** Shown under a required field the user left blank. */
872
+ requiredFieldError: string;
873
+ /** Shown under a filled-in field that fails a rule with no message of its own. */
874
+ invalidFieldError: string;
875
+ /** Shown on an owners-list row whose saved details are incomplete or invalid. */
876
+ ownerIncompleteError: string;
869
877
  /** Required-field marker appended to field labels (e.g. ` *`). */
870
878
  requiredFieldMarker: string;
871
879
  /** Suffix shown after ownership percentage inputs (e.g. `%`). */
@@ -888,8 +896,13 @@ interface BusinessDetailsLabels {
888
896
  state: string;
889
897
  statePlaceholder: string;
890
898
  zipCode: string;
899
+ zipCodeInvalid: string;
891
900
  companyPhoneNumber: string;
892
901
  companyPhoneNumberInvalid: string;
902
+ /** Shown under a required field the user left blank. */
903
+ requiredFieldError: string;
904
+ /** Shown under a filled-in field that fails a rule with no message of its own. */
905
+ invalidFieldError: string;
893
906
  companyStructure: string;
894
907
  companyStructurePlaceholder: string;
895
908
  website: string;
@@ -936,9 +949,15 @@ interface PersonalDetailsLabels {
936
949
  state: string;
937
950
  statePlaceholder: string;
938
951
  zipCode: string;
952
+ zipCodeInvalid: string;
939
953
  mobilePhoneNumber: string;
940
954
  mobilePhoneNumberInvalid: string;
941
955
  workEmail: string;
956
+ workEmailInvalid: string;
957
+ /** Shown under a required field the user left blank. */
958
+ requiredFieldError: string;
959
+ /** Shown under a filled-in field that fails a rule with no message of its own. */
960
+ invalidFieldError: string;
942
961
  ownsOver25Question: string;
943
962
  ownsOver25SummaryLabel: string;
944
963
  ownsOver25Yes: string;
@@ -2,104 +2,125 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { ADDITIONAL_OWNERS_LABELS_EN as e } from "../../../../ui/dist/index5.js";
6
- import { AdditionalOwnersForm as t } from "../../../../ui/dist/index6.js";
5
+ import { ADDITIONAL_OWNERS_LABELS_EN as e } from "../../../../ui/dist/index6.js";
6
+ import { AdditionalOwnersForm as t } from "../../../../ui/dist/index7.js";
7
7
  import "../../../../ui/dist/index.js";
8
8
  import { bankAccountOnboardingTestIds as n } from "./testIds.js";
9
9
  import { buildAdditionalOwnerSchema as r } from "./stepSchemas.js";
10
- import { valuesKey as i } from "./valuesKey.js";
11
- import { EMPTY_ADDITIONAL_OWNER as a, buildAdditionalOwnerEditDisplay as o, buildAdditionalOwnerEditFields as s, normalizeAdditionalOwnerDraft as c } from "./additionalOwnerDraft.js";
12
- import { useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
13
- import { jsx as p } from "react/jsx-runtime";
10
+ import { fieldErrorsFromIssues as i, fieldsToFlagOnOpen as ee, labelOwnedFallback as a, useTouchedFields as te, withFieldFeedback as o } from "./fieldErrors.js";
11
+ import { valuesKey as s } from "./valuesKey.js";
12
+ import { EMPTY_ADDITIONAL_OWNER as c, buildAdditionalOwnerEditDisplay as l, buildAdditionalOwnerEditFields as u, normalizeAdditionalOwnerDraft as d } from "./additionalOwnerDraft.js";
13
+ import { useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
14
+ import { jsx as g } from "react/jsx-runtime";
14
15
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/AdditionalOwnersStep.js
15
- function m(e) {
16
+ var _ = [
17
+ "firstName",
18
+ "lastName",
19
+ "dateOfBirth",
20
+ "ssn",
21
+ "homeAddress",
22
+ "city",
23
+ "state",
24
+ "zipCode",
25
+ "mobilePhoneNumber",
26
+ "ownershipPercentage"
27
+ ];
28
+ function v(e) {
16
29
  return e.ownershipPercentage !== null && e.ownershipPercentage >= 25 ? e.ownershipPercentage : 0;
17
30
  }
18
- function h(e) {
19
- return `${m(e)}%`;
31
+ function y(e) {
32
+ return `${e.ownershipPercentage ?? 0}%`;
20
33
  }
21
- function g(e) {
34
+ function b(e, t) {
22
35
  return {
23
36
  name: `${e.firstName} ${e.lastName}`.trim(),
24
- shareDisplay: h(e)
37
+ shareDisplay: y(e),
38
+ error: t
25
39
  };
26
40
  }
27
- function _({ owners: h, onOwnersChange: _, primaryOwnerName: v, primaryOwnerPercentage: y, stateOptions: b, onSnapshotChange: x, onPendingOwnerChange: S, isSubmitting: C, labels: w }) {
28
- let T = u(() => ({
41
+ function x({ owners: y, onOwnersChange: x, primaryOwnerName: S, primaryOwnerPercentage: C, stateOptions: w, onSnapshotChange: T, onPendingOwnerChange: E, isSubmitting: ne, labels: D }) {
42
+ let O = p(() => ({
29
43
  ...e,
30
- ...w
31
- }), [w]), E = u(() => r(T), [T]), [D, O] = f(null), [k, A] = f(null), [j, M] = f(null), [N, P] = f(null), [F, I] = f(!1), L = (e) => {
32
- O(c(e));
33
- }, R = y + h.reduce((e, t) => e + m(t), 0), z = R > 100 ? T.totalOwnershipExceedsTemplate(R) : null, B = R > 75, V = `${y}%`, H = y >= 25, U = h.every((e) => E.safeParse(e).success), W = D !== null && E.safeParse(D).success, G = U && z === null && D === null && N === null ? h : null, K = JSON.stringify({ snapshot: G?.map((e) => ({
44
+ ...D
45
+ }), [D]), k = p(() => r(O), [O]), A = a(O.invalidFieldError), [j, M] = h(null), [N, P] = h(null), [re, F] = h(null), [I, L] = h(null), [R, z] = h(!1), B = te(() => []), V = (e) => {
46
+ M(d(e));
47
+ }, H = C + y.reduce((e, t) => e + v(t), 0), U = H > 100 ? O.totalOwnershipExceedsTemplate(H) : null, W = H > 75, G = `${C}%`, K = C >= 25, q = y.map((e) => {
48
+ let t = k.safeParse(e, A);
49
+ if (t.success) return;
50
+ let n = t.error.issues.find((e) => e.path[0] === "ownershipPercentage");
51
+ return n ? e.ownershipPercentage === null ? O.ownershipPercentageMinError : n.message : O.ownerIncompleteError;
52
+ }), J = q.every((e) => e === void 0), Y = j === null ? null : k.safeParse(j, A), ie = Y?.success ?? !1, X = J && U === null && j === null && I === null ? y : null, ae = JSON.stringify({ snapshot: X?.map((e) => ({
34
53
  ...e,
35
54
  dateOfBirth: e.dateOfBirth?.toISOString()
36
- })) }), q = d(x);
37
- q.current = x, l(() => {
38
- q.current(G);
39
- }, [K]);
40
- let J = D !== null && i(D) !== i(j) ? {
41
- owner: D,
42
- index: k
43
- } : null, Y = i(J), X = d(S);
44
- X.current = S, l(() => {
45
- X.current?.(J);
46
- }, [Y]), l(() => () => X.current?.(null), []);
47
- let Z = () => {
48
- A(null), I(!1), O({ ...a }), M({ ...a });
49
- }, Q = (e) => {
50
- A(e), I(!1);
51
- let t = c({ ...h[e] });
52
- O(t), M(t);
53
- }, $ = (e) => {
54
- let t = h[e];
55
- P({
55
+ })) }), Z = m(T);
56
+ Z.current = T, f(() => {
57
+ Z.current(X);
58
+ }, [ae]);
59
+ let Q = j !== null && N !== null && s(j) !== s(re) ? {
60
+ owner: j,
61
+ index: N
62
+ } : null, oe = s(Q), $ = m(E);
63
+ $.current = E, f(() => {
64
+ $.current?.(Q);
65
+ }, [oe]), f(() => () => $.current?.(null), []);
66
+ let se = () => {
67
+ P(null), z(!1), M({ ...c }), F({ ...c }), B.reset([]);
68
+ }, ce = (e) => {
69
+ P(e), z(!1);
70
+ let t = d({ ...y[e] });
71
+ M(t), F(t);
72
+ let n = k.safeParse(t, A);
73
+ B.reset(ee(_, t, i(_, t, n.error?.issues, O.requiredFieldError)));
74
+ }, le = (e) => {
75
+ let t = y[e];
76
+ L({
56
77
  index: e,
57
78
  displayName: `${t.firstName} ${t.lastName}`.trim()
58
79
  });
59
- }, ee = () => {
60
- N && (_(h.filter((e, t) => t !== N.index)), P(null));
61
- }, te = () => {
62
- P(null);
63
- }, ne = D ? {
64
- fields: s(D, L, { stateOptions: b }),
65
- display: o(D, T),
66
- isExisting: k !== null,
67
- isValid: W,
68
- ssnRevealed: F,
69
- ssnToggleAriaLabel: F ? T.ssnHide : T.ssnShow,
70
- onToggleSsnVisibility: () => I((e) => !e),
80
+ }, ue = () => {
81
+ I && (x(y.filter((e, t) => t !== I.index)), L(null));
82
+ }, de = () => {
83
+ L(null);
84
+ }, fe = j ? {
85
+ fields: o(u(j, V, { stateOptions: w }), i(_, j, Y?.error?.issues, O.requiredFieldError), B.touched, B.touch),
86
+ display: l(j, O),
87
+ isExisting: N !== null,
88
+ isValid: ie,
89
+ ssnRevealed: R,
90
+ ssnToggleAriaLabel: R ? O.ssnHide : O.ssnShow,
91
+ onToggleSsnVisibility: () => z((e) => !e),
71
92
  onSubmit: () => {
72
- if (!D) return;
73
- let e = E.safeParse(D);
93
+ if (!j) return;
94
+ let e = k.safeParse(j);
74
95
  if (e.success) {
75
- if (k === null) _([...h, e.data]);
96
+ if (N === null) x([...y, e.data]);
76
97
  else {
77
- let t = [...h];
78
- t[k] = e.data, _(t);
98
+ let t = [...y];
99
+ t[N] = e.data, x(t);
79
100
  }
80
- O(null), A(null), I(!1);
101
+ M(null), P(null), z(!1);
81
102
  }
82
103
  },
83
104
  onCancel: () => {
84
- O(null), A(null), I(!1);
105
+ M(null), P(null), z(!1);
85
106
  }
86
107
  } : null;
87
- return /* @__PURE__ */ p(t, {
88
- ownerRows: h.map(g),
89
- primaryOwnerName: v,
90
- primaryOwnerShareDisplay: V,
91
- showPrimaryOwner: H,
92
- totalOwnershipError: z,
93
- addOwnerDisabled: B,
94
- onAddOwner: Z,
95
- onEditOwner: Q,
96
- onDeleteOwnerRequest: $,
97
- deletingOwnerName: N?.displayName ?? null,
98
- onDeleteOwnerConfirm: ee,
99
- onDeleteOwnerCancel: te,
100
- editingOverlay: ne,
101
- isSubmitting: C,
102
- labels: w,
108
+ return /* @__PURE__ */ g(t, {
109
+ ownerRows: y.map((e, t) => b(e, q[t])),
110
+ primaryOwnerName: S,
111
+ primaryOwnerShareDisplay: G,
112
+ showPrimaryOwner: K,
113
+ totalOwnershipError: U,
114
+ addOwnerDisabled: W,
115
+ onAddOwner: se,
116
+ onEditOwner: ce,
117
+ onDeleteOwnerRequest: le,
118
+ deletingOwnerName: I?.displayName ?? null,
119
+ onDeleteOwnerConfirm: ue,
120
+ onDeleteOwnerCancel: de,
121
+ editingOverlay: fe,
122
+ isSubmitting: ne,
123
+ labels: D,
103
124
  testIds: {
104
125
  addOwnerButton: n.addOwnerButton,
105
126
  overlay: { root: n.shellOverlay },
@@ -111,4 +132,4 @@ function _({ owners: h, onOwnersChange: _, primaryOwnerName: v, primaryOwnerPerc
111
132
  });
112
133
  }
113
134
  //#endregion
114
- export { _ as AdditionalOwnersStep, m as getAdditionalOwnerShare };
135
+ export { x as AdditionalOwnersStep, v as getAdditionalOwnerShare };
@@ -22,12 +22,12 @@ import { useRefetchWidget as oe, useWidgetConfig as se, useWidgetInitStaleForTok
22
22
  import { getNaicsOptions as ue } from "../../../../../shared/feature/dist/lib/naicsCodeMap.js";
23
23
  import { deniedNoticeExpiresAt as de, selectBankAccountApplication as fe } from "../../../../../shared/feature/dist/lib/application/bankAccountApplication.js";
24
24
  import "../../../../../shared/feature/dist/index.js";
25
- import { ADDITIONAL_OWNERS_LABELS_EN as pe } from "../../../../ui/dist/index5.js";
26
- import { interpolateBankName as me } from "../../../../ui/dist/index7.js";
27
- import { ApplicationStatusCard as he } from "../../../../ui/dist/index10.js";
28
- import { ResultStep as ge } from "../../../../ui/dist/index14.js";
29
- import { UnsavedApplicationDialog as _e } from "../../../../ui/dist/index28.js";
30
- import { DeleteApplicationDialog as ve } from "../../../../ui/dist/index30.js";
25
+ import { ADDITIONAL_OWNERS_LABELS_EN as pe } from "../../../../ui/dist/index6.js";
26
+ import { interpolateBankName as me } from "../../../../ui/dist/index8.js";
27
+ import { ApplicationStatusCard as he } from "../../../../ui/dist/index11.js";
28
+ import { ResultStep as ge } from "../../../../ui/dist/index15.js";
29
+ import { UnsavedApplicationDialog as _e } from "../../../../ui/dist/index29.js";
30
+ import { DeleteApplicationDialog as ve } from "../../../../ui/dist/index31.js";
31
31
  import "../../../../ui/dist/index.js";
32
32
  import { DEFAULT_LABELS as ye } from "./labels.js";
33
33
  import { OnboardingApplicationView as be, applicationStatusNoticeFor as xe, hiddenViewReason as Se, isNoticeView as Ce, mergeApplicationStatusLabels as we, onboardingApplicationViewFor as Te } from "./applicationStatusView.js";
@@ -71,7 +71,7 @@ function at(e) {
71
71
  };
72
72
  }
73
73
  function ot(e, t) {
74
- return t ? t.index === null ? [...e, t.owner] : e.map((e, n) => n === t.index ? t.owner : e) : e;
74
+ return t ? e.map((e, n) => n === t.index ? t.owner : e) : e;
75
75
  }
76
76
  var st = {
77
77
  companyLegalName: "",
@@ -2,56 +2,70 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { BusinessDetailsPanel as e } from "../../../../ui/dist/index21.js";
6
- import { BusinessDisclosuresSection as t } from "../../../../ui/dist/index26.js";
5
+ import { BusinessDetailsPanel as e } from "../../../../ui/dist/index22.js";
6
+ import { BusinessDisclosuresSection as t } from "../../../../ui/dist/index27.js";
7
7
  import "../../../../ui/dist/index.js";
8
8
  import { bankAccountOnboardingTestIds as n } from "./testIds.js";
9
- import { buildBusinessDetailsPanelFieldsSchema as r, buildBusinessDetailsSchema as i, isTaxIdSatisfied as a } from "./stepSchemas.js";
10
- import { buildBusinessDetailsEditFields as o, buildBusinessDetailsPanelLabels as s, buildBusinessDetailsSummaryRows as c, buildTaxIdFieldDisplay as l, isBusinessWebsiteInvalid as u, mergeBusinessDetailsLabels as d } from "./businessDetailsPanelMapping.js";
11
- import { useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
12
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
9
+ import { ALWAYS_CHECK as r, buildBusinessDetailsPanelFieldsSchema as i, buildBusinessDetailsSchema as a, isTaxIdSatisfied as o } from "./stepSchemas.js";
10
+ import { buildBusinessDetailsEditFields as s, buildBusinessDetailsPanelLabels as c, buildBusinessDetailsSummaryRows as l, buildTaxIdFieldDisplay as ee, mergeBusinessDetailsLabels as u } from "./businessDetailsPanelMapping.js";
11
+ import { fieldErrorsFromIssues as d, fieldsToFlagOnOpen as f, labelOwnedFallback as p, useTouchedFields as m, withFieldFeedback as h } from "./fieldErrors.js";
12
+ import { useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
13
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
13
14
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BusinessDetailsStep.js
14
- function v({ value: v, onValueChange: y, onSnapshotChange: b, naicsOptions: x, stateOptions: S, isSubmitting: C, labels: w, bankName: T, termsHref: E, privacyHref: D, electronicCommunicationHref: O, patriotActHref: k }) {
15
- let A = p(() => d(w), [w]), j = p(() => ({
16
- panelFields: r(A).refine(a, {
17
- message: A.taxIdInvalid,
18
- path: ["taxId"]
15
+ var S = [
16
+ "companyLegalName",
17
+ "companyDbaName",
18
+ "businessAddress",
19
+ "city",
20
+ "state",
21
+ "zipCode",
22
+ "companyPhoneNumber",
23
+ "companyStructure",
24
+ "website",
25
+ "taxId",
26
+ "naicsCode"
27
+ ];
28
+ function C({ value: C, onValueChange: w, onSnapshotChange: T, naicsOptions: E, stateOptions: D, isSubmitting: O, labels: k, bankName: A, termsHref: j, privacyHref: M, electronicCommunicationHref: N, patriotActHref: P }) {
29
+ let F = _(() => u(k), [k]), I = _(() => ({
30
+ panelFields: i(F).refine(o, {
31
+ message: F.taxIdInvalid,
32
+ path: ["taxId"],
33
+ ...r
19
34
  }),
20
- full: i(A)
21
- }), [A]), M = j.full.safeParse(v), N = M.success ? M.data : null, P = j.panelFields.safeParse(v).success, F = JSON.stringify(N), I = m(b);
22
- I.current = b, f(() => {
23
- I.current(N);
24
- }, [F]);
25
- let [L, R] = h(() => !P);
26
- f(() => {
27
- P || R(!0);
28
- }, [P]);
29
- let z = p(() => ({
30
- stateOptions: S,
31
- naicsOptions: x,
32
- labels: w
35
+ full: a(F)
36
+ }), [F]), L = I.full.safeParse(C), R = L.success ? L.data : null, z = I.panelFields.safeParse(C, p(F.invalidFieldError)), B = z.success, V = d(S, C, z.error?.issues, F.requiredFieldError), { touched: H, touch: U } = m(() => f(S, C, V)), W = JSON.stringify(R), G = v(T);
37
+ G.current = T, g(() => {
38
+ G.current(R);
39
+ }, [W]);
40
+ let [K, q] = y(() => !B);
41
+ g(() => {
42
+ B || q(!0);
43
+ }, [B]);
44
+ let J = _(() => ({
45
+ stateOptions: D,
46
+ naicsOptions: E,
47
+ labels: k
33
48
  }), [
34
- S,
35
- x,
36
- w
37
- ]), B = p(() => s(w), [w]), V = p(() => c(v, z), [v, z]), H = p(() => o(v, y, z), [
38
- v,
39
- y,
40
- z
41
- ]), U = u(v.website), W = p(() => l(v, w), [v, w]);
42
- return /* @__PURE__ */ _("div", {
49
+ D,
50
+ E,
51
+ k
52
+ ]), Y = _(() => c(k), [k]), X = _(() => l(C, J), [C, J]), Z = _(() => s(C, w, J), [
53
+ C,
54
+ w,
55
+ J
56
+ ]), Q = h(Z, V, H, U), $ = _(() => ee(C, k), [C, k]);
57
+ return /* @__PURE__ */ x("div", {
43
58
  className: "ttw:flex ttw:flex-col ttw:gap-6",
44
- children: [/* @__PURE__ */ g(e, {
45
- isEditing: L,
46
- onEditClick: () => R(!0),
47
- summaryRows: V,
48
- editFields: H,
49
- labels: B,
50
- isDisabled: C,
51
- websiteInvalid: U,
52
- taxIdRequired: W.required,
53
- taxIdPlaceholder: W.placeholder,
54
- taxIdHelpText: W.helpText,
59
+ children: [/* @__PURE__ */ b(e, {
60
+ isEditing: K,
61
+ onEditClick: () => q(!0),
62
+ summaryRows: X,
63
+ editFields: Q,
64
+ labels: Y,
65
+ isDisabled: O,
66
+ taxIdRequired: $.required,
67
+ taxIdPlaceholder: $.placeholder,
68
+ taxIdHelpText: $.helpText,
55
69
  testIds: {
56
70
  root: n.businessDetailsPanel,
57
71
  editButton: n.businessDetailsEditButton,
@@ -61,22 +75,22 @@ function v({ value: v, onValueChange: y, onSnapshotChange: b, naicsOptions: x, s
61
75
  naicsCombobox: n.businessDetailsNaicsCombobox
62
76
  }
63
77
  }
64
- }), /* @__PURE__ */ g(t, {
78
+ }), /* @__PURE__ */ b(t, {
65
79
  value: {
66
- isAuthorized: v.isAuthorized,
67
- isCheckboxChecked: v.isCheckboxChecked
80
+ isAuthorized: C.isAuthorized,
81
+ isCheckboxChecked: C.isCheckboxChecked
68
82
  },
69
- onChange: (e) => y({
70
- ...v,
83
+ onChange: (e) => w({
84
+ ...C,
71
85
  ...e
72
86
  }),
73
- isSubmitting: C,
74
- labels: w,
75
- bankName: T,
76
- termsHref: E,
77
- privacyHref: D,
78
- electronicCommunicationHref: O,
79
- patriotActHref: k,
87
+ isSubmitting: O,
88
+ labels: k,
89
+ bankName: A,
90
+ termsHref: j,
91
+ privacyHref: M,
92
+ electronicCommunicationHref: N,
93
+ patriotActHref: P,
80
94
  testIds: {
81
95
  authorizationCheckbox: n.authorizationCheckbox,
82
96
  disclosureCheckbox: n.disclosureCheckbox
@@ -85,4 +99,4 @@ function v({ value: v, onValueChange: y, onSnapshotChange: b, naicsOptions: x, s
85
99
  });
86
100
  }
87
101
  //#endregion
88
- export { v as BusinessDetailsStep };
102
+ export { C as BusinessDetailsStep };