@tesouro/embedded-components-react 0.5.181 → 0.5.183

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 (41) hide show
  1. package/README.md +32 -32
  2. package/dist/index.css +6 -0
  3. package/dist/index.d.ts +48 -20
  4. package/dist/index.js +2 -2
  5. package/dist/lib/BankAccountOnboardingWidget.d.ts +30 -1
  6. package/dist/lib/CreditCardsWidget.d.ts +9 -11
  7. package/dist/lib/CreditCardsWidget.js +1 -1
  8. package/dist/lib/DebitCardsWidget.d.ts +14 -15
  9. package/dist/lib/DebitCardsWidget.js +1 -1
  10. package/dist/lib/WidgetSuite.d.ts +43 -16
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index.js +5 -4
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index10.js +3 -32
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index11.js +24 -33
  14. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index12.js +44 -0
  15. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index8.js +13 -36
  16. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index9.js +43 -3
  17. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +4 -0
  18. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index23.js +3 -0
  19. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js +339 -301
  20. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +3 -1
  21. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +11 -0
  22. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +64 -0
  23. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index.js +4 -4
  24. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index10.js +87 -8
  25. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index11.js +3 -3
  26. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index12.js +17 -0
  27. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index4.js +17 -24
  28. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index5.js +23 -24
  29. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index6.js +24 -30
  30. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index7.js +28 -55
  31. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +53 -222
  32. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +219 -87
  33. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +34 -34
  34. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +188 -181
  35. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +162 -154
  36. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  37. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +67 -55
  38. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/labels.js +1 -0
  39. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index9.js +3 -3
  40. package/package.json +1 -1
  41. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index3.js +0 -19
package/README.md CHANGED
@@ -216,16 +216,16 @@ A whole banking page in one component: a section menu over the widgets behind it
216
216
 
217
217
  #### Props
218
218
 
219
- | Prop | Type | Default | Description |
220
- | --------------------------- | --------------------------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
221
- | `sections` | `readonly WidgetSuiteSectionId[]` | `WIDGET_SUITE_DEFAULT_SECTIONS` | Which sections the suite offers, in menu order. A listed section is still hidden when the token does not earn it. |
222
- | `section` | `WidgetSuiteSectionId` | — | Which section is showing. Supplying it puts the menu in controlled mode for the lifetime of the mount, so pair it with `onSectionChange`. |
223
- | `defaultSection` | `WidgetSuiteSectionId` | first of `sections` | Which section the suite opens on. Read once per mount, and ignored when `section` is supplied. |
224
- | `onSectionChange` | `(section) => void` | `undefined` | Called when a person moves the suite. Never fired on mount, and never for the entitlement fallback, so a URL mirroring it cannot erase a deep link. |
225
- | `labels` | `WidgetSuiteLabelOverrides` | `WIDGET_SUITE_LABELS_EN` | Every string on the page, in one tree: a group for the shell, the menu names, the section heading, the disclosure states, and one per section carrying that section's widget copy. Override any leaf and its siblings keep their defaults. |
226
- | `showSectionTitle` | `boolean` | `true` | Shows a heading above each section, named as its menu item is. Set `false` when your page already heads the suite. |
227
- | `onboardingDisclosureLinks` | `DisclosureLinks` | `undefined` | Legal disclosure URLs (Terms, Privacy, Electronic Communication, Patriot Act) for the entry-point onboarding widget's business-details agreement step, shown to a session whose organization has no application yet. Omitted fields render as plain, non-clickable text. |
228
- | `cardArtSrc` | `string` | `undefined` | Card artwork URL for the debit list's built-in Create card sheet and details card face. Omit it and both use a built-in neutral plastic, so Create card still shows when the token holds the issue, roster and funding scopes. Credit Create card is always hidden in the suite. |
219
+ | Prop | Type | Default | Description |
220
+ | --------------------------- | --------------------------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
221
+ | `sections` | `readonly WidgetSuiteSectionId[]` | `WIDGET_SUITE_DEFAULT_SECTIONS` | Which sections the suite offers, in menu order. A listed section is still hidden when the token does not earn it. |
222
+ | `section` | `WidgetSuiteSectionId` | — | Which section is showing. Supplying it puts the menu in controlled mode for the lifetime of the mount, so pair it with `onSectionChange`. |
223
+ | `defaultSection` | `WidgetSuiteSectionId` | first of `sections` | Which section the suite opens on. Read once per mount, and ignored when `section` is supplied. |
224
+ | `onSectionChange` | `(section) => void` | `undefined` | Called when a person moves the suite. Never fired on mount, and never for the entitlement fallback, so a URL mirroring it cannot erase a deep link. |
225
+ | `labels` | `WidgetSuiteLabelOverrides` | `WIDGET_SUITE_LABELS_EN` | Every string on the page, in one tree: a group for the shell, the menu names, the section heading, the disclosure states, and one per section carrying that section's widget copy. Override any leaf and its siblings keep their defaults. |
226
+ | `showSectionTitle` | `boolean` | `true` | Shows a heading above each section, named as its menu item is. Set `false` when your page already heads the suite. |
227
+ | `onboardingDisclosureLinks` | `DisclosureLinks` | `undefined` | Legal disclosure URLs (Terms, Privacy, Electronic Communication, Patriot Act) for the entry-point onboarding widget's business-details agreement step, shown to a session whose organization has no application yet. Omitted fields render as plain, non-clickable text. |
228
+ | `cardArtSrc` | `string` | `undefined` | Card artwork URL for the debit list's built-in Create card sheet and details card face. Omit it and the sheet uses a built-in neutral plastic while the face falls back to the bank logo. Create card shows when the token holds the issue, roster and funding scopes. Credit Create card is always hidden in the suite. |
229
229
 
230
230
  ### AcceptDisclosuresWidget
231
231
 
@@ -309,31 +309,31 @@ One page of an organization's **credit** cards, with a scope-gated "Show my card
309
309
 
310
310
  ### DebitCardsWidget
311
311
 
312
- One page of an organization's **debit** cards, with a scope-gated "Show my cards" toggle, Create card and per-row Activate affordances. Selecting a row opens that card's read-only details in a side sheet. With `cardArtSrc`, Create card opens the same sheet with the built-in debit issuance flow.
312
+ One page of an organization's **debit** cards, with a scope-gated "Show my cards" toggle, Create card and per-row Activate affordances. Selecting a row opens that card's read-only details in a side sheet. Create card opens the same sheet with the built-in debit issuance flow.
313
313
 
314
314
  #### Props
315
315
 
316
- | Prop | Type | Default | Description |
317
- | --------------------------- | --------------------------------------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
318
- | `pagination` | `{ paginationToken?, pageSize? }` | `undefined` | Controlled cursor and page size. Supply with `onPaginationChange` when your app owns the list position. |
319
- | `defaultPagination` | `{ paginationToken?, pageSize? }` | First page, 10 | Initial cursor and page size when uncontrolled. Ignored when `pagination` is supplied. |
320
- | `onPaginationChange` | `(pagination: CardsPagination) => void` | `undefined` | Called whenever the widget moves page or changes page size. Persist the whole object, not the token alone. |
321
- | `labels` | `PartialDeep<CardsLabels>` | English labels | Overrides the copy of the list screen — its controls, columns, states, the details sheet's screen-reader name under `detailsSheet` and the create sheet's under `createSheet`. Nested groups merge per group. |
322
- | `featureLabels` | `PartialDeep<CardsFeatureLabels>` | English labels | Overrides the copy this widget resolves rather than passes through — status and form-factor vocabulary, the empty-cell placeholder, and name fallbacks. |
323
- | `selectedCardId` | `string \| null` | `undefined` | Controlled selection of the card whose details panel is open. `null` closes it; omit for uncontrolled. See **Selection** below. |
324
- | `defaultSelectedCardId` | `string \| null` | `undefined` | Initial selection when uncontrolled. Ignored when `selectedCardId` is supplied. |
325
- | `onSelectedCardIdChange` | `(cardId: string \| null) => void` | `undefined` | Fires whenever the open card changes, including on close (`null`). Supplying it does **not** change what renders. |
326
- | `cardDetailsLabels` | `PartialDeep<CardDetailsWidgetLabels>` | English labels | Label overrides forwarded into the details panel. |
327
- | `cardDetailsFeatureLabels` | `PartialDeep<CardDetailsFeatureLabels>` | English labels | Overrides for the copy the panel's feature layer resolves — status vocabulary, form-factor copy, program label, copy-success toast. Distinct from `featureLabels`. |
328
- | `cardDetailsActivateLabels` | `PartialDeep<ActivateCardPanelLabels>` | English labels | Overrides for the Activate Card form the details panel opens — its heading, the two field labels, and its validation and status copy. |
329
- | `bankLogoSrc` | `string` | `undefined` | Bank logo for the details panel's card face. Ignored there when `cardArtSrc` is set. Omit both and the face renders without a logo rather than with a placeholder. |
330
- | `bankLogoAlt` | `string` | `undefined` | Alt text for `bankLogoSrc`. |
331
- | `cardArtSrc` | `string` | `undefined` | Plastic art for the built-in create sheet **and** the details panel's card face. Required for the create sheet: omit it (with no `onCreateCard`) and Create card is hidden. The details panel has no such requirement — omit it there and it falls back to `bankLogoSrc`. See **Create card** below. |
332
- | `createCardLabels` | `PartialDeep<CreateCardWidgetLabels>` | English labels | Label overrides forwarded into the nested create-card panel. |
333
- | `createCardFeatureLabels` | toast / untitled-funding overrides | English labels | Overrides for the copy the create panel's feature layer resolves — mutation toasts, untitled funding-account fallback, pending-activation success copy. |
334
- | `onCreateCard` | `() => void` | `undefined` | Host-owned Create card handler. When supplied, the built-in sheet does not open — use it for a custom issuance flow. |
335
- | `headerStart` | `ReactNode` | `undefined` | Your own markup for the start of the header row, beside Create card. Pass your heading here so the two share one row; the widget renders no heading of its own, so you choose the element and level. |
336
- | `onActivateCard` | `(cardId: string) => void` | `undefined` | Called when a row's Activate button is clicked. Omit it and the button is not rendered. |
316
+ | Prop | Type | Default | Description |
317
+ | --------------------------- | --------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
318
+ | `pagination` | `{ paginationToken?, pageSize? }` | `undefined` | Controlled cursor and page size. Supply with `onPaginationChange` when your app owns the list position. |
319
+ | `defaultPagination` | `{ paginationToken?, pageSize? }` | First page, 10 | Initial cursor and page size when uncontrolled. Ignored when `pagination` is supplied. |
320
+ | `onPaginationChange` | `(pagination: CardsPagination) => void` | `undefined` | Called whenever the widget moves page or changes page size. Persist the whole object, not the token alone. |
321
+ | `labels` | `PartialDeep<CardsLabels>` | English labels | Overrides the copy of the list screen — its controls, columns, states, the details sheet's screen-reader name under `detailsSheet` and the create sheet's under `createSheet`. Nested groups merge per group. |
322
+ | `featureLabels` | `PartialDeep<CardsFeatureLabels>` | English labels | Overrides the copy this widget resolves rather than passes through — status and form-factor vocabulary, the empty-cell placeholder, and name fallbacks. |
323
+ | `selectedCardId` | `string \| null` | `undefined` | Controlled selection of the card whose details panel is open. `null` closes it; omit for uncontrolled. See **Selection** below. |
324
+ | `defaultSelectedCardId` | `string \| null` | `undefined` | Initial selection when uncontrolled. Ignored when `selectedCardId` is supplied. |
325
+ | `onSelectedCardIdChange` | `(cardId: string \| null) => void` | `undefined` | Fires whenever the open card changes, including on close (`null`). Supplying it does **not** change what renders. |
326
+ | `cardDetailsLabels` | `PartialDeep<CardDetailsWidgetLabels>` | English labels | Label overrides forwarded into the details panel. |
327
+ | `cardDetailsFeatureLabels` | `PartialDeep<CardDetailsFeatureLabels>` | English labels | Overrides for the copy the panel's feature layer resolves — status vocabulary, form-factor copy, program label, copy-success toast. Distinct from `featureLabels`. |
328
+ | `cardDetailsActivateLabels` | `PartialDeep<ActivateCardPanelLabels>` | English labels | Overrides for the Activate Card form the details panel opens — its heading, the two field labels, and its validation and status copy. |
329
+ | `bankLogoSrc` | `string` | `undefined` | Bank logo for the details panel's card face. Ignored there when `cardArtSrc` is set. Omit both and the face renders without a logo rather than with a placeholder. |
330
+ | `bankLogoAlt` | `string` | `undefined` | Alt text for `bankLogoSrc`. |
331
+ | `cardArtSrc` | `string` | `undefined` | Plastic art for the built-in create sheet **and** the details panel's card face. Omit it and the create sheet draws a built-in neutral plastic, while the details face falls back to `bankLogoSrc`. See **Create card** below. |
332
+ | `createCardLabels` | `PartialDeep<CreateCardWidgetLabels>` | English labels | Label overrides forwarded into the nested create-card panel. |
333
+ | `createCardFeatureLabels` | toast / untitled-funding overrides | English labels | Overrides for the copy the create panel's feature layer resolves — mutation toasts, untitled funding-account fallback, pending-activation success copy. |
334
+ | `onCreateCard` | `() => void` | `undefined` | Host-owned Create card handler. When supplied, the built-in sheet does not open — use it for a custom issuance flow. |
335
+ | `headerStart` | `ReactNode` | `undefined` | Your own markup for the start of the header row, beside Create card. Pass your heading here so the two share one row; the widget renders no heading of its own, so you choose the element and level. |
336
+ | `onActivateCard` | `(cardId: string) => void` | `undefined` | Called when a row's Activate button is clicked. Omit it and the button is not rendered. |
337
337
 
338
338
  ### CardDetailsWidget
339
339
 
package/dist/index.css CHANGED
@@ -1286,6 +1286,9 @@
1286
1286
  .ttw\:w-\[720px\] {
1287
1287
  width: 720px;
1288
1288
  }
1289
+ .ttw\:w-\[840px\] {
1290
+ width: 840px;
1291
+ }
1289
1292
  .ttw\:w-\[880px\] {
1290
1293
  width: 880px;
1291
1294
  }
@@ -5767,6 +5770,9 @@
5767
5770
  .ttw\:sm\:flex-row {
5768
5771
  flex-direction: row;
5769
5772
  }
5773
+ .ttw\:sm\:items-center {
5774
+ align-items: center;
5775
+ }
5770
5776
  .ttw\:sm\:justify-between {
5771
5777
  justify-content: space-between;
5772
5778
  }
package/dist/index.d.ts CHANGED
@@ -1773,6 +1773,21 @@ interface UnsavedApplicationDialogLabels {
1773
1773
  closeButton: string;
1774
1774
  }
1775
1775
 
1776
+ interface DeleteApplicationDialogLabels {
1777
+ title: string;
1778
+ /**
1779
+ * The description is split around the emphasised name of the save control so
1780
+ * the bold run can be restyled without translators touching markup.
1781
+ */
1782
+ descriptionBeforeEmphasis: string;
1783
+ descriptionEmphasis: string;
1784
+ descriptionAfterEmphasis: string;
1785
+ /** Closes the prompt and returns to the form. */
1786
+ keepEditingButton: string;
1787
+ /** Permanently deletes the application. */
1788
+ deleteButton: string;
1789
+ }
1790
+
1776
1791
  interface BankAccountOnboardingWidgetLabels {
1777
1792
  stepIndicator: {
1778
1793
  business: string;
@@ -1786,11 +1801,20 @@ interface BankAccountOnboardingWidgetLabels {
1786
1801
  result: ResultLabels;
1787
1802
  /** The prompt shown when closing with unsaved changes. */
1788
1803
  unsavedApplicationDialog: Partial<UnsavedApplicationDialogLabels>;
1804
+ /**
1805
+ * The prompt confirming "Cancel and delete application". Its bold run
1806
+ * defaults to `saveAndClose`, so it names the footer's save control.
1807
+ */
1808
+ deleteApplicationDialog: Partial<DeleteApplicationDialogLabels>;
1789
1809
  back: string;
1790
1810
  cancel: string;
1791
1811
  next: string;
1792
1812
  submit: string;
1793
1813
  saveAndClose: string;
1814
+ /** The destructive footer control that opens the delete prompt. */
1815
+ deleteApplication: string;
1816
+ /** Shown once the application has been deleted. */
1817
+ applicationDeletedToast: string;
1794
1818
  /** Shown after "Save and close" or the close prompt's "Save changes" writes the application. */
1795
1819
  applicationSavedToast: string;
1796
1820
  businessReviewTitle: string;
@@ -1852,6 +1876,11 @@ interface BankAccountOnboardingWidgetInnerProps {
1852
1876
  applicationId: string;
1853
1877
  authEpoch: number;
1854
1878
  } | null) => void;
1879
+ /**
1880
+ * Called once the applicant has deleted the application, so the session
1881
+ * scope can start a fresh one. Set by the session scope, not by hosts.
1882
+ */
1883
+ onApplicationDeleted?: () => void;
1855
1884
  bankLogoSrc?: string;
1856
1885
  /**
1857
1886
  * Host-resolved disclosure URLs for the business-details agreement step.
@@ -1886,7 +1915,7 @@ interface BankAccountOnboardingWidgetInnerProps {
1886
1915
  */
1887
1916
  isFullScreenInline?: boolean;
1888
1917
  }
1889
- type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange'> & {
1918
+ type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange' | 'onApplicationDeleted'> & {
1890
1919
  initialBusinessDetails?: Partial<HostSupplied<BusinessDetailsValues>>;
1891
1920
  initialPersonalDetails?: Partial<HostSupplied<PersonalDetailsValues>>;
1892
1921
  initialAdditionalOwners?: HostSuppliedOwner[];
@@ -2795,12 +2824,10 @@ interface CardsWidgetProps extends WidgetProviderProps {
2795
2824
  * details panel's card face — forwarded verbatim into both nested
2796
2825
  * `CreateCardWidget` and `CardDetailsWidget`, so a card created in this
2797
2826
  * widget's own sheet and that same card's later details view show the same
2798
- * artwork. Required for the create sheet specifically: omitting it (with no
2799
- * host `onCreateCard`) hides Create card rather than opening a panel that
2800
- * cannot render. The details panel has no such requirement — omitting it
2801
- * just falls back to `bankLogoSrc`, same as `CardDetailsWidget` on its own.
2802
- * Same PLAT-1179 / ADR 0005 rule as `bankLogoSrc` — the package ships no
2803
- * card artwork.
2827
+ * artwork. Omitted, the create sheet draws a built-in neutral plastic and the
2828
+ * details panel falls back to `bankLogoSrc`, same as `CardDetailsWidget` on
2829
+ * its own. Card art never decides whether Create card shows; the token's
2830
+ * scopes do.
2804
2831
  */
2805
2832
  cardArtSrc?: string;
2806
2833
  /**
@@ -2817,11 +2844,11 @@ interface CardsWidgetProps extends WidgetProviderProps {
2817
2844
  createCardFeatureLabels?: CreateCardWidgetProps['featureLabels'];
2818
2845
  /**
2819
2846
  * Called when Create card is clicked. When supplied, the host owns the
2820
- * gesture: the built-in debit sheet does **not** open. Omit it on a debit list
2821
- * with `cardArtSrc` to use the built-in `CreateCardWidget` sheet. Credit has
2822
- * no in-package issuance widget, so credit Create card still requires this
2823
- * callback — omitting it hides the button rather than offering a control that
2824
- * does nothing.
2847
+ * gesture: the built-in debit sheet does **not** open. Omit it on a debit
2848
+ * list to use the built-in `CreateCardWidget` sheet. Credit has no in-package
2849
+ * issuance widget, so credit Create card still requires this callback —
2850
+ * omitting it hides the button rather than offering a control that does
2851
+ * nothing.
2825
2852
  */
2826
2853
  onCreateCard?: () => void;
2827
2854
  /**
@@ -2884,10 +2911,11 @@ type DebitCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram'>;
2884
2911
  * Create card and per-row Activate affordances. Selecting a row opens that
2885
2912
  * card's read-only details in a sheet.
2886
2913
  *
2887
- * With `cardArtSrc`, Create card opens the same sheet with the built-in
2888
- * `CreateCardWidget` issuance flow; a host `onCreateCard` still takes the
2889
- * gesture over. Credit is {@link CreditCardsWidget}, which accepts neither
2890
- * `cardArtSrc` nor the create-panel labels.
2914
+ * Create card opens the same sheet with the built-in `CreateCardWidget`
2915
+ * issuance flow, drawing `cardArtSrc` or a built-in plastic; a host
2916
+ * `onCreateCard` still takes the gesture over. Credit is
2917
+ * {@link CreditCardsWidget}, which accepts neither `cardArtSrc` nor the
2918
+ * create-panel labels.
2891
2919
  *
2892
2920
  * The program is pinned *after* the spread, so a JavaScript host still passing
2893
2921
  * the retired `cardProgram` cannot point this export at the credit endpoint.
@@ -3657,10 +3685,10 @@ interface WidgetSuiteProps extends WidgetProviderProps {
3657
3685
  onboardingDisclosureLinks?: DisclosureLinks;
3658
3686
  /**
3659
3687
  * Card artwork URL for the debit list's built-in Create card sheet and its
3660
- * details card face. Omitted, both use a built-in neutral plastic, so Create
3661
- * card still shows whenever the token holds the issue, roster and funding
3662
- * scopes. Credit has no in-package issuance flow, so its Create card stays
3663
- * hidden either way.
3688
+ * details card face. Omitted, the sheet draws a built-in neutral plastic and
3689
+ * the face falls back to the bank logo. Create card shows whenever the token
3690
+ * holds the issue, roster and funding scopes. Credit has no in-package
3691
+ * issuance flow, so its Create card stays hidden either way.
3664
3692
  */
3665
3693
  cardArtSrc?: string;
3666
3694
  }
package/dist/index.js CHANGED
@@ -16,8 +16,8 @@ import { useDisclosuresAcceptanceSurface as b, useOwnWidgetConfig as x, useRefet
16
16
  import { BankAccountsWidget as D } from "./libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js";
17
17
  import { BillPayWidget as O } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index91.js";
18
18
  import { CardDetailsWidget as k } from "./libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js";
19
- import { CreditCardsWidget as A } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index10.js";
20
- import { DebitCardsWidget as j } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index11.js";
19
+ import { CreditCardsWidget as A } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index11.js";
20
+ import { DebitCardsWidget as j } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index12.js";
21
21
  import { BALANCES_WIDGET_LABELS_EN as M } from "./libs/tesouro-embedded-components-react/balances-widget/ui/dist/lib/BalancesWidget/labels.js";
22
22
  import { BalancesWidget as N } from "./libs/tesouro-embedded-components-react/balances-widget/feature/dist/index6.js";
23
23
  import { INSIGHTS_FEATURE_LABELS_EN as P } from "./libs/tesouro-embedded-components-react/insights-widget/feature/dist/index3.js";
@@ -926,6 +926,21 @@ interface UnsavedApplicationDialogLabels {
926
926
  closeButton: string;
927
927
  }
928
928
 
929
+ interface DeleteApplicationDialogLabels {
930
+ title: string;
931
+ /**
932
+ * The description is split around the emphasised name of the save control so
933
+ * the bold run can be restyled without translators touching markup.
934
+ */
935
+ descriptionBeforeEmphasis: string;
936
+ descriptionEmphasis: string;
937
+ descriptionAfterEmphasis: string;
938
+ /** Closes the prompt and returns to the form. */
939
+ keepEditingButton: string;
940
+ /** Permanently deletes the application. */
941
+ deleteButton: string;
942
+ }
943
+
929
944
  interface BankAccountOnboardingWidgetLabels {
930
945
  stepIndicator: {
931
946
  business: string;
@@ -939,11 +954,20 @@ interface BankAccountOnboardingWidgetLabels {
939
954
  result: ResultLabels;
940
955
  /** The prompt shown when closing with unsaved changes. */
941
956
  unsavedApplicationDialog: Partial<UnsavedApplicationDialogLabels>;
957
+ /**
958
+ * The prompt confirming "Cancel and delete application". Its bold run
959
+ * defaults to `saveAndClose`, so it names the footer's save control.
960
+ */
961
+ deleteApplicationDialog: Partial<DeleteApplicationDialogLabels>;
942
962
  back: string;
943
963
  cancel: string;
944
964
  next: string;
945
965
  submit: string;
946
966
  saveAndClose: string;
967
+ /** The destructive footer control that opens the delete prompt. */
968
+ deleteApplication: string;
969
+ /** Shown once the application has been deleted. */
970
+ applicationDeletedToast: string;
947
971
  /** Shown after "Save and close" or the close prompt's "Save changes" writes the application. */
948
972
  applicationSavedToast: string;
949
973
  businessReviewTitle: string;
@@ -1005,6 +1029,11 @@ interface BankAccountOnboardingWidgetInnerProps {
1005
1029
  applicationId: string;
1006
1030
  authEpoch: number;
1007
1031
  } | null) => void;
1032
+ /**
1033
+ * Called once the applicant has deleted the application, so the session
1034
+ * scope can start a fresh one. Set by the session scope, not by hosts.
1035
+ */
1036
+ onApplicationDeleted?: () => void;
1008
1037
  bankLogoSrc?: string;
1009
1038
  /**
1010
1039
  * Host-resolved disclosure URLs for the business-details agreement step.
@@ -1039,7 +1068,7 @@ interface BankAccountOnboardingWidgetInnerProps {
1039
1068
  */
1040
1069
  isFullScreenInline?: boolean;
1041
1070
  }
1042
- type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange'> & {
1071
+ type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange' | 'onApplicationDeleted'> & {
1043
1072
  initialBusinessDetails?: Partial<HostSupplied<BusinessDetailsValues>>;
1044
1073
  initialPersonalDetails?: Partial<HostSupplied<PersonalDetailsValues>>;
1045
1074
  initialAdditionalOwners?: HostSuppliedOwner[];
@@ -1382,12 +1382,10 @@ interface CardsWidgetProps extends WidgetProviderProps {
1382
1382
  * details panel's card face — forwarded verbatim into both nested
1383
1383
  * `CreateCardWidget` and `CardDetailsWidget`, so a card created in this
1384
1384
  * widget's own sheet and that same card's later details view show the same
1385
- * artwork. Required for the create sheet specifically: omitting it (with no
1386
- * host `onCreateCard`) hides Create card rather than opening a panel that
1387
- * cannot render. The details panel has no such requirement — omitting it
1388
- * just falls back to `bankLogoSrc`, same as `CardDetailsWidget` on its own.
1389
- * Same PLAT-1179 / ADR 0005 rule as `bankLogoSrc` — the package ships no
1390
- * card artwork.
1385
+ * artwork. Omitted, the create sheet draws a built-in neutral plastic and the
1386
+ * details panel falls back to `bankLogoSrc`, same as `CardDetailsWidget` on
1387
+ * its own. Card art never decides whether Create card shows; the token's
1388
+ * scopes do.
1391
1389
  */
1392
1390
  cardArtSrc?: string;
1393
1391
  /**
@@ -1404,11 +1402,11 @@ interface CardsWidgetProps extends WidgetProviderProps {
1404
1402
  createCardFeatureLabels?: CreateCardWidgetProps['featureLabels'];
1405
1403
  /**
1406
1404
  * Called when Create card is clicked. When supplied, the host owns the
1407
- * gesture: the built-in debit sheet does **not** open. Omit it on a debit list
1408
- * with `cardArtSrc` to use the built-in `CreateCardWidget` sheet. Credit has
1409
- * no in-package issuance widget, so credit Create card still requires this
1410
- * callback — omitting it hides the button rather than offering a control that
1411
- * does nothing.
1405
+ * gesture: the built-in debit sheet does **not** open. Omit it on a debit
1406
+ * list to use the built-in `CreateCardWidget` sheet. Credit has no in-package
1407
+ * issuance widget, so credit Create card still requires this callback —
1408
+ * omitting it hides the button rather than offering a control that does
1409
+ * nothing.
1412
1410
  */
1413
1411
  onCreateCard?: () => void;
1414
1412
  /**
@@ -1,3 +1,3 @@
1
- import { CreditCardsWidget as e } from "../libs/tesouro-embedded-components-react/cards-widget/feature/dist/index10.js";
1
+ import { CreditCardsWidget as e } from "../libs/tesouro-embedded-components-react/cards-widget/feature/dist/index11.js";
2
2
  import "../libs/tesouro-embedded-components-react/cards-widget/feature/dist/index.js";
3
3
  export { e as CreditCardsWidget };
@@ -1382,12 +1382,10 @@ interface CardsWidgetProps extends WidgetProviderProps {
1382
1382
  * details panel's card face — forwarded verbatim into both nested
1383
1383
  * `CreateCardWidget` and `CardDetailsWidget`, so a card created in this
1384
1384
  * widget's own sheet and that same card's later details view show the same
1385
- * artwork. Required for the create sheet specifically: omitting it (with no
1386
- * host `onCreateCard`) hides Create card rather than opening a panel that
1387
- * cannot render. The details panel has no such requirement — omitting it
1388
- * just falls back to `bankLogoSrc`, same as `CardDetailsWidget` on its own.
1389
- * Same PLAT-1179 / ADR 0005 rule as `bankLogoSrc` — the package ships no
1390
- * card artwork.
1385
+ * artwork. Omitted, the create sheet draws a built-in neutral plastic and the
1386
+ * details panel falls back to `bankLogoSrc`, same as `CardDetailsWidget` on
1387
+ * its own. Card art never decides whether Create card shows; the token's
1388
+ * scopes do.
1391
1389
  */
1392
1390
  cardArtSrc?: string;
1393
1391
  /**
@@ -1404,11 +1402,11 @@ interface CardsWidgetProps extends WidgetProviderProps {
1404
1402
  createCardFeatureLabels?: CreateCardWidgetProps['featureLabels'];
1405
1403
  /**
1406
1404
  * Called when Create card is clicked. When supplied, the host owns the
1407
- * gesture: the built-in debit sheet does **not** open. Omit it on a debit list
1408
- * with `cardArtSrc` to use the built-in `CreateCardWidget` sheet. Credit has
1409
- * no in-package issuance widget, so credit Create card still requires this
1410
- * callback — omitting it hides the button rather than offering a control that
1411
- * does nothing.
1405
+ * gesture: the built-in debit sheet does **not** open. Omit it on a debit
1406
+ * list to use the built-in `CreateCardWidget` sheet. Credit has no in-package
1407
+ * issuance widget, so credit Create card still requires this callback —
1408
+ * omitting it hides the button rather than offering a control that does
1409
+ * nothing.
1412
1410
  */
1413
1411
  onCreateCard?: () => void;
1414
1412
  /**
@@ -1446,10 +1444,11 @@ type DebitCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram'>;
1446
1444
  * Create card and per-row Activate affordances. Selecting a row opens that
1447
1445
  * card's read-only details in a sheet.
1448
1446
  *
1449
- * With `cardArtSrc`, Create card opens the same sheet with the built-in
1450
- * `CreateCardWidget` issuance flow; a host `onCreateCard` still takes the
1451
- * gesture over. Credit is {@link CreditCardsWidget}, which accepts neither
1452
- * `cardArtSrc` nor the create-panel labels.
1447
+ * Create card opens the same sheet with the built-in `CreateCardWidget`
1448
+ * issuance flow, drawing `cardArtSrc` or a built-in plastic; a host
1449
+ * `onCreateCard` still takes the gesture over. Credit is
1450
+ * {@link CreditCardsWidget}, which accepts neither `cardArtSrc` nor the
1451
+ * create-panel labels.
1453
1452
  *
1454
1453
  * The program is pinned *after* the spread, so a JavaScript host still passing
1455
1454
  * the retired `cardProgram` cannot point this export at the credit endpoint.
@@ -1,3 +1,3 @@
1
- import { DebitCardsWidget as e } from "../libs/tesouro-embedded-components-react/cards-widget/feature/dist/index11.js";
1
+ import { DebitCardsWidget as e } from "../libs/tesouro-embedded-components-react/cards-widget/feature/dist/index12.js";
2
2
  import "../libs/tesouro-embedded-components-react/cards-widget/feature/dist/index.js";
3
3
  export { e as DebitCardsWidget };
@@ -976,6 +976,21 @@ interface UnsavedApplicationDialogLabels {
976
976
  closeButton: string;
977
977
  }
978
978
 
979
+ interface DeleteApplicationDialogLabels {
980
+ title: string;
981
+ /**
982
+ * The description is split around the emphasised name of the save control so
983
+ * the bold run can be restyled without translators touching markup.
984
+ */
985
+ descriptionBeforeEmphasis: string;
986
+ descriptionEmphasis: string;
987
+ descriptionAfterEmphasis: string;
988
+ /** Closes the prompt and returns to the form. */
989
+ keepEditingButton: string;
990
+ /** Permanently deletes the application. */
991
+ deleteButton: string;
992
+ }
993
+
979
994
  interface BankAccountOnboardingWidgetLabels {
980
995
  stepIndicator: {
981
996
  business: string;
@@ -989,11 +1004,20 @@ interface BankAccountOnboardingWidgetLabels {
989
1004
  result: ResultLabels;
990
1005
  /** The prompt shown when closing with unsaved changes. */
991
1006
  unsavedApplicationDialog: Partial<UnsavedApplicationDialogLabels>;
1007
+ /**
1008
+ * The prompt confirming "Cancel and delete application". Its bold run
1009
+ * defaults to `saveAndClose`, so it names the footer's save control.
1010
+ */
1011
+ deleteApplicationDialog: Partial<DeleteApplicationDialogLabels>;
992
1012
  back: string;
993
1013
  cancel: string;
994
1014
  next: string;
995
1015
  submit: string;
996
1016
  saveAndClose: string;
1017
+ /** The destructive footer control that opens the delete prompt. */
1018
+ deleteApplication: string;
1019
+ /** Shown once the application has been deleted. */
1020
+ applicationDeletedToast: string;
997
1021
  /** Shown after "Save and close" or the close prompt's "Save changes" writes the application. */
998
1022
  applicationSavedToast: string;
999
1023
  businessReviewTitle: string;
@@ -1055,6 +1079,11 @@ interface BankAccountOnboardingWidgetInnerProps {
1055
1079
  applicationId: string;
1056
1080
  authEpoch: number;
1057
1081
  } | null) => void;
1082
+ /**
1083
+ * Called once the applicant has deleted the application, so the session
1084
+ * scope can start a fresh one. Set by the session scope, not by hosts.
1085
+ */
1086
+ onApplicationDeleted?: () => void;
1058
1087
  bankLogoSrc?: string;
1059
1088
  /**
1060
1089
  * Host-resolved disclosure URLs for the business-details agreement step.
@@ -1089,7 +1118,7 @@ interface BankAccountOnboardingWidgetInnerProps {
1089
1118
  */
1090
1119
  isFullScreenInline?: boolean;
1091
1120
  }
1092
- type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange'> & {
1121
+ type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange' | 'onApplicationDeleted'> & {
1093
1122
  initialBusinessDetails?: Partial<HostSupplied<BusinessDetailsValues>>;
1094
1123
  initialPersonalDetails?: Partial<HostSupplied<PersonalDetailsValues>>;
1095
1124
  initialAdditionalOwners?: HostSuppliedOwner[];
@@ -1979,12 +2008,10 @@ interface CardsWidgetProps extends WidgetProviderProps {
1979
2008
  * details panel's card face — forwarded verbatim into both nested
1980
2009
  * `CreateCardWidget` and `CardDetailsWidget`, so a card created in this
1981
2010
  * widget's own sheet and that same card's later details view show the same
1982
- * artwork. Required for the create sheet specifically: omitting it (with no
1983
- * host `onCreateCard`) hides Create card rather than opening a panel that
1984
- * cannot render. The details panel has no such requirement — omitting it
1985
- * just falls back to `bankLogoSrc`, same as `CardDetailsWidget` on its own.
1986
- * Same PLAT-1179 / ADR 0005 rule as `bankLogoSrc` — the package ships no
1987
- * card artwork.
2011
+ * artwork. Omitted, the create sheet draws a built-in neutral plastic and the
2012
+ * details panel falls back to `bankLogoSrc`, same as `CardDetailsWidget` on
2013
+ * its own. Card art never decides whether Create card shows; the token's
2014
+ * scopes do.
1988
2015
  */
1989
2016
  cardArtSrc?: string;
1990
2017
  /**
@@ -2001,11 +2028,11 @@ interface CardsWidgetProps extends WidgetProviderProps {
2001
2028
  createCardFeatureLabels?: CreateCardWidgetProps['featureLabels'];
2002
2029
  /**
2003
2030
  * Called when Create card is clicked. When supplied, the host owns the
2004
- * gesture: the built-in debit sheet does **not** open. Omit it on a debit list
2005
- * with `cardArtSrc` to use the built-in `CreateCardWidget` sheet. Credit has
2006
- * no in-package issuance widget, so credit Create card still requires this
2007
- * callback — omitting it hides the button rather than offering a control that
2008
- * does nothing.
2031
+ * gesture: the built-in debit sheet does **not** open. Omit it on a debit
2032
+ * list to use the built-in `CreateCardWidget` sheet. Credit has no in-package
2033
+ * issuance widget, so credit Create card still requires this callback —
2034
+ * omitting it hides the button rather than offering a control that does
2035
+ * nothing.
2009
2036
  */
2010
2037
  onCreateCard?: () => void;
2011
2038
  /**
@@ -2796,10 +2823,10 @@ interface WidgetSuiteProps extends WidgetProviderProps {
2796
2823
  onboardingDisclosureLinks?: DisclosureLinks;
2797
2824
  /**
2798
2825
  * Card artwork URL for the debit list's built-in Create card sheet and its
2799
- * details card face. Omitted, both use a built-in neutral plastic, so Create
2800
- * card still shows whenever the token holds the issue, roster and funding
2801
- * scopes. Credit has no in-package issuance flow, so its Create card stays
2802
- * hidden either way.
2826
+ * details card face. Omitted, the sheet draws a built-in neutral plastic and
2827
+ * the face falls back to the bank logo. Create card shows whenever the token
2828
+ * holds the issue, roster and funding scopes. Credit has no in-package
2829
+ * issuance flow, so its Create card stays hidden either way.
2803
2830
  */
2804
2831
  cardArtSrc?: string;
2805
2832
  }
@@ -5,7 +5,8 @@ import { ApplicationClientSecretProvider as n, useApplicationClientSecret as r }
5
5
  import { useCreateApplication as i } from "./index5.js";
6
6
  import { useUpdateApplication as a } from "./index6.js";
7
7
  import { useSubmitApplication as o } from "./index7.js";
8
- import { usePollApplicationCompletion as s } from "./index8.js";
9
- import { useResumableBankAccountApplication as c } from "./index10.js";
10
- import { useStartedBankAccountApplication as l } from "./index11.js";
11
- export { n as ApplicationClientSecretProvider, e as OnboardingSuppressionReason, r as useApplicationClientSecret, i as useCreateApplication, t as useOrganizationOnboardingSuppression, s as usePollApplicationCompletion, c as useResumableBankAccountApplication, l as useStartedBankAccountApplication, o as useSubmitApplication, a as useUpdateApplication };
8
+ import { useDeleteApplication as s } from "./index8.js";
9
+ import { usePollApplicationCompletion as c } from "./index9.js";
10
+ import { useResumableBankAccountApplication as l } from "./index11.js";
11
+ import { useStartedBankAccountApplication as u } from "./index12.js";
12
+ export { n as ApplicationClientSecretProvider, e as OnboardingSuppressionReason, r as useApplicationClientSecret, i as useCreateApplication, s as useDeleteApplication, t as useOrganizationOnboardingSuppression, c as usePollApplicationCompletion, l as useResumableBankAccountApplication, u as useStartedBankAccountApplication, o as useSubmitApplication, a as useUpdateApplication };
@@ -1,35 +1,6 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { applicationStatusQueryOptions as e } from "../../../shared/data-access/dist/lib/applicationStatusQueryOptions.js";
6
- import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
- import "../../../shared/data-access/dist/index.js";
8
- import { hasFreshAnswer as n } from "./index9.js";
9
- import { useQuery as r } from "@tanstack/react-query";
10
1
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index10.js
11
- var i = "DRAFT", a = "BANK_ACCOUNT", o = "STARTED_BY_YOU";
12
- function s(e) {
13
- return e.find((e) => e.product === a && e.ownership === o && e.status === i && !!e.applicationId && !!e.clientSecret);
14
- }
15
- function c(e) {
16
- return e.filter((e) => e.product === a && e.ownership === o).map((e) => e.applicationId).filter((e) => !!e);
17
- }
18
- function l() {
19
- let { client: i, widgetToken: a, authEpoch: o } = t(), l = !!a, u = r({
20
- ...e({
21
- client: i,
22
- widgetToken: a,
23
- authEpoch: o
24
- }),
25
- enabled: l
26
- }), d = l && n(u), f = d && !u.isError ? u.data?.applications ?? null : null, p = f ? s(f) : void 0;
27
- return {
28
- applicationId: p?.applicationId ?? null,
29
- clientSecret: p?.clientSecret ?? null,
30
- isResolved: d,
31
- ownApplicationIds: f ? c(f) : null
32
- };
2
+ function e(e) {
3
+ return (e.isSuccess || e.isError) && !e.isFetching;
33
4
  }
34
5
  //#endregion
35
- export { l as useResumableBankAccountApplication };
6
+ export { e as hasFreshAnswer };