@tesouro/embedded-components-react 0.11.140 → 0.11.167

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 (148) hide show
  1. package/NOTICE +24 -0
  2. package/README.md +15 -37
  3. package/dist/experimental/BalanceHistoryWidget.d.ts +0 -11
  4. package/dist/experimental/QuickViewWidget.d.ts +0 -11
  5. package/dist/experimental/RemoteCheckCapture.d.ts +0 -11
  6. package/dist/experimental/index.d.ts +0 -11
  7. package/dist/fixtures/index.d.ts +27 -1
  8. package/dist/index.css +6976 -6246
  9. package/dist/index.d.ts +64 -173
  10. package/dist/index.js +9 -10
  11. package/dist/lib/AcceptDisclosuresWidget.d.ts +0 -11
  12. package/dist/lib/BalancesWidget.d.ts +0 -11
  13. package/dist/lib/BankAccountOnboardingWidget.d.ts +0 -11
  14. package/dist/lib/BankAccountsWidget.d.ts +2 -11
  15. package/dist/lib/BankingComplianceBannerWidget.d.ts +0 -11
  16. package/dist/lib/BillPayWidget.d.ts +0 -11
  17. package/dist/lib/CardDetailsWidget.d.ts +0 -11
  18. package/dist/lib/CounterpartsWidget.d.ts +1 -12
  19. package/dist/lib/CounterpartsWidgetPublic.d.ts +1 -12
  20. package/dist/lib/CreditCardsWidget.d.ts +0 -11
  21. package/dist/lib/DebitCardsWidget.d.ts +0 -11
  22. package/dist/lib/ExpenseManagementWidget.d.ts +1 -12
  23. package/dist/lib/InsightsWidget.d.ts +0 -11
  24. package/dist/lib/LinkedAccountsWidget.d.ts +0 -11
  25. package/dist/lib/OfferWidget.d.ts +0 -11
  26. package/dist/lib/ReceivablesWidget.d.ts +60 -17
  27. package/dist/lib/ReceivablesWidget.js +3 -2
  28. package/dist/lib/SettingsWidget.d.ts +0 -11
  29. package/dist/lib/TransfersWidget.d.ts +0 -11
  30. package/dist/lib/WidgetProvider.d.ts +0 -11
  31. package/dist/lib/WidgetProviderPublic.d.ts +0 -11
  32. package/dist/lib/WidgetSuite.d.ts +60 -15
  33. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +1 -1
  34. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +20 -19
  35. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index10.js +8 -8
  36. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index4.js +2 -3
  37. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index10.js +83 -82
  38. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index4.js +84 -79
  39. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index9.js +2 -1
  40. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/formatters.js +2 -3
  41. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/useBankAccountsWidget.js +4 -4
  42. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/AccountCard.js +51 -46
  43. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/labels.js +2 -1
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +1 -1
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +1 -1
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +1 -1
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +1 -1
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +1 -1
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index4.js +1 -1
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +1 -1
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +1 -1
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index10.js +1 -1
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index4.js +1 -1
  55. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/useActivateCard.js +1 -1
  56. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/useCardLock.js +1 -1
  57. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/useEditCardNickname.js +1 -1
  58. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +1 -1
  59. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +1 -1
  60. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index7.js +1 -1
  61. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/ExpenseManagementWidget.js +10 -9
  62. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsFeature.js +1 -1
  63. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js +1 -1
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +2 -2
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index16.js +66 -74
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +3 -2
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +351 -318
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +126 -133
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +63 -56
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/invoicesFilter.js +78 -72
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/invoicesFilterLabels.js +2 -1
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +14 -1
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +138 -129
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurringSeries.js +119 -0
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/statusCards.js +37 -28
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/tabs.js +1 -2
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useInvoicesFilter.js +131 -81
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useLocalDayStart.js +15 -0
  79. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +46 -46
  80. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +1 -1
  81. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableAttachmentUploads.js +13 -13
  82. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableBankAccount.js +1 -1
  83. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +440 -438
  84. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +7 -7
  85. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentTerms.js +1 -1
  86. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableRecurrence.js +62 -56
  87. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +1 -1
  88. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js +47 -16
  89. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +78 -86
  90. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +180 -158
  91. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useRecurringSeriesTable.js +132 -0
  92. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/mocks/invoicing.js +4 -0
  93. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/mocks/receivables.js +153 -137
  94. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +22 -19
  95. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +6 -4
  96. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +1 -1
  97. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +3 -3
  98. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +137 -129
  99. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js +21 -46
  100. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index62.js +143 -0
  101. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index63.js +2 -0
  102. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index64.js +47 -0
  103. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +25 -25
  104. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +1 -1
  105. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductDelete.js +1 -1
  106. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/mocks/products.js +3 -11
  107. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/scenarios.js +1 -1
  108. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/data-access/dist/index2.js +36 -77
  109. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/summarizeCardSpend.js +11 -13
  110. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/useCardSpendSummary.js +20 -17
  111. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/useRemoteCheckCaptureWidget.js +1 -1
  112. package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/feature/dist/index7.js +1 -1
  113. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/settings.js +7 -0
  114. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index7.js +1 -1
  115. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index8.js +1 -1
  116. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index8.js +4 -9
  117. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index12.js +1 -1
  118. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index16.js +2 -3
  119. package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsWidgetUi.js +2 -2
  120. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApprovalPolicyRules.js +1 -1
  121. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index3.js +2 -2
  122. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +1 -1
  123. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +1 -1
  124. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +43 -43
  125. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +233 -211
  126. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +66 -42
  127. package/dist/libs/tesouro-embedded-components-react/shared/document-status/util/dist/lib/receivableFilledTone.js +1 -1
  128. package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/feature/dist/lib/ExpenseRequirementsWidget.js +5 -4
  129. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  130. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +1 -1
  131. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/toasts.js +1 -1
  132. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +28 -28
  133. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/EmbeddedToaster.js +33 -32
  134. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js +9 -8
  135. package/dist/node_modules/sonner/dist/index.js +620 -0
  136. package/dist/packages/shared-ui-shadcn/dist/index.js +6072 -6062
  137. package/dist/scenarios/index.d.ts +1 -3
  138. package/dist/scenarios/index.js +17 -20
  139. package/package.json +17 -4
  140. package/dist/lib/CustomersWidget.d.ts +0 -993
  141. package/dist/lib/CustomersWidget.js +0 -2
  142. package/dist/lib/ProductsWidget.d.ts +0 -893
  143. package/dist/lib/ProductsWidget.js +0 -2
  144. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index.js +0 -1
  145. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/lib/CustomersWidget/CustomersWidget.js +0 -41
  146. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/lib/analytics/events.js +0 -3
  147. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/scenarios.js +0 -2
  148. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useUtcDayStart.js +0 -15
@@ -1,993 +0,0 @@
1
- import * as React from 'react';
2
- import { ComponentType, AnchorHTMLAttributes, ReactNode, ErrorInfo } from 'react';
3
- import { RowData } from '@tanstack/react-table';
4
- import { FallbackProps } from 'react-error-boundary';
5
- import { PartialDeep } from 'type-fest';
6
-
7
- type AuthToken = string | undefined;
8
- interface Auth {
9
- /**
10
- * Which part of the request do we use to send the auth?
11
- *
12
- * @default 'header'
13
- */
14
- in?: 'header' | 'query' | 'cookie';
15
- /**
16
- * A unique identifier for the security scheme.
17
- *
18
- * Defined only when there are multiple security schemes whose `Auth`
19
- * shape would otherwise be identical.
20
- */
21
- key?: string;
22
- /**
23
- * Header or query parameter name.
24
- *
25
- * @default 'Authorization'
26
- */
27
- name?: string;
28
- scheme?: 'basic' | 'bearer';
29
- type: 'apiKey' | 'http';
30
- }
31
-
32
- interface SerializerOptions<T> {
33
- /**
34
- * @default true
35
- */
36
- explode: boolean;
37
- style: T;
38
- }
39
- type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
40
- type ObjectStyle = 'form' | 'deepObject';
41
-
42
- type QuerySerializer = (query: Record<string, unknown>) => string;
43
- type BodySerializer = (body: unknown) => unknown;
44
- type QuerySerializerOptionsObject = {
45
- allowReserved?: boolean;
46
- array?: Partial<SerializerOptions<ArrayStyle>>;
47
- object?: Partial<SerializerOptions<ObjectStyle>>;
48
- };
49
- type QuerySerializerOptions = QuerySerializerOptionsObject & {
50
- /**
51
- * Per-parameter serialization overrides. When provided, these settings
52
- * override the global array/object settings for specific parameter names.
53
- */
54
- parameters?: Record<string, QuerySerializerOptionsObject>;
55
- };
56
-
57
- type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
58
- type Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
59
- /**
60
- * Returns the final request URL.
61
- */
62
- buildUrl: BuildUrlFn;
63
- getConfig: () => Config;
64
- request: RequestFn;
65
- setConfig: (config: Config) => Config;
66
- } & {
67
- [K in HttpMethod]: MethodFn;
68
- } & ([SseFn] extends [never] ? {
69
- sse?: never;
70
- } : {
71
- sse: {
72
- [K in HttpMethod]: SseFn;
73
- };
74
- });
75
- interface Config$1 {
76
- /**
77
- * Auth token or a function returning auth token. The resolved value will be
78
- * added to the request payload as defined by its `security` array.
79
- */
80
- auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
81
- /**
82
- * A function for serializing request body parameter. By default,
83
- * {@link JSON.stringify()} will be used.
84
- */
85
- bodySerializer?: BodySerializer | null;
86
- /**
87
- * An object containing any HTTP headers that you want to pre-populate your
88
- * `Headers` object with.
89
- *
90
- * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
91
- */
92
- headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
93
- /**
94
- * The request method.
95
- *
96
- * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
97
- */
98
- method?: Uppercase<HttpMethod>;
99
- /**
100
- * A function for serializing request query parameters. By default, arrays
101
- * will be exploded in form style, objects will be exploded in deepObject
102
- * style, and reserved characters are percent-encoded.
103
- *
104
- * This method will have no effect if the native `paramsSerializer()` Axios
105
- * API function is used.
106
- *
107
- * {@link https://swagger.io/docs/specification/serialization/#query View examples}
108
- */
109
- querySerializer?: QuerySerializer | QuerySerializerOptions;
110
- /**
111
- * A function validating request data. This is useful if you want to ensure
112
- * the request conforms to the desired shape, so it can be safely sent to
113
- * the server.
114
- */
115
- requestValidator?: (data: unknown) => Promise<unknown>;
116
- /**
117
- * A function transforming response data before it's returned. This is useful
118
- * for post-processing data, e.g., converting ISO strings into Date objects.
119
- */
120
- responseTransformer?: (data: unknown) => Promise<unknown>;
121
- /**
122
- * A function validating response data. This is useful if you want to ensure
123
- * the response conforms to the desired shape, so it can be safely passed to
124
- * the transformers and returned to the user.
125
- */
126
- responseValidator?: (data: unknown) => Promise<unknown>;
127
- }
128
-
129
- type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config$1, 'method' | 'responseTransformer' | 'responseValidator'> & {
130
- /**
131
- * Fetch API implementation. You can use this option to provide a custom
132
- * fetch instance.
133
- *
134
- * @default globalThis.fetch
135
- */
136
- fetch?: typeof fetch;
137
- /**
138
- * Implementing clients can call request interceptors inside this hook.
139
- */
140
- onRequest?: (url: string, init: RequestInit) => Promise<Request>;
141
- /**
142
- * Callback invoked when a network or parsing error occurs during streaming.
143
- *
144
- * This option applies only if the endpoint returns a stream of events.
145
- *
146
- * @param error The error that occurred.
147
- */
148
- onSseError?: (error: unknown) => void;
149
- /**
150
- * Callback invoked when an event is streamed from the server.
151
- *
152
- * This option applies only if the endpoint returns a stream of events.
153
- *
154
- * @param event Event streamed from the server.
155
- * @returns Nothing (void).
156
- */
157
- onSseEvent?: (event: StreamEvent<TData>) => void;
158
- serializedBody?: RequestInit['body'];
159
- /**
160
- * Default retry delay in milliseconds.
161
- *
162
- * This option applies only if the endpoint returns a stream of events.
163
- *
164
- * @default 3000
165
- */
166
- sseDefaultRetryDelay?: number;
167
- /**
168
- * Maximum number of retry attempts before giving up.
169
- */
170
- sseMaxRetryAttempts?: number;
171
- /**
172
- * Maximum retry delay in milliseconds.
173
- *
174
- * Applies only when exponential backoff is used.
175
- *
176
- * This option applies only if the endpoint returns a stream of events.
177
- *
178
- * @default 30000
179
- */
180
- sseMaxRetryDelay?: number;
181
- /**
182
- * Optional sleep function for retry backoff.
183
- *
184
- * Defaults to using `setTimeout`.
185
- */
186
- sseSleepFn?: (ms: number) => Promise<void>;
187
- url: string;
188
- };
189
- interface StreamEvent<TData = unknown> {
190
- data: TData;
191
- event?: string;
192
- id?: string;
193
- retry?: number;
194
- }
195
- type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
196
- stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
197
- };
198
-
199
- type ErrInterceptor<Err, Res, Req, Options> = (error: Err,
200
- /** response may be undefined due to a network error where no response object is produced */
201
- response: Res | undefined,
202
- /** request may be undefined, because error may be from building the request object itself */
203
- request: Req | undefined, options: Options) => Err | Promise<Err>;
204
- type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
205
- type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
206
- declare class Interceptors<Interceptor> {
207
- fns: Array<Interceptor | null>;
208
- clear(): void;
209
- eject(id: number | Interceptor): void;
210
- exists(id: number | Interceptor): boolean;
211
- getInterceptorIndex(id: number | Interceptor): number;
212
- update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
213
- use(fn: Interceptor): number;
214
- }
215
- interface Middleware<Req, Res, Err, Options> {
216
- error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
217
- request: Interceptors<ReqInterceptor<Req, Options>>;
218
- response: Interceptors<ResInterceptor<Res, Req, Options>>;
219
- }
220
-
221
- type ResponseStyle = 'data' | 'fields';
222
- interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config$1 {
223
- /**
224
- * Base URL for all requests made by this client.
225
- */
226
- baseUrl?: T['baseUrl'];
227
- /**
228
- * Fetch API implementation. You can use this option to provide a custom
229
- * fetch instance.
230
- *
231
- * @default globalThis.fetch
232
- */
233
- fetch?: typeof fetch;
234
- /**
235
- * Please don't use the Fetch client for Next.js applications. The `next`
236
- * options won't have any effect.
237
- *
238
- * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
239
- */
240
- next?: never;
241
- /**
242
- * Return the response data parsed in a specified format. By default, `auto`
243
- * will infer the appropriate method from the `Content-Type` response header.
244
- * You can override this behavior with any of the {@link Body} methods.
245
- * Select `stream` if you don't want to parse response data at all.
246
- *
247
- * @default 'auto'
248
- */
249
- parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
250
- /**
251
- * Should we return only data or multiple fields (data, error, response, etc.)?
252
- *
253
- * @default 'fields'
254
- */
255
- responseStyle?: ResponseStyle;
256
- /**
257
- * Throw an error instead of returning it in the response?
258
- *
259
- * @default false
260
- */
261
- throwOnError?: T['throwOnError'];
262
- }
263
- interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
264
- responseStyle: TResponseStyle;
265
- throwOnError: ThrowOnError;
266
- }>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
267
- /**
268
- * Any body that you want to add to your request.
269
- *
270
- * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
271
- */
272
- body?: unknown;
273
- path?: Record<string, unknown>;
274
- query?: Record<string, unknown>;
275
- /**
276
- * Security mechanism(s) to use for the request.
277
- */
278
- security?: ReadonlyArray<Auth>;
279
- url: Url;
280
- }
281
- interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
282
- headers: Headers;
283
- serializedBody?: string;
284
- }
285
- type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
286
- data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
287
- request: Request;
288
- response: Response;
289
- }> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
290
- data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
291
- error: undefined;
292
- } | {
293
- data: undefined;
294
- error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
295
- }) & {
296
- /** request may be undefined, because error may be from building the request object itself */
297
- request?: Request;
298
- /** response may be undefined, because error may be from building the request object itself or from a network error */
299
- response?: Response;
300
- }>;
301
- interface ClientOptions$1 {
302
- baseUrl?: string;
303
- responseStyle?: ResponseStyle;
304
- throwOnError?: boolean;
305
- }
306
- type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
307
- type SseFn = <TData = unknown, _TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData>>;
308
- type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
309
- type BuildUrlFn = <TData extends {
310
- body?: unknown;
311
- path?: Record<string, unknown>;
312
- query?: Record<string, unknown>;
313
- url: string;
314
- }>(options: TData & Options<TData>) => string;
315
- type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
316
- interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
317
- };
318
- interface TDataShape {
319
- body?: unknown;
320
- headers?: unknown;
321
- path?: unknown;
322
- query?: unknown;
323
- url: string;
324
- }
325
- type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
326
- type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
327
-
328
- type ClientOptions = {
329
- baseUrl: 'https://api.stage.tesouro.com' | 'https://api.sandbox.stage.tesouro.com' | 'https://api.stage.business-banking.app' | 'https://api.tesouro.com' | 'https://api.sandbox.tesouro.com' | 'https://api.business-banking.app' | (string & {});
330
- };
331
-
332
- type EmbeddedClient = Client;
333
- type ExtractLiterals<T> = T extends string ? string extends T ? never : T : never;
334
- type BaseUrl = ExtractLiterals<ClientOptions['baseUrl']>;
335
-
336
- declare module '@tanstack/react-table' {
337
- interface ColumnMeta<TData extends RowData, TValue> {
338
- /**
339
- * Shrinks the column to its content on one line, leaving the table's
340
- * spare width to the columns without it: dates, statuses and amounts.
341
- */
342
- fitContent?: boolean;
343
- }
344
- }
345
-
346
- interface LabelLabels {
347
- /**
348
- * How the field name and its requirement fragment compose. `{label}` is the
349
- * name, `{marker}` the asterisk or the note — reorder them freely, and note
350
- * that the space between them is part of this string.
351
- */
352
- composition: string;
353
- /** In the label's own colour, deliberately not `destructive`. */
354
- requiredMarker: string;
355
- /**
356
- * Screen-reader-only stand-in for the marker, for a control whose role does
357
- * not take `aria-required` — a popover trigger is a `button`, which does
358
- * not. Render it hidden and name it from the control's `aria-labelledby`.
359
- */
360
- requiredAccessibleText: string;
361
- optionalNote: string;
362
- /** "This has no meaning here", as against `optionalNote`'s "may be blank". */
363
- notApplicableNote: string;
364
- }
365
-
366
- interface RequiredFieldsLegendLabels {
367
- /**
368
- * One string, so a translator can move the marker into whatever clause the
369
- * language wants. `{marker}` is substituted with `marker`, rendered
370
- * semi-bold; keep the placeholder when overriding.
371
- */
372
- instruction: string;
373
- marker: string;
374
- }
375
-
376
- type LinkComponentProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
377
- children?: ReactNode;
378
- };
379
- type LinkComponent = ComponentType<LinkComponentProps>;
380
- /**
381
- * The UI frameworks a widget's UI layer can render with.
382
- *
383
- * - `shadcn` — the shadcn/Tailwind implementation. This is the default and the
384
- * implicit fallback, so existing consumers that select nothing keep rendering
385
- * shadcn.
386
- * - `tecton` — the Tecton implementation.
387
- *
388
- * Declared as an `as const` object (not a TypeScript `enum`) per repo
389
- * convention.
390
- */
391
- declare const UIFramework: {
392
- readonly Shadcn: "shadcn";
393
- readonly Tecton: "tecton";
394
- };
395
- type UIFramework = (typeof UIFramework)[keyof typeof UIFramework];
396
-
397
- /**
398
- * The settable fields of the widget config cascade.
399
- *
400
- * This is the type accepted by {@link setGlobalWidgetConfig} and all provider props.
401
- * It intentionally excludes `initResponse`, which is populated automatically by the
402
- * provider after a successful fetch and must never be set manually.
403
- *
404
- * The `null` vs `undefined` distinction on `widgetToken` and `organizationId` is intentional:
405
- * - `undefined` — not set at this level; inherit from the nearest ancestor or global store.
406
- * - `null` — explicitly cleared; downstream sees "no value" even if an ancestor had one
407
- * (e.g. after logout or deliberate de-scoping).
408
- *
409
- * @see {@link WidgetConfig} for the resolved output type (includes `initResponse`)
410
- * @see {@link RootWidgetProvider}
411
- * @see {@link WidgetProvider}
412
- * @see {@link setGlobalWidgetConfig}
413
- */
414
- interface WidgetConfigInput {
415
- /**
416
- * Base URL of the Tesouro embedded API (e.g. `"https://api.tesouro.com"`).
417
- *
418
- * When omitted the nearest ancestor's `baseUrl` or the global store value is used.
419
- * Changing this recreates the underlying HTTP client so all subsequent requests
420
- * go to the new host.
421
- */
422
- baseUrl?: BaseUrl;
423
- /**
424
- * Bearer token used to authenticate widget requests.
425
- *
426
- * Injected as `Authorization: Bearer <token>` on every outgoing request via an
427
- * interceptor on the scoped HTTP client. Token updates are picked up immediately
428
- * without recreating the client.
429
- *
430
- * - `string` — send this token on all requests from this level downward.
431
- * - `null` — explicitly cleared; no auth header is sent and fetching is suppressed.
432
- * - `undefined` — not set at this level; inherit from the nearest ancestor or global store.
433
- */
434
- widgetToken?: string | null;
435
- /**
436
- * Organization ID forwarded as the `x-organization-id` request header.
437
- *
438
- * Passed through {@link EmbedApiProvider} context rather than the auth interceptor,
439
- * so individual data-access hooks can opt in per-request.
440
- *
441
- * - `string` — use this organization for downstream data requests.
442
- * - `null` — explicitly cleared; queries that require an org ID will be disabled.
443
- * - `undefined` — not set at this level; inherit from the nearest ancestor or global store.
444
- *
445
- * When `undefined` across the **whole** cascade (no prop, no ancestor, no global
446
- * value), the resolved org defaults to the loaded `initResponse.organizationId`
447
- * (see {@link WidgetConfig.initResponse}) once the widget-init fetch settles. This
448
- * is the lowest-priority fallback — any explicit `string` or `null` at any cascade
449
- * level wins, and an explicit `null` is preserved and never falls back.
450
- *
451
- * Only an **explicit** ancestor org is inherited. An ancestor's *init-derived*
452
- * default does not propagate into a descendant that owns its own fetch (its own
453
- * `baseUrl`/`widgetToken`); such a descendant defaults to its own
454
- * `initResponse.organizationId` instead, so it never sends an ancestor's org with
455
- * its own token.
456
- */
457
- organizationId?: string | null;
458
- /**
459
- * Optional post-creation hook for the scoped HTTP client.
460
- *
461
- * Called once after the provider creates its scoped {@link EmbeddedClient} and
462
- * applies the built-in `Authorization: Bearer` interceptor. Receives the
463
- * fully-configured client and must return the client to be used for the lifetime of
464
- * this provider level — either the same instance (with additional interceptors
465
- * attached) or a new client entirely.
466
- *
467
- * **Order:** The built-in auth interceptor is always applied first. `configClient`
468
- * is called on top of it, so any interceptors you add here run after auth is set.
469
- *
470
- * **Any prop triggers a scoped client.** A {@link WidgetProvider} creates its own
471
- * scoped client whenever any prop is set — including `configClient` alone, without
472
- * `baseUrl` or `widgetToken`. Only a fully props-free pass-through provider skips
473
- * client creation and never calls this function.
474
- *
475
- * **Stability:** The function reference is included in the client creation memo's
476
- * dependency array. Passing an unstable (inline) function recreates the client on
477
- * every render. Stabilize with `useCallback` or define the function outside the
478
- * component.
479
- *
480
- * **Cascade:** Inherits from the nearest ancestor when `undefined`. A child
481
- * {@link WidgetProvider} that creates its own scoped client will use the resolved
482
- * `configClient` from the cascade unless it provides its own override.
483
- *
484
- * @example
485
- * ```tsx
486
- * const addLogging = useCallback(
487
- * (client: EmbeddedClient) => {
488
- * client.interceptors.request.use((req) => {
489
- * console.log('[widget]', req.method, req.url);
490
- * return req;
491
- * });
492
- * return client;
493
- * },
494
- * [],
495
- * );
496
- *
497
- * <RootWidgetProvider
498
- * baseUrl="https://api.tesouro.com"
499
- * widgetToken={token}
500
- * configClient={addLogging}
501
- * >
502
- * <App />
503
- * </RootWidgetProvider>
504
- * ```
505
- */
506
- configClient?: (client: EmbeddedClient) => EmbeddedClient;
507
- /**
508
- * Overrides the widget-gateway routing decision for the scoped HTTP client.
509
- *
510
- * Any caller reaching the Tesouro API with a widget token must route data
511
- * requests through the widget gateway: prefix the path with
512
- * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
513
- * provider applies both automatically per request when the request origin is
514
- * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
515
- * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
516
- * init round-trip) always pass through untouched.
517
- *
518
- * - `undefined` — decide from the request origin, as above. Inherits from
519
- * the nearest ancestor or global store like every other config field.
520
- * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
521
- * custom domain in front of the gateway).
522
- * - `false` — never apply it. For hosts that route widget requests their own
523
- * way, such as a same-origin BFF whose `configClient` retargets every
524
- * request.
525
- *
526
- * Independent of {@link configClient}: a host that only adds a header keeps
527
- * the built-in routing, and the built-in interceptor runs before any
528
- * `configClient` interceptor.
529
- */
530
- gatewayRouting?: boolean;
531
- /**
532
- * Component the embedded widgets should render in place of plain `<a>` tags.
533
- *
534
- * Pass e.g. Next.js's `Link` to make in-app navigation use the host router.
535
- * Cascades like other config: provider prop > nearest ancestor > global store.
536
- * When no value is set anywhere, widgets fall back to a plain `<a>` element.
537
- */
538
- linkComponent?: LinkComponent;
539
- /**
540
- * Which UI framework the widget UI layer should render with.
541
- *
542
- * Lets a consuming context bind widgets to either the shadcn/Tailwind or the
543
- * Tecton implementation behind the same outward-facing API. The selection is
544
- * a presentation concern only — it cascades through the provider tree exactly
545
- * like {@link linkComponent} and is read by UI libraries via `useUIFramework`;
546
- * it never appears in any widget's feature-library or component props.
547
- *
548
- * - `'shadcn'` — the shadcn/Tailwind implementation.
549
- * - `'tecton'` — the Tecton implementation.
550
- * - `null` / `undefined` — not set at this level; inherit from the nearest
551
- * ancestor or global store, falling back to `shadcn` when unset everywhere.
552
- * `shadcn` is the implicit default, so existing consumers need no changes.
553
- */
554
- uiFramework?: UIFramework | null;
555
- }
556
- /**
557
- * Props shared by every analytics-owner-capable widget provider.
558
- *
559
- * Combines the full settable cascade ({@link WidgetConfigInput}) with the
560
- * analytics opt-out honored by analytics owners. Both {@link RootWidgetProvider}
561
- * and {@link WidgetProvider} build their public props on top of this; the latter
562
- * adds error-boundary props of its own.
563
- *
564
- * @see {@link WidgetConfigInput} for per-field cascade and `null` vs omitted semantics
565
- */
566
- interface WidgetProviderBaseProps extends WidgetConfigInput {
567
- /**
568
- * Opt out of all analytics capture and prevent PostHog from loading. Default `true`.
569
- *
570
- * Honored only by an analytics **owner** — a {@link RootWidgetProvider} or a
571
- * standalone {@link WidgetProvider} with no parent provider. When `false`,
572
- * owner-bound `track` calls in this subtree become no-ops and the PostHog
573
- * installer is never dynamically imported for this owner's environment.
574
- * Setting it on a nested {@link WidgetProvider} is ignored in v1 (a one-time
575
- * `console.warn` is emitted to make the no-op discoverable).
576
- */
577
- analytics?: boolean;
578
- }
579
-
580
- /**
581
- * Copy for the states `WidgetProvider` renders *itself*, in place of the widget:
582
- * the error-boundary fallback and the disclosures gate. A host overrides any
583
- * subset through the `providerLabels` prop, which cascades like
584
- * `disclosuresAcceptance`.
585
- *
586
- * Not named `Labels` on the public surface: a widget's own `labels` prop is a
587
- * different thing, and these two travel together on every widget's props type.
588
- */
589
- interface WidgetProviderLabels {
590
- /** Default copy for the built-in error boundary fallback. */
591
- errorBoundaryFallback: string;
592
- /** Heading when init reports disclosures are required and not yet accepted. */
593
- disclosuresRequiredTitle: string;
594
- /** Heading while a token-only refresh leaves init stale for the live token. */
595
- disclosuresRefreshingTitle: string;
596
- /** Supporting copy while the accept action is withheld for a stale init. */
597
- disclosuresRefreshingDescription: string;
598
- }
599
-
600
- /**
601
- * Props for {@link WidgetProvider}.
602
- *
603
- * All fields are optional. When **all** are omitted the provider is a transparent
604
- * pass-through: no fetch is issued and all resolved values cascade unchanged from
605
- * the nearest ancestor.
606
- */
607
- interface WidgetProviderProps extends WidgetProviderBaseProps {
608
- /**
609
- * Fallback rendered when a render-time exception is caught inside this
610
- * provider's subtree. Pass either a `ReactNode` (rendered directly) or a
611
- * render-prop receiving `{ error, resetErrorBoundary }` from
612
- * `react-error-boundary`. Default is a plain `role="alert"` div whose copy
613
- * comes from `providerLabels.errorBoundaryFallback`.
614
- */
615
- errorFallback?: ReactNode | ((props: FallbackProps) => ReactNode);
616
- /**
617
- * Called once when the boundary catches an error, before the fallback
618
- * renders. Use for telemetry / error tracking / partner logging. Exceptions
619
- * thrown from `onError` propagate per `react-error-boundary` semantics.
620
- */
621
- onError?: (error: unknown, info: ErrorInfo) => void;
622
- /**
623
- * Accept surface shown when the caller owes disclosures — an INVITED
624
- * teammate (including `NOT_REQUIRED` orgs, who still need Accept to
625
- * activate) or an ACTIVE user who owes a new version. Pass
626
- * `<AcceptDisclosuresWidget />`. Cascades like `linkComponent`.
627
- * WidgetProvider cannot import the widget itself (cycle).
628
- */
629
- disclosuresAcceptance?: ReactNode;
630
- /**
631
- * Overrides for the copy this provider renders in place of the widget: the
632
- * built-in error-boundary fallback and the disclosures gate. Any subset;
633
- * unlisted keys keep their defaults. Cascades like `linkComponent`.
634
- *
635
- * Named `providerLabels` rather than `labels` because a widget's own
636
- * `labels` prop sits alongside this one on the same props type.
637
- */
638
- providerLabels?: Partial<WidgetProviderLabels>;
639
- }
640
-
641
- interface AddressFieldGroupLabels {
642
- line1: string;
643
- line2: string;
644
- city: string;
645
- state: string;
646
- statePlaceholder: string;
647
- postalCode: string;
648
- country: string;
649
- /** Fixed country display value (US-only locale in v1). */
650
- countryValue: string;
651
- /** The asterisk and "(optional)" copy this group's labels carry. */
652
- fieldMarkers: LabelLabels;
653
- }
654
- interface AchFieldGroupLabels {
655
- accountHolderName: string;
656
- routingNumber: string;
657
- accountNumber: string;
658
- routingNumberPlaceholder: string;
659
- accountNumberPlaceholder: string;
660
- /** The asterisk copy this group's labels carry. */
661
- fieldMarkers: LabelLabels;
662
- }
663
- interface CounterpartFormSheetLabels {
664
- createTitleOrganization: string;
665
- createTitleIndividual: string;
666
- editTitleOrganization: string;
667
- editTitleIndividual: string;
668
- createTitleCustomer: string;
669
- createTitleVendor: string;
670
- editTitleCustomer: string;
671
- editTitleVendor: string;
672
- createDescriptionCustomer: string;
673
- createDescriptionVendor: string;
674
- customerTypeHeading: string;
675
- vendorTypeHeading: string;
676
- businessTypeOption: string;
677
- businessTypeHint: string;
678
- personTypeOption: string;
679
- personTypeHint: string;
680
- profileHeading: string;
681
- addressHeading: string;
682
- customerAddressDescription: string;
683
- legalNameLabel: string;
684
- businessNameLabel: string;
685
- firstNameLabel: string;
686
- lastNameLabel: string;
687
- titleLabel: string;
688
- emailLabel: string;
689
- phoneLabel: string;
690
- /** Used by the inline fields; the sheet prefers the SSN/EIN keys and falls back to this. */
691
- taxIdLabel: string;
692
- taxIdSsnLabel: string;
693
- taxIdEinLabel: string;
694
- taxIdSsnPlaceholder: string;
695
- taxIdEinPlaceholder: string;
696
- customerTaxIdHelp: string;
697
- vendorTaxIdHelp: string;
698
- paymentRemindersLabel: string;
699
- paymentRemindersDescription: string;
700
- paymentMethodsHeading: string;
701
- paymentMethodsDescription: string;
702
- /**
703
- * @deprecated Superseded by `ach.accountHolderName`. Kept, and still
704
- * mapped in, so a consumer already shipping an override for this
705
- * already-published flat key doesn't silently lose it — this package is
706
- * published standalone, so removing a public field outright is a breaking
707
- * change even when nothing internal still reads it directly.
708
- */
709
- accountHolderNameLabel?: string;
710
- /** @deprecated Superseded by `ach.routingNumber`. See `accountHolderNameLabel`. */
711
- routingNumberLabel?: string;
712
- /** @deprecated Superseded by `ach.accountNumber`. See `accountHolderNameLabel`. */
713
- accountNumberLabel?: string;
714
- addAddress: string;
715
- cancelButton: string;
716
- /** @deprecated Superseded by `createButtonCustomer` / `createButtonVendor`. */
717
- createButton?: string;
718
- createButtonCustomer: string;
719
- createButtonVendor: string;
720
- saveButton: string;
721
- /** Screen-reader name and tooltip of the sheet's close (X) button. */
722
- close: string;
723
- address: AddressFieldGroupLabels;
724
- ach: AchFieldGroupLabels;
725
- /** Seeds `address.fieldMarkers` and `ach.fieldMarkers` unless set per group. */
726
- fieldMarkers: LabelLabels;
727
- /** Rendered by the sheet only, not by the inline field group. */
728
- requiredFieldsLegend: RequiredFieldsLegendLabels;
729
- }
730
- interface AddressFormSheetLabels {
731
- title: string;
732
- cancelButton: string;
733
- saveButton: string;
734
- /** Screen-reader name and tooltip of the sheet's close (X) button. */
735
- close: string;
736
- address: AddressFieldGroupLabels;
737
- /** Seeds `address.fieldMarkers` unless set on the group itself. */
738
- fieldMarkers: LabelLabels;
739
- requiredFieldsLegend: RequiredFieldsLegendLabels;
740
- }
741
- interface ConfirmDeleteDialogLabels {
742
- confirmButton: string;
743
- cancelButton: string;
744
- /** Screen-reader name and tooltip of the dialog's close (X) button. */
745
- close: string;
746
- }
747
-
748
- /**
749
- * Overridable validation / error messages produced by the counterparts feature
750
- * layer and surfaced through each form's `errors` prop. Consumers override via
751
- * the widget's `messageLabels` prop, merged over {@link COUNTERPART_MESSAGE_LABELS_EN}.
752
- */
753
- interface CounterpartMessageLabels {
754
- legalNameRequired: string;
755
- firstNameRequired: string;
756
- lastNameRequired: string;
757
- emailRequired: string;
758
- emailInvalid: string;
759
- phoneInvalid: string;
760
- taxIdInvalid: string;
761
- addressLine1Required: string;
762
- cityRequired: string;
763
- stateRequired: string;
764
- postalCodeRequired: string;
765
- accountHolderNameRequired: string;
766
- routingNumberInvalid: string;
767
- accountNumberInvalid: string;
768
- /** Shown for a non-field-specific submit failure. */
769
- genericError: string;
770
- /** @deprecated Unused; the list labels its own warning. */
771
- amountsUnavailable: string;
772
- /** Delete confirmation title; `{name}` is replaced with the entity name. */
773
- deleteTitle: string;
774
- deleteBankAccountTitle: string;
775
- deleteBankAccountConfirm: string;
776
- deleteCounterpartMessage: string;
777
- deleteBankAccountMessage: string;
778
- /** @deprecated No longer shown. Use `customerAdded` / `vendorAdded`. */
779
- createSucceeded: string;
780
- /** @deprecated No longer shown. Use `customerUpdated` / `vendorUpdated`. */
781
- updateSucceeded: string;
782
- customerAdded: string;
783
- vendorAdded: string;
784
- customerUpdated: string;
785
- vendorUpdated: string;
786
- addressAdded: string;
787
- addressUpdated: string;
788
- bankAccountAdded: string;
789
- bankAccountUpdated: string;
790
- /**
791
- * @deprecated Used only when the delete controller gets no `counterpartType`;
792
- * users never see the word "counterpart". Use `customerDeleted` / `vendorDeleted`.
793
- */
794
- counterpartDeleted: string;
795
- customerDeleted: string;
796
- vendorDeleted: string;
797
- bankAccountDeleted: string;
798
- /** Error toast when a counterpart delete fails without an API message. */
799
- deleteCounterpartFailed: string;
800
- /** Error toast when a bank account delete fails without an API message. */
801
- deleteBankAccountFailed: string;
802
- }
803
-
804
- /** Display statuses; overdue state is represented separately on the due date. */
805
- type BillBadgeStatus = 'draft' | 'ready_to_submit' | 'pending_approval' | 'ready_to_pay' | 'scheduled' | 'paid' | 'canceled' | 'rejected';
806
-
807
- type BillStatusBadgeLabels = Record<BillBadgeStatus, string> & {
808
- unknown: string;
809
- };
810
-
811
- interface ReceivableStatusBadgeLabels {
812
- draft: string;
813
- issuing: string;
814
- issued: string;
815
- failed: string;
816
- accepted: string;
817
- expired: string;
818
- declined: string;
819
- recurring: string;
820
- partially_paid: string;
821
- paid: string;
822
- overdue: string;
823
- uncollectible: string;
824
- canceled: string;
825
- deleted: string;
826
- unknown: string;
827
- }
828
-
829
- interface CounterpartsScreenLabels {
830
- /** Customer-mode create action. */
831
- createButton: string;
832
- /** Vendor-mode create action. */
833
- vendorsCreateButton: string;
834
- columnName: string;
835
- columnBilledAmount: string;
836
- columnInvoicedAmount: string;
837
- columnReceivedAmount: string;
838
- columnAmountDue: string;
839
- columnTotalPaidToDate: string;
840
- columnBalanceDue: string;
841
- /**
842
- * A focused row's accessible name. The row itself is the control that
843
- * opens it, so the name says what Enter does. A template so locales own the
844
- * wording and order.
845
- */
846
- openRow: (counterpartName: string) => string;
847
- /** Shown in the name cell when a counterpart has no name. */
848
- unnamedCounterpart: string;
849
- searchPlaceholder: string;
850
- searchLabel: string;
851
- entityFilterLabel: string;
852
- entityFilterAll: string;
853
- entityFilterOrganization: string;
854
- entityFilterIndividual: string;
855
- filterChipRemove: string;
856
- typeChip: (value: string) => string;
857
- searchChip: (value: string) => string;
858
- clearAllFilters: string;
859
- customersEmptyTitle: string;
860
- customersEmptyDescription: string;
861
- customersEmptyAction: string;
862
- vendorsEmptyTitle: string;
863
- vendorsEmptyDescription: string;
864
- vendorsEmptyAction: string;
865
- customersFilterEmptyTitle: string;
866
- vendorsFilterEmptyTitle: string;
867
- filterEmptyDescription: string;
868
- filterEmptyAction: string;
869
- customersErrorTitle: string;
870
- customersErrorDescription: string;
871
- vendorsErrorTitle: string;
872
- vendorsErrorDescription: string;
873
- errorRetry: string;
874
- accessRestrictedTitle: string;
875
- accessRestrictedDescription: string;
876
- amountsUnavailable: string;
877
- amountsRetry: string;
878
- }
879
- interface CounterpartDetailsSheetLabels {
880
- loadingTitle: string;
881
- notFoundCustomerTitle: string;
882
- notFoundVendorTitle: string;
883
- notFoundCustomerDescription: string;
884
- notFoundVendorDescription: string;
885
- reloadFailed: string;
886
- openActionsMenu: string;
887
- closeAction: string;
888
- deleteCustomerAction: string;
889
- deleteVendorAction: string;
890
- summaryAmountDue: string;
891
- summaryBalanceDue: string;
892
- summaryBilled: string;
893
- summaryInvoiced: string;
894
- summaryReceived: string;
895
- summaryPaid: string;
896
- summaryRejected: string;
897
- overdueTag: string;
898
- /** Vendor footer action ("Add a bill"); the key predates the copy. */
899
- sendPaymentAction: string;
900
- issueInvoiceAction: string;
901
- recentCustomerDocumentsHeading: string;
902
- recentVendorDocumentsHeading: string;
903
- recentCustomerDocumentsDescription: string;
904
- recentVendorDocumentsDescription: string;
905
- /** Shown beside the recent-documents heading only when the host wires it. */
906
- viewAllDocumentsAction: string;
907
- subtitleTemplate: string;
908
- customerSubtitleLabel: string;
909
- vendorSubtitleLabel: string;
910
- entityTypePersonLabel: string;
911
- entityTypeBusinessLabel: string;
912
- remindersEnabledLabel: string;
913
- remindersDisabledLabel: string;
914
- paymentMethodTitle: string;
915
- customerDetailsHeading: string;
916
- vendorDetailsHeading: string;
917
- rowType: string;
918
- rowName: string;
919
- rowEmail: string;
920
- rowPaymentReminders: string;
921
- rowPhone: string;
922
- rowTaxIdSsn: string;
923
- rowTaxIdEin: string;
924
- showTaxId: string;
925
- hideTaxId: string;
926
- customerTaxIdHelp: string;
927
- vendorTaxIdHelp: string;
928
- addressHeading: string;
929
- noAddress: string;
930
- paymentMethodsHeading: string;
931
- paymentMethodsDescription: string;
932
- addPaymentMethodAction: string;
933
- editPaymentMethodAction: string;
934
- paymentMethodActionsMenu: string;
935
- deletePaymentMethodAction: string;
936
- incompletePaymentMethod: string;
937
- accountHolderLabel: string;
938
- accountNumberLabel: string;
939
- routingNumberLabel: string;
940
- noPaymentMethods: string;
941
- editButton: string;
942
- billStatusBadge: Partial<BillStatusBadgeLabels>;
943
- invoiceStatusBadge: Partial<ReceivableStatusBadgeLabels>;
944
- }
945
-
946
- /**
947
- * The counterpart a details-sheet action was invoked for. The name rides along
948
- * so a host filtering by it can label that filter without a second lookup.
949
- */
950
- interface CounterpartActionTarget {
951
- id: string;
952
- name: string;
953
- }
954
-
955
- /**
956
- * Named after {@link CounterpartsWidgetOwnProps} (this widget is a thin
957
- * `counterpartType="customer"` wrapper around `CounterpartsWidget`) minus
958
- * `counterpartType` itself, which this widget hardcodes.
959
- */
960
- interface CustomersWidgetOwnProps {
961
- pageSizeOptions?: number[];
962
- /**
963
- * Reveals a "View all" action beside the recent-documents heading in the
964
- * details sheet. Omit when the host has nowhere to send the user.
965
- */
966
- onViewAllDocuments?: (counterpart: CounterpartActionTarget) => void;
967
- /**
968
- * Opens the host's create-invoice flow for this customer, behind the
969
- * "Issue an invoice" button, which is hidden while unwired.
970
- */
971
- onCreateDocument?: (counterpart: CounterpartActionTarget) => void;
972
- screenLabels?: Partial<CounterpartsScreenLabels>;
973
- formLabels?: PartialDeep<CounterpartFormSheetLabels>;
974
- detailsLabels?: Partial<CounterpartDetailsSheetLabels>;
975
- /** @deprecated Unused; relabel the address through `formLabels.address`. */
976
- addressLabels?: PartialDeep<AddressFormSheetLabels>;
977
- deleteLabels?: Partial<ConfirmDeleteDialogLabels>;
978
- /** Overrides for validation / error / delete-prompt messages. */
979
- messageLabels?: Partial<CounterpartMessageLabels>;
980
- }
981
-
982
- /** Public props for {@link CustomersWidget}. */
983
- type CustomersWidgetProps = WidgetProviderProps & CustomersWidgetOwnProps;
984
- /**
985
- * A customer is a counterpart, so the published `CounterpartsWidget` already
986
- * is this surface end to end (list, details, create/edit, delete) via
987
- * `counterpartType`. Reused rather than rebuilt, the same way `BillPayWidget`
988
- * reuses it for its Vendors tab.
989
- */
990
- declare function CustomersWidget({ pageSizeOptions, onViewAllDocuments, onCreateDocument, screenLabels, formLabels, detailsLabels, addressLabels, deleteLabels, messageLabels, ...widgetProviderProps }: CustomersWidgetProps): React.JSX.Element;
991
-
992
- export { CustomersWidget };
993
- export type { CounterpartActionTarget, CustomersWidgetOwnProps, CustomersWidgetProps };