@tesouro/embedded-components-react 0.11.141 → 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,893 +0,0 @@
1
- import * as React from 'react';
2
- import { ComponentType, AnchorHTMLAttributes, ReactNode, ErrorInfo } from 'react';
3
- import { PartialDeep } from 'type-fest';
4
- import { RowData } from '@tanstack/react-table';
5
- import { FallbackProps } from 'react-error-boundary';
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
- /**
642
- * Co-located user-facing strings for the product catalog UI. Each component
643
- * takes a `labels?: Partial<…Labels>` prop merged over the matching
644
- * `*_LABELS_EN` default.
645
- */
646
- interface ProductFormSheetLabels {
647
- createTitle: string;
648
- /** Shown in the sheet description for the create form. */
649
- headerDescription: string;
650
- /** Heading of the inline edit form. `{type}` is replaced with the product/service word. */
651
- editingBanner: string;
652
- nameLabel: string;
653
- /** @deprecated Unused: placeholders carry format hints only. */
654
- namePlaceholder: string;
655
- descriptionLabel: string;
656
- /** @deprecated Unused: placeholders carry format hints only. */
657
- descriptionPlaceholder: string;
658
- /** `{count}` is replaced with the current character count. */
659
- descriptionCount: string;
660
- typeLabel: string;
661
- typeProduct: string;
662
- typeService: string;
663
- unitLabel: string;
664
- unitPlaceholder: string;
665
- /** First option in the unit picker; choosing it leaves the unit blank. */
666
- noUnit: string;
667
- unitEmpty: string;
668
- unitClearAriaLabel: string;
669
- addUnit: string;
670
- priceLabel: string;
671
- pricePlaceholder: string;
672
- cancelButton: string;
673
- /** `{type}` is replaced with the product/service word. */
674
- createButton: string;
675
- saveButton: string;
676
- /** Screen-reader name and tooltip of the sheet's close (X) button. */
677
- close: string;
678
- /** The required asterisk and "(optional)" note on each field label. */
679
- fieldMarkers: LabelLabels;
680
- requiredFieldsLegend: RequiredFieldsLegendLabels;
681
- }
682
- interface MeasureUnitsManagerLabels {
683
- title: string;
684
- hiddenDescription: string;
685
- searchPlaceholder: string;
686
- searchLabel: string;
687
- columnLabel: string;
688
- columnDescription: string;
689
- noDescription: string;
690
- /** @deprecated Unused: placeholders carry format hints only. */
691
- namePlaceholder: string;
692
- /** @deprecated Unused: placeholders carry format hints only. */
693
- descriptionPlaceholder: string;
694
- addButton: string;
695
- doneButton: string;
696
- editAction: string;
697
- deleteAction: string;
698
- saveAction: string;
699
- cancelAction: string;
700
- /** @deprecated Use `emptyTitle` and `emptyDescription`. */
701
- emptyText: string;
702
- emptyTitle: string;
703
- emptyDescription: string;
704
- searchEmptyTitle: string;
705
- searchEmptyDescription: string;
706
- loadingLabel: string;
707
- errorTitle: string;
708
- errorDescription: string;
709
- errorRetry: string;
710
- moreActionsLabel: string;
711
- close: string;
712
- createTitle: string;
713
- editTitle: string;
714
- nameLabel: string;
715
- descriptionLabel: string;
716
- fieldMarkers: LabelLabels;
717
- }
718
- interface MeasureUnitDeleteDialogLabels {
719
- /** `{name}` is replaced with the unit name. */
720
- title: string;
721
- /** @deprecated Unused: `messageNoItemsHint` alone covers a unit no product uses. */
722
- messageNoItems: string;
723
- messageNoItemsHint: string;
724
- messageWithItems: string;
725
- messageWithItemsHint: string;
726
- confirmButton: string;
727
- cancelButton: string;
728
- /** Screen-reader name and tooltip of the dialog's close (X) button. */
729
- close: string;
730
- loadingProducts: string;
731
- }
732
-
733
- /**
734
- * Overridable validation, error and toast messages produced by the products
735
- * feature layer and surfaced through the form's `errors` prop, the
736
- * measure-units manager and toasts. Consumers override them through
737
- * `ProductsWidget`'s `messageLabels` or `ReceivablesWidget`'s
738
- * `productMessageLabels`, merged over {@link PRODUCT_MESSAGE_LABELS_EN}.
739
- */
740
- interface ProductMessageLabels {
741
- nameRequired: string;
742
- /** Shown when a name exceeds the 100-character limit. */
743
- nameTooLong: string;
744
- typeRequired: string;
745
- priceInvalid: string;
746
- /** Shown when a description exceeds the 255-character limit. */
747
- descriptionTooLong: string;
748
- unitNameRequired: string;
749
- /** Shown for a non-field-specific product submit failure. */
750
- genericError: string;
751
- /** Fallback when creating a measure unit fails without a server message. */
752
- createMeasureUnitError: string;
753
- /** Fallback when updating a measure unit fails without a server message. */
754
- updateMeasureUnitError: string;
755
- /** Success toast after creating a product; `{name}` is replaced with its name. */
756
- productCreated: string;
757
- /** Success toast after editing a product; `{name}` is replaced with its name. */
758
- productUpdated: string;
759
- /** Success toast after editing a service; `{name}` is replaced with its name. */
760
- serviceUpdated: string;
761
- /** Success toast after deleting a product; `{name}` is replaced with its name. */
762
- productDeleted: string;
763
- /** Error toast when a product delete fails; `{name}` is replaced with its name. */
764
- deleteProductError: string;
765
- /** Success toast after creating a measure unit; `{name}` is replaced with its name. */
766
- measureUnitCreated: string;
767
- /** Success toast after editing a measure unit; `{name}` is replaced with its name. */
768
- measureUnitUpdated: string;
769
- /** Success toast after deleting a measure unit; `{name}` is replaced with its name. */
770
- measureUnitDeleted: string;
771
- /** Error toast when a measure unit delete fails; `{name}` is replaced with its name. */
772
- deleteMeasureUnitError: string;
773
- }
774
-
775
- interface ProductTypeBadgeLabels {
776
- product: string;
777
- service: string;
778
- }
779
- interface ProductsScreenLabels {
780
- createButton: string;
781
- manageUnitsButton: string;
782
- columnName: string;
783
- columnType: string;
784
- columnDescription: string;
785
- columnPrice: string;
786
- searchPlaceholder: string;
787
- searchLabel: string;
788
- filtersButton: string;
789
- filterFieldType: string;
790
- filterFieldUnit: string;
791
- /** Accessible name of a chip's dismiss button. `{label}` is the chip's text. */
792
- filterChipRemove: string;
793
- typeChip: (value: string) => string;
794
- unitChip: (value: string) => string;
795
- searchChip: (value: string) => string;
796
- clearAllFilters: string;
797
- typeFilterProduct: string;
798
- typeFilterService: string;
799
- /** First choice in the unit panel; choosing it removes the unit filter. */
800
- unitFilterAll: string;
801
- emptyTitle: string;
802
- emptyDescription: string;
803
- emptyAction: string;
804
- filterEmptyTitle: string;
805
- filterEmptyDescription: string;
806
- errorTitle: string;
807
- errorDescription: string;
808
- errorRetry: string;
809
- accessRestrictedTitle: string;
810
- accessRestrictedDescription: string;
811
- /**
812
- * A focused row's accessible name. The row itself is the control that
813
- * opens it, so the name says what Enter does. A template so locales own the
814
- * wording and order.
815
- */
816
- openRow: (productName: string) => string;
817
- typeBadge: ProductTypeBadgeLabels;
818
- }
819
- interface ProductDetailsSheetLabels {
820
- /** @deprecated Unused: the sheet has no description while it loads. */
821
- hiddenDescription: string;
822
- /** `{type}` and `{createdAt}` are replaced at render time. */
823
- subtitle: string;
824
- /** `{type}` is replaced with "Product" or "Service". */
825
- sectionHeading: string;
826
- typeProductDescription: string;
827
- typeServiceDescription: string;
828
- /** `{type}` is replaced with "Product" or "Service". */
829
- rowName: string;
830
- rowDescription: string;
831
- rowType: string;
832
- rowUnit: string;
833
- rowPrice: string;
834
- rowCreatedOn: string;
835
- rowLastUpdate: string;
836
- /** Accessible label for the overflow actions trigger button. */
837
- moreActionsLabel: string;
838
- /** Accessible label for the close button. */
839
- closeLabel: string;
840
- /** Fallback displayed in a detail row when the value is empty. */
841
- rowEmptyValue: string;
842
- /** Label for the delete item in the actions dropdown. `{type}` is replaced with "Product" or "Service". */
843
- deleteProductOption: string;
844
- editButton: string;
845
- loadingTitle: string;
846
- unavailableTitle: string;
847
- loadingLabel: string;
848
- errorTitle: string;
849
- errorDescription: string;
850
- typeBadge: ProductTypeBadgeLabels;
851
- }
852
- interface ProductDeleteDialogLabels {
853
- /** `{name}` is replaced with the product name. */
854
- title: string;
855
- message: string;
856
- confirmButton: string;
857
- cancelButton: string;
858
- /** Accessible name and tooltip of the dialog's close (X) button. */
859
- close: string;
860
- }
861
-
862
- interface ProductsWidgetOwnProps {
863
- pageSizeOptions?: number[];
864
- screenLabels?: PartialDeep<ProductsScreenLabels>;
865
- formLabels?: PartialDeep<ProductFormSheetLabels>;
866
- detailsLabels?: PartialDeep<ProductDetailsSheetLabels>;
867
- deleteLabels?: Partial<ProductDeleteDialogLabels>;
868
- measureUnitsLabels?: PartialDeep<MeasureUnitsManagerLabels>;
869
- measureUnitDeleteLabels?: Partial<MeasureUnitDeleteDialogLabels>;
870
- /** Overrides for validation / error messages produced by the widget. */
871
- messageLabels?: Partial<ProductMessageLabels>;
872
- }
873
- /** Public props for {@link ProductsWidget}. */
874
- type ProductsWidgetProps = WidgetProviderProps & ProductsWidgetOwnProps;
875
-
876
- /** Kept off the exported {@link ProductsWidgetProps}: only Invoicing's tab row passes the slot. */
877
- interface ProductsWidgetInternalProps extends ProductsWidgetProps {
878
- headerActionContainer?: HTMLElement | null;
879
- }
880
- /**
881
- * Self-contained products/services widget: lists, filters, creates, edits,
882
- * views, and deletes products, and manages measure units. The provider/inner
883
- * split keeps the public component a pure {@link WidgetProvider} wrapper.
884
- *
885
- * @example
886
- * ```tsx
887
- * <ProductsWidget baseUrl="https://api.tesouro.com" widgetToken="wt_..." organizationId="org_..." />
888
- * ```
889
- */
890
- declare function ProductsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }: ProductsWidgetInternalProps): React.JSX.Element;
891
-
892
- export { ProductsWidget };
893
- export type { MeasureUnitDeleteDialogLabels, MeasureUnitsManagerLabels, ProductDeleteDialogLabels, ProductDetailsSheetLabels, ProductFormSheetLabels, ProductMessageLabels, ProductsScreenLabels, ProductsWidgetProps };