@gusto/embedded-react-sdk 0.8.1 → 0.9.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 (374) hide show
  1. package/CHANGELOG.md +20 -3
  2. package/dist/components/Base/Base.d.ts +6 -5
  3. package/dist/components/Base/Base.js +40 -39
  4. package/dist/components/Base/Base.js.map +1 -1
  5. package/dist/components/Base/index.d.ts +1 -0
  6. package/dist/components/Common/ActionsLayout/index.d.ts +1 -0
  7. package/dist/components/Common/DataView/DataCards/DataCards.js +21 -21
  8. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  9. package/dist/components/Common/DataView/DataCards/index.d.ts +1 -0
  10. package/dist/components/Common/DataView/index.d.ts +1 -0
  11. package/dist/components/Common/DocumentList/index.d.ts +1 -0
  12. package/dist/components/Common/DocumentViewer/index.d.ts +1 -0
  13. package/dist/components/Common/FieldCaption/index.d.ts +1 -0
  14. package/dist/components/Common/FieldDescription/index.d.ts +1 -0
  15. package/dist/components/Common/FieldErrorMessage/index.d.ts +1 -0
  16. package/dist/components/Common/FieldLayout/index.d.ts +1 -0
  17. package/dist/components/Common/Fields/CheckboxField/index.d.ts +1 -0
  18. package/dist/components/Common/Fields/CheckboxGroupField/index.d.ts +1 -0
  19. package/dist/components/Common/Fields/ComboBoxField/index.d.ts +1 -0
  20. package/dist/components/Common/Fields/DatePickerField/index.d.ts +1 -0
  21. package/dist/components/Common/Fields/NumberInputField/index.d.ts +1 -0
  22. package/dist/components/Common/Fields/RadioGroupField/index.d.ts +1 -0
  23. package/dist/components/Common/Fields/SelectField/index.d.ts +1 -0
  24. package/dist/components/Common/Fields/SwitchField/index.d.ts +1 -0
  25. package/dist/components/Common/Fields/TextInputField/index.d.ts +1 -0
  26. package/dist/components/Common/Fieldset/index.d.ts +1 -0
  27. package/dist/components/Common/Flex/index.d.ts +1 -0
  28. package/dist/components/Common/Form/index.d.ts +1 -0
  29. package/dist/components/Common/HamburgerMenu/index.d.ts +1 -0
  30. package/dist/components/Common/HorizontalFieldLayout/index.d.ts +1 -0
  31. package/dist/components/Common/PaginationControl/index.d.ts +1 -0
  32. package/dist/components/Common/ReorderableList/index.d.ts +1 -0
  33. package/dist/components/Common/SignatureForm/index.d.ts +1 -0
  34. package/dist/components/Common/TaxInputs/index.d.ts +1 -0
  35. package/dist/components/Common/UI/Alert/index.d.ts +1 -0
  36. package/dist/components/Common/UI/Button/index.d.ts +1 -0
  37. package/dist/components/Common/UI/CalendarPreview/index.d.ts +1 -0
  38. package/dist/components/Common/UI/Checkbox/index.d.ts +1 -0
  39. package/dist/components/Common/UI/CheckboxGroup/index.d.ts +1 -0
  40. package/dist/components/Common/UI/ComboBox/ComboBox.js +28 -27
  41. package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
  42. package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +6 -6
  43. package/dist/components/Common/UI/DatePicker/index.d.ts +1 -0
  44. package/dist/components/Common/UI/Heading/index.d.ts +1 -0
  45. package/dist/components/Common/UI/Input/index.d.ts +1 -0
  46. package/dist/components/Common/UI/Link/index.d.ts +1 -0
  47. package/dist/components/Common/UI/List/index.d.ts +1 -0
  48. package/dist/components/Common/UI/Menu/index.d.ts +1 -0
  49. package/dist/components/Common/UI/NumberInput/index.d.ts +1 -0
  50. package/dist/components/Common/UI/ProgressBar/index.d.ts +1 -0
  51. package/dist/components/Common/UI/Radio/index.d.ts +1 -0
  52. package/dist/components/Common/UI/RadioGroup/index.d.ts +1 -0
  53. package/dist/components/Common/UI/Select/index.d.ts +1 -0
  54. package/dist/components/Common/UI/Switch/index.d.ts +1 -0
  55. package/dist/components/Common/UI/Table/index.d.ts +1 -0
  56. package/dist/components/Common/UI/Text/index.d.ts +1 -0
  57. package/dist/components/Common/UI/TextInput/index.d.ts +1 -0
  58. package/dist/components/Common/VisuallyHidden/index.d.ts +1 -0
  59. package/dist/components/Common/index.d.ts +1 -0
  60. package/dist/components/Company/AssignSignatory/AssignSignatory.d.ts +3 -3
  61. package/dist/components/Company/AssignSignatory/AssignSignatory.js +20 -19
  62. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  63. package/dist/components/Company/AssignSignatory/CreateSignatory/index.d.ts +1 -0
  64. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
  65. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  66. package/dist/components/Company/AssignSignatory/InviteSignatory/index.d.ts +1 -0
  67. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
  68. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  69. package/dist/components/Company/AssignSignatory/index.d.ts +1 -0
  70. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
  71. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  72. package/dist/components/Company/BankAccount/BankAccount.d.ts +10 -0
  73. package/dist/components/Company/BankAccount/BankAccount.js +32 -0
  74. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -0
  75. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
  76. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  77. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -0
  78. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +13 -0
  79. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +63 -0
  80. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -0
  81. package/dist/components/Company/DocumentSigner/DocumentList/Head.js.map +1 -0
  82. package/dist/components/Company/DocumentSigner/DocumentList/List.js.map +1 -0
  83. package/dist/components/Company/DocumentSigner/DocumentList/ManageSignatories.js.map +1 -0
  84. package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/index.d.ts +1 -0
  85. package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/useDocumentList.js +4 -3
  86. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -0
  87. package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +12 -0
  88. package/dist/components/Company/DocumentSigner/DocumentSigner.js +41 -0
  89. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -0
  90. package/dist/components/Company/DocumentSigner/SignatureForm/Actions.js.map +1 -0
  91. package/dist/components/Company/DocumentSigner/SignatureForm/Form.js.map +1 -0
  92. package/dist/components/Company/DocumentSigner/SignatureForm/Head.js.map +1 -0
  93. package/dist/components/Company/DocumentSigner/SignatureForm/Preview.js.map +1 -0
  94. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +14 -0
  95. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +72 -0
  96. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -0
  97. package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/index.d.ts +1 -0
  98. package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/useSignatureForm.js +4 -3
  99. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -0
  100. package/dist/components/Company/DocumentSigner/assignSignatoryState.js.map +1 -0
  101. package/dist/components/Company/DocumentSigner/documentSignerStateMachine.js.map +1 -0
  102. package/dist/components/Company/DocumentSigner/index.d.ts +2 -0
  103. package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -0
  104. package/dist/components/Company/FederalTaxes/FederalTaxes.d.ts +1 -4
  105. package/dist/components/Company/FederalTaxes/FederalTaxes.js +27 -27
  106. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  107. package/dist/components/Company/FederalTaxes/index.d.ts +1 -0
  108. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
  109. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  110. package/dist/components/Company/Industry/Context.js +7 -6
  111. package/dist/components/Company/Industry/Context.js.map +1 -1
  112. package/dist/components/Company/Industry/Industry.d.ts +1 -1
  113. package/dist/components/Company/Industry/Industry.js +29 -28
  114. package/dist/components/Company/Industry/Industry.js.map +1 -1
  115. package/dist/components/Company/Industry/index.d.ts +1 -0
  116. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
  117. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  118. package/dist/components/Company/Locations/Locations.d.ts +9 -0
  119. package/dist/components/Company/Locations/Locations.js +27 -0
  120. package/dist/components/Company/Locations/Locations.js.map +1 -0
  121. package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +3 -3
  122. package/dist/components/Company/Locations/LocationsList/LocationsList.js +27 -32
  123. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  124. package/dist/components/Company/Locations/LocationsList/index.d.ts +1 -0
  125. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
  126. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  127. package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.d.ts +2 -2
  128. package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js +13 -13
  129. package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
  130. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js +3 -3
  131. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  132. package/dist/components/Company/OnboardingOverview/OnboardingOverview.d.ts +1 -1
  133. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +15 -15
  134. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  135. package/dist/components/Company/OnboardingOverview/context.js +4 -3
  136. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  137. package/dist/components/Company/PaySchedule/PaySchedule.d.ts +2 -2
  138. package/dist/components/Company/PaySchedule/PaySchedule.js +63 -62
  139. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  140. package/dist/components/Company/PaySchedule/_parts/index.d.ts +1 -0
  141. package/dist/components/Company/PaySchedule/index.d.ts +1 -0
  142. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
  143. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  144. package/dist/components/Company/StateTaxes/StateTaxes.d.ts +9 -0
  145. package/dist/components/Company/StateTaxes/StateTaxes.js +27 -0
  146. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -0
  147. package/dist/components/Company/StateTaxes/{StateTaxesFlowComponents.js → StateTaxesComponents.js} +1 -1
  148. package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -0
  149. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +10 -10
  150. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  151. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +1 -1
  152. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
  153. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +29 -29
  154. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  155. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
  156. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  157. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +3 -3
  158. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  159. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
  160. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  161. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +1 -1
  162. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
  163. package/dist/components/Company/index.d.ts +7 -6
  164. package/dist/components/Company/index.js +18 -18
  165. package/dist/components/Contractor/Address/Actions.d.ts +1 -0
  166. package/dist/components/Contractor/Address/Actions.js +13 -0
  167. package/dist/components/Contractor/Address/Actions.js.map +1 -0
  168. package/dist/components/Contractor/Address/Address.d.ts +16 -0
  169. package/dist/components/Contractor/Address/Address.js +74 -0
  170. package/dist/components/Contractor/Address/Address.js.map +1 -0
  171. package/dist/components/Contractor/Address/Form.d.ts +1 -0
  172. package/dist/components/Contractor/Address/Form.js +57 -0
  173. package/dist/components/Contractor/Address/Form.js.map +1 -0
  174. package/dist/components/Contractor/Address/Head.d.ts +1 -0
  175. package/dist/components/Contractor/Address/Head.js +15 -0
  176. package/dist/components/Contractor/Address/Head.js.map +1 -0
  177. package/dist/components/Contractor/Address/index.d.ts +2 -0
  178. package/dist/components/Contractor/Address/useAddress.d.ts +33 -0
  179. package/dist/components/Contractor/Address/useAddress.js +28 -0
  180. package/dist/components/Contractor/Address/useAddress.js.map +1 -0
  181. package/dist/components/Contractor/index.d.ts +2 -0
  182. package/dist/components/Contractor/index.js +5 -0
  183. package/dist/components/{Flow → Contractor}/index.js.map +1 -1
  184. package/dist/components/Employee/Compensation/Compensation.d.ts +1 -1
  185. package/dist/components/Employee/Compensation/Compensation.js +45 -44
  186. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  187. package/dist/components/Employee/Compensation/Edit.js +17 -16
  188. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  189. package/dist/components/Employee/Compensation/index.d.ts +1 -0
  190. package/dist/components/Employee/Compensation/useCompensation.d.ts +6 -46
  191. package/dist/components/Employee/Compensation/useCompensation.js +60 -45
  192. package/dist/components/Employee/Compensation/useCompensation.js.map +1 -1
  193. package/dist/components/Employee/Deductions/Deductions.d.ts +2 -2
  194. package/dist/components/Employee/Deductions/Deductions.js +73 -71
  195. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  196. package/dist/components/Employee/Deductions/index.d.ts +1 -0
  197. package/dist/components/Employee/Deductions/useDeductions.js +6 -5
  198. package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
  199. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  200. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  201. package/dist/components/Employee/DocumentSigner/DocumentSigner.d.ts +11 -0
  202. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +27 -0
  203. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -0
  204. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  205. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  206. package/dist/components/Employee/DocumentSigner/index.d.ts +2 -1
  207. package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +1 -1
  208. package/dist/components/Employee/EmployeeList/EmployeeList.js +38 -38
  209. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  210. package/dist/components/Employee/EmployeeList/List.js +9 -9
  211. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  212. package/dist/components/Employee/EmployeeList/useEmployeeList.d.ts +2 -1
  213. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
  214. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  215. package/dist/components/Employee/Landing/Landing.d.ts +1 -1
  216. package/dist/components/Employee/Landing/Landing.js +5 -5
  217. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  218. package/dist/components/Employee/Landing/index.d.ts +1 -0
  219. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +27 -0
  220. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js +29 -0
  221. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -0
  222. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +107 -0
  223. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -0
  224. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.d.ts +1 -1
  225. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +30 -30
  226. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
  227. package/dist/components/Employee/OnboardingSummary/index.d.ts +1 -0
  228. package/dist/components/Employee/PaymentMethod/PaymentMethod.d.ts +1 -1
  229. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +68 -68
  230. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  231. package/dist/components/Employee/PaymentMethod/index.d.ts +1 -0
  232. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +9 -8
  233. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  234. package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +1 -1
  235. package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +1 -1
  236. package/dist/components/Employee/Profile/Profile.d.ts +1 -1
  237. package/dist/components/Employee/Profile/Profile.js +117 -112
  238. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  239. package/dist/components/Employee/Profile/SelfPersonalDetails.d.ts +2 -2
  240. package/dist/components/Employee/Profile/index.d.ts +1 -0
  241. package/dist/components/Employee/Profile/useProfile.js +4 -3
  242. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  243. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +17 -0
  244. package/dist/components/{Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingComponents.js → Employee/SelfOnboardingFlow/SelfOnboardingComponents.js} +7 -7
  245. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -0
  246. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +2 -0
  247. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js +22 -0
  248. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -0
  249. package/dist/components/{Flow/StateMachines/employeeSelfOnboarding.js → Employee/SelfOnboardingFlow/selfOnboardingMachine.js} +4 -4
  250. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -0
  251. package/dist/components/Employee/Taxes/StateForm.d.ts +3 -3
  252. package/dist/components/Employee/Taxes/StateForm.js +2 -2
  253. package/dist/components/Employee/Taxes/StateForm.js.map +1 -1
  254. package/dist/components/Employee/Taxes/Taxes.d.ts +1 -1
  255. package/dist/components/Employee/Taxes/Taxes.js +93 -86
  256. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  257. package/dist/components/Employee/Taxes/index.d.ts +1 -0
  258. package/dist/components/Employee/Taxes/useTaxes.d.ts +2 -2
  259. package/dist/components/Employee/Taxes/useTaxes.js +4 -3
  260. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  261. package/dist/components/Employee/index.d.ts +4 -1
  262. package/dist/components/Employee/index.js +20 -16
  263. package/dist/components/Employee/index.js.map +1 -1
  264. package/dist/components/Flow/useFlow.d.ts +2 -1
  265. package/dist/components/Flow/useFlow.js.map +1 -1
  266. package/dist/components/index.d.ts +2 -1
  267. package/dist/contexts/ApiProvider/ApiProvider.d.ts +1 -1
  268. package/dist/contexts/ApiProvider/ApiProvider.js +17 -17
  269. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  270. package/dist/contexts/GustoApiProvider/index.d.ts +1 -0
  271. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +2 -7
  272. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +16 -14
  273. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  274. package/dist/contexts/GustoProvider/index.d.ts +2 -1
  275. package/dist/contexts/LocaleProvider/index.d.ts +1 -0
  276. package/dist/contexts/ThemeProvider/index.d.ts +1 -0
  277. package/dist/contexts/index.d.ts +1 -0
  278. package/dist/hooks/useForkRef/index.d.ts +1 -0
  279. package/dist/i18n/I18n.d.ts +2 -0
  280. package/dist/i18n/I18n.js +23 -17
  281. package/dist/i18n/I18n.js.map +1 -1
  282. package/dist/i18n/en/Contractor.Address.json.js +35 -0
  283. package/dist/i18n/en/Contractor.Address.json.js.map +1 -0
  284. package/dist/i18n/index.d.ts +1 -0
  285. package/dist/index.d.ts +1 -2
  286. package/dist/index.js +7 -11
  287. package/dist/index.js.map +1 -1
  288. package/dist/shared/constants.d.ts +7 -1
  289. package/dist/shared/constants.js +52 -46
  290. package/dist/shared/constants.js.map +1 -1
  291. package/dist/style.css +1 -1
  292. package/dist/types/Helpers.d.ts +14 -0
  293. package/dist/types/i18next.d.ts +80 -62
  294. package/package.json +5 -2
  295. package/dist/components/Company/BankAccount/BankAccountFlow.d.ts +0 -5
  296. package/dist/components/Company/BankAccount/BankAccountFlow.js +0 -24
  297. package/dist/components/Company/BankAccount/BankAccountFlow.js.map +0 -1
  298. package/dist/components/Company/DocumentSignerFlow/DocumentList/Actions.js.map +0 -1
  299. package/dist/components/Company/DocumentSignerFlow/DocumentList/DocumentList.d.ts +0 -13
  300. package/dist/components/Company/DocumentSignerFlow/DocumentList/DocumentList.js +0 -69
  301. package/dist/components/Company/DocumentSignerFlow/DocumentList/DocumentList.js.map +0 -1
  302. package/dist/components/Company/DocumentSignerFlow/DocumentList/Head.js.map +0 -1
  303. package/dist/components/Company/DocumentSignerFlow/DocumentList/List.js.map +0 -1
  304. package/dist/components/Company/DocumentSignerFlow/DocumentList/ManageSignatories.js.map +0 -1
  305. package/dist/components/Company/DocumentSignerFlow/DocumentList/useDocumentList.js.map +0 -1
  306. package/dist/components/Company/DocumentSignerFlow/DocumentSignerFlow.d.ts +0 -6
  307. package/dist/components/Company/DocumentSignerFlow/DocumentSignerFlow.js +0 -35
  308. package/dist/components/Company/DocumentSignerFlow/DocumentSignerFlow.js.map +0 -1
  309. package/dist/components/Company/DocumentSignerFlow/SignatureForm/Actions.js.map +0 -1
  310. package/dist/components/Company/DocumentSignerFlow/SignatureForm/Form.js.map +0 -1
  311. package/dist/components/Company/DocumentSignerFlow/SignatureForm/Head.js.map +0 -1
  312. package/dist/components/Company/DocumentSignerFlow/SignatureForm/Preview.js.map +0 -1
  313. package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.d.ts +0 -17
  314. package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.js +0 -78
  315. package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.js.map +0 -1
  316. package/dist/components/Company/DocumentSignerFlow/SignatureForm/useSignatureForm.js.map +0 -1
  317. package/dist/components/Company/DocumentSignerFlow/assignSignatoryState.js.map +0 -1
  318. package/dist/components/Company/DocumentSignerFlow/documentSignerStateMachine.js.map +0 -1
  319. package/dist/components/Company/DocumentSignerFlow/index.d.ts +0 -1
  320. package/dist/components/Company/DocumentSignerFlow/stateMachine.js.map +0 -1
  321. package/dist/components/Company/Locations/LocationsFlow.d.ts +0 -5
  322. package/dist/components/Company/Locations/LocationsFlow.js +0 -21
  323. package/dist/components/Company/Locations/LocationsFlow.js.map +0 -1
  324. package/dist/components/Company/StateTaxes/StateTaxesFlow.d.ts +0 -5
  325. package/dist/components/Company/StateTaxes/StateTaxesFlow.js +0 -21
  326. package/dist/components/Company/StateTaxes/StateTaxesFlow.js.map +0 -1
  327. package/dist/components/Company/StateTaxes/StateTaxesFlowComponents.js.map +0 -1
  328. package/dist/components/Employee/DocumentSigner/DocumentSignerFlow.d.ts +0 -5
  329. package/dist/components/Employee/DocumentSigner/DocumentSignerFlow.js +0 -21
  330. package/dist/components/Employee/DocumentSigner/DocumentSignerFlow.js.map +0 -1
  331. package/dist/components/Flow/EmployeeOnboardingFlow.d.ts +0 -27
  332. package/dist/components/Flow/EmployeeOnboardingFlow.js +0 -29
  333. package/dist/components/Flow/EmployeeOnboardingFlow.js.map +0 -1
  334. package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingComponents.d.ts +0 -5
  335. package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingComponents.js.map +0 -1
  336. package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingFlow.d.ts +0 -13
  337. package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingFlow.js +0 -26
  338. package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingFlow.js.map +0 -1
  339. package/dist/components/Flow/StateMachines/employeeOnboarding.js +0 -136
  340. package/dist/components/Flow/StateMachines/employeeOnboarding.js.map +0 -1
  341. package/dist/components/Flow/StateMachines/employeeSelfOnboarding.js.map +0 -1
  342. package/dist/components/Flow/StateMachines/index.d.ts +0 -2
  343. package/dist/components/Flow/index.d.ts +0 -2
  344. package/dist/components/Flow/index.js +0 -7
  345. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Actions.d.ts +0 -0
  346. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Actions.js +0 -0
  347. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Head.d.ts +0 -0
  348. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Head.js +0 -0
  349. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/List.d.ts +0 -0
  350. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/List.js +0 -0
  351. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.d.ts +0 -0
  352. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.js +0 -0
  353. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.module.scss.js +0 -0
  354. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.module.scss.js.map +0 -0
  355. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/useDocumentList.d.ts +0 -0
  356. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Actions.d.ts +0 -0
  357. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Actions.js +0 -0
  358. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Form.d.ts +0 -0
  359. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Form.js +0 -0
  360. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Head.d.ts +0 -0
  361. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Head.js +0 -0
  362. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Preview.d.ts +0 -0
  363. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Preview.js +0 -0
  364. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/useSignatureForm.d.ts +0 -0
  365. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/assignSignatoryState.d.ts +0 -0
  366. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/assignSignatoryState.js +0 -0
  367. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/documentSignerStateMachine.d.ts +0 -0
  368. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/documentSignerStateMachine.js +0 -0
  369. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/stateMachine.d.ts +0 -0
  370. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/stateMachine.js +0 -0
  371. /package/dist/components/Company/{DocumentSignerFlow/useDocumentSignerFlow.d.ts → DocumentSigner/useDocumentSigner.d.ts} +0 -0
  372. /package/dist/components/Company/StateTaxes/{StateTaxesFlowComponents.d.ts → StateTaxesComponents.d.ts} +0 -0
  373. /package/dist/components/{Flow/StateMachines/employeeOnboarding.d.ts → Employee/OnboardingFlow/onboardingStateMachine.d.ts} +0 -0
  374. /package/dist/components/{Flow/StateMachines/employeeSelfOnboarding.d.ts → Employee/SelfOnboardingFlow/selfOnboardingMachine.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.0
4
+
5
+ - Added new Contractor.Address form component for managing contractor address information
6
+ - Improved ComboBox accessibility and added comprehensive component tests
7
+ - Added accessibility testing infrastructure with foundational component coverage
8
+ - Added accessibility tests to complex interactive and data components
9
+ - Fixed state tax boolean validation issues
10
+ - Updated Gusto embedded-api version to the latest
11
+
12
+ ## 0.8.2
13
+
14
+ - Refactored employee flow components structure and improved organization within Employee namespace
15
+ - Added component-level dictionary override functionality for improved internationalization
16
+ - Updated state taxes component to support API-based validation messages
17
+ - Fixed commission Zod schema validation issues
18
+ - Fixed issue with headers not being passed properly through our API client
19
+
3
20
  ## 0.8.1
4
21
 
5
22
  - Replaced Valibot with Zod for bundle size reduction. Also included zod as a dependency
@@ -16,7 +33,7 @@
16
33
  - Introduced Company.OnboardingOverview component for tracking onboarding progress
17
34
  - Improved state management and context handling for onboarding components
18
35
  - Enhanced documentation for company onboarding workflow
19
- - Added Company.StateTaxesFlow component for managing state tax requirements
36
+ - Added Company.StateTaxes component for managing state tax requirements
20
37
  - Support for state-specific tax forms and requirements
21
38
  - Ability to update state tax settings with validation
22
39
  - Component Adapter initial implementation available with most components (Docs coming soon)
@@ -108,7 +125,7 @@ You would do the following instead::
108
125
  >
109
126
  ```
110
127
 
111
- #### DocumentSigner has been renamed to DocumentSignerFlow
128
+ #### DocumentSigner has been renamed to DocumentSigner
112
129
 
113
130
  Where you would previously do
114
131
 
@@ -119,7 +136,7 @@ Where you would previously do
119
136
  You should update the naming as follows:
120
137
 
121
138
  ```tsx
122
- <Employee.DocumentSignerFlow employeeId="some-id" onEvent={() => {}} />
139
+ <Employee.DocumentSigner employeeId="some-id" onEvent={() => {}} />
123
140
  ```
124
141
 
125
142
  ## 0.6.0
@@ -1,16 +1,17 @@
1
- import { ReactNode, FC, JSX } from 'react';
1
+ import { ReactNode, JSX } from 'react';
2
2
  import { FallbackProps } from 'react-error-boundary';
3
3
  import { OnEventType } from './useBase';
4
4
  import { EventType } from '../../shared/constants';
5
- export interface CommonComponentInterface {
5
+ import { ResourceDictionary, Resources } from '../../types/Helpers';
6
+ export interface CommonComponentInterface<TResourceKey extends keyof Resources = keyof Resources> {
6
7
  children?: ReactNode;
7
8
  className?: string;
8
9
  defaultValues?: unknown;
10
+ dictionary?: ResourceDictionary<TResourceKey>;
9
11
  }
10
- export interface BaseComponentInterface {
12
+ export interface BaseComponentInterface<TResourceKey extends keyof Resources = keyof Resources> extends CommonComponentInterface<TResourceKey> {
11
13
  FallbackComponent?: (props: FallbackProps) => JSX.Element;
12
14
  LoaderComponent?: () => JSX.Element;
13
15
  onEvent: OnEventType<EventType, unknown>;
14
- children?: ReactNode;
15
16
  }
16
- export declare const BaseComponent: FC<BaseComponentInterface>;
17
+ export declare const BaseComponent: <TResourceKey extends keyof Resources = keyof Resources>({ children, FallbackComponent, LoaderComponent, onEvent, dictionary, }: BaseComponentInterface<TResourceKey>) => import("react/jsx-runtime").JSX.Element;
@@ -1,71 +1,72 @@
1
- import { jsx as a, jsxs as b } from "react/jsx-runtime";
2
- import { useState as u, useCallback as h, Suspense as x } from "react";
3
- import { ErrorBoundary as v } from "react-error-boundary";
4
- import { useTranslation as A } from "react-i18next";
5
- import { APIError as S } from "@gusto/embedded-api/models/errors/apierror";
6
- import { SDKValidationError as _ } from "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
- import { UnprocessableEntityErrorObject as d } from "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
- import { FadeIn as j } from "../Common/FadeIn/FadeIn.js";
9
- import { BaseContext as B } from "./useBase.js";
10
- import { componentEvents as I } from "../../shared/constants.js";
11
- import { useAsyncError as K } from "../Common/hooks/useAsyncError.js";
12
- import { Loading as P } from "../Common/Loading/Loading.js";
13
- import { InternalError as R } from "../Common/InternalError/InternalError.js";
14
- import { snakeCaseToCamelCase as w } from "../../helpers/formattedStrings.js";
15
- import { useComponentContext as M } from "../../contexts/ComponentAdapter/useComponentContext.js";
16
- const O = (t) => t.map((e) => e.message ? /* @__PURE__ */ a("li", { children: e.message }, e.key) : null), y = (t, e) => {
17
- const n = e ? e + "." : "";
1
+ import { jsx as a, jsxs as h } from "react/jsx-runtime";
2
+ import { useState as p, useCallback as x, Suspense as v } from "react";
3
+ import { ErrorBoundary as A } from "react-error-boundary";
4
+ import { useTranslation as S } from "react-i18next";
5
+ import { APIError as _ } from "@gusto/embedded-api/models/errors/apierror";
6
+ import { SDKValidationError as j } from "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
+ import { UnprocessableEntityErrorObject as u } from "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
+ import { FadeIn as B } from "../Common/FadeIn/FadeIn.js";
9
+ import { BaseContext as I } from "./useBase.js";
10
+ import { componentEvents as K } from "../../shared/constants.js";
11
+ import { useAsyncError as P } from "../Common/hooks/useAsyncError.js";
12
+ import { Loading as R } from "../Common/Loading/Loading.js";
13
+ import { InternalError as w } from "../Common/InternalError/InternalError.js";
14
+ import { snakeCaseToCamelCase as M } from "../../helpers/formattedStrings.js";
15
+ import { useComponentContext as O } from "../../contexts/ComponentAdapter/useComponentContext.js";
16
+ const T = (t) => t.map((e) => e.message ? /* @__PURE__ */ a("li", { children: e.message }, e.key) : null), y = (t, e) => {
17
+ const s = e ? e + "." : "";
18
18
  if (t.category === "invalid_attribute_value" || t.category === "invalid_operation")
19
19
  return [
20
20
  {
21
- key: w(n + t.errorKey),
21
+ key: M(s + t.errorKey),
22
22
  message: t.message ?? ""
23
23
  }
24
24
  ];
25
25
  if (t.category === "nested_errors" && t.errors !== void 0) {
26
26
  let o = "";
27
- return t.metadata?.key && typeof t.metadata.key == "string" ? o = t.metadata.key : t.metadata?.state && typeof t.metadata.state == "string" ? o = t.metadata.state : t.errorKey && (o = t.errorKey), t.errors.flatMap((l) => y(l, n + o));
27
+ return t.metadata?.key && typeof t.metadata.key == "string" ? o = t.metadata.key : t.metadata?.state && typeof t.metadata.state == "string" ? o = t.metadata.state : t.errorKey && (o = t.errorKey), t.errors.flatMap((f) => y(f, s + o));
28
28
  }
29
29
  return [];
30
- }, Y = ({
30
+ }, Z = ({
31
31
  children: t,
32
- FallbackComponent: e = R,
33
- LoaderComponent: n = P,
34
- onEvent: o
32
+ FallbackComponent: e = w,
33
+ LoaderComponent: s = R,
34
+ onEvent: o,
35
+ dictionary: f
35
36
  }) => {
36
- const [l, i] = u(null), [m, p] = u(null), f = K(), { t: E } = A(), g = M(), k = (r) => {
37
- i(r), r instanceof d && Array.isArray(r.errors) && p(r.errors.flatMap((c) => y(c)));
38
- }, C = h(
37
+ const [E, i] = p(null), [m, d] = p(null), l = P(), { t: g } = S(), k = O(), C = (r) => {
38
+ i(r), r instanceof u && Array.isArray(r.errors) && d(r.errors.flatMap((c) => y(c)));
39
+ }, b = x(
39
40
  async (r, c) => {
40
- i(null), p(null);
41
+ i(null), d(null);
41
42
  try {
42
43
  await c(r);
43
- } catch (s) {
44
- s instanceof S || s instanceof _ || s instanceof d ? k(s) : f(s);
44
+ } catch (n) {
45
+ n instanceof _ || n instanceof j || n instanceof u ? C(n) : l(n);
45
46
  }
46
47
  },
47
- [i, f]
48
+ [i, l]
48
49
  );
49
50
  return /* @__PURE__ */ a(
50
- B.Provider,
51
+ I.Provider,
51
52
  {
52
53
  value: {
53
54
  fieldErrors: m,
54
55
  setError: i,
55
56
  onEvent: o,
56
- throwError: f,
57
- baseSubmitHandler: C
57
+ throwError: l,
58
+ baseSubmitHandler: b
58
59
  },
59
- children: /* @__PURE__ */ b(
60
- v,
60
+ children: /* @__PURE__ */ h(
61
+ A,
61
62
  {
62
63
  FallbackComponent: e,
63
64
  onError: (r) => {
64
- o(I.ERROR, r);
65
+ o(K.ERROR, r);
65
66
  },
66
67
  children: [
67
- (l || m) && /* @__PURE__ */ a(g.Alert, { label: E("status.errorEncountered"), status: "error", children: m && /* @__PURE__ */ a("ul", { children: O(m) }) }),
68
- /* @__PURE__ */ a(x, { fallback: /* @__PURE__ */ a(n, {}), children: /* @__PURE__ */ a(j, { children: t }) })
68
+ (E || m) && /* @__PURE__ */ a(k.Alert, { label: g("status.errorEncountered"), status: "error", children: m && /* @__PURE__ */ a("ul", { children: T(m) }) }),
69
+ /* @__PURE__ */ a(v, { fallback: /* @__PURE__ */ a(s, {}), children: /* @__PURE__ */ a(B, { children: t }) })
69
70
  ]
70
71
  }
71
72
  )
@@ -73,6 +74,6 @@ const O = (t) => t.map((e) => e.message ? /* @__PURE__ */ a("li", { children: e.
73
74
  );
74
75
  };
75
76
  export {
76
- Y as BaseComponent
77
+ Z as BaseComponent
77
78
  };
78
79
  //# sourceMappingURL=Base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Base.js","sources":["../../../src/components/Base/Base.tsx"],"sourcesContent":["import type { ReactNode, FC, JSX } from 'react'\nimport { Suspense, useState, useCallback } from 'react'\nimport type { FallbackProps } from 'react-error-boundary'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { useTranslation } from 'react-i18next'\nimport { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror'\nimport { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject'\nimport type { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject'\nimport { FadeIn } from '../Common/FadeIn/FadeIn'\nimport { BaseContext, type FieldError, type KnownErrors, type OnEventType } from './useBase'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport { InternalError, Loading, useAsyncError } from '@/components/Common'\nimport { snakeCaseToCamelCase } from '@/helpers/formattedStrings'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport interface CommonComponentInterface {\n children?: ReactNode\n className?: string\n defaultValues?: unknown\n}\n\n// Base component wrapper with error and suspense handling\nexport interface BaseComponentInterface {\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n LoaderComponent?: () => JSX.Element\n onEvent: OnEventType<EventType, unknown>\n children?: ReactNode\n}\n\n/**Traverses errorList and finds items with message properties */\nconst renderErrorList = (errorList: FieldError[]): React.ReactNode => {\n return errorList.map(errorFromList => {\n if (errorFromList.message) {\n return <li key={errorFromList.key}>{errorFromList.message}</li>\n }\n return null\n })\n}\n/**Recuresively parses error list and constructs an array of objects containing attribute value error messages associated with form fields. Nested errors construct '.' separated keys\n * metadata.state is a special case for state taxes validation errors\n */\nconst getFieldErrors = (\n error: EntityErrorObject,\n parentKey?: string,\n): { key: string; message: string }[] => {\n const keyPrefix = parentKey ? parentKey + '.' : ''\n if (error.category === 'invalid_attribute_value' || error.category === 'invalid_operation') {\n return [\n {\n key: snakeCaseToCamelCase(keyPrefix + error.errorKey),\n message: error.message ?? '',\n },\n ]\n }\n if (error.category === 'nested_errors' && error.errors !== undefined) {\n //TODO: clean this up once Metadata type is fixed in openapi spec\n let keySuffix = ''\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n if (error.metadata?.key && typeof error.metadata.key === 'string') {\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n keySuffix = error.metadata.key as string\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n } else if (error.metadata?.state && typeof error.metadata.state === 'string') {\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n keySuffix = error.metadata.state as string\n } else if (error.errorKey) {\n keySuffix = error.errorKey\n }\n return error.errors.flatMap(err => getFieldErrors(err, keyPrefix + keySuffix))\n }\n return []\n}\n\ntype SubmitHandler<T> = (data: T) => Promise<void>\n\nexport const BaseComponent: FC<BaseComponentInterface> = ({\n children,\n FallbackComponent = InternalError,\n LoaderComponent = Loading,\n onEvent,\n}) => {\n const [error, setError] = useState<KnownErrors | null>(null)\n const [fieldErrors, setFieldErrors] = useState<FieldError[] | null>(null)\n const throwError = useAsyncError()\n const { t } = useTranslation()\n const Components = useComponentContext()\n\n const processError = (error: KnownErrors) => {\n setError(error)\n //422\tapplication/json - content relaited error\n if (error instanceof UnprocessableEntityErrorObject && Array.isArray(error.errors)) {\n setFieldErrors(error.errors.flatMap(err => getFieldErrors(err)))\n }\n }\n\n const baseSubmitHandler = useCallback(\n async <T,>(data: T, componentHandler: SubmitHandler<T>) => {\n setError(null)\n setFieldErrors(null)\n try {\n await componentHandler(data)\n } catch (err) {\n if (\n err instanceof APIError ||\n err instanceof SDKValidationError ||\n err instanceof UnprocessableEntityErrorObject\n ) {\n processError(err)\n } else throwError(err)\n }\n },\n [setError, throwError],\n )\n\n return (\n <BaseContext.Provider\n value={{\n fieldErrors,\n setError,\n onEvent,\n throwError,\n baseSubmitHandler,\n }}\n >\n <ErrorBoundary\n FallbackComponent={FallbackComponent}\n onError={err => {\n onEvent(componentEvents.ERROR, err)\n }}\n >\n {(error || fieldErrors) && (\n <Components.Alert label={t('status.errorEncountered')} status=\"error\">\n {fieldErrors && <ul>{renderErrorList(fieldErrors)}</ul>}\n </Components.Alert>\n )}\n <Suspense fallback={<LoaderComponent />}>\n <FadeIn>{children}</FadeIn>\n </Suspense>\n </ErrorBoundary>\n </BaseContext.Provider>\n )\n}\n"],"names":["renderErrorList","errorList","errorFromList","jsx","getFieldErrors","error","parentKey","keyPrefix","snakeCaseToCamelCase","keySuffix","err","BaseComponent","children","FallbackComponent","InternalError","LoaderComponent","Loading","onEvent","setError","useState","fieldErrors","setFieldErrors","throwError","useAsyncError","t","useTranslation","Components","useComponentContext","processError","UnprocessableEntityErrorObject","baseSubmitHandler","useCallback","data","componentHandler","APIError","SDKValidationError","BaseContext","jsxs","ErrorBoundary","componentEvents","Suspense","FadeIn"],"mappings":";;;;;;;;;;;;;;;AA+BA,MAAMA,IAAkB,CAACC,MAChBA,EAAU,IAAI,CAAiBC,MAChCA,EAAc,UACR,gBAAAC,EAAA,MAAA,EAA4B,UAAcD,EAAA,QAAA,GAAlCA,EAAc,GAA4B,IAErD,IACR,GAKGE,IAAiB,CACrBC,GACAC,MACuC;AACjC,QAAAC,IAAYD,IAAYA,IAAY,MAAM;AAChD,MAAID,EAAM,aAAa,6BAA6BA,EAAM,aAAa;AAC9D,WAAA;AAAA,MACL;AAAA,QACE,KAAKG,EAAqBD,IAAYF,EAAM,QAAQ;AAAA,QACpD,SAASA,EAAM,WAAW;AAAA,MAAA;AAAA,IAE9B;AAEF,MAAIA,EAAM,aAAa,mBAAmBA,EAAM,WAAW,QAAW;AAEpE,QAAII,IAAY;AAEhB,WAAIJ,EAAM,UAAU,OAAO,OAAOA,EAAM,SAAS,OAAQ,WAEvDI,IAAYJ,EAAM,SAAS,MAElBA,EAAM,UAAU,SAAS,OAAOA,EAAM,SAAS,SAAU,WAElEI,IAAYJ,EAAM,SAAS,QAClBA,EAAM,aACfI,IAAYJ,EAAM,WAEbA,EAAM,OAAO,QAAQ,CAAAK,MAAON,EAAeM,GAAKH,IAAYE,CAAS,CAAC;AAAA,EAAA;AAE/E,SAAO,CAAC;AACV,GAIaE,IAA4C,CAAC;AAAA,EACxD,UAAAC;AAAA,EACA,mBAAAC,IAAoBC;AAAA,EACpB,iBAAAC,IAAkBC;AAAA,EAClB,SAAAC;AACF,MAAM;AACJ,QAAM,CAACZ,GAAOa,CAAQ,IAAIC,EAA6B,IAAI,GACrD,CAACC,GAAaC,CAAc,IAAIF,EAA8B,IAAI,GAClEG,IAAaC,EAAc,GAC3B,EAAE,GAAAC,EAAE,IAAIC,EAAe,GACvBC,IAAaC,EAAoB,GAEjCC,IAAe,CAACvB,MAAuB;AAC3C,IAAAa,EAASb,CAAK,GAEVA,aAAiBwB,KAAkC,MAAM,QAAQxB,EAAM,MAAM,KAC/EgB,EAAehB,EAAM,OAAO,QAAQ,OAAOD,EAAeM,CAAG,CAAC,CAAC;AAAA,EAEnE,GAEMoB,IAAoBC;AAAA,IACxB,OAAWC,GAASC,MAAuC;AACzD,MAAAf,EAAS,IAAI,GACbG,EAAe,IAAI;AACf,UAAA;AACF,cAAMY,EAAiBD,CAAI;AAAA,eACpBtB,GAAK;AACZ,QACEA,aAAewB,KACfxB,aAAeyB,KACfzB,aAAemB,IAEfD,EAAalB,CAAG,MACAA,CAAG;AAAA,MAAA;AAAA,IAEzB;AAAA,IACA,CAACQ,GAAUI,CAAU;AAAA,EACvB;AAGE,SAAA,gBAAAnB;AAAA,IAACiC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,aAAAhB;AAAA,QACA,UAAAF;AAAA,QACA,SAAAD;AAAA,QACA,YAAAK;AAAA,QACA,mBAAAQ;AAAA,MACF;AAAA,MAEA,UAAA,gBAAAO;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,mBAAAzB;AAAA,UACA,SAAS,CAAOH,MAAA;AACN,YAAAO,EAAAsB,EAAgB,OAAO7B,CAAG;AAAA,UACpC;AAAA,UAEE,UAAA;AAAA,aAAAL,KAASe,MACR,gBAAAjB,EAAAuB,EAAW,OAAX,EAAiB,OAAOF,EAAE,yBAAyB,GAAG,QAAO,SAC3D,UAAeJ,KAAA,gBAAAjB,EAAC,QAAI,UAAgBH,EAAAoB,CAAW,EAAE,CAAA,GACpD;AAAA,YAEF,gBAAAjB,EAACqC,KAAS,UAAU,gBAAArC,EAACY,KAAgB,GACnC,UAAA,gBAAAZ,EAACsC,GAAQ,EAAA,UAAA7B,EAAS,CAAA,EACpB,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"Base.js","sources":["../../../src/components/Base/Base.tsx"],"sourcesContent":["import type { ReactNode, JSX } from 'react'\nimport { Suspense, useState, useCallback } from 'react'\nimport type { FallbackProps } from 'react-error-boundary'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { useTranslation } from 'react-i18next'\nimport { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror'\nimport { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject'\nimport type { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject'\nimport { FadeIn } from '../Common/FadeIn/FadeIn'\nimport { BaseContext, type FieldError, type KnownErrors, type OnEventType } from './useBase'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport { InternalError, Loading, useAsyncError } from '@/components/Common'\nimport { snakeCaseToCamelCase } from '@/helpers/formattedStrings'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport type { ResourceDictionary, Resources } from '@/types/Helpers'\n\nexport interface CommonComponentInterface<TResourceKey extends keyof Resources = keyof Resources> {\n children?: ReactNode\n className?: string\n defaultValues?: unknown\n dictionary?: ResourceDictionary<TResourceKey>\n}\n\n// Base component wrapper with error and suspense handling\nexport interface BaseComponentInterface<TResourceKey extends keyof Resources = keyof Resources>\n extends CommonComponentInterface<TResourceKey> {\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n LoaderComponent?: () => JSX.Element\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**Traverses errorList and finds items with message properties */\nconst renderErrorList = (errorList: FieldError[]): React.ReactNode => {\n return errorList.map(errorFromList => {\n if (errorFromList.message) {\n return <li key={errorFromList.key}>{errorFromList.message}</li>\n }\n return null\n })\n}\n/**Recuresively parses error list and constructs an array of objects containing attribute value error messages associated with form fields. Nested errors construct '.' separated keys\n * metadata.state is a special case for state taxes validation errors\n */\nconst getFieldErrors = (\n error: EntityErrorObject,\n parentKey?: string,\n): { key: string; message: string }[] => {\n const keyPrefix = parentKey ? parentKey + '.' : ''\n if (error.category === 'invalid_attribute_value' || error.category === 'invalid_operation') {\n return [\n {\n key: snakeCaseToCamelCase(keyPrefix + error.errorKey),\n message: error.message ?? '',\n },\n ]\n }\n if (error.category === 'nested_errors' && error.errors !== undefined) {\n //TODO: clean this up once Metadata type is fixed in openapi spec\n let keySuffix = ''\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n if (error.metadata?.key && typeof error.metadata.key === 'string') {\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n keySuffix = error.metadata.key as string\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n } else if (error.metadata?.state && typeof error.metadata.state === 'string') {\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n keySuffix = error.metadata.state as string\n } else if (error.errorKey) {\n keySuffix = error.errorKey\n }\n return error.errors.flatMap(err => getFieldErrors(err, keyPrefix + keySuffix))\n }\n return []\n}\n\ntype SubmitHandler<T> = (data: T) => Promise<void>\n\nexport const BaseComponent = <TResourceKey extends keyof Resources = keyof Resources>({\n children,\n FallbackComponent = InternalError,\n LoaderComponent = Loading,\n onEvent,\n dictionary,\n}: BaseComponentInterface<TResourceKey>) => {\n const [error, setError] = useState<KnownErrors | null>(null)\n const [fieldErrors, setFieldErrors] = useState<FieldError[] | null>(null)\n const throwError = useAsyncError()\n const { t } = useTranslation()\n const Components = useComponentContext()\n\n const processError = (error: KnownErrors) => {\n setError(error)\n //422\tapplication/json - content relaited error\n if (error instanceof UnprocessableEntityErrorObject && Array.isArray(error.errors)) {\n setFieldErrors(error.errors.flatMap(err => getFieldErrors(err)))\n }\n }\n\n const baseSubmitHandler = useCallback(\n async <T,>(data: T, componentHandler: SubmitHandler<T>) => {\n setError(null)\n setFieldErrors(null)\n try {\n await componentHandler(data)\n } catch (err) {\n if (\n err instanceof APIError ||\n err instanceof SDKValidationError ||\n err instanceof UnprocessableEntityErrorObject\n ) {\n processError(err)\n } else throwError(err)\n }\n },\n [setError, throwError],\n )\n\n return (\n <BaseContext.Provider\n value={{\n fieldErrors,\n setError,\n onEvent,\n throwError,\n baseSubmitHandler,\n }}\n >\n <ErrorBoundary\n FallbackComponent={FallbackComponent}\n onError={err => {\n onEvent(componentEvents.ERROR, err)\n }}\n >\n {(error || fieldErrors) && (\n <Components.Alert label={t('status.errorEncountered')} status=\"error\">\n {fieldErrors && <ul>{renderErrorList(fieldErrors)}</ul>}\n </Components.Alert>\n )}\n <Suspense fallback={<LoaderComponent />}>\n <FadeIn>{children}</FadeIn>\n </Suspense>\n </ErrorBoundary>\n </BaseContext.Provider>\n )\n}\n"],"names":["renderErrorList","errorList","errorFromList","jsx","getFieldErrors","error","parentKey","keyPrefix","snakeCaseToCamelCase","keySuffix","err","BaseComponent","children","FallbackComponent","InternalError","LoaderComponent","Loading","onEvent","dictionary","setError","useState","fieldErrors","setFieldErrors","throwError","useAsyncError","t","useTranslation","Components","useComponentContext","processError","UnprocessableEntityErrorObject","baseSubmitHandler","useCallback","data","componentHandler","APIError","SDKValidationError","BaseContext","jsxs","ErrorBoundary","componentEvents","Suspense","FadeIn"],"mappings":";;;;;;;;;;;;;;;AAiCA,MAAMA,IAAkB,CAACC,MAChBA,EAAU,IAAI,CAAiBC,MAChCA,EAAc,UACR,gBAAAC,EAAA,MAAA,EAA4B,UAAcD,EAAA,QAAA,GAAlCA,EAAc,GAA4B,IAErD,IACR,GAKGE,IAAiB,CACrBC,GACAC,MACuC;AACjC,QAAAC,IAAYD,IAAYA,IAAY,MAAM;AAChD,MAAID,EAAM,aAAa,6BAA6BA,EAAM,aAAa;AAC9D,WAAA;AAAA,MACL;AAAA,QACE,KAAKG,EAAqBD,IAAYF,EAAM,QAAQ;AAAA,QACpD,SAASA,EAAM,WAAW;AAAA,MAAA;AAAA,IAE9B;AAEF,MAAIA,EAAM,aAAa,mBAAmBA,EAAM,WAAW,QAAW;AAEpE,QAAII,IAAY;AAEhB,WAAIJ,EAAM,UAAU,OAAO,OAAOA,EAAM,SAAS,OAAQ,WAEvDI,IAAYJ,EAAM,SAAS,MAElBA,EAAM,UAAU,SAAS,OAAOA,EAAM,SAAS,SAAU,WAElEI,IAAYJ,EAAM,SAAS,QAClBA,EAAM,aACfI,IAAYJ,EAAM,WAEbA,EAAM,OAAO,QAAQ,CAAAK,MAAON,EAAeM,GAAKH,IAAYE,CAAS,CAAC;AAAA,EAAA;AAE/E,SAAO,CAAC;AACV,GAIaE,IAAgB,CAAyD;AAAA,EACpF,UAAAC;AAAA,EACA,mBAAAC,IAAoBC;AAAA,EACpB,iBAAAC,IAAkBC;AAAA,EAClB,SAAAC;AAAA,EACA,YAAAC;AACF,MAA4C;AAC1C,QAAM,CAACb,GAAOc,CAAQ,IAAIC,EAA6B,IAAI,GACrD,CAACC,GAAaC,CAAc,IAAIF,EAA8B,IAAI,GAClEG,IAAaC,EAAc,GAC3B,EAAE,GAAAC,EAAE,IAAIC,EAAe,GACvBC,IAAaC,EAAoB,GAEjCC,IAAe,CAACxB,MAAuB;AAC3C,IAAAc,EAASd,CAAK,GAEVA,aAAiByB,KAAkC,MAAM,QAAQzB,EAAM,MAAM,KAC/EiB,EAAejB,EAAM,OAAO,QAAQ,OAAOD,EAAeM,CAAG,CAAC,CAAC;AAAA,EAEnE,GAEMqB,IAAoBC;AAAA,IACxB,OAAWC,GAASC,MAAuC;AACzD,MAAAf,EAAS,IAAI,GACbG,EAAe,IAAI;AACf,UAAA;AACF,cAAMY,EAAiBD,CAAI;AAAA,eACpBvB,GAAK;AACZ,QACEA,aAAeyB,KACfzB,aAAe0B,KACf1B,aAAeoB,IAEfD,EAAanB,CAAG,MACAA,CAAG;AAAA,MAAA;AAAA,IAEzB;AAAA,IACA,CAACS,GAAUI,CAAU;AAAA,EACvB;AAGE,SAAA,gBAAApB;AAAA,IAACkC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,aAAAhB;AAAA,QACA,UAAAF;AAAA,QACA,SAAAF;AAAA,QACA,YAAAM;AAAA,QACA,mBAAAQ;AAAA,MACF;AAAA,MAEA,UAAA,gBAAAO;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,mBAAA1B;AAAA,UACA,SAAS,CAAOH,MAAA;AACN,YAAAO,EAAAuB,EAAgB,OAAO9B,CAAG;AAAA,UACpC;AAAA,UAEE,UAAA;AAAA,aAAAL,KAASgB,MACR,gBAAAlB,EAAAwB,EAAW,OAAX,EAAiB,OAAOF,EAAE,yBAAyB,GAAG,QAAO,SAC3D,UAAeJ,KAAA,gBAAAlB,EAAC,QAAI,UAAgBH,EAAAqB,CAAW,EAAE,CAAA,GACpD;AAAA,YAEF,gBAAAlB,EAACsC,KAAS,UAAU,gBAAAtC,EAACY,KAAgB,GACnC,UAAA,gBAAAZ,EAACuC,GAAQ,EAAA,UAAA9B,EAAS,CAAA,EACpB,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAEJ;"}
@@ -1,3 +1,4 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { BaseComponent, type BaseComponentInterface, type CommonComponentInterface } from './Base';
2
3
  export { createCompoundContext } from './createCompoundContext';
3
4
  export { useBase } from './useBase';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export * from './ActionsLayout';
@@ -1,31 +1,31 @@
1
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import s from "./DataCards.module.scss.js";
3
- import { Flex as h } from "../../Flex/Flex.js";
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import a from "./DataCards.module.scss.js";
3
+ import { Flex as p } from "../../Flex/Flex.js";
4
4
  import { useComponentContext as x } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
5
5
  const D = ({
6
- data: n,
7
- columns: a,
8
- itemMenu: o,
9
- onSelect: d,
10
- emptyState: c
6
+ data: t,
7
+ columns: c,
8
+ itemMenu: d,
9
+ onSelect: n,
10
+ emptyState: o
11
11
  }) => {
12
- const l = x();
13
- return /* @__PURE__ */ i("div", { role: "list", "data-testid": "data-cards", children: [
14
- n.length === 0 && /* @__PURE__ */ t(l.Card, { children: c?.() }),
15
- n.map((e, m) => /* @__PURE__ */ t("div", { role: "listitem", children: /* @__PURE__ */ t(
16
- l.Card,
12
+ const s = x();
13
+ return /* @__PURE__ */ l("div", { role: "list", "data-testid": "data-cards", children: [
14
+ t.length === 0 && o && /* @__PURE__ */ e("div", { role: "listitem", children: /* @__PURE__ */ e(s.Card, { children: o() }) }),
15
+ t.map((i, m) => /* @__PURE__ */ e("div", { role: "listitem", children: /* @__PURE__ */ e(
16
+ s.Card,
17
17
  {
18
- menu: o && o(e),
19
- onSelect: d ? (r) => {
20
- d(e, r);
18
+ menu: d && d(i),
19
+ onSelect: n ? (r) => {
20
+ n(i, r);
21
21
  } : void 0,
22
- children: a.map((r, p) => /* @__PURE__ */ i(h, { flexDirection: "column", gap: 0, children: [
23
- /* @__PURE__ */ t("h5", { className: s.columnTitle, children: r.title }),
24
- /* @__PURE__ */ i("div", { className: s.columnData, children: [
22
+ children: c.map((r, h) => /* @__PURE__ */ l(p, { flexDirection: "column", gap: 0, children: [
23
+ /* @__PURE__ */ e("h5", { className: a.columnTitle, children: r.title }),
24
+ /* @__PURE__ */ l("div", { className: a.columnData, children: [
25
25
  " ",
26
- r.render ? r.render(e) : String(e[r.key])
26
+ r.render ? r.render(i) : String(i[r.key])
27
27
  ] })
28
- ] }, p))
28
+ ] }, h))
29
29
  }
30
30
  ) }, m))
31
31
  ] });
@@ -1 +1 @@
1
- {"version":3,"file":"DataCards.js","sources":["../../../../../src/components/Common/DataView/DataCards/DataCards.tsx"],"sourcesContent":["import styles from './DataCards.module.scss'\nimport type { useDataViewPropReturn } from '@/components/Common/DataView/useDataView'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport type DataCardsProps<T> = {\n columns: useDataViewPropReturn<T>['columns']\n data: useDataViewPropReturn<T>['data']\n itemMenu?: useDataViewPropReturn<T>['itemMenu']\n onSelect?: useDataViewPropReturn<T>['onSelect']\n emptyState?: useDataViewPropReturn<T>['emptyState']\n}\n\nexport const DataCards = <T,>({\n data,\n columns,\n itemMenu,\n onSelect,\n emptyState,\n}: DataCardsProps<T>) => {\n const Components = useComponentContext()\n return (\n <div role=\"list\" data-testid=\"data-cards\">\n {data.length === 0 && <Components.Card>{emptyState?.()}</Components.Card>}\n {data.map((item, index) => (\n <div role=\"listitem\" key={index}>\n <Components.Card\n menu={itemMenu && itemMenu(item)}\n onSelect={\n onSelect\n ? (checked: boolean) => {\n onSelect(item, checked)\n }\n : undefined\n }\n >\n {columns.map((column, index) => (\n <Flex key={index} flexDirection=\"column\" gap={0}>\n <h5 className={styles.columnTitle}>{column.title}</h5>\n <div className={styles.columnData}>\n {' '}\n {column.render ? column.render(item) : String(item[column.key as keyof T])}\n </div>\n </Flex>\n ))}\n </Components.Card>\n </div>\n ))}\n </div>\n )\n}\n"],"names":["DataCards","data","columns","itemMenu","onSelect","emptyState","Components","useComponentContext","jsxs","jsx","item","index","checked","column","Flex","styles"],"mappings":";;;;AAaO,MAAMA,IAAY,CAAK;AAAA,EAC5B,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,MAAyB;AACvB,QAAMC,IAAaC,EAAoB;AACvC,SACG,gBAAAC,EAAA,OAAA,EAAI,MAAK,QAAO,eAAY,cAC1B,UAAA;AAAA,IAAAP,EAAK,WAAW,KAAK,gBAAAQ,EAACH,EAAW,MAAX,EAAiB,iBAAe;AAAA,IACtDL,EAAK,IAAI,CAACS,GAAMC,MACd,gBAAAF,EAAA,OAAA,EAAI,MAAK,YACR,UAAA,gBAAAA;AAAA,MAACH,EAAW;AAAA,MAAX;AAAA,QACC,MAAMH,KAAYA,EAASO,CAAI;AAAA,QAC/B,UACEN,IACI,CAACQ,MAAqB;AACpB,UAAAR,EAASM,GAAME,CAAO;AAAA,QAAA,IAExB;AAAA,QAGL,UAAAV,EAAQ,IAAI,CAACW,GAAQF,wBACnBG,GAAiB,EAAA,eAAc,UAAS,KAAK,GAC5C,UAAA;AAAA,UAAA,gBAAAL,EAAC,MAAG,EAAA,WAAWM,EAAO,aAAc,YAAO,OAAM;AAAA,UAChD,gBAAAP,EAAA,OAAA,EAAI,WAAWO,EAAO,YACpB,UAAA;AAAA,YAAA;AAAA,YACAF,EAAO,SAASA,EAAO,OAAOH,CAAI,IAAI,OAAOA,EAAKG,EAAO,GAAc,CAAC;AAAA,UAAA,EAC3E,CAAA;AAAA,QAAA,EAAA,GALSF,CAMX,CACD;AAAA,MAAA;AAAA,IACH,EAAA,GApBwBA,CAqB1B,CACD;AAAA,EAAA,GACH;AAEJ;"}
1
+ {"version":3,"file":"DataCards.js","sources":["../../../../../src/components/Common/DataView/DataCards/DataCards.tsx"],"sourcesContent":["import styles from './DataCards.module.scss'\nimport type { useDataViewPropReturn } from '@/components/Common/DataView/useDataView'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport type DataCardsProps<T> = {\n columns: useDataViewPropReturn<T>['columns']\n data: useDataViewPropReturn<T>['data']\n itemMenu?: useDataViewPropReturn<T>['itemMenu']\n onSelect?: useDataViewPropReturn<T>['onSelect']\n emptyState?: useDataViewPropReturn<T>['emptyState']\n}\n\nexport const DataCards = <T,>({\n data,\n columns,\n itemMenu,\n onSelect,\n emptyState,\n}: DataCardsProps<T>) => {\n const Components = useComponentContext()\n return (\n <div role=\"list\" data-testid=\"data-cards\">\n {data.length === 0 && emptyState && (\n <div role=\"listitem\">\n <Components.Card>{emptyState()}</Components.Card>\n </div>\n )}\n {data.map((item, index) => (\n <div role=\"listitem\" key={index}>\n <Components.Card\n menu={itemMenu && itemMenu(item)}\n onSelect={\n onSelect\n ? (checked: boolean) => {\n onSelect(item, checked)\n }\n : undefined\n }\n >\n {columns.map((column, index) => (\n <Flex key={index} flexDirection=\"column\" gap={0}>\n <h5 className={styles.columnTitle}>{column.title}</h5>\n <div className={styles.columnData}>\n {' '}\n {column.render ? column.render(item) : String(item[column.key as keyof T])}\n </div>\n </Flex>\n ))}\n </Components.Card>\n </div>\n ))}\n </div>\n )\n}\n"],"names":["DataCards","data","columns","itemMenu","onSelect","emptyState","Components","useComponentContext","jsxs","jsx","item","index","checked","column","Flex","styles"],"mappings":";;;;AAaO,MAAMA,IAAY,CAAK;AAAA,EAC5B,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,MAAyB;AACvB,QAAMC,IAAaC,EAAoB;AACvC,SACG,gBAAAC,EAAA,OAAA,EAAI,MAAK,QAAO,eAAY,cAC1B,UAAA;AAAA,IAAAP,EAAK,WAAW,KAAKI,KACpB,gBAAAI,EAAC,OAAI,EAAA,MAAK,YACR,UAAA,gBAAAA,EAACH,EAAW,MAAX,EAAiB,UAAAD,EAAA,EAAa,CAAA,GACjC;AAAA,IAEDJ,EAAK,IAAI,CAACS,GAAMC,MACd,gBAAAF,EAAA,OAAA,EAAI,MAAK,YACR,UAAA,gBAAAA;AAAA,MAACH,EAAW;AAAA,MAAX;AAAA,QACC,MAAMH,KAAYA,EAASO,CAAI;AAAA,QAC/B,UACEN,IACI,CAACQ,MAAqB;AACpB,UAAAR,EAASM,GAAME,CAAO;AAAA,QAAA,IAExB;AAAA,QAGL,UAAAV,EAAQ,IAAI,CAACW,GAAQF,wBACnBG,GAAiB,EAAA,eAAc,UAAS,KAAK,GAC5C,UAAA;AAAA,UAAA,gBAAAL,EAAC,MAAG,EAAA,WAAWM,EAAO,aAAc,YAAO,OAAM;AAAA,UAChD,gBAAAP,EAAA,OAAA,EAAI,WAAWO,EAAO,YACpB,UAAA;AAAA,YAAA;AAAA,YACAF,EAAO,SAASA,EAAO,OAAOH,CAAI,IAAI,OAAOA,EAAKG,EAAO,GAAc,CAAC;AAAA,UAAA,EAC3E,CAAA;AAAA,QAAA,EAAA,GALSF,CAMX,CACD;AAAA,MAAA;AAAA,IACH,EAAA,GApBwBA,CAqB1B,CACD;AAAA,EAAA,GACH;AAEJ;"}
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export * from './DataCards';
@@ -1,3 +1,4 @@
1
+ import "./types/i18next.d.ts"
1
2
  export * from './DataView';
2
3
  export * from './DataCards/';
3
4
  export * from './DataTable/DataTable';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { DocumentList, type FormData } from './DocumentList';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export * from './DocumentViewer';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { FieldCaption } from './FieldCaption';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { FieldDescription } from './FieldDescription';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { FieldErrorMessage } from './FieldErrorMessage';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { FieldLayout } from './FieldLayout';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { CheckboxField, type CheckboxFieldProps } from './CheckboxField';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { CheckboxGroupField, type CheckboxGroupFieldProps } from './CheckboxGroupField';
@@ -1,2 +1,3 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { ComboBoxField } from './ComboBoxField';
2
3
  export type { ComboBoxFieldProps } from './ComboBoxField';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export * from './DatePickerField';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { NumberInputField, type NumberInputFieldProps } from './NumberInputField';
@@ -1,2 +1,3 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { RadioGroupField } from './RadioGroupField';
2
3
  export type { RadioGroupFieldProps } from './RadioGroupField';
@@ -1,2 +1,3 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { SelectField } from './SelectField';
2
3
  export type { SelectFieldProps } from './SelectField';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export * from './SwitchField';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { TextInputField, type TextInputFieldProps } from './TextInputField';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { Fieldset, type FieldsetProps } from './Fieldset';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { Flex } from './Flex';
@@ -1,2 +1,3 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { Form } from './Form';
2
3
  export type { FormProps } from './Form';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { HamburgerMenu } from './HamburgerMenu';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { HorizontalFieldLayout } from './HorizontalFieldLayout';
@@ -1,2 +1,3 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { PaginationControl } from './PaginationControl';
2
3
  export type { PaginationControlProps } from './PaginationControlTypes';
@@ -1,2 +1,3 @@
1
+ import "./types/i18next.d.ts"
1
2
  export * from './ReorderableList';
2
3
  export * from './ReorderableListTypes';
@@ -1,3 +1,4 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { SignatureForm } from './SignatureForm';
2
3
  export { SignatureFormFields } from './SignatureFormFields';
3
4
  export { SignatureFormActions } from './SignatureFormActions';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export * as TaxInputs from './TaxInputs';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { Alert } from './Alert';
@@ -1,3 +1,4 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { Button } from './Button';
2
3
  export { ButtonIcon } from './ButtonIcon';
3
4
  export type { ButtonProps, ButtonIconProps } from './ButtonTypes';
@@ -1,3 +1,4 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { CalendarPreview } from './CalendarPreview';
2
3
  export { CalendarLegend } from './CalendarLegend';
3
4
  export type { CalendarPreviewProps } from './CalendarPreviewTypes';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { Checkbox } from './Checkbox';
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export { CheckboxGroup } from './CheckboxGroup';
@@ -1,5 +1,5 @@
1
- import { jsx as r, jsxs as e } from "react/jsx-runtime";
2
- import { ComboBox as F, Button as T, Input as j, Popover as D, ListBox as E, ListBoxItem as P } from "react-aria-components";
1
+ import { jsx as o, jsxs as e } from "react/jsx-runtime";
2
+ import { ComboBox as A, Input as F, Button as j, Popover as D, ListBox as E, ListBoxItem as P } from "react-aria-components";
3
3
  import { useTranslation as z } from "react-i18next";
4
4
  import { useMemo as H } from "react";
5
5
  import d from "classnames";
@@ -10,14 +10,14 @@ import { useTheme as U } from "../../../../contexts/ThemeProvider/useTheme.js";
10
10
  /* empty css */
11
11
  import _ from "../../../../assets/icons/alert-circle.svg.js";
12
12
  import $ from "../../../../assets/icons/caret-down.svg.js";
13
- const oo = ({
13
+ const rr = ({
14
14
  className: p,
15
15
  description: i,
16
16
  errorMessage: m,
17
17
  id: f,
18
- isDisabled: h,
18
+ isDisabled: u,
19
19
  isInvalid: a,
20
- isRequired: u,
20
+ isRequired: h,
21
21
  label: s,
22
22
  onChange: x,
23
23
  onBlur: B,
@@ -25,57 +25,58 @@ const oo = ({
25
25
  placeholder: b,
26
26
  value: c,
27
27
  inputRef: C,
28
- shouldVisuallyHideLabel: I,
28
+ shouldVisuallyHideLabel: g,
29
29
  name: v,
30
- ...N
30
+ ...I
31
31
  }) => {
32
- const { t: S } = z(), { inputId: l, errorMessageId: g, descriptionId: y, ariaDescribedBy: L } = K({
32
+ const { t: N } = z(), { inputId: l, errorMessageId: S, descriptionId: y, ariaDescribedBy: L } = K({
33
33
  inputId: f,
34
34
  errorMessage: m,
35
35
  description: i
36
- }), { container: w } = U(), A = H(() => n.map((o) => ({ name: o.label, id: o.value })), [n]);
37
- return /* @__PURE__ */ r(
36
+ }), { container: T } = U(), w = H(() => n.map((r) => ({ name: r.label, id: r.value })), [n]);
37
+ return /* @__PURE__ */ o(
38
38
  M,
39
39
  {
40
40
  label: s,
41
41
  htmlFor: l,
42
42
  errorMessage: m,
43
- errorMessageId: g,
43
+ errorMessageId: S,
44
44
  descriptionId: y,
45
- isRequired: u,
45
+ isRequired: h,
46
46
  description: i,
47
- shouldVisuallyHideLabel: I,
47
+ shouldVisuallyHideLabel: g,
48
48
  className: d(t.root, p),
49
49
  withErrorIcon: !1,
50
50
  children: /* @__PURE__ */ e(
51
- F,
51
+ A,
52
52
  {
53
53
  "aria-label": s,
54
54
  "aria-describedby": L,
55
55
  className: "react-aria-ComboBox-root",
56
- isDisabled: h,
56
+ isDisabled: u,
57
57
  isInvalid: a,
58
- onSelectionChange: (o) => {
59
- o && x?.(o.toString());
58
+ menuTrigger: "focus",
59
+ onSelectionChange: (r) => {
60
+ r && x?.(r.toString());
60
61
  },
61
62
  id: l,
62
63
  selectedKey: c || void 0,
63
64
  name: v,
64
65
  children: [
65
- /* @__PURE__ */ e(T, { children: [
66
- /* @__PURE__ */ r(j, { ref: C, placeholder: b, onBlur: B, ...N }),
67
- /* @__PURE__ */ e("div", { "aria-hidden": "true", className: t.icons, children: [
68
- a && /* @__PURE__ */ r(_, { fontSize: 16 }),
69
- /* @__PURE__ */ r($, { title: S("icons.selectArrow") })
70
- ] })
66
+ /* @__PURE__ */ e("div", { children: [
67
+ /* @__PURE__ */ o(F, { ref: C, placeholder: b, onBlur: B, ...I }),
68
+ /* @__PURE__ */ o(j, { children: /* @__PURE__ */ e("div", { "aria-hidden": "true", className: t.icons, children: [
69
+ a && /* @__PURE__ */ o(_, { fontSize: 16 }),
70
+ /* @__PURE__ */ o($, { title: N("icons.selectArrow") })
71
+ ] }) })
71
72
  ] }),
72
- /* @__PURE__ */ r(
73
+ /* @__PURE__ */ o(
73
74
  D,
74
75
  {
75
76
  className: d(t.popover, "react-aria-Popover"),
76
- UNSTABLE_portalContainer: w.current,
77
+ UNSTABLE_portalContainer: T.current,
77
78
  maxHeight: 320,
78
- children: /* @__PURE__ */ r(E, { items: A, children: (o) => /* @__PURE__ */ r(P, { children: o.name }, o.id) })
79
+ children: /* @__PURE__ */ o(E, { items: w, children: (r) => /* @__PURE__ */ o(P, { children: r.name }, r.id) })
79
80
  }
80
81
  )
81
82
  ]
@@ -85,6 +86,6 @@ const oo = ({
85
86
  );
86
87
  };
87
88
  export {
88
- oo as ComboBox
89
+ rr as ComboBox
89
90
  };
90
91
  //# sourceMappingURL=ComboBox.js.map