@taxbit/react-sdk 0.1.0 → 0.2.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 (129) hide show
  1. package/README.md +79 -243
  2. package/dist/App.d.ts +1 -1
  3. package/dist/basic.css +1 -1
  4. package/dist/components/ErrorMessage/ErrorMessage.d.ts +2 -2
  5. package/dist/components/Form/Form.d.ts +8 -0
  6. package/dist/components/Form/index.d.ts +1 -0
  7. package/dist/components/Notification/Notification.d.ts +2 -2
  8. package/dist/components/Row/Row.d.ts +2 -2
  9. package/dist/components/index.d.ts +7 -7
  10. package/dist/contexts/FormUI/index.d.ts +3 -3
  11. package/dist/contexts/FormUI/useFormUI.d.ts +17 -117
  12. package/dist/contexts/FormUI/useFormUIContext.d.ts +30 -626
  13. package/dist/contexts/TaxDocumentation/TaxBitFormProvider.d.ts +6 -4
  14. package/dist/contexts/TaxDocumentation/useTaxDocumentation.d.ts +11 -10
  15. package/dist/contexts/TaxDocumentation/useTaxDocumentationContext.d.ts +194 -110
  16. package/dist/entry/index.d.ts +5 -5
  17. package/dist/hooks/useTaxBit/useTaxBit.d.ts +108 -4
  18. package/dist/i18n/locales/bg-bg.d.ts +1 -1
  19. package/dist/i18n/locales/cs-cz.d.ts +1 -1
  20. package/dist/i18n/locales/da-dk.d.ts +2 -0
  21. package/dist/i18n/locales/de-at.d.ts +2 -0
  22. package/dist/i18n/locales/de-de.d.ts +1 -1
  23. package/dist/i18n/locales/el-cy.d.ts +2 -0
  24. package/dist/i18n/locales/el-gr.d.ts +1 -1
  25. package/dist/i18n/locales/en-gb.d.ts +1 -1
  26. package/dist/i18n/locales/en-us.d.ts +1 -1
  27. package/dist/i18n/locales/es-es.d.ts +1 -1
  28. package/dist/i18n/locales/et-ee.d.ts +1 -1
  29. package/dist/i18n/locales/fi-fi.d.ts +2 -0
  30. package/dist/i18n/locales/fr-fr.d.ts +1 -1
  31. package/dist/i18n/locales/fr-lu.d.ts +2 -0
  32. package/dist/i18n/locales/ga-ie.d.ts +2 -0
  33. package/dist/i18n/locales/hr-hr.d.ts +2 -0
  34. package/dist/i18n/locales/hu-hu.d.ts +1 -1
  35. package/dist/i18n/locales/index.d.ts +18 -7
  36. package/dist/i18n/locales/it-it.d.ts +1 -1
  37. package/dist/i18n/locales/lt-lt.d.ts +2 -0
  38. package/dist/i18n/locales/lv-lv.d.ts +2 -0
  39. package/dist/i18n/locales/mt-mt.d.ts +1 -1
  40. package/dist/i18n/locales/nl-be.d.ts +2 -0
  41. package/dist/i18n/locales/nl-nl.d.ts +1 -1
  42. package/dist/i18n/locales/no-no.d.ts +1 -1
  43. package/dist/i18n/locales/pl-pl.d.ts +2 -0
  44. package/dist/i18n/locales/pt-pt.d.ts +1 -1
  45. package/dist/i18n/locales/ro-ro.d.ts +1 -1
  46. package/dist/i18n/locales/sk-sk.d.ts +1 -1
  47. package/dist/i18n/locales/sl-si.d.ts +1 -1
  48. package/dist/i18n/locales/sv-se.d.ts +1 -1
  49. package/dist/i18n/types/LocalizationKey.d.ts +10 -11
  50. package/dist/inline.css +1 -1
  51. package/dist/lookups/toOptions.d.ts +3 -0
  52. package/dist/services/api.d.ts +3 -2
  53. package/dist/taxbit-react-sdk.es.js +16961 -10199
  54. package/dist/taxbit-react-sdk.umd.js +10 -10
  55. package/dist/test/Wrapper.d.ts +7 -0
  56. package/dist/test/getWrapper.d.ts +4 -0
  57. package/dist/test/index.d.ts +2 -0
  58. package/dist/types/Locale.d.ts +1 -1
  59. package/dist/types/TaxDocumentation.d.ts +8 -4
  60. package/dist/types/client/index.d.ts +6 -0
  61. package/dist/types/{external → server}/ComprehensiveTaxDocumentation.d.ts +3 -14
  62. package/dist/types/server/TaxDocumentationStatus.d.ts +9 -0
  63. package/dist/types/server/enums.d.ts +13 -0
  64. package/dist/types/server/index.d.ts +3 -0
  65. package/dist/ui/DateOfBirthInput/DateOfBirthInput.d.ts +1 -2
  66. package/dist/ui/DateOfBirthInput/__tests__/useDateOfBirthInput.test.d.ts +1 -0
  67. package/dist/ui/DateOfBirthInput/useDateOfBirthInput.d.ts +20 -0
  68. package/dist/ui/Password/Password.d.ts +2 -3
  69. package/dist/ui/RadioButtons/RadioButtons.d.ts +3 -3
  70. package/dist/ui/RadioButtons/__tests__/RadioButtons.test.d.ts +0 -0
  71. package/dist/utils/getFieldsState.d.ts +4 -3
  72. package/dist/utils/getHintKeyMap.d.ts +4 -2
  73. package/dist/utils/getPromptKeyMap.d.ts +6 -4
  74. package/dist/utils/index.d.ts +10 -15
  75. package/dist/utils/kebabCase.d.ts +1 -0
  76. package/dist/utils/{getForeignAccountType.d.ts → transformInbound/getForeignAccountType.d.ts} +1 -1
  77. package/dist/utils/{getForeignOtherClassification.d.ts → transformInbound/getForeignOtherClassification.d.ts} +1 -1
  78. package/dist/utils/{getForeignTrustClassification.d.ts → transformInbound/getForeignTrustClassification.d.ts} +1 -1
  79. package/dist/utils/{getLLCClassification.d.ts → transformInbound/getLLCClassification.d.ts} +1 -1
  80. package/dist/utils/{getUsAccountType.d.ts → transformInbound/getUsAccountType.d.ts} +1 -1
  81. package/dist/utils/transformInbound/index.d.ts +6 -0
  82. package/dist/utils/transformInbound/transformInbound.d.ts +3 -0
  83. package/dist/utils/transformOutbound/index.d.ts +6 -0
  84. package/dist/utils/transformOutbound/transformOutbound.d.ts +2 -2
  85. package/dist/utils/transformOutbound/transformToOutboundAccoutHolder.d.ts +3 -3
  86. package/dist/utils/transformOutbound/transformToOutboundAddress.d.ts +2 -2
  87. package/dist/utils/transformOutbound/transformToOutboundRegardedOwner.d.ts +2 -2
  88. package/dist/utils/transformOutbound/transformToOutboundTaxResidenceFields.d.ts +3 -4
  89. package/dist/validations/getInvalidFields.d.ts +3 -0
  90. package/dist/validations/getNotifiedFields.d.ts +10 -0
  91. package/dist/validations/getRequiredFields.d.ts +3 -0
  92. package/dist/validations/getSubmittableFields.d.ts +3 -0
  93. package/dist/{utils → validations}/getSupportedFields.d.ts +1 -1
  94. package/dist/validations/getVisibleFields.d.ts +3 -0
  95. package/dist/validations/index.d.ts +7 -2
  96. package/dist/validations/invalidFieldRules.d.ts +7 -0
  97. package/dist/validations/{requiredFields.d.ts → requiredFieldRules.d.ts} +3 -3
  98. package/dist/widgets/TaxBitForm/TaxBitDAC7Form.d.ts +4 -11
  99. package/dist/widgets/TaxBitForm/TaxBitForm.d.ts +7 -6
  100. package/dist/wizard/AddressInput/AddressInput.d.ts +3 -3
  101. package/dist/wizard/PlaceOfBirthInput/PlaceOfBirthInput.d.ts +1 -1
  102. package/dist/wizard/ResidenceInput/ResidenceInput.d.ts +3 -3
  103. package/dist/wizard/RowInput/ErrorRow/ErrorRow.d.ts +6 -0
  104. package/dist/wizard/RowInput/ErrorRow/index.d.ts +1 -0
  105. package/dist/wizard/RowInput/VisibleRow/VisibleRow.d.ts +2 -2
  106. package/dist/wizard/RowInput/index.d.ts +7 -6
  107. package/dist/wizard/TaxBitFormUI/AccountHolderClassification/AccountHolderClassification.d.ts +1 -1
  108. package/dist/wizard/TaxBitFormUI/AccountHolderContact/AccountHolderContact.d.ts +1 -1
  109. package/dist/wizard/TaxBitFormUI/AccountHolderTax/AccountHolderTax.d.ts +1 -1
  110. package/dist/wizard/TaxBitFormUI/AccountHolderTaxClarification/AccountHolderTaxClarification.d.ts +1 -1
  111. package/dist/wizard/TaxBitFormUI/Exemptions/Exemptions.d.ts +1 -1
  112. package/dist/wizard/TaxBitFormUI/RegardedOwnerClassification/RegardedOwnerClassification.d.ts +1 -1
  113. package/dist/wizard/TaxBitFormUI/RegardedOwnerContact/RegardedOwnerContact.d.ts +1 -1
  114. package/dist/wizard/TaxBitFormUI/RegardedOwnerTax/RegardedOwnerTax.d.ts +1 -1
  115. package/dist/wizard/TaxBitFormUI/Summary/Recap.d.ts +1 -1
  116. package/dist/wizard/TaxBitFormUI/Summary/Summary.d.ts +1 -1
  117. package/dist/wizard/TaxBitFormUI/TaxBitDAC7FormUI.d.ts +3 -9
  118. package/dist/wizard/TaxBitFormUI/TaxBitFormUI.d.ts +6 -6
  119. package/package.json +17 -10
  120. package/dist/components/Page/Page.d.ts +0 -8
  121. package/dist/components/Page/index.d.ts +0 -1
  122. package/dist/types/external/index.d.ts +0 -1
  123. package/dist/utils/getNotifications.d.ts +0 -10
  124. package/dist/utils/getRequiredFields.d.ts +0 -103
  125. package/dist/utils/getValidationMessages.d.ts +0 -104
  126. package/dist/utils/getVisibleQuestions.d.ts +0 -6
  127. package/dist/utils/transformInbound.d.ts +0 -3
  128. package/dist/validations/validations.d.ts +0 -7
  129. /package/dist/{taxbit-react-sdk.es.d.ts → index.d.ts} +0 -0
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { ClientTaxDocumentation } from 'types/client';
3
+ import { TaxForm } from '../types';
4
+ export declare const Wrapper: React.FC<React.PropsWithChildren & {
5
+ initialData?: ClientTaxDocumentation;
6
+ taxForms?: TaxForm[];
7
+ }>;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { TaxForm } from '../types';
3
+ import { ClientTaxDocumentation } from '../types/client';
4
+ export declare const getWrapper: (initialData?: ClientTaxDocumentation, taxForms?: TaxForm[]) => ({ children }: React.PropsWithChildren) => React.ReactNode;
@@ -0,0 +1,2 @@
1
+ export * from './Wrapper';
2
+ export * from './getWrapper';
@@ -1 +1 @@
1
- export type Locale = "bg-bg" | "cs-cz" | "de-de" | "el-gr" | "en-gb" | "en-us" | "es-es" | "et-ee" | "fr-fr" | "hu-hu" | "it-it" | "mt-mt" | "nl-nl" | "no-no" | "pt-pt" | "ro-ro" | "sk-sk" | "sl-si" | "sv-se";
1
+ export type Locale = "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";
@@ -1,6 +1,6 @@
1
- import { type YesNo } from "./YesNo";
2
- import { type Yes } from "./Yes";
3
- import type { UsAccountType, UsLlcAccountType, ForeignAccountType, ForeignTrustAccountType, ForeignOtherAccountType } from "./AccountType";
1
+ import type { ForeignAccountType, ForeignOtherAccountType, ForeignTrustAccountType, UsAccountType, UsLlcAccountType } from './AccountType';
2
+ import { type Yes } from './Yes';
3
+ import { type YesNo } from './YesNo';
4
4
  export type AccountHolderClassificationData = {
5
5
  accountHolderIsIndividual?: YesNo;
6
6
  accountHolderIsEuResident?: YesNo;
@@ -114,6 +114,10 @@ export type SummaryData = {
114
114
  iConfirmTheTaxIdIsCorrect?: Yes;
115
115
  iHaveLegalCapacityToSign?: Yes;
116
116
  signature?: string;
117
+ source?: string;
117
118
  };
118
- export type TaxDocumentation = AccountHolderContactData & AccountHolderTaxData & AccountHolderClassificationData & RegardedOwnerContactData & RegardedOwnerClassificationData & RegardedOwnerTaxData & SummaryData;
119
+ export type CalculatedData = {
120
+ accountHolderCountryIsResidence?: YesNo;
121
+ };
122
+ export type TaxDocumentation = AccountHolderContactData & AccountHolderTaxData & AccountHolderClassificationData & RegardedOwnerContactData & RegardedOwnerClassificationData & RegardedOwnerTaxData & SummaryData & CalculatedData;
119
123
  export type TaxDocumentationKey = keyof TaxDocumentation;
@@ -0,0 +1,6 @@
1
+ import { CamelCasedPropertiesDeep } from 'type-fest';
2
+ import { SignedComprehensiveTaxDocumentation, TaxDocumentationStatus } from '../server';
3
+ export type ClientTaxDocumentation = CamelCasedPropertiesDeep<SignedComprehensiveTaxDocumentation>;
4
+ export type ClientTaxDocumentationStatus = CamelCasedPropertiesDeep<TaxDocumentationStatus, {
5
+ preserveConsecutiveUppercase: false;
6
+ }>;
@@ -1,4 +1,3 @@
1
- import type { CamelCasedPropertiesDeep } from "type-fest";
2
1
  export type Address = {
3
2
  city?: string;
4
3
  country?: string;
@@ -26,7 +25,6 @@ export type AccountHolderTaxDocumentation = {
26
25
  tin?: string;
27
26
  tin_not_required?: boolean;
28
27
  }[];
29
- show_tax_residence?: boolean[];
30
28
  tin?: string;
31
29
  vatin?: string;
32
30
  vatin_country?: string;
@@ -61,7 +59,7 @@ export type RegardedOwnerTaxDocumentation = {
61
59
  is_us_person?: boolean;
62
60
  us_account_type?: string;
63
61
  us_llc_classification?: string;
64
- other_classification?: string;
62
+ us_other_classification?: string;
65
63
  us_trust_estate_ein?: boolean;
66
64
  foreign_account_type?: string;
67
65
  foreign_trust_classification?: string;
@@ -75,15 +73,6 @@ export type SignedComprehensiveTaxDocumentation = {
75
73
  has_certified?: boolean;
76
74
  is_not_subject_backup_withholding?: boolean;
77
75
  signature?: string;
78
- document_type: "COMPREHENSIVE";
76
+ document_type?: 'COMPREHENSIVE';
77
+ source?: string;
79
78
  };
80
- export declare enum ComprehensiveStatus {
81
- Undocumented = "UNDOCUMENTED",
82
- Undetermined = "UNDETERMINED"
83
- }
84
- export declare enum ComprehensiveFormStatus {
85
- Collected = "COLLECTED",
86
- NotCollected = "NOT_COLLECTED",
87
- PartiallyCollected = "PARTIALLY_COLLECTED"
88
- }
89
- export type ClientTaxDocumentation = CamelCasedPropertiesDeep<AccountHolderTaxDocumentation>;
@@ -0,0 +1,9 @@
1
+ import { ComprehensiveFormStatusEnum, ComprehensiveStatusEnum } from './enums.ts';
2
+ export type TaxDocumentationStatus = {
3
+ status: ComprehensiveStatusEnum.Undocumented | ComprehensiveStatusEnum.Undetermined;
4
+ submission_status: ComprehensiveStatusEnum.Submitted | ComprehensiveStatusEnum.NotSubmitted;
5
+ DAC7_interview?: {
6
+ data_collection_status: ComprehensiveFormStatusEnum.Complete | ComprehensiveFormStatusEnum.Incomplete;
7
+ expiration_date: string;
8
+ };
9
+ };
@@ -0,0 +1,13 @@
1
+ export declare enum ComprehensiveStatusEnum {
2
+ Undocumented = "UNDOCUMENTED",
3
+ Undetermined = "UNDETERMINED",
4
+ Submitted = "SUBMITTED",
5
+ NotSubmitted = "NOT_SUBMITTED"
6
+ }
7
+ export declare enum ComprehensiveFormStatusEnum {
8
+ Collected = "COLLECTED",
9
+ NotCollected = "NOT_COLLECTED",
10
+ PartiallyCollected = "PARTIALLY_COLLECTED",
11
+ Complete = "COMPLETE",
12
+ Incomplete = "INCOMPLETE"
13
+ }
@@ -0,0 +1,3 @@
1
+ export * from './ComprehensiveTaxDocumentation';
2
+ export * from './TaxDocumentationStatus';
3
+ export * from './enums';
@@ -4,6 +4,5 @@ export type DateOfBirthInputProps = {
4
4
  name: TaxDocumentationKey;
5
5
  className?: string;
6
6
  hint?: true;
7
- children?: React.ReactNode;
8
7
  };
9
- export declare const DateOfBirthInput: ({ name, className, hint, children, }: DateOfBirthInputProps) => React.JSX.Element;
8
+ export declare const DateOfBirthInput: ({ name, className, hint, }: DateOfBirthInputProps) => React.JSX.Element;
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { TaxDocumentationKey } from "types";
3
+ export declare const useDateOfBirthInput: (name: TaxDocumentationKey) => {
4
+ mm: string;
5
+ dd: string;
6
+ yyyy: string;
7
+ handleDayChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
8
+ handleMonthChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
9
+ handleYearChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
10
+ dayOptions: {
11
+ value: "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17" | "18" | "19" | "20" | "21" | "22" | "23" | "24" | "25" | "26" | "27" | "28" | "29" | "30" | "31" | "01" | "02" | "03" | "04" | "05" | "06" | "07" | "08" | "09";
12
+ }[];
13
+ birthYearOptions: {
14
+ value: number;
15
+ }[];
16
+ monthOptions: {
17
+ label: string;
18
+ value: import("types").MonthCode;
19
+ }[];
20
+ };
@@ -1,11 +1,10 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  type PasswordProps = {
3
3
  value?: string;
4
4
  mask?: string;
5
- timeout?: number;
6
5
  onChange?: (val: string) => void;
7
6
  show?: boolean;
8
7
  className?: string;
9
8
  };
10
- export declare const Password: ({ value, mask, timeout, onChange, show, ...inputProps }: PasswordProps) => React.JSX.Element;
9
+ export declare const Password: ({ value, mask, onChange, show, ...inputProps }: PasswordProps) => React.JSX.Element;
11
10
  export {};
@@ -1,6 +1,6 @@
1
- import React from "react";
2
- import { TaxDocumentationKey } from "types/TaxDocumentation";
3
- import { OptionKey } from "i18n/types";
1
+ import { OptionKey } from 'i18n/types';
2
+ import React from 'react';
3
+ import { TaxDocumentationKey } from 'types/TaxDocumentation';
4
4
  type SelectOption = {
5
5
  value: OptionKey;
6
6
  label?: string;
@@ -1,8 +1,9 @@
1
- import { TaxDocumentation } from "types/TaxDocumentation";
2
- export declare const getFieldsState: (fields: TaxDocumentation) => {
1
+ import { TaxDocumentation } from 'types/TaxDocumentation';
2
+ import { TaxForm } from '../types';
3
+ export declare const getFieldsState: (fields: TaxDocumentation, supportedForms?: TaxForm[]) => {
3
4
  accountHolderIsDisregarded: boolean;
4
5
  hasNoTaxId: boolean;
5
- isDac7: boolean;
6
+ isDac7: boolean | undefined;
6
7
  isW9: boolean;
7
8
  isW8: boolean;
8
9
  isW8Ben: boolean;
@@ -1,8 +1,10 @@
1
1
  import { TaxDocumentationKey } from "types/TaxDocumentation";
2
2
  import { HintKey } from "i18n/types";
3
3
  export declare const getHintKeyMap: () => {
4
- exemptPayeeCode?: "dateOfBirth" | undefined;
4
+ signature?: "dateOfBirth" | undefined;
5
+ source?: "dateOfBirth" | undefined;
5
6
  exemptFatcaCode?: "dateOfBirth" | undefined;
7
+ exemptPayeeCode?: "dateOfBirth" | undefined;
6
8
  iAcknowlegeESignIsOk?: "dateOfBirth" | undefined;
7
9
  iAmACitizenOfTheUs?: "dateOfBirth" | undefined;
8
10
  iAmExemptFromFatcaReporting?: "dateOfBirth" | undefined;
@@ -16,7 +18,6 @@ export declare const getHintKeyMap: () => {
16
18
  iConfirmTheTaxIdIsCorrect?: "dateOfBirth" | undefined;
17
19
  iHaveLegalCapacityToSign?: "dateOfBirth" | undefined;
18
20
  regardedOwnerUsPerson?: "dateOfBirth" | undefined;
19
- signature?: "dateOfBirth" | undefined;
20
21
  accountHolderAddressCity?: "dateOfBirth" | undefined;
21
22
  accountHolderAddressCountry?: "dateOfBirth" | undefined;
22
23
  accountHolderAddressState?: "dateOfBirth" | undefined;
@@ -101,4 +102,5 @@ export declare const getHintKeyMap: () => {
101
102
  regardedOwnerForeignTin?: "dateOfBirth" | undefined;
102
103
  regardedOwnerForeignTinIsNotRequired?: "dateOfBirth" | undefined;
103
104
  regardedOwnerUsTin?: "dateOfBirth" | undefined;
105
+ accountHolderCountryIsResidence?: "dateOfBirth" | undefined;
104
106
  };
@@ -1,8 +1,10 @@
1
- import { TaxDocumentation, TaxDocumentationKey } from "types/TaxDocumentation";
2
- import { PromptKey } from "i18n/types";
1
+ import { PromptKey } from 'i18n/types';
2
+ import { TaxDocumentation, TaxDocumentationKey } from 'types/TaxDocumentation';
3
3
  export declare const getPromptKeyMap: (data: TaxDocumentation) => {
4
- exemptPayeeCode?: PromptKey | undefined;
4
+ signature?: PromptKey | undefined;
5
+ source?: PromptKey | undefined;
5
6
  exemptFatcaCode?: PromptKey | undefined;
7
+ exemptPayeeCode?: PromptKey | undefined;
6
8
  iAcknowlegeESignIsOk?: PromptKey | undefined;
7
9
  iAmACitizenOfTheUs?: PromptKey | undefined;
8
10
  iAmExemptFromFatcaReporting?: PromptKey | undefined;
@@ -16,7 +18,6 @@ export declare const getPromptKeyMap: (data: TaxDocumentation) => {
16
18
  iConfirmTheTaxIdIsCorrect?: PromptKey | undefined;
17
19
  iHaveLegalCapacityToSign?: PromptKey | undefined;
18
20
  regardedOwnerUsPerson?: PromptKey | undefined;
19
- signature?: PromptKey | undefined;
20
21
  accountHolderAddressCity?: PromptKey | undefined;
21
22
  accountHolderAddressCountry?: PromptKey | undefined;
22
23
  accountHolderAddressState?: PromptKey | undefined;
@@ -101,4 +102,5 @@ export declare const getPromptKeyMap: (data: TaxDocumentation) => {
101
102
  regardedOwnerForeignTin?: PromptKey | undefined;
102
103
  regardedOwnerForeignTinIsNotRequired?: PromptKey | undefined;
103
104
  regardedOwnerUsTin?: PromptKey | undefined;
105
+ accountHolderCountryIsResidence?: PromptKey | undefined;
104
106
  };
@@ -1,15 +1,10 @@
1
- export * from "./cx";
2
- export * from "./date";
3
- export * from "./getFieldsState";
4
- export * from "./getForeignAccountType";
5
- export * from "./getForeignOtherClassification";
6
- export * from "./getForeignTrustClassification";
7
- export * from "./getLLCClassification.ts";
8
- export * from "./getPromptKeyMap";
9
- export * from "./getSupportedFields";
10
- export * from "./getUsAccountType";
11
- export * from "./getVisibleQuestions";
12
- export * from "./isBlank";
13
- export * from "./transformInbound";
14
- export * from "./transformOutbound/transformOutbound.ts";
15
- export * from "./getMonthlyDayCount.ts";
1
+ export * from './cx';
2
+ export * from './date';
3
+ export * from './getFieldsState';
4
+ export * from './getHintKeyMap';
5
+ export * from './getMonthlyDayCount';
6
+ export * from './getPromptKeyMap';
7
+ export * from './isBlank';
8
+ export * from './kebabCase';
9
+ export * from './transformInbound';
10
+ export * from './transformOutbound';
@@ -0,0 +1 @@
1
+ export declare const kebabCase: (str: string) => string;
@@ -1,2 +1,2 @@
1
- import { type ForeignAccountHolderAccountType } from "lookups";
1
+ import { type ForeignAccountHolderAccountType } from 'lookups';
2
2
  export declare const getForeignAccountType: (accountType: string | undefined) => ForeignAccountHolderAccountType | undefined;
@@ -1,2 +1,2 @@
1
- import { type ForeignOtherClassification } from "lookups";
1
+ import { type ForeignOtherClassification } from 'lookups';
2
2
  export declare const getForeignOtherClassification: (classification: string | undefined) => ForeignOtherClassification | undefined;
@@ -1,2 +1,2 @@
1
- import { type ForeignTrustClassification } from "lookups";
1
+ import { type ForeignTrustClassification } from 'lookups';
2
2
  export declare const getForeignTrustClassification: (classification: string | undefined) => ForeignTrustClassification | undefined;
@@ -1,2 +1,2 @@
1
- import { type UsLLCAccountType } from "lookups";
1
+ import { type UsLLCAccountType } from 'lookups';
2
2
  export declare const getLLCClassification: (accountType: string | undefined) => UsLLCAccountType | undefined;
@@ -1,2 +1,2 @@
1
- import { type UsAccountHolderAccountType } from "lookups";
1
+ import { type UsAccountHolderAccountType } from 'lookups';
2
2
  export declare const getUsAccountType: (accountType: string | undefined) => UsAccountHolderAccountType | undefined;
@@ -0,0 +1,6 @@
1
+ export * from './getForeignAccountType';
2
+ export * from './getForeignOtherClassification';
3
+ export * from './getForeignTrustClassification';
4
+ export * from './getLLCClassification';
5
+ export * from './getUsAccountType';
6
+ export * from './transformInbound';
@@ -0,0 +1,3 @@
1
+ import { TaxDocumentation, TaxForm } from 'types';
2
+ import { ClientTaxDocumentation } from '../../types/client';
3
+ export declare const transformInbound: (data: ClientTaxDocumentation, forms: TaxForm[]) => TaxDocumentation;
@@ -0,0 +1,6 @@
1
+ export * from './convertYesNoToBoolean';
2
+ export * from './transformOutbound';
3
+ export * from './transformToOutboundAccoutHolder';
4
+ export * from './transformToOutboundAddress';
5
+ export * from './transformToOutboundRegardedOwner';
6
+ export * from './transformToOutboundTaxResidenceFields';
@@ -1,3 +1,3 @@
1
- import { SignedComprehensiveTaxDocumentation } from "../../types/external";
2
- import { TaxDocumentation } from "../../types";
1
+ import { TaxDocumentation } from '../../types';
2
+ import { SignedComprehensiveTaxDocumentation } from '../../types/server';
3
3
  export declare const transformOutbound: (data: TaxDocumentation) => SignedComprehensiveTaxDocumentation;
@@ -1,3 +1,3 @@
1
- import { TaxDocumentation } from "types";
2
- import { AccountHolderTaxDocumentation } from "types/external";
3
- export declare const transformToOutbouondAccountHolder: (data: TaxDocumentation) => AccountHolderTaxDocumentation | undefined;
1
+ import { TaxDocumentation } from 'types';
2
+ import { AccountHolderTaxDocumentation } from 'types/server';
3
+ export declare const transformToOutboundAccountHolder: (data: TaxDocumentation) => AccountHolderTaxDocumentation | undefined;
@@ -1,5 +1,5 @@
1
- import { TaxDocumentation } from "types";
2
- import { Address } from "types/external";
1
+ import { TaxDocumentation } from 'types';
2
+ import { Address } from 'types/server';
3
3
  export declare const transformToOutboundAccountHolderAddress: (data: TaxDocumentation) => Address | undefined;
4
4
  export declare const transformToOutboundRegardedOwnerAddress: (data: TaxDocumentation) => Address | undefined;
5
5
  export declare const transformToOutboundAccountHolderMailingAddress: (data: TaxDocumentation) => Address | undefined;
@@ -1,3 +1,3 @@
1
- import { TaxDocumentation } from "types";
2
- import { RegardedOwnerTaxDocumentation } from "types/external";
1
+ import { TaxDocumentation } from 'types';
2
+ import { RegardedOwnerTaxDocumentation } from 'types/server';
3
3
  export declare const transformToOutboundRegardedOwner: (data: TaxDocumentation) => RegardedOwnerTaxDocumentation | undefined;
@@ -1,4 +1,3 @@
1
- import { TaxDocumentation } from "types";
2
- import { AccountHolderTaxDocumentation } from "types/external";
3
- export declare const transformToOutboundAccountHolderTaxResidences: (data: TaxDocumentation) => AccountHolderTaxDocumentation["tax_residences"] | undefined;
4
- export declare const transformToOutboundAccountHolderShowTaxResidence: (data: TaxDocumentation) => AccountHolderTaxDocumentation["show_tax_residence"] | undefined;
1
+ import { TaxDocumentation } from 'types';
2
+ import { AccountHolderTaxDocumentation } from 'types/server';
3
+ export declare const transformToOutboundAccountHolderTaxResidences: (data: TaxDocumentation) => AccountHolderTaxDocumentation['tax_residences'] | undefined;
@@ -0,0 +1,3 @@
1
+ import { TaxDocumentationErrorFile, TaxDocumentationPropertyFile } from '../contexts';
2
+ import { TaxDocumentation } from '../types';
3
+ export declare const getInvalidFields: (fields: TaxDocumentation, requiredFields: TaxDocumentationPropertyFile, shownFields: TaxDocumentationPropertyFile) => TaxDocumentationErrorFile;
@@ -0,0 +1,10 @@
1
+ import { NotificationKey } from '../i18n/types';
2
+ import { TaxDocumentation, TaxDocumentationKey } from '../types';
3
+ export type NotificationRule = (fields: TaxDocumentation) => NotificationKey | undefined;
4
+ export type Notifications = {
5
+ [key in TaxDocumentationKey]?: NotificationKey;
6
+ };
7
+ export type NotificationRules = {
8
+ [key in TaxDocumentationKey]?: NotificationRule;
9
+ };
10
+ export declare const getNotifiedFields: (fields: TaxDocumentation, shownFields: Set<TaxDocumentationKey>) => Notifications;
@@ -0,0 +1,3 @@
1
+ import { type TaxDocumentationPropertyFile } from '../contexts';
2
+ import { TaxDocumentation } from '../types';
3
+ export declare const getRequiredFields: (fields: TaxDocumentation, visibleFields: TaxDocumentationPropertyFile) => TaxDocumentationPropertyFile;
@@ -0,0 +1,3 @@
1
+ import { TaxDocumentationPropertyFile } from '../contexts';
2
+ import { TaxDocumentation } from '../types';
3
+ export declare const getSubmittableFields: (fields: TaxDocumentation, visibleFields: TaxDocumentationPropertyFile) => TaxDocumentation;
@@ -1,4 +1,4 @@
1
- import type { TaxDocumentationKey, TaxForm } from "types";
1
+ import type { TaxDocumentationKey, TaxForm } from 'types';
2
2
  type TaxDocumentationPropertyFile = {
3
3
  [key in TaxDocumentationKey]: boolean;
4
4
  };
@@ -0,0 +1,3 @@
1
+ import type { TaxDocumentation, TaxForm } from 'types';
2
+ import { TaxDocumentationPropertyFile } from '../contexts';
3
+ export declare const getVisibleFields: (fields: TaxDocumentation, supportedFields: TaxDocumentationPropertyFile, supportedForms: TaxForm[]) => TaxDocumentationPropertyFile;
@@ -1,2 +1,7 @@
1
- export * from "./validations";
2
- export * from "./requiredFields";
1
+ export * from './getInvalidFields';
2
+ export * from './getRequiredFields';
3
+ export * from './getSubmittableFields';
4
+ export * from './getSupportedFields';
5
+ export * from './getVisibleFields';
6
+ export * from './invalidFieldRules.ts';
7
+ export * from './requiredFieldRules';
@@ -0,0 +1,7 @@
1
+ import { ErrorKey } from 'i18n/types';
2
+ import { TaxDocumentation, TaxDocumentationKey } from 'types/TaxDocumentation';
3
+ export type FormUIValidation = (fields: TaxDocumentation) => ErrorKey | undefined;
4
+ export type FormUIValidations = {
5
+ [key in TaxDocumentationKey]?: FormUIValidation;
6
+ };
7
+ export declare const invalidFieldRules: FormUIValidations;
@@ -1,7 +1,7 @@
1
- import { TaxDocumentation, TaxDocumentationKey } from "types/TaxDocumentation";
2
- import { TaxForm } from "../types";
1
+ import { TaxDocumentation, TaxDocumentationKey } from 'types/TaxDocumentation';
2
+ import { TaxForm } from '../types';
3
3
  export type FormUIRequired = ((fields: TaxDocumentation, taxForms?: TaxForm[]) => boolean | undefined) | (() => boolean | undefined);
4
4
  export type FormUIRequiredFields = {
5
5
  [key in TaxDocumentationKey]?: FormUIRequired;
6
6
  };
7
- export declare const requiredFields: FormUIRequiredFields;
7
+ export declare const requiredFieldRules: FormUIRequiredFields;
@@ -1,11 +1,4 @@
1
- import React from "react";
2
- import type { Locale } from "../../types";
3
- import { ClientTaxDocumentation } from "../../types/external";
4
- type TaxBitDAC7FormProps = {
5
- data?: ClientTaxDocumentation;
6
- bearerToken: string;
7
- language?: Locale;
8
- staging?: true;
9
- };
10
- export declare const TaxBitDAC7Form: ({ data, staging, bearerToken, language, }: TaxBitDAC7FormProps) => React.JSX.Element;
11
- export {};
1
+ import React from 'react';
2
+ import { TaxBitFormProps } from './TaxBitForm';
3
+ export type TaxBitDAC7FormProps = Omit<TaxBitFormProps, 'taxForms'>;
4
+ export declare const TaxBitDAC7Form: ({ data, staging, bearerToken, language, onSubmit, onSuccess, }: TaxBitDAC7FormProps) => React.JSX.Element;
@@ -1,12 +1,13 @@
1
- import React from "react";
2
- import { Locale, TaxForm } from "../../types";
3
- import { ClientTaxDocumentation } from "../../types/external";
4
- type TaxBitFormProps = {
1
+ import React from 'react';
2
+ import { Locale, TaxDocumentation, TaxForm } from 'types';
3
+ import { ClientTaxDocumentation } from 'types/client';
4
+ export type TaxBitFormProps = {
5
5
  data?: ClientTaxDocumentation;
6
6
  staging?: true;
7
7
  bearerToken: string;
8
8
  language?: Locale;
9
9
  taxForms?: TaxForm[];
10
+ onSubmit?: (data?: TaxDocumentation) => void;
11
+ onSuccess?: (data?: TaxDocumentation) => void;
10
12
  };
11
- export declare const TaxBitForm: ({ staging, data, bearerToken, language, taxForms, }: TaxBitFormProps) => React.JSX.Element;
12
- export {};
13
+ export declare const TaxBitForm: ({ staging, data, bearerToken, language, taxForms, onSubmit, onSuccess, }: TaxBitFormProps) => React.JSX.Element;
@@ -1,8 +1,8 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  type AddressProps = {
3
3
  prompt: string;
4
4
  showIf?: boolean;
5
- prefix: "accountHolderAddress" | "accountHolderMailingAddress" | "regardedOwnerAddress" | "regardedOwnerMailingAddress";
5
+ prefix: 'accountHolderAddress' | 'accountHolderMailingAddress' | 'regardedOwnerAddress' | 'regardedOwnerMailingAddress';
6
6
  };
7
- export declare const AddressInput: ({ prompt, prefix, showIf, }: AddressProps) => React.JSX.Element | undefined;
7
+ export declare const AddressInput: ({ prompt, prefix, showIf, }: AddressProps) => React.JSX.Element | null;
8
8
  export {};
@@ -1,2 +1,2 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export declare const PlaceOfBirthInput: () => React.JSX.Element;
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import { CountryCode } from "types";
1
+ import React from 'react';
2
+ import { CountryCode } from 'types';
3
3
  type AddressProps = {
4
4
  index: 1 | 2 | 3 | 4 | 5;
5
5
  showIf?: boolean;
@@ -9,5 +9,5 @@ type AddressProps = {
9
9
  label: string;
10
10
  }>;
11
11
  };
12
- export declare const ResidenceInput: ({ index, showIf, more, countryOptions, }: AddressProps) => React.JSX.Element | undefined;
12
+ export declare const ResidenceInput: ({ index, showIf, more, countryOptions, }: AddressProps) => React.JSX.Element | null;
13
13
  export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { TaxDocumentationKey } from 'types';
3
+ export declare const ErrorRow: ({ label, name, }: {
4
+ label?: string | undefined;
5
+ name: TaxDocumentationKey;
6
+ }) => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './ErrorRow.tsx';
@@ -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 VisibleRow: ({ label, subLabel, name, children, onEdit, notification, }: {
4
4
  label?: boolean | undefined;
5
5
  subLabel?: boolean | undefined;
@@ -1,6 +1,7 @@
1
- export * from "./CheckBoxRow";
2
- export * from "./RadioButtonRow";
3
- export * from "./SelectRow";
4
- export * from "./TextInputRow";
5
- export * from "./ToggleButtonRow";
6
- export * from "./MaskedInputRow";
1
+ export * from './CheckBoxRow';
2
+ export * from './ErrorRow';
3
+ export * from './MaskedInputRow';
4
+ export * from './RadioButtonRow';
5
+ export * from './SelectRow';
6
+ export * from './TextInputRow';
7
+ export * from './ToggleButtonRow';
@@ -1,2 +1,2 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export declare const AccountHolderClassification: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export declare const AccountHolderContact: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export declare const AccountHolderTax: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export declare const AccountHolderTaxClarification: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export declare const Exemptions: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export declare const RegardedOwnerClassification: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export declare const RegardedOwnerContact: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export declare const RegardedOwnerTax: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export declare const Recap: () => React.JSX.Element;