@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.
Files changed (250) hide show
  1. package/README.md +88 -76
  2. package/dist/src/components/Address/Address.d.ts +1 -2
  3. package/dist/src/components/ErrorMessage/ErrorMessage.d.ts +1 -2
  4. package/dist/src/components/Form/Form.d.ts +2 -1
  5. package/dist/src/components/Form/index.d.ts +1 -1
  6. package/dist/src/contexts/QuestionnaireUI/QuestionnaireUIProvider.d.ts +6 -0
  7. package/dist/src/contexts/QuestionnaireUI/getLocal.d.ts +19 -0
  8. package/dist/src/contexts/{FormUI → QuestionnaireUI}/index.d.ts +3 -3
  9. package/dist/src/contexts/{FormUI/useFormUI.d.ts → QuestionnaireUI/useQuestionnaireUI.d.ts} +6 -6
  10. package/dist/src/contexts/{FormUI/useFormUIContext.d.ts → QuestionnaireUI/useQuestionnaireUIContext.d.ts} +18 -18
  11. package/dist/src/contexts/TaxDocumentation/TaxbitQuestionnaireProvider.d.ts +7 -0
  12. package/dist/src/contexts/TaxDocumentation/index.d.ts +1 -1
  13. package/dist/src/contexts/TaxDocumentation/useTaxDocumentation.d.ts +13 -15
  14. package/dist/src/contexts/TaxDocumentation/useTaxDocumentationContext.d.ts +24 -30
  15. package/dist/src/contexts/index.d.ts +2 -2
  16. package/dist/src/entry/TaxbitQuestionnaire/TaxbitQuestionnaire.d.ts +9 -0
  17. package/dist/src/entry/TaxbitQuestionnaire/index.d.ts +1 -0
  18. package/dist/src/entry/index.d.ts +4 -6
  19. package/dist/src/hooks/index.d.ts +1 -1
  20. package/dist/src/hooks/useTaxbit/__tests__/clientTaxDocumentation.d.ts +2 -0
  21. package/dist/src/hooks/{useTaxBit → useTaxbit}/__tests__/serverTaxDocumentation.d.ts +1 -1
  22. package/dist/src/hooks/useTaxbit/index.d.ts +1 -0
  23. package/dist/src/hooks/useTaxbit/useTaxbit.d.ts +9 -0
  24. package/dist/src/hooks/useTaxbit/useTaxbitConnect.d.ts +8 -0
  25. package/dist/src/hooks/useTaxbit/useTaxbitStatus.d.ts +8 -0
  26. package/dist/src/i18n/index.d.ts +1 -1
  27. package/dist/src/i18n/locales/bg.d.ts +1 -0
  28. package/dist/src/i18n/locales/cs.d.ts +1 -0
  29. package/dist/src/i18n/locales/da.d.ts +1 -0
  30. package/dist/src/i18n/locales/de-at.d.ts +1 -2
  31. package/dist/src/i18n/locales/de.d.ts +3 -0
  32. package/dist/src/i18n/locales/el-cy.d.ts +3 -2
  33. package/dist/src/i18n/locales/el.d.ts +3 -0
  34. package/dist/src/i18n/locales/{bg-bg.d.ts → en-nz.d.ts} +1 -1
  35. package/dist/src/i18n/locales/{cs-cz.d.ts → en.d.ts} +1 -1
  36. package/dist/src/i18n/locales/{da-dk.d.ts → es.d.ts} +1 -1
  37. package/dist/src/i18n/locales/et.d.ts +1 -0
  38. package/dist/src/i18n/locales/fi.d.ts +1 -0
  39. package/dist/src/i18n/locales/{de-de.d.ts → fr-ca.d.ts} +1 -1
  40. package/dist/src/i18n/locales/fr-lu.d.ts +1 -2
  41. package/dist/src/i18n/locales/fr.d.ts +2 -0
  42. package/dist/src/i18n/locales/ga.d.ts +2 -0
  43. package/dist/src/i18n/locales/hr.d.ts +1 -0
  44. package/dist/src/i18n/locales/hu.d.ts +1 -0
  45. package/dist/src/i18n/locales/index.d.ts +33 -30
  46. package/dist/src/i18n/locales/it.d.ts +1 -0
  47. package/dist/src/i18n/locales/lt.d.ts +3 -0
  48. package/dist/src/i18n/locales/lv.d.ts +1 -0
  49. package/dist/src/i18n/locales/mergePropertyFiles.d.ts +6 -0
  50. package/dist/src/i18n/locales/mt.d.ts +1 -0
  51. package/dist/src/i18n/locales/nl-be.d.ts +3 -2
  52. package/dist/src/i18n/locales/nl.d.ts +1 -0
  53. package/dist/src/i18n/locales/no.d.ts +1 -0
  54. package/dist/src/i18n/locales/pl.d.ts +3 -0
  55. package/dist/src/i18n/locales/pt.d.ts +1 -0
  56. package/dist/src/i18n/locales/ro.d.ts +1 -0
  57. package/dist/src/i18n/locales/sk.d.ts +1 -0
  58. package/dist/src/i18n/locales/sl.d.ts +1 -0
  59. package/dist/src/i18n/locales/sv.d.ts +1 -0
  60. package/dist/src/i18n/locales/translation-missing.d.ts +5 -0
  61. package/dist/src/i18n/localizationFileMap.d.ts +7 -0
  62. package/dist/src/i18n/types/LocalizationKey.d.ts +8 -8
  63. package/dist/src/i18n/types/PropertyFile.d.ts +23 -19
  64. package/dist/src/i18n/utils/getText.d.ts +2 -9
  65. package/dist/src/lookups/countryOptions.d.ts +1 -7
  66. package/dist/src/lookups/dayOptions.d.ts +1 -1
  67. package/dist/src/lookups/fatcaCodeOptions.d.ts +2 -2
  68. package/dist/src/lookups/foreignAccountHolderAccountTypeOptions.d.ts +3 -15
  69. package/dist/src/lookups/foreignOtherClassificationOptions.d.ts +3 -17
  70. package/dist/src/lookups/foreignRegardedOwnerAccountTypeOptions.d.ts +3 -11
  71. package/dist/src/lookups/foreignTrustClassificationOptions.d.ts +3 -9
  72. package/dist/src/lookups/index.d.ts +13 -16
  73. package/dist/src/lookups/localeOptions.d.ts +5 -1
  74. package/dist/src/lookups/payeeCodeOptions.d.ts +2 -2
  75. package/dist/src/lookups/toOptions.d.ts +1 -1
  76. package/dist/src/lookups/usAccountHolderAccountTypeOptions.d.ts +3 -23
  77. package/dist/src/lookups/usLlcAccountTypeOptions.d.ts +3 -9
  78. package/dist/src/lookups/usRegardedOwnerAccountTypeOptions.d.ts +3 -15
  79. package/dist/src/services/api.d.ts +7 -2
  80. package/dist/src/test/Wrapper.d.ts +3 -3
  81. package/dist/src/test/getWrapper.d.ts +3 -3
  82. package/dist/src/test/utils/helpers.d.ts +7 -2
  83. package/dist/src/types/InputStep.d.ts +2 -2
  84. package/dist/src/types/Locale.d.ts +1 -1
  85. package/dist/src/types/Questionnaire.d.ts +1 -0
  86. package/dist/src/types/StepId.d.ts +1 -1
  87. package/dist/src/types/TaxDocumentation.d.ts +30 -30
  88. package/dist/src/types/client/ClientTaxDocumentationStatus.d.ts +12 -3
  89. package/dist/src/types/client/index.d.ts +0 -1
  90. package/dist/src/types/index.d.ts +1 -6
  91. package/dist/src/types/server/TaxDocumentationStatus.d.ts +12 -3
  92. package/dist/src/types/server/index.d.ts +0 -1
  93. package/dist/src/ui/ActionButton/index.d.ts +1 -1
  94. package/dist/src/ui/CheckBox/CheckBox.d.ts +2 -1
  95. package/dist/src/ui/DateOfBirthInput/DateOfBirthInput.d.ts +1 -2
  96. package/dist/src/ui/DateOfBirthInput/index.d.ts +1 -1
  97. package/dist/src/ui/DateOfBirthInput/useDateOfBirthInput.d.ts +2 -2
  98. package/dist/src/ui/FormattedInput/FormattedInput.d.ts +11 -0
  99. package/dist/src/ui/FormattedInput/index.d.ts +1 -0
  100. package/dist/src/ui/PasswordInput/PasswordInput.d.ts +9 -0
  101. package/dist/src/ui/PasswordInput/index.d.ts +1 -0
  102. package/dist/src/ui/RadioButtons/index.d.ts +1 -1
  103. package/dist/src/ui/Select/index.d.ts +1 -1
  104. package/dist/src/ui/{MaskedInput/MaskedInput.d.ts → ShowHideInput/ShowHideInput.d.ts} +2 -3
  105. package/dist/src/ui/ShowHideInput/index.d.ts +1 -0
  106. package/dist/src/ui/TextInput/TextInput.d.ts +1 -2
  107. package/dist/src/ui/TextInput/index.d.ts +1 -1
  108. package/dist/src/ui/index.d.ts +3 -1
  109. package/dist/src/utils/formatUsTin.d.ts +5 -0
  110. package/dist/src/utils/getFieldsState.d.ts +16 -10
  111. package/dist/src/utils/getMaskedContent.d.ts +1 -0
  112. package/dist/src/utils/getPromptKeyMap.d.ts +22 -22
  113. package/dist/src/utils/index.d.ts +3 -2
  114. package/dist/src/utils/mergeClientTaxDocumentationData.d.ts +1 -1
  115. package/dist/src/utils/transformForClient/convertYesNoToBoolean.d.ts +1 -1
  116. package/dist/src/utils/transformForClient/convertYesNoToBooleanOrUndefined.d.ts +2 -0
  117. package/dist/src/utils/transformForClient/index.d.ts +1 -1
  118. package/dist/src/utils/transformForClient/transformForClient.d.ts +3 -2
  119. package/dist/src/utils/transformForClient/transformForClientAccoutHolder.d.ts +1 -53
  120. package/dist/src/utils/transformForClient/transformForClientRegardedOwner.d.ts +1 -36
  121. package/dist/src/utils/transformInbound/getForeignAccountType.d.ts +1 -1
  122. package/dist/src/utils/transformInbound/getForeignOtherClassification.d.ts +1 -1
  123. package/dist/src/utils/transformInbound/getForeignTrustClassification.d.ts +1 -1
  124. package/dist/src/utils/transformInbound/getLLCClassification.d.ts +1 -1
  125. package/dist/src/utils/transformInbound/getUsAccountType.d.ts +1 -1
  126. package/dist/src/utils/transformInbound/transformInbound.d.ts +3 -3
  127. package/dist/src/utils/uppercase.d.ts +1 -0
  128. package/dist/src/validations/getInvalidFields.d.ts +2 -2
  129. package/dist/src/validations/getRequiredFields.d.ts +2 -2
  130. package/dist/src/validations/getSupportedFields.d.ts +2 -2
  131. package/dist/src/validations/getVisibleFields.d.ts +2 -2
  132. package/dist/src/widgets/TaxbitQuestionnairePersist/TaxbitQuestionnairePersist.d.ts +5 -0
  133. package/dist/src/widgets/TaxbitQuestionnairePersist/index.d.ts +2 -0
  134. package/dist/src/widgets/TaxbitQuestionnairePersist/useTaxbitPersist.d.ts +25 -0
  135. package/dist/src/widgets/index.d.ts +1 -1
  136. package/dist/src/wizard/AddressInput/AddressInput.d.ts +2 -1
  137. package/dist/src/wizard/LanguageSelector/LanguageSelector.d.ts +4 -1
  138. package/dist/src/wizard/ResidenceInput/ResidenceInput.d.ts +1 -2
  139. package/dist/src/wizard/RowInput/AddressRow/AddressRow.d.ts +2 -1
  140. package/dist/src/wizard/RowInput/CheckBoxRow/CheckBoxRow.d.ts +4 -3
  141. package/dist/src/wizard/RowInput/DateOfBirthRow/index.d.ts +1 -1
  142. package/dist/src/wizard/RowInput/ErrorRow/index.d.ts +1 -1
  143. package/dist/src/wizard/RowInput/RadioButtonRow/RadioButtonRow.d.ts +2 -2
  144. package/dist/src/wizard/RowInput/ShowHideInputRow/ShowHideInputRow.d.ts +11 -0
  145. package/dist/src/wizard/RowInput/ShowHideInputRow/index.d.ts +1 -0
  146. package/dist/src/wizard/RowInput/TextInputRow/TextInputRow.d.ts +3 -4
  147. package/dist/src/wizard/RowInput/index.d.ts +1 -1
  148. package/dist/src/wizard/TaxbitQuestionnaireUI/AccountHolderClassification/index.d.ts +1 -0
  149. package/dist/src/wizard/TaxbitQuestionnaireUI/AccountHolderContact/index.d.ts +1 -0
  150. package/dist/src/wizard/TaxbitQuestionnaireUI/AccountHolderTax/index.d.ts +1 -0
  151. package/dist/src/wizard/TaxbitQuestionnaireUI/AccountHolderTaxClarification/index.d.ts +1 -0
  152. package/dist/src/wizard/TaxbitQuestionnaireUI/AppError/index.d.ts +1 -0
  153. package/dist/src/wizard/TaxbitQuestionnaireUI/Exemptions/index.d.ts +1 -0
  154. package/dist/src/wizard/TaxbitQuestionnaireUI/RegardedOwnerContact/index.d.ts +1 -0
  155. package/dist/src/wizard/TaxbitQuestionnaireUI/RegardedOwnerTax/index.d.ts +1 -0
  156. package/dist/src/wizard/TaxbitQuestionnaireUI/Summary/index.d.ts +1 -0
  157. package/dist/src/wizard/TaxbitQuestionnaireUI/TaxbitQuestionnaireUI.d.ts +6 -0
  158. package/dist/src/wizard/TaxbitQuestionnaireUI/index.d.ts +1 -0
  159. package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/steps.d.ts +0 -1
  160. package/dist/src/wizard/index.d.ts +1 -1
  161. package/dist/taxbit-react-sdk.js +5799 -16652
  162. package/dist/taxbit-react-sdk.umd.cjs +10 -10
  163. package/package.json +13 -19
  164. package/style/basic.css +32 -13
  165. package/style/inline.css +32 -13
  166. package/dist/src/contexts/FormUI/FormUIProvider.d.ts +0 -6
  167. package/dist/src/contexts/FormUI/getLocal.d.ts +0 -20
  168. package/dist/src/contexts/TaxDocumentation/TaxBitFormProvider.d.ts +0 -7
  169. package/dist/src/hooks/useTaxBit/__tests__/clientTaxDocumentation.d.ts +0 -2
  170. package/dist/src/hooks/useTaxBit/index.d.ts +0 -1
  171. package/dist/src/hooks/useTaxBit/useTaxBit.d.ts +0 -7
  172. package/dist/src/i18n/i18n.d.ts +0 -7
  173. package/dist/src/i18n/locales/el-gr.d.ts +0 -2
  174. package/dist/src/i18n/locales/es-es.d.ts +0 -2
  175. package/dist/src/i18n/locales/et-ee.d.ts +0 -2
  176. package/dist/src/i18n/locales/fi-fi.d.ts +0 -2
  177. package/dist/src/i18n/locales/fr-fr.d.ts +0 -2
  178. package/dist/src/i18n/locales/ga-ie.d.ts +0 -2
  179. package/dist/src/i18n/locales/hr-hr.d.ts +0 -2
  180. package/dist/src/i18n/locales/hu-hu.d.ts +0 -2
  181. package/dist/src/i18n/locales/it-it.d.ts +0 -2
  182. package/dist/src/i18n/locales/lt-lt.d.ts +0 -2
  183. package/dist/src/i18n/locales/lv-lv.d.ts +0 -2
  184. package/dist/src/i18n/locales/mt-mt.d.ts +0 -2
  185. package/dist/src/i18n/locales/nl-nl.d.ts +0 -2
  186. package/dist/src/i18n/locales/no-no.d.ts +0 -2
  187. package/dist/src/i18n/locales/pl-pl.d.ts +0 -2
  188. package/dist/src/i18n/locales/pt-pt.d.ts +0 -2
  189. package/dist/src/i18n/locales/ro-ro.d.ts +0 -2
  190. package/dist/src/i18n/locales/sk-sk.d.ts +0 -2
  191. package/dist/src/i18n/locales/sl-si.d.ts +0 -2
  192. package/dist/src/i18n/locales/sv-se.d.ts +0 -2
  193. package/dist/src/lookups/caProvinceOptions.d.ts +0 -4
  194. package/dist/src/lookups/monthOptions.d.ts +0 -4
  195. package/dist/src/lookups/usStateOptions.d.ts +0 -4
  196. package/dist/src/types/AccountType.d.ts +0 -6
  197. package/dist/src/types/CaProvinceCode.d.ts +0 -1
  198. package/dist/src/types/CountryCode.d.ts +0 -3
  199. package/dist/src/types/MonthCode.d.ts +0 -1
  200. package/dist/src/types/TaxForm.d.ts +0 -1
  201. package/dist/src/types/UsStateCode.d.ts +0 -1
  202. package/dist/src/types/client/ClientTaxDocumentation.d.ts +0 -84
  203. package/dist/src/types/server/ComprehensiveTaxDocumentation.d.ts +0 -84
  204. package/dist/src/ui/MaskedInput/index.d.ts +0 -1
  205. package/dist/src/ui/Password/Password.d.ts +0 -12
  206. package/dist/src/ui/Password/index.d.ts +0 -1
  207. package/dist/src/utils/date.d.ts +0 -4
  208. package/dist/src/utils/getHintKeyMap.d.ts +0 -113
  209. package/dist/src/utils/getVerboseDate.d.ts +0 -1
  210. package/dist/src/widgets/TaxBitForm/TaxBitDAC7Form.d.ts +0 -4
  211. package/dist/src/widgets/TaxBitForm/TaxBitForm.d.ts +0 -5
  212. package/dist/src/widgets/TaxBitForm/index.d.ts +0 -2
  213. package/dist/src/widgets/TaxBitForm/useTaxBitForm.d.ts +0 -22
  214. package/dist/src/wizard/PlaceOfBirthInput/PlaceOfBirthInput.d.ts +0 -2
  215. package/dist/src/wizard/PlaceOfBirthInput/index.d.ts +0 -1
  216. package/dist/src/wizard/RowInput/MaskedInputRow/MaskedInputRow.d.ts +0 -11
  217. package/dist/src/wizard/RowInput/MaskedInputRow/index.d.ts +0 -1
  218. package/dist/src/wizard/TaxBitFormUI/AccountHolderClassification/index.d.ts +0 -1
  219. package/dist/src/wizard/TaxBitFormUI/AccountHolderContact/index.d.ts +0 -1
  220. package/dist/src/wizard/TaxBitFormUI/AccountHolderTax/index.d.ts +0 -1
  221. package/dist/src/wizard/TaxBitFormUI/AccountHolderTaxClarification/index.d.ts +0 -1
  222. package/dist/src/wizard/TaxBitFormUI/AppError/index.d.ts +0 -1
  223. package/dist/src/wizard/TaxBitFormUI/Exemptions/index.d.ts +0 -1
  224. package/dist/src/wizard/TaxBitFormUI/RegardedOwnerClassification/RegardedOwnerClassification.d.ts +0 -2
  225. package/dist/src/wizard/TaxBitFormUI/RegardedOwnerClassification/index.d.ts +0 -1
  226. package/dist/src/wizard/TaxBitFormUI/RegardedOwnerContact/index.d.ts +0 -1
  227. package/dist/src/wizard/TaxBitFormUI/RegardedOwnerTax/index.d.ts +0 -1
  228. package/dist/src/wizard/TaxBitFormUI/Summary/index.d.ts +0 -1
  229. package/dist/src/wizard/TaxBitFormUI/TaxBitDAC7FormUI.d.ts +0 -4
  230. package/dist/src/wizard/TaxBitFormUI/TaxBitFormUI.d.ts +0 -6
  231. package/dist/src/wizard/TaxBitFormUI/index.d.ts +0 -2
  232. /package/dist/src/contexts/{FormUI → QuestionnaireUI}/shiftResidence.d.ts +0 -0
  233. /package/dist/src/widgets/{TaxBitForm/__tests__/TaxBitDAC7Form.loaded.test.d.ts → TaxbitQuestionnairePersist/__tests__/TaxbitQuestionnairePersist.complete.test.d.ts} +0 -0
  234. /package/dist/src/widgets/{TaxBitForm/__tests__/TaxBitForm.complete.test.d.ts → TaxbitQuestionnairePersist/__tests__/TaxbitQuestionnairePersist.loaded.test.d.ts} +0 -0
  235. /package/dist/src/widgets/{TaxBitForm/__tests__/TaxBitForm.loaded.test.d.ts → TaxbitQuestionnairePersist/__tests__/TaxbitQuestionnairePersist.loading.test.d.ts} +0 -0
  236. /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/AccountHolderClassification/AccountHolderClassification.d.ts +0 -0
  237. /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/AccountHolderContact/AccountHolderContact.d.ts +0 -0
  238. /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/AccountHolderTax/AccountHolderTax.d.ts +0 -0
  239. /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/AccountHolderTaxClarification/AccountHolderTaxClarification.d.ts +0 -0
  240. /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/AppError/AppError.d.ts +0 -0
  241. /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/Confirmation/Confirmation.d.ts +0 -0
  242. /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/Confirmation/index.d.ts +0 -0
  243. /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/Exemptions/Exemptions.d.ts +0 -0
  244. /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/RegardedOwnerContact/RegardedOwnerContact.d.ts +0 -0
  245. /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/RegardedOwnerTax/RegardedOwnerTax.d.ts +0 -0
  246. /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/Summary/Recap.d.ts +0 -0
  247. /package/dist/src/wizard/{TaxBitFormUI → TaxbitQuestionnaireUI}/Summary/Summary.d.ts +0 -0
  248. /package/dist/src/{widgets/TaxBitForm/__tests__/TaxBitForm.loading.test.d.ts → wizard/TaxbitQuestionnaireUI/__tests__/TaxbitDPSQuestionnaireUI.test.d.ts} +0 -0
  249. /package/dist/src/wizard/{TaxBitFormUI/__tests__/TaxBitDAC7FormUI.test.d.ts → TaxbitQuestionnaireUI/__tests__/TaxbitQuestionnaireUI.test.d.ts} +0 -0
  250. /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
- # TaxBit React SDK
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 { TaxBitDAC7Form, ClientTaxDocumentation } from '@taxbit/react-sdk';
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
- <TaxBitDAC7Form
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
- Which is just a shortcut for this component...
73
+ For W-9 W-8BEN and W-8BEN-E forms, this component can be used...
74
74
 
75
75
  ```jsx
76
- <TaxBitForm
76
+ <TaxbitQuestionnaire
77
77
  data={exampleData} // `data` is an optional prop
78
78
  bearerToken="bearer token goes here"
79
- language="en-us" // 'en-us' is the default
80
- forms={['DAC7']}
79
+ questionnaire="W-FORM"
80
+ language="en" // 'en' is the default
81
81
  staging // if not production
82
82
  />
83
83
  ```
84
84
 
85
- There is a more basic component that simply shows the TaxBit UI and does not interact with the TaxBit server. It can be used like this...
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 { TaxBitDAC7FormUI, ClientTaxDocumentation } from '@taxbit/react-sdk';
88
+ import { TaxbitQuestionnaire, ClientTaxDocumentation } from '@taxbit/react-sdk';
89
89
 
90
- <TaxBitDAC7FormUI
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 TaxBit API and passed in as a prop to the component.
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
- This can also be initially set to any of that languages that are supported by the TaxBit API.
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 `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:
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
- DAC7Interview: {
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
- "DAC7Interview": {
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 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.
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 TaxBit React SDK provides callbacks for the following events on the `TaxBitDAC7Form` component. These callbacks can be passed in to the Component and used to trigger other actions in your application.
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 TaxBit UI. The function passed here will be passed a Progress object (see below for the type definition):
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 DAC7 sequence, for example, can have a total of 3, 4, or 5 steps, each with a localized `stepTitle` and `stepId`. The `stepNumber` is the current step (1 based), and `percentComplete` is the percentage of the steps that have been completed.
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 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`.
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-bg'
169
- | 'cs-cz'
170
- | 'da-dk'
170
+ | 'bg'
171
+ | 'cs'
172
+ | 'da'
173
+ | 'de'
171
174
  | 'de-at'
172
- | 'de-de'
175
+ | 'el'
173
176
  | 'el-cy'
174
- | 'el-gr'
177
+ | 'en'
175
178
  | 'en-gb'
176
179
  | 'en-us'
177
- | 'es-es'
178
- | 'et-ee'
179
- | 'fi-fi'
180
- | 'fr-fr'
180
+ | 'es'
181
+ | 'et'
182
+ | 'fi'
183
+ | 'fr'
181
184
  | 'fr-lu'
182
- | 'ga-ie'
183
- | 'hr-hr'
184
- | 'hu-hu'
185
- | 'it-it'
186
- | 'lt-lt'
187
- | 'lv-lv'
188
- | 'mt-mt'
185
+ | 'ga'
186
+ | 'hr'
187
+ | 'hu'
188
+ | 'it'
189
+ | 'lt'
190
+ | 'lv'
191
+ | 'mt'
192
+ | 'nl'
189
193
  | 'nl-be'
190
- | 'nl-nl'
191
- | 'no-no'
192
- | 'pl-pl'
193
- | 'pt-pt'
194
- | 'ro-ro'
195
- | 'sk-sk'
196
- | 'sl-si'
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.6.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
- - Native local terms for languages
232
- - Moved "Remove Residence" button, added section action button
233
- - Fixed Type for onSubmit callback. Callback can be async or not async.
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
- - Place of Birth: Localized text update
238
- - Confirming valid ISO country code in data
239
- - Setting account holder name as the default value on Financial Account Identifier
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
- - Adding all error messages to Summary Screen
244
- - Submit button is disabled when saved data matches local data
245
- - Indicate in form footer when errors are in the form above
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
- - Handle blank bearer token. No error, but a warning is logged.
261
+ 1. Handle blank bearer token. No error, but a warning is logged.
250
262
 
251
263
  ### Version 0.4.3
252
264
 
253
- - Show error on VAT Identifier field when the Identifier is determined to be invalid
254
- - Fix: data should not reset on react render
255
- - Fix: changing data prop will reset form
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
- - Added stepIndex and steps fields to the Progress object. stepId is now typed to potential enum values.
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
- - Bug fix for onProgress callback not being triggered from the TaxBitDAC7Form component.
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
- - Added onProgress callback.
268
- - Showing multiple errors for DAC7 Tax residency when the case arises.
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
- - Added business registration questions to the form.
273
- - Added confirmation checkbox to the summary screen before submission.
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
- - Bug fix for naming of CommonJS module exports.
289
+ 1. Bug fix for naming of CommonJS module exports.
278
290
 
279
291
  ### Version 0.2.3
280
292
 
281
- - Bug fix for the ClientTaxDocumentationStatus type not being accessible externally.
293
+ 1. Bug fix for the ClientTaxDocumentationStatus type not being accessible externally.
282
294
 
283
295
  ### Version 0.2.2
284
296
 
285
- - onSubmit and onSuccess callbacks are invoked with a parameter of type ClientTaxDocumentation which is now exposed.
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
- - The SDK now supports React versions 16, 17, and 18 and TypeScript versions 4 and 5.
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
- - Fix in package.json to expose UMD module as main.
294
- - Added specific CSS class names for each question and each screen of the form.
295
- - Added the new status structure into the useTaxBit hook.
296
- - TaxBitDAC7Form component will now preload the form with previously submitted data.
297
- - Validation update to enforce that primary address country and tax residence country are the same.
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 | UsStateCode | CaProvinceCode;
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, hint, }: {
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.tsx';
1
+ export * from './Form';
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ type FormUIProviderProps = {
3
+ children: React.ReactNode;
4
+ };
5
+ export declare const QuestionnaireUIProvider: ({ children }: FormUIProviderProps) => React.JSX.Element;
6
+ export {};
@@ -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 './useFormUI';
2
- export * from './FormUIProvider';
3
- export * from './useFormUIContext';
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 useFormUI: () => {
11
+ export declare const useQuestionnaireUI: () => {
12
12
  config: {
13
13
  minimumAge: number;
14
14
  } | undefined;
15
- getLocalHint: (key: keyof import("types").AccountHolderContactData | keyof import("types").AccountHolderTaxData | keyof import("types").AccountHolderClassificationData | keyof import("types").RegardedOwnerContactData | keyof import("types").RegardedOwnerClassificationData | keyof import("types").RegardedOwnerTaxData | keyof import("types").SummaryData | keyof import("types").CalculatedData) => string | undefined;
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: "taxResidences") => string;
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) => string;
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: 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) => import("i18n/types").SubPromptKey;
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 useFormUIContext: () => {
2
+ export declare const useQuestionnaireUIContext: () => {
3
3
  config: {
4
4
  minimumAge: number;
5
5
  } | undefined;
6
- getLocalHint: (key: keyof import("../../types").AccountHolderContactData | keyof import("../../types").AccountHolderTaxData | keyof import("../../types").AccountHolderClassificationData | keyof import("../../types").RegardedOwnerContactData | keyof import("../../types").RegardedOwnerClassificationData | keyof import("../../types").RegardedOwnerTaxData | keyof import("../../types").SummaryData | keyof import("../../types").CalculatedData) => string | undefined;
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: "taxResidences") => string;
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) => string;
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: 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) => import("../../i18n/types").SubPromptKey;
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("./useFormUI").TaxDocumentationPropertyFile;
34
- invalidFields: import("./useFormUI").TaxDocumentationErrorFile;
35
- requiredFields: import("./useFormUI").TaxDocumentationPropertyFile;
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
- }, FormUIContextProvider: import("react").Provider<{
38
+ }, QuestionnaireUIContextProvider: import("react").Provider<{
39
39
  config: {
40
40
  minimumAge: number;
41
41
  } | undefined;
42
- getLocalHint: (key: keyof import("../../types").AccountHolderContactData | keyof import("../../types").AccountHolderTaxData | keyof import("../../types").AccountHolderClassificationData | keyof import("../../types").RegardedOwnerContactData | keyof import("../../types").RegardedOwnerClassificationData | keyof import("../../types").RegardedOwnerTaxData | keyof import("../../types").SummaryData | keyof import("../../types").CalculatedData) => string | undefined;
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: "taxResidences") => string;
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) => string;
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: 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) => import("../../i18n/types").SubPromptKey;
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("./useFormUI").TaxDocumentationPropertyFile;
70
- invalidFields: import("./useFormUI").TaxDocumentationErrorFile;
71
- requiredFields: import("./useFormUI").TaxDocumentationPropertyFile;
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,3 +1,3 @@
1
- export * from './TaxBitFormProvider';
1
+ export * from './TaxbitQuestionnaireProvider';
2
2
  export type { UseTaxDocumentationProps } from './useTaxDocumentation';
3
3
  export * from './useTaxDocumentationContext';
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
- import type { InputStep, Locale, Progress, TaxDocumentation, TaxForm } from 'types';
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 { ClientTaxDocumentation, ExternalValidations } from 'types/client';
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
- taxForms?: TaxForm[];
16
+ questionnaire?: Questionnaire;
16
17
  config?: InterviewConfig;
17
18
  };
18
- export declare const useTaxDocumentation: ({ data: startingData, language: initialLanguage, externalValidations, onSubmit, onProgress, step: initialStep, taxForms: supportedForms, config, }: UseTaxDocumentationProps) => {
19
- isW9: boolean;
20
- isW8: boolean;
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" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
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" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
39
- setLanguage: import("react").Dispatch<import("react").SetStateAction<"bg-bg" | "cs-cz" | "da-dk" | "de-at" | "de-de" | "el-cy" | "el-gr" | "en-gb" | "en-us" | "es-es" | "et-ee" | "fi-fi" | "fr-fr" | "fr-lu" | "ga-ie" | "hr-hr" | "hu-hu" | "it-it" | "lt-lt" | "lv-lv" | "mt-mt" | "nl-be" | "nl-nl" | "no-no" | "pl-pl" | "pt-pt" | "ro-ro" | "sk-sk" | "sl-si" | "sv-se">>;
40
- language: "bg-bg" | "cs-cz" | "da-dk" | "de-at" | "de-de" | "el-cy" | "el-gr" | "en-gb" | "en-us" | "es-es" | "et-ee" | "fi-fi" | "fr-fr" | "fr-lu" | "ga-ie" | "hr-hr" | "hu-hu" | "it-it" | "lt-lt" | "lv-lv" | "mt-mt" | "nl-be" | "nl-nl" | "no-no" | "pl-pl" | "pt-pt" | "ro-ro" | "sk-sk" | "sl-si" | "sv-se";
41
- supportedForms: TaxForm[];
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 {};