@taxbit/react-sdk 0.6.2 → 1.0.0-beta.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.
- package/README.md +65 -61
- 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 +6557 -16802
- package/dist/taxbit-react-sdk.umd.cjs +10 -10
- package/package.json +10 -18
- 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,62 @@ 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
|
-
staging // if not production
|
|
70
69
|
/>
|
|
71
70
|
```
|
|
72
71
|
|
|
73
|
-
|
|
72
|
+
For W-9 W-8BEN and W-8BEN-E forms, this component can be used...
|
|
74
73
|
|
|
75
74
|
```jsx
|
|
76
|
-
<
|
|
75
|
+
<TaxbitQuestionnaire
|
|
77
76
|
data={exampleData} // `data` is an optional prop
|
|
78
77
|
bearerToken="bearer token goes here"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
staging // if not production
|
|
78
|
+
questionnaire="W-FORM"
|
|
79
|
+
language="en" // 'en' is the default
|
|
82
80
|
/>
|
|
83
81
|
```
|
|
84
82
|
|
|
85
|
-
|
|
83
|
+
To view the Taxbit Questionnaire component without connecting to the server, you can put it in "demoMode". It can be used like this...
|
|
86
84
|
|
|
87
85
|
```typescript jsx
|
|
88
|
-
import {
|
|
86
|
+
import { TaxbitQuestionnaire, ClientTaxDocumentation } from '@taxbit/react-sdk';
|
|
89
87
|
|
|
90
|
-
<
|
|
88
|
+
<TaxbitQuestionnaire
|
|
91
89
|
data={exampleData}
|
|
92
90
|
onSubmit={(data: ClientTaxDocumentation) => alert(JSON.stringify(data))}
|
|
91
|
+
demoMode={true}
|
|
93
92
|
/>;
|
|
94
93
|
```
|
|
95
94
|
|
|
96
95
|
### Bearer Token
|
|
97
96
|
|
|
98
|
-
This will be generated from the
|
|
97
|
+
This will be generated from the Taxbit API and passed in as a prop to the component.
|
|
99
98
|
|
|
100
99
|
### Language
|
|
101
100
|
|
|
102
101
|
The first screen of the tax documentation interview gives the user the opportunity to select a language.
|
|
103
|
-
|
|
102
|
+
The language in the DPS component can be initially set to any of that languages that are supported by the Taxbit API.
|
|
103
|
+
The WForm component language can be set to 'en', 'fr', or 'es'.
|
|
104
104
|
|
|
105
105
|
See the `Locale` type below.
|
|
106
106
|
|
|
107
107
|
### Status
|
|
108
108
|
|
|
109
|
-
The `
|
|
109
|
+
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
110
|
|
|
111
111
|
```typescript
|
|
112
112
|
{
|
|
113
113
|
submissionStatus: 'SUBMITTED' | 'NOT_SUBMITTED';
|
|
114
|
-
|
|
114
|
+
dpsQuestionnaire: {
|
|
115
115
|
dataCollectionStatus: 'COMPLETE' | 'INCOMPLETE';
|
|
116
116
|
expirationDate: 'PENDING' |
|
|
117
117
|
'VALID' |
|
|
@@ -127,82 +127,76 @@ an example is below.
|
|
|
127
127
|
```json
|
|
128
128
|
{
|
|
129
129
|
"submissionStatus": "SUBMITTED",
|
|
130
|
-
"
|
|
130
|
+
"dpsQuestionnaire": {
|
|
131
131
|
"dataCollectionStatus": "COMPLETE",
|
|
132
132
|
"expirationDate": "2026-11-20T00:00:00.000Z"
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
### Staging
|
|
138
|
-
|
|
139
|
-
This can be set to `true` or `false`. Passing `staging` in the component is the same as passing `staging={true}`.
|
|
140
|
-
|
|
141
|
-
If `true`, the staging environment will be used. If `false`, the production environment will be used. The default is `false`.
|
|
142
|
-
|
|
143
137
|
### CSS and Style Customization
|
|
144
138
|
|
|
145
|
-
The
|
|
139
|
+
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 client's style.
|
|
146
140
|
Classnames are namespaced with "taxbit-" to reduce the chance of conflict.
|
|
147
141
|
|
|
148
142
|
### Callbacks
|
|
149
143
|
|
|
150
|
-
The
|
|
144
|
+
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
145
|
|
|
152
146
|
- `onSubmit` - called when the user clicks the submit button. This can be an `async` function.
|
|
153
147
|
- `onSuccess` - called after the server responds with a successful submission.
|
|
154
148
|
- `onError` - called when the server responds with an error during data submission.
|
|
155
149
|
- `onSettled` - called after `onError` or `onSuccess` is called.
|
|
156
|
-
- `onProgress` - called when the user loads and navigates within the
|
|
150
|
+
- `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
151
|
|
|
158
|
-
The
|
|
152
|
+
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
153
|
|
|
160
154
|
### Types
|
|
161
155
|
|
|
162
|
-
The
|
|
156
|
+
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
157
|
|
|
164
158
|
Also included are some utility types:
|
|
165
159
|
|
|
166
160
|
```typescript
|
|
167
161
|
type Locale =
|
|
168
|
-
| 'bg
|
|
169
|
-
| 'cs
|
|
170
|
-
| 'da
|
|
162
|
+
| 'bg'
|
|
163
|
+
| 'cs'
|
|
164
|
+
| 'da'
|
|
165
|
+
| 'de'
|
|
171
166
|
| 'de-at'
|
|
172
|
-
| '
|
|
167
|
+
| 'el'
|
|
173
168
|
| 'el-cy'
|
|
174
|
-
| '
|
|
169
|
+
| 'en'
|
|
175
170
|
| 'en-gb'
|
|
176
171
|
| 'en-us'
|
|
177
|
-
| 'es
|
|
178
|
-
| 'et
|
|
179
|
-
| 'fi
|
|
180
|
-
| 'fr
|
|
172
|
+
| 'es'
|
|
173
|
+
| 'et'
|
|
174
|
+
| 'fi'
|
|
175
|
+
| 'fr'
|
|
181
176
|
| 'fr-lu'
|
|
182
|
-
| 'ga
|
|
183
|
-
| 'hr
|
|
184
|
-
| 'hu
|
|
185
|
-
| 'it
|
|
186
|
-
| 'lt
|
|
187
|
-
| 'lv
|
|
188
|
-
| 'mt
|
|
177
|
+
| 'ga'
|
|
178
|
+
| 'hr'
|
|
179
|
+
| 'hu'
|
|
180
|
+
| 'it'
|
|
181
|
+
| 'lt'
|
|
182
|
+
| 'lv'
|
|
183
|
+
| 'mt'
|
|
184
|
+
| 'nl'
|
|
189
185
|
| 'nl-be'
|
|
190
|
-
| '
|
|
191
|
-
| '
|
|
192
|
-
| '
|
|
193
|
-
| '
|
|
194
|
-
| '
|
|
195
|
-
| '
|
|
196
|
-
| '
|
|
197
|
-
| 'sv-se';
|
|
186
|
+
| 'no'
|
|
187
|
+
| 'pl'
|
|
188
|
+
| 'pt'
|
|
189
|
+
| 'ro'
|
|
190
|
+
| 'sk'
|
|
191
|
+
| 'sl'
|
|
192
|
+
| 'sv';
|
|
198
193
|
```
|
|
199
194
|
|
|
200
195
|
```typescript
|
|
201
196
|
type StepId =
|
|
197
|
+
| 'accountHolderClassification'
|
|
202
198
|
| 'accountHolderContactInformation'
|
|
203
199
|
| 'accountHolderTaxInformation'
|
|
204
|
-
| 'accountHolderTaxClarification'
|
|
205
|
-
| 'accountHolderClassification'
|
|
206
200
|
| 'confirmation'
|
|
207
201
|
| 'exemptions'
|
|
208
202
|
| 'regardedOwnerClassification'
|
|
@@ -226,11 +220,21 @@ type Progress = {
|
|
|
226
220
|
|
|
227
221
|
## Changelog
|
|
228
222
|
|
|
229
|
-
### Version 0.
|
|
223
|
+
### Version 1.0.0-beta.1
|
|
224
|
+
|
|
225
|
+
1. Showing "\*" when required for Addresses on Summary
|
|
226
|
+
|
|
227
|
+
### Version 1.0.0-beta.0
|
|
230
228
|
|
|
231
|
-
1.
|
|
229
|
+
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.
|
|
230
|
+
2. Translations for country names are now coming from the Intl API.
|
|
231
|
+
3. Download URL available in the `useTaxbit` hook.
|
|
232
232
|
|
|
233
|
-
### Version 0.6.
|
|
233
|
+
### Version 0.6.2
|
|
234
|
+
|
|
235
|
+
1. Added this Changelog file
|
|
236
|
+
|
|
237
|
+
### Version 0.6.1
|
|
234
238
|
|
|
235
239
|
1. Native local terms for languages
|
|
236
240
|
2. Moved "Remove Residence" button, added section action button
|
|
@@ -264,7 +268,7 @@ type Progress = {
|
|
|
264
268
|
|
|
265
269
|
### Version 0.4.1
|
|
266
270
|
|
|
267
|
-
1. Bug fix for onProgress callback not being triggered from the
|
|
271
|
+
1. Bug fix for onProgress callback not being triggered from the TaxbitDPSQuestionnaire component.
|
|
268
272
|
|
|
269
273
|
### Version 0.4.0
|
|
270
274
|
|
|
@@ -296,6 +300,6 @@ type Progress = {
|
|
|
296
300
|
|
|
297
301
|
1. Fix in package.json to expose UMD module as main.
|
|
298
302
|
2. Added specific CSS class names for each question and each screen of the form.
|
|
299
|
-
3. Added the new status structure into the
|
|
300
|
-
4.
|
|
303
|
+
3. Added the new status structure into the useTaxbit hook.
|
|
304
|
+
4. TaxbitDPSQuestionnaire component will now preload the form with previously submitted data.
|
|
301
305
|
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';
|
|
4
|
+
import { ExternalValidations } from 'types/client';
|
|
3
5
|
import type { StepId } from 'types/StepId';
|
|
4
|
-
import { ClientTaxDocumentation, 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 {};
|