@taxbit/react-sdk 0.4.4 → 0.5.1

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 (37) hide show
  1. package/README.md +21 -44
  2. package/dist/basic.css +27 -12
  3. package/dist/inline.css +27 -12
  4. package/dist/minimal.css +8 -1
  5. package/dist/src/contexts/FormUI/useFormUI.d.ts +2 -1
  6. package/dist/src/contexts/FormUI/useFormUIContext.d.ts +4 -2
  7. package/dist/src/contexts/TaxDocumentation/TaxBitFormProvider.d.ts +1 -1
  8. package/dist/src/contexts/TaxDocumentation/useTaxDocumentation.d.ts +6 -4
  9. package/dist/src/contexts/TaxDocumentation/useTaxDocumentationContext.d.ts +6 -4
  10. package/dist/src/hooks/useTaxBit/useTaxBit.d.ts +1 -1
  11. package/dist/src/i18n/types/LocalizationKey.d.ts +2 -2
  12. package/dist/src/test/utils/helpers.d.ts +3 -0
  13. package/dist/src/ui/Actions/Actions.d.ts +3 -1
  14. package/dist/src/ui/InputValue/InputValue.d.ts +7 -0
  15. package/dist/src/ui/InputValue/index.d.ts +1 -0
  16. package/dist/src/ui/MaskedContent/MaskedContent.d.ts +3 -2
  17. package/dist/src/ui/RadioButtons/RadioButtons.d.ts +1 -1
  18. package/dist/src/ui/Select/Select.d.ts +4 -14
  19. package/dist/src/ui/TextInput/TextInput.d.ts +2 -2
  20. package/dist/src/ui/TextInput/__tests__/TextInput.test.d.ts +0 -0
  21. package/dist/src/ui/index.d.ts +12 -10
  22. package/dist/src/utils/isBlank.d.ts +1 -1
  23. package/dist/src/utils/sort/byOptionalLabel.d.ts +5 -0
  24. package/dist/src/utils/sort/index.d.ts +1 -0
  25. package/dist/src/widgets/TaxBitForm/TaxBitDAC7Form.d.ts +1 -1
  26. package/dist/src/widgets/TaxBitForm/TaxBitForm.d.ts +11 -4
  27. package/dist/src/widgets/TaxBitForm/useTaxBitForm.d.ts +2 -2
  28. package/dist/src/wizard/LanguageSelector/LanguageSelector.d.ts +1 -1
  29. package/dist/src/wizard/RowInput/TextInputRow/TextInputRow.d.ts +3 -5
  30. package/dist/src/wizard/TaxBitFormUI/AppError/AppError.d.ts +4 -0
  31. package/dist/src/wizard/TaxBitFormUI/AppError/index.d.ts +1 -0
  32. package/dist/src/wizard/TaxBitFormUI/TaxBitDAC7FormUI.d.ts +2 -2
  33. package/dist/src/wizard/TaxBitFormUI/TaxBitFormUI.d.ts +3 -7
  34. package/dist/src/wizard/TaxBitFormUI/index.d.ts +2 -2
  35. package/dist/taxbit-react-sdk.js +1958 -1696
  36. package/dist/taxbit-react-sdk.umd.cjs +10 -10
  37. package/package.json +1 -1
package/README.md CHANGED
@@ -100,38 +100,9 @@ This will be generated from the TaxBit API and passed in as a prop to the compon
100
100
  ### Language
101
101
 
102
102
  The first screen of the tax documentation interview gives the user the opportunity to select a language.
103
- This can also be initially set to any one of the following:
104
-
105
- - bg-bg
106
- - cs-cz
107
- - da-dk
108
- - de-at
109
- - de-de
110
- - el-cy
111
- - el-gr
112
- - en-gb
113
- - en-us
114
- - es-es
115
- - et-ee
116
- - fi-fi
117
- - fr-fr
118
- - fr-lu
119
- - ga-ie
120
- - hr-hr
121
- - hu-hu
122
- - it-it
123
- - lt-lt
124
- - lv-lv
125
- - mt-mt
126
- - nl-be
127
- - nl-nl
128
- - no-no
129
- - pl-pl
130
- - pt-pt
131
- - ro-ro
132
- - sk-sk
133
- - sl-si
134
- - sv-se
103
+ This can also be initially set to any of that languages that are supported by the TaxBit API.
104
+
105
+ See the `Locale` type below.
135
106
 
136
107
  ### Status
137
108
 
@@ -139,10 +110,14 @@ The `useTaxBit` hook will return a `status` object that can be used to determine
139
110
 
140
111
  ```typescript
141
112
  {
142
- submission_status: string;
143
- DAC7_interview: {
144
- data_collection_status: string;
145
- expiration_date: string;
113
+ submissionStatus: 'SUBMITTED' | 'NOT_SUBMITTED';
114
+ DAC7Interview: {
115
+ dataCollectionStatus: 'COMPLETE' | 'INCOMPLETE';
116
+ expirationDate: 'PENDING' |
117
+ 'VALID' |
118
+ 'INVALID' |
119
+ 'INSUFFICIENT_DATA' |
120
+ 'NOT_REQUIRED';
146
121
  }
147
122
  }
148
123
  ```
@@ -151,10 +126,10 @@ an example is below.
151
126
 
152
127
  ```json
153
128
  {
154
- "submission_status": "SUBMITTED",
155
- "DAC7_interview": {
156
- "data_collection_status": "COMPLETE",
157
- "expiration_date": "2026-11-20T00:00:00.000Z"
129
+ "submissionStatus": "SUBMITTED",
130
+ "DAC7Interview": {
131
+ "dataCollectionStatus": "COMPLETE",
132
+ "expirationDate": "2026-11-20T00:00:00.000Z"
158
133
  }
159
134
  }
160
135
  ```
@@ -174,15 +149,17 @@ Classnames are namespaced with "taxbit-" to reduce the chance of conflict.
174
149
 
175
150
  The TaxBit React SDK provides callbacks for the following events on the `TaxBitDAC7Form` component. These callbacks can be passed in to the Component and used to trigger other actions in your application.
176
151
 
177
- - `onSubmit` - called when the user clicks the submit button
178
- - `onSuccess` - called after the server responds with a successful submission
179
- - `onProgress` - called when the user navigates within the TaxBit UI. The function passed here will be passed a Progress object (see below for the type definition):
152
+ - `onSubmit` - called when the user clicks the submit button. This can be an `async` function.
153
+ - `onSuccess` - called after the server responds with a successful submission.
154
+ - `onError` - called when the server responds with an error during data submission.
155
+ - `onSettled` - called after `onError` or `onSuccess` is called.
156
+ - `onProgress` - called when the user loads and navigates within the TaxBit UI. The function passed here will be passed a Progress object (see below for the type definition):
180
157
 
181
158
  The DAC7 sequence, for example, can have a total of 3, 4, or 5 steps, each with a localized `stepTitle` and `stepId`. The `stepNumber` is the current step (1 based), and `percentComplete` is the percentage of the steps that have been completed.
182
159
 
183
160
  ### Types
184
161
 
185
- The TaxBit React SDK provides a type for the status of the most resent tax documentation submitted by the user, referred to as `ClientTaxDocumentationStatus`. The data passed to the component and returned to the callback is typed as `ClientTaxDocumentation`.
162
+ The TaxBit React SDK provides a type for the status of the most recent tax documentation submitted by the user, referred to as `ClientTaxDocumentationStatus`. The data passed to the component and returned to the callback is typed as `ClientTaxDocumentation`.
186
163
 
187
164
  Also included are some utility types:
188
165
 
package/dist/basic.css CHANGED
@@ -78,14 +78,19 @@ button.taxbit-button:focus-visible {
78
78
  color: red;
79
79
  }
80
80
  }
81
- .taxbit-error-message {
82
- color: red;
83
- font-size: 0.8em;
84
- }
85
- .taxbit-hint {
86
- font-size: 0.8em;
87
- opacity: 0.7;
88
- }
81
+ }
82
+
83
+ .taxbit-info-message {
84
+ color: blue;
85
+ font-size: 0.8em;
86
+ }
87
+ .taxbit-error-message {
88
+ color: red;
89
+ font-size: 0.8em;
90
+ }
91
+ .taxbit-hint {
92
+ font-size: 0.8em;
93
+ opacity: 0.7;
89
94
  }
90
95
 
91
96
  .taxbit-row-actions {
@@ -181,12 +186,15 @@ button.taxbit-button:focus-visible {
181
186
  flex: 0 0 40%;
182
187
  }
183
188
 
184
- .taxbit-step-actions {
185
- display: flex;
186
-
187
- padding-top: 8px;
189
+ .taxbit-footer {
190
+ padding-top: 5px;
188
191
  border-top: solid 1px #e4ebf6;
189
192
  margin-top: 12px;
193
+ }
194
+
195
+ .taxbit-step-actions {
196
+ display: flex;
197
+ margin-top: 5px;
190
198
 
191
199
  .taxbit-primary-actions {
192
200
  > button {
@@ -197,6 +205,13 @@ button.taxbit-button:focus-visible {
197
205
  border-color: rgb(2, 80, 187);
198
206
  background-color: rgb(2, 80, 187);
199
207
  }
208
+ > button.taxbit-button-disabled {
209
+ cursor: default;
210
+ background-color: rgb(170, 179, 187);
211
+ }
212
+ > button.taxbit-button-disabled:hover {
213
+ border-color: rgb(170, 179, 187);
214
+ }
200
215
  }
201
216
 
202
217
  .taxbit-secondary-actions {
package/dist/inline.css CHANGED
@@ -66,14 +66,19 @@ button.taxbit-button:focus-visible {
66
66
  color: red;
67
67
  }
68
68
  }
69
- .taxbit-error-message {
70
- color: red;
71
- font-size: 0.8em;
72
- }
73
- .taxbit-hint {
74
- font-size: 0.8em;
75
- opacity: 0.7;
76
- }
69
+ }
70
+
71
+ .taxbit-info-message {
72
+ color: blue;
73
+ font-size: 0.8em;
74
+ }
75
+ .taxbit-error-message {
76
+ color: red;
77
+ font-size: 0.8em;
78
+ }
79
+ .taxbit-hint {
80
+ font-size: 0.8em;
81
+ opacity: 0.7;
77
82
  }
78
83
 
79
84
  .taxbit-row-actions {
@@ -181,12 +186,15 @@ button.taxbit-button:focus-visible {
181
186
  margin-right: 50%;
182
187
  }
183
188
 
184
- .taxbit-step-actions {
185
- display: flex;
186
-
187
- padding-top: 8px;
189
+ .taxbit-footer {
190
+ padding-top: 5px;
188
191
  border-top: solid 1px #e4ebf6;
189
192
  margin-top: 12px;
193
+ }
194
+
195
+ .taxbit-step-actions {
196
+ display: flex;
197
+ margin-top: 5px;
190
198
 
191
199
  .taxbit-primary-actions {
192
200
  > button {
@@ -197,6 +205,13 @@ button.taxbit-button:focus-visible {
197
205
  border-color: rgb(2, 80, 187);
198
206
  background-color: rgb(2, 80, 187);
199
207
  }
208
+ > button.taxbit-button-disabled {
209
+ cursor: default;
210
+ background-color: rgb(170, 179, 187);
211
+ }
212
+ > button.taxbit-button-disabled:hover {
213
+ border-color: rgb(170, 179, 187);
214
+ }
200
215
  }
201
216
 
202
217
  .taxbit-secondary-actions {
package/dist/minimal.css CHANGED
@@ -11,8 +11,15 @@
11
11
  color: red;
12
12
  }
13
13
 
14
+ .taxbit-info-message {
15
+ color: blue;
16
+ }
17
+
18
+ .taxbit-footer {
19
+ margin-top: 20px;
20
+ }
21
+
14
22
  .taxbit-step-actions {
15
23
  display: flex;
16
24
  justify-content: space-between;
17
- margin-top: 20px;
18
25
  }
@@ -35,10 +35,11 @@ export declare const useFormUI: () => {
35
35
  showErrorsForField: (key: TaxDocumentationKey) => boolean | undefined;
36
36
  exposeErrors: () => void;
37
37
  hideErrors: () => void;
38
+ hasChangedData: boolean;
38
39
  getRequiredLocalPrompt: (key: TaxDocumentationKey) => string;
40
+ visibleFields: TaxDocumentationPropertyFile;
39
41
  invalidFields: TaxDocumentationErrorFile;
40
42
  requiredFields: TaxDocumentationPropertyFile;
41
- visibleFields: TaxDocumentationPropertyFile;
42
43
  hideField: (key: TaxDocumentationKey) => void;
43
44
  showField: (key: TaxDocumentationKey) => void;
44
45
  };
@@ -26,10 +26,11 @@ export declare const useFormUIContext: () => {
26
26
  showErrorsForField: (key: keyof import("../../types").AccountHolderContactData | keyof import("../../types").AccountHolderTaxData | keyof import("../../types").AccountHolderClassificationData | keyof import("../../types").RegardedOwnerContactData | keyof import("../../types").RegardedOwnerClassificationData | keyof import("../../types").RegardedOwnerTaxData | keyof import("../../types").SummaryData | keyof import("../../types").CalculatedData) => boolean | undefined;
27
27
  exposeErrors: () => void;
28
28
  hideErrors: () => void;
29
+ hasChangedData: boolean;
29
30
  getRequiredLocalPrompt: (key: keyof import("../../types").AccountHolderContactData | keyof import("../../types").AccountHolderTaxData | keyof import("../../types").AccountHolderClassificationData | keyof import("../../types").RegardedOwnerContactData | keyof import("../../types").RegardedOwnerClassificationData | keyof import("../../types").RegardedOwnerTaxData | keyof import("../../types").SummaryData | keyof import("../../types").CalculatedData) => string;
31
+ visibleFields: import("./useFormUI").TaxDocumentationPropertyFile;
30
32
  invalidFields: import("./useFormUI").TaxDocumentationErrorFile;
31
33
  requiredFields: import("./useFormUI").TaxDocumentationPropertyFile;
32
- visibleFields: import("./useFormUI").TaxDocumentationPropertyFile;
33
34
  hideField: (key: keyof import("../../types").AccountHolderContactData | keyof import("../../types").AccountHolderTaxData | keyof import("../../types").AccountHolderClassificationData | keyof import("../../types").RegardedOwnerContactData | keyof import("../../types").RegardedOwnerClassificationData | keyof import("../../types").RegardedOwnerTaxData | keyof import("../../types").SummaryData | keyof import("../../types").CalculatedData) => void;
34
35
  showField: (key: keyof import("../../types").AccountHolderContactData | keyof import("../../types").AccountHolderTaxData | keyof import("../../types").AccountHolderClassificationData | keyof import("../../types").RegardedOwnerContactData | keyof import("../../types").RegardedOwnerClassificationData | keyof import("../../types").RegardedOwnerTaxData | keyof import("../../types").SummaryData | keyof import("../../types").CalculatedData) => void;
35
36
  }, FormUIContextProvider: import("react").Provider<{
@@ -59,10 +60,11 @@ export declare const useFormUIContext: () => {
59
60
  showErrorsForField: (key: keyof import("../../types").AccountHolderContactData | keyof import("../../types").AccountHolderTaxData | keyof import("../../types").AccountHolderClassificationData | keyof import("../../types").RegardedOwnerContactData | keyof import("../../types").RegardedOwnerClassificationData | keyof import("../../types").RegardedOwnerTaxData | keyof import("../../types").SummaryData | keyof import("../../types").CalculatedData) => boolean | undefined;
60
61
  exposeErrors: () => void;
61
62
  hideErrors: () => void;
63
+ hasChangedData: boolean;
62
64
  getRequiredLocalPrompt: (key: keyof import("../../types").AccountHolderContactData | keyof import("../../types").AccountHolderTaxData | keyof import("../../types").AccountHolderClassificationData | keyof import("../../types").RegardedOwnerContactData | keyof import("../../types").RegardedOwnerClassificationData | keyof import("../../types").RegardedOwnerTaxData | keyof import("../../types").SummaryData | keyof import("../../types").CalculatedData) => string;
65
+ visibleFields: import("./useFormUI").TaxDocumentationPropertyFile;
63
66
  invalidFields: import("./useFormUI").TaxDocumentationErrorFile;
64
67
  requiredFields: import("./useFormUI").TaxDocumentationPropertyFile;
65
- visibleFields: import("./useFormUI").TaxDocumentationPropertyFile;
66
68
  hideField: (key: keyof import("../../types").AccountHolderContactData | keyof import("../../types").AccountHolderTaxData | keyof import("../../types").AccountHolderClassificationData | keyof import("../../types").RegardedOwnerContactData | keyof import("../../types").RegardedOwnerClassificationData | keyof import("../../types").RegardedOwnerTaxData | keyof import("../../types").SummaryData | keyof import("../../types").CalculatedData) => void;
67
69
  showField: (key: keyof import("../../types").AccountHolderContactData | keyof import("../../types").AccountHolderTaxData | keyof import("../../types").AccountHolderClassificationData | keyof import("../../types").RegardedOwnerContactData | keyof import("../../types").RegardedOwnerClassificationData | keyof import("../../types").RegardedOwnerTaxData | keyof import("../../types").SummaryData | keyof import("../../types").CalculatedData) => void;
68
70
  } | undefined>;
@@ -3,7 +3,7 @@ import type { InputStep, Locale, Progress, TaxForm } from '../../types';
3
3
  import { ClientTaxDocumentation, ExternalValidations } from '../../types/client';
4
4
  type TaxDocumentationProviderProps = {
5
5
  data?: ClientTaxDocumentation;
6
- onSubmit: (data: ClientTaxDocumentation) => void;
6
+ onSubmit: (data: ClientTaxDocumentation) => Promise<void>;
7
7
  language?: Locale;
8
8
  children: React.ReactNode;
9
9
  taxForms?: TaxForm[];
@@ -2,12 +2,13 @@
2
2
  import type { InputStep, Locale, Progress, TaxDocumentation, TaxForm } from 'types';
3
3
  import type { StepId } from 'types/StepId';
4
4
  import { ClientTaxDocumentation, ExternalValidations } from 'types/client';
5
+ import { TaxBitFormProps } from '../../widgets';
5
6
  type UseTaxDocumentationProps = {
6
7
  data: ClientTaxDocumentation;
7
8
  language?: Locale;
8
9
  externalValidations?: ExternalValidations;
9
- onSubmit: (data: ClientTaxDocumentation) => void;
10
- onProgress?: (progress: Progress) => void;
10
+ onSubmit: (data: ClientTaxDocumentation) => Promise<void>;
11
+ onProgress?: TaxBitFormProps['onProgress'];
11
12
  step?: InputStep;
12
13
  taxForms?: TaxForm[];
13
14
  };
@@ -20,7 +21,7 @@ export declare const useTaxDocumentation: ({ data: startingData, language: initi
20
21
  onPersistAccountHolderData: (newData: TaxDocumentation) => void;
21
22
  onPersistCollectedData: (newData: TaxDocumentation) => void;
22
23
  onSubmitTaxDocumentation: (data: TaxDocumentation) => void;
23
- onResetTaxDocumentation: (data: ClientTaxDocumentation) => void;
24
+ error: string | undefined;
24
25
  editTo: (form: InputStep) => void;
25
26
  onCancel: (() => void) | undefined;
26
27
  getStepId: (key: InputStep) => StepId;
@@ -30,10 +31,11 @@ export declare const useTaxDocumentation: ({ data: startingData, language: initi
30
31
  progress: Progress | undefined;
31
32
  stepName: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
32
33
  data: TaxDocumentation;
34
+ originalClientData: TaxDocumentation;
35
+ initialStep: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
33
36
  setLanguage: import("react").Dispatch<import("react").SetStateAction<"bg-bg" | "cs-cz" | "da-dk" | "de-at" | "de-de" | "el-cy" | "el-gr" | "en-gb" | "en-us" | "es-es" | "et-ee" | "fi-fi" | "fr-fr" | "fr-lu" | "ga-ie" | "hr-hr" | "hu-hu" | "it-it" | "lt-lt" | "lv-lv" | "mt-mt" | "nl-be" | "nl-nl" | "no-no" | "pl-pl" | "pt-pt" | "ro-ro" | "sk-sk" | "sl-si" | "sv-se">>;
34
37
  language: "bg-bg" | "cs-cz" | "da-dk" | "de-at" | "de-de" | "el-cy" | "el-gr" | "en-gb" | "en-us" | "es-es" | "et-ee" | "fi-fi" | "fr-fr" | "fr-lu" | "ga-ie" | "hr-hr" | "hu-hu" | "it-it" | "lt-lt" | "lv-lv" | "mt-mt" | "nl-be" | "nl-nl" | "no-no" | "pl-pl" | "pt-pt" | "ro-ro" | "sk-sk" | "sl-si" | "sv-se";
35
38
  supportedForms: TaxForm[];
36
- setSupportedForms: import("react").Dispatch<import("react").SetStateAction<TaxForm[]>>;
37
39
  externalValidations: ExternalValidations | undefined;
38
40
  };
39
41
  export {};
@@ -8,7 +8,7 @@ export declare const useTaxDocumentationContext: () => {
8
8
  onPersistAccountHolderData: (newData: import("../../types").TaxDocumentation) => void;
9
9
  onPersistCollectedData: (newData: import("../../types").TaxDocumentation) => void;
10
10
  onSubmitTaxDocumentation: (data: import("../../types").TaxDocumentation) => void;
11
- onResetTaxDocumentation: (data: import("../../entry").ClientTaxDocumentation) => void;
11
+ error: string | undefined;
12
12
  editTo: (form: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => void;
13
13
  onCancel: (() => void) | undefined;
14
14
  getStepId: (key: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => import("../../entry").StepId;
@@ -18,10 +18,11 @@ export declare const useTaxDocumentationContext: () => {
18
18
  progress: import("../../types").Progress | undefined;
19
19
  stepName: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
20
20
  data: import("../../types").TaxDocumentation;
21
+ originalClientData: import("../../types").TaxDocumentation;
22
+ initialStep: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
21
23
  setLanguage: import("react").Dispatch<import("react").SetStateAction<"bg-bg" | "cs-cz" | "da-dk" | "de-at" | "de-de" | "el-cy" | "el-gr" | "en-gb" | "en-us" | "es-es" | "et-ee" | "fi-fi" | "fr-fr" | "fr-lu" | "ga-ie" | "hr-hr" | "hu-hu" | "it-it" | "lt-lt" | "lv-lv" | "mt-mt" | "nl-be" | "nl-nl" | "no-no" | "pl-pl" | "pt-pt" | "ro-ro" | "sk-sk" | "sl-si" | "sv-se">>;
22
24
  language: "bg-bg" | "cs-cz" | "da-dk" | "de-at" | "de-de" | "el-cy" | "el-gr" | "en-gb" | "en-us" | "es-es" | "et-ee" | "fi-fi" | "fr-fr" | "fr-lu" | "ga-ie" | "hr-hr" | "hu-hu" | "it-it" | "lt-lt" | "lv-lv" | "mt-mt" | "nl-be" | "nl-nl" | "no-no" | "pl-pl" | "pt-pt" | "ro-ro" | "sk-sk" | "sl-si" | "sv-se";
23
25
  supportedForms: import("../../types").TaxForm[];
24
- setSupportedForms: import("react").Dispatch<import("react").SetStateAction<import("../../types").TaxForm[]>>;
25
26
  externalValidations: import("../../entry").ExternalValidations | undefined;
26
27
  }, TaxDocumentationContextProvider: import("react").Provider<{
27
28
  isW9: boolean;
@@ -32,7 +33,7 @@ export declare const useTaxDocumentationContext: () => {
32
33
  onPersistAccountHolderData: (newData: import("../../types").TaxDocumentation) => void;
33
34
  onPersistCollectedData: (newData: import("../../types").TaxDocumentation) => void;
34
35
  onSubmitTaxDocumentation: (data: import("../../types").TaxDocumentation) => void;
35
- onResetTaxDocumentation: (data: import("../../entry").ClientTaxDocumentation) => void;
36
+ error: string | undefined;
36
37
  editTo: (form: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => void;
37
38
  onCancel: (() => void) | undefined;
38
39
  getStepId: (key: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => import("../../entry").StepId;
@@ -42,9 +43,10 @@ export declare const useTaxDocumentationContext: () => {
42
43
  progress: import("../../types").Progress | undefined;
43
44
  stepName: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
44
45
  data: import("../../types").TaxDocumentation;
46
+ originalClientData: import("../../types").TaxDocumentation;
47
+ initialStep: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
45
48
  setLanguage: import("react").Dispatch<import("react").SetStateAction<"bg-bg" | "cs-cz" | "da-dk" | "de-at" | "de-de" | "el-cy" | "el-gr" | "en-gb" | "en-us" | "es-es" | "et-ee" | "fi-fi" | "fr-fr" | "fr-lu" | "ga-ie" | "hr-hr" | "hu-hu" | "it-it" | "lt-lt" | "lv-lv" | "mt-mt" | "nl-be" | "nl-nl" | "no-no" | "pl-pl" | "pt-pt" | "ro-ro" | "sk-sk" | "sl-si" | "sv-se">>;
46
49
  language: "bg-bg" | "cs-cz" | "da-dk" | "de-at" | "de-de" | "el-cy" | "el-gr" | "en-gb" | "en-us" | "es-es" | "et-ee" | "fi-fi" | "fr-fr" | "fr-lu" | "ga-ie" | "hr-hr" | "hu-hu" | "it-it" | "lt-lt" | "lv-lv" | "mt-mt" | "nl-be" | "nl-nl" | "no-no" | "pl-pl" | "pt-pt" | "ro-ro" | "sk-sk" | "sl-si" | "sv-se";
47
50
  supportedForms: import("../../types").TaxForm[];
48
- setSupportedForms: import("react").Dispatch<import("react").SetStateAction<import("../../types").TaxForm[]>>;
49
51
  externalValidations: import("../../entry").ExternalValidations | undefined;
50
52
  } | undefined>;
@@ -1,6 +1,6 @@
1
1
  import type { ClientTaxDocumentation, ClientTaxDocumentationStatus } from '../../types/client';
2
2
  export declare const useTaxBit: (bearerToken: string, staging?: true) => {
3
- postData: (data: ClientTaxDocumentation) => Promise<void>;
3
+ postData: (data: ClientTaxDocumentation) => Promise<Response>;
4
4
  status: ClientTaxDocumentationStatus | undefined;
5
5
  formSubmitted: boolean;
6
6
  serverData: ClientTaxDocumentation | undefined;
@@ -1,9 +1,9 @@
1
1
  export type ButtonKey = 'edit' | 'back' | 'next' | 'reset' | 'submit' | 'cancel' | 'hide' | 'show';
2
- export type ErrorKey = 'required' | 'invalid' | 'invalidDate' | 'invalidVat' | 'mustBeSixCharacters' | 'mustBeNineDigits' | 'mustBeFiveOrNineDigits' | 'mustMatchName' | 'mustBeInDateFormat' | 'mustBeValidBirthDate' | 'mustNotMatchVatin' | 'residencesMustIncludeVatCountry' | 'residencesMustIncludeAddressCountry' | 'residencesMustIncludeAnEUCountry';
2
+ export type ErrorKey = 'formHasErrors' | 'invalid' | 'invalidDate' | 'invalidVat' | 'mustBeFiveOrNineDigits' | 'mustBeInDateFormat' | 'mustBeNineDigits' | 'mustBeSixCharacters' | 'mustBeValidBirthDate' | 'mustMatchName' | 'mustNotMatchVatin' | 'required' | 'residencesMustIncludeAddressCountry' | 'residencesMustIncludeAnEUCountry' | 'residencesMustIncludeVatCountry';
3
3
  export type OptionKey = 'usPerson_yes' | 'usPerson_no' | 'regardedOwnerUsPerson_yes' | 'regardedOwnerUsPerson_no' | 'isIndividual_yes' | 'isIndividual_no' | 'cCorporation' | 'centralBankOfIssue' | 'complexTrust' | 'corporation' | 'disregardedEntity' | 'estate' | 'foreignGovernmentControlledEntity' | 'foreignGovernmentIntegralPart' | 'grantorTrust' | 'individual' | 'internationalOrganization' | 'llc' | 'no' | 'other' | 'partnership' | 'privateFoundation' | 'sCorporation' | 'simpleTrust' | 'smllc' | 'soleProprietor' | 'taxExemptOrganization' | 'trust' | 'trustEstate' | 'yes';
4
4
  export type PromptKey = 'addAdditional' | 'address' | 'businessRegistrationNumber' | 'businessRegistrationCountry' | 'city' | 'cityOfBirth' | 'country' | 'countryOfBirth' | 'countryOfCitizenship' | 'dateOfBirth' | 'day' | 'dbaName' | 'exemptPayeeCode' | 'exemptFatcaCode' | 'financialAccountIdentifier' | 'financialAccountName' | 'foreignAccountType' | 'foreignOtherClassification' | 'foreignTin' | 'foreignTinIsNotRequired' | 'foreignTrustClassification' | 'isEuResident' | 'isIndividual' | 'iAcknowlegeESignIsOk' | 'iAmACitizenOfTheUs' | 'iAmExemptFromFatcaReporting' | 'iAmNotSubjectToBackupWithholding' | 'iAuthorizeWithholdingAgent' | 'iCertifyToAll' | 'iConfirmIncomeIsNonUs' | 'iConfirmTheBeneficialOwnerIsExempt' | 'iConfirmTheInformationIsCorrectComplete' | 'iConfirmTheEntityIsNotAUsPerson' | 'iConfirmTheEntityIsTheBeneficialOwner' | 'iConfirmTheTaxIdIsCorrect' | 'iHaveLegalCapacityToSign' | 'mailingAddress' | 'mailingAddressIsDifferent' | 'month' | 'name' | 'nameOfEntity' | 'nameOfCCorporation' | 'nameOfCorporation' | 'nameOfIndividual' | 'nameOfLlc' | 'nameOfOrganization' | 'nameOfPartnership' | 'nameOfSCorporation' | 'nameOfSoleProprietor' | 'nameOfTrustEstate' | 'nameOfTrust' | 'province' | 'regardedOwnerUsPerson' | 'removeAdditional' | 'signature' | 'smllcElection' | 'state' | 'stateProvince' | 'street' | 'street2' | 'taxIdNumber' | 'taxIdNumberIsNotRequired' | 'tin' | 'usAccountType' | 'usLlcClassification' | 'usOtherClassification' | 'usPerson' | 'usEin' | 'usSsn' | 'usTin' | 'usTrustEstateEin' | 'vatIdentificationNumber' | 'vatIsNotRequired' | 'vatCountry' | 'year' | 'zip';
5
5
  export type SubPromptKey = 'smllcElection' | 'iConfirmIncomeIsNonUs' | 'isEuResident' | 'isIndividual' | 'financialAccountIdentifier' | 'financialAccountName' | 'vatIdentificationNumber' | 'placeOfBirth';
6
6
  export type TitleKey = 'accountHolder' | 'accountHolderClassification' | 'accountHolderContactInformation' | 'accountHolderTaxInformation' | 'accountHolderTaxClarification' | 'address' | 'confirmation' | 'exemptions' | 'mailingAddress' | 'primaryAddress' | 'placeOfBirth' | 'regardedOwner' | 'regardedOwnerClassification' | 'regardedOwnerContactInformation' | 'regardedOwnerTaxInformation' | 'signature' | 'summary' | 'taxResidences' | 'taxResidence1' | 'taxResidence2' | 'taxResidence3' | 'taxResidence4' | 'taxResidence5';
7
7
  export type SubTitleKey = 'taxResidences';
8
- export type TextKey = 'eSignActReference' | 'notRequired' | 'interviewIsComplete' | 'retrievingInterviewStatus';
8
+ export type TextKey = 'eSignActReference' | 'notRequired' | 'interviewIsComplete' | 'retrievingInterviewStatus' | 'taxDocumentationSaved';
9
9
  export type HintKey = 'dateOfBirth';
@@ -1,4 +1,5 @@
1
1
  export declare const expectRowError: (prompt: string) => void;
2
+ export declare const expectRowErrorText: (prompt: string, text: string) => void;
2
3
  export declare const expectNoRowError: (prompt: string) => void;
3
4
  export declare const expectText: (text: string, length?: number) => void;
4
5
  export declare const expectNullInput: (ariaLabel: string) => void;
@@ -6,8 +7,10 @@ export declare const expectInputValue: (ariaLabel: string, value: string) => voi
6
7
  export declare const clickLabel: (ariaLabel: string) => void;
7
8
  export declare const changeInput: (ariaLabel: string, value: string) => void;
8
9
  export declare const clickInput: (ariaLabel: string) => void;
10
+ export declare const clickEdit: (ariaLabel: string) => void;
9
11
  export declare const clickBack: () => void;
10
12
  export declare const clickNext: () => void;
13
+ export declare const clickSubmit: () => void;
11
14
  export declare const clickAddAdditionalResidence: () => void;
12
15
  export declare const setBusinessNameAndAddress: () => void;
13
16
  export declare const setIndividualNameAndAddress: () => void;
@@ -5,6 +5,8 @@ type ActionsProps = {
5
5
  onNext?: (data: unknown) => void;
6
6
  onReset?: (data: unknown) => void;
7
7
  onSubmit?: (data: unknown) => void;
8
+ disabled?: boolean;
9
+ info?: string;
8
10
  };
9
- export declare const Actions: ({ onBack, onCancel, onNext, onSubmit, onReset, }: ActionsProps) => React.JSX.Element;
11
+ export declare const Actions: ({ onBack, onCancel, onNext, onSubmit, onReset, disabled, info, }: ActionsProps) => React.JSX.Element;
10
12
  export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { TaxDocumentationKey } from 'types/TaxDocumentation';
3
+ export type InputValueProps = {
4
+ name: TaxDocumentationKey;
5
+ value?: string;
6
+ };
7
+ export declare const InputValue: ({ name, value }: InputValueProps) => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './InputValue';
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
- export declare const MaskedContent: ({ text }: {
3
- text: string | undefined;
2
+ import { TaxDocumentationKey } from '../../types';
3
+ export declare const MaskedContent: ({ name }: {
4
+ name: TaxDocumentationKey;
4
5
  }) => React.JSX.Element;
@@ -9,5 +9,5 @@ export type RadioButtonsProps = {
9
9
  name: TaxDocumentationKey;
10
10
  options: ReadonlyArray<SelectOption>;
11
11
  };
12
- export declare const RadioButtons: ({ name, options }: RadioButtonsProps) => React.JSX.Element;
12
+ export declare const RadioButtons: <T extends OptionKey>({ name, options, }: RadioButtonsProps) => React.JSX.Element;
13
13
  export {};
@@ -1,24 +1,14 @@
1
1
  import { OptionKey } from 'i18n/types';
2
- import { FatcaCode, PayeeCode } from 'lookups';
3
2
  import React from 'react';
4
- import type { CaProvinceCode } from 'types/CaProvinceCode';
5
- import type { CountryCode } from 'types/CountryCode';
6
3
  import { TaxDocumentationKey } from 'types/TaxDocumentation';
7
- import type { UsStateCode } from 'types/UsStateCode';
8
- type FatcaSelectOption = {
9
- value: FatcaCode;
10
- };
11
- type PayeeSelectOption = {
12
- value: PayeeCode;
13
- };
14
- type SpecialSelectOption = {
15
- value: CountryCode | UsStateCode | CaProvinceCode;
16
- label: string;
4
+ type ValueOption = {
5
+ value: string;
6
+ label?: string;
17
7
  };
18
8
  export type SelectProps = {
19
9
  prompt?: string;
20
10
  name: TaxDocumentationKey;
21
- options: ReadonlyArray<FatcaSelectOption> | ReadonlyArray<PayeeSelectOption> | ReadonlyArray<SpecialSelectOption>;
11
+ options: ReadonlyArray<ValueOption>;
22
12
  addBlank?: boolean;
23
13
  className?: string;
24
14
  onChange?: () => void;
@@ -7,6 +7,6 @@ export type TextInputProps = {
7
7
  hint?: true;
8
8
  disabled?: boolean;
9
9
  children?: React.ReactNode;
10
- syncName?: TaxDocumentationKey;
10
+ defaultValue?: string;
11
11
  };
12
- export declare const TextInput: ({ name, className, onChange, hint, children, disabled, syncName, }: TextInputProps) => React.JSX.Element;
12
+ export declare const TextInput: ({ name, className, onChange, hint, children, disabled, defaultValue, }: TextInputProps) => React.JSX.Element;
@@ -1,10 +1,12 @@
1
- export * from "./Actions";
2
- export * from "./ActionButton";
3
- export * from "./CheckBox";
4
- export * from "./DateOfBirthInput";
5
- export * from "./RadioButtons";
6
- export * from "./Select";
7
- export * from "./TextInput";
8
- export * from "./ToggleButton";
9
- export * from "./HideShowButton";
10
- export * from "./MaskedInput";
1
+ export * from './ActionButton';
2
+ export * from './Actions';
3
+ export * from './CheckBox';
4
+ export * from './DateOfBirthInput';
5
+ export * from './HideShowButton';
6
+ export * from './InputValue';
7
+ export * from './MaskedContent';
8
+ export * from './MaskedInput';
9
+ export * from './RadioButtons';
10
+ export * from './Select';
11
+ export * from './TextInput';
12
+ export * from './ToggleButton';
@@ -1,2 +1,2 @@
1
- export declare const isBlank: (value: string | undefined) => value is undefined;
1
+ export declare const isBlank: (val: unknown) => boolean;
2
2
  export declare const isPresent: (value: string | undefined) => value is string;
@@ -0,0 +1,5 @@
1
+ export declare const byOptionalLabel: (a: {
2
+ label?: string;
3
+ }, b: {
4
+ label?: string;
5
+ }) => number;
@@ -0,0 +1 @@
1
+ export * from './byOptionalLabel';
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { TaxBitFormProps } from './TaxBitForm';
3
3
  export type TaxBitDAC7FormProps = Omit<TaxBitFormProps, 'taxForms'>;
4
- export declare const TaxBitDAC7Form: ({ data, staging, bearerToken, language, onSubmit, onProgress, onSuccess, }: TaxBitDAC7FormProps) => React.JSX.Element;
4
+ export declare const TaxBitDAC7Form: ({ data, staging, bearerToken, language, onSubmit, onProgress, onSuccess, onError, onSettled, }: TaxBitDAC7FormProps) => React.JSX.Element;
@@ -1,14 +1,21 @@
1
1
  import React from 'react';
2
2
  import { Locale, Progress, TaxForm } from 'types';
3
3
  import { ClientTaxDocumentation } from 'types/client';
4
+ type TaxBitResponseError = {
5
+ message: string;
6
+ response: Response;
7
+ };
4
8
  export type TaxBitFormProps = {
5
9
  data?: ClientTaxDocumentation;
6
10
  staging?: true;
7
11
  bearerToken: string;
8
12
  language?: Locale;
9
13
  taxForms?: TaxForm[];
10
- onProgress?: (progress: Progress) => void;
11
- onSubmit?: (data?: ClientTaxDocumentation) => void;
12
- onSuccess?: (data?: ClientTaxDocumentation) => void;
14
+ onProgress?: (progress: Progress) => void | Promise<void>;
15
+ onSubmit?: (data?: ClientTaxDocumentation) => void | Promise<void>;
16
+ onSuccess?: (data?: ClientTaxDocumentation) => void | Promise<void>;
17
+ onSettled?: (data?: ClientTaxDocumentation) => void | Promise<void>;
18
+ onError?: (error?: TaxBitResponseError) => void | Promise<void>;
13
19
  };
14
- export declare const TaxBitForm: ({ staging, data, bearerToken, language, taxForms, onProgress, onSubmit, onSuccess, }: TaxBitFormProps) => React.JSX.Element;
20
+ export declare const TaxBitForm: ({ staging, data, bearerToken, language, taxForms, onProgress, onSubmit, onSettled, onSuccess, onError, }: TaxBitFormProps) => React.JSX.Element;
21
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { ClientTaxDocumentation, ExternalValidations } from 'types/client';
2
2
  import { TaxBitFormProps } from './TaxBitForm';
3
- type UseTaxBitFormProps = Exclude<TaxBitFormProps, 'language'>;
4
- export declare const useTaxBitForm: ({ bearerToken, data, onSubmit, onSuccess, staging, }: UseTaxBitFormProps) => {
3
+ type UseTaxBitFormProps = Omit<TaxBitFormProps, 'language'>;
4
+ export declare const useTaxBitForm: ({ bearerToken, data, onSubmit, onSuccess, onSettled, onError, staging, }: UseTaxBitFormProps) => {
5
5
  handleOnSubmit: (data: ClientTaxDocumentation) => Promise<void>;
6
6
  externalValidations: ExternalValidations;
7
7
  formData: ClientTaxDocumentation;
@@ -1,2 +1,2 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export declare const LanguageSelector: () => React.JSX.Element;
@@ -1,12 +1,10 @@
1
- import React from "react";
2
- import { TextInputProps } from "ui";
3
- import { TaxDocumentationKey } from "types";
1
+ import React from 'react';
2
+ import { TextInputProps } from 'ui';
4
3
  type TextInputRowProps = {
5
4
  label?: true;
6
5
  subLabel?: true;
7
6
  hint?: true;
8
7
  onChange?: (val: string) => string;
9
- syncName?: TaxDocumentationKey;
10
8
  };
11
- export declare const TextInputRow: ({ name, label, hint, subLabel, onChange, disabled, syncName, }: TextInputProps & TextInputRowProps) => React.JSX.Element;
9
+ export declare const TextInputRow: ({ name, label, hint, subLabel, onChange, disabled, defaultValue, }: TextInputProps & TextInputRowProps) => React.JSX.Element;
12
10
  export {};
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const AppError: ({ message }: {
3
+ message: string;
4
+ }) => React.JSX.Element;