@taxbit/react-sdk 0.5.1 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/README.md +72 -0
  2. package/dist/src/components/Section/Section.d.ts +3 -2
  3. package/dist/src/contexts/FormUI/getLocal.d.ts +0 -1
  4. package/dist/src/contexts/FormUI/useFormUI.d.ts +3 -1
  5. package/dist/src/contexts/FormUI/useFormUIContext.d.ts +6 -2
  6. package/dist/src/contexts/TaxDocumentation/TaxBitFormProvider.d.ts +3 -11
  7. package/dist/src/contexts/TaxDocumentation/index.d.ts +3 -2
  8. package/dist/src/contexts/TaxDocumentation/useTaxDocumentation.d.ts +10 -6
  9. package/dist/src/contexts/TaxDocumentation/useTaxDocumentationContext.d.ts +6 -0
  10. package/dist/src/i18n/index.d.ts +1 -1
  11. package/dist/src/i18n/types/LocalizationKey.d.ts +2 -2
  12. package/dist/src/i18n/types/PropertyFile.d.ts +0 -4
  13. package/dist/src/i18n/utils/getText.d.ts +0 -1
  14. package/dist/src/lookups/localeOptions.d.ts +2 -1
  15. package/dist/src/lookups/yearOptions.d.ts +3 -1
  16. package/dist/src/ui/DateOfBirthInput/useDateOfBirthInput.d.ts +2 -2
  17. package/dist/src/utils/date.d.ts +1 -0
  18. package/dist/src/widgets/TaxBitForm/TaxBitForm.d.ts +3 -19
  19. package/dist/src/widgets/TaxBitForm/useTaxBitForm.d.ts +13 -2
  20. package/dist/src/wizard/ResidenceInput/ResidenceInput.d.ts +3 -2
  21. package/dist/src/wizard/RowInput/ToggleButtonRow/ToggleButtonRow.d.ts +2 -2
  22. package/dist/src/wizard/TaxBitFormUI/TaxBitFormUI.d.ts +2 -5
  23. package/dist/taxbit-react-sdk.js +1516 -2418
  24. package/dist/taxbit-react-sdk.umd.cjs +10 -10
  25. package/package.json +7 -8
  26. package/{dist → style}/basic.css +8 -1
  27. package/{dist → style}/inline.css +8 -1
  28. /package/{dist → style}/index.css +0 -0
  29. /package/{dist → style}/minimal.css +0 -0
package/README.md CHANGED
@@ -223,3 +223,75 @@ type Progress = {
223
223
  totalSteps: number;
224
224
  };
225
225
  ```
226
+
227
+ ## Changelog
228
+
229
+ ### Version 0.6.0
230
+
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.
234
+
235
+ ### Version 0.5.1
236
+
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
240
+
241
+ ### Version 0.5.0
242
+
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
246
+
247
+ ### Version 0.4.4
248
+
249
+ - Handle blank bearer token. No error, but a warning is logged.
250
+
251
+ ### Version 0.4.3
252
+
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
256
+
257
+ ### Version 0.4.2
258
+
259
+ - Added stepIndex and steps fields to the Progress object. stepId is now typed to potential enum values.
260
+
261
+ ### Version 0.4.1
262
+
263
+ - Bug fix for onProgress callback not being triggered from the TaxBitDAC7Form component.
264
+
265
+ ### Version 0.4.0
266
+
267
+ - Added onProgress callback.
268
+ - Showing multiple errors for DAC7 Tax residency when the case arises.
269
+
270
+ ### Version 0.3.0
271
+
272
+ - Added business registration questions to the form.
273
+ - Added confirmation checkbox to the summary screen before submission.
274
+
275
+ ### Version 0.2.4
276
+
277
+ - Bug fix for naming of CommonJS module exports.
278
+
279
+ ### Version 0.2.3
280
+
281
+ - Bug fix for the ClientTaxDocumentationStatus type not being accessible externally.
282
+
283
+ ### Version 0.2.2
284
+
285
+ - onSubmit and onSuccess callbacks are invoked with a parameter of type ClientTaxDocumentation which is now exposed.
286
+
287
+ ### Version 0.2.1
288
+
289
+ - The SDK now supports React versions 16, 17, and 18 and TypeScript versions 4 and 5.
290
+
291
+ ### Version 0.2.0
292
+
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.
@@ -1,9 +1,10 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  type SectionProps = {
3
3
  title?: string;
4
4
  subTitle?: string;
5
5
  showIf?: boolean;
6
+ action?: React.ReactNode;
6
7
  children: React.ReactNode;
7
8
  };
8
- export declare const Section: ({ title, subTitle, showIf, children, }: SectionProps) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
9
+ export declare const Section: ({ title, subTitle, showIf, children, action, }: SectionProps) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
9
10
  export {};
@@ -6,7 +6,6 @@ export declare const getLocal: (fields: TaxDocumentation, language: Locale) => {
6
6
  getLocalTitle: (key: string) => string;
7
7
  getLocalSubTitle: (key: SubTitleKey) => string;
8
8
  getLocalError: (key: ErrorKey) => string;
9
- getLocalLocale: (key: Locale) => string;
10
9
  getLocalButton: (key: ButtonKey) => string;
11
10
  getLocalPrompt: (key: string) => string;
12
11
  getLocalSubPrompt: (key: TaxDocumentationKey) => string;
@@ -9,12 +9,14 @@ export type TaxDocumentationErrorFile = {
9
9
  [key in TaxDocumentationKey]?: ErrorKey[];
10
10
  };
11
11
  export declare const useFormUI: () => {
12
+ config: {
13
+ minimumAge: number;
14
+ } | undefined;
12
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;
13
16
  getLocalText: (key: import("i18n/types").TextKey) => string;
14
17
  getLocalTitle: (key: string) => string;
15
18
  getLocalSubTitle: (key: "taxResidences") => string;
16
19
  getLocalError: (key: ErrorKey) => string;
17
- getLocalLocale: (key: import("types").Locale) => string;
18
20
  getLocalButton: (key: import("i18n/types").ButtonKey) => string;
19
21
  getLocalPrompt: (key: string) => string;
20
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;
@@ -1,11 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  export declare const useFormUIContext: () => {
3
+ config: {
4
+ minimumAge: number;
5
+ } | undefined;
3
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;
4
7
  getLocalText: (key: import("../../i18n/types").TextKey) => string;
5
8
  getLocalTitle: (key: string) => string;
6
9
  getLocalSubTitle: (key: "taxResidences") => string;
7
10
  getLocalError: (key: import("../../i18n/types").ErrorKey) => string;
8
- getLocalLocale: (key: import("../../types").Locale) => string;
9
11
  getLocalButton: (key: import("../../i18n/types").ButtonKey) => string;
10
12
  getLocalPrompt: (key: string) => string;
11
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;
@@ -34,12 +36,14 @@ export declare const useFormUIContext: () => {
34
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;
35
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;
36
38
  }, FormUIContextProvider: import("react").Provider<{
39
+ config: {
40
+ minimumAge: number;
41
+ } | undefined;
37
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;
38
43
  getLocalText: (key: import("../../i18n/types").TextKey) => string;
39
44
  getLocalTitle: (key: string) => string;
40
45
  getLocalSubTitle: (key: "taxResidences") => string;
41
46
  getLocalError: (key: import("../../i18n/types").ErrorKey) => string;
42
- getLocalLocale: (key: import("../../types").Locale) => string;
43
47
  getLocalButton: (key: import("../../i18n/types").ButtonKey) => string;
44
48
  getLocalPrompt: (key: string) => string;
45
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;
@@ -1,15 +1,7 @@
1
1
  import React from 'react';
2
- import type { InputStep, Locale, Progress, TaxForm } from '../../types';
3
- import { ClientTaxDocumentation, ExternalValidations } from '../../types/client';
4
- type TaxDocumentationProviderProps = {
5
- data?: ClientTaxDocumentation;
6
- onSubmit: (data: ClientTaxDocumentation) => Promise<void>;
7
- language?: Locale;
2
+ import { UseTaxDocumentationProps } from './useTaxDocumentation';
3
+ type TaxDocumentationProviderProps = UseTaxDocumentationProps & {
8
4
  children: React.ReactNode;
9
- taxForms?: TaxForm[];
10
- step?: InputStep;
11
- onProgress?: (progress: Progress) => void;
12
- externalValidations?: ExternalValidations;
13
5
  };
14
- export declare const TaxBitFormProvider: ({ data, externalValidations, onSubmit, onProgress, language, taxForms, step, children, }: TaxDocumentationProviderProps) => React.JSX.Element;
6
+ export declare const TaxBitFormProvider: ({ data, externalValidations, onSubmit, onProgress, language, taxForms, step, children, config, }: TaxDocumentationProviderProps) => React.JSX.Element;
15
7
  export {};
@@ -1,2 +1,3 @@
1
- export * from "./useTaxDocumentationContext";
2
- export * from "./TaxBitFormProvider";
1
+ export * from './TaxBitFormProvider';
2
+ export type { UseTaxDocumentationProps } from './useTaxDocumentation';
3
+ export * from './useTaxDocumentationContext';
@@ -2,17 +2,20 @@
2
2
  import type { InputStep, Locale, Progress, TaxDocumentation, TaxForm } from 'types';
3
3
  import type { StepId } from 'types/StepId';
4
4
  import { ClientTaxDocumentation, ExternalValidations } from 'types/client';
5
- import { TaxBitFormProps } from '../../widgets';
6
- type UseTaxDocumentationProps = {
7
- data: ClientTaxDocumentation;
5
+ type InterviewConfig = {
6
+ minimumAge: number;
7
+ };
8
+ export type UseTaxDocumentationProps = {
9
+ data?: ClientTaxDocumentation;
8
10
  language?: Locale;
9
11
  externalValidations?: ExternalValidations;
10
- onSubmit: (data: ClientTaxDocumentation) => Promise<void>;
11
- onProgress?: TaxBitFormProps['onProgress'];
12
+ onSubmit: (data: ClientTaxDocumentation) => void | Promise<void>;
13
+ onProgress?: (progress: Progress) => void | Promise<void>;
12
14
  step?: InputStep;
13
15
  taxForms?: TaxForm[];
16
+ config?: InterviewConfig;
14
17
  };
15
- export declare const useTaxDocumentation: ({ data: startingData, language: initialLanguage, externalValidations, onSubmit, onProgress, step: initialStep, taxForms: supportedForms, }: UseTaxDocumentationProps) => {
18
+ export declare const useTaxDocumentation: ({ data: startingData, language: initialLanguage, externalValidations, onSubmit, onProgress, step: initialStep, taxForms: supportedForms, config, }: UseTaxDocumentationProps) => {
16
19
  isW9: boolean;
17
20
  isW8: boolean;
18
21
  isW8Ben: boolean;
@@ -37,5 +40,6 @@ export declare const useTaxDocumentation: ({ data: startingData, language: initi
37
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";
38
41
  supportedForms: TaxForm[];
39
42
  externalValidations: ExternalValidations | undefined;
43
+ config: InterviewConfig | undefined;
40
44
  };
41
45
  export {};
@@ -24,6 +24,9 @@ export declare const useTaxDocumentationContext: () => {
24
24
  language: "bg-bg" | "cs-cz" | "da-dk" | "de-at" | "de-de" | "el-cy" | "el-gr" | "en-gb" | "en-us" | "es-es" | "et-ee" | "fi-fi" | "fr-fr" | "fr-lu" | "ga-ie" | "hr-hr" | "hu-hu" | "it-it" | "lt-lt" | "lv-lv" | "mt-mt" | "nl-be" | "nl-nl" | "no-no" | "pl-pl" | "pt-pt" | "ro-ro" | "sk-sk" | "sl-si" | "sv-se";
25
25
  supportedForms: import("../../types").TaxForm[];
26
26
  externalValidations: import("../../entry").ExternalValidations | undefined;
27
+ config: {
28
+ minimumAge: number;
29
+ } | undefined;
27
30
  }, TaxDocumentationContextProvider: import("react").Provider<{
28
31
  isW9: boolean;
29
32
  isW8: boolean;
@@ -49,4 +52,7 @@ export declare const useTaxDocumentationContext: () => {
49
52
  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";
50
53
  supportedForms: import("../../types").TaxForm[];
51
54
  externalValidations: import("../../entry").ExternalValidations | undefined;
55
+ config: {
56
+ minimumAge: number;
57
+ } | undefined;
52
58
  } | undefined>;
@@ -1 +1 @@
1
- export { getButtonText, getCaProvinceText, getCountryText, getErrorText, getHintText, getLocaleText, getMonthText, getOptionText, getPromptText, getSubPromptText, getSubTitleText, getTitleText, getUsStateText, } from './utils';
1
+ export { getButtonText, getCaProvinceText, getCountryText, getErrorText, getHintText, getMonthText, getOptionText, getPromptText, getSubPromptText, getSubTitleText, getTitleText, getUsStateText, } from './utils';
@@ -1,7 +1,7 @@
1
1
  export type ButtonKey = 'edit' | 'back' | 'next' | 'reset' | 'submit' | 'cancel' | 'hide' | 'show';
2
- export type ErrorKey = 'formHasErrors' | 'invalid' | 'invalidDate' | 'invalidVat' | 'mustBeFiveOrNineDigits' | 'mustBeInDateFormat' | 'mustBeNineDigits' | 'mustBeSixCharacters' | 'mustBeValidBirthDate' | 'mustMatchName' | 'mustNotMatchVatin' | 'required' | 'residencesMustIncludeAddressCountry' | 'residencesMustIncludeAnEUCountry' | 'residencesMustIncludeVatCountry';
2
+ export type ErrorKey = 'formHasErrors' | 'invalid' | 'invalidDate' | 'invalidVat' | 'mustBeFiveOrNineDigits' | 'mustBeInDateFormat' | 'mustBeNineDigits' | 'mustBeSixCharacters' | 'mustBeValidBirthDate' | 'mustBeAtLeast18' | 'mustMatchName' | 'mustNotMatchVatin' | 'required' | 'residencesMustIncludeAddressCountry' | 'residencesMustIncludeAnEUCountry' | 'residencesMustIncludeVatCountry';
3
3
  export type OptionKey = 'usPerson_yes' | 'usPerson_no' | 'regardedOwnerUsPerson_yes' | 'regardedOwnerUsPerson_no' | 'isIndividual_yes' | 'isIndividual_no' | 'cCorporation' | 'centralBankOfIssue' | 'complexTrust' | 'corporation' | 'disregardedEntity' | 'estate' | 'foreignGovernmentControlledEntity' | 'foreignGovernmentIntegralPart' | 'grantorTrust' | 'individual' | 'internationalOrganization' | 'llc' | 'no' | 'other' | 'partnership' | 'privateFoundation' | 'sCorporation' | 'simpleTrust' | 'smllc' | 'soleProprietor' | 'taxExemptOrganization' | 'trust' | 'trustEstate' | 'yes';
4
- export type PromptKey = 'addAdditional' | 'address' | 'businessRegistrationNumber' | 'businessRegistrationCountry' | 'city' | 'cityOfBirth' | 'country' | 'countryOfBirth' | 'countryOfCitizenship' | 'dateOfBirth' | 'day' | 'dbaName' | 'exemptPayeeCode' | 'exemptFatcaCode' | 'financialAccountIdentifier' | 'financialAccountName' | 'foreignAccountType' | 'foreignOtherClassification' | 'foreignTin' | 'foreignTinIsNotRequired' | 'foreignTrustClassification' | 'isEuResident' | 'isIndividual' | 'iAcknowlegeESignIsOk' | 'iAmACitizenOfTheUs' | 'iAmExemptFromFatcaReporting' | 'iAmNotSubjectToBackupWithholding' | 'iAuthorizeWithholdingAgent' | 'iCertifyToAll' | 'iConfirmIncomeIsNonUs' | 'iConfirmTheBeneficialOwnerIsExempt' | 'iConfirmTheInformationIsCorrectComplete' | 'iConfirmTheEntityIsNotAUsPerson' | 'iConfirmTheEntityIsTheBeneficialOwner' | 'iConfirmTheTaxIdIsCorrect' | 'iHaveLegalCapacityToSign' | 'mailingAddress' | 'mailingAddressIsDifferent' | 'month' | 'name' | 'nameOfEntity' | 'nameOfCCorporation' | 'nameOfCorporation' | 'nameOfIndividual' | 'nameOfLlc' | 'nameOfOrganization' | 'nameOfPartnership' | 'nameOfSCorporation' | 'nameOfSoleProprietor' | 'nameOfTrustEstate' | 'nameOfTrust' | 'province' | 'regardedOwnerUsPerson' | 'removeAdditional' | 'signature' | 'smllcElection' | 'state' | 'stateProvince' | 'street' | 'street2' | 'taxIdNumber' | 'taxIdNumberIsNotRequired' | 'tin' | 'usAccountType' | 'usLlcClassification' | 'usOtherClassification' | 'usPerson' | 'usEin' | 'usSsn' | 'usTin' | 'usTrustEstateEin' | 'vatIdentificationNumber' | 'vatIsNotRequired' | 'vatCountry' | 'year' | 'zip';
4
+ export type PromptKey = 'addAdditional' | 'address' | 'businessRegistrationNumber' | 'businessRegistrationCountry' | 'city' | 'cityOfBirth' | 'country' | 'countryOfBirth' | 'countryOfCitizenship' | 'dateOfBirth' | 'day' | 'dbaName' | 'exemptPayeeCode' | 'exemptFatcaCode' | 'financialAccountIdentifier' | 'financialAccountName' | 'foreignAccountType' | 'foreignOtherClassification' | 'foreignTin' | 'foreignTinIsNotRequired' | 'foreignTrustClassification' | 'isEuResident' | 'isIndividual' | 'iAcknowlegeESignIsOk' | 'iAmACitizenOfTheUs' | 'iAmExemptFromFatcaReporting' | 'iAmNotSubjectToBackupWithholding' | 'iAuthorizeWithholdingAgent' | 'iCertifyToAll' | 'iConfirmIncomeIsNonUs' | 'iConfirmTheBeneficialOwnerIsExempt' | 'iConfirmTheInformationIsCorrectComplete' | 'iConfirmTheEntityIsNotAUsPerson' | 'iConfirmTheEntityIsTheBeneficialOwner' | 'iConfirmTheTaxIdIsCorrect' | 'iHaveLegalCapacityToSign' | 'mailingAddress' | 'mailingAddressIsDifferent' | 'month' | 'name' | 'nameOfEntity' | 'nameOfCCorporation' | 'nameOfCorporation' | 'nameOfIndividual' | 'nameOfLlc' | 'nameOfOrganization' | 'nameOfPartnership' | 'nameOfSCorporation' | 'nameOfSoleProprietor' | 'nameOfTrustEstate' | 'nameOfTrust' | 'province' | 'regardedOwnerUsPerson' | 'removeResidence' | 'signature' | 'smllcElection' | 'state' | 'stateProvince' | 'street' | 'street2' | 'taxIdNumber' | 'taxIdNumberIsNotRequired' | 'tin' | 'usAccountType' | 'usLlcClassification' | 'usOtherClassification' | 'usPerson' | 'usEin' | 'usSsn' | 'usTin' | 'usTrustEstateEin' | 'vatIdentificationNumber' | 'vatIsNotRequired' | 'vatCountry' | 'year' | 'zip';
5
5
  export type SubPromptKey = 'smllcElection' | 'iConfirmIncomeIsNonUs' | 'isEuResident' | 'isIndividual' | 'financialAccountIdentifier' | 'financialAccountName' | 'vatIdentificationNumber' | 'placeOfBirth';
6
6
  export type TitleKey = 'accountHolder' | 'accountHolderClassification' | 'accountHolderContactInformation' | 'accountHolderTaxInformation' | 'accountHolderTaxClarification' | 'address' | 'confirmation' | 'exemptions' | 'mailingAddress' | 'primaryAddress' | 'placeOfBirth' | 'regardedOwner' | 'regardedOwnerClassification' | 'regardedOwnerContactInformation' | 'regardedOwnerTaxInformation' | 'signature' | 'summary' | 'taxResidences' | 'taxResidence1' | 'taxResidence2' | 'taxResidence3' | 'taxResidence4' | 'taxResidence5';
7
7
  export type SubTitleKey = 'taxResidences';
@@ -1,6 +1,5 @@
1
1
  import { CaProvinceCode } from 'types/CaProvinceCode';
2
2
  import { CountryCode } from 'types/CountryCode';
3
- import { Locale } from 'types/Locale';
4
3
  import { MonthCode } from 'types/MonthCode';
5
4
  import { UsStateCode } from 'types/UsStateCode';
6
5
  import { ButtonKey, ErrorKey, HintKey, OptionKey, PromptKey, SubPromptKey, SubTitleKey, TextKey, TitleKey } from './LocalizationKey';
@@ -44,7 +43,4 @@ export type PropertyFile = {
44
43
  month: {
45
44
  [key in MonthCode]: string;
46
45
  };
47
- locale: {
48
- [key in Locale]: string;
49
- };
50
46
  };
@@ -16,4 +16,3 @@ export declare const getCountryText: (key: CountryCode, locale: Locale | undefin
16
16
  export declare const getUsStateText: (key: UsStateCode, locale: Locale | undefined) => string;
17
17
  export declare const getCaProvinceText: (key: CaProvinceCode, locale: Locale | undefined) => string;
18
18
  export declare const getMonthText: (key: string, locale: Locale | undefined) => string;
19
- export declare const getLocaleText: (key: string, locale: Locale | undefined) => string;
@@ -1,4 +1,5 @@
1
- import { Locale } from "types";
1
+ import { Locale } from 'types';
2
2
  export declare const localeOptions: {
3
3
  value: Locale;
4
+ label: string;
4
5
  }[];
@@ -1,4 +1,6 @@
1
- export declare const birthYears: number[];
1
+ export declare const getBirthYearOptions: (minimumAge: number | undefined) => {
2
+ value: number;
3
+ }[];
2
4
  export declare const birthYearOptions: {
3
5
  value: number;
4
6
  }[];
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import { TaxDocumentationKey } from "types";
1
+ import React from 'react';
2
+ import { TaxDocumentationKey } from 'types';
3
3
  export declare const useDateOfBirthInput: (name: TaxDocumentationKey) => {
4
4
  mm: string;
5
5
  dd: string;
@@ -1,3 +1,4 @@
1
1
  export declare const isValidAge: (birthday: string) => boolean;
2
+ export declare const isAboveMinimumAge: (birthday: string, minAge?: number) => boolean;
2
3
  export declare const isValidDateFormat: (dateString: string) => boolean;
3
4
  export declare const isValidDateString: (birthday: string) => boolean;
@@ -1,21 +1,5 @@
1
+ import type { UseTaxDocumentationProps } from 'contexts';
1
2
  import React from 'react';
2
- import { Locale, Progress, TaxForm } from 'types';
3
- import { ClientTaxDocumentation } from 'types/client';
4
- type TaxBitResponseError = {
5
- message: string;
6
- response: Response;
7
- };
8
- export type TaxBitFormProps = {
9
- data?: ClientTaxDocumentation;
10
- staging?: true;
11
- bearerToken: string;
12
- language?: Locale;
13
- taxForms?: TaxForm[];
14
- onProgress?: (progress: Progress) => void | Promise<void>;
15
- onSubmit?: (data?: ClientTaxDocumentation) => void | Promise<void>;
16
- onSuccess?: (data?: ClientTaxDocumentation) => void | Promise<void>;
17
- onSettled?: (data?: ClientTaxDocumentation) => void | Promise<void>;
18
- onError?: (error?: TaxBitResponseError) => void | Promise<void>;
19
- };
3
+ import { UseTaxBitFormProps } from 'widgets/TaxBitForm/useTaxBitForm';
4
+ export type TaxBitFormProps = Omit<UseTaxDocumentationProps, 'onSubmit'> & UseTaxBitFormProps;
20
5
  export declare const TaxBitForm: ({ staging, data, bearerToken, language, taxForms, onProgress, onSubmit, onSettled, onSuccess, onError, }: TaxBitFormProps) => React.JSX.Element;
21
- export {};
@@ -1,6 +1,17 @@
1
1
  import { ClientTaxDocumentation, ExternalValidations } from 'types/client';
2
- import { TaxBitFormProps } from './TaxBitForm';
3
- type UseTaxBitFormProps = Omit<TaxBitFormProps, 'language'>;
2
+ type TaxBitResponseError = {
3
+ message: string;
4
+ response: Response;
5
+ };
6
+ export type UseTaxBitFormProps = {
7
+ data?: ClientTaxDocumentation;
8
+ staging?: true;
9
+ bearerToken: string;
10
+ onSuccess?: (data?: ClientTaxDocumentation) => void | Promise<void>;
11
+ onSettled?: (data?: ClientTaxDocumentation) => void | Promise<void>;
12
+ onError?: (error?: TaxBitResponseError) => void | Promise<void>;
13
+ onSubmit: (data?: ClientTaxDocumentation) => void | Promise<void>;
14
+ };
4
15
  export declare const useTaxBitForm: ({ bearerToken, data, onSubmit, onSuccess, onSettled, onError, staging, }: UseTaxBitFormProps) => {
5
16
  handleOnSubmit: (data: ClientTaxDocumentation) => Promise<void>;
6
17
  externalValidations: ExternalValidations;
@@ -3,12 +3,13 @@ import { CountryCode } from 'types';
3
3
  type ResidenceInputProps = {
4
4
  index: 1 | 2 | 3 | 4 | 5;
5
5
  showIf?: boolean;
6
- more?: true;
6
+ more?: boolean;
7
+ remove?: boolean;
7
8
  onShow?: () => void;
8
9
  countryOptions: ReadonlyArray<{
9
10
  value: CountryCode;
10
11
  label: string;
11
12
  }>;
12
13
  };
13
- export declare const ResidenceInput: ({ index, showIf, onShow, more, countryOptions, }: ResidenceInputProps) => React.JSX.Element | null;
14
+ export declare const ResidenceInput: ({ index, showIf, onShow, more, remove, countryOptions, }: ResidenceInputProps) => React.JSX.Element;
14
15
  export {};
@@ -1,3 +1,3 @@
1
- import React from "react";
2
- import { ToggleButtonProps } from "ui";
1
+ import React from 'react';
2
+ import { ToggleButtonProps } from 'ui';
3
3
  export declare const ToggleButtonRow: ({ name }: ToggleButtonProps) => React.JSX.Element;
@@ -1,9 +1,6 @@
1
+ import { UseTaxDocumentationProps } from 'contexts';
1
2
  import React from 'react';
2
- import { ClientTaxDocumentation, ExternalValidations } from '../../types/client';
3
- import { TaxBitFormProps } from '../../widgets';
4
- export type TaxBitFormUIProps = Pick<TaxBitFormProps, 'data' | 'language' | 'taxForms' | 'onProgress'> & {
5
- onSubmit: (data: ClientTaxDocumentation) => Promise<void> | void;
6
- externalValidations?: ExternalValidations;
3
+ export type TaxBitFormUIProps = Omit<UseTaxDocumentationProps, 'step' | 'config'> & {
7
4
  complete?: boolean;
8
5
  };
9
6
  export declare const TaxBitFormUI: ({ data, onSubmit, language, taxForms, complete, onProgress, externalValidations, }: TaxBitFormUIProps) => React.JSX.Element;