@taxbit/react-sdk 0.6.1 → 1.0.0-beta.0
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 -76
- package/dist/src/components/Address/Address.d.ts +1 -2
- package/dist/src/components/ErrorMessage/ErrorMessage.d.ts +1 -2
- package/dist/src/components/Form/Form.d.ts +2 -1
- package/dist/src/components/Form/index.d.ts +1 -1
- package/dist/src/contexts/QuestionnaireUI/QuestionnaireUIProvider.d.ts +6 -0
- package/dist/src/contexts/QuestionnaireUI/getLocal.d.ts +19 -0
- package/dist/src/contexts/{FormUI → QuestionnaireUI}/index.d.ts +3 -3
- package/dist/src/contexts/{FormUI/useFormUI.d.ts → QuestionnaireUI/useQuestionnaireUI.d.ts} +6 -6
- package/dist/src/contexts/{FormUI/useFormUIContext.d.ts → QuestionnaireUI/useQuestionnaireUIContext.d.ts} +18 -18
- package/dist/src/contexts/TaxDocumentation/TaxbitQuestionnaireProvider.d.ts +7 -0
- package/dist/src/contexts/TaxDocumentation/index.d.ts +1 -1
- package/dist/src/contexts/TaxDocumentation/useTaxDocumentation.d.ts +13 -15
- package/dist/src/contexts/TaxDocumentation/useTaxDocumentationContext.d.ts +24 -30
- package/dist/src/contexts/index.d.ts +2 -2
- package/dist/src/entry/TaxbitQuestionnaire/TaxbitQuestionnaire.d.ts +9 -0
- package/dist/src/entry/TaxbitQuestionnaire/index.d.ts +1 -0
- package/dist/src/entry/index.d.ts +4 -6
- package/dist/src/hooks/index.d.ts +1 -1
- package/dist/src/hooks/useTaxbit/__tests__/clientTaxDocumentation.d.ts +2 -0
- package/dist/src/hooks/{useTaxBit → useTaxbit}/__tests__/serverTaxDocumentation.d.ts +1 -1
- package/dist/src/hooks/useTaxbit/index.d.ts +1 -0
- package/dist/src/hooks/useTaxbit/useTaxbit.d.ts +9 -0
- package/dist/src/hooks/useTaxbit/useTaxbitConnect.d.ts +8 -0
- package/dist/src/hooks/useTaxbit/useTaxbitStatus.d.ts +8 -0
- package/dist/src/i18n/index.d.ts +1 -1
- package/dist/src/i18n/locales/bg.d.ts +1 -0
- package/dist/src/i18n/locales/cs.d.ts +1 -0
- package/dist/src/i18n/locales/da.d.ts +1 -0
- package/dist/src/i18n/locales/de-at.d.ts +1 -2
- package/dist/src/i18n/locales/de.d.ts +3 -0
- package/dist/src/i18n/locales/el-cy.d.ts +3 -2
- package/dist/src/i18n/locales/el.d.ts +3 -0
- package/dist/src/i18n/locales/{bg-bg.d.ts → en-nz.d.ts} +1 -1
- package/dist/src/i18n/locales/{cs-cz.d.ts → en.d.ts} +1 -1
- package/dist/src/i18n/locales/{da-dk.d.ts → es.d.ts} +1 -1
- package/dist/src/i18n/locales/et.d.ts +1 -0
- package/dist/src/i18n/locales/fi.d.ts +1 -0
- package/dist/src/i18n/locales/{de-de.d.ts → fr-ca.d.ts} +1 -1
- package/dist/src/i18n/locales/fr-lu.d.ts +1 -2
- package/dist/src/i18n/locales/fr.d.ts +2 -0
- package/dist/src/i18n/locales/ga.d.ts +2 -0
- package/dist/src/i18n/locales/hr.d.ts +1 -0
- package/dist/src/i18n/locales/hu.d.ts +1 -0
- package/dist/src/i18n/locales/index.d.ts +33 -30
- package/dist/src/i18n/locales/it.d.ts +1 -0
- package/dist/src/i18n/locales/lt.d.ts +3 -0
- package/dist/src/i18n/locales/lv.d.ts +1 -0
- package/dist/src/i18n/locales/mergePropertyFiles.d.ts +6 -0
- package/dist/src/i18n/locales/mt.d.ts +1 -0
- package/dist/src/i18n/locales/nl-be.d.ts +3 -2
- package/dist/src/i18n/locales/nl.d.ts +1 -0
- package/dist/src/i18n/locales/no.d.ts +1 -0
- package/dist/src/i18n/locales/pl.d.ts +3 -0
- package/dist/src/i18n/locales/pt.d.ts +1 -0
- package/dist/src/i18n/locales/ro.d.ts +1 -0
- package/dist/src/i18n/locales/sk.d.ts +1 -0
- package/dist/src/i18n/locales/sl.d.ts +1 -0
- package/dist/src/i18n/locales/sv.d.ts +1 -0
- package/dist/src/i18n/locales/translation-missing.d.ts +5 -0
- package/dist/src/i18n/localizationFileMap.d.ts +7 -0
- package/dist/src/i18n/types/LocalizationKey.d.ts +8 -8
- package/dist/src/i18n/types/PropertyFile.d.ts +23 -19
- package/dist/src/i18n/utils/getText.d.ts +2 -9
- package/dist/src/lookups/countryOptions.d.ts +1 -7
- package/dist/src/lookups/dayOptions.d.ts +1 -1
- package/dist/src/lookups/fatcaCodeOptions.d.ts +2 -2
- package/dist/src/lookups/foreignAccountHolderAccountTypeOptions.d.ts +3 -15
- package/dist/src/lookups/foreignOtherClassificationOptions.d.ts +3 -17
- package/dist/src/lookups/foreignRegardedOwnerAccountTypeOptions.d.ts +3 -11
- package/dist/src/lookups/foreignTrustClassificationOptions.d.ts +3 -9
- package/dist/src/lookups/index.d.ts +13 -16
- package/dist/src/lookups/localeOptions.d.ts +5 -1
- package/dist/src/lookups/payeeCodeOptions.d.ts +2 -2
- package/dist/src/lookups/toOptions.d.ts +1 -1
- package/dist/src/lookups/usAccountHolderAccountTypeOptions.d.ts +3 -23
- package/dist/src/lookups/usLlcAccountTypeOptions.d.ts +3 -9
- package/dist/src/lookups/usRegardedOwnerAccountTypeOptions.d.ts +3 -15
- package/dist/src/services/api.d.ts +7 -2
- package/dist/src/test/Wrapper.d.ts +3 -3
- package/dist/src/test/getWrapper.d.ts +3 -3
- package/dist/src/test/utils/helpers.d.ts +7 -2
- package/dist/src/types/InputStep.d.ts +2 -2
- package/dist/src/types/Locale.d.ts +1 -1
- package/dist/src/types/Questionnaire.d.ts +1 -0
- package/dist/src/types/StepId.d.ts +1 -1
- package/dist/src/types/TaxDocumentation.d.ts +30 -30
- package/dist/src/types/client/ClientTaxDocumentationStatus.d.ts +12 -3
- package/dist/src/types/client/index.d.ts +0 -1
- package/dist/src/types/index.d.ts +1 -6
- package/dist/src/types/server/TaxDocumentationStatus.d.ts +12 -3
- package/dist/src/types/server/index.d.ts +0 -1
- package/dist/src/ui/ActionButton/index.d.ts +1 -1
- package/dist/src/ui/CheckBox/CheckBox.d.ts +2 -1
- package/dist/src/ui/DateOfBirthInput/DateOfBirthInput.d.ts +1 -2
- package/dist/src/ui/DateOfBirthInput/index.d.ts +1 -1
- package/dist/src/ui/DateOfBirthInput/useDateOfBirthInput.d.ts +2 -2
- package/dist/src/ui/FormattedInput/FormattedInput.d.ts +11 -0
- package/dist/src/ui/FormattedInput/index.d.ts +1 -0
- package/dist/src/ui/PasswordInput/PasswordInput.d.ts +9 -0
- package/dist/src/ui/PasswordInput/index.d.ts +1 -0
- package/dist/src/ui/RadioButtons/index.d.ts +1 -1
- package/dist/src/ui/Select/index.d.ts +1 -1
- package/dist/src/ui/{MaskedInput/MaskedInput.d.ts → ShowHideInput/ShowHideInput.d.ts} +2 -3
- package/dist/src/ui/ShowHideInput/index.d.ts +1 -0
- package/dist/src/ui/TextInput/TextInput.d.ts +1 -2
- package/dist/src/ui/TextInput/index.d.ts +1 -1
- package/dist/src/ui/index.d.ts +3 -1
- package/dist/src/utils/formatUsTin.d.ts +5 -0
- package/dist/src/utils/getFieldsState.d.ts +16 -10
- package/dist/src/utils/getMaskedContent.d.ts +1 -0
- package/dist/src/utils/getPromptKeyMap.d.ts +22 -22
- package/dist/src/utils/index.d.ts +3 -2
- package/dist/src/utils/mergeClientTaxDocumentationData.d.ts +1 -1
- package/dist/src/utils/transformForClient/convertYesNoToBoolean.d.ts +1 -1
- package/dist/src/utils/transformForClient/convertYesNoToBooleanOrUndefined.d.ts +2 -0
- package/dist/src/utils/transformForClient/index.d.ts +1 -1
- package/dist/src/utils/transformForClient/transformForClient.d.ts +3 -2
- package/dist/src/utils/transformForClient/transformForClientAccoutHolder.d.ts +1 -53
- package/dist/src/utils/transformForClient/transformForClientRegardedOwner.d.ts +1 -36
- package/dist/src/utils/transformInbound/getForeignAccountType.d.ts +1 -1
- package/dist/src/utils/transformInbound/getForeignOtherClassification.d.ts +1 -1
- package/dist/src/utils/transformInbound/getForeignTrustClassification.d.ts +1 -1
- package/dist/src/utils/transformInbound/getLLCClassification.d.ts +1 -1
- package/dist/src/utils/transformInbound/getUsAccountType.d.ts +1 -1
- package/dist/src/utils/transformInbound/transformInbound.d.ts +3 -3
- package/dist/src/utils/uppercase.d.ts +1 -0
- package/dist/src/validations/getInvalidFields.d.ts +2 -2
- package/dist/src/validations/getRequiredFields.d.ts +2 -2
- package/dist/src/validations/getSupportedFields.d.ts +2 -2
- package/dist/src/validations/getVisibleFields.d.ts +2 -2
- package/dist/src/widgets/TaxbitQuestionnairePersist/TaxbitQuestionnairePersist.d.ts +5 -0
- package/dist/src/widgets/TaxbitQuestionnairePersist/index.d.ts +2 -0
- package/dist/src/widgets/TaxbitQuestionnairePersist/useTaxbitPersist.d.ts +25 -0
- package/dist/src/widgets/index.d.ts +1 -1
- package/dist/src/wizard/AddressInput/AddressInput.d.ts +2 -1
- package/dist/src/wizard/LanguageSelector/LanguageSelector.d.ts +4 -1
- package/dist/src/wizard/ResidenceInput/ResidenceInput.d.ts +1 -2
- package/dist/src/wizard/RowInput/AddressRow/AddressRow.d.ts +2 -1
- package/dist/src/wizard/RowInput/CheckBoxRow/CheckBoxRow.d.ts +4 -3
- package/dist/src/wizard/RowInput/DateOfBirthRow/index.d.ts +1 -1
- package/dist/src/wizard/RowInput/ErrorRow/index.d.ts +1 -1
- package/dist/src/wizard/RowInput/RadioButtonRow/RadioButtonRow.d.ts +2 -2
- package/dist/src/wizard/RowInput/ShowHideInputRow/ShowHideInputRow.d.ts +11 -0
- package/dist/src/wizard/RowInput/ShowHideInputRow/index.d.ts +1 -0
- package/dist/src/wizard/RowInput/TextInputRow/TextInputRow.d.ts +3 -4
- package/dist/src/wizard/RowInput/index.d.ts +1 -1
- package/dist/src/wizard/TaxbitQuestionnaireUI/AccountHolderClassification/index.d.ts +1 -0
- package/dist/src/wizard/TaxbitQuestionnaireUI/AccountHolderContact/index.d.ts +1 -0
- package/dist/src/wizard/TaxbitQuestionnaireUI/AccountHolderTax/index.d.ts +1 -0
- package/dist/src/wizard/TaxbitQuestionnaireUI/AccountHolderTaxClarification/index.d.ts +1 -0
- package/dist/src/wizard/TaxbitQuestionnaireUI/AppError/index.d.ts +1 -0
- package/dist/src/wizard/TaxbitQuestionnaireUI/Exemptions/index.d.ts +1 -0
- package/dist/src/wizard/TaxbitQuestionnaireUI/RegardedOwnerContact/index.d.ts +1 -0
- package/dist/src/wizard/TaxbitQuestionnaireUI/RegardedOwnerTax/index.d.ts +1 -0
- package/dist/src/wizard/TaxbitQuestionnaireUI/Summary/index.d.ts +1 -0
- package/dist/src/wizard/TaxbitQuestionnaireUI/TaxbitQuestionnaireUI.d.ts +6 -0
- package/dist/src/wizard/TaxbitQuestionnaireUI/index.d.ts +1 -0
- package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/steps.d.ts +0 -1
- package/dist/src/wizard/index.d.ts +1 -1
- package/dist/taxbit-react-sdk.js +5799 -16652
- package/dist/taxbit-react-sdk.umd.cjs +10 -10
- package/package.json +13 -19
- package/style/basic.css +32 -13
- package/style/inline.css +32 -13
- package/dist/src/contexts/FormUI/FormUIProvider.d.ts +0 -6
- package/dist/src/contexts/FormUI/getLocal.d.ts +0 -20
- package/dist/src/contexts/TaxDocumentation/TaxBitFormProvider.d.ts +0 -7
- package/dist/src/hooks/useTaxBit/__tests__/clientTaxDocumentation.d.ts +0 -2
- package/dist/src/hooks/useTaxBit/index.d.ts +0 -1
- package/dist/src/hooks/useTaxBit/useTaxBit.d.ts +0 -7
- package/dist/src/i18n/i18n.d.ts +0 -7
- package/dist/src/i18n/locales/el-gr.d.ts +0 -2
- package/dist/src/i18n/locales/es-es.d.ts +0 -2
- package/dist/src/i18n/locales/et-ee.d.ts +0 -2
- package/dist/src/i18n/locales/fi-fi.d.ts +0 -2
- package/dist/src/i18n/locales/fr-fr.d.ts +0 -2
- package/dist/src/i18n/locales/ga-ie.d.ts +0 -2
- package/dist/src/i18n/locales/hr-hr.d.ts +0 -2
- package/dist/src/i18n/locales/hu-hu.d.ts +0 -2
- package/dist/src/i18n/locales/it-it.d.ts +0 -2
- package/dist/src/i18n/locales/lt-lt.d.ts +0 -2
- package/dist/src/i18n/locales/lv-lv.d.ts +0 -2
- package/dist/src/i18n/locales/mt-mt.d.ts +0 -2
- package/dist/src/i18n/locales/nl-nl.d.ts +0 -2
- package/dist/src/i18n/locales/no-no.d.ts +0 -2
- package/dist/src/i18n/locales/pl-pl.d.ts +0 -2
- package/dist/src/i18n/locales/pt-pt.d.ts +0 -2
- package/dist/src/i18n/locales/ro-ro.d.ts +0 -2
- package/dist/src/i18n/locales/sk-sk.d.ts +0 -2
- package/dist/src/i18n/locales/sl-si.d.ts +0 -2
- package/dist/src/i18n/locales/sv-se.d.ts +0 -2
- package/dist/src/lookups/caProvinceOptions.d.ts +0 -4
- package/dist/src/lookups/monthOptions.d.ts +0 -4
- package/dist/src/lookups/usStateOptions.d.ts +0 -4
- package/dist/src/types/AccountType.d.ts +0 -6
- package/dist/src/types/CaProvinceCode.d.ts +0 -1
- package/dist/src/types/CountryCode.d.ts +0 -3
- package/dist/src/types/MonthCode.d.ts +0 -1
- package/dist/src/types/TaxForm.d.ts +0 -1
- package/dist/src/types/UsStateCode.d.ts +0 -1
- package/dist/src/types/client/ClientTaxDocumentation.d.ts +0 -84
- package/dist/src/types/server/ComprehensiveTaxDocumentation.d.ts +0 -84
- package/dist/src/ui/MaskedInput/index.d.ts +0 -1
- package/dist/src/ui/Password/Password.d.ts +0 -12
- package/dist/src/ui/Password/index.d.ts +0 -1
- package/dist/src/utils/date.d.ts +0 -4
- package/dist/src/utils/getHintKeyMap.d.ts +0 -113
- package/dist/src/utils/getVerboseDate.d.ts +0 -1
- package/dist/src/widgets/TaxBitForm/TaxBitDAC7Form.d.ts +0 -4
- package/dist/src/widgets/TaxBitForm/TaxBitForm.d.ts +0 -5
- package/dist/src/widgets/TaxBitForm/index.d.ts +0 -2
- package/dist/src/widgets/TaxBitForm/useTaxBitForm.d.ts +0 -22
- package/dist/src/wizard/PlaceOfBirthInput/PlaceOfBirthInput.d.ts +0 -2
- package/dist/src/wizard/PlaceOfBirthInput/index.d.ts +0 -1
- package/dist/src/wizard/RowInput/MaskedInputRow/MaskedInputRow.d.ts +0 -11
- package/dist/src/wizard/RowInput/MaskedInputRow/index.d.ts +0 -1
- package/dist/src/wizard/TaxBitFormUI/AccountHolderClassification/index.d.ts +0 -1
- package/dist/src/wizard/TaxBitFormUI/AccountHolderContact/index.d.ts +0 -1
- package/dist/src/wizard/TaxBitFormUI/AccountHolderTax/index.d.ts +0 -1
- package/dist/src/wizard/TaxBitFormUI/AccountHolderTaxClarification/index.d.ts +0 -1
- package/dist/src/wizard/TaxBitFormUI/AppError/index.d.ts +0 -1
- package/dist/src/wizard/TaxBitFormUI/Exemptions/index.d.ts +0 -1
- package/dist/src/wizard/TaxBitFormUI/RegardedOwnerClassification/RegardedOwnerClassification.d.ts +0 -2
- package/dist/src/wizard/TaxBitFormUI/RegardedOwnerClassification/index.d.ts +0 -1
- package/dist/src/wizard/TaxBitFormUI/RegardedOwnerContact/index.d.ts +0 -1
- package/dist/src/wizard/TaxBitFormUI/RegardedOwnerTax/index.d.ts +0 -1
- package/dist/src/wizard/TaxBitFormUI/Summary/index.d.ts +0 -1
- package/dist/src/wizard/TaxBitFormUI/TaxBitDAC7FormUI.d.ts +0 -4
- package/dist/src/wizard/TaxBitFormUI/TaxBitFormUI.d.ts +0 -6
- package/dist/src/wizard/TaxBitFormUI/index.d.ts +0 -2
- /package/dist/src/contexts/{FormUI → QuestionnaireUI}/shiftResidence.d.ts +0 -0
- /package/dist/src/widgets/{TaxBitForm/__tests__/TaxBitDAC7Form.loaded.test.d.ts → TaxbitQuestionnairePersist/__tests__/TaxbitQuestionnairePersist.complete.test.d.ts} +0 -0
- /package/dist/src/widgets/{TaxBitForm/__tests__/TaxBitForm.complete.test.d.ts → TaxbitQuestionnairePersist/__tests__/TaxbitQuestionnairePersist.loaded.test.d.ts} +0 -0
- /package/dist/src/widgets/{TaxBitForm/__tests__/TaxBitForm.loaded.test.d.ts → TaxbitQuestionnairePersist/__tests__/TaxbitQuestionnairePersist.loading.test.d.ts} +0 -0
- /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/AccountHolderClassification/AccountHolderClassification.d.ts +0 -0
- /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/AccountHolderContact/AccountHolderContact.d.ts +0 -0
- /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/AccountHolderTax/AccountHolderTax.d.ts +0 -0
- /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/AccountHolderTaxClarification/AccountHolderTaxClarification.d.ts +0 -0
- /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/AppError/AppError.d.ts +0 -0
- /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/Confirmation/Confirmation.d.ts +0 -0
- /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/Confirmation/index.d.ts +0 -0
- /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/Exemptions/Exemptions.d.ts +0 -0
- /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/RegardedOwnerContact/RegardedOwnerContact.d.ts +0 -0
- /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/RegardedOwnerTax/RegardedOwnerTax.d.ts +0 -0
- /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/Summary/Recap.d.ts +0 -0
- /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/Summary/Summary.d.ts +0 -0
- /package/dist/src/{widgets/TaxBitForm/__tests__/TaxBitForm.loading.test.d.ts → wizard/TaxbitQuestionnaireUI/__tests__/TaxbitDPSQuestionnaireUI.test.d.ts} +0 -0
- /package/dist/src/wizard/{TaxBitFormUI/__tests__/TaxBitDAC7FormUI.test.d.ts → TaxbitQuestionnaireUI/__tests__/TaxbitQuestionnaireUI.test.d.ts} +0 -0
- /package/dist/src/wizard/{TaxBitFormUI/__tests__/TaxBitFormUI.test.d.ts → TaxbitQuestionnaireUI/__tests__/TaxbitWFormQuestionnaireUI.test.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Taxbit React SDK
|
|
2
2
|
|
|
3
3
|
A React app, widget, and component for gathering Tax Documentation data for US and EU Tax forms.
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@ npm install @taxbit/react-sdk
|
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
12
|
import '@taxbit/react-sdk/style/inline.css'; // other options include 'basic.css' and 'minimal.css'
|
|
13
|
-
import {
|
|
13
|
+
import { TaxbitQuestionnaire, ClientTaxDocumentation } from '@taxbit/react-sdk';
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
### Data
|
|
@@ -56,62 +56,64 @@ exampleData: ClientTaxDocumentation = {
|
|
|
56
56
|
businessRegistrationNumber: '123123123',
|
|
57
57
|
businessRegistrationCountry: 'GR',
|
|
58
58
|
isIndividual: true,
|
|
59
|
-
isEuResident: true,
|
|
60
59
|
},
|
|
61
60
|
};
|
|
62
61
|
```
|
|
63
62
|
|
|
64
63
|
```jsx
|
|
65
|
-
<
|
|
64
|
+
<TaxbitQuestionnaire
|
|
66
65
|
data={exampleData} // `data` is an optional prop
|
|
67
66
|
bearerToken="bearer token goes here"
|
|
67
|
+
questionnaire="DPS"
|
|
68
68
|
language="en-us" // 'en-us' is the default
|
|
69
69
|
staging // if not production
|
|
70
70
|
/>
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
For W-9 W-8BEN and W-8BEN-E forms, this component can be used...
|
|
74
74
|
|
|
75
75
|
```jsx
|
|
76
|
-
<
|
|
76
|
+
<TaxbitQuestionnaire
|
|
77
77
|
data={exampleData} // `data` is an optional prop
|
|
78
78
|
bearerToken="bearer token goes here"
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
questionnaire="W-FORM"
|
|
80
|
+
language="en" // 'en' is the default
|
|
81
81
|
staging // if not production
|
|
82
82
|
/>
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
To view the Taxbit Questionnaire component without connecting to the server, you can put it in "demoMode". It can be used like this...
|
|
86
86
|
|
|
87
87
|
```typescript jsx
|
|
88
|
-
import {
|
|
88
|
+
import { TaxbitQuestionnaire, ClientTaxDocumentation } from '@taxbit/react-sdk';
|
|
89
89
|
|
|
90
|
-
<
|
|
90
|
+
<TaxbitQuestionnaire
|
|
91
91
|
data={exampleData}
|
|
92
92
|
onSubmit={(data: ClientTaxDocumentation) => alert(JSON.stringify(data))}
|
|
93
|
+
demoMode={true}
|
|
93
94
|
/>;
|
|
94
95
|
```
|
|
95
96
|
|
|
96
97
|
### Bearer Token
|
|
97
98
|
|
|
98
|
-
This will be generated from the
|
|
99
|
+
This will be generated from the Taxbit API and passed in as a prop to the component.
|
|
99
100
|
|
|
100
101
|
### Language
|
|
101
102
|
|
|
102
103
|
The first screen of the tax documentation interview gives the user the opportunity to select a language.
|
|
103
|
-
|
|
104
|
+
The language in the DPS component can be initially set to any of that languages that are supported by the Taxbit API.
|
|
105
|
+
The WForm component language can be set to 'en', 'fr', or 'es'.
|
|
104
106
|
|
|
105
107
|
See the `Locale` type below.
|
|
106
108
|
|
|
107
109
|
### Status
|
|
108
110
|
|
|
109
|
-
The `
|
|
111
|
+
The `useTaxbit` hook will return a `status` object that can be used to determine the status of the user's tax documentation. The `status` object will have the following shape:
|
|
110
112
|
|
|
111
113
|
```typescript
|
|
112
114
|
{
|
|
113
115
|
submissionStatus: 'SUBMITTED' | 'NOT_SUBMITTED';
|
|
114
|
-
|
|
116
|
+
dpsQuestionnaire: {
|
|
115
117
|
dataCollectionStatus: 'COMPLETE' | 'INCOMPLETE';
|
|
116
118
|
expirationDate: 'PENDING' |
|
|
117
119
|
'VALID' |
|
|
@@ -127,7 +129,7 @@ an example is below.
|
|
|
127
129
|
```json
|
|
128
130
|
{
|
|
129
131
|
"submissionStatus": "SUBMITTED",
|
|
130
|
-
"
|
|
132
|
+
"dpsQuestionnaire": {
|
|
131
133
|
"dataCollectionStatus": "COMPLETE",
|
|
132
134
|
"expirationDate": "2026-11-20T00:00:00.000Z"
|
|
133
135
|
}
|
|
@@ -142,67 +144,67 @@ If `true`, the staging environment will be used. If `false`, the production envi
|
|
|
142
144
|
|
|
143
145
|
### CSS and Style Customization
|
|
144
146
|
|
|
145
|
-
The
|
|
147
|
+
The Taxbit React SDK renders a form for collecting user data. The form is structured with fairly semantic HTML and CSS classes and can be easily customized to closely match your website's style.
|
|
146
148
|
Classnames are namespaced with "taxbit-" to reduce the chance of conflict.
|
|
147
149
|
|
|
148
150
|
### Callbacks
|
|
149
151
|
|
|
150
|
-
The
|
|
152
|
+
The Taxbit React SDK provides callbacks for the following events on the `TaxbitQuestionnaire` component. These callbacks can be passed in to the Component and used to trigger other actions in your application.
|
|
151
153
|
|
|
152
154
|
- `onSubmit` - called when the user clicks the submit button. This can be an `async` function.
|
|
153
155
|
- `onSuccess` - called after the server responds with a successful submission.
|
|
154
156
|
- `onError` - called when the server responds with an error during data submission.
|
|
155
157
|
- `onSettled` - called after `onError` or `onSuccess` is called.
|
|
156
|
-
- `onProgress` - called when the user loads and navigates within the
|
|
158
|
+
- `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):
|
|
157
159
|
|
|
158
|
-
The
|
|
160
|
+
The DPS 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.
|
|
159
161
|
|
|
160
162
|
### Types
|
|
161
163
|
|
|
162
|
-
The
|
|
164
|
+
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`.
|
|
163
165
|
|
|
164
166
|
Also included are some utility types:
|
|
165
167
|
|
|
166
168
|
```typescript
|
|
167
169
|
type Locale =
|
|
168
|
-
| 'bg
|
|
169
|
-
| 'cs
|
|
170
|
-
| 'da
|
|
170
|
+
| 'bg'
|
|
171
|
+
| 'cs'
|
|
172
|
+
| 'da'
|
|
173
|
+
| 'de'
|
|
171
174
|
| 'de-at'
|
|
172
|
-
| '
|
|
175
|
+
| 'el'
|
|
173
176
|
| 'el-cy'
|
|
174
|
-
| '
|
|
177
|
+
| 'en'
|
|
175
178
|
| 'en-gb'
|
|
176
179
|
| 'en-us'
|
|
177
|
-
| 'es
|
|
178
|
-
| 'et
|
|
179
|
-
| 'fi
|
|
180
|
-
| 'fr
|
|
180
|
+
| 'es'
|
|
181
|
+
| 'et'
|
|
182
|
+
| 'fi'
|
|
183
|
+
| 'fr'
|
|
181
184
|
| 'fr-lu'
|
|
182
|
-
| 'ga
|
|
183
|
-
| 'hr
|
|
184
|
-
| 'hu
|
|
185
|
-
| 'it
|
|
186
|
-
| 'lt
|
|
187
|
-
| 'lv
|
|
188
|
-
| 'mt
|
|
185
|
+
| 'ga'
|
|
186
|
+
| 'hr'
|
|
187
|
+
| 'hu'
|
|
188
|
+
| 'it'
|
|
189
|
+
| 'lt'
|
|
190
|
+
| 'lv'
|
|
191
|
+
| 'mt'
|
|
192
|
+
| 'nl'
|
|
189
193
|
| 'nl-be'
|
|
190
|
-
| '
|
|
191
|
-
| '
|
|
192
|
-
| '
|
|
193
|
-
| '
|
|
194
|
-
| '
|
|
195
|
-
| '
|
|
196
|
-
| '
|
|
197
|
-
| 'sv-se';
|
|
194
|
+
| 'no'
|
|
195
|
+
| 'pl'
|
|
196
|
+
| 'pt'
|
|
197
|
+
| 'ro'
|
|
198
|
+
| 'sk'
|
|
199
|
+
| 'sl'
|
|
200
|
+
| 'sv';
|
|
198
201
|
```
|
|
199
202
|
|
|
200
203
|
```typescript
|
|
201
204
|
type StepId =
|
|
205
|
+
| 'accountHolderClassification'
|
|
202
206
|
| 'accountHolderContactInformation'
|
|
203
207
|
| 'accountHolderTaxInformation'
|
|
204
|
-
| 'accountHolderTaxClarification'
|
|
205
|
-
| 'accountHolderClassification'
|
|
206
208
|
| 'confirmation'
|
|
207
209
|
| 'exemptions'
|
|
208
210
|
| 'regardedOwnerClassification'
|
|
@@ -226,72 +228,82 @@ type Progress = {
|
|
|
226
228
|
|
|
227
229
|
## Changelog
|
|
228
230
|
|
|
229
|
-
### Version 0.
|
|
231
|
+
### Version 1.0.0-beta
|
|
232
|
+
|
|
233
|
+
1. W-9, W-8BEN, and W-8BEN-E forms are now supported in the UI. The `TaxbitQuestionnaire` component can be used to collect data for these forms.
|
|
234
|
+
2. Translations for country names are now coming from the Intl API.
|
|
235
|
+
3. Download URL available in the `useTaxbit` hook.
|
|
236
|
+
|
|
237
|
+
### Version 0.6.2
|
|
238
|
+
|
|
239
|
+
1. Added this Changelog file
|
|
240
|
+
|
|
241
|
+
### Version 0.6.1
|
|
230
242
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
243
|
+
1. Native local terms for languages
|
|
244
|
+
2. Moved "Remove Residence" button, added section action button
|
|
245
|
+
3. Fixed Type for onSubmit callback. Callback can be async or not async.
|
|
234
246
|
|
|
235
247
|
### Version 0.5.1
|
|
236
248
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
249
|
+
1. Place of Birth: Localized text update
|
|
250
|
+
2. Confirming valid ISO country code in data
|
|
251
|
+
3. Setting account holder name as the default value on Financial Account Identifier
|
|
240
252
|
|
|
241
253
|
### Version 0.5.0
|
|
242
254
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
255
|
+
1. Adding all error messages to Summary Screen
|
|
256
|
+
2. Submit button is disabled when saved data matches local data
|
|
257
|
+
3. Indicate in form footer when errors are in the form above
|
|
246
258
|
|
|
247
259
|
### Version 0.4.4
|
|
248
260
|
|
|
249
|
-
|
|
261
|
+
1. Handle blank bearer token. No error, but a warning is logged.
|
|
250
262
|
|
|
251
263
|
### Version 0.4.3
|
|
252
264
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
265
|
+
1. Show error on VAT Identifier field when the Identifier is determined to be invalid
|
|
266
|
+
2. Fix: data should not reset on react render
|
|
267
|
+
3. Fix: changing data prop will reset form
|
|
256
268
|
|
|
257
269
|
### Version 0.4.2
|
|
258
270
|
|
|
259
|
-
|
|
271
|
+
1. Added stepIndex and steps fields to the Progress object. stepId is now typed to potential enum values.
|
|
260
272
|
|
|
261
273
|
### Version 0.4.1
|
|
262
274
|
|
|
263
|
-
|
|
275
|
+
1. Bug fix for onProgress callback not being triggered from the TaxbitDPSQuestionnaire component.
|
|
264
276
|
|
|
265
277
|
### Version 0.4.0
|
|
266
278
|
|
|
267
|
-
|
|
268
|
-
|
|
279
|
+
1. Added onProgress callback.
|
|
280
|
+
2. Showing multiple errors for DAC7 Tax residency when the case arises.
|
|
269
281
|
|
|
270
282
|
### Version 0.3.0
|
|
271
283
|
|
|
272
|
-
|
|
273
|
-
|
|
284
|
+
1. Added business registration questions to the form.
|
|
285
|
+
2. Added confirmation checkbox to the summary screen before submission.
|
|
274
286
|
|
|
275
287
|
### Version 0.2.4
|
|
276
288
|
|
|
277
|
-
|
|
289
|
+
1. Bug fix for naming of CommonJS module exports.
|
|
278
290
|
|
|
279
291
|
### Version 0.2.3
|
|
280
292
|
|
|
281
|
-
|
|
293
|
+
1. Bug fix for the ClientTaxDocumentationStatus type not being accessible externally.
|
|
282
294
|
|
|
283
295
|
### Version 0.2.2
|
|
284
296
|
|
|
285
|
-
|
|
297
|
+
1. onSubmit and onSuccess callbacks are invoked with a parameter of type ClientTaxDocumentation which is now exposed.
|
|
286
298
|
|
|
287
299
|
### Version 0.2.1
|
|
288
300
|
|
|
289
|
-
|
|
301
|
+
1. The SDK now supports React versions 16, 17, and 18 and TypeScript versions 4 and 5.
|
|
290
302
|
|
|
291
303
|
### Version 0.2.0
|
|
292
304
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
305
|
+
1. Fix in package.json to expose UMD module as main.
|
|
306
|
+
2. Added specific CSS class names for each question and each screen of the form.
|
|
307
|
+
3. Added the new status structure into the useTaxbit hook.
|
|
308
|
+
4. TaxbitDPSQuestionnaire component will now preload the form with previously submitted data.
|
|
309
|
+
5. Validation update to enforce that primary address country and tax residence country are the same.
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CaProvinceCode, UsStateCode } from 'types';
|
|
3
2
|
type AddressParts = {
|
|
4
3
|
street?: string;
|
|
5
4
|
street2?: string;
|
|
6
5
|
city?: string;
|
|
7
|
-
state?: string
|
|
6
|
+
state?: string;
|
|
8
7
|
zip?: string;
|
|
9
8
|
country?: string;
|
|
10
9
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TaxDocumentationKey } from 'types';
|
|
3
|
-
export declare const ErrorMessage: ({ name
|
|
3
|
+
export declare const ErrorMessage: ({ name }: {
|
|
4
4
|
name: TaxDocumentationKey;
|
|
5
|
-
hint?: true | undefined;
|
|
6
5
|
}) => React.JSX.Element | null;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type FormProps = {
|
|
3
3
|
title: string;
|
|
4
|
+
subTitle?: string;
|
|
4
5
|
className?: string;
|
|
5
6
|
children: React.ReactNode;
|
|
6
7
|
actions?: React.ReactNode;
|
|
7
8
|
};
|
|
8
|
-
export declare const Form: ({ children, title, actions, className }: FormProps) => React.JSX.Element;
|
|
9
|
+
export declare const Form: ({ children, title, subTitle, actions, className, }: FormProps) => React.JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './Form
|
|
1
|
+
export * from './Form';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ButtonKey, ErrorKey, PromptKey, SubPromptKey, SubTitleKey, TextKey } from '../../i18n/types';
|
|
2
|
+
import { Locale, TaxDocumentation, TaxDocumentationKey } from '../../types';
|
|
3
|
+
export declare const getLocal: (fields: TaxDocumentation, language: Locale) => {
|
|
4
|
+
getLocalText: (key: TextKey) => string;
|
|
5
|
+
getLocalTitle: (key: string) => string;
|
|
6
|
+
getLocalSubTitle: (key: SubTitleKey) => string;
|
|
7
|
+
getLocalError: (key: ErrorKey) => string;
|
|
8
|
+
getLocalButton: (key: ButtonKey) => string;
|
|
9
|
+
getLocalPrompt: (key: string) => string;
|
|
10
|
+
getLocalSubPrompt: (key: TaxDocumentationKey) => string;
|
|
11
|
+
getLocalOption: (key: string | undefined) => string | undefined;
|
|
12
|
+
getLocalSubOption: (key: string | undefined) => string | undefined;
|
|
13
|
+
getLocalCountry: (key: string | undefined) => string;
|
|
14
|
+
getLocalUsState: (key: string | undefined) => "" | "Guam" | "Puerto Rico" | "Alabama" | "Alaska" | "American Samoa" | "Arizona" | "Arkansas" | "California" | "Colorado" | "Connecticut" | "Delaware" | "District Of Columbia" | "Federated States Of Micronesia" | "Florida" | "Georgia" | "Hawaii" | "Idaho" | "Illinois" | "Indiana" | "Iowa" | "Kansas" | "Kentucky" | "Louisiana" | "Maine" | "Marshall Islands" | "Maryland" | "Massachusetts" | "Michigan" | "Minnesota" | "Mississippi" | "Missouri" | "Montana" | "Nebraska" | "Nevada" | "New Hampshire" | "New Jersey" | "New Mexico" | "New York" | "North Carolina" | "North Dakota" | "Northern Mariana Islands" | "Ohio" | "Oklahoma" | "Oregon" | "Outlying Islands" | "Palau" | "Pennsylvania" | "Rhode Island" | "South Carolina" | "South Dakota" | "Tennessee" | "Texas" | "Utah" | "Vermont" | "Virgin Islands" | "Virginia" | "Washington" | "West Virginia" | "Wisconsin" | "Wyoming";
|
|
15
|
+
getLocalCaProvince: (key: string | undefined) => string;
|
|
16
|
+
getLocalMonth: (key: string | undefined) => string;
|
|
17
|
+
getPromptKey: (key: string) => PromptKey;
|
|
18
|
+
getSubPromptKey: (key: string) => SubPromptKey;
|
|
19
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TaxDocumentationErrorFile, TaxDocumentationPropertyFile } from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
1
|
+
import type { TaxDocumentationErrorFile, TaxDocumentationPropertyFile } from './useQuestionnaireUI';
|
|
2
|
+
export * from './QuestionnaireUIProvider';
|
|
3
|
+
export * from './useQuestionnaireUIContext';
|
|
4
4
|
export { TaxDocumentationErrorFile, TaxDocumentationPropertyFile };
|
|
@@ -8,26 +8,26 @@ export type TaxDocumentationPropertyFile = {
|
|
|
8
8
|
export type TaxDocumentationErrorFile = {
|
|
9
9
|
[key in TaxDocumentationKey]?: ErrorKey[];
|
|
10
10
|
};
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const useQuestionnaireUI: () => {
|
|
12
12
|
config: {
|
|
13
13
|
minimumAge: number;
|
|
14
14
|
} | undefined;
|
|
15
|
-
|
|
15
|
+
language: "bg" | "cs" | "da" | "de" | "de-at" | "el" | "el-cy" | "en" | "en-gb" | "en-nz" | "en-us" | "es" | "et" | "fi" | "fr" | "fr-ca" | "fr-lu" | "ga" | "hr" | "hu" | "it" | "lt" | "lv" | "mt" | "nl" | "nl-be" | "no" | "pl" | "pt" | "ro" | "sk" | "sl" | "sv";
|
|
16
16
|
getLocalText: (key: import("i18n/types").TextKey) => string;
|
|
17
17
|
getLocalTitle: (key: string) => string;
|
|
18
|
-
getLocalSubTitle: (key: "
|
|
18
|
+
getLocalSubTitle: (key: import("i18n/types").SubTitleKey) => string;
|
|
19
19
|
getLocalError: (key: ErrorKey) => string;
|
|
20
20
|
getLocalButton: (key: import("i18n/types").ButtonKey) => string;
|
|
21
21
|
getLocalPrompt: (key: string) => string;
|
|
22
22
|
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 | keyof import("types").CalculatedData) => string;
|
|
23
23
|
getLocalOption: (key: string | undefined) => string | undefined;
|
|
24
|
+
getLocalSubOption: (key: string | undefined) => string | undefined;
|
|
24
25
|
getLocalCountry: (key: string | undefined) => string;
|
|
25
|
-
getLocalUsState: (key: string | undefined) =>
|
|
26
|
+
getLocalUsState: (key: string | undefined) => "" | "Guam" | "Puerto Rico" | "Alabama" | "Alaska" | "American Samoa" | "Arizona" | "Arkansas" | "California" | "Colorado" | "Connecticut" | "Delaware" | "District Of Columbia" | "Federated States Of Micronesia" | "Florida" | "Georgia" | "Hawaii" | "Idaho" | "Illinois" | "Indiana" | "Iowa" | "Kansas" | "Kentucky" | "Louisiana" | "Maine" | "Marshall Islands" | "Maryland" | "Massachusetts" | "Michigan" | "Minnesota" | "Mississippi" | "Missouri" | "Montana" | "Nebraska" | "Nevada" | "New Hampshire" | "New Jersey" | "New Mexico" | "New York" | "North Carolina" | "North Dakota" | "Northern Mariana Islands" | "Ohio" | "Oklahoma" | "Oregon" | "Outlying Islands" | "Palau" | "Pennsylvania" | "Rhode Island" | "South Carolina" | "South Dakota" | "Tennessee" | "Texas" | "Utah" | "Vermont" | "Virgin Islands" | "Virginia" | "Washington" | "West Virginia" | "Wisconsin" | "Wyoming";
|
|
26
27
|
getLocalCaProvince: (key: string | undefined) => string;
|
|
27
28
|
getLocalMonth: (key: string | undefined) => string;
|
|
28
|
-
getHintKey: (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) => "dateOfBirth";
|
|
29
29
|
getPromptKey: (key: string) => import("i18n/types").PromptKey;
|
|
30
|
-
getSubPromptKey: (key:
|
|
30
|
+
getSubPromptKey: (key: string) => import("i18n/types").SubPromptKey;
|
|
31
31
|
clearIfNotRequired: (...arg: TaxDocumentationKey[]) => (value: Yes | undefined) => void;
|
|
32
32
|
fields: TaxDocumentation;
|
|
33
33
|
setFields: import("react").Dispatch<import("react").SetStateAction<TaxDocumentation>>;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const useQuestionnaireUIContext: () => {
|
|
3
3
|
config: {
|
|
4
4
|
minimumAge: number;
|
|
5
5
|
} | undefined;
|
|
6
|
-
|
|
6
|
+
language: "bg" | "cs" | "da" | "de" | "de-at" | "el" | "el-cy" | "en" | "en-gb" | "en-nz" | "en-us" | "es" | "et" | "fi" | "fr" | "fr-ca" | "fr-lu" | "ga" | "hr" | "hu" | "it" | "lt" | "lv" | "mt" | "nl" | "nl-be" | "no" | "pl" | "pt" | "ro" | "sk" | "sl" | "sv";
|
|
7
7
|
getLocalText: (key: import("../../i18n/types").TextKey) => string;
|
|
8
8
|
getLocalTitle: (key: string) => string;
|
|
9
|
-
getLocalSubTitle: (key: "
|
|
9
|
+
getLocalSubTitle: (key: import("../../i18n/types").SubTitleKey) => string;
|
|
10
10
|
getLocalError: (key: import("../../i18n/types").ErrorKey) => string;
|
|
11
11
|
getLocalButton: (key: import("../../i18n/types").ButtonKey) => string;
|
|
12
12
|
getLocalPrompt: (key: string) => string;
|
|
13
13
|
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 | keyof import("../../types").CalculatedData) => string;
|
|
14
14
|
getLocalOption: (key: string | undefined) => string | undefined;
|
|
15
|
+
getLocalSubOption: (key: string | undefined) => string | undefined;
|
|
15
16
|
getLocalCountry: (key: string | undefined) => string;
|
|
16
|
-
getLocalUsState: (key: string | undefined) =>
|
|
17
|
+
getLocalUsState: (key: string | undefined) => "" | "Guam" | "Puerto Rico" | "Alabama" | "Alaska" | "American Samoa" | "Arizona" | "Arkansas" | "California" | "Colorado" | "Connecticut" | "Delaware" | "District Of Columbia" | "Federated States Of Micronesia" | "Florida" | "Georgia" | "Hawaii" | "Idaho" | "Illinois" | "Indiana" | "Iowa" | "Kansas" | "Kentucky" | "Louisiana" | "Maine" | "Marshall Islands" | "Maryland" | "Massachusetts" | "Michigan" | "Minnesota" | "Mississippi" | "Missouri" | "Montana" | "Nebraska" | "Nevada" | "New Hampshire" | "New Jersey" | "New Mexico" | "New York" | "North Carolina" | "North Dakota" | "Northern Mariana Islands" | "Ohio" | "Oklahoma" | "Oregon" | "Outlying Islands" | "Palau" | "Pennsylvania" | "Rhode Island" | "South Carolina" | "South Dakota" | "Tennessee" | "Texas" | "Utah" | "Vermont" | "Virgin Islands" | "Virginia" | "Washington" | "West Virginia" | "Wisconsin" | "Wyoming";
|
|
17
18
|
getLocalCaProvince: (key: string | undefined) => string;
|
|
18
19
|
getLocalMonth: (key: string | undefined) => string;
|
|
19
|
-
getHintKey: (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) => "dateOfBirth";
|
|
20
20
|
getPromptKey: (key: string) => import("../../i18n/types").PromptKey;
|
|
21
|
-
getSubPromptKey: (key:
|
|
21
|
+
getSubPromptKey: (key: string) => import("../../i18n/types").SubPromptKey;
|
|
22
22
|
clearIfNotRequired: (...arg: (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)[]) => (value: "yes" | undefined) => void;
|
|
23
23
|
fields: import("../../types").TaxDocumentation;
|
|
24
24
|
setFields: import("react").Dispatch<import("react").SetStateAction<import("../../types").TaxDocumentation>>;
|
|
@@ -30,31 +30,31 @@ export declare const useFormUIContext: () => {
|
|
|
30
30
|
hideErrors: () => void;
|
|
31
31
|
hasChangedData: boolean;
|
|
32
32
|
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;
|
|
33
|
-
visibleFields: import("./
|
|
34
|
-
invalidFields: import("./
|
|
35
|
-
requiredFields: import("./
|
|
33
|
+
visibleFields: import("./useQuestionnaireUI").TaxDocumentationPropertyFile;
|
|
34
|
+
invalidFields: import("./useQuestionnaireUI").TaxDocumentationErrorFile;
|
|
35
|
+
requiredFields: import("./useQuestionnaireUI").TaxDocumentationPropertyFile;
|
|
36
36
|
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;
|
|
37
37
|
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;
|
|
38
|
-
},
|
|
38
|
+
}, QuestionnaireUIContextProvider: import("react").Provider<{
|
|
39
39
|
config: {
|
|
40
40
|
minimumAge: number;
|
|
41
41
|
} | undefined;
|
|
42
|
-
|
|
42
|
+
language: "bg" | "cs" | "da" | "de" | "de-at" | "el" | "el-cy" | "en" | "en-gb" | "en-nz" | "en-us" | "es" | "et" | "fi" | "fr" | "fr-ca" | "fr-lu" | "ga" | "hr" | "hu" | "it" | "lt" | "lv" | "mt" | "nl" | "nl-be" | "no" | "pl" | "pt" | "ro" | "sk" | "sl" | "sv";
|
|
43
43
|
getLocalText: (key: import("../../i18n/types").TextKey) => string;
|
|
44
44
|
getLocalTitle: (key: string) => string;
|
|
45
|
-
getLocalSubTitle: (key: "
|
|
45
|
+
getLocalSubTitle: (key: import("../../i18n/types").SubTitleKey) => string;
|
|
46
46
|
getLocalError: (key: import("../../i18n/types").ErrorKey) => string;
|
|
47
47
|
getLocalButton: (key: import("../../i18n/types").ButtonKey) => string;
|
|
48
48
|
getLocalPrompt: (key: string) => string;
|
|
49
49
|
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 | keyof import("../../types").CalculatedData) => string;
|
|
50
50
|
getLocalOption: (key: string | undefined) => string | undefined;
|
|
51
|
+
getLocalSubOption: (key: string | undefined) => string | undefined;
|
|
51
52
|
getLocalCountry: (key: string | undefined) => string;
|
|
52
|
-
getLocalUsState: (key: string | undefined) =>
|
|
53
|
+
getLocalUsState: (key: string | undefined) => "" | "Guam" | "Puerto Rico" | "Alabama" | "Alaska" | "American Samoa" | "Arizona" | "Arkansas" | "California" | "Colorado" | "Connecticut" | "Delaware" | "District Of Columbia" | "Federated States Of Micronesia" | "Florida" | "Georgia" | "Hawaii" | "Idaho" | "Illinois" | "Indiana" | "Iowa" | "Kansas" | "Kentucky" | "Louisiana" | "Maine" | "Marshall Islands" | "Maryland" | "Massachusetts" | "Michigan" | "Minnesota" | "Mississippi" | "Missouri" | "Montana" | "Nebraska" | "Nevada" | "New Hampshire" | "New Jersey" | "New Mexico" | "New York" | "North Carolina" | "North Dakota" | "Northern Mariana Islands" | "Ohio" | "Oklahoma" | "Oregon" | "Outlying Islands" | "Palau" | "Pennsylvania" | "Rhode Island" | "South Carolina" | "South Dakota" | "Tennessee" | "Texas" | "Utah" | "Vermont" | "Virgin Islands" | "Virginia" | "Washington" | "West Virginia" | "Wisconsin" | "Wyoming";
|
|
53
54
|
getLocalCaProvince: (key: string | undefined) => string;
|
|
54
55
|
getLocalMonth: (key: string | undefined) => string;
|
|
55
|
-
getHintKey: (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) => "dateOfBirth";
|
|
56
56
|
getPromptKey: (key: string) => import("../../i18n/types").PromptKey;
|
|
57
|
-
getSubPromptKey: (key:
|
|
57
|
+
getSubPromptKey: (key: string) => import("../../i18n/types").SubPromptKey;
|
|
58
58
|
clearIfNotRequired: (...arg: (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)[]) => (value: "yes" | undefined) => void;
|
|
59
59
|
fields: import("../../types").TaxDocumentation;
|
|
60
60
|
setFields: import("react").Dispatch<import("react").SetStateAction<import("../../types").TaxDocumentation>>;
|
|
@@ -66,9 +66,9 @@ export declare const useFormUIContext: () => {
|
|
|
66
66
|
hideErrors: () => void;
|
|
67
67
|
hasChangedData: boolean;
|
|
68
68
|
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;
|
|
69
|
-
visibleFields: import("./
|
|
70
|
-
invalidFields: import("./
|
|
71
|
-
requiredFields: import("./
|
|
69
|
+
visibleFields: import("./useQuestionnaireUI").TaxDocumentationPropertyFile;
|
|
70
|
+
invalidFields: import("./useQuestionnaireUI").TaxDocumentationErrorFile;
|
|
71
|
+
requiredFields: import("./useQuestionnaireUI").TaxDocumentationPropertyFile;
|
|
72
72
|
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;
|
|
73
73
|
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;
|
|
74
74
|
} | undefined>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UseTaxDocumentationProps } from './useTaxDocumentation';
|
|
3
|
+
type TaxDocumentationProviderProps = UseTaxDocumentationProps & {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare const TaxbitQuestionnaireProvider: ({ data, externalValidations, onSubmit, onProgress, language, questionnaire, step, children, config, }: TaxDocumentationProviderProps) => React.JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
2
|
+
import { ClientTaxDocumentation } from '@taxbit/utilities';
|
|
3
|
+
import type { InputStep, Locale, Progress, Questionnaire, TaxDocumentation } from 'types';
|
|
3
4
|
import type { StepId } from 'types/StepId';
|
|
4
|
-
import {
|
|
5
|
+
import { ExternalValidations } from 'types/client';
|
|
5
6
|
type InterviewConfig = {
|
|
6
7
|
minimumAge: number;
|
|
7
8
|
};
|
|
@@ -12,16 +13,12 @@ export type UseTaxDocumentationProps = {
|
|
|
12
13
|
onSubmit: (data: ClientTaxDocumentation) => void | Promise<void>;
|
|
13
14
|
onProgress?: (progress: Progress) => void | Promise<void>;
|
|
14
15
|
step?: InputStep;
|
|
15
|
-
|
|
16
|
+
questionnaire?: Questionnaire;
|
|
16
17
|
config?: InterviewConfig;
|
|
17
18
|
};
|
|
18
|
-
export declare const useTaxDocumentation: ({ data: startingData, language: initialLanguage, externalValidations, onSubmit, onProgress, step: initialStep,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
isW8Ben: boolean;
|
|
22
|
-
isW8BenE: boolean;
|
|
23
|
-
isDac7: boolean;
|
|
24
|
-
onPersistAccountHolderData: (newData: TaxDocumentation) => void;
|
|
19
|
+
export declare const useTaxDocumentation: ({ data: startingData, language: initialLanguage, externalValidations, onSubmit, onProgress, step: initialStep, questionnaire, config, }: UseTaxDocumentationProps) => {
|
|
20
|
+
isBuildingW9: boolean;
|
|
21
|
+
isBuildingW8: boolean;
|
|
25
22
|
onPersistCollectedData: (newData: TaxDocumentation) => void;
|
|
26
23
|
onSubmitTaxDocumentation: (data: TaxDocumentation) => void;
|
|
27
24
|
error: string | undefined;
|
|
@@ -32,14 +29,15 @@ export declare const useTaxDocumentation: ({ data: startingData, language: initi
|
|
|
32
29
|
goBack: (() => void) | undefined;
|
|
33
30
|
goToNext: (data: TaxDocumentation) => void;
|
|
34
31
|
progress: Progress | undefined;
|
|
35
|
-
stepName: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "
|
|
32
|
+
stepName: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
|
|
36
33
|
data: TaxDocumentation;
|
|
37
34
|
originalClientData: TaxDocumentation;
|
|
38
|
-
initialStep: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "
|
|
39
|
-
setLanguage: import("react").Dispatch<import("react").SetStateAction<"bg
|
|
40
|
-
language: "bg
|
|
41
|
-
|
|
35
|
+
initialStep: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
|
|
36
|
+
setLanguage: import("react").Dispatch<import("react").SetStateAction<"bg" | "cs" | "da" | "de" | "de-at" | "el" | "el-cy" | "en" | "en-gb" | "en-nz" | "en-us" | "es" | "et" | "fi" | "fr" | "fr-ca" | "fr-lu" | "ga" | "hr" | "hu" | "it" | "lt" | "lv" | "mt" | "nl" | "nl-be" | "no" | "pl" | "pt" | "ro" | "sk" | "sl" | "sv">>;
|
|
37
|
+
language: "bg" | "cs" | "da" | "de" | "de-at" | "el" | "el-cy" | "en" | "en-gb" | "en-nz" | "en-us" | "es" | "et" | "fi" | "fr" | "fr-ca" | "fr-lu" | "ga" | "hr" | "hu" | "it" | "lt" | "lv" | "mt" | "nl" | "nl-be" | "no" | "pl" | "pt" | "ro" | "sk" | "sl" | "sv";
|
|
38
|
+
questionnaire: Questionnaire;
|
|
42
39
|
externalValidations: ExternalValidations | undefined;
|
|
43
40
|
config: InterviewConfig | undefined;
|
|
41
|
+
isSubmitting: boolean;
|
|
44
42
|
};
|
|
45
43
|
export {};
|