@taxbit/react-sdk 0.5.0 → 0.6.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 (37) hide show
  1. package/README.md +4 -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 -8
  9. package/dist/src/contexts/TaxDocumentation/useTaxDocumentationContext.d.ts +6 -4
  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/ui/RadioButtons/RadioButtons.d.ts +1 -1
  18. package/dist/src/ui/Select/Select.d.ts +4 -14
  19. package/dist/src/ui/TextInput/TextInput.d.ts +1 -2
  20. package/dist/src/ui/TextInput/__tests__/TextInput.test.d.ts +0 -0
  21. package/dist/src/utils/date.d.ts +1 -0
  22. package/dist/src/utils/sort/byOptionalLabel.d.ts +5 -0
  23. package/dist/src/utils/sort/index.d.ts +1 -0
  24. package/dist/src/widgets/TaxBitForm/TaxBitForm.d.ts +3 -19
  25. package/dist/src/widgets/TaxBitForm/useTaxBitForm.d.ts +13 -2
  26. package/dist/src/wizard/LanguageSelector/LanguageSelector.d.ts +1 -1
  27. package/dist/src/wizard/ResidenceInput/ResidenceInput.d.ts +3 -2
  28. package/dist/src/wizard/RowInput/TextInputRow/TextInputRow.d.ts +1 -3
  29. package/dist/src/wizard/RowInput/ToggleButtonRow/ToggleButtonRow.d.ts +2 -2
  30. package/dist/src/wizard/TaxBitFormUI/TaxBitFormUI.d.ts +2 -5
  31. package/dist/taxbit-react-sdk.js +1766 -2648
  32. package/dist/taxbit-react-sdk.umd.cjs +10 -10
  33. package/package.json +7 -8
  34. package/{dist → style}/basic.css +8 -1
  35. package/{dist → style}/inline.css +8 -1
  36. /package/{dist → style}/index.css +0 -0
  37. /package/{dist → style}/minimal.css +0 -0
package/README.md CHANGED
@@ -223,3 +223,7 @@ type Progress = {
223
223
  totalSteps: number;
224
224
  };
225
225
  ```
226
+
227
+ ## Change Log
228
+
229
+ The Change log is available [here](CHANGELOG.md).
@@ -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;
@@ -21,7 +24,6 @@ export declare const useTaxDocumentation: ({ data: startingData, language: initi
21
24
  onPersistAccountHolderData: (newData: TaxDocumentation) => void;
22
25
  onPersistCollectedData: (newData: TaxDocumentation) => void;
23
26
  onSubmitTaxDocumentation: (data: TaxDocumentation) => void;
24
- onResetTaxDocumentation: (data: ClientTaxDocumentation) => void;
25
27
  error: string | undefined;
26
28
  editTo: (form: InputStep) => void;
27
29
  onCancel: (() => void) | undefined;
@@ -37,7 +39,7 @@ export declare const useTaxDocumentation: ({ data: startingData, language: initi
37
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">>;
38
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";
39
41
  supportedForms: TaxForm[];
40
- setSupportedForms: import("react").Dispatch<import("react").SetStateAction<TaxForm[]>>;
41
42
  externalValidations: ExternalValidations | undefined;
43
+ config: InterviewConfig | undefined;
42
44
  };
43
45
  export {};
@@ -8,7 +8,6 @@ export declare const useTaxDocumentationContext: () => {
8
8
  onPersistAccountHolderData: (newData: import("../../types").TaxDocumentation) => void;
9
9
  onPersistCollectedData: (newData: import("../../types").TaxDocumentation) => void;
10
10
  onSubmitTaxDocumentation: (data: import("../../types").TaxDocumentation) => void;
11
- onResetTaxDocumentation: (data: import("../../entry").ClientTaxDocumentation) => void;
12
11
  error: string | undefined;
13
12
  editTo: (form: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => void;
14
13
  onCancel: (() => void) | undefined;
@@ -24,8 +23,10 @@ export declare const useTaxDocumentationContext: () => {
24
23
  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">>;
25
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";
26
25
  supportedForms: import("../../types").TaxForm[];
27
- setSupportedForms: import("react").Dispatch<import("react").SetStateAction<import("../../types").TaxForm[]>>;
28
26
  externalValidations: import("../../entry").ExternalValidations | undefined;
27
+ config: {
28
+ minimumAge: number;
29
+ } | undefined;
29
30
  }, TaxDocumentationContextProvider: import("react").Provider<{
30
31
  isW9: boolean;
31
32
  isW8: boolean;
@@ -35,7 +36,6 @@ export declare const useTaxDocumentationContext: () => {
35
36
  onPersistAccountHolderData: (newData: import("../../types").TaxDocumentation) => void;
36
37
  onPersistCollectedData: (newData: import("../../types").TaxDocumentation) => void;
37
38
  onSubmitTaxDocumentation: (data: import("../../types").TaxDocumentation) => void;
38
- onResetTaxDocumentation: (data: import("../../entry").ClientTaxDocumentation) => void;
39
39
  error: string | undefined;
40
40
  editTo: (form: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerClassification" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => void;
41
41
  onCancel: (() => void) | undefined;
@@ -51,6 +51,8 @@ export declare const useTaxDocumentationContext: () => {
51
51
  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">>;
52
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";
53
53
  supportedForms: import("../../types").TaxForm[];
54
- setSupportedForms: import("react").Dispatch<import("react").SetStateAction<import("../../types").TaxForm[]>>;
55
54
  externalValidations: import("../../entry").ExternalValidations | undefined;
55
+ config: {
56
+ minimumAge: number;
57
+ } | undefined;
56
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;
@@ -9,5 +9,5 @@ export type RadioButtonsProps = {
9
9
  name: TaxDocumentationKey;
10
10
  options: ReadonlyArray<SelectOption>;
11
11
  };
12
- export declare const RadioButtons: ({ name, options }: RadioButtonsProps) => React.JSX.Element;
12
+ export declare const RadioButtons: <T extends OptionKey>({ name, options, }: RadioButtonsProps) => React.JSX.Element;
13
13
  export {};
@@ -1,24 +1,14 @@
1
1
  import { OptionKey } from 'i18n/types';
2
- import { FatcaCode, PayeeCode } from 'lookups';
3
2
  import React from 'react';
4
- import type { CaProvinceCode } from 'types/CaProvinceCode';
5
- import type { CountryCode } from 'types/CountryCode';
6
3
  import { TaxDocumentationKey } from 'types/TaxDocumentation';
7
- import type { UsStateCode } from 'types/UsStateCode';
8
- type FatcaSelectOption = {
9
- value: FatcaCode;
10
- };
11
- type PayeeSelectOption = {
12
- value: PayeeCode;
13
- };
14
- type SpecialSelectOption = {
15
- value: CountryCode | UsStateCode | CaProvinceCode;
16
- label: string;
4
+ type ValueOption = {
5
+ value: string;
6
+ label?: string;
17
7
  };
18
8
  export type SelectProps = {
19
9
  prompt?: string;
20
10
  name: TaxDocumentationKey;
21
- options: ReadonlyArray<FatcaSelectOption> | ReadonlyArray<PayeeSelectOption> | ReadonlyArray<SpecialSelectOption>;
11
+ options: ReadonlyArray<ValueOption>;
22
12
  addBlank?: boolean;
23
13
  className?: string;
24
14
  onChange?: () => void;
@@ -7,7 +7,6 @@ export type TextInputProps = {
7
7
  hint?: true;
8
8
  disabled?: boolean;
9
9
  children?: React.ReactNode;
10
- syncName?: TaxDocumentationKey;
11
10
  defaultValue?: string;
12
11
  };
13
- export declare const TextInput: ({ name, className, onChange, hint, children, disabled, syncName, defaultValue, }: TextInputProps) => React.JSX.Element;
12
+ export declare const TextInput: ({ name, className, onChange, hint, children, disabled, defaultValue, }: TextInputProps) => React.JSX.Element;
@@ -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;
@@ -0,0 +1,5 @@
1
+ export declare const byOptionalLabel: (a: {
2
+ label?: string;
3
+ }, b: {
4
+ label?: string;
5
+ }) => number;
@@ -0,0 +1 @@
1
+ export * from './byOptionalLabel';
@@ -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;
@@ -1,2 +1,2 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export declare const LanguageSelector: () => React.JSX.Element;
@@ -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,12 +1,10 @@
1
1
  import React from 'react';
2
- import { TaxDocumentationKey } from 'types';
3
2
  import { TextInputProps } from 'ui';
4
3
  type TextInputRowProps = {
5
4
  label?: true;
6
5
  subLabel?: true;
7
6
  hint?: true;
8
7
  onChange?: (val: string) => string;
9
- syncName?: TaxDocumentationKey;
10
8
  };
11
- export declare const TextInputRow: ({ name, label, hint, subLabel, onChange, disabled, defaultValue, syncName, }: TextInputProps & TextInputRowProps) => React.JSX.Element;
9
+ export declare const TextInputRow: ({ name, label, hint, subLabel, onChange, disabled, defaultValue, }: TextInputProps & TextInputRowProps) => React.JSX.Element;
12
10
  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;