@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
package/README.md CHANGED
@@ -1,20 +1,319 @@
1
- # TaxBit Tax Documentation
1
+ # TaxBit React SDK
2
2
 
3
- A React app, widget, and component for gathering Tax Documentation data.
3
+ A React app, widget, and component for gathering Tax Documentation data for US and EU Tax forms.
4
4
 
5
5
  ## Installation
6
6
 
7
- `npm install @taxbit/taxbit-tax-documentation`.
7
+ ```bash
8
+ npm install @taxbit/react-sdk
9
+ ```
10
+
11
+ ```typescript
12
+ import '@taxbit/react-sdk/style/inline.css'; // other options include 'basic.css' and 'minimal.css'
13
+ import { TaxBitDAC7Form } from '@taxbit/react-sdk';
14
+ ```
8
15
 
9
- `import { TaxDocumentation } from '@taxbit/taxbit-tax-documentation';`
16
+ ### Data
17
+ ```typescript
18
+ exampleData = {
19
+ name: "John Smith",
20
+ tin: "456456456",
21
+ ftin: "667788991",
22
+ usAccountType: "individual",
23
+ foreignAccountType: "individual",
24
+ address: {
25
+ firstLine: "123 Main St",
26
+ city: "Seattle",
27
+ stateOrProvince: "WA",
28
+ postalCode: "98000",
29
+ country: "GR",
30
+ },
31
+ mailingAddress: {
32
+ firstLine: "123 Main St",
33
+ city: "Seattle",
34
+ stateOrProvince: "WA",
35
+ postalCode: "98000",
36
+ country: "GR",
37
+ },
38
+ mailingAddressIsDifferent: true,
39
+ countryOfCitizenship: "GR",
40
+ ftinNotLegallyRequired: true,
41
+ taxResidences: [
42
+ {
43
+ country: "GR",
44
+ tin: "456456456",
45
+ tinNotRequired: false,
46
+ },
47
+ ],
48
+ vatin: "123123123",
49
+ vatinCountry: "GR",
50
+ vatinNotRequired: true,
51
+ financialAccountIdentifier: "123123123",
52
+ financialAccountName: "John Smith",
53
+ isIndividual: true,
54
+ isEuResident: true,
55
+ isUsPerson: false,
56
+ };
57
+ ```
58
+
59
+ ```jsx
60
+ <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
+ />
66
+ ```
10
67
 
68
+ Which is just a shortcut for this component...
11
69
  ```jsx
12
- <TaxBitFormUI onSubmit={data => alert(JSON.stringify(data))} />
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
76
+ />
13
77
  ```
14
78
 
15
- ## Todo
79
+ 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...
80
+ ```typescript jsx
81
+ <TaxBitDAC7FormUI
82
+ data={exampleData}
83
+ onSubmit={(data: unknown) => alert(JSON.stringify(data))}
84
+ />
85
+ ```
86
+
87
+ ### Bearer Token
88
+ This will be generated from the TaxBit API and passed in as a prop to the component.
89
+
90
+ ### Language
91
+ This can be set to any of the following:
92
+ - bg-bg
93
+ - cs-cz
94
+ - de-de
95
+ - el-gr
96
+ - en-gb
97
+ - en-us
98
+ - es-es
99
+ - et-ee
100
+ - fr-fr
101
+ - hu-hu
102
+ - it-it
103
+ - mt-mt
104
+ - nl-nl
105
+ - no-no
106
+ - pt-pt
107
+ - ro-ro
108
+ - sk-sk
109
+ - sl-si
110
+ - sv-se
111
+
112
+ ### Staging
113
+ This can be set to `true` or `false`. Passing `staging` in the component is the same as passing `staging={true}`.
114
+
115
+ If `true`, the staging environment will be used. If `false`, the production environment will be used. The default is `false`.
116
+
117
+ ### CSS and Style Customization
118
+ 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.
119
+ The structure below is an example of the HTML that that could be produced by a rendered React SDK Widget component.
120
+
121
+ ```html
122
+ <form class="taxbit-page">
123
+ <header class="taxbit-page-header">
124
+ <h3 class="taxbit-page-title">Title</h3>
125
+ </header>
126
+ <main class="taxbit-page-main">
127
+ <div class="taxbit-row">
128
+ <div class="taxbit-label">Are you an individual?*</div>
129
+ <div class="taxbit-row-content">
130
+ <div class="taxbit-row-value">
131
+ <div class="taxbit-input-status">
132
+ <div class="taxbit-radio-buttons">
133
+ <div class="taxbit-radio-button">
134
+ <input type="radio" name="accountHolderIsIndividual" id="accountHolderIsIndividual-yes" value="yes" checked="">
135
+ <label for="accountHolderIsIndividual-yes">Yes</label>
136
+ </div>
137
+ <div class="taxbit-radio-button">
138
+ <input type="radio" name="accountHolderIsIndividual" id="accountHolderIsIndividual-no" value="no">
139
+ <label for="accountHolderIsIndividual-no">No</label>
140
+ </div>
141
+ </div>
142
+ </div>
143
+ </div>
144
+ </div>
145
+ </div>
146
+ <div class="taxbit-row">
147
+ <div class="taxbit-label">Name of Individual*</div>
148
+ <div class="taxbit-row-content">
149
+ <div class="taxbit-row-value">
150
+ <div class="taxbit-input-status">
151
+ <input type="text" name="accountHolderName" class="taxbit-input" value="Mark">
152
+ </div>
153
+ </div>
154
+ </div>
155
+ </div>
156
+ <div class="taxbit-row">
157
+ <div class="taxbit-label">Date of Birth*</div>
158
+ <div class="taxbit-row-content">
159
+ <div class="taxbit-row-value">
160
+ <div class="taxbit-input-status">
161
+ <div class="taxbit-row-value">
162
+ <select name="accountHolderDateOfBirth" class="taxbit-select taxbit-select-month">
163
+ <option value="" disabled="" hidden="">Month</option>
164
+ <option value="01">January</option>
165
+ <option value="02">February</option>
166
+ <option value="03">March</option>
167
+ <option value="04">April</option>
168
+ <option value="05">May</option>
169
+ <option value="06">June</option>
170
+ <option value="07">July</option>
171
+ <option value="08">August</option>
172
+ <option value="09">September</option>
173
+ <option value="10">October</option>
174
+ <option value="11">November</option>
175
+ <option value="12">December</option>
176
+ </select>
177
+ <select name="accountHolderDateOfBirth" class="taxbit-select taxbit-select-day taxbit-placeholder">
178
+ <option value="" disabled="" hidden="">Day</option>
179
+ <option value="01">1</option>
180
+ <option value="02">2</option>
181
+ <option value="03">3</option>
182
+ <option value="04">4</option>
183
+ <option value="05">5</option>
184
+ <option value="06">6</option>
185
+ <option value="07">7</option>
186
+ <option value="08">8</option>
187
+ <option value="09">9</option>
188
+ <option value="10">10</option>
189
+ <option value="11">11</option>
190
+ <option value="12">12</option>
191
+ <option value="13">13</option>
192
+ <option value="14">14</option>
193
+ <option value="15">15</option>
194
+ <option value="16">16</option>
195
+ <option value="17">17</option>
196
+ <option value="18">18</option>
197
+ <option value="19">19</option>
198
+ <option value="21">21</option>
199
+ <option value="22">22</option>
200
+ <option value="23">23</option>
201
+ <option value="24">24</option>
202
+ <option value="25">25</option>
203
+ <option value="26">26</option>
204
+ <option value="27">27</option>
205
+ <option value="28">28</option>
206
+ <option value="29">29</option>
207
+ <option value="30">30</option>
208
+ <option value="31">31</option>
209
+ </select>
210
+ <select name="accountHolderDateOfBirth" class="taxbit-select taxbit-select-year taxbit-placeholder">
211
+ <option value="" disabled="" hidden="">Year</option>
212
+ <option value="2023">2023</option>
213
+ <option value="2022">2022</option>
214
+ <option value="2021">2021</option>
215
+ <option value="2020">2020</option>
216
+ <option value="2019">2019</option>
217
+ <option value="2018">2018</option>
218
+ <option value="2017">2017</option>
219
+ <option value="2016">2016</option>
220
+ <option value="2015">2015</option>
221
+ <option value="2014">2014</option>
222
+ <option value="2013">2013</option>
223
+ <option value="2012">2012</option>
224
+ <option value="2011">2011</option>
225
+ <option value="2010">2010</option>
226
+ <option value="2009">2009</option>
227
+ <option value="2008">2008</option>
228
+ <option value="2007">2007</option>
229
+ <option value="2006">2006</option>
230
+ <option value="2005">2005</option>
231
+ <option value="2004">2004</option>
232
+ <option value="2003">2003</option>
233
+ <option value="2002">2002</option>
234
+ <option value="2001">2001</option>
235
+ <option value="2000">2000</option>
236
+ </select>
237
+ </div>
238
+ </div>
239
+ </div>
240
+ </div>
241
+ </div>
242
+ <div class="taxbit-section">
243
+ <div class="taxbit-row">
244
+ <div class="taxbit-label">VAT Member State*</div>
245
+ <div class="taxbit-row-content">
246
+ <div class="taxbit-row-value">
247
+ <div class="taxbit-input-status">
248
+ <select name="accountHolderVatCountry" class="taxbit-select">
249
+ <option value="">
16
250
 
17
- - I18n for another language
18
- - Config for self-cert and w forms
19
- - Style selection
20
- -
251
+ </option>
252
+ <option value="AT">Austria</option>
253
+ <option value="BE">Belgium</option>
254
+ <option value="BG">Bulgaria</option>
255
+ <option value="HR">Croatia</option>
256
+ <option value="CY">Cyprus</option>
257
+ <option value="CZ">Czechia</option>
258
+ <option value="DK">Denmark</option>
259
+ <option value="EE">Estonia</option>
260
+ <option value="FI">Finland</option>
261
+ <option value="FR">France</option>
262
+ <option value="DE">Germany</option>
263
+ <option value="GR">Greece</option>
264
+ <option value="HU">Hungary</option>
265
+ <option value="IE">Ireland</option>
266
+ <option value="IT">Italy</option>
267
+ <option value="LV">Latvia</option>
268
+ <option value="LT">Lithuania</option>
269
+ <option value="LU">Luxembourg</option>
270
+ <option value="MT">Malta</option>
271
+ <option value="NL">Netherlands</option>
272
+ <option value="PL">Poland</option>
273
+ <option value="PT">Portugal</option>
274
+ <option value="RO">Romania</option>
275
+ <option value="SK">Slovakia</option>
276
+ <option value="SI">Slovenia</option>
277
+ <option value="ES">Spain</option>
278
+ <option value="SE">Sweden</option>
279
+ </select>
280
+ </div>
281
+ </div>
282
+ </div>
283
+ </div>
284
+ <div class="taxbit-row">
285
+ <div class="taxbit-label">VAT Identification Number*<div class="taxbit-sub-label">Unique identifier for VAT-registered businesses or individuals.</div>
286
+ </div>
287
+ <div class="taxbit-row-content">
288
+ <div class="taxbit-row-value">
289
+ <div class="taxbit-input-status">
290
+ <input type="text" name="accountHolderVatIdentificationNumber" class="taxbit-input" value="">
291
+ </div>
292
+ </div>
293
+ </div>
294
+ </div>
295
+ <div class="taxbit-row">
296
+ <div class="taxbit-label"></div>
297
+ <div class="taxbit-row-content">
298
+ <div class="taxbit-row-value">
299
+ <div class="taxbit-input-status">
300
+ <div class="taxbit-checkBox-label">
301
+ <input type="checkbox" id="accountHolderVatIdentificationNumberIsNotRequired" name="accountHolderVatIdentificationNumberIsNotRequired" class="taxbit-check-box">
302
+ <label for="accountHolderVatIdentificationNumberIsNotRequired">VAT is not required or has not been issued</label>
303
+ </div>
304
+ </div>
305
+ </div>
306
+ </div>
307
+ </div>
308
+ </div>
309
+ </main>
310
+ <footer class="taxbit-step-actions">
311
+ <div class="taxbit-secondary-actions">
312
+ <button tabindex="-1">Back</button>
313
+ </div>
314
+ <div class="taxbit-primary-actions">
315
+ <button>Next</button>
316
+ </div>
317
+ </footer>
318
+ </form>
319
+ ```
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 {
@@ -50,6 +56,23 @@ button:focus-visible {
50
56
  margin-bottom: 8px;
51
57
  opacity: .8;
52
58
  }
59
+ .taxbit-section-sub-title {
60
+ font-size: .8em;
61
+ opacity: .7;
62
+ font-weight: 400;
63
+ }
64
+ }
65
+
66
+ .taxbit-select-language {
67
+ border: 0;
68
+ outline: none;
69
+ opacity: 0.6;
70
+ width: 100px;
71
+ }
72
+
73
+ .taxbit-select-language:focus {
74
+ border-bottom: solid 1px #E4EBF6;
75
+ opacity: 1;
53
76
  }
54
77
 
55
78
  .taxbit-row {
@@ -66,6 +89,10 @@ button:focus-visible {
66
89
  color: red;
67
90
  font-size: .8em;
68
91
  }
92
+ .taxbit-notification {
93
+ color: blue;
94
+ font-size: .8em;
95
+ }
69
96
  .taxbit-hint {
70
97
  font-size: .8em;
71
98
  opacity: .7;
@@ -74,19 +101,23 @@ button:focus-visible {
74
101
 
75
102
  .taxbit-row-actions {
76
103
  flex: 0 0 10%;
104
+ display: flex;
105
+ align-items: center;
77
106
  }
78
- .taxbit-row-action-button, .taxbit-toggle-button {
107
+ .taxbit-row-action-button {
79
108
  font-size: .8em;
80
109
  padding: 0.2em 1em;
110
+ flex: 0 0 auto;
81
111
  }
82
112
 
83
113
  .taxbit-label {
84
114
  flex: 0 0 40%;
85
115
  font-weight: 500;
86
116
  .taxbit-sub-label {
87
- font-size: 0.7em;
117
+ font-size: 0.8em;
88
118
  opacity: 0.7;
89
119
  font-weight: 400;
120
+ line-height: 1.25em;
90
121
  }
91
122
  }
92
123
  .taxbit-input, .taxbit-select {
@@ -99,6 +130,16 @@ button:focus-visible {
99
130
  color: rgb(18, 38, 63);
100
131
  }
101
132
 
133
+ @media only screen and (max-width: 600px) {
134
+ .taxbit-input, .taxbit-select {
135
+ font-size: 100%;
136
+ }
137
+ }
138
+
139
+ .taxbit-placeholder {
140
+ color: #aaa;
141
+ }
142
+
102
143
  .taxbit-check-box {
103
144
  margin: 5px;
104
145
  }
@@ -118,6 +159,10 @@ button:focus-visible {
118
159
  width: 100%;
119
160
  }
120
161
 
162
+ .taxbit-input-status-footer {
163
+ margin-top: 5px
164
+ }
165
+
121
166
  .taxbit-row-value {
122
167
  display: flex;
123
168
  flex: 1;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { TaxDocumentationKey } from "types";
3
+ export declare const Notification: ({ name }: {
4
+ name: TaxDocumentationKey;
5
+ }) => React.JSX.Element | null;
@@ -0,0 +1 @@
1
+ export * from "./Notification";
@@ -1,6 +1,8 @@
1
1
  import React from "react";
2
2
  type PageProps = {
3
+ title?: string;
3
4
  children: React.ReactNode;
5
+ actions?: React.ReactNode;
4
6
  };
5
- export declare const Page: ({ children }: PageProps) => React.JSX.Element;
7
+ export declare const Page: ({ children, title, actions }: PageProps) => React.JSX.Element;
6
8
  export {};
@@ -1,8 +1,9 @@
1
1
  import React from "react";
2
2
  type SectionProps = {
3
3
  title?: string;
4
+ subTitle?: string;
4
5
  showIf?: boolean;
5
6
  children: React.ReactNode;
6
7
  };
7
- export declare const Section: ({ title, showIf, children }: SectionProps) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
8
+ export declare const Section: ({ title, subTitle, showIf, children, }: SectionProps) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
8
9
  export {};
@@ -1,7 +1,7 @@
1
1
  export * from "./Address";
2
2
  export * from "./ErrorMessage";
3
+ export * from "./Notification";
3
4
  export * from "./InputStatus";
4
5
  export * from "./Page";
5
6
  export * from "./Row";
6
7
  export * from "./Section";
7
- export * from "./Title";
@@ -1,5 +1,7 @@
1
- import { ButtonKey, ErrorKey, TextKey, TitleKey } from "i18n/types";
1
+ import { ButtonKey, ErrorKey, NotificationKey, TextKey, TitleKey } from "i18n/types";
2
2
  import { TaxDocumentation, TaxDocumentationKey } from "types/TaxDocumentation";
3
+ import { Locale } from "types";
4
+ import { Notifications } from "../../utils/getNotifications";
3
5
  export type FormUIFields = {
4
6
  [key in TaxDocumentationKey]?: string | undefined;
5
7
  };
@@ -13,22 +15,27 @@ export declare const useFormUI: () => {
13
15
  fields: TaxDocumentation;
14
16
  setValue: (key: TaxDocumentationKey, value: string | undefined) => void;
15
17
  errors: FormUIErrors;
18
+ notifications: Notifications;
16
19
  isErrorFree: boolean;
17
20
  showErrors: boolean;
18
21
  exposeErrors: () => void;
19
22
  hideErrors: () => void;
20
- requiredFields: FormUIRequired;
23
+ required: FormUIRequired;
21
24
  getLocalButton: (key: ButtonKey) => string;
22
25
  getLocalCaProvince: (key: string | undefined) => string;
23
26
  getLocalCountry: (key: string | undefined) => string;
24
27
  getLocalError: (key: ErrorKey) => string;
25
28
  getLocalHint: (key: TaxDocumentationKey) => string | undefined;
29
+ getLocalLocale: (key: Locale) => string;
30
+ getLocalNotification: (key: NotificationKey) => string;
26
31
  getLocalOption: (key: string | undefined) => string | undefined;
27
- getLocalPrompt: (key: TaxDocumentationKey) => string;
32
+ getLocalPrompt: (key: string) => string;
28
33
  getLocalSubPrompt: (key: TaxDocumentationKey) => string;
29
34
  getLocalText: (key: TextKey) => string;
30
35
  getLocalTitle: (key: TitleKey) => string;
36
+ getLocalSubTitle: (key: string) => string;
31
37
  getLocalUsState: (key: string | undefined) => string;
38
+ getLocalMonth: (key: string | undefined) => string;
32
39
  getRequiredLocalPrompt: (key: TaxDocumentationKey) => string;
33
40
  visibleQuestions: {
34
41
  exemptPayeeCode: boolean;
@@ -91,6 +98,7 @@ export declare const useFormUI: () => {
91
98
  accountHolderShowTaxResidence5: boolean;
92
99
  accountHolderUsTin: boolean;
93
100
  accountHolderVatIdentificationNumber: boolean;
101
+ accountHolderVatIdentificationNumberIsNotRequired: boolean;
94
102
  accountHolderVatCountry: boolean;
95
103
  accountHolderIsIndividual: boolean;
96
104
  accountHolderIsEuResident: boolean;
@@ -63,6 +63,7 @@ export declare const useFormUIContext: () => {
63
63
  accountHolderShowTaxResidence5: import("../../i18n/types").ErrorKey;
64
64
  accountHolderUsTin: import("../../i18n/types").ErrorKey;
65
65
  accountHolderVatIdentificationNumber: import("../../i18n/types").ErrorKey;
66
+ accountHolderVatIdentificationNumberIsNotRequired: import("../../i18n/types").ErrorKey;
66
67
  accountHolderVatCountry: import("../../i18n/types").ErrorKey;
67
68
  accountHolderIsIndividual: import("../../i18n/types").ErrorKey;
68
69
  accountHolderIsEuResident: import("../../i18n/types").ErrorKey;
@@ -103,11 +104,12 @@ export declare const useFormUIContext: () => {
103
104
  regardedOwnerForeignTinIsNotRequired: import("../../i18n/types").ErrorKey;
104
105
  regardedOwnerUsTin: import("../../i18n/types").ErrorKey;
105
106
  };
107
+ notifications: import("../../utils/getNotifications").Notifications;
106
108
  isErrorFree: boolean;
107
109
  showErrors: boolean;
108
110
  exposeErrors: () => void;
109
111
  hideErrors: () => void;
110
- requiredFields: {
112
+ required: {
111
113
  exemptPayeeCode?: boolean | undefined;
112
114
  exemptFatcaCode?: boolean | undefined;
113
115
  iAcknowlegeESignIsOk?: boolean | undefined;
@@ -168,6 +170,7 @@ export declare const useFormUIContext: () => {
168
170
  accountHolderShowTaxResidence5?: boolean | undefined;
169
171
  accountHolderUsTin?: boolean | undefined;
170
172
  accountHolderVatIdentificationNumber?: boolean | undefined;
173
+ accountHolderVatIdentificationNumberIsNotRequired?: boolean | undefined;
171
174
  accountHolderVatCountry?: boolean | undefined;
172
175
  accountHolderIsIndividual?: boolean | undefined;
173
176
  accountHolderIsEuResident?: boolean | undefined;
@@ -213,12 +216,16 @@ export declare const useFormUIContext: () => {
213
216
  getLocalCountry: (key: string | undefined) => string;
214
217
  getLocalError: (key: import("../../i18n/types").ErrorKey) => string;
215
218
  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) => string | undefined;
219
+ getLocalLocale: (key: import("../../types").Locale) => string;
220
+ getLocalNotification: (key: "vatUnexpectedFormat") => string;
216
221
  getLocalOption: (key: string | undefined) => string | undefined;
217
- getLocalPrompt: (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) => string;
222
+ getLocalPrompt: (key: string) => string;
218
223
  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) => string;
219
224
  getLocalText: (key: import("../../i18n/types").TextKey) => string;
220
225
  getLocalTitle: (key: import("../../i18n/types").TitleKey) => string;
226
+ getLocalSubTitle: (key: string) => string;
221
227
  getLocalUsState: (key: string | undefined) => string;
228
+ getLocalMonth: (key: string | undefined) => string;
222
229
  getRequiredLocalPrompt: (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) => string;
223
230
  visibleQuestions: {
224
231
  exemptPayeeCode: boolean;
@@ -281,6 +288,7 @@ export declare const useFormUIContext: () => {
281
288
  accountHolderShowTaxResidence5: boolean;
282
289
  accountHolderUsTin: boolean;
283
290
  accountHolderVatIdentificationNumber: boolean;
291
+ accountHolderVatIdentificationNumberIsNotRequired: boolean;
284
292
  accountHolderVatCountry: boolean;
285
293
  accountHolderIsIndividual: boolean;
286
294
  accountHolderIsEuResident: boolean;
@@ -387,6 +395,7 @@ export declare const useFormUIContext: () => {
387
395
  accountHolderShowTaxResidence5: import("../../i18n/types").ErrorKey;
388
396
  accountHolderUsTin: import("../../i18n/types").ErrorKey;
389
397
  accountHolderVatIdentificationNumber: import("../../i18n/types").ErrorKey;
398
+ accountHolderVatIdentificationNumberIsNotRequired: import("../../i18n/types").ErrorKey;
390
399
  accountHolderVatCountry: import("../../i18n/types").ErrorKey;
391
400
  accountHolderIsIndividual: import("../../i18n/types").ErrorKey;
392
401
  accountHolderIsEuResident: import("../../i18n/types").ErrorKey;
@@ -427,11 +436,12 @@ export declare const useFormUIContext: () => {
427
436
  regardedOwnerForeignTinIsNotRequired: import("../../i18n/types").ErrorKey;
428
437
  regardedOwnerUsTin: import("../../i18n/types").ErrorKey;
429
438
  };
439
+ notifications: import("../../utils/getNotifications").Notifications;
430
440
  isErrorFree: boolean;
431
441
  showErrors: boolean;
432
442
  exposeErrors: () => void;
433
443
  hideErrors: () => void;
434
- requiredFields: {
444
+ required: {
435
445
  exemptPayeeCode?: boolean | undefined;
436
446
  exemptFatcaCode?: boolean | undefined;
437
447
  iAcknowlegeESignIsOk?: boolean | undefined;
@@ -492,6 +502,7 @@ export declare const useFormUIContext: () => {
492
502
  accountHolderShowTaxResidence5?: boolean | undefined;
493
503
  accountHolderUsTin?: boolean | undefined;
494
504
  accountHolderVatIdentificationNumber?: boolean | undefined;
505
+ accountHolderVatIdentificationNumberIsNotRequired?: boolean | undefined;
495
506
  accountHolderVatCountry?: boolean | undefined;
496
507
  accountHolderIsIndividual?: boolean | undefined;
497
508
  accountHolderIsEuResident?: boolean | undefined;
@@ -537,12 +548,16 @@ export declare const useFormUIContext: () => {
537
548
  getLocalCountry: (key: string | undefined) => string;
538
549
  getLocalError: (key: import("../../i18n/types").ErrorKey) => string;
539
550
  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) => string | undefined;
551
+ getLocalLocale: (key: import("../../types").Locale) => string;
552
+ getLocalNotification: (key: "vatUnexpectedFormat") => string;
540
553
  getLocalOption: (key: string | undefined) => string | undefined;
541
- getLocalPrompt: (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) => string;
554
+ getLocalPrompt: (key: string) => string;
542
555
  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) => string;
543
556
  getLocalText: (key: import("../../i18n/types").TextKey) => string;
544
557
  getLocalTitle: (key: import("../../i18n/types").TitleKey) => string;
558
+ getLocalSubTitle: (key: string) => string;
545
559
  getLocalUsState: (key: string | undefined) => string;
560
+ getLocalMonth: (key: string | undefined) => string;
546
561
  getRequiredLocalPrompt: (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) => string;
547
562
  visibleQuestions: {
548
563
  exemptPayeeCode: boolean;
@@ -605,6 +620,7 @@ export declare const useFormUIContext: () => {
605
620
  accountHolderShowTaxResidence5: boolean;
606
621
  accountHolderUsTin: boolean;
607
622
  accountHolderVatIdentificationNumber: boolean;
623
+ accountHolderVatIdentificationNumberIsNotRequired: boolean;
608
624
  accountHolderVatCountry: boolean;
609
625
  accountHolderIsIndividual: boolean;
610
626
  accountHolderIsEuResident: boolean;
@@ -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 TaxDocumentationProviderProps = {
5
- data?: TaxDocumentation;
5
+ data?: ClientTaxDocumentation;
6
6
  onSubmit: (data: TaxDocumentation) => void;
7
7
  language?: Locale;
8
8
  children: React.ReactNode;