@taxbit/react-sdk 0.0.16 → 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 (195) hide show
  1. package/README.md +99 -42
  2. package/dist/App.d.ts +1 -1
  3. package/dist/basic.css +32 -6
  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 -8
  10. package/dist/contexts/FormUI/index.d.ts +3 -3
  11. package/dist/contexts/FormUI/useFormUI.d.ts +18 -117
  12. package/dist/contexts/FormUI/useFormUIContext.d.ts +32 -632
  13. package/dist/contexts/TaxDocumentation/TaxBitFormProvider.d.ts +6 -5
  14. package/dist/contexts/TaxDocumentation/useTaxDocumentation.d.ts +11 -10
  15. package/dist/contexts/TaxDocumentation/useTaxDocumentationContext.d.ts +194 -112
  16. package/dist/entry/index.d.ts +5 -6
  17. package/dist/hooks/useTaxBit/useTaxBit.d.ts +108 -4
  18. package/dist/i18n/i18n.d.ts +1 -1
  19. package/dist/i18n/index.d.ts +1 -2
  20. package/dist/i18n/locales/bg-bg.d.ts +2 -0
  21. package/dist/i18n/locales/cs-cz.d.ts +2 -0
  22. package/dist/i18n/locales/da-dk.d.ts +2 -0
  23. package/dist/i18n/locales/de-at.d.ts +2 -0
  24. package/dist/i18n/locales/de-de.d.ts +1 -1
  25. package/dist/i18n/locales/el-cy.d.ts +2 -0
  26. package/dist/i18n/locales/el-gr.d.ts +2 -0
  27. package/dist/i18n/locales/en-gb.d.ts +1 -1
  28. package/dist/i18n/locales/en-us.d.ts +1 -1
  29. package/dist/i18n/locales/es-es.d.ts +1 -1
  30. package/dist/i18n/locales/et-ee.d.ts +2 -0
  31. package/dist/i18n/locales/fi-fi.d.ts +2 -0
  32. package/dist/i18n/locales/fr-fr.d.ts +1 -1
  33. package/dist/i18n/locales/fr-lu.d.ts +2 -0
  34. package/dist/i18n/locales/ga-ie.d.ts +2 -0
  35. package/dist/i18n/locales/hr-hr.d.ts +2 -0
  36. package/dist/i18n/locales/hu-hu.d.ts +2 -0
  37. package/dist/i18n/locales/index.d.ts +21 -1
  38. package/dist/i18n/locales/it-it.d.ts +1 -1
  39. package/dist/i18n/locales/lt-lt.d.ts +2 -0
  40. package/dist/i18n/locales/lv-lv.d.ts +2 -0
  41. package/dist/i18n/locales/mt-mt.d.ts +2 -0
  42. package/dist/i18n/locales/nl-be.d.ts +2 -0
  43. package/dist/i18n/locales/nl-nl.d.ts +1 -1
  44. package/dist/i18n/locales/no-no.d.ts +1 -1
  45. package/dist/i18n/locales/pl-pl.d.ts +2 -0
  46. package/dist/i18n/locales/pt-pt.d.ts +1 -1
  47. package/dist/i18n/locales/ro-ro.d.ts +2 -0
  48. package/dist/i18n/locales/sk-sk.d.ts +2 -0
  49. package/dist/i18n/locales/sl-si.d.ts +2 -0
  50. package/dist/i18n/locales/sv-se.d.ts +1 -1
  51. package/dist/i18n/types/LocalizationKey.d.ts +10 -10
  52. package/dist/i18n/types/PropertyFile.d.ts +6 -2
  53. package/dist/i18n/types/index.d.ts +0 -1
  54. package/dist/i18n/utils/getText.d.ts +16 -15
  55. package/dist/index.css +4 -0
  56. package/dist/inline.css +33 -6
  57. package/dist/lookups/dayOptions.d.ts +1 -1
  58. package/dist/lookups/index.d.ts +3 -2
  59. package/dist/lookups/localeOptions.d.ts +4 -0
  60. package/dist/lookups/toOptions.d.ts +3 -0
  61. package/dist/minimal.css +0 -1
  62. package/dist/services/api.d.ts +3 -2
  63. package/dist/taxbit-react-sdk.es.js +18748 -6610
  64. package/dist/taxbit-react-sdk.umd.js +10 -10
  65. package/dist/test/Wrapper.d.ts +7 -0
  66. package/dist/test/getWrapper.d.ts +4 -0
  67. package/dist/test/index.d.ts +2 -0
  68. package/dist/types/Locale.d.ts +1 -0
  69. package/dist/types/TaxDocumentation.d.ts +8 -5
  70. package/dist/types/client/index.d.ts +6 -0
  71. package/dist/types/index.d.ts +1 -0
  72. package/dist/types/{external → server}/ComprehensiveTaxDocumentation.d.ts +7 -11
  73. package/dist/types/server/TaxDocumentationStatus.d.ts +9 -0
  74. package/dist/types/server/enums.d.ts +13 -0
  75. package/dist/types/server/index.d.ts +3 -0
  76. package/dist/ui/DateOfBirthInput/DateOfBirthInput.d.ts +1 -2
  77. package/dist/ui/DateOfBirthInput/__tests__/useDateOfBirthInput.test.d.ts +1 -0
  78. package/dist/ui/DateOfBirthInput/useDateOfBirthInput.d.ts +20 -0
  79. package/dist/ui/HideShowButton/HideShowButton.d.ts +5 -0
  80. package/dist/ui/HideShowButton/index.d.ts +1 -0
  81. package/dist/ui/MaskedContent/MaskedContent.d.ts +4 -0
  82. package/dist/ui/MaskedContent/index.d.ts +1 -0
  83. package/dist/ui/MaskedInput/MaskedInput.d.ts +10 -0
  84. package/dist/ui/MaskedInput/index.d.ts +1 -0
  85. package/dist/ui/Password/Password.d.ts +10 -0
  86. package/dist/ui/Password/index.d.ts +1 -0
  87. package/dist/ui/RadioButtons/RadioButtons.d.ts +3 -3
  88. package/dist/ui/RadioButtons/__tests__/RadioButtons.test.d.ts +0 -0
  89. package/dist/ui/TextInput/TextInput.d.ts +2 -1
  90. package/dist/ui/index.d.ts +2 -0
  91. package/dist/utils/getFieldsState.d.ts +4 -3
  92. package/dist/utils/getHintKeyMap.d.ts +4 -3
  93. package/dist/utils/getMonthlyDayCount.d.ts +1 -0
  94. package/dist/utils/getPromptKeyMap.d.ts +6 -5
  95. package/dist/utils/index.d.ts +10 -14
  96. package/dist/utils/kebabCase.d.ts +1 -0
  97. package/dist/utils/{getForeignAccountType.d.ts → transformInbound/getForeignAccountType.d.ts} +1 -1
  98. package/dist/utils/{getForeignOtherClassification.d.ts → transformInbound/getForeignOtherClassification.d.ts} +1 -1
  99. package/dist/utils/{getForeignTrustClassification.d.ts → transformInbound/getForeignTrustClassification.d.ts} +1 -1
  100. package/dist/utils/{getLLCClassification.d.ts → transformInbound/getLLCClassification.d.ts} +1 -1
  101. package/dist/utils/{getUsAccountType.d.ts → transformInbound/getUsAccountType.d.ts} +1 -1
  102. package/dist/utils/transformInbound/index.d.ts +6 -0
  103. package/dist/utils/transformInbound/transformInbound.d.ts +3 -0
  104. package/dist/utils/transformOutbound/convertYesNoToBoolean.d.ts +2 -0
  105. package/dist/utils/transformOutbound/index.d.ts +6 -0
  106. package/dist/utils/transformOutbound/transformOutbound.d.ts +3 -0
  107. package/dist/utils/transformOutbound/transformToOutboundAccoutHolder.d.ts +3 -0
  108. package/dist/utils/transformOutbound/transformToOutboundAddress.d.ts +6 -0
  109. package/dist/utils/transformOutbound/transformToOutboundRegardedOwner.d.ts +3 -0
  110. package/dist/utils/transformOutbound/transformToOutboundTaxResidenceFields.d.ts +3 -0
  111. package/dist/validations/getInvalidFields.d.ts +3 -0
  112. package/dist/validations/getNotifiedFields.d.ts +10 -0
  113. package/dist/validations/getRequiredFields.d.ts +3 -0
  114. package/dist/validations/getSubmittableFields.d.ts +3 -0
  115. package/dist/{utils → validations}/getSupportedFields.d.ts +1 -1
  116. package/dist/validations/getVisibleFields.d.ts +3 -0
  117. package/dist/validations/index.d.ts +7 -1
  118. package/dist/validations/invalidFieldRules.d.ts +7 -0
  119. package/dist/validations/requiredFieldRules.d.ts +7 -0
  120. package/dist/widgets/TaxBitForm/TaxBitDAC7Form.d.ts +4 -11
  121. package/dist/widgets/TaxBitForm/TaxBitForm.d.ts +7 -7
  122. package/dist/wizard/AddressInput/AddressInput.d.ts +8 -0
  123. package/dist/wizard/LanguageSelector/LanguageSelector.d.ts +2 -0
  124. package/dist/wizard/LanguageSelector/index.d.ts +1 -0
  125. package/dist/{paths → wizard}/PlaceOfBirthInput/PlaceOfBirthInput.d.ts +1 -1
  126. package/dist/{paths → wizard}/ResidenceInput/ResidenceInput.d.ts +3 -3
  127. package/dist/{paths → wizard}/RowInput/CheckBoxRow/CheckBoxRow.d.ts +2 -2
  128. package/dist/wizard/RowInput/ErrorRow/ErrorRow.d.ts +6 -0
  129. package/dist/wizard/RowInput/ErrorRow/index.d.ts +1 -0
  130. package/dist/wizard/RowInput/MaskedInputRow/MaskedInputRow.d.ts +10 -0
  131. package/dist/wizard/RowInput/MaskedInputRow/index.d.ts +1 -0
  132. package/dist/{paths → wizard}/RowInput/TextInputRow/TextInputRow.d.ts +3 -1
  133. package/dist/{paths → wizard}/RowInput/VisibleRow/VisibleRow.d.ts +2 -2
  134. package/dist/wizard/RowInput/index.d.ts +7 -0
  135. package/dist/{paths → wizard}/TaxBitFormUI/AccountHolderClassification/AccountHolderClassification.d.ts +1 -1
  136. package/dist/{paths → wizard}/TaxBitFormUI/AccountHolderContact/AccountHolderContact.d.ts +1 -1
  137. package/dist/{paths → wizard}/TaxBitFormUI/AccountHolderTax/AccountHolderTax.d.ts +1 -1
  138. package/dist/{paths → wizard}/TaxBitFormUI/AccountHolderTaxClarification/AccountHolderTaxClarification.d.ts +1 -1
  139. package/dist/{paths → wizard}/TaxBitFormUI/Exemptions/Exemptions.d.ts +1 -1
  140. package/dist/{paths → wizard}/TaxBitFormUI/RegardedOwnerClassification/RegardedOwnerClassification.d.ts +1 -1
  141. package/dist/{paths → wizard}/TaxBitFormUI/RegardedOwnerContact/RegardedOwnerContact.d.ts +1 -1
  142. package/dist/{paths → wizard}/TaxBitFormUI/RegardedOwnerTax/RegardedOwnerTax.d.ts +1 -1
  143. package/dist/{paths → wizard}/TaxBitFormUI/Summary/Recap.d.ts +1 -1
  144. package/dist/{paths → wizard}/TaxBitFormUI/Summary/Summary.d.ts +1 -1
  145. package/dist/wizard/TaxBitFormUI/TaxBitDAC7FormUI.d.ts +4 -0
  146. package/dist/wizard/TaxBitFormUI/TaxBitFormUI.d.ts +11 -0
  147. package/package.json +17 -9
  148. package/dist/components/Page/Page.d.ts +0 -6
  149. package/dist/components/Page/index.d.ts +0 -1
  150. package/dist/components/Title/Title.d.ts +0 -5
  151. package/dist/components/Title/index.d.ts +0 -1
  152. package/dist/i18n/types/Locale.d.ts +0 -1
  153. package/dist/paths/AddressInput/AddressInput.d.ts +0 -8
  154. package/dist/paths/FinancialAccountInput/FinancialAccountInput.d.ts +0 -2
  155. package/dist/paths/FinancialAccountInput/index.d.ts +0 -1
  156. package/dist/paths/RowInput/ErrorRow/ErrorRow.d.ts +0 -2
  157. package/dist/paths/RowInput/ErrorRow/index.d.ts +0 -1
  158. package/dist/paths/RowInput/index.d.ts +0 -6
  159. package/dist/paths/TaxBitFormUI/TaxBitDAC7FormUI.d.ts +0 -11
  160. package/dist/paths/TaxBitFormUI/TaxBitFormUI.d.ts +0 -12
  161. package/dist/paths/VatInput/VatInput.d.ts +0 -8
  162. package/dist/paths/VatInput/index.d.ts +0 -1
  163. package/dist/types/external/index.d.ts +0 -1
  164. package/dist/utils/getNotifications.d.ts +0 -10
  165. package/dist/utils/getVisibleQuestions.d.ts +0 -6
  166. package/dist/utils/transformInbound.d.ts +0 -3
  167. package/dist/utils/transformOutbound.d.ts +0 -3
  168. package/dist/validations/validations.d.ts +0 -7
  169. /package/dist/{taxbit-react-sdk.es.d.ts → index.d.ts} +0 -0
  170. /package/dist/{paths → wizard}/AddressInput/index.d.ts +0 -0
  171. /package/dist/{paths → wizard}/PlaceOfBirthInput/index.d.ts +0 -0
  172. /package/dist/{paths → wizard}/ResidenceInput/index.d.ts +0 -0
  173. /package/dist/{paths → wizard}/RowInput/CheckBoxRow/index.d.ts +0 -0
  174. /package/dist/{paths → wizard}/RowInput/DateOfBirthRow/DateOfBirthRow.d.ts +0 -0
  175. /package/dist/{paths → wizard}/RowInput/DateOfBirthRow/index.d.ts +0 -0
  176. /package/dist/{paths → wizard}/RowInput/RadioButtonRow/RadioButtonRow.d.ts +0 -0
  177. /package/dist/{paths → wizard}/RowInput/RadioButtonRow/index.d.ts +0 -0
  178. /package/dist/{paths → wizard}/RowInput/SelectRow/SelectRow.d.ts +0 -0
  179. /package/dist/{paths → wizard}/RowInput/SelectRow/index.d.ts +0 -0
  180. /package/dist/{paths → wizard}/RowInput/TextInputRow/index.d.ts +0 -0
  181. /package/dist/{paths → wizard}/RowInput/ToggleButtonRow/ToggleButtonRow.d.ts +0 -0
  182. /package/dist/{paths → wizard}/RowInput/ToggleButtonRow/index.d.ts +0 -0
  183. /package/dist/{paths → wizard}/RowInput/VisibleRow/index.d.ts +0 -0
  184. /package/dist/{paths → wizard}/TaxBitFormUI/AccountHolderClassification/index.d.ts +0 -0
  185. /package/dist/{paths → wizard}/TaxBitFormUI/AccountHolderContact/index.d.ts +0 -0
  186. /package/dist/{paths → wizard}/TaxBitFormUI/AccountHolderTax/index.d.ts +0 -0
  187. /package/dist/{paths → wizard}/TaxBitFormUI/AccountHolderTaxClarification/index.d.ts +0 -0
  188. /package/dist/{paths → wizard}/TaxBitFormUI/Exemptions/index.d.ts +0 -0
  189. /package/dist/{paths → wizard}/TaxBitFormUI/RegardedOwnerClassification/index.d.ts +0 -0
  190. /package/dist/{paths → wizard}/TaxBitFormUI/RegardedOwnerContact/index.d.ts +0 -0
  191. /package/dist/{paths → wizard}/TaxBitFormUI/RegardedOwnerTax/index.d.ts +0 -0
  192. /package/dist/{paths → wizard}/TaxBitFormUI/Summary/index.d.ts +0 -0
  193. /package/dist/{paths → wizard}/TaxBitFormUI/index.d.ts +0 -0
  194. /package/dist/{paths → wizard}/TaxBitFormUI/steps.d.ts +0 -0
  195. /package/dist/{paths → wizard}/index.d.ts +0 -0
package/README.md CHANGED
@@ -9,90 +9,147 @@ npm install @taxbit/react-sdk
9
9
  ```
10
10
 
11
11
  ```typescript
12
- import '@taxbit/react-sdk/style/inline.css'; // other options include 'basic.css' and 'minimal.css'
12
+ import '@taxbit/react-sdk/style/inline.css'; // other options include 'basic.css' and 'minimal.css'
13
13
  import { TaxBitDAC7Form } from '@taxbit/react-sdk';
14
14
  ```
15
15
 
16
16
  ### Data
17
+
17
18
  ```typescript
18
19
  exampleData = {
19
- name: "John Smith",
20
- tin: "456456456",
21
- ftin: "667788991",
22
- usAccountType: "individual",
23
- foreignAccountType: "individual",
20
+ accountHolder: {
21
+ name: 'John Smith',
22
+ tin: '456456456',
23
+ ftin: '667788991',
24
+ usAccountType: 'individual',
25
+ foreignAccountType: 'individual',
24
26
  address: {
25
- firstLine: "123 Main St",
26
- city: "Seattle",
27
- stateOrProvince: "WA",
28
- postalCode: "98000",
29
- country: "GR",
27
+ firstLine: '123 Main St',
28
+ secondLine: 'Unit #2',
29
+ city: 'Seattle',
30
+ stateOrProvince: 'WA',
31
+ postalCode: '98000',
32
+ country: 'GR',
30
33
  },
31
34
  mailingAddress: {
32
- firstLine: "123 Main St",
33
- city: "Seattle",
34
- stateOrProvince: "WA",
35
- postalCode: "98000",
36
- country: "GR",
35
+ firstLine: '123 Main St',
36
+ city: 'Seattle',
37
+ stateOrProvince: 'WA',
38
+ postalCode: '98000',
39
+ country: 'GR',
37
40
  },
38
41
  mailingAddressIsDifferent: true,
39
- countryOfCitizenship: "GR",
42
+ countryOfCitizenship: 'GR',
40
43
  ftinNotLegallyRequired: true,
41
44
  taxResidences: [
42
- {
43
- country: "GR",
44
- tin: "456456456",
45
- tinNotRequired: false,
46
- },
45
+ {
46
+ country: 'GR',
47
+ tin: '456456456',
48
+ tinNotRequired: false,
49
+ },
47
50
  ],
48
- vatin: "123123123",
49
- vatinCountry: "GR",
51
+ vatin: '123123123',
52
+ vatinCountry: 'GR',
50
53
  vatinNotRequired: true,
51
- financialAccountIdentifier: "123123123",
52
- financialAccountName: "John Smith",
54
+ financialAccountIdentifier: '123123123',
55
+ financialAccountName: 'John Smith',
53
56
  isIndividual: true,
54
57
  isEuResident: true,
55
58
  isUsPerson: false,
59
+ },
56
60
  };
57
61
  ```
58
62
 
59
63
  ```jsx
60
64
  <TaxBitDAC7Form
61
- data={exampleData} // `data` is an optional prop
62
- bearerToken='bearer token goes here'
63
- language='en-us' // 'en-us' is the default
64
- staging // if not production
65
+ data={exampleData} // `data` is an optional prop
66
+ bearerToken="bearer token goes here"
67
+ language="en-us" // 'en-us' is the default
68
+ staging // if not production
65
69
  />
66
70
  ```
67
71
 
68
72
  Which is just a shortcut for this component...
73
+
69
74
  ```jsx
70
- <TaxBitForm
71
- data={exampleData} // `data` is an optional prop
72
- bearerToken='bearer token goes here'
73
- language='en-us' // 'en-us' is the default
74
- forms={['DAC7']}
75
- staging // if not production
75
+ <TaxBitForm
76
+ data={exampleData} // `data` is an optional prop
77
+ bearerToken="bearer token goes here"
78
+ language="en-us" // 'en-us' is the default
79
+ forms={['DAC7']}
80
+ staging // if not production
81
+ />
82
+ ```
83
+
84
+ There is a more basic component that simply shows the TaxBit UI and does not interact with the TaxBit server. It can be used like this...
85
+
86
+ ```typescript jsx
87
+ <TaxBitDAC7FormUI
88
+ data={exampleData}
89
+ onSubmit={(data: unknown) => alert(JSON.stringify(data))}
76
90
  />
77
91
  ```
78
92
 
79
93
  ### Bearer Token
94
+
80
95
  This will be generated from the TaxBit API and passed in as a prop to the component.
81
96
 
82
97
  ### Language
83
- This can be set to any of the following:
98
+
99
+ The first screen of the tax documentation interview gives the user the opportunity to select a language.
100
+ This can also be initially set to any one of the following:
101
+
102
+ - bg-bg
103
+ - cs-cz
104
+ - da-dk
105
+ - de-at
106
+ - de-de
107
+ - el-cy
108
+ - el-gr
109
+ - en-gb
84
110
  - en-us
85
111
  - es-es
112
+ - et-ee
113
+ - fi-fi
86
114
  - fr-fr
87
- - de-de
115
+ - fr-lu
116
+ - ga-ie
117
+ - hr-hr
118
+ - hu-hu
88
119
  - it-it
120
+ - lt-lt
121
+ - lv-lv
122
+ - mt-mt
123
+ - nl-be
89
124
  - nl-nl
90
125
  - no-no
91
- - sv-se
92
- - en-gb
126
+ - pl-pl
93
127
  - pt-pt
128
+ - ro-ro
129
+ - sk-sk
130
+ - sl-si
131
+ - sv-se
94
132
 
95
133
  ### Staging
96
- This can be set to `true` or `false`. Passing `staging` in the component is the same as passing `staging={true}`.
97
134
 
98
- If `true`, the staging environment will be used. If `false`, the production environment will be used. The default is `false`.
135
+ This can be set to `true` or `false`. Passing `staging` in the component is the same as passing `staging={true}`.
136
+
137
+ If `true`, the staging environment will be used. If `false`, the production environment will be used. The default is `false`.
138
+
139
+ ### CSS and Style Customization
140
+
141
+ The TaxBit React SDK renders a form for collecting user data. The form is structured with fairly semantic HTML and CSS classes and can be easily customized to closely match your website's style.
142
+ Classnames are namespaced with "taxbit-" to reduce the chance of conflict.
143
+
144
+ ### Callbacks
145
+
146
+ The TaxBit React SDK provides callbacks for the following events:
147
+
148
+ - `onSubmit` - called when the user clicks the submit button
149
+ - `onSuccess` - called after the server responds with a successful submission
150
+
151
+ These callbacks can be passed in to the Component and used to trigger other actions in your application.
152
+
153
+ ### Types
154
+
155
+ The TaxBit React SDK provides a type for the status of the most resent tax documentation submitted by the user, referred to as `ClientTaxDocumentationStatus`. The data is typed as `ClientTaxDocumentation` and can be used to determine if the user has submitted tax documentation and if it has been approved.
package/dist/App.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export declare const App: () => React.JSX.Element;
package/dist/basic.css CHANGED
@@ -29,17 +29,23 @@ button:focus-visible {
29
29
  .taxbit-page {
30
30
  max-width: 600px;
31
31
  padding: 12px;
32
- margin-bottom: 100px;
33
32
  }
34
33
 
35
- .taxbit-title {
34
+ .taxbit-page-header {
35
+ display: flex;
36
+ align-items: center;
37
+ padding-bottom: 8px;
38
+ border-bottom: solid 1px #E4EBF6;
39
+ margin-bottom: 20px;
40
+ }
41
+
42
+ .taxbit-page-title {
43
+ margin: 0;
36
44
  font-size: 1.2em;
37
45
  line-height: 1.1;
38
46
  font-weight: 600;
39
- padding-bottom: 8px;
40
- border-bottom: solid 1px #E4EBF6;
41
- margin-bottom: 8px;
42
47
  color: #12263F;
48
+ flex: 1 1 auto;
43
49
  }
44
50
 
45
51
  .taxbit-section {
@@ -57,6 +63,18 @@ button:focus-visible {
57
63
  }
58
64
  }
59
65
 
66
+ .taxbit-select-language {
67
+ border: 0;
68
+ outline: none;
69
+ opacity: 0.6;
70
+ width: 170px;
71
+ }
72
+
73
+ .taxbit-select-language:focus {
74
+ border-bottom: solid 1px #E4EBF6;
75
+ opacity: 1;
76
+ }
77
+
60
78
  .taxbit-row {
61
79
  margin-bottom: 10px;
62
80
  align-items: flex-start;
@@ -83,6 +101,8 @@ button:focus-visible {
83
101
 
84
102
  .taxbit-row-actions {
85
103
  flex: 0 0 10%;
104
+ display: flex;
105
+ align-items: center;
86
106
  }
87
107
  .taxbit-row-action-button {
88
108
  font-size: .8em;
@@ -93,11 +113,11 @@ button:focus-visible {
93
113
  .taxbit-label {
94
114
  flex: 0 0 40%;
95
115
  font-weight: 500;
96
- line-height: 1.25em;
97
116
  .taxbit-sub-label {
98
117
  font-size: 0.8em;
99
118
  opacity: 0.7;
100
119
  font-weight: 400;
120
+ line-height: 1.25em;
101
121
  }
102
122
  }
103
123
  .taxbit-input, .taxbit-select {
@@ -110,6 +130,12 @@ button:focus-visible {
110
130
  color: rgb(18, 38, 63);
111
131
  }
112
132
 
133
+ @media only screen and (max-width: 600px) {
134
+ .taxbit-input, .taxbit-select {
135
+ font-size: 100%;
136
+ }
137
+ }
138
+
113
139
  .taxbit-placeholder {
114
140
  color: #aaa;
115
141
  }
@@ -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 ErrorMessage: ({ name, hint, }: {
4
4
  name: TaxDocumentationKey;
5
5
  hint?: true | undefined;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ type FormProps = {
3
+ title: string;
4
+ children: React.ReactNode;
5
+ actions?: React.ReactNode;
6
+ };
7
+ export declare const Form: ({ children, title, actions }: FormProps) => React.JSX.Element;
8
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Form.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 Notification: ({ name }: {
4
4
  name: TaxDocumentationKey;
5
5
  }) => React.JSX.Element | null;
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import { TaxDocumentationKey } from "types/TaxDocumentation";
1
+ import React from 'react';
2
+ import { TaxDocumentationKey } from 'types/TaxDocumentation';
3
3
  export type RowProps = {
4
4
  label?: string;
5
5
  subLabel?: string;
@@ -1,8 +1,7 @@
1
- export * from "./Address";
2
- export * from "./ErrorMessage";
3
- export * from "./Notification";
4
- export * from "./InputStatus";
5
- export * from "./Page";
6
- export * from "./Row";
7
- export * from "./Section";
8
- export * from "./Title";
1
+ export * from './Address';
2
+ export * from './ErrorMessage';
3
+ export * from './Form';
4
+ export * from './InputStatus';
5
+ export * from './Notification';
6
+ export * from './Row';
7
+ export * from './Section';
@@ -1,3 +1,3 @@
1
- export * from "./useFormUIContext";
2
- export * from "./FormUIProvider";
3
- export { type FormUIFields } from "./useFormUI";
1
+ export * from './FormUIProvider';
2
+ export { type TaxDocumentationErrorFile, type TaxDocumentationPropertyFile, } from './useFormUI';
3
+ export * from './useFormUIContext';
@@ -1,144 +1,45 @@
1
- import { ButtonKey, ErrorKey, NotificationKey, TextKey, TitleKey } from "i18n/types";
2
- import { TaxDocumentation, TaxDocumentationKey } from "types/TaxDocumentation";
3
- import { Notifications } from "../../utils/getNotifications";
4
- export type FormUIFields = {
5
- [key in TaxDocumentationKey]?: string | undefined;
1
+ /// <reference types="react" />
2
+ import { ButtonKey, ErrorKey, HintKey, NotificationKey, PromptKey, SubPromptKey, TextKey, TitleKey } from 'i18n/types';
3
+ import { Locale } from 'types';
4
+ import { TaxDocumentation, TaxDocumentationKey } from 'types/TaxDocumentation';
5
+ export type TaxDocumentationPropertyFile = {
6
+ [key in TaxDocumentationKey]: boolean;
6
7
  };
7
- type FormUIErrors = {
8
- [key in TaxDocumentationKey]: ErrorKey;
9
- };
10
- type FormUIRequired = {
11
- [key in TaxDocumentationKey]?: boolean;
8
+ export type TaxDocumentationErrorFile = {
9
+ [key in TaxDocumentationKey]?: ErrorKey;
12
10
  };
13
11
  export declare const useFormUI: () => {
14
12
  fields: TaxDocumentation;
13
+ setFields: import("react").Dispatch<import("react").SetStateAction<TaxDocumentation>>;
15
14
  setValue: (key: TaxDocumentationKey, value: string | undefined) => void;
16
- errors: FormUIErrors;
17
- notifications: Notifications;
18
15
  isErrorFree: boolean;
19
16
  showErrors: boolean;
20
17
  exposeErrors: () => void;
21
18
  hideErrors: () => void;
22
- requiredFields: FormUIRequired;
23
19
  getLocalButton: (key: ButtonKey) => string;
24
20
  getLocalCaProvince: (key: string | undefined) => string;
25
21
  getLocalCountry: (key: string | undefined) => string;
26
22
  getLocalError: (key: ErrorKey) => string;
27
23
  getLocalHint: (key: TaxDocumentationKey) => string | undefined;
24
+ getHintKey: (key: TaxDocumentationKey) => HintKey;
25
+ getLocalLocale: (key: Locale) => string;
28
26
  getLocalNotification: (key: NotificationKey) => string;
29
27
  getLocalOption: (key: string | undefined) => string | undefined;
30
28
  getLocalPrompt: (key: string) => string;
29
+ getPromptKey: (key: string) => PromptKey;
31
30
  getLocalSubPrompt: (key: TaxDocumentationKey) => string;
31
+ getSubPromptKey: (key: TaxDocumentationKey) => SubPromptKey;
32
32
  getLocalText: (key: TextKey) => string;
33
33
  getLocalTitle: (key: TitleKey) => string;
34
34
  getLocalSubTitle: (key: string) => string;
35
35
  getLocalUsState: (key: string | undefined) => string;
36
36
  getLocalMonth: (key: string | undefined) => string;
37
37
  getRequiredLocalPrompt: (key: TaxDocumentationKey) => string;
38
- visibleQuestions: {
39
- exemptPayeeCode: boolean;
40
- exemptFatcaCode: boolean;
41
- iAcknowlegeESignIsOk: boolean;
42
- iAmACitizenOfTheUs: boolean;
43
- iAmExemptFromFatcaReporting: boolean;
44
- iAmNotSubjectToBackupWithholding: boolean;
45
- iAuthorizeWithholdingAgent: boolean;
46
- iCertifyToAll: boolean;
47
- iConfirmIncomeIsNonUs: boolean;
48
- iConfirmTheBeneficialOwnerIsExempt: boolean;
49
- iConfirmTheEntityIsNotAUsPerson: boolean;
50
- iConfirmTheEntityIsTheBeneficialOwner: boolean;
51
- iConfirmTheTaxIdIsCorrect: boolean;
52
- iHaveLegalCapacityToSign: boolean;
53
- regardedOwnerUsPerson: boolean;
54
- signature: boolean;
55
- accountHolderAddressCity: boolean;
56
- accountHolderAddressCountry: boolean;
57
- accountHolderAddressState: boolean;
58
- accountHolderAddressStreet2: boolean;
59
- accountHolderAddressStreet: boolean;
60
- accountHolderAddressZip: boolean;
61
- accountHolderCityOfBirth: boolean;
62
- accountHolderCountryOfBirth: boolean;
63
- accountHolderCountryOfCitizenship: boolean;
64
- accountHolderDateOfBirth: boolean;
65
- accountHolderDbaName: boolean;
66
- accountHolderMailingAddressCity: boolean;
67
- accountHolderMailingAddressCountry: boolean;
68
- accountHolderMailingAddressIsDifferent: boolean;
69
- accountHolderMailingAddressState: boolean;
70
- accountHolderMailingAddressStreet2: boolean;
71
- accountHolderMailingAddressStreet: boolean;
72
- accountHolderMailingAddressZip: boolean;
73
- accountHolderName: boolean;
74
- accountHolderFinancialAccountIdentifier: boolean;
75
- accountHolderFinancialAccountName: boolean;
76
- accountHolderFinancialAccountNameSameAsAccountHolderName: boolean;
77
- accountHolderForeignTin: boolean;
78
- accountHolderForeignTinIsNotRequired: boolean;
79
- accountHolderTaxResidenceCountry1: boolean;
80
- accountHolderTaxResidenceForeignTin1: boolean;
81
- accountHolderTaxResidenceForeignTin1IsNotRequired: boolean;
82
- accountHolderTaxResidenceCountry2: boolean;
83
- accountHolderTaxResidenceForeignTin2: boolean;
84
- accountHolderTaxResidenceForeignTin2IsNotRequired: boolean;
85
- accountHolderTaxResidenceCountry3: boolean;
86
- accountHolderTaxResidenceForeignTin3: boolean;
87
- accountHolderTaxResidenceForeignTin3IsNotRequired: boolean;
88
- accountHolderTaxResidenceCountry4: boolean;
89
- accountHolderTaxResidenceForeignTin4: boolean;
90
- accountHolderTaxResidenceForeignTin4IsNotRequired: boolean;
91
- accountHolderTaxResidenceCountry5: boolean;
92
- accountHolderTaxResidenceForeignTin5: boolean;
93
- accountHolderTaxResidenceForeignTin5IsNotRequired: boolean;
94
- accountHolderShowTaxResidence2: boolean;
95
- accountHolderShowTaxResidence3: boolean;
96
- accountHolderShowTaxResidence4: boolean;
97
- accountHolderShowTaxResidence5: boolean;
98
- accountHolderUsTin: boolean;
99
- accountHolderVatIdentificationNumber: boolean;
100
- accountHolderVatIdentificationNumberIsNotRequired: boolean;
101
- accountHolderVatCountry: boolean;
102
- accountHolderIsIndividual: boolean;
103
- accountHolderIsEuResident: boolean;
104
- accountHolderUsPerson: boolean;
105
- accountHolderUsAccountType: boolean;
106
- accountHolderUsSmllcElection: boolean;
107
- accountHolderUsLlcClassification: boolean;
108
- accountHolderUsOtherClassification: boolean;
109
- accountHolderUsTrustEstateEin: boolean;
110
- accountHolderForeignAccountType: boolean;
111
- accountHolderForeignTrustClassification: boolean;
112
- accountHolderForeignOtherClassification: boolean;
113
- regardedOwnerAddressCity: boolean;
114
- regardedOwnerAddressCountry: boolean;
115
- regardedOwnerAddressState: boolean;
116
- regardedOwnerAddressStreet2: boolean;
117
- regardedOwnerAddressStreet: boolean;
118
- regardedOwnerAddressZip: boolean;
119
- regardedOwnerCountryOfCitizenship: boolean;
120
- regardedOwnerDateOfBirth: boolean;
121
- regardedOwnerDbaName: boolean;
122
- regardedOwnerMailingAddressCity: boolean;
123
- regardedOwnerMailingAddressCountry: boolean;
124
- regardedOwnerMailingAddressIsDifferent: boolean;
125
- regardedOwnerMailingAddressState: boolean;
126
- regardedOwnerMailingAddressStreet2: boolean;
127
- regardedOwnerMailingAddressStreet: boolean;
128
- regardedOwnerMailingAddressZip: boolean;
129
- regardedOwnerName: boolean;
130
- regardedOwnerUsAccountType: boolean;
131
- regardedOwnerUsLlcClassification: boolean;
132
- regardedOwnerUsOtherClassification: boolean;
133
- regardedOwnerUsTrustEstateEin: boolean;
134
- regardedOwnerForeignAccountType: boolean;
135
- regardedOwnerForeignTrustClassification: boolean;
136
- regardedOwnerForeignOtherClassification: boolean;
137
- regardedOwnerForeignTin: boolean;
138
- regardedOwnerForeignTinIsNotRequired: boolean;
139
- regardedOwnerUsTin: boolean;
140
- };
38
+ notifiedFields: import("../../validations/getNotifiedFields.ts").Notifications;
39
+ invalidFields: TaxDocumentationErrorFile;
40
+ requiredFields: TaxDocumentationPropertyFile;
41
+ submittableFields: TaxDocumentation;
42
+ visibleFields: TaxDocumentationPropertyFile;
141
43
  hideField: (key: TaxDocumentationKey) => void;
142
44
  showField: (key: TaxDocumentationKey) => void;
143
45
  };
144
- export {};