@taxbit/react-sdk 0.0.15 → 0.1.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 (153) hide show
  1. package/README.md +309 -10
  2. package/dist/basic.css +52 -7
  3. package/dist/components/Notification/Notification.d.ts +5 -0
  4. package/dist/components/Notification/index.d.ts +1 -0
  5. package/dist/components/Page/Page.d.ts +3 -1
  6. package/dist/components/Section/Section.d.ts +2 -1
  7. package/dist/components/index.d.ts +1 -1
  8. package/dist/contexts/FormUI/useFormUI.d.ts +11 -3
  9. package/dist/contexts/FormUI/useFormUIContext.d.ts +20 -4
  10. package/dist/contexts/TaxDocumentation/TaxBitFormProvider.d.ts +3 -3
  11. package/dist/contexts/TaxDocumentation/useTaxDocumentation.d.ts +6 -5
  12. package/dist/contexts/TaxDocumentation/useTaxDocumentationContext.d.ts +114 -12
  13. package/dist/entry/index.d.ts +3 -3
  14. package/dist/i18n/i18n.d.ts +1 -1
  15. package/dist/i18n/index.d.ts +1 -2
  16. package/dist/i18n/locales/bg-bg.d.ts +2 -0
  17. package/dist/i18n/locales/cs-cz.d.ts +2 -0
  18. package/dist/i18n/locales/el-gr.d.ts +2 -0
  19. package/dist/i18n/locales/et-ee.d.ts +2 -0
  20. package/dist/i18n/locales/hu-hu.d.ts +2 -0
  21. package/dist/i18n/locales/index.d.ts +10 -0
  22. package/dist/i18n/locales/mt-mt.d.ts +2 -0
  23. package/dist/i18n/locales/pt-pt.d.ts +2 -0
  24. package/dist/i18n/locales/ro-ro.d.ts +2 -0
  25. package/dist/i18n/locales/sk-sk.d.ts +2 -0
  26. package/dist/i18n/locales/sl-si.d.ts +2 -0
  27. package/dist/i18n/types/LocalizationKey.d.ts +9 -6
  28. package/dist/i18n/types/PropertyFile.d.ts +16 -2
  29. package/dist/i18n/types/index.d.ts +0 -1
  30. package/dist/i18n/utils/getText.d.ts +17 -13
  31. package/dist/index.css +4 -0
  32. package/dist/inline.css +53 -8
  33. package/dist/lookups/dayOptions.d.ts +3 -0
  34. package/dist/lookups/foreignAccountHolderAccountTypeOptions.d.ts +2 -0
  35. package/dist/lookups/foreignOtherClassificationOptions.d.ts +17 -0
  36. package/dist/lookups/foreignTrustClassificationOptions.d.ts +9 -0
  37. package/dist/lookups/index.d.ts +6 -2
  38. package/dist/lookups/localeOptions.d.ts +4 -0
  39. package/dist/lookups/monthOptions.d.ts +4 -0
  40. package/dist/lookups/usAccountHolderAccountTypeOptions.d.ts +2 -0
  41. package/dist/lookups/usLlcAccountTypeOptions.d.ts +2 -0
  42. package/dist/lookups/yearOptions.d.ts +4 -0
  43. package/dist/minimal.css +3 -1
  44. package/dist/taxbit-react-sdk.es.js +13131 -6599
  45. package/dist/taxbit-react-sdk.umd.js +10 -10
  46. package/dist/types/AccountType.d.ts +3 -3
  47. package/dist/types/Locale.d.ts +1 -0
  48. package/dist/types/MonthCode.d.ts +1 -0
  49. package/dist/types/TaxDocumentation.d.ts +1 -0
  50. package/dist/types/external/ComprehensiveTaxDocumentation.d.ts +78 -65
  51. package/dist/types/index.d.ts +2 -0
  52. package/dist/ui/ActionButton/ActionButton.d.ts +7 -0
  53. package/dist/ui/ActionButton/index.d.ts +1 -0
  54. package/dist/ui/CheckBox/CheckBox.d.ts +2 -1
  55. package/dist/ui/DateOfBirthInput/DateOfBirthInput.d.ts +9 -0
  56. package/dist/ui/DateOfBirthInput/index.d.ts +1 -0
  57. package/dist/ui/HideShowButton/HideShowButton.d.ts +5 -0
  58. package/dist/ui/HideShowButton/index.d.ts +1 -0
  59. package/dist/ui/MaskedContent/MaskedContent.d.ts +4 -0
  60. package/dist/ui/MaskedContent/index.d.ts +1 -0
  61. package/dist/ui/MaskedInput/MaskedInput.d.ts +10 -0
  62. package/dist/ui/MaskedInput/index.d.ts +1 -0
  63. package/dist/ui/Password/Password.d.ts +11 -0
  64. package/dist/ui/Password/index.d.ts +1 -0
  65. package/dist/ui/TextInput/TextInput.d.ts +4 -1
  66. package/dist/ui/index.d.ts +4 -0
  67. package/dist/utils/getForeignAccountType.d.ts +2 -0
  68. package/dist/utils/getForeignOtherClassification.d.ts +2 -0
  69. package/dist/utils/getForeignTrustClassification.d.ts +2 -0
  70. package/dist/utils/getHintKeyMap.d.ts +1 -0
  71. package/dist/utils/getLLCClassification.d.ts +2 -0
  72. package/dist/utils/getMonthlyDayCount.d.ts +1 -0
  73. package/dist/utils/getNotifications.d.ts +10 -0
  74. package/dist/utils/getPromptKeyMap.d.ts +1 -0
  75. package/dist/utils/getRequiredFields.d.ts +103 -0
  76. package/dist/utils/getUsAccountType.d.ts +2 -0
  77. package/dist/utils/getValidationMessages.d.ts +104 -0
  78. package/dist/utils/index.d.ts +8 -2
  79. package/dist/utils/isBlank.d.ts +2 -2
  80. package/dist/utils/transformInbound.d.ts +2 -1
  81. package/dist/utils/transformOutbound/convertYesNoToBoolean.d.ts +2 -0
  82. package/dist/utils/transformOutbound/transformOutbound.d.ts +3 -0
  83. package/dist/utils/transformOutbound/transformToOutboundAccoutHolder.d.ts +3 -0
  84. package/dist/utils/transformOutbound/transformToOutboundAddress.d.ts +6 -0
  85. package/dist/utils/transformOutbound/transformToOutboundRegardedOwner.d.ts +3 -0
  86. package/dist/utils/transformOutbound/transformToOutboundTaxResidenceFields.d.ts +4 -0
  87. package/dist/validations/index.d.ts +1 -0
  88. package/dist/validations/requiredFields.d.ts +7 -0
  89. package/dist/widgets/TaxBitForm/TaxBitDAC7Form.d.ts +3 -3
  90. package/dist/widgets/TaxBitForm/TaxBitForm.d.ts +3 -3
  91. package/dist/wizard/LanguageSelector/LanguageSelector.d.ts +2 -0
  92. package/dist/wizard/LanguageSelector/index.d.ts +1 -0
  93. package/dist/{paths → wizard}/ResidenceInput/ResidenceInput.d.ts +5 -2
  94. package/dist/wizard/RowInput/CheckBoxRow/CheckBoxRow.d.ts +8 -0
  95. package/dist/wizard/RowInput/DateOfBirthRow/DateOfBirthRow.d.ts +10 -0
  96. package/dist/wizard/RowInput/DateOfBirthRow/index.d.ts +1 -0
  97. package/dist/wizard/RowInput/MaskedInputRow/MaskedInputRow.d.ts +10 -0
  98. package/dist/wizard/RowInput/MaskedInputRow/index.d.ts +1 -0
  99. package/dist/{paths → wizard}/RowInput/TextInputRow/TextInputRow.d.ts +3 -1
  100. package/dist/{paths → wizard}/RowInput/VisibleRow/VisibleRow.d.ts +2 -1
  101. package/dist/{paths → wizard}/RowInput/index.d.ts +1 -1
  102. package/dist/{paths → wizard}/TaxBitFormUI/TaxBitDAC7FormUI.d.ts +3 -3
  103. package/dist/{paths → wizard}/TaxBitFormUI/TaxBitFormUI.d.ts +3 -3
  104. package/package.json +4 -2
  105. package/dist/components/Title/Title.d.ts +0 -5
  106. package/dist/components/Title/index.d.ts +0 -1
  107. package/dist/i18n/types/Locale.d.ts +0 -1
  108. package/dist/lookups/foreignOtherAccountTypeOptions.d.ts +0 -15
  109. package/dist/lookups/foreignTrustAccountTypeOptions.d.ts +0 -7
  110. package/dist/paths/FinancialAccountInput/FinancialAccountInput.d.ts +0 -6
  111. package/dist/paths/FinancialAccountInput/index.d.ts +0 -1
  112. package/dist/paths/RowInput/CheckBoxRow/CheckBoxRow.d.ts +0 -8
  113. package/dist/paths/RowInput/ErrorRow/ErrorRow.d.ts +0 -2
  114. package/dist/paths/RowInput/ErrorRow/index.d.ts +0 -1
  115. package/dist/paths/VatInput/VatInput.d.ts +0 -8
  116. package/dist/paths/VatInput/index.d.ts +0 -1
  117. package/dist/utils/transformOutbound.d.ts +0 -3
  118. /package/dist/{paths → wizard}/AddressInput/AddressInput.d.ts +0 -0
  119. /package/dist/{paths → wizard}/AddressInput/index.d.ts +0 -0
  120. /package/dist/{paths → wizard}/PlaceOfBirthInput/PlaceOfBirthInput.d.ts +0 -0
  121. /package/dist/{paths → wizard}/PlaceOfBirthInput/index.d.ts +0 -0
  122. /package/dist/{paths → wizard}/ResidenceInput/index.d.ts +0 -0
  123. /package/dist/{paths → wizard}/RowInput/CheckBoxRow/index.d.ts +0 -0
  124. /package/dist/{paths → wizard}/RowInput/RadioButtonRow/RadioButtonRow.d.ts +0 -0
  125. /package/dist/{paths → wizard}/RowInput/RadioButtonRow/index.d.ts +0 -0
  126. /package/dist/{paths → wizard}/RowInput/SelectRow/SelectRow.d.ts +0 -0
  127. /package/dist/{paths → wizard}/RowInput/SelectRow/index.d.ts +0 -0
  128. /package/dist/{paths → wizard}/RowInput/TextInputRow/index.d.ts +0 -0
  129. /package/dist/{paths → wizard}/RowInput/ToggleButtonRow/ToggleButtonRow.d.ts +0 -0
  130. /package/dist/{paths → wizard}/RowInput/ToggleButtonRow/index.d.ts +0 -0
  131. /package/dist/{paths → wizard}/RowInput/VisibleRow/index.d.ts +0 -0
  132. /package/dist/{paths → wizard}/TaxBitFormUI/AccountHolderClassification/AccountHolderClassification.d.ts +0 -0
  133. /package/dist/{paths → wizard}/TaxBitFormUI/AccountHolderClassification/index.d.ts +0 -0
  134. /package/dist/{paths → wizard}/TaxBitFormUI/AccountHolderContact/AccountHolderContact.d.ts +0 -0
  135. /package/dist/{paths → wizard}/TaxBitFormUI/AccountHolderContact/index.d.ts +0 -0
  136. /package/dist/{paths → wizard}/TaxBitFormUI/AccountHolderTax/AccountHolderTax.d.ts +0 -0
  137. /package/dist/{paths → wizard}/TaxBitFormUI/AccountHolderTax/index.d.ts +0 -0
  138. /package/dist/{paths → wizard}/TaxBitFormUI/AccountHolderTaxClarification/AccountHolderTaxClarification.d.ts +0 -0
  139. /package/dist/{paths → wizard}/TaxBitFormUI/AccountHolderTaxClarification/index.d.ts +0 -0
  140. /package/dist/{paths → wizard}/TaxBitFormUI/Exemptions/Exemptions.d.ts +0 -0
  141. /package/dist/{paths → wizard}/TaxBitFormUI/Exemptions/index.d.ts +0 -0
  142. /package/dist/{paths → wizard}/TaxBitFormUI/RegardedOwnerClassification/RegardedOwnerClassification.d.ts +0 -0
  143. /package/dist/{paths → wizard}/TaxBitFormUI/RegardedOwnerClassification/index.d.ts +0 -0
  144. /package/dist/{paths → wizard}/TaxBitFormUI/RegardedOwnerContact/RegardedOwnerContact.d.ts +0 -0
  145. /package/dist/{paths → wizard}/TaxBitFormUI/RegardedOwnerContact/index.d.ts +0 -0
  146. /package/dist/{paths → wizard}/TaxBitFormUI/RegardedOwnerTax/RegardedOwnerTax.d.ts +0 -0
  147. /package/dist/{paths → wizard}/TaxBitFormUI/RegardedOwnerTax/index.d.ts +0 -0
  148. /package/dist/{paths → wizard}/TaxBitFormUI/Summary/Recap.d.ts +0 -0
  149. /package/dist/{paths → wizard}/TaxBitFormUI/Summary/Summary.d.ts +0 -0
  150. /package/dist/{paths → wizard}/TaxBitFormUI/Summary/index.d.ts +0 -0
  151. /package/dist/{paths → wizard}/TaxBitFormUI/index.d.ts +0 -0
  152. /package/dist/{paths → wizard}/TaxBitFormUI/steps.d.ts +0 -0
  153. /package/dist/{paths → wizard}/index.d.ts +0 -0
@@ -0,0 +1,7 @@
1
+ import { TaxDocumentation, TaxDocumentationKey } from "types/TaxDocumentation";
2
+ import { TaxForm } from "../types";
3
+ export type FormUIRequired = ((fields: TaxDocumentation, taxForms?: TaxForm[]) => boolean | undefined) | (() => boolean | undefined);
4
+ export type FormUIRequiredFields = {
5
+ [key in TaxDocumentationKey]?: FormUIRequired;
6
+ };
7
+ export declare const requiredFields: FormUIRequiredFields;
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
- import type { Locale } from "../../i18n";
3
- import { TaxDocumentation } from "../../types";
2
+ import type { Locale } from "../../types";
3
+ import { ClientTaxDocumentation } from "../../types/external";
4
4
  type TaxBitDAC7FormProps = {
5
- data?: TaxDocumentation;
5
+ data?: ClientTaxDocumentation;
6
6
  bearerToken: string;
7
7
  language?: Locale;
8
8
  staging?: true;
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
- import type { Locale } from "../../i18n";
3
- import { TaxForm, TaxDocumentation } from "../../types";
2
+ import { Locale, TaxForm } from "../../types";
3
+ import { ClientTaxDocumentation } from "../../types/external";
4
4
  type TaxBitFormProps = {
5
- data?: TaxDocumentation;
5
+ data?: ClientTaxDocumentation;
6
6
  staging?: true;
7
7
  bearerToken: string;
8
8
  language?: Locale;
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const LanguageSelector: () => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./LanguageSelector";
@@ -1,10 +1,13 @@
1
1
  import React from "react";
2
- import { SelectProps } from "ui";
2
+ import { CountryCode } from "types";
3
3
  type AddressProps = {
4
4
  index: 1 | 2 | 3 | 4 | 5;
5
5
  showIf?: boolean;
6
6
  more?: true;
7
- countryOptions: SelectProps["options"];
7
+ countryOptions: ReadonlyArray<{
8
+ value: CountryCode;
9
+ label: string;
10
+ }>;
8
11
  };
9
12
  export declare const ResidenceInput: ({ index, showIf, more, countryOptions, }: AddressProps) => React.JSX.Element | undefined;
10
13
  export {};
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { CheckBoxProps } from "ui";
3
+ type CheckBoxRowProps = {
4
+ label?: boolean;
5
+ subLabel?: boolean;
6
+ };
7
+ export declare const CheckBoxRow: ({ name, label, subLabel, onClick, }: CheckBoxProps & CheckBoxRowProps) => React.JSX.Element;
8
+ export {};
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { DateOfBirthInputProps } from "ui";
3
+ import { TaxDocumentationKey } from "types";
4
+ type DateOfBirthRowProps = {
5
+ name: TaxDocumentationKey;
6
+ label?: true;
7
+ subLabel?: true;
8
+ };
9
+ export declare const DateOfBirthRow: ({ name, label, subLabel, }: DateOfBirthRowProps & DateOfBirthInputProps) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./DateOfBirthRow.tsx";
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { MaskedInputProps } from "ui";
3
+ type MaskedInputRowProps = {
4
+ label?: true;
5
+ subLabel?: true;
6
+ hint?: true;
7
+ onChange?: (val: string) => string;
8
+ };
9
+ export declare const MaskedInputRow: ({ name, label, hint, subLabel, onChange, }: MaskedInputProps & MaskedInputRowProps) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./MaskedInputRow";
@@ -1,10 +1,12 @@
1
1
  import React from "react";
2
2
  import { TextInputProps } from "ui";
3
+ import { TaxDocumentationKey } from "types";
3
4
  type TextInputRowProps = {
4
5
  label?: true;
5
6
  subLabel?: true;
6
7
  hint?: true;
7
8
  onChange?: (val: string) => string;
9
+ syncName?: TaxDocumentationKey;
8
10
  };
9
- export declare const TextInputRow: ({ name, label, hint, subLabel, onChange, }: TextInputProps & TextInputRowProps) => React.JSX.Element;
11
+ export declare const TextInputRow: ({ name, label, hint, subLabel, onChange, disabled, syncName, }: TextInputProps & TextInputRowProps) => React.JSX.Element;
10
12
  export {};
@@ -1,8 +1,9 @@
1
1
  import React from "react";
2
2
  import { TaxDocumentationKey } from "types";
3
- export declare const VisibleRow: ({ label, subLabel, name, children, onEdit, }: {
3
+ export declare const VisibleRow: ({ label, subLabel, name, children, onEdit, notification, }: {
4
4
  label?: boolean | undefined;
5
5
  subLabel?: boolean | undefined;
6
+ notification?: boolean | undefined;
6
7
  name: TaxDocumentationKey;
7
8
  children: React.ReactNode;
8
9
  onEdit?: (() => void) | undefined;
@@ -1,6 +1,6 @@
1
1
  export * from "./CheckBoxRow";
2
- export * from "./ErrorRow";
3
2
  export * from "./RadioButtonRow";
4
3
  export * from "./SelectRow";
5
4
  export * from "./TextInputRow";
6
5
  export * from "./ToggleButtonRow";
6
+ export * from "./MaskedInputRow";
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
- import type { Locale } from "../../i18n";
3
- import type { TaxDocumentation } from "../../types";
2
+ import type { Locale, TaxDocumentation } from "../../types";
3
+ import { ClientTaxDocumentation } from "../../types/external";
4
4
  type TaxDocumentationDAC7PathProps = {
5
- data?: TaxDocumentation;
5
+ data?: ClientTaxDocumentation;
6
6
  onSubmit: (data: TaxDocumentation) => void;
7
7
  language?: Locale;
8
8
  };
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
- import type { Locale } from "../../i18n";
3
- import type { TaxForm, TaxDocumentation } from "../../types";
2
+ import type { Locale, TaxForm, TaxDocumentation } from "../../types";
3
+ import { ClientTaxDocumentation } from "../../types/external";
4
4
  type TaxBitFormUIProps = {
5
- data?: TaxDocumentation;
5
+ data?: ClientTaxDocumentation;
6
6
  onSubmit: (data: TaxDocumentation) => void;
7
7
  language?: Locale;
8
8
  taxForms?: TaxForm[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taxbit/react-sdk",
3
- "version": "0.0.15",
3
+ "version": "0.1.0",
4
4
  "description": "TaxBit Tax Documentation",
5
5
  "author": "TaxBit",
6
6
  "type": "module",
@@ -33,11 +33,13 @@
33
33
  "dependencies": {
34
34
  "react": "^18.2.0",
35
35
  "react-dom": "^18.2.0",
36
- "react-input-mask": "^2.0.4"
36
+ "react-input-mask": "^2.0.4",
37
+ "type-fest": "^4.3.2"
37
38
  },
38
39
  "devDependencies": {
39
40
  "@types/node": "^18.17.0",
40
41
  "@types/react": "^18.2.15",
42
+ "@types/react-better-password": "^1.0.3",
41
43
  "@types/react-dom": "^18.2.7",
42
44
  "@typescript-eslint/eslint-plugin": "^6.0.0",
43
45
  "@typescript-eslint/parser": "^6.0.0",
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- export declare const Title: ({ title, subtitle, }: {
3
- title: string;
4
- subtitle?: string | undefined;
5
- }) => React.JSX.Element;
@@ -1 +0,0 @@
1
- export * from './Title.tsx';
@@ -1 +0,0 @@
1
- export type Locale = "en-us" | "de-de" | "en-gb" | "it-it" | "nl-nl" | "no-no" | "sv-se" | "fr-fr" | "es-es";
@@ -1,15 +0,0 @@
1
- export declare const foreignOtherAccountTypeOptions: readonly [{
2
- readonly value: "taxExemptOrganization";
3
- }, {
4
- readonly value: "privateFoundation";
5
- }, {
6
- readonly value: "internationalOrganization";
7
- }, {
8
- readonly value: "centralBankOfIssue";
9
- }, {
10
- readonly value: "foreignGovernmentControlledEntity";
11
- }, {
12
- readonly value: "foreignGovernmentIntegralPart";
13
- }, {
14
- readonly value: "estate";
15
- }];
@@ -1,7 +0,0 @@
1
- export declare const foreignTrustAccountTypeOptions: readonly [{
2
- readonly value: "simpleTrust";
3
- }, {
4
- readonly value: "complexTrust";
5
- }, {
6
- readonly value: "grantorTrust";
7
- }];
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- type AddressProps = {
3
- showIf?: boolean;
4
- };
5
- export declare const FinancialAccountInput: ({ showIf }: AddressProps) => React.JSX.Element;
6
- export {};
@@ -1 +0,0 @@
1
- export * from "./FinancialAccountInput";
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- import { CheckBoxProps } from "ui";
3
- type CheckBoxRowProps = {
4
- label?: true;
5
- subLabel?: true;
6
- };
7
- export declare const CheckBoxRow: ({ name, label, subLabel, }: CheckBoxProps & CheckBoxRowProps) => React.JSX.Element;
8
- export {};
@@ -1,2 +0,0 @@
1
- import React from "react";
2
- export declare const ErrorRow: () => React.JSX.Element;
@@ -1 +0,0 @@
1
- export * from "./ErrorRow";
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- import { SelectProps } from "ui";
3
- type AddressProps = {
4
- showIf?: boolean;
5
- countryOptions: SelectProps["options"];
6
- };
7
- export declare const VatInput: ({ countryOptions, showIf }: AddressProps) => React.JSX.Element;
8
- export {};
@@ -1 +0,0 @@
1
- export * from "./VatInput";
@@ -1,3 +0,0 @@
1
- import { ComprehensiveTaxDocumentation } from "../types/external";
2
- import { TaxDocumentation } from "../types";
3
- export declare const transformOutbound: (data: TaxDocumentation) => ComprehensiveTaxDocumentation;
File without changes
File without changes
File without changes
File without changes