@gusto/embedded-react-sdk 0.16.0 → 0.18.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 (387) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/components/Base/Base.js +50 -65
  3. package/dist/components/Base/Base.js.map +1 -1
  4. package/dist/components/Base/useBase.d.ts +2 -5
  5. package/dist/components/Base/useBase.js.map +1 -1
  6. package/dist/components/Common/EmptyData/EmptyData.js +10 -10
  7. package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
  8. package/dist/components/Common/EmptyData/EmptyData.module.scss.js +5 -3
  9. package/dist/components/Common/EmptyData/EmptyData.module.scss.js.map +1 -1
  10. package/dist/components/Common/FieldDescription/FieldDescription.module.scss.js +1 -1
  11. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +41 -33
  12. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
  13. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js +1 -1
  14. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
  15. package/dist/components/Common/SignatureForm/SignatureForm.js +4 -6
  16. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  17. package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -12
  18. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  19. package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -8
  20. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  21. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  22. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +32 -18
  23. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js.map +1 -1
  24. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.module.scss.js +12 -12
  25. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +14 -0
  26. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js +8 -0
  27. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js.map +1 -0
  28. package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +8 -8
  29. package/dist/components/Common/UI/DescriptionList/DescriptionList.d.ts +2 -0
  30. package/dist/components/Common/UI/DescriptionList/DescriptionList.js +16 -0
  31. package/dist/components/Common/UI/DescriptionList/DescriptionList.js.map +1 -0
  32. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +10 -0
  33. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js.map +1 -0
  34. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +10 -0
  35. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js +5 -0
  36. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -0
  37. package/dist/components/Common/UI/DescriptionList/index.d.ts +3 -0
  38. package/dist/components/Common/UI/Dialog/Dialog.js +50 -76
  39. package/dist/components/Common/UI/Dialog/Dialog.js.map +1 -1
  40. package/dist/components/Common/UI/Dialog/Dialog.module.scss.js +8 -14
  41. package/dist/components/Common/UI/Dialog/Dialog.module.scss.js.map +1 -1
  42. package/dist/components/Common/UI/Link/LinkTypes.d.ts +7 -6
  43. package/dist/components/Common/UI/Modal/Modal.d.ts +2 -0
  44. package/dist/components/Common/UI/Modal/Modal.js +90 -0
  45. package/dist/components/Common/UI/Modal/Modal.js.map +1 -0
  46. package/dist/components/Common/UI/Modal/Modal.module.scss.js +26 -0
  47. package/dist/components/Common/UI/Modal/Modal.module.scss.js.map +1 -0
  48. package/dist/components/Common/UI/Modal/ModalTypes.d.ts +34 -0
  49. package/dist/components/Common/UI/Modal/ModalTypes.js +8 -0
  50. package/dist/components/Common/UI/Modal/ModalTypes.js.map +1 -0
  51. package/dist/components/Common/UI/Modal/index.d.ts +3 -0
  52. package/dist/components/Common/UI/Tabs/Tabs.d.ts +0 -5
  53. package/dist/components/Common/UI/Tabs/Tabs.js +45 -16
  54. package/dist/components/Common/UI/Tabs/Tabs.js.map +1 -1
  55. package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +8 -4
  56. package/dist/components/Common/UI/Tabs/Tabs.module.scss.js.map +1 -1
  57. package/dist/components/Common/UI/Tabs/TabsTypes.d.ts +7 -0
  58. package/dist/components/Common/index.d.ts +0 -1
  59. package/dist/components/Company/AssignSignatory/AssignSignatory.js +6 -8
  60. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  61. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -7
  62. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  63. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -9
  64. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  65. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +2 -3
  66. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  67. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +2 -3
  68. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  69. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -6
  70. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  71. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -7
  72. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  73. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -6
  74. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  75. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
  76. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  77. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -6
  78. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  79. package/dist/components/Company/AssignSignatory/TitleSelect.js +7 -8
  80. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  81. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -8
  82. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  83. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +2 -3
  84. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  85. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -8
  86. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  87. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -6
  88. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  89. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js +22 -17
  90. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js.map +1 -1
  91. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +6 -7
  92. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  93. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
  94. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  95. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
  96. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  97. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -6
  98. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  99. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -13
  100. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  101. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -6
  102. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  103. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +6 -8
  104. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  105. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -6
  106. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  107. package/dist/components/Company/FederalTaxes/Actions.js +6 -7
  108. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  109. package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -17
  110. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  111. package/dist/components/Company/FederalTaxes/Form.js +2 -3
  112. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  113. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -11
  114. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  115. package/dist/components/Company/Industry/Actions.js +5 -6
  116. package/dist/components/Company/Industry/Actions.js.map +1 -1
  117. package/dist/components/Company/Industry/Context.js +7 -9
  118. package/dist/components/Company/Industry/Context.js.map +1 -1
  119. package/dist/components/Company/Industry/Edit.js +10 -11
  120. package/dist/components/Company/Industry/Edit.js.map +1 -1
  121. package/dist/components/Company/Locations/LocationForm/Actions.js +2 -3
  122. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  123. package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
  124. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  125. package/dist/components/Company/Locations/LocationForm/LocationForm.js +9 -11
  126. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  127. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -6
  128. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  129. package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
  130. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  131. package/dist/components/Company/Locations/LocationsList/List.js +2 -3
  132. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  133. package/dist/components/Company/Locations/LocationsList/LocationsList.js +12 -14
  134. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  135. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -6
  136. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  137. package/dist/components/Company/OnboardingOverview/Completed.js +5 -6
  138. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  139. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
  140. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  141. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -4
  142. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  143. package/dist/components/Company/OnboardingOverview/context.js +4 -6
  144. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  145. package/dist/components/Company/PaySchedule/PaySchedule.js +39 -41
  146. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  147. package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -11
  148. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  149. package/dist/components/Company/PaySchedule/_parts/Edit.js +35 -37
  150. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  151. package/dist/components/Company/PaySchedule/_parts/Head.js +18 -19
  152. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  153. package/dist/components/Company/PaySchedule/_parts/List.js +5 -6
  154. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  155. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -8
  156. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  157. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -6
  158. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  159. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -6
  160. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  161. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -7
  162. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  163. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -6
  164. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  165. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -6
  166. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  167. package/dist/components/Contractor/Address/Address.js +3 -5
  168. package/dist/components/Contractor/Address/Address.js.map +1 -1
  169. package/dist/components/Contractor/Address/Form.js +2 -3
  170. package/dist/components/Contractor/Address/Form.js.map +1 -1
  171. package/dist/components/Contractor/Address/useAddress.js +6 -8
  172. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  173. package/dist/components/Contractor/ContractorList/index.js +15 -16
  174. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  175. package/dist/components/Contractor/NewHireReport/NewHireReport.js +13 -14
  176. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  177. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -3
  178. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  179. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
  180. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  181. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
  182. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  183. package/dist/components/Contractor/Profile/useContractorProfile.js +3 -4
  184. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  185. package/dist/components/Contractor/Submit/Submit.js +2 -3
  186. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  187. package/dist/components/Employee/Compensation/Actions.js +4 -5
  188. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  189. package/dist/components/Employee/Compensation/Edit.js +10 -9
  190. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  191. package/dist/components/Employee/Compensation/List.js +5 -6
  192. package/dist/components/Employee/Compensation/List.js.map +1 -1
  193. package/dist/components/Employee/Deductions/DeductionsComponents.js +1 -1
  194. package/dist/components/Employee/Deductions/DeductionsComponents.js.map +1 -1
  195. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +6 -6
  196. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +2 -2
  197. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +2 -3
  198. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
  199. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +44 -40
  200. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  201. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +2 -3
  202. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -1
  203. package/dist/components/Employee/Deductions/useDeductions.d.ts +2 -2
  204. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +4 -5
  205. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  206. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +9 -11
  207. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  208. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
  209. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  210. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -6
  211. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  212. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +11 -13
  213. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  214. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -6
  215. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  216. package/dist/components/Employee/EmployeeList/Actions.js +4 -5
  217. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  218. package/dist/components/Employee/EmployeeList/Head.js +2 -3
  219. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  220. package/dist/components/Employee/EmployeeList/List.js +9 -10
  221. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  222. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -6
  223. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  224. package/dist/components/Employee/FederalTaxes/Actions.js +2 -3
  225. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  226. package/dist/components/Employee/FederalTaxes/FederalForm.js +5 -6
  227. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  228. package/dist/components/Employee/FederalTaxes/FederalTaxes.js +8 -8
  229. package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
  230. package/dist/components/Employee/FederalTaxes/Head.js +6 -6
  231. package/dist/components/Employee/FederalTaxes/Head.js.map +1 -1
  232. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -6
  233. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  234. package/dist/components/Employee/Landing/Landing.js +6 -7
  235. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  236. package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
  237. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  238. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -5
  239. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  240. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -4
  241. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  242. package/dist/components/Employee/PaymentMethod/PaymentMethod.d.ts +1 -0
  243. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +79 -78
  244. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  245. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +12 -13
  246. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  247. package/dist/components/Employee/PaymentMethod/Split.js +2 -3
  248. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  249. package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +1 -0
  250. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -8
  251. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  252. package/dist/components/Employee/Profile/Actions.js +6 -7
  253. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  254. package/dist/components/Employee/Profile/AdminPersonalDetails.js +38 -35
  255. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  256. package/dist/components/Employee/Profile/HomeAddress.d.ts +52 -0
  257. package/dist/components/Employee/Profile/HomeAddress.js +63 -44
  258. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  259. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +20 -21
  260. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  261. package/dist/components/Employee/Profile/Profile.js +150 -143
  262. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  263. package/dist/components/Employee/Profile/useProfile.d.ts +1 -0
  264. package/dist/components/Employee/Profile/useProfile.js +4 -6
  265. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  266. package/dist/components/Employee/StateTaxes/Actions.js +6 -7
  267. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  268. package/dist/components/Employee/StateTaxes/StateTaxes.js +4 -4
  269. package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
  270. package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -6
  271. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  272. package/dist/components/Employee/Taxes/Actions.js +7 -8
  273. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  274. package/dist/components/Employee/Taxes/FederalForm.js +5 -6
  275. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  276. package/dist/components/Employee/Taxes/FederalHead.js +6 -6
  277. package/dist/components/Employee/Taxes/FederalHead.js.map +1 -1
  278. package/dist/components/Employee/Taxes/Taxes.js +5 -5
  279. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  280. package/dist/components/Employee/Taxes/useTaxes.js +4 -6
  281. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  282. package/dist/components/Flow/Flow.js +9 -10
  283. package/dist/components/Flow/Flow.js.map +1 -1
  284. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +9 -10
  285. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  286. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +101 -90
  287. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  288. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +5 -1
  289. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +135 -133
  290. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  291. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js +5 -3
  292. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js.map +1 -1
  293. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +127 -119
  294. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  295. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +5 -6
  296. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  297. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -1
  298. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +22 -22
  299. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  300. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +40 -27
  301. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  302. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +50 -72
  303. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  304. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +2 -3
  305. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  306. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +1 -1
  307. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +4 -4
  308. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  309. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +20 -20
  310. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
  311. package/dist/components/Payroll/PayrollList/PayrollList.js +24 -21
  312. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  313. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +3 -9
  314. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +117 -128
  315. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  316. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +6 -6
  317. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +89 -78
  318. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  319. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +195 -214
  320. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  321. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.module.scss.js +8 -0
  322. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.module.scss.js.map +1 -0
  323. package/dist/components/Payroll/usePreparedPayrollData.js +8 -10
  324. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  325. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +49 -45
  326. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  327. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +2 -0
  328. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +4 -0
  329. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  330. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +5 -7
  331. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  332. package/dist/helpers/apiErrorToList.d.ts +7 -0
  333. package/dist/helpers/apiErrorToList.js +23 -0
  334. package/dist/helpers/apiErrorToList.js.map +1 -0
  335. package/dist/helpers/breadcrumbHelpers.js +30 -30
  336. package/dist/helpers/breadcrumbHelpers.js.map +1 -1
  337. package/dist/helpers/dateFormatting.d.ts +18 -6
  338. package/dist/helpers/dateFormatting.js +93 -24
  339. package/dist/helpers/dateFormatting.js.map +1 -1
  340. package/dist/helpers/formattedStrings.js +11 -12
  341. package/dist/helpers/formattedStrings.js.map +1 -1
  342. package/dist/hooks/useAsyncError.js.map +1 -0
  343. package/dist/hooks/useDateFormatter.d.ts +19 -0
  344. package/dist/hooks/useDateFormatter.js +24 -0
  345. package/dist/hooks/useDateFormatter.js.map +1 -0
  346. package/dist/hooks/useMenu.js.map +1 -0
  347. package/dist/{components/Common/hooks → hooks}/useNumberFormatter.js +1 -1
  348. package/dist/hooks/useNumberFormatter.js.map +1 -0
  349. package/dist/hooks/useOverflowDetection/index.d.ts +3 -0
  350. package/dist/hooks/useOverflowDetection/useOverflowDetection.d.ts +7 -0
  351. package/dist/hooks/useOverflowDetection/useOverflowDetection.js +28 -0
  352. package/dist/hooks/useOverflowDetection/useOverflowDetection.js.map +1 -0
  353. package/dist/i18n/en/Company.PaySchedule.json.js +9 -9
  354. package/dist/i18n/en/Employee.Compensation.json.js +15 -15
  355. package/dist/i18n/en/Employee.Deductions.json.js +131 -105
  356. package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
  357. package/dist/i18n/en/Employee.FederalTaxes.json.js +9 -9
  358. package/dist/i18n/en/Employee.HomeAddress.json.js +1 -1
  359. package/dist/i18n/en/Employee.PaymentMethod.json.js +70 -66
  360. package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
  361. package/dist/i18n/en/Employee.Taxes.json.js +25 -27
  362. package/dist/i18n/en/Employee.Taxes.json.js.map +1 -1
  363. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +17 -17
  364. package/dist/i18n/en/Payroll.PayrollOverview.json.js +23 -23
  365. package/dist/i18n/en/common.json.d.ts +2 -1
  366. package/dist/i18n/en/common.json.js +4 -4
  367. package/dist/style.css +1 -1
  368. package/dist/types/i18next.d.ts +20 -1
  369. package/package.json +10 -10
  370. package/dist/components/Common/hooks/useAsyncError.js.map +0 -1
  371. package/dist/components/Common/hooks/useMenu.js.map +0 -1
  372. package/dist/components/Common/hooks/useNumberFormatter.js.map +0 -1
  373. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +0 -221
  374. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +0 -1
  375. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +0 -8
  376. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +0 -1
  377. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +0 -132
  378. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +0 -1
  379. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +0 -14
  380. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +0 -1
  381. package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.js +0 -98
  382. package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.js.map +0 -1
  383. /package/dist/{components/Common/hooks → hooks}/useAsyncError.d.ts +0 -0
  384. /package/dist/{components/Common/hooks → hooks}/useAsyncError.js +0 -0
  385. /package/dist/{components/Common/hooks → hooks}/useMenu.d.ts +0 -0
  386. /package/dist/{components/Common/hooks → hooks}/useMenu.js +0 -0
  387. /package/dist/{components/Common/hooks → hooks}/useNumberFormatter.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,59 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.18.0
4
+
5
+ ### Features & Enhancements
6
+
7
+ - Add Modal component
8
+ - Update Tabs to allow for responsive behavior
9
+ - Update to provide all profile fields on admin review
10
+ - Updates UI for deductions v2
11
+ - Update autogenerated component adapter props docs
12
+ - Add error handling for payroll processing
13
+
14
+ ### Fixes
15
+
16
+ - Update to restore translations in federal taxes
17
+ - Fix responsive layouts in payroll components
18
+ - Fix clearing alerts when leaving overview step
19
+
20
+ ### Refactoring
21
+
22
+ - Normalize date formatting and consolidate hooks into single location
23
+
24
+ ### Chores & Maintenance
25
+
26
+ - Bump react-hook-form from 7.65.0 to 7.66.0
27
+ - Bump typescript-eslint from 8.46.2 to 8.46.3
28
+ - Bump @ladle/react from 5.1.0 to 5.1.1
29
+ - Bump react-i18next from 16.2.3 to 16.2.4
30
+ - Bump eslint from 9.39.0 to 9.39.1
31
+ - Bump @eslint/js from 9.39.0 to 9.39.1
32
+ - Bump eslint from 9.38.0 to 9.39.0
33
+ - Bump sass-embedded from 1.93.2 to 1.93.3
34
+ - Bump globals from 16.4.0 to 16.5.0
35
+ - Bump @eslint/js from 9.38.0 to 9.39.0
36
+ - Bump react-i18next from 16.2.1 to 16.2.3
37
+
38
+ ## 0.17.0
39
+
40
+ ### Features & Enhancements
41
+
42
+ - Add payroll deadline alert to payroll configuration
43
+ - Enable responsive breadcrumb behavior
44
+ - Add DescriptionList component with flexible term/description support
45
+ - Update payment method copy for self onboarding
46
+
47
+ ### Fixes
48
+
49
+ - Remove base image styles in favor of emptydata styles
50
+ - Remove unused style from base.scss
51
+
52
+ ### Chores & Maintenance
53
+
54
+ - Bump react-i18next from 16.1.0 to 16.2.1
55
+ - Bump lint-staged from 16.2.5 to 16.2.6
56
+
3
57
  ## 0.16.0
4
58
 
5
59
  ### Features & Enhancements
@@ -1,81 +1,66 @@
1
- import { jsx as o, jsxs as y } from "react/jsx-runtime";
2
- import { useState as E, useCallback as g, Suspense as R } from "react";
3
- import { ErrorBoundary as S } from "react-error-boundary";
4
- import { useTranslation as B } from "react-i18next";
5
- import { APIError as C } from "@gusto/embedded-api/models/errors/apierror";
1
+ import { jsx as o, jsxs as p } from "react/jsx-runtime";
2
+ import { useState as f, useCallback as u, Suspense as R } from "react";
3
+ import { ErrorBoundary as B } from "react-error-boundary";
4
+ import { useTranslation as S } from "react-i18next";
5
+ import { APIError as E } from "@gusto/embedded-api/models/errors/apierror";
6
6
  import { SDKValidationError as h } from "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
- import { UnprocessableEntityErrorObject as k } from "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
- import { QueryErrorResetBoundary as T } from "@tanstack/react-query";
9
- import { FadeIn as _ } from "../Common/FadeIn/FadeIn.js";
10
- import { BaseContext as j } from "./useBase.js";
11
- import { componentEvents as F } from "../../shared/constants.js";
12
- import { useAsyncError as K } from "../Common/hooks/useAsyncError.js";
13
- import "classnames";
14
- import { InternalError as P } from "../Common/InternalError/InternalError.js";
15
- import { snakeCaseToCamelCase as w } from "../../helpers/formattedStrings.js";
16
- import { useComponentContext as M } from "../../contexts/ComponentAdapter/useComponentContext.js";
17
- import { useLoadingIndicator as O } from "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
18
- const U = (t) => t.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.message }, n.key) : null), x = (t, n) => {
19
- const m = n ? n + "." : "";
20
- if (t.category === "invalid_attribute_value" || t.category === "invalid_operation")
21
- return [
22
- {
23
- key: w(m + t.errorKey),
24
- message: t.message ?? ""
25
- }
26
- ];
27
- if (t.category === "nested_errors" && t.errors !== void 0) {
28
- let a = "";
29
- return t.metadata?.key && typeof t.metadata.key == "string" ? a = t.metadata.key : t.metadata?.state && typeof t.metadata.state == "string" ? a = t.metadata.state : t.errorKey && (a = t.errorKey), t.errors.flatMap((r) => x(r, m + a));
30
- }
31
- return [];
32
- }, ot = ({
33
- children: t,
34
- FallbackComponent: n = P,
35
- LoaderComponent: m,
36
- onEvent: a
7
+ import { UnprocessableEntityErrorObject as y } from "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
+ import { QueryErrorResetBoundary as j } from "@tanstack/react-query";
9
+ import { FadeIn as T } from "../Common/FadeIn/FadeIn.js";
10
+ import { BaseContext as k } from "./useBase.js";
11
+ import { componentEvents as v } from "../../shared/constants.js";
12
+ import { InternalError as w } from "../Common/InternalError/InternalError.js";
13
+ import { useComponentContext as O } from "../../contexts/ComponentAdapter/useComponentContext.js";
14
+ import { useLoadingIndicator as P } from "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
15
+ import { renderErrorList as U, getFieldErrors as D } from "../../helpers/apiErrorToList.js";
16
+ import { useAsyncError as H } from "../../hooks/useAsyncError.js";
17
+ const or = ({
18
+ children: C,
19
+ FallbackComponent: x = w,
20
+ LoaderComponent: L,
21
+ onEvent: l
37
22
  }) => {
38
- const [r, l] = E(null), [c, f] = E(null), p = K(), { t: b } = B(), d = M(), { LoadingIndicator: I } = O(), u = m ?? I, v = g((e) => {
39
- l(e), e || f(null);
40
- }, []), L = (e) => {
41
- l(e), e instanceof k && Array.isArray(e.errors) && f(e.errors.flatMap((s) => x(s)));
42
- }, A = g(
43
- async (e, s) => {
44
- l(null), f(null);
23
+ const [t, s] = f(null), [i, m] = f(null), c = H(), { t: b } = S(), a = O(), { LoadingIndicator: I } = P(), d = L ?? I, g = u((r) => {
24
+ s(r), r || m(null);
25
+ }, []), A = (r) => {
26
+ s(r), r instanceof y && Array.isArray(r.errors) && m(r.errors.flatMap((e) => D(e)));
27
+ }, F = u(
28
+ async (r, e) => {
29
+ s(null), m(null);
45
30
  try {
46
- await s(e);
47
- } catch (i) {
48
- i instanceof C || i instanceof h || i instanceof k ? L(i) : p(i);
31
+ await e(r);
32
+ } catch (n) {
33
+ n instanceof E || n instanceof h || n instanceof y ? A(n) : c(n);
49
34
  }
50
35
  },
51
- [l, p]
36
+ [s, c]
52
37
  );
53
38
  return /* @__PURE__ */ o(
54
- j.Provider,
39
+ k.Provider,
55
40
  {
56
41
  value: {
57
- fieldErrors: c,
58
- setError: v,
59
- onEvent: a,
60
- throwError: p,
61
- baseSubmitHandler: A,
62
- LoadingIndicator: u
42
+ fieldErrors: i,
43
+ setError: g,
44
+ onEvent: l,
45
+ throwError: c,
46
+ baseSubmitHandler: F,
47
+ LoadingIndicator: d
63
48
  },
64
- children: /* @__PURE__ */ o(T, { children: ({ reset: e }) => /* @__PURE__ */ y(
65
- S,
49
+ children: /* @__PURE__ */ o(j, { children: ({ reset: r }) => /* @__PURE__ */ p(
50
+ B,
66
51
  {
67
- FallbackComponent: n,
68
- onReset: e,
69
- onError: (s) => {
70
- a(F.ERROR, s);
52
+ FallbackComponent: x,
53
+ onReset: r,
54
+ onError: (e) => {
55
+ l(v.ERROR, e);
71
56
  },
72
57
  children: [
73
- (r || c) && /* @__PURE__ */ y(d.Alert, { label: b("status.errorEncountered"), status: "error", children: [
74
- c && /* @__PURE__ */ o(d.UnorderedList, { items: U(c) }),
75
- r && r instanceof C && /* @__PURE__ */ o(d.Text, { children: r.message }),
76
- r && r instanceof h && /* @__PURE__ */ o(d.Text, { as: "pre", children: r.pretty() })
58
+ (t || i) && /* @__PURE__ */ p(a.Alert, { label: b("status.errorEncountered"), status: "error", children: [
59
+ i && /* @__PURE__ */ o(a.UnorderedList, { items: U(i) }),
60
+ t && t instanceof E && /* @__PURE__ */ o(a.Text, { children: t.message }),
61
+ t && t instanceof h && /* @__PURE__ */ o(a.Text, { as: "pre", children: t.pretty() })
77
62
  ] }),
78
- /* @__PURE__ */ o(R, { fallback: /* @__PURE__ */ o(u, {}), children: /* @__PURE__ */ o(_, { children: t }) })
63
+ /* @__PURE__ */ o(R, { fallback: /* @__PURE__ */ o(d, {}), children: /* @__PURE__ */ o(T, { children: C }) })
79
64
  ]
80
65
  }
81
66
  ) })
@@ -83,6 +68,6 @@ const U = (t) => t.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.
83
68
  );
84
69
  };
85
70
  export {
86
- ot as BaseComponent
71
+ or as BaseComponent
87
72
  };
88
73
  //# sourceMappingURL=Base.js.map
@@ -1 +1 @@
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 { QueryErrorResetBoundary } from '@tanstack/react-query'\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, useAsyncError } from '@/components/Common'\nimport { snakeCaseToCamelCase } from '@/helpers/formattedStrings'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport type { ResourceDictionary, Resources } from '@/types/Helpers'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport type { LoadingIndicatorContextProps } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\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?: LoadingIndicatorContextProps['LoadingIndicator']\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: LoadingIndicatorFromProps,\n onEvent,\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 { LoadingIndicator: LoadingIndicatorFromContext } = useLoadingIndicator()\n\n const LoaderComponent = LoadingIndicatorFromProps ?? LoadingIndicatorFromContext\n\n // Enhanced setError that also clears fieldErrors when error is cleared\n const setErrorWithFieldsClear = useCallback((error: KnownErrors | null) => {\n setError(error)\n if (!error) {\n setFieldErrors(null)\n }\n }, [])\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: setErrorWithFieldsClear,\n onEvent,\n throwError,\n baseSubmitHandler,\n LoadingIndicator: LoaderComponent,\n }}\n >\n <QueryErrorResetBoundary>\n {({ reset: resetQueries }) => (\n <ErrorBoundary\n FallbackComponent={FallbackComponent}\n onReset={resetQueries}\n onError={err => {\n onEvent(componentEvents.ERROR, err)\n }}\n >\n {(error || fieldErrors) && (\n <Components.Alert label={t('status.errorEncountered')} status=\"error\">\n {fieldErrors && <Components.UnorderedList items={renderErrorList(fieldErrors)} />}\n {error && error instanceof APIError && (\n <Components.Text>{error.message}</Components.Text>\n )}\n {error && error instanceof SDKValidationError && (\n <Components.Text as=\"pre\">{error.pretty()}</Components.Text>\n )}\n </Components.Alert>\n )}\n <Suspense fallback={<LoaderComponent />}>\n <FadeIn>{children}</FadeIn>\n </Suspense>\n </ErrorBoundary>\n )}\n </QueryErrorResetBoundary>\n </BaseContext.Provider>\n )\n}\n"],"names":["renderErrorList","errorList","errorFromList","jsx","getFieldErrors","error","parentKey","keyPrefix","snakeCaseToCamelCase","keySuffix","err","BaseComponent","children","FallbackComponent","InternalError","LoadingIndicatorFromProps","onEvent","setError","useState","fieldErrors","setFieldErrors","throwError","useAsyncError","t","useTranslation","Components","useComponentContext","LoadingIndicatorFromContext","useLoadingIndicator","LoaderComponent","setErrorWithFieldsClear","useCallback","processError","UnprocessableEntityErrorObject","baseSubmitHandler","data","componentHandler","APIError","SDKValidationError","BaseContext","QueryErrorResetBoundary","resetQueries","jsxs","ErrorBoundary","componentEvents","Suspense","FadeIn"],"mappings":";;;;;;;;;;;;;;;;;AAoCA,MAAMA,IAAkB,CAACC,MAChBA,EAAU,IAAI,CAAAC,MACfA,EAAc,UACT,gBAAAC,EAAC,MAAA,EAA4B,UAAAD,EAAc,QAAA,GAAlCA,EAAc,GAA4B,IAErD,IACR,GAKGE,IAAiB,CACrBC,GACAC,MACuC;AACvC,QAAMC,IAAYD,IAAYA,IAAY,MAAM;AAChD,MAAID,EAAM,aAAa,6BAA6BA,EAAM,aAAa;AACrE,WAAO;AAAA,MACL;AAAA,QACE,KAAKG,EAAqBD,IAAYF,EAAM,QAAQ;AAAA,QACpD,SAASA,EAAM,WAAW;AAAA,MAAA;AAAA,IAC5B;AAGJ,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,EAC/E;AACA,SAAO,CAAA;AACT,GAIaE,KAAgB,CAAyD;AAAA,EACpF,UAAAC;AAAA,EACA,mBAAAC,IAAoBC;AAAA,EACpB,iBAAiBC;AAAA,EACjB,SAAAC;AACF,MAA4C;AAC1C,QAAM,CAACX,GAAOY,CAAQ,IAAIC,EAA6B,IAAI,GACrD,CAACC,GAAaC,CAAc,IAAIF,EAA8B,IAAI,GAClEG,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAaC,EAAA,GAEb,EAAE,kBAAkBC,EAAA,IAAgCC,EAAA,GAEpDC,IAAkBd,KAA6BY,GAG/CG,IAA0BC,EAAY,CAAC1B,MAA8B;AACzE,IAAAY,EAASZ,CAAK,GACTA,KACHe,EAAe,IAAI;AAAA,EAEvB,GAAG,CAAA,CAAE,GAECY,IAAe,CAAC3B,MAAuB;AAC3C,IAAAY,EAASZ,CAAK,GAEVA,aAAiB4B,KAAkC,MAAM,QAAQ5B,EAAM,MAAM,KAC/Ee,EAAef,EAAM,OAAO,QAAQ,OAAOD,EAAeM,CAAG,CAAC,CAAC;AAAA,EAEnE,GAEMwB,IAAoBH;AAAA,IACxB,OAAWI,GAASC,MAAuC;AACzD,MAAAnB,EAAS,IAAI,GACbG,EAAe,IAAI;AACnB,UAAI;AACF,cAAMgB,EAAiBD,CAAI;AAAA,MAC7B,SAASzB,GAAK;AACZ,QACEA,aAAe2B,KACf3B,aAAe4B,KACf5B,aAAeuB,IAEfD,EAAatB,CAAG,MACAA,CAAG;AAAA,MACvB;AAAA,IACF;AAAA,IACA,CAACO,GAAUI,CAAU;AAAA,EAAA;AAGvB,SACE,gBAAAlB;AAAA,IAACoC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,aAAApB;AAAA,QACA,UAAUW;AAAA,QACV,SAAAd;AAAA,QACA,YAAAK;AAAA,QACA,mBAAAa;AAAA,QACA,kBAAkBL;AAAA,MAAA;AAAA,MAGpB,4BAACW,GAAA,EACE,UAAA,CAAC,EAAE,OAAOC,QACT,gBAAAC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,mBAAA9B;AAAA,UACA,SAAS4B;AAAA,UACT,SAAS,CAAA/B,MAAO;AACd,YAAAM,EAAQ4B,EAAgB,OAAOlC,CAAG;AAAA,UACpC;AAAA,UAEE,UAAA;AAAA,aAAAL,KAASc,MACT,gBAAAuB,EAACjB,EAAW,OAAX,EAAiB,OAAOF,EAAE,yBAAyB,GAAG,QAAO,SAC3D,UAAA;AAAA,cAAAJ,uBAAgBM,EAAW,eAAX,EAAyB,OAAOzB,EAAgBmB,CAAW,GAAG;AAAA,cAC9Ed,KAASA,aAAiBgC,KACzB,gBAAAlC,EAACsB,EAAW,MAAX,EAAiB,YAAM,SAAQ;AAAA,cAEjCpB,KAASA,aAAiBiC,KACzB,gBAAAnC,EAACsB,EAAW,MAAX,EAAgB,IAAG,OAAO,UAAApB,EAAM,OAAA,EAAO,CAAE;AAAA,YAAA,GAE9C;AAAA,YAEF,gBAAAF,EAAC0C,KAAS,UAAU,gBAAA1C,EAAC0B,KAAgB,GACnC,UAAA,gBAAA1B,EAAC2C,GAAA,EAAQ,UAAAlC,EAAA,CAAS,EAAA,CACpB;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA,EACF,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
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 { QueryErrorResetBoundary } from '@tanstack/react-query'\nimport type { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject'\nimport { FadeIn } from '../Common/FadeIn/FadeIn'\nimport { BaseContext, type KnownErrors, type OnEventType } from './useBase'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport { InternalError } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport type { ResourceDictionary, Resources } from '@/types/Helpers'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport type { LoadingIndicatorContextProps } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport { getFieldErrors, renderErrorList } from '@/helpers/apiErrorToList'\nimport { useAsyncError } from '@/hooks/useAsyncError'\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?: LoadingIndicatorContextProps['LoadingIndicator']\n onEvent: OnEventType<EventType, unknown>\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: LoadingIndicatorFromProps,\n onEvent,\n}: BaseComponentInterface<TResourceKey>) => {\n const [error, setError] = useState<KnownErrors | null>(null)\n const [fieldErrors, setFieldErrors] = useState<EntityErrorObject[] | null>(null)\n const throwError = useAsyncError()\n const { t } = useTranslation()\n const Components = useComponentContext()\n\n const { LoadingIndicator: LoadingIndicatorFromContext } = useLoadingIndicator()\n\n const LoaderComponent = LoadingIndicatorFromProps ?? LoadingIndicatorFromContext\n\n // Enhanced setError that also clears fieldErrors when error is cleared\n const setErrorWithFieldsClear = useCallback((error: KnownErrors | null) => {\n setError(error)\n if (!error) {\n setFieldErrors(null)\n }\n }, [])\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: setErrorWithFieldsClear,\n onEvent,\n throwError,\n baseSubmitHandler,\n LoadingIndicator: LoaderComponent,\n }}\n >\n <QueryErrorResetBoundary>\n {({ reset: resetQueries }) => (\n <ErrorBoundary\n FallbackComponent={FallbackComponent}\n onReset={resetQueries}\n onError={err => {\n onEvent(componentEvents.ERROR, err)\n }}\n >\n {(error || fieldErrors) && (\n <Components.Alert label={t('status.errorEncountered')} status=\"error\">\n {fieldErrors && <Components.UnorderedList items={renderErrorList(fieldErrors)} />}\n {error && error instanceof APIError && (\n <Components.Text>{error.message}</Components.Text>\n )}\n {error && error instanceof SDKValidationError && (\n <Components.Text as=\"pre\">{error.pretty()}</Components.Text>\n )}\n </Components.Alert>\n )}\n <Suspense fallback={<LoaderComponent />}>\n <FadeIn>{children}</FadeIn>\n </Suspense>\n </ErrorBoundary>\n )}\n </QueryErrorResetBoundary>\n </BaseContext.Provider>\n )\n}\n"],"names":["BaseComponent","children","FallbackComponent","InternalError","LoadingIndicatorFromProps","onEvent","error","setError","useState","fieldErrors","setFieldErrors","throwError","useAsyncError","t","useTranslation","Components","useComponentContext","LoadingIndicatorFromContext","useLoadingIndicator","LoaderComponent","setErrorWithFieldsClear","useCallback","processError","UnprocessableEntityErrorObject","getFieldErrors","err","baseSubmitHandler","data","componentHandler","APIError","SDKValidationError","jsx","BaseContext","QueryErrorResetBoundary","resetQueries","jsxs","ErrorBoundary","componentEvents","renderErrorList","Suspense","FadeIn"],"mappings":";;;;;;;;;;;;;;;;AAsCO,MAAMA,KAAgB,CAAyD;AAAA,EACpF,UAAAC;AAAA,EACA,mBAAAC,IAAoBC;AAAA,EACpB,iBAAiBC;AAAA,EACjB,SAAAC;AACF,MAA4C;AAC1C,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAA6B,IAAI,GACrD,CAACC,GAAaC,CAAc,IAAIF,EAAqC,IAAI,GACzEG,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAaC,EAAA,GAEb,EAAE,kBAAkBC,EAAA,IAAgCC,EAAA,GAEpDC,IAAkBf,KAA6Ba,GAG/CG,IAA0BC,EAAY,CAACf,MAA8B;AACzE,IAAAC,EAASD,CAAK,GACTA,KACHI,EAAe,IAAI;AAAA,EAEvB,GAAG,CAAA,CAAE,GAECY,IAAe,CAAChB,MAAuB;AAC3C,IAAAC,EAASD,CAAK,GAEVA,aAAiBiB,KAAkC,MAAM,QAAQjB,EAAM,MAAM,KAC/EI,EAAeJ,EAAM,OAAO,QAAQ,OAAOkB,EAAeC,CAAG,CAAC,CAAC;AAAA,EAEnE,GAEMC,IAAoBL;AAAA,IACxB,OAAWM,GAASC,MAAuC;AACzD,MAAArB,EAAS,IAAI,GACbG,EAAe,IAAI;AACnB,UAAI;AACF,cAAMkB,EAAiBD,CAAI;AAAA,MAC7B,SAASF,GAAK;AACZ,QACEA,aAAeI,KACfJ,aAAeK,KACfL,aAAeF,IAEfD,EAAaG,CAAG,MACAA,CAAG;AAAA,MACvB;AAAA,IACF;AAAA,IACA,CAAClB,GAAUI,CAAU;AAAA,EAAA;AAGvB,SACE,gBAAAoB;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,aAAAvB;AAAA,QACA,UAAUW;AAAA,QACV,SAAAf;AAAA,QACA,YAAAM;AAAA,QACA,mBAAAe;AAAA,QACA,kBAAkBP;AAAA,MAAA;AAAA,MAGpB,4BAACc,GAAA,EACE,UAAA,CAAC,EAAE,OAAOC,QACT,gBAAAC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,mBAAAlC;AAAA,UACA,SAASgC;AAAA,UACT,SAAS,CAAAT,MAAO;AACd,YAAApB,EAAQgC,EAAgB,OAAOZ,CAAG;AAAA,UACpC;AAAA,UAEE,UAAA;AAAA,aAAAnB,KAASG,MACT,gBAAA0B,EAACpB,EAAW,OAAX,EAAiB,OAAOF,EAAE,yBAAyB,GAAG,QAAO,SAC3D,UAAA;AAAA,cAAAJ,uBAAgBM,EAAW,eAAX,EAAyB,OAAOuB,EAAgB7B,CAAW,GAAG;AAAA,cAC9EH,KAASA,aAAiBuB,KACzB,gBAAAE,EAAChB,EAAW,MAAX,EAAiB,YAAM,SAAQ;AAAA,cAEjCT,KAASA,aAAiBwB,KACzB,gBAAAC,EAAChB,EAAW,MAAX,EAAgB,IAAG,OAAO,UAAAT,EAAM,OAAA,EAAO,CAAE;AAAA,YAAA,GAE9C;AAAA,YAEF,gBAAAyB,EAACQ,KAAS,UAAU,gBAAAR,EAACZ,KAAgB,GACnC,UAAA,gBAAAY,EAACS,GAAA,EAAQ,UAAAvC,EAAA,CAAS,EAAA,CACpB;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA,EACF,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,16 +1,13 @@
1
1
  import { APIError } from '@gusto/embedded-api/models/errors/apierror';
2
2
  import { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror';
3
3
  import { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject';
4
+ import { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject';
4
5
  import { EventType } from '../../shared/constants';
5
6
  import { LoadingIndicatorContextProps } from '../../contexts/LoadingIndicatorProvider/useLoadingIndicator';
6
7
  export type OnEventType<K, T> = (type: K, data?: T) => void;
7
8
  export type KnownErrors = APIError | SDKValidationError | UnprocessableEntityErrorObject;
8
- export type FieldError = {
9
- key: string;
10
- message: string;
11
- };
12
9
  interface BaseContextProps {
13
- fieldErrors: FieldError[] | null;
10
+ fieldErrors: Array<EntityErrorObject> | null;
14
11
  setError: (err: KnownErrors | null) => void;
15
12
  onEvent: OnEventType<EventType, unknown>;
16
13
  throwError: (e: unknown) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"useBase.js","sources":["../../../src/components/Base/useBase.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport type { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror'\nimport type { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject'\nimport { type EventType } from '@/shared/constants'\nimport type { LoadingIndicatorContextProps } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\n\nexport type OnEventType<K, T> = (type: K, data?: T) => void\n\nexport type KnownErrors = APIError | SDKValidationError | UnprocessableEntityErrorObject\n\nexport type FieldError = {\n key: string\n message: string\n}\n\ninterface BaseContextProps {\n fieldErrors: FieldError[] | null\n setError: (err: KnownErrors | null) => void\n onEvent: OnEventType<EventType, unknown>\n throwError: (e: unknown) => void\n baseSubmitHandler: <T>(\n formData: T,\n componentHandler: (payload: T) => Promise<void>,\n ) => Promise<void>\n LoadingIndicator: LoadingIndicatorContextProps['LoadingIndicator']\n}\n\nexport const BaseContext = createContext<BaseContextProps | undefined>(undefined)\n\nexport const useBase = () => {\n const context = useContext(BaseContext)\n if (!context) {\n throw new Error('useBase must be used within a BaseProvider')\n }\n return context\n}\n"],"names":["BaseContext","createContext","useBase","context","useContext"],"mappings":";AA4BO,MAAMA,IAAcC,EAA4C,MAAS,GAEnEC,IAAU,MAAM;AAC3B,QAAMC,IAAUC,EAAWJ,CAAW;AACtC,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,4CAA4C;AAE9D,SAAOA;AACT;"}
1
+ {"version":3,"file":"useBase.js","sources":["../../../src/components/Base/useBase.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport type { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror'\nimport type { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject'\nimport type { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject'\nimport { type EventType } from '@/shared/constants'\nimport type { LoadingIndicatorContextProps } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\n\nexport type OnEventType<K, T> = (type: K, data?: T) => void\n\nexport type KnownErrors = APIError | SDKValidationError | UnprocessableEntityErrorObject\n\ninterface BaseContextProps {\n fieldErrors: Array<EntityErrorObject> | null\n setError: (err: KnownErrors | null) => void\n onEvent: OnEventType<EventType, unknown>\n throwError: (e: unknown) => void\n baseSubmitHandler: <T>(\n formData: T,\n componentHandler: (payload: T) => Promise<void>,\n ) => Promise<void>\n LoadingIndicator: LoadingIndicatorContextProps['LoadingIndicator']\n}\n\nexport const BaseContext = createContext<BaseContextProps | undefined>(undefined)\n\nexport const useBase = () => {\n const context = useContext(BaseContext)\n if (!context) {\n throw new Error('useBase must be used within a BaseProvider')\n }\n return context\n}\n"],"names":["BaseContext","createContext","useBase","context","useContext"],"mappings":";AAwBO,MAAMA,IAAcC,EAA4C,MAAS,GAEnEC,IAAU,MAAM;AAC3B,QAAMC,IAAUC,EAAWJ,CAAW;AACtC,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,4CAA4C;AAE9D,SAAOA;AACT;"}
@@ -1,16 +1,16 @@
1
- import { jsx as t, jsxs as s } from "react/jsx-runtime";
2
- import { useTranslation as a } from "react-i18next";
1
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
+ import { useTranslation as r } from "react-i18next";
3
3
  import { Flex as l } from "../Flex/Flex.js";
4
- import n from "./EmptyData.module.scss.js";
4
+ import m from "./EmptyData.module.scss.js";
5
5
  import c from "../../../assets/icons/magnifyingGlass.png.js";
6
6
  import { useComponentContext as f } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
- function h({ title: m, description: o, children: e }) {
8
- const { t: r } = a(), { Text: i } = f();
9
- return /* @__PURE__ */ t("div", { className: n.emptyData, "data-testid": "emptydata", children: /* @__PURE__ */ s(l, { flexDirection: "column", alignItems: "center", children: [
10
- /* @__PURE__ */ t("img", { src: c, alt: r("icons.magnifyingGlass") }),
11
- m && /* @__PURE__ */ t(i, { weight: "bold", className: n.title, children: m }),
12
- o && /* @__PURE__ */ t(i, { children: o }),
13
- e && e
7
+ function h({ title: e, description: a, children: o }) {
8
+ const { t: i } = r(), { Text: s } = f();
9
+ return /* @__PURE__ */ t("div", { className: m.emptyData, "data-testid": "emptydata", children: /* @__PURE__ */ n(l, { flexDirection: "column", alignItems: "center", children: [
10
+ /* @__PURE__ */ t("img", { src: c, alt: i("icons.magnifyingGlass"), className: m.image }),
11
+ e && /* @__PURE__ */ t(s, { weight: "bold", className: m.title, children: e }),
12
+ a && /* @__PURE__ */ t(s, { children: a }),
13
+ o && o
14
14
  ] }) });
15
15
  }
16
16
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyData.js","sources":["../../../../src/components/Common/EmptyData/EmptyData.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { Flex } from '../Flex/Flex'\nimport styles from './EmptyData.module.scss'\nimport magnifyingGlass from '@/assets/icons/magnifyingGlass.png'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype EmptyDataProps = {\n title?: string\n description?: string\n children?: React.ReactNode\n}\nexport function EmptyData({ title, description, children }: EmptyDataProps) {\n const { t } = useTranslation()\n const { Text } = useComponentContext()\n return (\n <div className={styles.emptyData} data-testid=\"emptydata\">\n <Flex flexDirection=\"column\" alignItems=\"center\">\n <img src={magnifyingGlass} alt={t('icons.magnifyingGlass')} />\n {title && (\n <Text weight=\"bold\" className={styles.title}>\n {title}\n </Text>\n )}\n {description && <Text>{description}</Text>}\n {children && children}\n </Flex>\n </div>\n )\n}\n"],"names":["EmptyData","title","description","children","t","useTranslation","Text","useComponentContext","jsx","styles","jsxs","Flex","magnifyingGlass"],"mappings":";;;;;;AAWO,SAASA,EAAU,EAAE,OAAAC,GAAO,aAAAC,GAAa,UAAAC,KAA4B;AAC1E,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,EAAE,MAAAC,EAAA,IAASC,EAAA;AACjB,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAO,WAAW,eAAY,aAC5C,UAAA,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,YAAW,UACtC,UAAA;AAAA,IAAA,gBAAAH,EAAC,SAAI,KAAKI,GAAiB,KAAKR,EAAE,uBAAuB,GAAG;AAAA,IAC3DH,uBACEK,GAAA,EAAK,QAAO,QAAO,WAAWG,EAAO,OACnC,UAAAR,EAAA,CACH;AAAA,IAEDC,KAAe,gBAAAM,EAACF,GAAA,EAAM,UAAAJ,EAAA,CAAY;AAAA,IAClCC,KAAYA;AAAA,EAAA,EAAA,CACf,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"EmptyData.js","sources":["../../../../src/components/Common/EmptyData/EmptyData.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { Flex } from '../Flex/Flex'\nimport styles from './EmptyData.module.scss'\nimport magnifyingGlass from '@/assets/icons/magnifyingGlass.png'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype EmptyDataProps = {\n title?: string\n description?: string\n children?: React.ReactNode\n}\nexport function EmptyData({ title, description, children }: EmptyDataProps) {\n const { t } = useTranslation()\n const { Text } = useComponentContext()\n return (\n <div className={styles.emptyData} data-testid=\"emptydata\">\n <Flex flexDirection=\"column\" alignItems=\"center\">\n <img src={magnifyingGlass} alt={t('icons.magnifyingGlass')} className={styles.image} />\n {title && (\n <Text weight=\"bold\" className={styles.title}>\n {title}\n </Text>\n )}\n {description && <Text>{description}</Text>}\n {children && children}\n </Flex>\n </div>\n )\n}\n"],"names":["EmptyData","title","description","children","t","useTranslation","Text","useComponentContext","jsx","styles","jsxs","Flex","magnifyingGlass"],"mappings":";;;;;;AAWO,SAASA,EAAU,EAAE,OAAAC,GAAO,aAAAC,GAAa,UAAAC,KAA4B;AAC1E,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,EAAE,MAAAC,EAAA,IAASC,EAAA;AACjB,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAO,WAAW,eAAY,aAC5C,UAAA,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,YAAW,UACtC,UAAA;AAAA,IAAA,gBAAAH,EAAC,OAAA,EAAI,KAAKI,GAAiB,KAAKR,EAAE,uBAAuB,GAAG,WAAWK,EAAO,MAAA,CAAO;AAAA,IACpFR,uBACEK,GAAA,EAAK,QAAO,QAAO,WAAWG,EAAO,OACnC,UAAAR,EAAA,CACH;AAAA,IAEDC,KAAe,gBAAAM,EAACF,GAAA,EAAM,UAAAJ,EAAA,CAAY;AAAA,IAClCC,KAAYA;AAAA,EAAA,EAAA,CACf,EAAA,CACF;AAEJ;"}
@@ -1,10 +1,12 @@
1
- const t = "_emptyData_vn3oy_1", e = "_title_vn3oy_11", a = {
1
+ const t = "_emptyData_19niy_1", e = "_title_19niy_11", a = "_image_19niy_17", i = {
2
2
  emptyData: t,
3
- title: e
3
+ title: e,
4
+ image: a
4
5
  };
5
6
  export {
6
- a as default,
7
+ i as default,
7
8
  t as emptyData,
9
+ a as image,
8
10
  e as title
9
11
  };
10
12
  //# sourceMappingURL=EmptyData.module.scss.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyData.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"EmptyData.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1,4 +1,4 @@
1
- const o = "_root_11vye_1", t = {
1
+ const o = "_root_anlja_1", t = {
2
2
  root: o
3
3
  };
4
4
  export {
@@ -1,52 +1,60 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { useTranslation as f } from "react-i18next";
3
- import { useMemo as c } from "react";
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { useTranslation as h } from "react-i18next";
3
+ import { useRef as C, useMemo as d } from "react";
4
4
  import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
5
5
  import { componentEvents as B } from "../../../shared/constants.js";
6
- import { useI18n as C } from "../../../i18n/I18n.js";
7
- function V({
8
- breadcrumbs: o,
9
- currentBreadcrumbId: l,
10
- onEvent: a
6
+ import { useI18n as k } from "../../../i18n/I18n.js";
7
+ import { useLocale as g } from "../../../contexts/LocaleProvider/useLocale.js";
8
+ import { useContainerBreakpoints as R } from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
9
+ import { useDateFormatter as V } from "../../../hooks/useDateFormatter.js";
10
+ function Y({
11
+ breadcrumbs: a,
12
+ currentBreadcrumbId: f,
13
+ onEvent: s
11
14
  }) {
12
- const { Breadcrumbs: i } = u(), s = o.reduce(
13
- (e, n) => (n.namespace && e.push(n.namespace), e),
15
+ const i = C(null), m = R({ ref: i }).length === 1, { Breadcrumbs: c } = u(), { locale: v } = g(), r = V(), l = a.reduce(
16
+ (t, e) => (e.namespace && t.push(e.namespace), t),
14
17
  []
15
18
  );
16
- C(s);
17
- const { t } = f(s), p = c(
18
- () => o.map((e) => {
19
- const n = e.namespace ? t(e.label, {
20
- ns: e.namespace,
21
- defaultValue: e.label,
22
- ...e.variables
23
- }) : t(e.label, {
24
- defaultValue: e.label,
25
- ...e.variables
19
+ k(l);
20
+ const { t: o } = h(l), D = d(
21
+ () => a.map((t) => {
22
+ const e = t.variables ? {
23
+ ...t.variables,
24
+ startDate: typeof t.variables.startDate == "string" ? r.formatShortWithYear(t.variables.startDate) : t.variables.startDate,
25
+ endDate: typeof t.variables.endDate == "string" ? r.formatShortWithYear(t.variables.endDate) : t.variables.endDate
26
+ } : void 0, n = t.namespace ? o(t.label, {
27
+ ns: t.namespace,
28
+ defaultValue: t.label,
29
+ ...e
30
+ }) : o(t.label, {
31
+ defaultValue: t.label,
32
+ ...e
26
33
  });
27
34
  return {
28
- id: e.id,
35
+ id: t.id,
29
36
  label: n
30
37
  };
31
38
  }),
32
- [o, t]
39
+ [a, o, v]
33
40
  );
34
- return /* @__PURE__ */ r(
35
- i,
41
+ return /* @__PURE__ */ p("div", { ref: i, children: /* @__PURE__ */ p(
42
+ c,
36
43
  {
37
- breadcrumbs: p,
38
- currentBreadcrumbId: l,
39
- onClick: (e) => {
40
- const n = o.find((m) => m.id === e);
41
- a && n && a(B.BREADCRUMB_NAVIGATE, {
42
- key: e,
43
- onNavigate: n.onNavigate
44
+ isSmallContainer: m,
45
+ breadcrumbs: D,
46
+ currentBreadcrumbId: f,
47
+ onClick: (t) => {
48
+ const e = a.find((n) => n.id === t);
49
+ s && e && s(B.BREADCRUMB_NAVIGATE, {
50
+ key: t,
51
+ onNavigate: e.onNavigate
44
52
  });
45
53
  }
46
54
  }
47
- );
55
+ ) });
48
56
  }
49
57
  export {
50
- V as FlowBreadcrumbs
58
+ Y as FlowBreadcrumbs
51
59
  };
52
60
  //# sourceMappingURL=FlowBreadcrumbs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FlowBreadcrumbs.js","sources":["../../../../src/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.tsx"],"sourcesContent":["import type { CustomTypeOptions } from 'i18next'\nimport { useTranslation } from 'react-i18next'\nimport { useMemo } from 'react'\nimport type { FlowBreadcrumbsProps } from './FlowBreadcrumbsTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { componentEvents } from '@/shared/constants'\nimport { useI18n } from '@/i18n/I18n'\n\nexport function FlowBreadcrumbs({\n breadcrumbs,\n currentBreadcrumbId,\n onEvent,\n}: FlowBreadcrumbsProps) {\n const { Breadcrumbs } = useComponentContext()\n const namespaces = breadcrumbs.reduce<Array<keyof CustomTypeOptions['resources']>>(\n (acc, breadcrumb) => {\n if (breadcrumb.namespace) {\n acc.push(breadcrumb.namespace as keyof CustomTypeOptions['resources'])\n }\n return acc\n },\n [],\n )\n useI18n(namespaces)\n const { t } = useTranslation(namespaces)\n\n const parsedBreadcrumbs = useMemo(\n () =>\n breadcrumbs.map(breadcrumb => {\n const translatedLabel = breadcrumb.namespace\n ? (t(breadcrumb.label, {\n ns: breadcrumb.namespace,\n defaultValue: breadcrumb.label,\n ...breadcrumb.variables,\n } as never) as unknown as string)\n : (t(breadcrumb.label, {\n defaultValue: breadcrumb.label,\n ...breadcrumb.variables,\n } as never) as unknown as string)\n return {\n id: breadcrumb.id,\n label: translatedLabel,\n }\n }),\n [breadcrumbs, t],\n )\n\n const handleBreadcrumbClick = (breadcrumbId: string) => {\n const breadcrumb = breadcrumbs.find(breadcrumb => breadcrumb.id === breadcrumbId)\n if (onEvent && breadcrumb) {\n onEvent(componentEvents.BREADCRUMB_NAVIGATE, {\n key: breadcrumbId,\n onNavigate: breadcrumb.onNavigate,\n })\n }\n }\n\n return (\n <Breadcrumbs\n breadcrumbs={parsedBreadcrumbs}\n currentBreadcrumbId={currentBreadcrumbId}\n onClick={handleBreadcrumbClick}\n />\n )\n}\n"],"names":["FlowBreadcrumbs","breadcrumbs","currentBreadcrumbId","onEvent","Breadcrumbs","useComponentContext","namespaces","acc","breadcrumb","useI18n","useTranslation","parsedBreadcrumbs","useMemo","translatedLabel","jsx","breadcrumbId","componentEvents"],"mappings":";;;;;;AAQO,SAASA,EAAgB;AAAA,EAC9B,aAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,SAAAC;AACF,GAAyB;AACvB,QAAM,EAAE,aAAAC,EAAA,IAAgBC,EAAA,GAClBC,IAAaL,EAAY;AAAA,IAC7B,CAACM,GAAKC,OACAA,EAAW,aACbD,EAAI,KAAKC,EAAW,SAAiD,GAEhED;AAAA,IAET,CAAA;AAAA,EAAC;AAEH,EAAAE,EAAQH,CAAU;AAClB,QAAM,EAAE,EAAA,IAAMI,EAAeJ,CAAU,GAEjCK,IAAoBC;AAAA,IACxB,MACEX,EAAY,IAAI,CAAAO,MAAc;AAC5B,YAAMK,IAAkBL,EAAW,YAC9B,EAAEA,EAAW,OAAO;AAAA,QACnB,IAAIA,EAAW;AAAA,QACf,cAAcA,EAAW;AAAA,QACzB,GAAGA,EAAW;AAAA,MAAA,CACN,IACT,EAAEA,EAAW,OAAO;AAAA,QACnB,cAAcA,EAAW;AAAA,QACzB,GAAGA,EAAW;AAAA,MAAA,CACN;AACd,aAAO;AAAA,QACL,IAAIA,EAAW;AAAA,QACf,OAAOK;AAAA,MAAA;AAAA,IAEX,CAAC;AAAA,IACH,CAACZ,GAAa,CAAC;AAAA,EAAA;AAajB,SACE,gBAAAa;AAAA,IAACV;AAAA,IAAA;AAAA,MACC,aAAaO;AAAA,MACb,qBAAAT;AAAA,MACA,SAd0B,CAACa,MAAyB;AACtD,cAAMP,IAAaP,EAAY,KAAK,CAAAO,MAAcA,EAAW,OAAOO,CAAY;AAChF,QAAIZ,KAAWK,KACbL,EAAQa,EAAgB,qBAAqB;AAAA,UAC3C,KAAKD;AAAA,UACL,YAAYP,EAAW;AAAA,QAAA,CACxB;AAAA,MAEL;AAAA,IAMa;AAAA,EAAA;AAGf;"}
1
+ {"version":3,"file":"FlowBreadcrumbs.js","sources":["../../../../src/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.tsx"],"sourcesContent":["import type { CustomTypeOptions } from 'i18next'\nimport { useTranslation } from 'react-i18next'\nimport { useMemo, useRef } from 'react'\nimport type { FlowBreadcrumbsProps } from './FlowBreadcrumbsTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { componentEvents } from '@/shared/constants'\nimport { useI18n } from '@/i18n/I18n'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { useContainerBreakpoints } from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\nexport function FlowBreadcrumbs({\n breadcrumbs,\n currentBreadcrumbId,\n onEvent,\n}: FlowBreadcrumbsProps) {\n const breadcrumbContainerRef = useRef<HTMLDivElement | null>(null)\n const breakpoints = useContainerBreakpoints({ ref: breadcrumbContainerRef })\n // Small if we only contain the base breakpoint\n const isSmallContainer = breakpoints.length === 1\n\n const { Breadcrumbs } = useComponentContext()\n const { locale } = useLocale()\n const dateFormatter = useDateFormatter()\n const namespaces = breadcrumbs.reduce<Array<keyof CustomTypeOptions['resources']>>(\n (acc, breadcrumb) => {\n if (breadcrumb.namespace) {\n acc.push(breadcrumb.namespace as keyof CustomTypeOptions['resources'])\n }\n return acc\n },\n [],\n )\n useI18n(namespaces)\n const { t } = useTranslation(namespaces)\n const parsedBreadcrumbs = useMemo(\n () =>\n breadcrumbs.map(breadcrumb => {\n const formattedVariables = breadcrumb.variables\n ? {\n ...breadcrumb.variables,\n startDate:\n typeof breadcrumb.variables.startDate === 'string'\n ? dateFormatter.formatShortWithYear(breadcrumb.variables.startDate)\n : breadcrumb.variables.startDate,\n endDate:\n typeof breadcrumb.variables.endDate === 'string'\n ? dateFormatter.formatShortWithYear(breadcrumb.variables.endDate)\n : breadcrumb.variables.endDate,\n }\n : undefined\n\n const translatedLabel = breadcrumb.namespace\n ? (t(breadcrumb.label, {\n ns: breadcrumb.namespace,\n defaultValue: breadcrumb.label,\n ...formattedVariables,\n } as never) as unknown as string)\n : (t(breadcrumb.label, {\n defaultValue: breadcrumb.label,\n ...formattedVariables,\n } as never) as unknown as string)\n return {\n id: breadcrumb.id,\n label: translatedLabel,\n }\n }),\n [breadcrumbs, t, locale],\n )\n\n const handleBreadcrumbClick = (breadcrumbId: string) => {\n const breadcrumb = breadcrumbs.find(breadcrumb => breadcrumb.id === breadcrumbId)\n if (onEvent && breadcrumb) {\n onEvent(componentEvents.BREADCRUMB_NAVIGATE, {\n key: breadcrumbId,\n onNavigate: breadcrumb.onNavigate,\n })\n }\n }\n return (\n <div ref={breadcrumbContainerRef}>\n <Breadcrumbs\n isSmallContainer={isSmallContainer}\n breadcrumbs={parsedBreadcrumbs}\n currentBreadcrumbId={currentBreadcrumbId}\n onClick={handleBreadcrumbClick}\n />\n </div>\n )\n}\n"],"names":["FlowBreadcrumbs","breadcrumbs","currentBreadcrumbId","onEvent","breadcrumbContainerRef","useRef","isSmallContainer","useContainerBreakpoints","Breadcrumbs","useComponentContext","locale","useLocale","dateFormatter","useDateFormatter","namespaces","acc","breadcrumb","useI18n","t","useTranslation","parsedBreadcrumbs","useMemo","formattedVariables","translatedLabel","jsx","breadcrumbId","componentEvents"],"mappings":";;;;;;;;;AAWO,SAASA,EAAgB;AAAA,EAC9B,aAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,SAAAC;AACF,GAAyB;AACvB,QAAMC,IAAyBC,EAA8B,IAAI,GAG3DC,IAFcC,EAAwB,EAAE,KAAKH,GAAwB,EAEtC,WAAW,GAE1C,EAAE,aAAAI,EAAA,IAAgBC,EAAA,GAClB,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACbC,IAAgBC,EAAA,GAChBC,IAAab,EAAY;AAAA,IAC7B,CAACc,GAAKC,OACAA,EAAW,aACbD,EAAI,KAAKC,EAAW,SAAiD,GAEhED;AAAA,IAET,CAAA;AAAA,EAAC;AAEH,EAAAE,EAAQH,CAAU;AAClB,QAAM,EAAE,GAAAI,EAAA,IAAMC,EAAeL,CAAU,GACjCM,IAAoBC;AAAA,IACxB,MACEpB,EAAY,IAAI,CAAAe,MAAc;AAC5B,YAAMM,IAAqBN,EAAW,YAClC;AAAA,QACE,GAAGA,EAAW;AAAA,QACd,WACE,OAAOA,EAAW,UAAU,aAAc,WACtCJ,EAAc,oBAAoBI,EAAW,UAAU,SAAS,IAChEA,EAAW,UAAU;AAAA,QAC3B,SACE,OAAOA,EAAW,UAAU,WAAY,WACpCJ,EAAc,oBAAoBI,EAAW,UAAU,OAAO,IAC9DA,EAAW,UAAU;AAAA,MAAA,IAE7B,QAEEO,IAAkBP,EAAW,YAC9BE,EAAEF,EAAW,OAAO;AAAA,QACnB,IAAIA,EAAW;AAAA,QACf,cAAcA,EAAW;AAAA,QACzB,GAAGM;AAAA,MAAA,CACK,IACTJ,EAAEF,EAAW,OAAO;AAAA,QACnB,cAAcA,EAAW;AAAA,QACzB,GAAGM;AAAA,MAAA,CACK;AACd,aAAO;AAAA,QACL,IAAIN,EAAW;AAAA,QACf,OAAOO;AAAA,MAAA;AAAA,IAEX,CAAC;AAAA,IACH,CAACtB,GAAaiB,GAAGR,CAAM;AAAA,EAAA;AAYzB,SACE,gBAAAc,EAAC,OAAA,EAAI,KAAKpB,GACR,UAAA,gBAAAoB;AAAA,IAAChB;AAAA,IAAA;AAAA,MACC,kBAAAF;AAAA,MACA,aAAac;AAAA,MACb,qBAAAlB;AAAA,MACA,SAfwB,CAACuB,MAAyB;AACtD,cAAMT,IAAaf,EAAY,KAAK,CAAAe,MAAcA,EAAW,OAAOS,CAAY;AAChF,QAAItB,KAAWa,KACbb,EAAQuB,EAAgB,qBAAqB;AAAA,UAC3C,KAAKD;AAAA,UACL,YAAYT,EAAW;AAAA,QAAA,CACxB;AAAA,MAEL;AAAA,IAOe;AAAA,EAAA,GAEb;AAEJ;"}
@@ -2,7 +2,7 @@ import { jsxs as f, Fragment as b, jsx as o } from "react/jsx-runtime";
2
2
  import { useTranslation as g } from "react-i18next";
3
3
  import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
4
4
  import x from "../../../assets/icons/hamburger.svg.js";
5
- import { useMenu as M } from "../hooks/useMenu.js";
5
+ import { useMenu as M } from "../../../hooks/useMenu.js";
6
6
  function T({
7
7
  items: t,
8
8
  triggerLabel: s,
@@ -1 +1 @@
1
- {"version":3,"file":"HamburgerMenu.js","sources":["../../../../src/components/Common/HamburgerMenu/HamburgerMenu.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type HamburgerMenuProps } from './HamburgerMenuTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport HamburgerIcon from '@/assets/icons/hamburger.svg?react'\nimport { useMenu } from '@/components/Common/hooks/useMenu'\n\nexport function HamburgerMenu({\n items,\n triggerLabel,\n menuLabel,\n onClose,\n isLoading = false,\n ...props\n}: HamburgerMenuProps) {\n const { t } = useTranslation('common')\n const Components = useComponentContext()\n const { triggerProps, menuProps } = useMenu()\n\n const { ref, ...restTriggerProps } = triggerProps\n\n return (\n <>\n <Components.ButtonIcon\n isLoading={isLoading}\n aria-label={triggerLabel || t('labels.openMenu')}\n buttonRef={ref}\n {...restTriggerProps}\n >\n <HamburgerIcon />\n </Components.ButtonIcon>\n <Components.Menu\n {...menuProps}\n items={items}\n aria-label={menuLabel || t('labels.menuLabel')}\n onClose={onClose || menuProps.onClose}\n {...props}\n />\n </>\n )\n}\n"],"names":["HamburgerMenu","items","triggerLabel","menuLabel","onClose","isLoading","props","t","useTranslation","Components","useComponentContext","triggerProps","menuProps","useMenu","ref","restTriggerProps","jsxs","Fragment","jsx","HamburgerIcon"],"mappings":";;;;;AAMO,SAASA,EAAc;AAAA,EAC5B,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAuB;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ,GAC/BC,IAAaC,EAAA,GACb,EAAE,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GAE9B,EAAE,KAAAC,GAAK,GAAGC,EAAA,IAAqBJ;AAErC,SACE,gBAAAK,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACT,EAAW;AAAA,MAAX;AAAA,QACC,WAAAJ;AAAA,QACA,cAAYH,KAAgBK,EAAE,iBAAiB;AAAA,QAC/C,WAAWO;AAAA,QACV,GAAGC;AAAA,QAEJ,4BAACI,GAAA,CAAA,CAAc;AAAA,MAAA;AAAA,IAAA;AAAA,IAEjB,gBAAAD;AAAA,MAACT,EAAW;AAAA,MAAX;AAAA,QACE,GAAGG;AAAA,QACJ,OAAAX;AAAA,QACA,cAAYE,KAAaI,EAAE,kBAAkB;AAAA,QAC7C,SAASH,KAAWQ,EAAU;AAAA,QAC7B,GAAGN;AAAA,MAAA;AAAA,IAAA;AAAA,EACN,GACF;AAEJ;"}
1
+ {"version":3,"file":"HamburgerMenu.js","sources":["../../../../src/components/Common/HamburgerMenu/HamburgerMenu.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type HamburgerMenuProps } from './HamburgerMenuTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport HamburgerIcon from '@/assets/icons/hamburger.svg?react'\nimport { useMenu } from '@/hooks/useMenu'\n\nexport function HamburgerMenu({\n items,\n triggerLabel,\n menuLabel,\n onClose,\n isLoading = false,\n ...props\n}: HamburgerMenuProps) {\n const { t } = useTranslation('common')\n const Components = useComponentContext()\n const { triggerProps, menuProps } = useMenu()\n\n const { ref, ...restTriggerProps } = triggerProps\n\n return (\n <>\n <Components.ButtonIcon\n isLoading={isLoading}\n aria-label={triggerLabel || t('labels.openMenu')}\n buttonRef={ref}\n {...restTriggerProps}\n >\n <HamburgerIcon />\n </Components.ButtonIcon>\n <Components.Menu\n {...menuProps}\n items={items}\n aria-label={menuLabel || t('labels.menuLabel')}\n onClose={onClose || menuProps.onClose}\n {...props}\n />\n </>\n )\n}\n"],"names":["HamburgerMenu","items","triggerLabel","menuLabel","onClose","isLoading","props","t","useTranslation","Components","useComponentContext","triggerProps","menuProps","useMenu","ref","restTriggerProps","jsxs","Fragment","jsx","HamburgerIcon"],"mappings":";;;;;AAMO,SAASA,EAAc;AAAA,EAC5B,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAuB;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ,GAC/BC,IAAaC,EAAA,GACb,EAAE,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GAE9B,EAAE,KAAAC,GAAK,GAAGC,EAAA,IAAqBJ;AAErC,SACE,gBAAAK,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACT,EAAW;AAAA,MAAX;AAAA,QACC,WAAAJ;AAAA,QACA,cAAYH,KAAgBK,EAAE,iBAAiB;AAAA,QAC/C,WAAWO;AAAA,QACV,GAAGC;AAAA,QAEJ,4BAACI,GAAA,CAAA,CAAc;AAAA,MAAA;AAAA,IAAA;AAAA,IAEjB,gBAAAD;AAAA,MAACT,EAAW;AAAA,MAAX;AAAA,QACE,GAAGG;AAAA,QACJ,OAAAX;AAAA,QACA,cAAYE,KAAaI,EAAE,kBAAkB;AAAA,QAC7C,SAASH,KAAWQ,EAAU;AAAA,QAC7B,GAAGN;AAAA,MAAA;AAAA,IAAA;AAAA,EACN,GACF;AAEJ;"}
@@ -5,24 +5,22 @@ import { zodResolver as l } from "@hookform/resolvers/zod";
5
5
  import t from "./SignatureForm.module.scss.js";
6
6
  import { Form as u } from "../Form/Form.js";
7
7
  import { Flex as c } from "../Flex/Flex.js";
8
- import "react-i18next";
9
- import "classnames";
10
8
  const f = o.object({
11
9
  signature: o.string().min(1),
12
10
  confirmSignature: o.literal(!0)
13
- }), p = {
11
+ }), d = {
14
12
  signature: ""
15
13
  };
16
- function z({ onSubmit: m, children: i, formProps: n }) {
14
+ function b({ onSubmit: m, children: i, formProps: n }) {
17
15
  const e = s({
18
16
  resolver: l(f),
19
- defaultValues: p,
17
+ defaultValues: d,
20
18
  ...n
21
19
  });
22
20
  return /* @__PURE__ */ r(a, { ...e, children: /* @__PURE__ */ r(u, { onSubmit: e.handleSubmit(m), className: t.container, children: /* @__PURE__ */ r("div", { className: t.formFields, children: /* @__PURE__ */ r(c, { flexDirection: "column", gap: 20, children: i }) }) }) });
23
21
  }
24
22
  export {
25
- z as SignatureForm,
23
+ b as SignatureForm,
26
24
  f as SignatureFormSchema
27
25
  };
28
26
  //# sourceMappingURL=SignatureForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureForm.js","sources":["../../../../src/components/Common/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useForm, type UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './SignatureForm.module.scss'\nimport { Form } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\n\nexport const SignatureFormSchema = z.object({\n signature: z.string().min(1),\n confirmSignature: z.literal(true),\n})\n\nconst signatureFormDefaultValues = {\n signature: '',\n}\n\nexport type SignatureFormInputs = z.infer<typeof SignatureFormSchema>\n\ninterface SignatureFormProps {\n onSubmit: (data: SignatureFormInputs) => void | Promise<void>\n children?: React.ReactNode\n formProps?: Partial<UseFormProps<SignatureFormInputs>>\n}\n\nexport function SignatureForm({ onSubmit, children, formProps }: SignatureFormProps) {\n const methods = useForm<SignatureFormInputs>({\n resolver: zodResolver(SignatureFormSchema),\n defaultValues: signatureFormDefaultValues,\n ...formProps,\n })\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)} className={styles.container}>\n <div className={styles.formFields}>\n <Flex flexDirection=\"column\" gap={20}>\n {children}\n </Flex>\n </div>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["SignatureFormSchema","z","signatureFormDefaultValues","SignatureForm","onSubmit","children","formProps","methods","useForm","zodResolver","jsx","FormProvider","Form","styles","Flex"],"mappings":";;;;;;;;;AAOO,MAAMA,IAAsBC,EAAE,OAAO;AAAA,EAC1C,WAAWA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC3B,kBAAkBA,EAAE,QAAQ,EAAI;AAClC,CAAC,GAEKC,IAA6B;AAAA,EACjC,WAAW;AACb;AAUO,SAASC,EAAc,EAAE,UAAAC,GAAU,UAAAC,GAAU,WAAAC,KAAiC;AACnF,QAAMC,IAAUC,EAA6B;AAAA,IAC3C,UAAUC,EAAYT,CAAmB;AAAA,IACzC,eAAeE;AAAA,IACf,GAAGI;AAAA,EAAA,CACJ;AAED,SACE,gBAAAI,EAACC,GAAA,EAAc,GAAGJ,GAChB,UAAA,gBAAAG,EAACE,GAAA,EAAK,UAAUL,EAAQ,aAAaH,CAAQ,GAAG,WAAWS,EAAO,WAChE,UAAA,gBAAAH,EAAC,OAAA,EAAI,WAAWG,EAAO,YACrB,UAAA,gBAAAH,EAACI,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAAT,EAAA,CACH,EAAA,CACF,EAAA,CACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"SignatureForm.js","sources":["../../../../src/components/Common/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useForm, type UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './SignatureForm.module.scss'\nimport { Form } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\n\nexport const SignatureFormSchema = z.object({\n signature: z.string().min(1),\n confirmSignature: z.literal(true),\n})\n\nconst signatureFormDefaultValues = {\n signature: '',\n}\n\nexport type SignatureFormInputs = z.infer<typeof SignatureFormSchema>\n\ninterface SignatureFormProps {\n onSubmit: (data: SignatureFormInputs) => void | Promise<void>\n children?: React.ReactNode\n formProps?: Partial<UseFormProps<SignatureFormInputs>>\n}\n\nexport function SignatureForm({ onSubmit, children, formProps }: SignatureFormProps) {\n const methods = useForm<SignatureFormInputs>({\n resolver: zodResolver(SignatureFormSchema),\n defaultValues: signatureFormDefaultValues,\n ...formProps,\n })\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)} className={styles.container}>\n <div className={styles.formFields}>\n <Flex flexDirection=\"column\" gap={20}>\n {children}\n </Flex>\n </div>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["SignatureFormSchema","z","signatureFormDefaultValues","SignatureForm","onSubmit","children","formProps","methods","useForm","zodResolver","jsx","FormProvider","Form","styles","Flex"],"mappings":";;;;;;;AAOO,MAAMA,IAAsBC,EAAE,OAAO;AAAA,EAC1C,WAAWA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC3B,kBAAkBA,EAAE,QAAQ,EAAI;AAClC,CAAC,GAEKC,IAA6B;AAAA,EACjC,WAAW;AACb;AAUO,SAASC,EAAc,EAAE,UAAAC,GAAU,UAAAC,GAAU,WAAAC,KAAiC;AACnF,QAAMC,IAAUC,EAA6B;AAAA,IAC3C,UAAUC,EAAYT,CAAmB;AAAA,IACzC,eAAeE;AAAA,IACf,GAAGI;AAAA,EAAA,CACJ;AAED,SACE,gBAAAI,EAACC,GAAA,EAAc,GAAGJ,GAChB,UAAA,gBAAAG,EAACE,GAAA,EAAK,UAAUL,EAAQ,aAAaH,CAAQ,GAAG,WAAWS,EAAO,WAChE,UAAA,gBAAAH,EAAC,OAAA,EAAI,WAAWG,EAAO,YACrB,UAAA,gBAAAH,EAACI,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAAT,EAAA,CACH,EAAA,CACF,EAAA,CACF,GACF;AAEJ;"}
@@ -1,21 +1,19 @@
1
- import { jsxs as m, jsx as n } from "react/jsx-runtime";
2
- import "react-i18next";
3
- import "classnames";
4
- import { ActionsLayout as s } from "../ActionsLayout/ActionsLayout.js";
5
- import { useComponentContext as p } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
- function d({
1
+ import { jsxs as s, jsx as n } from "react/jsx-runtime";
2
+ import { ActionsLayout as m } from "../ActionsLayout/ActionsLayout.js";
3
+ import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
4
+ function f({
7
5
  onBack: t,
8
6
  backLabel: r,
9
- submitLabel: i,
10
- isLoading: e = !1
7
+ submitLabel: e,
8
+ isLoading: i = !1
11
9
  }) {
12
- const o = p();
13
- return /* @__PURE__ */ m(s, { children: [
10
+ const o = u();
11
+ return /* @__PURE__ */ s(m, { children: [
14
12
  t && /* @__PURE__ */ n(o.Button, { variant: "secondary", type: "button", onClick: t, children: r }),
15
- /* @__PURE__ */ n(o.Button, { type: "submit", isLoading: e, children: i })
13
+ /* @__PURE__ */ n(o.Button, { type: "submit", isLoading: i, children: e })
16
14
  ] });
17
15
  }
18
16
  export {
19
- d as SignatureFormActions
17
+ f as SignatureFormActions
20
18
  };
21
19
  //# sourceMappingURL=SignatureFormActions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureFormActions.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormActions.tsx"],"sourcesContent":["import { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface SignatureFormActionsProps {\n onBack?: () => void\n backLabel: string\n submitLabel: string\n isLoading?: boolean\n}\n\nexport function SignatureFormActions({\n onBack,\n backLabel,\n submitLabel,\n isLoading = false,\n}: SignatureFormActionsProps) {\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {onBack && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onBack}>\n {backLabel}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isLoading}>\n {submitLabel}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["SignatureFormActions","onBack","backLabel","submitLabel","isLoading","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAUO,SAASA,EAAqB;AAAA,EACnC,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAA8B;AAC5B,QAAMC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACE,UAAA;AAAA,IAAAN,KACC,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASJ,GAC3D,UAAAC,EAAA,CACH;AAAA,sBAEDG,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAAD,GAC9B,UAAAD,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"SignatureFormActions.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormActions.tsx"],"sourcesContent":["import { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface SignatureFormActionsProps {\n onBack?: () => void\n backLabel: string\n submitLabel: string\n isLoading?: boolean\n}\n\nexport function SignatureFormActions({\n onBack,\n backLabel,\n submitLabel,\n isLoading = false,\n}: SignatureFormActionsProps) {\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {onBack && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onBack}>\n {backLabel}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isLoading}>\n {submitLabel}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["SignatureFormActions","onBack","backLabel","submitLabel","isLoading","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;AAUO,SAASA,EAAqB;AAAA,EACnC,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAA8B;AAC5B,QAAMC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACE,UAAA;AAAA,IAAAN,KACC,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASJ,GAC3D,UAAAC,EAAA,CACH;AAAA,sBAEDG,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAAD,GAC9B,UAAAD,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;"}