@taxbit/react-sdk 0.0.14 → 0.0.16
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.
- package/README.md +88 -10
- package/dist/basic.css +21 -2
- package/dist/components/Notification/Notification.d.ts +5 -0
- package/dist/components/Notification/index.d.ts +1 -0
- package/dist/components/Section/Section.d.ts +2 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/contexts/FormUI/useFormUI.d.ts +9 -2
- package/dist/contexts/FormUI/useFormUIContext.d.ts +22 -2
- package/dist/contexts/TaxDocumentation/TaxBitFormProvider.d.ts +2 -1
- package/dist/contexts/TaxDocumentation/useTaxDocumentation.d.ts +5 -4
- package/dist/contexts/TaxDocumentation/useTaxDocumentationContext.d.ts +110 -6
- package/dist/entry/index.d.ts +1 -0
- package/dist/i18n/i18n.d.ts +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/locales/index.d.ts +1 -0
- package/dist/i18n/locales/pt-pt.d.ts +2 -0
- package/dist/i18n/types/Locale.d.ts +1 -1
- package/dist/i18n/types/LocalizationKey.d.ts +7 -5
- package/dist/i18n/types/PropertyFile.d.ts +11 -1
- package/dist/i18n/utils/getText.d.ts +5 -2
- package/dist/inline.css +21 -3
- package/dist/lookups/dayOptions.d.ts +3 -0
- package/dist/lookups/foreignAccountHolderAccountTypeOptions.d.ts +2 -0
- package/dist/lookups/foreignOtherClassificationOptions.d.ts +17 -0
- package/dist/lookups/foreignTrustClassificationOptions.d.ts +9 -0
- package/dist/lookups/index.d.ts +5 -2
- package/dist/lookups/monthOptions.d.ts +4 -0
- package/dist/lookups/usAccountHolderAccountTypeOptions.d.ts +2 -0
- package/dist/lookups/usLlcAccountTypeOptions.d.ts +2 -0
- package/dist/lookups/yearOptions.d.ts +4 -0
- package/dist/minimal.css +3 -0
- package/dist/paths/FinancialAccountInput/FinancialAccountInput.d.ts +1 -5
- package/dist/paths/ResidenceInput/ResidenceInput.d.ts +5 -2
- package/dist/paths/RowInput/CheckBoxRow/CheckBoxRow.d.ts +1 -1
- package/dist/paths/RowInput/DateOfBirthRow/DateOfBirthRow.d.ts +10 -0
- package/dist/paths/RowInput/DateOfBirthRow/index.d.ts +1 -0
- package/dist/paths/RowInput/TextInputRow/TextInputRow.d.ts +1 -1
- package/dist/paths/RowInput/VisibleRow/VisibleRow.d.ts +2 -1
- package/dist/paths/TaxBitFormUI/TaxBitDAC7FormUI.d.ts +2 -1
- package/dist/paths/TaxBitFormUI/TaxBitFormUI.d.ts +2 -1
- package/dist/taxbit-react-sdk.es.js +7665 -6509
- package/dist/taxbit-react-sdk.umd.js +10 -10
- package/dist/types/AccountType.d.ts +3 -3
- package/dist/types/MonthCode.d.ts +1 -0
- package/dist/types/TaxDocumentation.d.ts +2 -0
- package/dist/types/external/ComprehensiveTaxDocumentation.d.ts +69 -63
- package/dist/types/index.d.ts +1 -0
- package/dist/ui/ActionButton/ActionButton.d.ts +7 -0
- package/dist/ui/ActionButton/index.d.ts +1 -0
- package/dist/ui/CheckBox/CheckBox.d.ts +2 -1
- package/dist/ui/DateOfBirthInput/DateOfBirthInput.d.ts +9 -0
- package/dist/ui/DateOfBirthInput/index.d.ts +1 -0
- package/dist/ui/TextInput/TextInput.d.ts +3 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/utils/getForeignAccountType.d.ts +2 -0
- package/dist/utils/getForeignOtherClassification.d.ts +2 -0
- package/dist/utils/getForeignTrustClassification.d.ts +2 -0
- package/dist/utils/getHintKeyMap.d.ts +2 -0
- package/dist/utils/getLLCClassification.d.ts +2 -0
- package/dist/utils/getNotifications.d.ts +10 -0
- package/dist/utils/getPromptKeyMap.d.ts +2 -0
- package/dist/utils/getUsAccountType.d.ts +2 -0
- package/dist/utils/index.d.ts +6 -1
- package/dist/utils/isBlank.d.ts +2 -2
- package/dist/utils/transformInbound.d.ts +2 -1
- package/dist/utils/transformOutbound.d.ts +2 -2
- package/dist/widgets/TaxBitForm/TaxBitDAC7Form.d.ts +2 -2
- package/dist/widgets/TaxBitForm/TaxBitForm.d.ts +3 -2
- package/package.json +3 -2
- package/dist/lookups/foreignOtherAccountTypeOptions.d.ts +0 -15
- package/dist/lookups/foreignTrustAccountTypeOptions.d.ts +0 -7
- package/dist/validations/__tests__/validations.test.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,20 +1,98 @@
|
|
|
1
|
-
# TaxBit
|
|
1
|
+
# TaxBit React SDK
|
|
2
2
|
|
|
3
|
-
A React app, widget, and component for gathering Tax Documentation data.
|
|
3
|
+
A React app, widget, and component for gathering Tax Documentation data for US and EU Tax forms.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```bash
|
|
8
|
+
npm install @taxbit/react-sdk
|
|
9
|
+
```
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
```typescript
|
|
12
|
+
import '@taxbit/react-sdk/style/inline.css'; // other options include 'basic.css' and 'minimal.css'
|
|
13
|
+
import { TaxBitDAC7Form } from '@taxbit/react-sdk';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Data
|
|
17
|
+
```typescript
|
|
18
|
+
exampleData = {
|
|
19
|
+
name: "John Smith",
|
|
20
|
+
tin: "456456456",
|
|
21
|
+
ftin: "667788991",
|
|
22
|
+
usAccountType: "individual",
|
|
23
|
+
foreignAccountType: "individual",
|
|
24
|
+
address: {
|
|
25
|
+
firstLine: "123 Main St",
|
|
26
|
+
city: "Seattle",
|
|
27
|
+
stateOrProvince: "WA",
|
|
28
|
+
postalCode: "98000",
|
|
29
|
+
country: "GR",
|
|
30
|
+
},
|
|
31
|
+
mailingAddress: {
|
|
32
|
+
firstLine: "123 Main St",
|
|
33
|
+
city: "Seattle",
|
|
34
|
+
stateOrProvince: "WA",
|
|
35
|
+
postalCode: "98000",
|
|
36
|
+
country: "GR",
|
|
37
|
+
},
|
|
38
|
+
mailingAddressIsDifferent: true,
|
|
39
|
+
countryOfCitizenship: "GR",
|
|
40
|
+
ftinNotLegallyRequired: true,
|
|
41
|
+
taxResidences: [
|
|
42
|
+
{
|
|
43
|
+
country: "GR",
|
|
44
|
+
tin: "456456456",
|
|
45
|
+
tinNotRequired: false,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
vatin: "123123123",
|
|
49
|
+
vatinCountry: "GR",
|
|
50
|
+
vatinNotRequired: true,
|
|
51
|
+
financialAccountIdentifier: "123123123",
|
|
52
|
+
financialAccountName: "John Smith",
|
|
53
|
+
isIndividual: true,
|
|
54
|
+
isEuResident: true,
|
|
55
|
+
isUsPerson: false,
|
|
56
|
+
};
|
|
57
|
+
```
|
|
10
58
|
|
|
11
59
|
```jsx
|
|
12
|
-
<
|
|
60
|
+
<TaxBitDAC7Form
|
|
61
|
+
data={exampleData} // `data` is an optional prop
|
|
62
|
+
bearerToken='bearer token goes here'
|
|
63
|
+
language='en-us' // 'en-us' is the default
|
|
64
|
+
staging // if not production
|
|
65
|
+
/>
|
|
13
66
|
```
|
|
14
67
|
|
|
15
|
-
|
|
68
|
+
Which is just a shortcut for this component...
|
|
69
|
+
```jsx
|
|
70
|
+
<TaxBitForm
|
|
71
|
+
data={exampleData} // `data` is an optional prop
|
|
72
|
+
bearerToken='bearer token goes here'
|
|
73
|
+
language='en-us' // 'en-us' is the default
|
|
74
|
+
forms={['DAC7']}
|
|
75
|
+
staging // if not production
|
|
76
|
+
/>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Bearer Token
|
|
80
|
+
This will be generated from the TaxBit API and passed in as a prop to the component.
|
|
81
|
+
|
|
82
|
+
### Language
|
|
83
|
+
This can be set to any of the following:
|
|
84
|
+
- en-us
|
|
85
|
+
- es-es
|
|
86
|
+
- fr-fr
|
|
87
|
+
- de-de
|
|
88
|
+
- it-it
|
|
89
|
+
- nl-nl
|
|
90
|
+
- no-no
|
|
91
|
+
- sv-se
|
|
92
|
+
- en-gb
|
|
93
|
+
- pt-pt
|
|
94
|
+
|
|
95
|
+
### Staging
|
|
96
|
+
This can be set to `true` or `false`. Passing `staging` in the component is the same as passing `staging={true}`.
|
|
16
97
|
|
|
17
|
-
|
|
18
|
-
- Config for self-cert and w forms
|
|
19
|
-
- Style selection
|
|
20
|
-
-
|
|
98
|
+
If `true`, the staging environment will be used. If `false`, the production environment will be used. The default is `false`.
|
package/dist/basic.css
CHANGED
|
@@ -50,6 +50,11 @@ button:focus-visible {
|
|
|
50
50
|
margin-bottom: 8px;
|
|
51
51
|
opacity: .8;
|
|
52
52
|
}
|
|
53
|
+
.taxbit-section-sub-title {
|
|
54
|
+
font-size: .8em;
|
|
55
|
+
opacity: .7;
|
|
56
|
+
font-weight: 400;
|
|
57
|
+
}
|
|
53
58
|
}
|
|
54
59
|
|
|
55
60
|
.taxbit-row {
|
|
@@ -66,6 +71,10 @@ button:focus-visible {
|
|
|
66
71
|
color: red;
|
|
67
72
|
font-size: .8em;
|
|
68
73
|
}
|
|
74
|
+
.taxbit-notification {
|
|
75
|
+
color: blue;
|
|
76
|
+
font-size: .8em;
|
|
77
|
+
}
|
|
69
78
|
.taxbit-hint {
|
|
70
79
|
font-size: .8em;
|
|
71
80
|
opacity: .7;
|
|
@@ -75,16 +84,18 @@ button:focus-visible {
|
|
|
75
84
|
.taxbit-row-actions {
|
|
76
85
|
flex: 0 0 10%;
|
|
77
86
|
}
|
|
78
|
-
.taxbit-row-action-button
|
|
87
|
+
.taxbit-row-action-button {
|
|
79
88
|
font-size: .8em;
|
|
80
89
|
padding: 0.2em 1em;
|
|
90
|
+
flex: 0 0 auto;
|
|
81
91
|
}
|
|
82
92
|
|
|
83
93
|
.taxbit-label {
|
|
84
94
|
flex: 0 0 40%;
|
|
85
95
|
font-weight: 500;
|
|
96
|
+
line-height: 1.25em;
|
|
86
97
|
.taxbit-sub-label {
|
|
87
|
-
font-size: 0.
|
|
98
|
+
font-size: 0.8em;
|
|
88
99
|
opacity: 0.7;
|
|
89
100
|
font-weight: 400;
|
|
90
101
|
}
|
|
@@ -99,6 +110,10 @@ button:focus-visible {
|
|
|
99
110
|
color: rgb(18, 38, 63);
|
|
100
111
|
}
|
|
101
112
|
|
|
113
|
+
.taxbit-placeholder {
|
|
114
|
+
color: #aaa;
|
|
115
|
+
}
|
|
116
|
+
|
|
102
117
|
.taxbit-check-box {
|
|
103
118
|
margin: 5px;
|
|
104
119
|
}
|
|
@@ -118,6 +133,10 @@ button:focus-visible {
|
|
|
118
133
|
width: 100%;
|
|
119
134
|
}
|
|
120
135
|
|
|
136
|
+
.taxbit-input-status-footer {
|
|
137
|
+
margin-top: 5px
|
|
138
|
+
}
|
|
139
|
+
|
|
121
140
|
.taxbit-row-value {
|
|
122
141
|
display: flex;
|
|
123
142
|
flex: 1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Notification";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
type SectionProps = {
|
|
3
3
|
title?: string;
|
|
4
|
+
subTitle?: string;
|
|
4
5
|
showIf?: boolean;
|
|
5
6
|
children: React.ReactNode;
|
|
6
7
|
};
|
|
7
|
-
export declare const Section: ({ title, showIf, children }: SectionProps) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
8
|
+
export declare const Section: ({ title, subTitle, showIf, children, }: SectionProps) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
8
9
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ButtonKey, ErrorKey, TextKey, TitleKey } from "i18n/types";
|
|
1
|
+
import { ButtonKey, ErrorKey, NotificationKey, TextKey, TitleKey } from "i18n/types";
|
|
2
2
|
import { TaxDocumentation, TaxDocumentationKey } from "types/TaxDocumentation";
|
|
3
|
+
import { Notifications } from "../../utils/getNotifications";
|
|
3
4
|
export type FormUIFields = {
|
|
4
5
|
[key in TaxDocumentationKey]?: string | undefined;
|
|
5
6
|
};
|
|
@@ -13,6 +14,7 @@ export declare const useFormUI: () => {
|
|
|
13
14
|
fields: TaxDocumentation;
|
|
14
15
|
setValue: (key: TaxDocumentationKey, value: string | undefined) => void;
|
|
15
16
|
errors: FormUIErrors;
|
|
17
|
+
notifications: Notifications;
|
|
16
18
|
isErrorFree: boolean;
|
|
17
19
|
showErrors: boolean;
|
|
18
20
|
exposeErrors: () => void;
|
|
@@ -23,12 +25,15 @@ export declare const useFormUI: () => {
|
|
|
23
25
|
getLocalCountry: (key: string | undefined) => string;
|
|
24
26
|
getLocalError: (key: ErrorKey) => string;
|
|
25
27
|
getLocalHint: (key: TaxDocumentationKey) => string | undefined;
|
|
28
|
+
getLocalNotification: (key: NotificationKey) => string;
|
|
26
29
|
getLocalOption: (key: string | undefined) => string | undefined;
|
|
27
|
-
getLocalPrompt: (key:
|
|
30
|
+
getLocalPrompt: (key: string) => string;
|
|
28
31
|
getLocalSubPrompt: (key: TaxDocumentationKey) => string;
|
|
29
32
|
getLocalText: (key: TextKey) => string;
|
|
30
33
|
getLocalTitle: (key: TitleKey) => string;
|
|
34
|
+
getLocalSubTitle: (key: string) => string;
|
|
31
35
|
getLocalUsState: (key: string | undefined) => string;
|
|
36
|
+
getLocalMonth: (key: string | undefined) => string;
|
|
32
37
|
getRequiredLocalPrompt: (key: TaxDocumentationKey) => string;
|
|
33
38
|
visibleQuestions: {
|
|
34
39
|
exemptPayeeCode: boolean;
|
|
@@ -68,6 +73,7 @@ export declare const useFormUI: () => {
|
|
|
68
73
|
accountHolderName: boolean;
|
|
69
74
|
accountHolderFinancialAccountIdentifier: boolean;
|
|
70
75
|
accountHolderFinancialAccountName: boolean;
|
|
76
|
+
accountHolderFinancialAccountNameSameAsAccountHolderName: boolean;
|
|
71
77
|
accountHolderForeignTin: boolean;
|
|
72
78
|
accountHolderForeignTinIsNotRequired: boolean;
|
|
73
79
|
accountHolderTaxResidenceCountry1: boolean;
|
|
@@ -91,6 +97,7 @@ export declare const useFormUI: () => {
|
|
|
91
97
|
accountHolderShowTaxResidence5: boolean;
|
|
92
98
|
accountHolderUsTin: boolean;
|
|
93
99
|
accountHolderVatIdentificationNumber: boolean;
|
|
100
|
+
accountHolderVatIdentificationNumberIsNotRequired: boolean;
|
|
94
101
|
accountHolderVatCountry: boolean;
|
|
95
102
|
accountHolderIsIndividual: boolean;
|
|
96
103
|
accountHolderIsEuResident: boolean;
|
|
@@ -40,6 +40,7 @@ export declare const useFormUIContext: () => {
|
|
|
40
40
|
accountHolderName: import("../../i18n/types").ErrorKey;
|
|
41
41
|
accountHolderFinancialAccountIdentifier: import("../../i18n/types").ErrorKey;
|
|
42
42
|
accountHolderFinancialAccountName: import("../../i18n/types").ErrorKey;
|
|
43
|
+
accountHolderFinancialAccountNameSameAsAccountHolderName: import("../../i18n/types").ErrorKey;
|
|
43
44
|
accountHolderForeignTin: import("../../i18n/types").ErrorKey;
|
|
44
45
|
accountHolderForeignTinIsNotRequired: import("../../i18n/types").ErrorKey;
|
|
45
46
|
accountHolderTaxResidenceCountry1: import("../../i18n/types").ErrorKey;
|
|
@@ -63,6 +64,7 @@ export declare const useFormUIContext: () => {
|
|
|
63
64
|
accountHolderShowTaxResidence5: import("../../i18n/types").ErrorKey;
|
|
64
65
|
accountHolderUsTin: import("../../i18n/types").ErrorKey;
|
|
65
66
|
accountHolderVatIdentificationNumber: import("../../i18n/types").ErrorKey;
|
|
67
|
+
accountHolderVatIdentificationNumberIsNotRequired: import("../../i18n/types").ErrorKey;
|
|
66
68
|
accountHolderVatCountry: import("../../i18n/types").ErrorKey;
|
|
67
69
|
accountHolderIsIndividual: import("../../i18n/types").ErrorKey;
|
|
68
70
|
accountHolderIsEuResident: import("../../i18n/types").ErrorKey;
|
|
@@ -103,6 +105,7 @@ export declare const useFormUIContext: () => {
|
|
|
103
105
|
regardedOwnerForeignTinIsNotRequired: import("../../i18n/types").ErrorKey;
|
|
104
106
|
regardedOwnerUsTin: import("../../i18n/types").ErrorKey;
|
|
105
107
|
};
|
|
108
|
+
notifications: import("../../utils/getNotifications").Notifications;
|
|
106
109
|
isErrorFree: boolean;
|
|
107
110
|
showErrors: boolean;
|
|
108
111
|
exposeErrors: () => void;
|
|
@@ -145,6 +148,7 @@ export declare const useFormUIContext: () => {
|
|
|
145
148
|
accountHolderName?: boolean | undefined;
|
|
146
149
|
accountHolderFinancialAccountIdentifier?: boolean | undefined;
|
|
147
150
|
accountHolderFinancialAccountName?: boolean | undefined;
|
|
151
|
+
accountHolderFinancialAccountNameSameAsAccountHolderName?: boolean | undefined;
|
|
148
152
|
accountHolderForeignTin?: boolean | undefined;
|
|
149
153
|
accountHolderForeignTinIsNotRequired?: boolean | undefined;
|
|
150
154
|
accountHolderTaxResidenceCountry1?: boolean | undefined;
|
|
@@ -168,6 +172,7 @@ export declare const useFormUIContext: () => {
|
|
|
168
172
|
accountHolderShowTaxResidence5?: boolean | undefined;
|
|
169
173
|
accountHolderUsTin?: boolean | undefined;
|
|
170
174
|
accountHolderVatIdentificationNumber?: boolean | undefined;
|
|
175
|
+
accountHolderVatIdentificationNumberIsNotRequired?: boolean | undefined;
|
|
171
176
|
accountHolderVatCountry?: boolean | undefined;
|
|
172
177
|
accountHolderIsIndividual?: boolean | undefined;
|
|
173
178
|
accountHolderIsEuResident?: boolean | undefined;
|
|
@@ -213,12 +218,15 @@ export declare const useFormUIContext: () => {
|
|
|
213
218
|
getLocalCountry: (key: string | undefined) => string;
|
|
214
219
|
getLocalError: (key: import("../../i18n/types").ErrorKey) => string;
|
|
215
220
|
getLocalHint: (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) => string | undefined;
|
|
221
|
+
getLocalNotification: (key: "vatUnexpectedFormat") => string;
|
|
216
222
|
getLocalOption: (key: string | undefined) => string | undefined;
|
|
217
|
-
getLocalPrompt: (key:
|
|
223
|
+
getLocalPrompt: (key: string) => string;
|
|
218
224
|
getLocalSubPrompt: (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) => string;
|
|
219
225
|
getLocalText: (key: import("../../i18n/types").TextKey) => string;
|
|
220
226
|
getLocalTitle: (key: import("../../i18n/types").TitleKey) => string;
|
|
227
|
+
getLocalSubTitle: (key: string) => string;
|
|
221
228
|
getLocalUsState: (key: string | undefined) => string;
|
|
229
|
+
getLocalMonth: (key: string | undefined) => string;
|
|
222
230
|
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) => string;
|
|
223
231
|
visibleQuestions: {
|
|
224
232
|
exemptPayeeCode: boolean;
|
|
@@ -258,6 +266,7 @@ export declare const useFormUIContext: () => {
|
|
|
258
266
|
accountHolderName: boolean;
|
|
259
267
|
accountHolderFinancialAccountIdentifier: boolean;
|
|
260
268
|
accountHolderFinancialAccountName: boolean;
|
|
269
|
+
accountHolderFinancialAccountNameSameAsAccountHolderName: boolean;
|
|
261
270
|
accountHolderForeignTin: boolean;
|
|
262
271
|
accountHolderForeignTinIsNotRequired: boolean;
|
|
263
272
|
accountHolderTaxResidenceCountry1: boolean;
|
|
@@ -281,6 +290,7 @@ export declare const useFormUIContext: () => {
|
|
|
281
290
|
accountHolderShowTaxResidence5: boolean;
|
|
282
291
|
accountHolderUsTin: boolean;
|
|
283
292
|
accountHolderVatIdentificationNumber: boolean;
|
|
293
|
+
accountHolderVatIdentificationNumberIsNotRequired: boolean;
|
|
284
294
|
accountHolderVatCountry: boolean;
|
|
285
295
|
accountHolderIsIndividual: boolean;
|
|
286
296
|
accountHolderIsEuResident: boolean;
|
|
@@ -364,6 +374,7 @@ export declare const useFormUIContext: () => {
|
|
|
364
374
|
accountHolderName: import("../../i18n/types").ErrorKey;
|
|
365
375
|
accountHolderFinancialAccountIdentifier: import("../../i18n/types").ErrorKey;
|
|
366
376
|
accountHolderFinancialAccountName: import("../../i18n/types").ErrorKey;
|
|
377
|
+
accountHolderFinancialAccountNameSameAsAccountHolderName: import("../../i18n/types").ErrorKey;
|
|
367
378
|
accountHolderForeignTin: import("../../i18n/types").ErrorKey;
|
|
368
379
|
accountHolderForeignTinIsNotRequired: import("../../i18n/types").ErrorKey;
|
|
369
380
|
accountHolderTaxResidenceCountry1: import("../../i18n/types").ErrorKey;
|
|
@@ -387,6 +398,7 @@ export declare const useFormUIContext: () => {
|
|
|
387
398
|
accountHolderShowTaxResidence5: import("../../i18n/types").ErrorKey;
|
|
388
399
|
accountHolderUsTin: import("../../i18n/types").ErrorKey;
|
|
389
400
|
accountHolderVatIdentificationNumber: import("../../i18n/types").ErrorKey;
|
|
401
|
+
accountHolderVatIdentificationNumberIsNotRequired: import("../../i18n/types").ErrorKey;
|
|
390
402
|
accountHolderVatCountry: import("../../i18n/types").ErrorKey;
|
|
391
403
|
accountHolderIsIndividual: import("../../i18n/types").ErrorKey;
|
|
392
404
|
accountHolderIsEuResident: import("../../i18n/types").ErrorKey;
|
|
@@ -427,6 +439,7 @@ export declare const useFormUIContext: () => {
|
|
|
427
439
|
regardedOwnerForeignTinIsNotRequired: import("../../i18n/types").ErrorKey;
|
|
428
440
|
regardedOwnerUsTin: import("../../i18n/types").ErrorKey;
|
|
429
441
|
};
|
|
442
|
+
notifications: import("../../utils/getNotifications").Notifications;
|
|
430
443
|
isErrorFree: boolean;
|
|
431
444
|
showErrors: boolean;
|
|
432
445
|
exposeErrors: () => void;
|
|
@@ -469,6 +482,7 @@ export declare const useFormUIContext: () => {
|
|
|
469
482
|
accountHolderName?: boolean | undefined;
|
|
470
483
|
accountHolderFinancialAccountIdentifier?: boolean | undefined;
|
|
471
484
|
accountHolderFinancialAccountName?: boolean | undefined;
|
|
485
|
+
accountHolderFinancialAccountNameSameAsAccountHolderName?: boolean | undefined;
|
|
472
486
|
accountHolderForeignTin?: boolean | undefined;
|
|
473
487
|
accountHolderForeignTinIsNotRequired?: boolean | undefined;
|
|
474
488
|
accountHolderTaxResidenceCountry1?: boolean | undefined;
|
|
@@ -492,6 +506,7 @@ export declare const useFormUIContext: () => {
|
|
|
492
506
|
accountHolderShowTaxResidence5?: boolean | undefined;
|
|
493
507
|
accountHolderUsTin?: boolean | undefined;
|
|
494
508
|
accountHolderVatIdentificationNumber?: boolean | undefined;
|
|
509
|
+
accountHolderVatIdentificationNumberIsNotRequired?: boolean | undefined;
|
|
495
510
|
accountHolderVatCountry?: boolean | undefined;
|
|
496
511
|
accountHolderIsIndividual?: boolean | undefined;
|
|
497
512
|
accountHolderIsEuResident?: boolean | undefined;
|
|
@@ -537,12 +552,15 @@ export declare const useFormUIContext: () => {
|
|
|
537
552
|
getLocalCountry: (key: string | undefined) => string;
|
|
538
553
|
getLocalError: (key: import("../../i18n/types").ErrorKey) => string;
|
|
539
554
|
getLocalHint: (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) => string | undefined;
|
|
555
|
+
getLocalNotification: (key: "vatUnexpectedFormat") => string;
|
|
540
556
|
getLocalOption: (key: string | undefined) => string | undefined;
|
|
541
|
-
getLocalPrompt: (key:
|
|
557
|
+
getLocalPrompt: (key: string) => string;
|
|
542
558
|
getLocalSubPrompt: (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) => string;
|
|
543
559
|
getLocalText: (key: import("../../i18n/types").TextKey) => string;
|
|
544
560
|
getLocalTitle: (key: import("../../i18n/types").TitleKey) => string;
|
|
561
|
+
getLocalSubTitle: (key: string) => string;
|
|
545
562
|
getLocalUsState: (key: string | undefined) => string;
|
|
563
|
+
getLocalMonth: (key: string | undefined) => string;
|
|
546
564
|
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) => string;
|
|
547
565
|
visibleQuestions: {
|
|
548
566
|
exemptPayeeCode: boolean;
|
|
@@ -582,6 +600,7 @@ export declare const useFormUIContext: () => {
|
|
|
582
600
|
accountHolderName: boolean;
|
|
583
601
|
accountHolderFinancialAccountIdentifier: boolean;
|
|
584
602
|
accountHolderFinancialAccountName: boolean;
|
|
603
|
+
accountHolderFinancialAccountNameSameAsAccountHolderName: boolean;
|
|
585
604
|
accountHolderForeignTin: boolean;
|
|
586
605
|
accountHolderForeignTinIsNotRequired: boolean;
|
|
587
606
|
accountHolderTaxResidenceCountry1: boolean;
|
|
@@ -605,6 +624,7 @@ export declare const useFormUIContext: () => {
|
|
|
605
624
|
accountHolderShowTaxResidence5: boolean;
|
|
606
625
|
accountHolderUsTin: boolean;
|
|
607
626
|
accountHolderVatIdentificationNumber: boolean;
|
|
627
|
+
accountHolderVatIdentificationNumberIsNotRequired: boolean;
|
|
608
628
|
accountHolderVatCountry: boolean;
|
|
609
629
|
accountHolderIsIndividual: boolean;
|
|
610
630
|
accountHolderIsEuResident: boolean;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { Locale } from "../../i18n";
|
|
3
3
|
import type { TaxForm, TaxDocumentation } from "../../types";
|
|
4
|
+
import { ClientTaxDocumentation } from "../../types/external";
|
|
4
5
|
type TaxDocumentationProviderProps = {
|
|
5
|
-
data?:
|
|
6
|
+
data?: ClientTaxDocumentation;
|
|
6
7
|
onSubmit: (data: TaxDocumentation) => void;
|
|
7
8
|
language?: Locale;
|
|
8
9
|
children: React.ReactNode;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { TaxForm, TaxDocumentation } from "types";
|
|
3
3
|
import { Locale } from "i18n";
|
|
4
|
+
import { ClientTaxDocumentation } from "../../types/external";
|
|
4
5
|
type InputStep = "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
|
|
5
6
|
type UseTaxDocumentationProps = {
|
|
6
|
-
data:
|
|
7
|
+
data: ClientTaxDocumentation;
|
|
7
8
|
onSubmit: (transformedData: TaxDocumentation) => void;
|
|
8
9
|
language?: Locale;
|
|
9
10
|
taxForms?: TaxForm[];
|
|
@@ -17,7 +18,7 @@ export declare const useTaxDocumentation: ({ data: initialData, onSubmit, langua
|
|
|
17
18
|
onPersistAccountHolderData: (newData: TaxDocumentation) => void;
|
|
18
19
|
onPersistCollectedData: (newData: TaxDocumentation) => void;
|
|
19
20
|
onSubmitTaxDocumentation: (newData: TaxDocumentation) => void;
|
|
20
|
-
onResetTaxDocumentation: () => void;
|
|
21
|
+
onResetTaxDocumentation: (data: ClientTaxDocumentation) => void;
|
|
21
22
|
editTo: (form: InputStep) => void;
|
|
22
23
|
onCancel: (() => void) | undefined;
|
|
23
24
|
goTo: (form: InputStep) => void;
|
|
@@ -25,8 +26,8 @@ export declare const useTaxDocumentation: ({ data: initialData, onSubmit, langua
|
|
|
25
26
|
goToNext: (data: TaxDocumentation) => void;
|
|
26
27
|
stepName: InputStep;
|
|
27
28
|
data: TaxDocumentation;
|
|
28
|
-
setLanguage: import("react").Dispatch<import("react").SetStateAction<"en-us" | "de-de" | "en-gb" | "it-it" | "nl-nl" | "no-no" | "sv-se" | "fr-fr" | "es-es">>;
|
|
29
|
-
language: "en-us" | "de-de" | "en-gb" | "it-it" | "nl-nl" | "no-no" | "sv-se" | "fr-fr" | "es-es";
|
|
29
|
+
setLanguage: import("react").Dispatch<import("react").SetStateAction<"en-us" | "de-de" | "en-gb" | "it-it" | "nl-nl" | "no-no" | "sv-se" | "fr-fr" | "es-es" | "pt-pt">>;
|
|
30
|
+
language: "en-us" | "de-de" | "en-gb" | "it-it" | "nl-nl" | "no-no" | "sv-se" | "fr-fr" | "es-es" | "pt-pt";
|
|
30
31
|
supportedForms: TaxForm[];
|
|
31
32
|
setSupportedForms: import("react").Dispatch<import("react").SetStateAction<TaxForm[]>>;
|
|
32
33
|
};
|
|
@@ -8,7 +8,59 @@ export declare const useTaxDocumentationContext: () => {
|
|
|
8
8
|
onPersistAccountHolderData: (newData: import("../../types").TaxDocumentation) => void;
|
|
9
9
|
onPersistCollectedData: (newData: import("../../types").TaxDocumentation) => void;
|
|
10
10
|
onSubmitTaxDocumentation: (newData: import("../../types").TaxDocumentation) => void;
|
|
11
|
-
onResetTaxDocumentation: (
|
|
11
|
+
onResetTaxDocumentation: (data: {
|
|
12
|
+
address?: {
|
|
13
|
+
city?: string | undefined;
|
|
14
|
+
country?: string | undefined;
|
|
15
|
+
stateOrProvince?: string | undefined;
|
|
16
|
+
firstLine?: string | undefined;
|
|
17
|
+
secondLine?: string | undefined;
|
|
18
|
+
postalCode?: string | undefined;
|
|
19
|
+
} | undefined;
|
|
20
|
+
countryOfCitizenship?: string | undefined;
|
|
21
|
+
dateOfBirth?: string | undefined;
|
|
22
|
+
dbaName?: string | undefined;
|
|
23
|
+
mailingAddress?: {
|
|
24
|
+
city?: string | undefined;
|
|
25
|
+
country?: string | undefined;
|
|
26
|
+
stateOrProvince?: string | undefined;
|
|
27
|
+
firstLine?: string | undefined;
|
|
28
|
+
secondLine?: string | undefined;
|
|
29
|
+
postalCode?: string | undefined;
|
|
30
|
+
} | undefined;
|
|
31
|
+
mailingAddressIsDifferent?: boolean | undefined;
|
|
32
|
+
name?: string | undefined;
|
|
33
|
+
cityOfBirth?: string | undefined;
|
|
34
|
+
countryOfBirth?: string | undefined;
|
|
35
|
+
businessRegistrationNumber?: string | undefined;
|
|
36
|
+
financialAccountIdentifier?: string | undefined;
|
|
37
|
+
financialAccountName?: string | undefined;
|
|
38
|
+
ftin?: string | undefined;
|
|
39
|
+
ftinNotLegallyRequired?: boolean | undefined;
|
|
40
|
+
taxResidences?: {
|
|
41
|
+
country?: string | undefined;
|
|
42
|
+
tin?: string | undefined;
|
|
43
|
+
tinNotRequired?: boolean | undefined;
|
|
44
|
+
}[] | undefined;
|
|
45
|
+
showTaxResidence?: boolean[] | undefined;
|
|
46
|
+
tin?: string | undefined;
|
|
47
|
+
vatin?: string | undefined;
|
|
48
|
+
vatinCountry?: string | undefined;
|
|
49
|
+
vatinNotRequired?: boolean | undefined;
|
|
50
|
+
exemptFatcaCode?: string | undefined;
|
|
51
|
+
exemptPayeeCode?: string | undefined;
|
|
52
|
+
isIndividual?: boolean | undefined;
|
|
53
|
+
isEuResident?: boolean | undefined;
|
|
54
|
+
isUsPerson?: boolean | undefined;
|
|
55
|
+
usAccountType?: string | undefined;
|
|
56
|
+
usSmllcElection?: boolean | undefined;
|
|
57
|
+
usLlcClassification?: string | undefined;
|
|
58
|
+
usOtherClassification?: string | undefined;
|
|
59
|
+
usTrustEstateEin?: boolean | undefined;
|
|
60
|
+
foreignAccountType?: string | undefined;
|
|
61
|
+
foreignTrustClassification?: string | undefined;
|
|
62
|
+
foreignOtherClassification?: string | undefined;
|
|
63
|
+
}) => void;
|
|
12
64
|
editTo: (form: "Summary" | "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax") => void;
|
|
13
65
|
onCancel: (() => void) | undefined;
|
|
14
66
|
goTo: (form: "Summary" | "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax") => void;
|
|
@@ -16,8 +68,8 @@ export declare const useTaxDocumentationContext: () => {
|
|
|
16
68
|
goToNext: (data: import("../../types").TaxDocumentation) => void;
|
|
17
69
|
stepName: "Summary" | "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax";
|
|
18
70
|
data: import("../../types").TaxDocumentation;
|
|
19
|
-
setLanguage: import("react").Dispatch<import("react").SetStateAction<"en-us" | "de-de" | "en-gb" | "it-it" | "nl-nl" | "no-no" | "sv-se" | "fr-fr" | "es-es">>;
|
|
20
|
-
language: "en-us" | "de-de" | "en-gb" | "it-it" | "nl-nl" | "no-no" | "sv-se" | "fr-fr" | "es-es";
|
|
71
|
+
setLanguage: import("react").Dispatch<import("react").SetStateAction<"en-us" | "de-de" | "en-gb" | "it-it" | "nl-nl" | "no-no" | "sv-se" | "fr-fr" | "es-es" | "pt-pt">>;
|
|
72
|
+
language: "en-us" | "de-de" | "en-gb" | "it-it" | "nl-nl" | "no-no" | "sv-se" | "fr-fr" | "es-es" | "pt-pt";
|
|
21
73
|
supportedForms: import("../../types").TaxForm[];
|
|
22
74
|
setSupportedForms: import("react").Dispatch<import("react").SetStateAction<import("../../types").TaxForm[]>>;
|
|
23
75
|
}, TaxDocumentationContextProvider: import("react").Provider<{
|
|
@@ -29,7 +81,59 @@ export declare const useTaxDocumentationContext: () => {
|
|
|
29
81
|
onPersistAccountHolderData: (newData: import("../../types").TaxDocumentation) => void;
|
|
30
82
|
onPersistCollectedData: (newData: import("../../types").TaxDocumentation) => void;
|
|
31
83
|
onSubmitTaxDocumentation: (newData: import("../../types").TaxDocumentation) => void;
|
|
32
|
-
onResetTaxDocumentation: (
|
|
84
|
+
onResetTaxDocumentation: (data: {
|
|
85
|
+
address?: {
|
|
86
|
+
city?: string | undefined;
|
|
87
|
+
country?: string | undefined;
|
|
88
|
+
stateOrProvince?: string | undefined;
|
|
89
|
+
firstLine?: string | undefined;
|
|
90
|
+
secondLine?: string | undefined;
|
|
91
|
+
postalCode?: string | undefined;
|
|
92
|
+
} | undefined;
|
|
93
|
+
countryOfCitizenship?: string | undefined;
|
|
94
|
+
dateOfBirth?: string | undefined;
|
|
95
|
+
dbaName?: string | undefined;
|
|
96
|
+
mailingAddress?: {
|
|
97
|
+
city?: string | undefined;
|
|
98
|
+
country?: string | undefined;
|
|
99
|
+
stateOrProvince?: string | undefined;
|
|
100
|
+
firstLine?: string | undefined;
|
|
101
|
+
secondLine?: string | undefined;
|
|
102
|
+
postalCode?: string | undefined;
|
|
103
|
+
} | undefined;
|
|
104
|
+
mailingAddressIsDifferent?: boolean | undefined;
|
|
105
|
+
name?: string | undefined;
|
|
106
|
+
cityOfBirth?: string | undefined;
|
|
107
|
+
countryOfBirth?: string | undefined;
|
|
108
|
+
businessRegistrationNumber?: string | undefined;
|
|
109
|
+
financialAccountIdentifier?: string | undefined;
|
|
110
|
+
financialAccountName?: string | undefined;
|
|
111
|
+
ftin?: string | undefined;
|
|
112
|
+
ftinNotLegallyRequired?: boolean | undefined;
|
|
113
|
+
taxResidences?: {
|
|
114
|
+
country?: string | undefined;
|
|
115
|
+
tin?: string | undefined;
|
|
116
|
+
tinNotRequired?: boolean | undefined;
|
|
117
|
+
}[] | undefined;
|
|
118
|
+
showTaxResidence?: boolean[] | undefined;
|
|
119
|
+
tin?: string | undefined;
|
|
120
|
+
vatin?: string | undefined;
|
|
121
|
+
vatinCountry?: string | undefined;
|
|
122
|
+
vatinNotRequired?: boolean | undefined;
|
|
123
|
+
exemptFatcaCode?: string | undefined;
|
|
124
|
+
exemptPayeeCode?: string | undefined;
|
|
125
|
+
isIndividual?: boolean | undefined;
|
|
126
|
+
isEuResident?: boolean | undefined;
|
|
127
|
+
isUsPerson?: boolean | undefined;
|
|
128
|
+
usAccountType?: string | undefined;
|
|
129
|
+
usSmllcElection?: boolean | undefined;
|
|
130
|
+
usLlcClassification?: string | undefined;
|
|
131
|
+
usOtherClassification?: string | undefined;
|
|
132
|
+
usTrustEstateEin?: boolean | undefined;
|
|
133
|
+
foreignAccountType?: string | undefined;
|
|
134
|
+
foreignTrustClassification?: string | undefined;
|
|
135
|
+
foreignOtherClassification?: string | undefined;
|
|
136
|
+
}) => void;
|
|
33
137
|
editTo: (form: "Summary" | "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax") => void;
|
|
34
138
|
onCancel: (() => void) | undefined;
|
|
35
139
|
goTo: (form: "Summary" | "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax") => void;
|
|
@@ -37,8 +141,8 @@ export declare const useTaxDocumentationContext: () => {
|
|
|
37
141
|
goToNext: (data: import("../../types").TaxDocumentation) => void;
|
|
38
142
|
stepName: "Summary" | "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax";
|
|
39
143
|
data: import("../../types").TaxDocumentation;
|
|
40
|
-
setLanguage: import("react").Dispatch<import("react").SetStateAction<"en-us" | "de-de" | "en-gb" | "it-it" | "nl-nl" | "no-no" | "sv-se" | "fr-fr" | "es-es">>;
|
|
41
|
-
language: "en-us" | "de-de" | "en-gb" | "it-it" | "nl-nl" | "no-no" | "sv-se" | "fr-fr" | "es-es";
|
|
144
|
+
setLanguage: import("react").Dispatch<import("react").SetStateAction<"en-us" | "de-de" | "en-gb" | "it-it" | "nl-nl" | "no-no" | "sv-se" | "fr-fr" | "es-es" | "pt-pt">>;
|
|
145
|
+
language: "en-us" | "de-de" | "en-gb" | "it-it" | "nl-nl" | "no-no" | "sv-se" | "fr-fr" | "es-es" | "pt-pt";
|
|
42
146
|
supportedForms: import("../../types").TaxForm[];
|
|
43
147
|
setSupportedForms: import("react").Dispatch<import("react").SetStateAction<import("../../types").TaxForm[]>>;
|
|
44
148
|
} | undefined>;
|
package/dist/entry/index.d.ts
CHANGED
package/dist/i18n/i18n.d.ts
CHANGED
package/dist/i18n/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { getButtonText, getCaProvinceText, getCountryText, getErrorText, getHintText, getOptionText, getPromptText, getSubPromptText, getTitleText, getUsStateText, } from "./utils";
|
|
1
|
+
export { getButtonText, getCaProvinceText, getCountryText, getErrorText, getHintText, getMonthText, getNotificationText, getOptionText, getPromptText, getSubPromptText, getTitleText, getUsStateText, } from "./utils";
|
|
2
2
|
export type { Locale } from "./types/Locale";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type Locale = "en-us" | "de-de" | "en-gb" | "it-it" | "nl-nl" | "no-no" | "sv-se" | "fr-fr" | "es-es";
|
|
1
|
+
export type Locale = "en-us" | "de-de" | "en-gb" | "it-it" | "nl-nl" | "no-no" | "sv-se" | "fr-fr" | "es-es" | "pt-pt";
|