@tesouro/embedded-components-react 0.2.259 → 0.2.261

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 (26) hide show
  1. package/README.md +45 -37
  2. package/dist/index.d.ts +236 -128
  3. package/dist/index.js +13 -12
  4. package/dist/lib/CardsWidget.d.ts +142 -14
  5. package/dist/lib/ProfileWidget.d.ts +16 -0
  6. package/dist/lib/SettingsWidget.d.ts +65 -3
  7. package/dist/lib/SettingsWidget.js +3 -2
  8. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index5.js +13 -8
  9. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index7.js +31 -30
  10. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +56 -34
  11. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListDetailsSheet.js +20 -20
  12. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/labels.js +8 -0
  13. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index22.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index327.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index597.js +1 -1
  16. package/dist/libs/tesouro-embedded-components-react/profile-widget/feature/dist/index4.js +59 -56
  17. package/dist/libs/tesouro-embedded-components-react/profile-widget/ui/dist/index2.js +3 -1
  18. package/dist/libs/tesouro-embedded-components-react/profile-widget/ui/dist/index3.js +25 -9
  19. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index.js +4 -3
  20. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index4.js +20 -41
  21. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index5.js +37 -122
  22. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +133 -2
  23. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index7.js +3 -0
  24. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index4.js +1 -1
  26. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -18,12 +18,12 @@ import { CounterpartsWidget as S } from "./libs/tesouro-embedded-components-reac
18
18
  import { BillPayWidget as C } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js";
19
19
  import "./lib/BillPayWidget.js";
20
20
  import { CardDetailsWidget as w } from "./libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js";
21
- import { CardsWidget as T } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js";
21
+ import { CardFormatValue as T } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index3.js";
22
+ import { CREATE_CARD_FEATURE_LABELS_EN as E, resolveCreateCardFeatureLabels as D } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index4.js";
23
+ import { CreateCardWidget as O } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js";
24
+ import { CardsWidget as k } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js";
22
25
  import "./lib/CardsWidget.js";
23
26
  import "./lib/CardDetailsWidget.js";
24
- import { CardFormatValue as E } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index3.js";
25
- import { CREATE_CARD_FEATURE_LABELS_EN as D, resolveCreateCardFeatureLabels as O } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index4.js";
26
- import { CreateCardWidget as k } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js";
27
27
  import "./lib/CreateCardWidget.js";
28
28
  import "./lib/CounterpartsWidget.js";
29
29
  import { ExpenseApprovalPoliciesWidget as A } from "./libs/tesouro-embedded-components-react/expense-approval-policies-widget/feature/dist/lib/ExpenseApprovalPoliciesWidgetFeature.js";
@@ -70,17 +70,18 @@ import "./lib/ProfileWidget.js";
70
70
  import "./lib/ReceivablesWidget.js";
71
71
  import { ReceiptMatchWidget as se } from "./libs/tesouro-embedded-components-react/expense-receipt-match-widget/feature/dist/lib/ReceiptMatchWidget.js";
72
72
  import "./lib/ReceiptMatchWidget.js";
73
- import { TagsWidget as ce } from "./libs/tesouro-embedded-components-react/tags-widget/feature/dist/index11.js";
74
- import { TeamWidget as le } from "./libs/tesouro-embedded-components-react/team-widget/feature/dist/index17.js";
75
- import { SettingsWidget as ue } from "./libs/tesouro-embedded-components-react/settings-widget/feature/dist/index5.js";
73
+ import { SettingsSection as ce } from "./libs/tesouro-embedded-components-react/settings-widget/feature/dist/index4.js";
74
+ import { TagsWidget as le } from "./libs/tesouro-embedded-components-react/tags-widget/feature/dist/index11.js";
75
+ import { TeamWidget as ue } from "./libs/tesouro-embedded-components-react/team-widget/feature/dist/index17.js";
76
+ import { SettingsWidget as de } from "./libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js";
76
77
  import "./lib/SettingsWidget.js";
77
78
  import "./lib/TagsWidget.js";
78
79
  import "./lib/TeamWidget.js";
79
- import { DEFAULT_FEATURE_LABELS as de } from "./libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index3.js";
80
- import { TRANSFERS_WIDGET_LABELS_EN as fe } from "./libs/tesouro-embedded-components-react/transfers-widget/ui/dist/index9.js";
81
- import { TransfersWidget as pe } from "./libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index6.js";
80
+ import { DEFAULT_FEATURE_LABELS as fe } from "./libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index3.js";
81
+ import { TRANSFERS_WIDGET_LABELS_EN as pe } from "./libs/tesouro-embedded-components-react/transfers-widget/ui/dist/index9.js";
82
+ import { TransfersWidget as me } from "./libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index6.js";
82
83
  import "./lib/TransfersWidget.js";
83
84
  import "./lib/UploadReceiptWidget.js";
84
- import { WidgetProvider as me } from "./lib/WidgetProviderPublic.js";
85
+ import { WidgetProvider as he } from "./lib/WidgetProviderPublic.js";
85
86
  import "./lib/WidgetProvider.js";
86
- export { e as ACCEPT_DISCLOSURES_WIDGET_LABELS_EN, V as ACCOUNT_DELETE_DIALOG_LABELS_EN, H as ACCOUNT_FORM_SHEET_LABELS_EN, ee as ADDITIONAL_OWNERS_LABELS_EN, b as AcceptDisclosuresWidget, K as AccountDeleteDialog, G as AccountFormSheet, P as BALANCES_WIDGET_LABELS_EN, te as BUSINESS_DETAILS_LABELS_EN, F as BalancesWidget, ie as BankAccountOnboardingWidget, x as BankAccountsWidget, C as BillPayWidget, U as CHART_OF_ACCOUNTS_LABELS_EN, B as CHART_OF_ACCOUNTS_MESSAGE_LABELS_EN, D as CREATE_CARD_FEATURE_LABELS_EN, w as CardDetailsWidget, E as CardFormatValue, T as CardsWidget, W as ChartOfAccountsTable, q as ChartOfAccountsWidget, S as CounterpartsWidget, k as CreateCardWidget, A as ExpenseApprovalPoliciesWidget, N as ExpenseManagementWidget, j as ExpenseRequirementsWidget, Y as HELP_FAQ_EN, J as HELP_WIDGET_LABELS_EN, X as HelpWidget, I as INSIGHTS_FEATURE_LABELS_EN, L as INSIGHTS_WIDGET_LABELS_EN, n as Implementation, z as InsightsWidget, Z as InvoicingWidget, $ as LinkedAccountsWidget, ne as PERSONAL_DETAILS_LABELS_EN, ae as ProductsWidget, oe as ProfileWidget, re as RESULT_LABELS_EN, se as ReceiptMatchWidget, Q as ReceivablesWidget, m as RefreshingRootWidgetProvider, d as RootWidgetProvider, R as SINGLE_INSIGHT_LABELS_EN, ue as SettingsWidget, de as TRANSFERS_FEATURE_LABELS_EN, fe as TRANSFERS_WIDGET_LABELS_EN, ce as TagsWidget, le as TeamWidget, pe as TransfersWidget, c as UIFramework, M as UploadReceiptWidget, me as WidgetProvider, f as WidgetTokenRefreshProvider, t as cloneEmbeddedClient, r as getGlobalWidgetConfig, o as getGlobalWidgetInitState, l as registerDesignSystemEnsurer, u as registerUIRenderers, O as resolveCreateCardFeatureLabels, i as setGlobalWidgetConfig, s as subscribeToGlobalWidgetInitState, a as updateGlobalWidgetConfig, h as useOwnWidgetConfig, g as useRefetchWidget, _ as useWidgetConfig, v as useWidgetError, y as useWidgetLoading, p as useWidgetToken };
87
+ export { e as ACCEPT_DISCLOSURES_WIDGET_LABELS_EN, V as ACCOUNT_DELETE_DIALOG_LABELS_EN, H as ACCOUNT_FORM_SHEET_LABELS_EN, ee as ADDITIONAL_OWNERS_LABELS_EN, b as AcceptDisclosuresWidget, K as AccountDeleteDialog, G as AccountFormSheet, P as BALANCES_WIDGET_LABELS_EN, te as BUSINESS_DETAILS_LABELS_EN, F as BalancesWidget, ie as BankAccountOnboardingWidget, x as BankAccountsWidget, C as BillPayWidget, U as CHART_OF_ACCOUNTS_LABELS_EN, B as CHART_OF_ACCOUNTS_MESSAGE_LABELS_EN, E as CREATE_CARD_FEATURE_LABELS_EN, w as CardDetailsWidget, T as CardFormatValue, k as CardsWidget, W as ChartOfAccountsTable, q as ChartOfAccountsWidget, S as CounterpartsWidget, O as CreateCardWidget, A as ExpenseApprovalPoliciesWidget, N as ExpenseManagementWidget, j as ExpenseRequirementsWidget, Y as HELP_FAQ_EN, J as HELP_WIDGET_LABELS_EN, X as HelpWidget, I as INSIGHTS_FEATURE_LABELS_EN, L as INSIGHTS_WIDGET_LABELS_EN, n as Implementation, z as InsightsWidget, Z as InvoicingWidget, $ as LinkedAccountsWidget, ne as PERSONAL_DETAILS_LABELS_EN, ae as ProductsWidget, oe as ProfileWidget, re as RESULT_LABELS_EN, se as ReceiptMatchWidget, Q as ReceivablesWidget, m as RefreshingRootWidgetProvider, d as RootWidgetProvider, R as SINGLE_INSIGHT_LABELS_EN, ce as SettingsSection, de as SettingsWidget, fe as TRANSFERS_FEATURE_LABELS_EN, pe as TRANSFERS_WIDGET_LABELS_EN, le as TagsWidget, ue as TeamWidget, me as TransfersWidget, c as UIFramework, M as UploadReceiptWidget, he as WidgetProvider, f as WidgetTokenRefreshProvider, t as cloneEmbeddedClient, r as getGlobalWidgetConfig, o as getGlobalWidgetInitState, l as registerDesignSystemEnsurer, u as registerUIRenderers, D as resolveCreateCardFeatureLabels, i as setGlobalWidgetConfig, s as subscribeToGlobalWidgetInitState, a as updateGlobalWidgetConfig, h as useOwnWidgetConfig, g as useRefetchWidget, _ as useWidgetConfig, v as useWidgetError, y as useWidgetLoading, p as useWidgetToken };
@@ -34,8 +34,8 @@ interface PaginationFooterLabels {
34
34
  * label without restating its siblings. Defined locally because the repo has no
35
35
  * shared deep-partial type and does not depend on `type-fest`.
36
36
  */
37
- type PartialDeep$2<T> = {
38
- [K in keyof T]?: T[K] extends object ? PartialDeep$2<T[K]> : T[K];
37
+ type PartialDeep$3<T> = {
38
+ [K in keyof T]?: T[K] extends object ? PartialDeep$3<T[K]> : T[K];
39
39
  };
40
40
  interface CardsListColumnHeaderLabels {
41
41
  cardName: string;
@@ -103,6 +103,11 @@ interface CardsListLabels {
103
103
  * sits here for a footer that lives in `shared/ui`.
104
104
  */
105
105
  detailsSheet: CardsListDetailsSheetLabels;
106
+ /**
107
+ * Screen-reader copy for the same sheet when Create card is slotted in, rather
108
+ * than a selected card's details. Same chrome, different accessible name.
109
+ */
110
+ createSheet: CardsListDetailsSheetLabels;
106
111
  }
107
112
 
108
113
  type AuthToken = string | undefined;
@@ -744,8 +749,8 @@ interface CardDetailsPanelLabels {
744
749
  * has an identical one for the panel's labels, and this declaration also types
745
750
  * that prop here so the widget carries one such helper rather than two.
746
751
  */
747
- type PartialDeep$1<T> = {
748
- [K in keyof T]?: T[K] extends object ? PartialDeep$1<T[K]> : T[K];
752
+ type PartialDeep$2<T> = {
753
+ [K in keyof T]?: T[K] extends object ? PartialDeep$2<T[K]> : T[K];
749
754
  };
750
755
  /**
751
756
  * Copy the **feature** layer owns, as opposed to the panel's own
@@ -798,9 +803,9 @@ interface CardDetailsWidgetProps extends WidgetProviderProps {
798
803
  */
799
804
  onClose?: () => void;
800
805
  /** Overrides for the panel's own copy. */
801
- labels?: PartialDeep$1<CardDetailsPanelLabels>;
806
+ labels?: PartialDeep$2<CardDetailsPanelLabels>;
802
807
  /** Overrides for the copy this layer resolves — see `CardDetailsFeatureLabels`. */
803
- featureLabels?: PartialDeep$1<CardDetailsFeatureLabels>;
808
+ featureLabels?: PartialDeep$2<CardDetailsFeatureLabels>;
804
809
  /**
805
810
  * Bank logo for the card face. The widget ships no bank artwork of its own and
806
811
  * resolves none from the init response: an embeddable library must not depend
@@ -813,6 +818,104 @@ interface CardDetailsWidgetProps extends WidgetProviderProps {
813
818
  bankLogoAlt?: string;
814
819
  }
815
820
 
821
+ type PartialDeep$1<T> = {
822
+ [K in keyof T]?: T[K] extends object ? PartialDeep$1<T[K]> : T[K];
823
+ };
824
+ interface CreateCardWidgetLabels {
825
+ header: {
826
+ title: string;
827
+ closeAriaLabel: string;
828
+ };
829
+ cardArtAlt: string;
830
+ setup: {
831
+ sectionTitle: string;
832
+ sectionDescription: string;
833
+ cardholderLabel: string;
834
+ cardholderPlaceholder: string;
835
+ cardFormatLabel: string;
836
+ cardFormatPlaceholder: string;
837
+ cardFormatVirtual: string;
838
+ cardFormatPhysical: string;
839
+ fundingAccountLabel: string;
840
+ fundingAccountPlaceholder: string;
841
+ };
842
+ mailing: {
843
+ sectionTitle: string;
844
+ sectionDescription: string;
845
+ businessTitle: string;
846
+ businessDescription: string;
847
+ customTitle: string;
848
+ customDescription: string;
849
+ };
850
+ manualAddress: {
851
+ streetLabel: string;
852
+ cityLabel: string;
853
+ stateLabel: string;
854
+ statePlaceholder: string;
855
+ zipLabel: string;
856
+ };
857
+ preparing: {
858
+ title: string;
859
+ description: string;
860
+ };
861
+ success: {
862
+ title: string;
863
+ description: string;
864
+ createAnother: string;
865
+ viewCard: string;
866
+ };
867
+ footer: {
868
+ cancel: string;
869
+ createCard: string;
870
+ };
871
+ cardholderError: {
872
+ title: string;
873
+ description: string;
874
+ retry: string;
875
+ };
876
+ fundingAccountError: {
877
+ title: string;
878
+ description: string;
879
+ retry: string;
880
+ };
881
+ }
882
+
883
+ interface CreateCardFeatureLabels {
884
+ toast: {
885
+ creating: string;
886
+ success: string;
887
+ error: string;
888
+ };
889
+ untitledFundingAccount: string;
890
+ /**
891
+ * Success-screen copy chosen from the create response's `cardStatus`.
892
+ * Active/ready wording lives on the UI defaults; these cover statuses that
893
+ * must not claim the card is already usable.
894
+ */
895
+ success: {
896
+ pendingActivationTitle: string;
897
+ pendingActivationDescription: string;
898
+ createdTitle: string;
899
+ createdDescription: string;
900
+ };
901
+ }
902
+
903
+ type CreateCardWidgetProps = WidgetProviderProps & {
904
+ /** Static card plastic image URL (no overlays). Host / white-label supplied. */
905
+ cardArtSrc: string;
906
+ labels?: PartialDeep$1<CreateCardWidgetLabels>;
907
+ featureLabels?: Partial<{
908
+ toast: Partial<CreateCardFeatureLabels['toast']>;
909
+ untitledFundingAccount: string;
910
+ success: Partial<CreateCardFeatureLabels['success']>;
911
+ }>;
912
+ className?: string;
913
+ onClose?: () => void;
914
+ onCancel?: () => void;
915
+ /** Fired with the new debit card id after a successful create. */
916
+ onViewCard?: (cardId: string) => void;
917
+ };
918
+
816
919
  /**
817
920
  * Every key of `T` optional, recursively, so a consumer can override one nested
818
921
  * label without restating its siblings. Defined locally because the repo has no
@@ -900,7 +1003,7 @@ interface CardsWidgetProps extends WidgetProviderProps {
900
1003
  * `ui` lib's own deep-partial helper (each labels module declares one — the
901
1004
  * repo has no shared version) so this prop follows that library's contract.
902
1005
  */
903
- labels?: PartialDeep$2<CardsListLabels>;
1006
+ labels?: PartialDeep$3<CardsListLabels>;
904
1007
  /**
905
1008
  * Overrides for the copy this layer produces rather than passes through — the
906
1009
  * status and form-factor vocabulary, the empty-cell placeholder, the nickname
@@ -963,13 +1066,32 @@ interface CardsWidgetProps extends WidgetProviderProps {
963
1066
  bankLogoSrc?: string;
964
1067
  bankLogoAlt?: string;
965
1068
  /**
966
- * Called when Create card is clicked. The button renders only when the widget
967
- * token also holds the program's issue scope.
968
- *
969
- * The widget deliberately implements no in-list creation flow: compose
970
- * `CreateCardWidget` (debit) or your own credit flow — and open it from
971
- * this callback (for example in the details sheet). Omitting the callback
972
- * hides the button rather than offering a control that does nothing.
1069
+ * Plastic art for the built-in debit create sheet. Forwarded verbatim into
1070
+ * nested `CreateCardWidget`. Required for that sheet: omitting it (with no
1071
+ * host `onCreateCard`) hides Create card rather than opening a panel that
1072
+ * cannot render. Same PLAT-1179 / ADR 0005 rule as `bankLogoSrc` — the package
1073
+ * ships no card artwork.
1074
+ */
1075
+ cardArtSrc?: string;
1076
+ /**
1077
+ * Label overrides forwarded into the nested create-card panel. Indexed off
1078
+ * `CreateCardWidgetProps` so the forwarded and received types cannot drift,
1079
+ * the same feature → feature edge as `cardDetailsLabels`.
1080
+ */
1081
+ createCardLabels?: CreateCardWidgetProps['labels'];
1082
+ /**
1083
+ * Overrides for the copy the create panel's *feature* layer resolves — mutation
1084
+ * toasts, the untitled funding-account fallback, and pending-activation success
1085
+ * copy.
1086
+ */
1087
+ createCardFeatureLabels?: CreateCardWidgetProps['featureLabels'];
1088
+ /**
1089
+ * Called when Create card is clicked. When supplied, the host owns the
1090
+ * gesture: the built-in debit sheet does **not** open. Omit it on a debit list
1091
+ * with `cardArtSrc` to use the built-in `CreateCardWidget` sheet. Credit has
1092
+ * no in-package issuance widget, so credit Create card still requires this
1093
+ * callback — omitting it hides the button rather than offering a control that
1094
+ * does nothing.
973
1095
  */
974
1096
  onCreateCard?: () => void;
975
1097
  /**
@@ -995,6 +1117,12 @@ interface CardsWidgetProps extends WidgetProviderProps {
995
1117
  * query param, or take navigation over entirely — the widget itself reads no
996
1118
  * router and no search params.
997
1119
  *
1120
+ * On a debit list with `cardArtSrc`, Create card opens the same sheet with
1121
+ * nested `CreateCardWidget`. A host `onCreateCard` still takes over that
1122
+ * gesture (credit, or a custom debit flow). The two panels are mutually
1123
+ * exclusive: opening one closes the other. Success **View card** selects the
1124
+ * new debit card so its details open.
1125
+ *
998
1126
  * A pure provider wrapper — every hook lives in `CardsWidgetInner` so it runs
999
1127
  * inside `WidgetProvider`'s subtree, which is what the data-access hooks read
1000
1128
  * their client, org and token from.
@@ -5,6 +5,14 @@ import { FallbackProps } from 'react-error-boundary';
5
5
  interface Labels {
6
6
  loadingLabel: string;
7
7
  errorLabel: string;
8
+ /**
9
+ * Lead-in for the contact line, rendered as
10
+ * `{contactPrefix} {bankName} {link}.` when both a bank name and a contact
11
+ * URL are available.
12
+ */
13
+ contactPrefix: string;
14
+ /** Text of the contact link (wraps the contact URL). */
15
+ contactLinkText: string;
8
16
  }
9
17
 
10
18
  type AuthToken = string | undefined;
@@ -588,6 +596,14 @@ interface FeatureLabels {
588
596
  interface ProfileWidgetProps extends WidgetProviderProps {
589
597
  labels?: Partial<Labels>;
590
598
  featureLabels?: Partial<FeatureLabels>;
599
+ /**
600
+ * Where the "to change this information, contact your bank" line links (a
601
+ * support page URL or a `mailto:`). Left unset, the card shows the plain
602
+ * unlinked sentence instead — the package has no tenant-agnostic support
603
+ * address to fall back on. The bank name in that line comes from widget init,
604
+ * so this is the only value a host needs to supply.
605
+ */
606
+ contactUrl?: string;
591
607
  }
592
608
  declare function ProfileWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ProfileWidgetProps): React.JSX.Element;
593
609
 
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ComponentType, AnchorHTMLAttributes, ReactNode, ErrorInfo } from 'react';
2
+ import { ReactNode, ComponentType, AnchorHTMLAttributes, ErrorInfo } from 'react';
3
3
  import { FallbackProps } from 'react-error-boundary';
4
4
 
5
5
  interface Labels {
@@ -7,6 +7,12 @@ interface Labels {
7
7
  description?: string;
8
8
  }
9
9
 
10
+ interface SettingsWidgetSection {
11
+ id: string;
12
+ label: string;
13
+ content: ReactNode;
14
+ }
15
+
10
16
  interface FinopsThemeColors {
11
17
  primary?: string;
12
18
  primaryForeground?: string;
@@ -594,6 +600,46 @@ interface FeatureLabels {
594
600
  expenseRequirementsTab: string;
595
601
  }
596
602
 
603
+ /**
604
+ * The sections this widget renders itself. These ids are the public vocabulary
605
+ * a host uses to deep-link into a section, so they are part of the package's
606
+ * API surface — renaming one is a breaking change.
607
+ */
608
+ declare const SettingsSection: {
609
+ readonly Profile: "profile";
610
+ readonly Team: "team";
611
+ readonly Invoice: "invoice";
612
+ readonly Expense: "expense";
613
+ readonly BillPay: "bill-pay";
614
+ readonly Accounting: "accounting";
615
+ readonly Tags: "tags";
616
+ readonly Help: "help";
617
+ };
618
+ type SettingsSection = (typeof SettingsSection)[keyof typeof SettingsSection];
619
+ /**
620
+ * A selectable section id: one of the built-ins, or the id of a host-supplied
621
+ * {@link SettingsWidgetAdditionalSection}. The `string & {}` arm keeps the
622
+ * built-in literals visible to editor autocomplete while still accepting a
623
+ * host's own id.
624
+ */
625
+ type SettingsWidgetSectionId = SettingsSection | (string & {});
626
+ /**
627
+ * A section contributed by the host, rendered alongside the built-in ones.
628
+ *
629
+ * This exists for surfaces the published package cannot own — the white-label
630
+ * dashboard's password management, for instance, which is an app-auth concern
631
+ * rather than an embedded one. Prefer the `*Content` props when replacing the
632
+ * content of a section that already exists.
633
+ */
634
+ interface SettingsWidgetAdditionalSection extends SettingsWidgetSection {
635
+ /**
636
+ * Place this section immediately after the named built-in one. Sections with
637
+ * no `after` — and those whose anchor is hidden by scope gating — are
638
+ * appended to the end of the list.
639
+ */
640
+ after?: SettingsSection;
641
+ }
642
+
597
643
  interface SettingsWidgetProps extends MoniteRegionProviderProps {
598
644
  labels?: Partial<Labels>;
599
645
  featureLabels?: Partial<FeatureLabels>;
@@ -609,6 +655,22 @@ interface SettingsWidgetProps extends MoniteRegionProviderProps {
609
655
  * support address to fall back on. The bank name in that line comes from
610
656
  * widget init, so this is the only value a host needs to supply. */
611
657
  helpContactUrl?: string;
658
+ /** Forwarded to the embedded Profile section's {@link ProfileWidget} — where
659
+ * its "to change this information, contact your bank" line links. The line
660
+ * falls back to a plain, unlinked sentence when unset, for the same reason
661
+ * {@link SettingsWidgetProps.helpContactUrl} does. */
662
+ profileContactUrl?: string;
663
+ /** The section to show. Leave unset to let the widget own the selection;
664
+ * supply it (with {@link SettingsWidgetProps.onSelectedSectionChange}) to
665
+ * drive navigation from a route, a search param, or host state. A section
666
+ * hidden by the user's scopes falls back to the first visible one. */
667
+ selectedSection?: SettingsWidgetSectionId;
668
+ /** Called with the id of the section the user selected. Fires whether or not
669
+ * {@link SettingsWidgetProps.selectedSection} is supplied, so a host can mirror
670
+ * the selection into its URL without taking ownership of it. */
671
+ onSelectedSectionChange?: (section: SettingsWidgetSectionId) => void;
672
+ /** Host-owned sections rendered alongside the built-in ones. */
673
+ additionalSections?: SettingsWidgetAdditionalSection[];
612
674
  profileContent?: ReactNode;
613
675
  teamContent?: ReactNode;
614
676
  billPayContent?: ReactNode;
@@ -620,5 +682,5 @@ interface SettingsWidgetProps extends MoniteRegionProviderProps {
620
682
  }
621
683
  declare function SettingsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, finopsThemeColors, analytics, ...innerProps }: SettingsWidgetProps): React.JSX.Element;
622
684
 
623
- export { SettingsWidget };
624
- export type { FeatureLabels as SettingsWidgetFeatureLabels, Labels as SettingsWidgetLabels, SettingsWidgetProps };
685
+ export { SettingsSection, SettingsWidget };
686
+ export type { SettingsWidgetAdditionalSection, FeatureLabels as SettingsWidgetFeatureLabels, Labels as SettingsWidgetLabels, SettingsWidgetProps, SettingsWidgetSection, SettingsWidgetSectionId };
@@ -1,3 +1,4 @@
1
- import { SettingsWidget as e } from "../libs/tesouro-embedded-components-react/settings-widget/feature/dist/index5.js";
1
+ import { SettingsSection as e } from "../libs/tesouro-embedded-components-react/settings-widget/feature/dist/index4.js";
2
+ import { SettingsWidget as t } from "../libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js";
2
3
  import "../libs/tesouro-embedded-components-react/settings-widget/feature/dist/index.js";
3
- export { e as SettingsWidget };
4
+ export { e as SettingsSection, t as SettingsWidget };
@@ -15,15 +15,20 @@ var r = {
15
15
  activate: [t.DebitCardActivateOrg],
16
16
  create: [t.DebitCardIssueOrg]
17
17
  }
18
- }, i = [t.BankAccountReadOrg];
19
- function a({ cardProgram: t, scopes: a }) {
20
- let o = new Set(a ?? []), s = r[t];
18
+ }, i = [t.BankAccountReadOrg], a = {
19
+ users: [t.UserReadOrg],
20
+ roles: [t.RoleReadOrg],
21
+ funding: i
22
+ };
23
+ function o({ cardProgram: t, scopes: o }) {
24
+ let s = new Set(o ?? []), c = r[t];
21
25
  return {
22
- canRead: e(o, s.read),
23
- canActivate: e(o, s.activate),
24
- canCreate: e(o, s.create),
25
- canReadFundingAccounts: t === n.Debit && e(o, i)
26
+ canRead: e(s, c.read),
27
+ canActivate: e(s, c.activate),
28
+ canCreate: e(s, c.create),
29
+ canReadFundingAccounts: t === n.Debit && e(s, i),
30
+ canComposeDebitCreate: t === n.Debit && e(s, a.users) && e(s, a.roles) && e(s, a.funding)
26
31
  };
27
32
  }
28
33
  //#endregion
29
- export { a as getCardsPermissions };
34
+ export { o as getCardsPermissions };
@@ -34,18 +34,18 @@ function l(e) {
34
34
  pageSize: t
35
35
  };
36
36
  }
37
- function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationChange: f, featureLabels: p, selectedCardId: ve, defaultSelectedCardId: ye, onSelectedCardIdChange: be, onCreateCard: m, onActivateCard: h }) {
37
+ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationChange: f, featureLabels: p, selectedCardId: ve, defaultSelectedCardId: ye, onSelectedCardIdChange: be, onCreateCard: m, onActivateCard: h, cardArtSrc: xe }) {
38
38
  let g = a(() => re(p), [p]), _ = t();
39
39
  i(() => {
40
40
  _(ae.Mounted);
41
41
  }, [_]);
42
- let { organizationId: v, widgetToken: xe, initResponse: y } = ee(), b = y?.userId ?? void 0, Se = ne(), x = !!te(), S = !!(v && xe), C = a(() => ie({
42
+ let { organizationId: v, widgetToken: Se, initResponse: y } = ee(), b = y?.userId ?? void 0, Ce = ne(), x = !!te(), S = !!(v && Se), C = a(() => ie({
43
43
  cardProgram: s,
44
44
  scopes: y?.scopes
45
- }), [s, y?.scopes]), w = S && C.canRead && !!y, Ce = a(() => l(u), [u?.pageSize, u?.paginationToken]), T = a(() => l(d), [d?.pageSize, d?.paginationToken]), [E, we] = o(b);
46
- b !== void 0 && b !== E && we(b);
47
- let [D, Te] = o(v);
48
- v !== void 0 && v !== D && Te(v);
45
+ }), [s, y?.scopes]), w = S && C.canRead && !!y, we = a(() => l(u), [u?.pageSize, u?.paginationToken]), T = a(() => l(d), [d?.pageSize, d?.paginationToken]), [E, Te] = o(b);
46
+ b !== void 0 && b !== E && Te(b);
47
+ let [D, Ee] = o(v);
48
+ v !== void 0 && v !== D && Ee(v);
49
49
  let O = [
50
50
  [
51
51
  s,
@@ -58,7 +58,7 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
58
58
  resetKey: O,
59
59
  paginationToken: T.paginationToken,
60
60
  pageSize: T.pageSize
61
- })), [Ee, De] = o(!1), [Oe, M] = he({
61
+ })), [De, Oe] = o(!1), [ke, M] = he({
62
62
  prop: ve,
63
63
  defaultProp: ye ?? null,
64
64
  onChange: be,
@@ -67,7 +67,7 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
67
67
  cardProgram: s,
68
68
  organizationId: D,
69
69
  userId: E
70
- }), ke = N.current.cardProgram !== s || c(N.current.organizationId, D) || c(N.current.userId, E);
70
+ }), Ae = N.current.cardProgram !== s || c(N.current.organizationId, D) || c(N.current.userId, E);
71
71
  i(() => {
72
72
  let e = N.current;
73
73
  N.current = {
@@ -83,7 +83,7 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
83
83
  ]);
84
84
  let P = r((e) => {
85
85
  M(e);
86
- }, [M]), F = Ee && !!b, Ae = A.resetKey === O;
86
+ }, [M]), F = De && !!b, je = A.resetKey === O;
87
87
  i(() => {
88
88
  k || j((e) => e.resetKey === O ? e : {
89
89
  resetKey: O,
@@ -96,9 +96,9 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
96
96
  k,
97
97
  O
98
98
  ]);
99
- let I = k ? Ce : Ae ? A : T, je = I.paginationToken, L = I.pageSize, R = {
99
+ let I = k ? we : je ? A : T, Me = I.paginationToken, L = I.pageSize, R = {
100
100
  limit: L,
101
- paginationToken: je,
101
+ paginationToken: Me,
102
102
  userId: F ? b : void 0
103
103
  }, z = fe({
104
104
  ...R,
@@ -115,12 +115,12 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
115
115
  U.data?.data,
116
116
  g.untitledFundingAccount,
117
117
  C.canReadFundingAccounts
118
- ]), G = H && U.isError, Me = H && !G && (U.isLoading || U.isFetchingNextPage || !!U.hasNextPage), K = a(() => w ? s === n.Credit ? ue(z.data?.data ?? []) : de(B.data?.data ?? []) : [], [
118
+ ]), G = H && U.isError, Ne = H && !G && (U.isLoading || U.isFetchingNextPage || !!U.hasNextPage), K = a(() => w ? s === n.Credit ? ue(z.data?.data ?? []) : de(B.data?.data ?? []) : [], [
119
119
  w,
120
120
  s,
121
121
  z.data?.data,
122
122
  B.data?.data
123
- ]), Ne = a(() => le(K, {
123
+ ]), Pe = a(() => le(K, {
124
124
  labels: g,
125
125
  fundingAccountNames: W,
126
126
  canActivate: C.canActivate,
@@ -133,7 +133,7 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
133
133
  g,
134
134
  h,
135
135
  C.canActivate
136
- ]), q = V.data?.nextPaginationToken ?? void 0, J = V.data?.prevPaginationToken ?? void 0, Pe = !!V.data, Y = w && (V.isError || G), X = r((e) => {
136
+ ]), q = V.data?.nextPaginationToken ?? void 0, J = V.data?.prevPaginationToken ?? void 0, Fe = !!V.data, Y = w && (V.isError || G), X = r((e) => {
137
137
  k || j({
138
138
  resetKey: O,
139
139
  paginationToken: e.paginationToken,
@@ -148,14 +148,14 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
148
148
  paginationToken: void 0,
149
149
  pageSize: L
150
150
  });
151
- }, [X, L]), Fe = r((e) => {
151
+ }, [X, L]), Ie = r((e) => {
152
152
  X({
153
153
  paginationToken: void 0,
154
154
  pageSize: e
155
155
  });
156
- }, [X]), Ie = r((e) => {
157
- De(e), Z();
158
- }, [Z]), Le = r(() => {
156
+ }, [X]), Le = r((e) => {
157
+ Oe(e), Z();
158
+ }, [Z]), Re = r(() => {
159
159
  X({
160
160
  paginationToken: J,
161
161
  pageSize: L
@@ -164,7 +164,7 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
164
164
  X,
165
165
  L,
166
166
  J
167
- ]), Re = r(() => {
167
+ ]), ze = r(() => {
168
168
  X({
169
169
  paginationToken: q,
170
170
  pageSize: L
@@ -173,7 +173,7 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
173
173
  X,
174
174
  q,
175
175
  L
176
- ]), Q = V.refetch, $ = U.refetch, ze = r(() => {
176
+ ]), Q = V.refetch, $ = U.refetch, Be = r(() => {
177
177
  Q(), H && $();
178
178
  }, [
179
179
  H,
@@ -181,26 +181,27 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
181
181
  $
182
182
  ]);
183
183
  return {
184
- rows: Ne,
185
- selectedCardId: ke ? null : Oe,
184
+ rows: Pe,
185
+ selectedCardId: Ae ? null : ke,
186
186
  onSelectCard: P,
187
+ canReadCards: C.canRead,
187
188
  columns: ce[s],
188
- isLoading: !x && (!S || Se && !y || w && (V.isLoading || Me)),
189
+ isLoading: !x && (!S || Ce && !y || w && (V.isLoading || Ne)),
189
190
  isError: x || Y,
190
191
  canToggleShowMyCards: C.canRead && !!b,
191
192
  isShowingMyCards: F,
192
- onShowMyCardsChange: Ie,
193
- canCreateCard: C.canCreate && !!m,
193
+ onShowMyCardsChange: Le,
194
+ canCreateCard: C.canCreate && (!!m || !!xe && C.canComposeDebitCreate),
194
195
  onCreateCardClick: m,
195
- onRetry: ze,
196
- isPaginationVisible: w && Pe && !Y,
196
+ onRetry: Be,
197
+ isPaginationVisible: w && Fe && !Y,
197
198
  pageSize: L,
198
199
  pageSizeOptions: ge,
199
200
  isPreviousPageDisabled: !J,
200
201
  isNextPageDisabled: !q,
201
- onPageSizeChange: Fe,
202
- onPreviousPageClick: Le,
203
- onNextPageClick: Re
202
+ onPageSizeChange: Ie,
203
+ onPreviousPageClick: Re,
204
+ onNextPageClick: ze
204
205
  };
205
206
  }
206
207
  //#endregion