@tesouro/embedded-components-react 0.7.40 → 0.7.42

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 (47) hide show
  1. package/README.md +2 -2
  2. package/dist/index.css +11 -0
  3. package/dist/index.d.ts +16 -14
  4. package/dist/lib/CounterpartsWidget.d.ts +16 -14
  5. package/dist/lib/CounterpartsWidgetPublic.d.ts +16 -14
  6. package/dist/lib/CustomersWidget.d.ts +16 -14
  7. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/mocks/acceptDisclosures.js +33 -28
  8. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/mocks/labels.js +6 -2
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +2 -2
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BusinessDetailsStep.js +2 -2
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/PersonalDetailsStep.js +1 -1
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/businessDetailsPanelMapping.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/personalDetailsPanelMapping.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/mocks/bankAccountOnboarding.js +40 -22
  15. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/mocks/labels.js +14 -2
  16. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +8 -10
  17. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index17.js +274 -2
  18. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index18.js +30 -4
  19. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +21 -272
  20. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index20.js +65 -26
  21. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index21.js +341 -21
  22. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +27 -65
  23. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index23.js +26 -341
  24. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index24.js +72 -27
  25. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index25.js +85 -26
  26. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index26.js +8 -74
  27. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +55 -83
  28. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +7 -6
  29. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index29.js +42 -37
  30. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +30 -29
  31. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/constants.js +6 -6
  32. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsTable.js +143 -95
  33. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +60 -48
  34. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/mocks/labels.js +1 -1
  35. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +4 -4
  36. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +22 -15
  37. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +137 -135
  38. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/mocks/expenseManagement.js +163 -140
  39. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/mocks/labels.js +22 -16
  40. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/labels.js +12 -0
  41. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/settings.js +255 -88
  42. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +106 -108
  43. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  44. package/dist/scenarios/index.d.ts +1 -1
  45. package/package.json +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index30.js +0 -11
  47. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index31.js +0 -64
package/README.md CHANGED
@@ -328,7 +328,7 @@ Manages an organization's customers or vendors: a searchable list with money col
328
328
  | Prop | Type | Default | Description |
329
329
  | -------------------- | ------------------------------------------------ | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
330
330
  | `counterpartType` | `'customer' \| 'vendor'` | **Required** | Selects the customer or vendor surface. |
331
- | `pageSizeOptions` | `number[]` | `[10, 25, 50, 100]` | Page-size choices shown by the table. |
331
+ | `pageSizeOptions` | `number[]` | `[10, 25, 50, 100]` | Page-size choices shown by the table. The list opens at the first one. |
332
332
  | `onViewAllDocuments` | `(counterpart: CounterpartActionTarget) => void` | `undefined` | Shows a "View all" action by the details sheet's recent bills/invoices and passes the counterpart's `id` and `name`. Hidden when omitted. |
333
333
  | `onCreateDocument` | `(counterpart: CounterpartActionTarget) => void` | `undefined` | Runs the details sheet's "Send a payment" (vendor) or "Issue an invoice" (customer) button. Hidden when omitted; you check the scopes it needs. |
334
334
  | `screenLabels` | `Partial<CounterpartsScreenLabels>` | English labels | Table, search/filter, empty, error and access-restricted copy. |
@@ -347,7 +347,7 @@ Manages an organization's customers: a searchable list with money columns, a det
347
347
 
348
348
  | Prop | Type | Default | Description |
349
349
  | -------------------- | --------------------------------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
350
- | `pageSizeOptions` | `number[]` | `[10, 25, 50, 100]` | Page-size choices shown by the table. |
350
+ | `pageSizeOptions` | `number[]` | `[10, 25, 50, 100]` | Page-size choices shown by the table. The list opens at the first one. |
351
351
  | `onViewAllDocuments` | `(customer: CounterpartActionTarget) => void` | `undefined` | Shows a "View all" action on the details sheet's recent invoices and passes the customer's `id` and `name`; omit to hide it. |
352
352
  | `onCreateDocument` | `(customer: CounterpartActionTarget) => void` | `undefined` | Handles "Issue an invoice" with the customer's `id` and `name`; omit to hide the button. You check invoice scopes. |
353
353
  | `screenLabels` | `Partial<CounterpartsScreenLabels>` | English labels | Table, search, filter, empty and error copy. |
package/dist/index.css CHANGED
@@ -1674,11 +1674,22 @@
1674
1674
  .ttw\:border-collapse {
1675
1675
  border-collapse: collapse;
1676
1676
  }
1677
+ .ttw\:border-separate {
1678
+ border-collapse: separate;
1679
+ }
1677
1680
  .ttw\:border-spacing-0 {
1678
1681
  --tw-border-spacing-x: 0px;
1679
1682
  --tw-border-spacing-y: 0px;
1680
1683
  border-spacing: var(--tw-border-spacing-x) var(--tw-border-spacing-y);
1681
1684
  }
1685
+ .ttw\:border-spacing-x-6 {
1686
+ --tw-border-spacing-x: calc(var(--ttw-spacing) * 6);
1687
+ border-spacing: var(--tw-border-spacing-x) var(--tw-border-spacing-y);
1688
+ }
1689
+ .ttw\:border-spacing-y-2 {
1690
+ --tw-border-spacing-y: calc(var(--ttw-spacing) * 2);
1691
+ border-spacing: var(--tw-border-spacing-x) var(--tw-border-spacing-y);
1692
+ }
1682
1693
  .ttw\:origin-\(--radix-dropdown-menu-content-transform-origin\) {
1683
1694
  transform-origin: var(--radix-dropdown-menu-content-transform-origin);
1684
1695
  }
package/dist/index.d.ts CHANGED
@@ -4545,36 +4545,35 @@ interface GapCoverageAlertProps {
4545
4545
  testIds?: GapCoverageAlertTestIds;
4546
4546
  }
4547
4547
 
4548
- /**
4549
- * Co-located user-facing strings for the counterparts widget UI. Each component
4550
- * takes a `labels?: Partial<...Labels>` prop merged over the matching
4551
- * `*_LABELS_EN` default, so integrators can re-label without forking the UI.
4552
- */
4553
4548
  interface CounterpartsScreenLabels {
4554
4549
  /** Customer-mode create action. */
4555
4550
  createButton: string;
4556
- /** Vendor-mode create action — the Bill Pay Figma labels it, not "Create new". */
4551
+ /** Vendor-mode create action. */
4557
4552
  vendorsCreateButton: string;
4558
4553
  columnName: string;
4559
4554
  sortByName: string;
4560
- /** Customer mode only — the vendor table has no billed column. */
4561
4555
  columnBilledAmount: string;
4562
4556
  columnReceivedAmount: string;
4563
4557
  columnAmountDue: string;
4564
4558
  columnTotalPaidToDate: string;
4565
4559
  columnBalanceDue: string;
4566
- columnActions: string;
4567
4560
  /**
4568
4561
  * A focused row's accessible name. The row itself is the control that
4569
4562
  * opens it, so the name says what Enter does. A template so locales own the
4570
4563
  * wording and order.
4571
4564
  */
4572
4565
  openRow: (counterpartName: string) => string;
4573
- openActionsMenu: string;
4574
- editAction: string;
4575
- deleteAction: string;
4566
+ /** Shown in the name cell when a counterpart has no name. */
4567
+ unnamedCounterpart: string;
4576
4568
  searchPlaceholder: string;
4577
- entityFilterAll: string;
4569
+ searchLabel: string;
4570
+ filtersButton: string;
4571
+ filterFieldType: string;
4572
+ /** Accessible name of a chip's dismiss button. `{label}` is the chip's text. */
4573
+ filterChipRemove: string;
4574
+ typeChip: (value: string) => string;
4575
+ searchChip: (value: string) => string;
4576
+ clearAllFilters: string;
4578
4577
  entityFilterOrganization: string;
4579
4578
  entityFilterIndividual: string;
4580
4579
  customersEmptyTitle: string;
@@ -4586,8 +4585,11 @@ interface CounterpartsScreenLabels {
4586
4585
  customersFilterEmptyTitle: string;
4587
4586
  vendorsFilterEmptyTitle: string;
4588
4587
  filterEmptyDescription: string;
4589
- errorTitle: string;
4590
- errorDescription: string;
4588
+ filterEmptyAction: string;
4589
+ customersErrorTitle: string;
4590
+ customersErrorDescription: string;
4591
+ vendorsErrorTitle: string;
4592
+ vendorsErrorDescription: string;
4591
4593
  errorRetry: string;
4592
4594
  accessRestrictedTitle: string;
4593
4595
  accessRestrictedDescription: string;
@@ -813,36 +813,35 @@ interface CounterpartMessageLabels {
813
813
  deleteBankAccountFailed: string;
814
814
  }
815
815
 
816
- /**
817
- * Co-located user-facing strings for the counterparts widget UI. Each component
818
- * takes a `labels?: Partial<...Labels>` prop merged over the matching
819
- * `*_LABELS_EN` default, so integrators can re-label without forking the UI.
820
- */
821
816
  interface CounterpartsScreenLabels {
822
817
  /** Customer-mode create action. */
823
818
  createButton: string;
824
- /** Vendor-mode create action — the Bill Pay Figma labels it, not "Create new". */
819
+ /** Vendor-mode create action. */
825
820
  vendorsCreateButton: string;
826
821
  columnName: string;
827
822
  sortByName: string;
828
- /** Customer mode only — the vendor table has no billed column. */
829
823
  columnBilledAmount: string;
830
824
  columnReceivedAmount: string;
831
825
  columnAmountDue: string;
832
826
  columnTotalPaidToDate: string;
833
827
  columnBalanceDue: string;
834
- columnActions: string;
835
828
  /**
836
829
  * A focused row's accessible name. The row itself is the control that
837
830
  * opens it, so the name says what Enter does. A template so locales own the
838
831
  * wording and order.
839
832
  */
840
833
  openRow: (counterpartName: string) => string;
841
- openActionsMenu: string;
842
- editAction: string;
843
- deleteAction: string;
834
+ /** Shown in the name cell when a counterpart has no name. */
835
+ unnamedCounterpart: string;
844
836
  searchPlaceholder: string;
845
- entityFilterAll: string;
837
+ searchLabel: string;
838
+ filtersButton: string;
839
+ filterFieldType: string;
840
+ /** Accessible name of a chip's dismiss button. `{label}` is the chip's text. */
841
+ filterChipRemove: string;
842
+ typeChip: (value: string) => string;
843
+ searchChip: (value: string) => string;
844
+ clearAllFilters: string;
846
845
  entityFilterOrganization: string;
847
846
  entityFilterIndividual: string;
848
847
  customersEmptyTitle: string;
@@ -854,8 +853,11 @@ interface CounterpartsScreenLabels {
854
853
  customersFilterEmptyTitle: string;
855
854
  vendorsFilterEmptyTitle: string;
856
855
  filterEmptyDescription: string;
857
- errorTitle: string;
858
- errorDescription: string;
856
+ filterEmptyAction: string;
857
+ customersErrorTitle: string;
858
+ customersErrorDescription: string;
859
+ vendorsErrorTitle: string;
860
+ vendorsErrorDescription: string;
859
861
  errorRetry: string;
860
862
  accessRestrictedTitle: string;
861
863
  accessRestrictedDescription: string;
@@ -813,36 +813,35 @@ interface CounterpartMessageLabels {
813
813
  deleteBankAccountFailed: string;
814
814
  }
815
815
 
816
- /**
817
- * Co-located user-facing strings for the counterparts widget UI. Each component
818
- * takes a `labels?: Partial<...Labels>` prop merged over the matching
819
- * `*_LABELS_EN` default, so integrators can re-label without forking the UI.
820
- */
821
816
  interface CounterpartsScreenLabels {
822
817
  /** Customer-mode create action. */
823
818
  createButton: string;
824
- /** Vendor-mode create action — the Bill Pay Figma labels it, not "Create new". */
819
+ /** Vendor-mode create action. */
825
820
  vendorsCreateButton: string;
826
821
  columnName: string;
827
822
  sortByName: string;
828
- /** Customer mode only — the vendor table has no billed column. */
829
823
  columnBilledAmount: string;
830
824
  columnReceivedAmount: string;
831
825
  columnAmountDue: string;
832
826
  columnTotalPaidToDate: string;
833
827
  columnBalanceDue: string;
834
- columnActions: string;
835
828
  /**
836
829
  * A focused row's accessible name. The row itself is the control that
837
830
  * opens it, so the name says what Enter does. A template so locales own the
838
831
  * wording and order.
839
832
  */
840
833
  openRow: (counterpartName: string) => string;
841
- openActionsMenu: string;
842
- editAction: string;
843
- deleteAction: string;
834
+ /** Shown in the name cell when a counterpart has no name. */
835
+ unnamedCounterpart: string;
844
836
  searchPlaceholder: string;
845
- entityFilterAll: string;
837
+ searchLabel: string;
838
+ filtersButton: string;
839
+ filterFieldType: string;
840
+ /** Accessible name of a chip's dismiss button. `{label}` is the chip's text. */
841
+ filterChipRemove: string;
842
+ typeChip: (value: string) => string;
843
+ searchChip: (value: string) => string;
844
+ clearAllFilters: string;
846
845
  entityFilterOrganization: string;
847
846
  entityFilterIndividual: string;
848
847
  customersEmptyTitle: string;
@@ -854,8 +853,11 @@ interface CounterpartsScreenLabels {
854
853
  customersFilterEmptyTitle: string;
855
854
  vendorsFilterEmptyTitle: string;
856
855
  filterEmptyDescription: string;
857
- errorTitle: string;
858
- errorDescription: string;
856
+ filterEmptyAction: string;
857
+ customersErrorTitle: string;
858
+ customersErrorDescription: string;
859
+ vendorsErrorTitle: string;
860
+ vendorsErrorDescription: string;
859
861
  errorRetry: string;
860
862
  accessRestrictedTitle: string;
861
863
  accessRestrictedDescription: string;
@@ -803,36 +803,35 @@ interface CounterpartMessageLabels {
803
803
  deleteBankAccountFailed: string;
804
804
  }
805
805
 
806
- /**
807
- * Co-located user-facing strings for the counterparts widget UI. Each component
808
- * takes a `labels?: Partial<...Labels>` prop merged over the matching
809
- * `*_LABELS_EN` default, so integrators can re-label without forking the UI.
810
- */
811
806
  interface CounterpartsScreenLabels {
812
807
  /** Customer-mode create action. */
813
808
  createButton: string;
814
- /** Vendor-mode create action — the Bill Pay Figma labels it, not "Create new". */
809
+ /** Vendor-mode create action. */
815
810
  vendorsCreateButton: string;
816
811
  columnName: string;
817
812
  sortByName: string;
818
- /** Customer mode only — the vendor table has no billed column. */
819
813
  columnBilledAmount: string;
820
814
  columnReceivedAmount: string;
821
815
  columnAmountDue: string;
822
816
  columnTotalPaidToDate: string;
823
817
  columnBalanceDue: string;
824
- columnActions: string;
825
818
  /**
826
819
  * A focused row's accessible name. The row itself is the control that
827
820
  * opens it, so the name says what Enter does. A template so locales own the
828
821
  * wording and order.
829
822
  */
830
823
  openRow: (counterpartName: string) => string;
831
- openActionsMenu: string;
832
- editAction: string;
833
- deleteAction: string;
824
+ /** Shown in the name cell when a counterpart has no name. */
825
+ unnamedCounterpart: string;
834
826
  searchPlaceholder: string;
835
- entityFilterAll: string;
827
+ searchLabel: string;
828
+ filtersButton: string;
829
+ filterFieldType: string;
830
+ /** Accessible name of a chip's dismiss button. `{label}` is the chip's text. */
831
+ filterChipRemove: string;
832
+ typeChip: (value: string) => string;
833
+ searchChip: (value: string) => string;
834
+ clearAllFilters: string;
836
835
  entityFilterOrganization: string;
837
836
  entityFilterIndividual: string;
838
837
  customersEmptyTitle: string;
@@ -844,8 +843,11 @@ interface CounterpartsScreenLabels {
844
843
  customersFilterEmptyTitle: string;
845
844
  vendorsFilterEmptyTitle: string;
846
845
  filterEmptyDescription: string;
847
- errorTitle: string;
848
- errorDescription: string;
846
+ filterEmptyAction: string;
847
+ customersErrorTitle: string;
848
+ customersErrorDescription: string;
849
+ vendorsErrorTitle: string;
850
+ vendorsErrorDescription: string;
849
851
  errorRetry: string;
850
852
  accessRestrictedTitle: string;
851
853
  accessRestrictedDescription: string;
@@ -1,62 +1,67 @@
1
1
  import { A_DISCLOSURES_SET as e, A_DISCLOSURE_ACCEPTANCE as t, NO_DISCLOSURES_OWED as n } from "../../../../shared/data-access-mocks/dist/lib/fixtures.js";
2
- import { IDENTITY as r, endpoint as i, initRoute as a, json as o, problem as s } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/scenario.js";
3
- import { ACCEPT_DISCLOSURES_LABELS as c } from "./labels.js";
2
+ import { IDENTITY as r, LOADING_DELAY_MS as i, endpoint as a, initRoute as o, json as s, problem as c, wait as l } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/scenario.js";
3
+ import { ACCEPT_DISCLOSURES_LABELS as u } from "./labels.js";
4
4
  //#region ../../libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/mocks/acceptDisclosures.js
5
- var l = "/api/widget-gateway/disclosure-acceptance", u = `${r}/disclosures`, d = {
5
+ var d = "/api/widget-gateway/disclosure-acceptance", f = `${r}/disclosures`, p = {
6
6
  status: "INVITED",
7
7
  disclosuresRequired: "REQUIRED",
8
8
  disclosuresAccepted: !1,
9
9
  vspName: "Example Payments",
10
10
  bankName: "Example Bank"
11
- }, f = {
11
+ }, m = {
12
12
  status: "ACTIVE",
13
13
  disclosuresAccepted: !0
14
14
  };
15
15
  if (!e.disclosures?.[0]) throw Error("A_DISCLOSURES_SET has no PERSON disclosure");
16
- var p = (e) => ({
16
+ var h = (e) => ({
17
17
  ...e,
18
18
  disclosures: e.disclosures?.map((e) => ({
19
19
  ...e,
20
20
  accepted: !0
21
21
  }))
22
- }), m = n, h = ({ init: e, read: n, accept: r }) => () => {
23
- let s = !1, c = 0;
22
+ }), g = n, _ = ({ init: e, read: n, accept: r, acceptDelayMs: i }) => () => {
23
+ let c = !1, u = 0;
24
24
  return [
25
- (t) => a([], {
25
+ (t) => o([], {
26
26
  ...e,
27
- ...s ? f : {}
27
+ ...c ? m : {}
28
28
  })(t),
29
- i("GET", u, () => {
29
+ a("GET", f, () => {
30
30
  let e = n();
31
- return e instanceof Response ? e : o(s ? p(e) : e);
31
+ return e instanceof Response ? e : s(c ? h(e) : e);
32
32
  }),
33
- i("POST", l, () => (c += 1, r?.(c) || (s = !0, o(t))))
33
+ a("POST", d, async () => (i && await l(i), u += 1, r?.(u) || (c = !0, s(t))))
34
34
  ];
35
- }, g = (e, t) => ({
35
+ }, v = (e, t) => ({
36
36
  key: e,
37
- ...c.scenarios[e],
38
- routes: h(t)
39
- }), _ = [
40
- g("default", {
41
- init: d,
37
+ ...u.scenarios[e],
38
+ routes: _(t)
39
+ }), y = [
40
+ v("default", {
41
+ init: p,
42
42
  read: () => e
43
43
  }),
44
- g("nothing-owed", {
44
+ v("nothing-owed", {
45
45
  init: {
46
- ...d,
46
+ ...p,
47
47
  disclosuresRequired: "NOT_REQUIRED"
48
48
  },
49
- read: () => m
49
+ read: () => g
50
50
  }),
51
- g("read-failed", {
52
- init: d,
53
- read: () => s(503, "Service Unavailable", "The disclosures service is unavailable.")
51
+ v("read-failed", {
52
+ init: p,
53
+ read: () => c(503, "Service Unavailable", "The disclosures service is unavailable.")
54
54
  }),
55
- g("accept-failed", {
56
- init: d,
55
+ v("accept-failed", {
56
+ init: p,
57
57
  read: () => e,
58
- accept: (e) => e === 1 ? s(503, "Service Unavailable", "Your acceptance could not be recorded right now. Try again in a moment.") : void 0
58
+ accept: (e) => e === 1 ? c(503, "Service Unavailable", "Your acceptance could not be recorded right now. Try again in a moment.") : void 0
59
+ }),
60
+ v("accepting", {
61
+ init: p,
62
+ read: () => e,
63
+ acceptDelayMs: i
59
64
  })
60
65
  ];
61
66
  //#endregion
62
- export { l as DISCLOSURE_ACCEPTANCE, _ as acceptDisclosuresScenarios };
67
+ export { d as DISCLOSURE_ACCEPTANCE, y as acceptDisclosuresScenarios };
@@ -10,11 +10,15 @@ var e = { scenarios: {
10
10
  },
11
11
  "read-failed": {
12
12
  label: "Documents fail to load",
13
- blurb: "The documents read fails with a 503, so the widget shows its own error with the API’s detail. Try again re-issues the read, which fails again."
13
+ blurb: "The documents read fails with a 503, so the widget shows its own load error in place of the agreement. Try again re-issues the read, which fails again."
14
14
  },
15
15
  "accept-failed": {
16
16
  label: "Accept fails",
17
- blurb: "The acceptance write fails with a 503 on the first press. The error appears under Accept with the API’s detail and the form stays usable; press Accept again and it goes through."
17
+ blurb: "The acceptance write fails with a 503 on the first press. The widget’s own error appears under Accept and the form stays usable; press Accept again and it goes through."
18
+ },
19
+ accepting: {
20
+ label: "Accept in progress",
21
+ blurb: "The acceptance write is held. Tick the agreement and press Accept: the checkbox and Accept lock and Accept shows its busy state for as long as the write is outstanding."
18
22
  }
19
23
  } };
20
24
  //#endregion
@@ -25,8 +25,8 @@ import { ADDITIONAL_OWNERS_LABELS_EN as fe } from "../../../../ui/dist/index6.js
25
25
  import { interpolateBankName as pe } from "../../../../ui/dist/index8.js";
26
26
  import { ApplicationStatusCard as me } from "../../../../ui/dist/index11.js";
27
27
  import { ResultStep as he } from "../../../../ui/dist/index15.js";
28
- import { UnsavedApplicationDialog as ge } from "../../../../ui/dist/index29.js";
29
- import { DeleteApplicationDialog as _e } from "../../../../ui/dist/index31.js";
28
+ import { UnsavedApplicationDialog as ge } from "../../../../ui/dist/index27.js";
29
+ import { DeleteApplicationDialog as _e } from "../../../../ui/dist/index29.js";
30
30
  import "../../../../ui/dist/index.js";
31
31
  import { DEFAULT_LABELS as p } from "./labels.js";
32
32
  import { OnboardingApplicationView as ve, applicationStatusNoticeFor as ye, hiddenViewReason as be, isNoticeView as xe, mergeApplicationStatusLabels as Se, onboardingApplicationViewFor as Ce } from "./applicationStatusView.js";
@@ -2,8 +2,8 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { BusinessDetailsPanel as e } from "../../../../ui/dist/index22.js";
6
- import { BusinessDisclosuresSection as t } from "../../../../ui/dist/index27.js";
5
+ import { BusinessDetailsPanel as e } from "../../../../ui/dist/index20.js";
6
+ import { BusinessDisclosuresSection as t } from "../../../../ui/dist/index25.js";
7
7
  import "../../../../ui/dist/index.js";
8
8
  import { bankAccountOnboardingTestIds as n } from "./testIds.js";
9
9
  import { ALWAYS_CHECK as r, buildBusinessDetailsPanelFieldsSchema as i, buildBusinessDetailsSchema as a, isTaxIdSatisfied as o } from "./stepSchemas.js";
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { AboutYouPanel as e } from "../../../../ui/dist/index26.js";
5
+ import { AboutYouPanel as e } from "../../../../ui/dist/index24.js";
6
6
  import "../../../../ui/dist/index.js";
7
7
  import { bankAccountOnboardingTestIds as t } from "./testIds.js";
8
8
  import { getMaxBirthDate as n } from "./fieldInput/maxBirthDate.js";
@@ -1,5 +1,5 @@
1
1
  import { BUSINESS_DETAILS_LABELS_EN as e } from "../../../../ui/dist/index8.js";
2
- import { BUSINESS_DETAILS_PANEL_LABELS_EN as t } from "../../../../ui/dist/index21.js";
2
+ import { BUSINESS_DETAILS_PANEL_LABELS_EN as t } from "../../../../ui/dist/index19.js";
3
3
  import "../../../../ui/dist/index.js";
4
4
  import { maskIdentifierLast4 as n } from "./fieldInput/maskIdentifierLast4.js";
5
5
  import { storedIdentifierFieldDisplay as r, usableStoredTaxIdLast4 as i } from "./fieldInput/storedIdentifier.js";
@@ -1,5 +1,5 @@
1
1
  import { PERSONAL_DETAILS_LABELS_EN as e } from "../../../../ui/dist/index9.js";
2
- import { ABOUT_YOU_PANEL_LABELS_EN as t } from "../../../../ui/dist/index25.js";
2
+ import { ABOUT_YOU_PANEL_LABELS_EN as t } from "../../../../ui/dist/index23.js";
3
3
  import "../../../../ui/dist/index.js";
4
4
  import { maskIdentifierLast4 as n } from "./fieldInput/maskIdentifierLast4.js";
5
5
  import { storedIdentifierFieldDisplay as r } from "./fieldInput/storedIdentifier.js";
@@ -28,44 +28,62 @@ var m = `${a}/bank-account-applications`, h = `${m}/:id`, g = `${a}/application-
28
28
  submittedAt: null,
29
29
  applicantFirstName: "Jordan",
30
30
  applicantLastName: "Lee"
31
- }, w = ({ draft: a, approves: u, others: d = [] }) => () => {
32
- let f = a ?? null, p = "DRAFT", b = 0, x = "cs_demo_application_secret", C = () => f ? (p === "SUBMITTED" && u && (b += 1, b > 2 && (p = "COMPLETE")), [S(f, p, p === "DRAFT" ? x : null), ...d]) : d;
31
+ }, w = 864e5, T = (e) => (/* @__PURE__ */ new Date(Date.now() - e * w)).toISOString(), E = (e, t = {}) => ({
32
+ ...S(x, e, null),
33
+ submittedAt: T(5),
34
+ updatedAt: T(e === "DENIED" ? 2 : 5),
35
+ ...t
36
+ }), D = ({ draft: a, approves: d, others: f = [], settled: p, failsFirstSubmit: b = !1 }) => () => {
37
+ let x = a ?? null, C = p?.(), w = 0, T = "DRAFT", E = 0, D = "cs_demo_application_secret", k = () => C ? [C, ...f] : x ? (T === "SUBMITTED" && d && (E += 1, E > 2 && (T = "COMPLETE")), [S(x, T, T === "DRAFT" ? D : null), ...f]) : f;
33
38
  return [
34
- (e) => s([], p === "COMPLETE" ? y : v)(e),
35
- o("GET", g, () => c({ applications: C() })),
39
+ (e) => s([], T === "COMPLETE" ? y : v)(e),
40
+ o("GET", g, () => c({ applications: k() })),
36
41
  o("GET", `${i}/disclosures`, () => c(n)),
37
42
  o("POST", _, () => c(r)),
38
- o("POST", m, () => (f = e, p = "DRAFT", c({
39
- ...f,
40
- clientSecret: x
43
+ o("POST", m, () => (x = e, T = "DRAFT", c({
44
+ ...x,
45
+ clientSecret: D
41
46
  }, 201))),
42
- o("GET", h, () => f ? c(f) : T()),
43
- o("PATCH", h, () => f ? c(f) : T()),
44
- o("POST", `${h}/submission`, () => f ? (p = "SUBMITTED", b = 0, c({
45
- ...f,
46
- status: p,
47
+ o("GET", h, () => x ? c(x) : O()),
48
+ o("PATCH", h, () => x ? c(x) : O()),
49
+ o("POST", `${h}/submission`, () => x ? (w += 1, b && w === 1 ? u(503, "Service Unavailable", "The application could not be submitted right now.") : (T = "SUBMITTED", E = 0, c({
50
+ ...x,
51
+ status: T,
47
52
  submittedAt: t.submittedAt
48
- })) : T()),
49
- o("DELETE", h, () => (p = "DELETED", l()))
53
+ }))) : O()),
54
+ o("DELETE", h, () => (T = "DELETED", l()))
50
55
  ];
51
- }, T = () => u(404, "Not Found", "No such bank account application."), E = (e, t) => ({
56
+ }, O = () => u(404, "Not Found", "No such bank account application."), k = (e, t) => ({
52
57
  key: e,
53
58
  ...p.scenarios[e],
54
- routes: w(t)
55
- }), D = [
56
- E("default", { approves: !0 }),
57
- E("resume-draft", {
59
+ routes: D(t)
60
+ }), A = [
61
+ k("default", { approves: !0 }),
62
+ k("resume-draft", {
58
63
  draft: x,
59
64
  approves: !0
60
65
  }),
61
- E("under-review", {
66
+ k("under-review", {
62
67
  draft: x,
63
68
  approves: !1
64
69
  }),
65
- E("colleague-applied", {
70
+ k("colleague-applied", {
66
71
  approves: !0,
67
72
  others: [C]
73
+ }),
74
+ k("submit-failed", {
75
+ draft: x,
76
+ approves: !0,
77
+ failsFirstSubmit: !0
78
+ }),
79
+ k("awaiting-review", {
80
+ approves: !1,
81
+ settled: () => E("SUBMITTED")
82
+ }),
83
+ k("denied", {
84
+ approves: !1,
85
+ settled: () => E("DENIED", { deniedAt: T(2) })
68
86
  })
69
87
  ];
70
88
  //#endregion
71
- export { D as bankAccountOnboardingScenarios };
89
+ export { A as bankAccountOnboardingScenarios };
@@ -13,8 +13,20 @@ var e = { scenarios: {
13
13
  blurb: "The same prefilled draft, but the bank does not decide while the widget waits. Tick the disclosures, press Next twice and Submit: the widget polls every two seconds for about 30 seconds and then says the applicant is getting close and will be emailed."
14
14
  },
15
15
  "colleague-applied": {
16
- label: "Hidden after a colleague applied",
17
- blurb: "Another member of the organization already has an application in progress. The organization can hold only one, so the widget renders nothing at all."
16
+ label: "A colleague’s application in progress",
17
+ blurb: "Another member of the organization already has an application in progress. The organization can hold only one, so instead of the form the widget shows an “Application in progress” card explaining that only the person who started it can finish it."
18
+ },
19
+ "submit-failed": {
20
+ label: "Submission fails",
21
+ blurb: "The same prefilled draft, but the first submission fails with a 503. Tick the disclosures, press Next twice and Submit: the error appears above the footer buttons and everything entered stays in place. Press Submit again and it goes through."
22
+ },
23
+ "awaiting-review": {
24
+ label: "Returning while under review",
25
+ blurb: "The applicant submitted their application a few days ago and the bank has not decided yet. Instead of the form the widget shows an “Under review” card with the submission date and what happens next."
26
+ },
27
+ denied: {
28
+ label: "Application not approved",
29
+ blurb: "The bank denied the applicant’s application two days ago. Instead of the form the widget shows a “Not approved” card with the denial date; the card stops showing 30 days after the denial."
18
30
  }
19
31
  } };
20
32
  //#endregion
@@ -6,15 +6,13 @@ import "./index10.js";
6
6
  import { ApplicationStatusCard as a, ApplicationStatusTone as o } from "./index11.js";
7
7
  import { ResultStep as s } from "./index15.js";
8
8
  import { RESULT_LABELS_EN as c } from "./index16.js";
9
- import "./index17.js";
10
- import "./index18.js";
11
- import { BUSINESS_DETAILS_PANEL_LABELS_EN as l } from "./index21.js";
12
- import { BusinessDetailsPanel as u } from "./index22.js";
13
- import { ABOUT_YOU_PANEL_LABELS_EN as d } from "./index25.js";
14
- import { AboutYouPanel as f } from "./index26.js";
15
- import { BusinessDisclosuresSection as p } from "./index27.js";
9
+ import { BUSINESS_DETAILS_PANEL_LABELS_EN as l } from "./index19.js";
10
+ import { BusinessDetailsPanel as u } from "./index20.js";
11
+ import { ABOUT_YOU_PANEL_LABELS_EN as d } from "./index23.js";
12
+ import { AboutYouPanel as f } from "./index24.js";
13
+ import { BusinessDisclosuresSection as p } from "./index25.js";
14
+ import "./index26.js";
15
+ import { UnsavedApplicationDialog as m } from "./index27.js";
16
16
  import "./index28.js";
17
- import { UnsavedApplicationDialog as m } from "./index29.js";
18
- import "./index30.js";
19
- import { DeleteApplicationDialog as h } from "./index31.js";
17
+ import { DeleteApplicationDialog as h } from "./index29.js";
20
18
  export { d as ABOUT_YOU_PANEL_LABELS_EN, e as ADDITIONAL_OWNERS_LABELS_EN, f as AboutYouPanel, t as AdditionalOwnersForm, a as ApplicationStatusCard, o as ApplicationStatusTone, n as BUSINESS_DETAILS_LABELS_EN, l as BUSINESS_DETAILS_PANEL_LABELS_EN, u as BusinessDetailsPanel, p as BusinessDisclosuresSection, h as DeleteApplicationDialog, i as PERSONAL_DETAILS_LABELS_EN, c as RESULT_LABELS_EN, s as ResultStep, m as UnsavedApplicationDialog, r as interpolateBankName };