@gusto/embedded-react-sdk 0.26.0 → 0.28.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 (379) hide show
  1. package/CHANGELOG.md +103 -0
  2. package/dist/assets/icons/plus-circle.svg.js +5 -5
  3. package/dist/assets/icons/plus-circle.svg.js.map +1 -1
  4. package/dist/components/Base/Base.js +13 -12
  5. package/dist/components/Base/Base.js.map +1 -1
  6. package/dist/components/Common/DataView/DataCards/DataCards.d.ts +4 -2
  7. package/dist/components/Common/DataView/DataCards/DataCards.js +52 -32
  8. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  9. package/dist/components/Common/DataView/DataTable/DataTable.d.ts +3 -2
  10. package/dist/components/Common/DataView/DataTable/DataTable.js +68 -53
  11. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  12. package/dist/components/Common/DataView/DataView.d.ts +4 -2
  13. package/dist/components/Common/DataView/DataView.js +28 -18
  14. package/dist/components/Common/DataView/DataView.js.map +1 -1
  15. package/dist/components/Common/DataView/useDataView.d.ts +6 -1
  16. package/dist/components/Common/DataView/useDataView.js +34 -19
  17. package/dist/components/Common/DataView/useDataView.js.map +1 -1
  18. package/dist/components/Common/DocumentList/DocumentList.js +23 -23
  19. package/dist/components/Common/DocumentList/DocumentList.js.map +1 -1
  20. package/dist/components/Common/DocumentList/DocumentList.module.scss.js +6 -10
  21. package/dist/components/Common/DocumentList/DocumentList.module.scss.js.map +1 -1
  22. package/dist/components/Common/DocumentViewer/DocumentViewer.module.scss.js +12 -12
  23. package/dist/components/Common/InlineSpinner/InlineSpinner.module.scss.js +1 -1
  24. package/dist/components/Common/InternalError/InternalError.module.scss.js +4 -4
  25. package/dist/components/Common/ReorderableList/ReorderableList.module.scss.js +8 -8
  26. package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +1 -1
  27. package/dist/components/Common/SignatureForm/SignatureForm.js +12 -10
  28. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  29. package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -2
  30. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  31. package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -6
  32. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  33. package/dist/components/Common/UI/Alert/Alert.module.scss.js +9 -9
  34. package/dist/components/Common/UI/Banner/Banner.module.scss.js +1 -1
  35. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  36. package/dist/components/Common/UI/Button/Button.module.scss.js +1 -1
  37. package/dist/components/Common/UI/CalendarPreview/CalendarPreview.module.scss.js +4 -4
  38. package/dist/components/Common/UI/Card/Card.d.ts +1 -1
  39. package/dist/components/Common/UI/Card/Card.js +10 -20
  40. package/dist/components/Common/UI/Card/Card.js.map +1 -1
  41. package/dist/components/Common/UI/Card/Card.module.scss.js +1 -1
  42. package/dist/components/Common/UI/Card/CardTypes.d.ts +4 -4
  43. package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js +1 -1
  44. package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +3 -3
  45. package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +4 -4
  46. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +1 -1
  47. package/dist/components/Common/UI/Dialog/Dialog.module.scss.js +2 -2
  48. package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
  49. package/dist/components/Common/UI/FileInput/FileInput.module.scss.js +26 -26
  50. package/dist/components/Common/UI/Input/Input.module.scss.js +8 -8
  51. package/dist/components/Common/UI/Modal/Modal.module.scss.js +12 -12
  52. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  53. package/dist/components/Common/UI/Radio/Radio.module.scss.js +6 -6
  54. package/dist/components/Common/UI/Select/Select.module.scss.js +4 -4
  55. package/dist/components/Common/UI/Table/Table.js +1 -1
  56. package/dist/components/Common/UI/Table/Table.js.map +1 -1
  57. package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
  58. package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +1 -1
  59. package/dist/components/Common/UI/Text/Text.module.scss.js +17 -15
  60. package/dist/components/Common/UI/Text/Text.module.scss.js.map +1 -1
  61. package/dist/components/Common/UI/TextArea/TextArea.module.scss.js +4 -4
  62. package/dist/components/Company/AssignSignatory/AssignSignatory.js +3 -2
  63. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  64. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +4 -3
  65. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  66. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
  67. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  68. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
  69. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
  70. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
  71. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  72. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
  73. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  74. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
  75. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  76. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
  77. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  78. package/dist/components/Company/AssignSignatory/TitleSelect.js +4 -3
  79. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  80. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
  81. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  82. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
  83. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  84. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -5
  85. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  86. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
  87. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  88. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +3 -2
  89. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  90. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -6
  91. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  92. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +7 -5
  93. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  94. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
  95. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  96. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
  97. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  98. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  99. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  100. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +4 -3
  101. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  102. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  103. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  104. package/dist/components/Company/FederalTaxes/Actions.js +7 -6
  105. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  106. package/dist/components/Company/FederalTaxes/FederalTaxes.js +4 -3
  107. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  108. package/dist/components/Company/FederalTaxes/Form.js +5 -3
  109. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  110. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
  111. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  112. package/dist/components/Company/Industry/Actions.js +8 -7
  113. package/dist/components/Company/Industry/Actions.js.map +1 -1
  114. package/dist/components/Company/Industry/Context.js +7 -6
  115. package/dist/components/Company/Industry/Context.js.map +1 -1
  116. package/dist/components/Company/Industry/Edit.js +3 -2
  117. package/dist/components/Company/Industry/Edit.js.map +1 -1
  118. package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
  119. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  120. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  121. package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -3
  122. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  123. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
  124. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  125. package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
  126. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  127. package/dist/components/Company/Locations/LocationsList/List.js +7 -6
  128. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  129. package/dist/components/Company/Locations/LocationsList/LocationsList.js +8 -7
  130. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  131. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
  132. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  133. package/dist/components/Company/OnboardingOverview/Completed.js +12 -10
  134. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  135. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +8 -6
  136. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  137. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +8 -7
  138. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  139. package/dist/components/Company/OnboardingOverview/context.js +4 -3
  140. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  141. package/dist/components/Company/PaySchedule/PaySchedule.js +4 -3
  142. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  143. package/dist/components/Company/PaySchedule/_parts/Actions.js +3 -2
  144. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  145. package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
  146. package/dist/components/Company/PaySchedule/_parts/Head.js +13 -11
  147. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  148. package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
  149. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  150. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
  151. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  152. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
  153. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  154. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
  155. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  156. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
  157. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  158. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
  159. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  160. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
  161. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  162. package/dist/components/Contractor/Address/Address.js +5 -4
  163. package/dist/components/Contractor/Address/Address.js.map +1 -1
  164. package/dist/components/Contractor/Address/Form.js +1 -1
  165. package/dist/components/Contractor/Address/useAddress.js +6 -5
  166. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  167. package/dist/components/Contractor/ContractorList/index.js +32 -31
  168. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  169. package/dist/components/Contractor/NewHireReport/NewHireReport.js +14 -13
  170. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  171. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +12 -11
  172. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  173. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  174. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  175. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +4 -3
  176. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  177. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +4 -2
  178. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  179. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
  180. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +9 -7
  181. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  182. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +9 -8
  183. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  184. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +11 -9
  185. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  186. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +8 -6
  187. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  188. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +14 -14
  189. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +4 -2
  190. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  191. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +4 -2
  192. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  193. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  194. package/dist/components/Contractor/Profile/ContractorProfileForm.module.scss.js +1 -1
  195. package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
  196. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  197. package/dist/components/Contractor/Submit/Submit.js +21 -20
  198. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  199. package/dist/components/Employee/Compensation/Actions.js +13 -12
  200. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  201. package/dist/components/Employee/Compensation/Edit.js +17 -16
  202. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  203. package/dist/components/Employee/Compensation/List.js +23 -22
  204. package/dist/components/Employee/Compensation/List.js.map +1 -1
  205. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.d.ts +3 -1
  206. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +145 -137
  207. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  208. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +2 -1
  209. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +106 -101
  210. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  211. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +90 -87
  212. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
  213. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +2 -1
  214. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +110 -104
  215. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  216. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +51 -45
  217. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  218. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +31 -30
  219. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
  220. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +4 -8
  221. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -1
  222. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +3 -2
  223. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  224. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +3 -2
  225. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  226. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
  227. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  228. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  229. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  230. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
  231. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  232. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  233. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  234. package/dist/components/Employee/EmployeeList/Actions.js +7 -6
  235. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  236. package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
  237. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  238. package/dist/components/Employee/EmployeeList/Head.js +7 -5
  239. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  240. package/dist/components/Employee/EmployeeList/List.js +3 -2
  241. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  242. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
  243. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  244. package/dist/components/Employee/FederalTaxes/Actions.js +6 -5
  245. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  246. package/dist/components/Employee/FederalTaxes/FederalForm.js +12 -11
  247. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  248. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
  249. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  250. package/dist/components/Employee/Landing/Landing.js +11 -10
  251. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  252. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  253. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  254. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  255. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -4
  256. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  257. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
  258. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  259. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -6
  260. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  261. package/dist/components/Employee/PaymentMethod/Split.js +11 -10
  262. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  263. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
  264. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  265. package/dist/components/Employee/Profile/Actions.js +6 -5
  266. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  267. package/dist/components/Employee/Profile/AdminPersonalDetails.js +6 -5
  268. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  269. package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js +1 -1
  270. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  271. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  272. package/dist/components/Employee/Profile/useProfile.js +4 -3
  273. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  274. package/dist/components/Employee/StateTaxes/Actions.js +6 -5
  275. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  276. package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
  277. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  278. package/dist/components/Employee/Taxes/Actions.js +7 -6
  279. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  280. package/dist/components/Employee/Taxes/FederalForm.js +14 -13
  281. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  282. package/dist/components/Employee/Taxes/useTaxes.js +4 -3
  283. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  284. package/dist/components/Flow/Flow.js +9 -7
  285. package/dist/components/Flow/Flow.js.map +1 -1
  286. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +17 -16
  287. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  288. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +4 -4
  289. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +41 -39
  290. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  291. package/dist/components/InformationRequests/InformationRequests.d.ts +7 -2
  292. package/dist/components/InformationRequests/InformationRequests.js +78 -45
  293. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  294. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +10 -9
  295. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  296. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js +10 -10
  297. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.d.ts +2 -0
  298. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js +33 -0
  299. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -0
  300. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +7 -0
  301. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +39 -0
  302. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -0
  303. package/dist/components/Payroll/OffCycleReasonSelection/index.d.ts +5 -0
  304. package/dist/components/Payroll/OffCycleReasonSelection/types.d.ts +15 -0
  305. package/dist/components/Payroll/OffCycleReasonSelection/types.js +14 -0
  306. package/dist/components/Payroll/OffCycleReasonSelection/types.js.map +1 -0
  307. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.d.ts +2 -0
  308. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.js +35 -0
  309. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.js.map +1 -0
  310. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.d.ts +2 -0
  311. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js +65 -0
  312. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js.map +1 -0
  313. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.module.scss.js +18 -0
  314. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.module.scss.js.map +1 -0
  315. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormTypes.d.ts +53 -0
  316. package/dist/components/Payroll/PayPeriodDateForm/index.d.ts +3 -0
  317. package/dist/components/Payroll/PayPeriodDateForm/usePayPeriodDateValidation.d.ts +5 -0
  318. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +4 -2
  319. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  320. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +19 -18
  321. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  322. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +36 -36
  323. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js +5 -5
  324. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +21 -19
  325. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  326. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +17 -15
  327. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  328. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +26 -24
  329. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  330. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +30 -29
  331. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  332. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +4 -2
  333. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  334. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
  335. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  336. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +18 -18
  337. package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +4 -1
  338. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +34 -28
  339. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
  340. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +29 -29
  341. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  342. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +12 -11
  343. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
  344. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +4 -2
  345. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
  346. package/dist/components/Payroll/index.d.ts +4 -0
  347. package/dist/components/Payroll/index.js +12 -8
  348. package/dist/components/Payroll/index.js.map +1 -1
  349. package/dist/components/Payroll/usePreparedPayrollData.js +3 -2
  350. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  351. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
  352. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  353. package/dist/contexts/ThemeProvider/theme.d.ts +8 -3
  354. package/dist/contexts/ThemeProvider/theme.js +29 -24
  355. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  356. package/dist/helpers/dateFormatting.d.ts +3 -0
  357. package/dist/helpers/dateFormatting.js.map +1 -1
  358. package/dist/i18n/I18n.js +1 -1
  359. package/dist/i18n/I18n.js.map +1 -1
  360. package/dist/i18n/en/Employee.Deductions.json.js +157 -161
  361. package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
  362. package/dist/i18n/en/InformationRequests.InformationRequestList.json.js +18 -14
  363. package/dist/i18n/en/InformationRequests.InformationRequestList.json.js.map +1 -1
  364. package/dist/i18n/en/InformationRequests.json.js +8 -0
  365. package/dist/i18n/en/InformationRequests.json.js.map +1 -0
  366. package/dist/i18n/en/Payroll.OffCycleReasonSelection.json.js +12 -0
  367. package/dist/i18n/en/Payroll.OffCycleReasonSelection.json.js.map +1 -0
  368. package/dist/i18n/en/Payroll.PayPeriodDateForm.json.js +32 -0
  369. package/dist/i18n/en/Payroll.PayPeriodDateForm.json.js.map +1 -0
  370. package/dist/shared/constants.d.ts +4 -0
  371. package/dist/shared/constants.js +10 -8
  372. package/dist/shared/constants.js.map +1 -1
  373. package/dist/style.css +1 -1
  374. package/dist/types/i18next.d.ts +52 -3
  375. package/package.json +11 -11
  376. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +0 -8
  377. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +0 -1
  378. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +0 -14
  379. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +0 -1
@@ -1,48 +1,54 @@
1
- import { jsxs as u, jsx as n } from "react/jsx-runtime";
2
- import { createMachine as M } from "robot3";
3
- import { useMachine as R } from "react-robot";
1
+ import { jsx as e, jsxs as v } from "react/jsx-runtime";
2
+ import { createMachine as R } from "robot3";
3
+ import { useMachine as M } from "react-robot";
4
4
  import { useState as d, useMemo as h } from "react";
5
5
  import { recoveryCasesMachine as O } from "./recoveryCasesStateMachine.js";
6
- import { useComponentContext as _ } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
- import { FlowContext as x } from "../../Flow/useFlow.js";
6
+ import { BaseComponent as _ } from "../../Base/Base.js";
7
+ import "../../Base/useBase.js";
8
+ import { useComponentContext as x } from "../../../contexts/ComponentAdapter/useComponentContext.js";
9
+ import { FlowContext as S } from "../../Flow/useFlow.js";
8
10
  import { recoveryCasesEvents as c } from "../../../shared/constants.js";
9
- import { RecoveryCasesList as S } from "./RecoveryCasesList/RecoveryCasesList.js";
10
- function T({ companyId: t, onEvent: a = () => {
11
+ import { RecoveryCasesList as A } from "./RecoveryCasesList/RecoveryCasesList.js";
12
+ function P({ onEvent: o = () => {
13
+ }, ...t }) {
14
+ return /* @__PURE__ */ e(_, { ...t, onEvent: o, children: /* @__PURE__ */ e(V, { ...t, onEvent: o }) });
15
+ }
16
+ function V({ companyId: o, onEvent: t = () => {
11
17
  } }) {
12
- const { Modal: C } = _(), [l, r] = d(!1), f = h(
13
- () => M(
18
+ const { Modal: l } = x(), [E, s] = d(!1), f = h(
19
+ () => R(
14
20
  "list",
15
21
  O,
16
22
  () => ({
17
23
  component: null,
18
- companyId: t,
19
- onEvent: e
24
+ companyId: o,
25
+ onEvent: r
20
26
  })
21
27
  ),
22
- [t]
23
- ), [i, v] = R(f);
24
- function e(o, E) {
25
- v({ type: o, payload: E }), o === c.RECOVERY_CASE_RESOLVE && r(!0), (o === c.RECOVERY_CASE_RESUBMIT_CANCEL || o === c.RECOVERY_CASE_RESUBMIT_DONE) && r(!1), a(o, E);
28
+ [o]
29
+ ), [m, u] = M(f);
30
+ function r(n, C) {
31
+ u({ type: n, payload: C }), n === c.RECOVERY_CASE_RESOLVE && s(!0), (n === c.RECOVERY_CASE_RESUBMIT_CANCEL || n === c.RECOVERY_CASE_RESUBMIT_DONE) && s(!1), t(n, C);
26
32
  }
27
33
  const p = () => {
28
- r(!1);
29
- }, s = i.context.component, m = s?.Footer || void 0;
30
- return /* @__PURE__ */ u(
31
- x.Provider,
34
+ s(!1);
35
+ }, i = m.context.component, a = i?.Footer || void 0;
36
+ return /* @__PURE__ */ v(
37
+ S.Provider,
32
38
  {
33
39
  value: {
34
- ...i.context,
35
- onEvent: e
40
+ ...m.context,
41
+ onEvent: r
36
42
  },
37
43
  children: [
38
- /* @__PURE__ */ n(S, { companyId: t, onEvent: e }),
39
- /* @__PURE__ */ n(
40
- C,
44
+ /* @__PURE__ */ e(A, { companyId: o, onEvent: r }),
45
+ /* @__PURE__ */ e(
46
+ l,
41
47
  {
42
- isOpen: l,
48
+ isOpen: E,
43
49
  onClose: p,
44
- footer: m && /* @__PURE__ */ n(m, { onEvent: e }),
45
- children: s && /* @__PURE__ */ n(s, {})
50
+ footer: a && /* @__PURE__ */ e(a, { onEvent: r }),
51
+ children: i && /* @__PURE__ */ e(i, {})
46
52
  }
47
53
  )
48
54
  ]
@@ -50,6 +56,6 @@ function T({ companyId: t, onEvent: a = () => {
50
56
  );
51
57
  }
52
58
  export {
53
- T as RecoveryCases
59
+ P as RecoveryCases
54
60
  };
55
61
  //# sourceMappingURL=RecoveryCases.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RecoveryCases.js","sources":["../../../../src/components/Payroll/RecoveryCases/RecoveryCases.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { useMemo, useState } from 'react'\nimport { RecoveryCasesList } from './RecoveryCasesList'\nimport { recoveryCasesMachine } from './recoveryCasesStateMachine'\nimport { type RecoveryCasesContextInterface } from './RecoveryCasesComponents'\nimport { type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { recoveryCasesEvents, type EventType } from '@/shared/constants'\n\nexport interface RecoveryCasesProps {\n companyId: string\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nexport function RecoveryCases({ companyId, onEvent = () => {} }: RecoveryCasesProps) {\n const { Modal } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n\n const recoveryCasesMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n recoveryCasesMachine,\n (): RecoveryCasesContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n }),\n ),\n [companyId],\n )\n const [current, send] = useMachine(recoveryCasesMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === recoveryCasesEvents.RECOVERY_CASE_RESOLVE) {\n setIsModalOpen(true)\n }\n\n if (\n type === recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_CANCEL ||\n type === recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE\n ) {\n setIsModalOpen(false)\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <RecoveryCasesList companyId={companyId} onEvent={handleEvent} />\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={Footer && <Footer onEvent={handleEvent} />}\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </FlowContext.Provider>\n )\n}\n"],"names":["RecoveryCases","companyId","onEvent","Modal","useComponentContext","isModalOpen","setIsModalOpen","useState","recoveryCasesMachineInstance","useMemo","createMachine","recoveryCasesMachine","handleEvent","current","send","useMachine","type","data","recoveryCasesEvents","handleCloseModal","CurrentComponent","Footer","jsxs","FlowContext","jsx","RecoveryCasesList"],"mappings":";;;;;;;;;AAgBO,SAASA,EAAc,EAAE,WAAAC,GAAW,SAAAC,IAAU,MAAM;AAAC,KAAyB;AACnF,QAAM,EAAE,OAAAC,EAAA,IAAUC,EAAA,GACZ,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAE9CC,IAA+BC;AAAA,IACnC,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,OAAsC;AAAA,QACpC,WAAW;AAAA,QACX,WAAAV;AAAA,QACA,SAASW;AAAA,MAAA;AAAA,IACX;AAAA,IAEJ,CAACX,CAAS;AAAA,EAAA,GAEN,CAACY,GAASC,CAAI,IAAIC,EAAWP,CAA4B;AAE/D,WAASI,EAAYI,GAAiBC,GAAgB;AACpD,IAAAH,EAAK,EAAE,MAAAE,GAAM,SAASC,EAAA,CAAM,GAExBD,MAASE,EAAoB,yBAC/BZ,EAAe,EAAI,IAInBU,MAASE,EAAoB,iCAC7BF,MAASE,EAAoB,gCAE7BZ,EAAe,EAAK,GAGtBJ,EAAQc,GAAMC,CAAI;AAAA,EACpB;AAEA,QAAME,IAAmB,MAAM;AAC7B,IAAAb,EAAe,EAAK;AAAA,EACtB,GAEMc,IAAmBP,EAAQ,QAAQ,WACnCQ,IAASD,GAAkB,UAAU;AAE3C,SACE,gBAAAE;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGV,EAAQ;AAAA,QACX,SAASD;AAAA,MAAA;AAAA,MAGX,UAAA;AAAA,QAAA,gBAAAY,EAACC,GAAA,EAAkB,WAAAxB,GAAsB,SAASW,EAAA,CAAa;AAAA,QAC/D,gBAAAY;AAAA,UAACrB;AAAA,UAAA;AAAA,YACC,QAAQE;AAAA,YACR,SAASc;AAAA,YACT,QAAQE,KAAU,gBAAAG,EAACH,GAAA,EAAO,SAAST,GAAa;AAAA,YAE/C,UAAAQ,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"RecoveryCases.js","sources":["../../../../src/components/Payroll/RecoveryCases/RecoveryCases.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { useMemo, useState } from 'react'\nimport { RecoveryCasesList } from './RecoveryCasesList'\nimport { recoveryCasesMachine } from './recoveryCasesStateMachine'\nimport { type RecoveryCasesContextInterface } from './RecoveryCasesComponents'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { recoveryCasesEvents, type EventType } from '@/shared/constants'\n\nexport interface RecoveryCasesProps {\n companyId: string\n onEvent?: BaseComponentInterface['onEvent']\n}\n\ninterface RecoveryCasesInternalProps\n extends Omit<BaseComponentInterface, 'onEvent'>, RecoveryCasesProps {}\n\nexport function RecoveryCases({ onEvent = () => {}, ...props }: RecoveryCasesInternalProps) {\n return (\n <BaseComponent {...props} onEvent={onEvent}>\n <Root {...props} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, onEvent = () => {} }: RecoveryCasesInternalProps) {\n const { Modal } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n\n const recoveryCasesMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n recoveryCasesMachine,\n (): RecoveryCasesContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n }),\n ),\n [companyId],\n )\n const [current, send] = useMachine(recoveryCasesMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown): void {\n send({ type, payload: data })\n\n if (type === recoveryCasesEvents.RECOVERY_CASE_RESOLVE) {\n setIsModalOpen(true)\n }\n\n if (\n type === recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_CANCEL ||\n type === recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE\n ) {\n setIsModalOpen(false)\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <RecoveryCasesList companyId={companyId} onEvent={handleEvent} />\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={Footer && <Footer onEvent={handleEvent} />}\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </FlowContext.Provider>\n )\n}\n"],"names":["RecoveryCases","onEvent","props","jsx","BaseComponent","Root","companyId","Modal","useComponentContext","isModalOpen","setIsModalOpen","useState","recoveryCasesMachineInstance","useMemo","createMachine","recoveryCasesMachine","handleEvent","current","send","useMachine","type","data","recoveryCasesEvents","handleCloseModal","CurrentComponent","Footer","jsxs","FlowContext","RecoveryCasesList"],"mappings":";;;;;;;;;;;AAmBO,SAASA,EAAc,EAAE,SAAAC,IAAU,MAAM;AAAC,GAAG,GAAGC,KAAqC;AAC1F,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GAAO,SAAAD,GACxB,4BAACI,GAAA,EAAM,GAAGH,GAAO,SAAAD,EAAA,CAAkB,EAAA,CACrC;AAEJ;AAEA,SAASI,EAAK,EAAE,WAAAC,GAAW,SAAAL,IAAU,MAAM;AAAC,KAAiC;AAC3E,QAAM,EAAE,OAAAM,EAAA,IAAUC,EAAA,GACZ,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAE9CC,IAA+BC;AAAA,IACnC,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,OAAsC;AAAA,QACpC,WAAW;AAAA,QACX,WAAAT;AAAA,QACA,SAASU;AAAA,MAAA;AAAA,IACX;AAAA,IAEJ,CAACV,CAAS;AAAA,EAAA,GAEN,CAACW,GAASC,CAAI,IAAIC,EAAWP,CAA4B;AAE/D,WAASI,EAAYI,GAAiBC,GAAsB;AAC1D,IAAAH,EAAK,EAAE,MAAAE,GAAM,SAASC,EAAA,CAAM,GAExBD,MAASE,EAAoB,yBAC/BZ,EAAe,EAAI,IAInBU,MAASE,EAAoB,iCAC7BF,MAASE,EAAoB,gCAE7BZ,EAAe,EAAK,GAGtBT,EAAQmB,GAAMC,CAAI;AAAA,EACpB;AAEA,QAAME,IAAmB,MAAM;AAC7B,IAAAb,EAAe,EAAK;AAAA,EACtB,GAEMc,IAAmBP,EAAQ,QAAQ,WACnCQ,IAASD,GAAkB,UAAU;AAE3C,SACE,gBAAAE;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGV,EAAQ;AAAA,QACX,SAASD;AAAA,MAAA;AAAA,MAGX,UAAA;AAAA,QAAA,gBAAAb,EAACyB,GAAA,EAAkB,WAAAtB,GAAsB,SAASU,EAAA,CAAa;AAAA,QAC/D,gBAAAb;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,QAAQE;AAAA,YACR,SAASc;AAAA,YACT,QAAQE,KAAU,gBAAAtB,EAACsB,GAAA,EAAO,SAAST,GAAa;AAAA,YAE/C,UAAAQ,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,41 +1,42 @@
1
1
  import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
2
  import { useTranslation as l } from "react-i18next";
3
- import { useRecoveryCasesGet as v } from "@gusto/embedded-api/react-query/recoveryCasesGet";
4
- import { useRecoveryCaseErrorCode as g } from "../useRecoveryCaseErrorCode.js";
5
- import R from "./RecoveryCasesList.module.scss.js";
6
- import { BaseComponent as L } from "../../../Base/Base.js";
3
+ import { useRecoveryCasesGetSuspense as v } from "@gusto/embedded-api/react-query/recoveryCasesGet";
4
+ import { useRecoveryCaseErrorCode as h } from "../useRecoveryCaseErrorCode.js";
5
+ import g from "./RecoveryCasesList.module.scss.js";
6
+ import { BaseComponent as R } from "../../../Base/Base.js";
7
7
  import "../../../Base/useBase.js";
8
8
  import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
9
- import { useComponentDictionary as b, useI18n as u } from "../../../../i18n/I18n.js";
10
- import { DataView as E } from "../../../Common/DataView/DataView.js";
11
- import { useDataView as x } from "../../../Common/DataView/useDataView.js";
12
- import { FlexItem as D, Flex as d } from "../../../Common/Flex/Flex.js";
9
+ import { useComponentDictionary as L, useI18n as u } from "../../../../i18n/I18n.js";
10
+ import { DataView as b } from "../../../Common/DataView/DataView.js";
11
+ import { useDataView as E } from "../../../Common/DataView/useDataView.js";
12
+ import { FlexItem as x, Flex as d } from "../../../Common/Flex/Flex.js";
13
+ import "classnames";
14
+ import { recoveryCasesEvents as D } from "../../../../shared/constants.js";
13
15
  import "react";
14
- import { recoveryCasesEvents as P } from "../../../../shared/constants.js";
15
16
  import { formatNumberAsCurrency as y } from "../../../../helpers/formattedStrings.js";
16
17
  function z(t) {
17
- return /* @__PURE__ */ e(L, { ...t, children: /* @__PURE__ */ e(S, { ...t, children: t.children }) });
18
+ return /* @__PURE__ */ e(R, { ...t, children: /* @__PURE__ */ e(w, { ...t, children: t.children }) });
18
19
  }
19
- function A(t) {
20
+ function P(t) {
20
21
  return t === "open" ? "info" : "warning";
21
22
  }
22
- function k({ errorCode: t }) {
23
+ function A({ errorCode: t }) {
23
24
  u("Payroll.RecoveryCasesList");
24
- const { t: n } = l("Payroll.RecoveryCasesList"), { Text: s } = c(), { title: r, subtitle: i } = g(t);
25
+ const { t: n } = l("Payroll.RecoveryCasesList"), { Text: s } = c(), { title: r, subtitle: i } = h(t);
25
26
  return !r && !i ? /* @__PURE__ */ e("span", { "aria-label": n("labels.noLatestErrorCodeAriaLabel"), "aria-live": "polite", children: n("labels.noLatestErrorCode") }) : /* @__PURE__ */ m(d, { flexDirection: "column", gap: 4, children: [
26
27
  r && /* @__PURE__ */ e(s, { weight: "semibold", children: r }),
27
28
  i && /* @__PURE__ */ e(s, { children: i })
28
29
  ] });
29
30
  }
30
- function w({ status: t }) {
31
+ function S({ status: t }) {
31
32
  u("Payroll.RecoveryCasesList");
32
33
  const { t: n } = l("Payroll.RecoveryCasesList"), { Badge: s } = c();
33
34
  if (!t)
34
35
  return null;
35
- const r = A(t), i = n(`status.${t}`);
36
+ const r = P(t), i = n(`status.${t}`);
36
37
  return /* @__PURE__ */ e(s, { status: r, children: i });
37
38
  }
38
- function O({
39
+ function k({
39
40
  recoveryCase: t,
40
41
  onEvent: n
41
42
  }) {
@@ -46,7 +47,7 @@ function O({
46
47
  {
47
48
  variant: "secondary",
48
49
  onClick: () => {
49
- n(P.RECOVERY_CASE_RESOLVE, {
50
+ n(D.RECOVERY_CASE_RESOLVE, {
50
51
  recoveryCaseId: t.uuid
51
52
  });
52
53
  },
@@ -54,18 +55,17 @@ function O({
54
55
  }
55
56
  );
56
57
  }
57
- function S({ companyId: t, dictionary: n, onEvent: s }) {
58
- b("Payroll.RecoveryCasesList", n), u("Payroll.RecoveryCasesList");
59
- const { t: r } = l("Payroll.RecoveryCasesList"), { Heading: i, Text: a } = c(), { data: C, isFetching: f } = v({
58
+ function w({ companyId: t, dictionary: n, onEvent: s }) {
59
+ L("Payroll.RecoveryCasesList", n), u("Payroll.RecoveryCasesList");
60
+ const { t: r } = l("Payroll.RecoveryCasesList"), { Heading: i, Text: a } = c(), { data: C } = v({
60
61
  companyUuid: t
61
- }), p = (C?.recoveryCaseList ?? []).filter((o) => o.status !== "recovered"), h = x({
62
- data: p,
63
- isFetching: f,
62
+ }), f = (C.recoveryCaseList ?? []).filter((o) => o.status !== "recovered"), p = E({
63
+ data: f,
64
64
  columns: [
65
65
  {
66
66
  key: "originalDebitDate",
67
67
  title: r("columns.originalDebitDate"),
68
- render: (o) => /* @__PURE__ */ e(D, { flexGrow: 1, children: /* @__PURE__ */ e(a, { children: o.originalDebitDate ?? "-" }) })
68
+ render: (o) => /* @__PURE__ */ e(x, { flexGrow: 1, children: /* @__PURE__ */ e(a, { children: o.originalDebitDate ?? "-" }) })
69
69
  },
70
70
  {
71
71
  key: "totalAmount",
@@ -80,22 +80,22 @@ function S({ companyId: t, dictionary: n, onEvent: s }) {
80
80
  {
81
81
  key: "latestErrorCode",
82
82
  title: r("columns.latestErrorCode"),
83
- render: (o) => /* @__PURE__ */ e(k, { errorCode: o.latestErrorCode })
83
+ render: (o) => /* @__PURE__ */ e(A, { errorCode: o.latestErrorCode })
84
84
  },
85
85
  {
86
86
  key: "status",
87
87
  title: r("columns.status"),
88
- render: (o) => /* @__PURE__ */ e(w, { status: o.status })
88
+ render: (o) => /* @__PURE__ */ e(S, { status: o.status })
89
89
  }
90
90
  ],
91
- itemMenu: (o) => /* @__PURE__ */ e(O, { recoveryCase: o, onEvent: s })
91
+ itemMenu: (o) => /* @__PURE__ */ e(k, { recoveryCase: o, onEvent: s })
92
92
  });
93
- return /* @__PURE__ */ e("div", { className: R.root, children: /* @__PURE__ */ m(d, { flexDirection: "column", gap: 20, children: [
93
+ return /* @__PURE__ */ e("div", { className: g.root, children: /* @__PURE__ */ m(d, { flexDirection: "column", gap: 20, children: [
94
94
  /* @__PURE__ */ m(d, { flexDirection: "column", gap: 2, children: [
95
95
  /* @__PURE__ */ e(i, { as: "h2", styledAs: "h4", children: r("title") }),
96
96
  /* @__PURE__ */ e(a, { children: r("description") })
97
97
  ] }),
98
- /* @__PURE__ */ e(E, { ...h, label: r("title") })
98
+ /* @__PURE__ */ e(b, { ...p, label: r("title") })
99
99
  ] }) });
100
100
  }
101
101
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"RecoveryCasesList.js","sources":["../../../../../src/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type {\n RecoveryCase,\n RecoveryCaseStatus,\n} from '@gusto/embedded-api/models/components/recoverycase'\nimport { useRecoveryCasesGet } from '@gusto/embedded-api/react-query/recoveryCasesGet'\nimport { useRecoveryCaseErrorCode } from '../useRecoveryCaseErrorCode'\nimport styles from './RecoveryCasesList.module.scss'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { Flex, FlexItem } from '@/components/Common'\nimport { recoveryCasesEvents } from '@/shared/constants'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\n\ninterface RecoveryCasesListProps extends BaseComponentInterface<'Payroll.RecoveryCasesList'> {\n companyId: string\n onEvent: BaseComponentInterface['onEvent']\n}\n\nexport function RecoveryCasesList(props: RecoveryCasesListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction getStatusBadgeStatus(status: RecoveryCaseStatus | undefined): BadgeProps['status'] {\n if (status === 'open') {\n return 'info'\n }\n return 'warning'\n}\n\nfunction ErrorCodeCell({ errorCode }: { errorCode: string | null | undefined }) {\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Text } = useComponentContext()\n const { title, subtitle } = useRecoveryCaseErrorCode(errorCode)\n\n if (!title && !subtitle) {\n return (\n <span aria-label={t('labels.noLatestErrorCodeAriaLabel')} aria-live=\"polite\">\n {t('labels.noLatestErrorCode')}\n </span>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={4}>\n {title && <Text weight=\"semibold\">{title}</Text>}\n {subtitle && <Text>{subtitle}</Text>}\n </Flex>\n )\n}\n\nfunction StatusCell({ status }: { status: RecoveryCaseStatus | undefined }) {\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Badge } = useComponentContext()\n\n if (!status) {\n return null\n }\n\n const badgeStatus = getStatusBadgeStatus(status)\n const statusLabel = t(`status.${status}`)\n\n return <Badge status={badgeStatus}>{statusLabel}</Badge>\n}\n\nfunction ResolveButton({\n recoveryCase,\n onEvent,\n}: {\n recoveryCase: RecoveryCase\n onEvent: BaseComponentInterface['onEvent']\n}) {\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Button } = useComponentContext()\n\n if (recoveryCase.status !== 'open') {\n return null\n }\n\n return (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESOLVE, {\n recoveryCaseId: recoveryCase.uuid,\n })\n }}\n >\n {t('cta.resolve')}\n </Button>\n )\n}\n\nfunction Root({ companyId, dictionary, onEvent }: RecoveryCasesListProps) {\n useComponentDictionary('Payroll.RecoveryCasesList', dictionary)\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Heading, Text } = useComponentContext()\n\n const { data, isFetching } = useRecoveryCasesGet({\n companyUuid: companyId,\n })\n\n const recoveryCases = (data?.recoveryCaseList ?? []).filter(rc => rc.status !== 'recovered')\n\n const dataViewProps = useDataView({\n data: recoveryCases,\n isFetching,\n columns: [\n {\n key: 'originalDebitDate',\n title: t('columns.originalDebitDate'),\n render: recoveryCase => (\n <FlexItem flexGrow={1}>\n <Text>{recoveryCase.originalDebitDate ?? '-'}</Text>\n </FlexItem>\n ),\n },\n {\n key: 'totalAmount',\n title: t('columns.totalAmount'),\n render: recoveryCase => (\n <Text>\n {recoveryCase.eventTotalAmount\n ? formatNumberAsCurrency(parseFloat(recoveryCase.eventTotalAmount))\n : '-'}\n </Text>\n ),\n },\n {\n key: 'amountOutstanding',\n title: t('columns.amountOutstanding'),\n render: recoveryCase => (\n <Text>\n {recoveryCase.amountOutstanding\n ? formatNumberAsCurrency(parseFloat(recoveryCase.amountOutstanding))\n : '-'}\n </Text>\n ),\n },\n {\n key: 'latestErrorCode',\n title: t('columns.latestErrorCode'),\n render: recoveryCase => <ErrorCodeCell errorCode={recoveryCase.latestErrorCode} />,\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: recoveryCase => <StatusCell status={recoveryCase.status} />,\n },\n ],\n itemMenu: recoveryCase => <ResolveButton recoveryCase={recoveryCase} onEvent={onEvent} />,\n })\n\n return (\n <div className={styles.root}>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('title')}\n </Heading>\n <Text>{t('description')}</Text>\n </Flex>\n\n <DataView {...dataViewProps} label={t('title')} />\n </Flex>\n </div>\n )\n}\n"],"names":["RecoveryCasesList","props","jsx","BaseComponent","Root","getStatusBadgeStatus","status","ErrorCodeCell","errorCode","useI18n","t","useTranslation","Text","useComponentContext","title","subtitle","useRecoveryCaseErrorCode","jsxs","Flex","StatusCell","Badge","badgeStatus","statusLabel","ResolveButton","recoveryCase","onEvent","Button","recoveryCasesEvents","companyId","dictionary","useComponentDictionary","Heading","data","isFetching","useRecoveryCasesGet","recoveryCases","rc","dataViewProps","useDataView","FlexItem","formatNumberAsCurrency","styles","DataView"],"mappings":";;;;;;;;;;;;;;;AAuBO,SAASA,EAAkBC,GAA+B;AAC/D,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASI,EAAqBC,GAA8D;AAC1F,SAAIA,MA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EAAa,iBAAiB,CAAC,IACjE,IAAA,CACN;AAAA,MAAA;AAAA,MAGJ;AAAA,QACE,KAAK;AAAA,QACL,OAAOd,EAAE,yBAAyB;AAAA,QAClC,QAAQ,CAAAc,MAAgB,gBAAAtB,EAACK,GAAA,EAAc,WAAWiB,EAAa,gBAAA,CAAiB;AAAA,MAAA;AAAA,MAElF;AAAA,QACE,KAAK;AAAA,QACL,OAAOd,EAAE,gBAAgB;AAAA,QACzB,QAAQ,CAAAc,MAAgB,gBAAAtB,EAACiB,GAAA,EAAW,QAAQK,EAAa,OAAA,CAAQ;AAAA,MAAA;AAAA,IACnE;AAAA,IAEF,UAAU,CAAAA,MAAgB,gBAAAtB,EAACqB,GAAA,EAAc,cAAAC,GAA4B,SAAAC,EAAA,CAAkB;AAAA,EAAA,CACxF;AAED,SACE,gBAAAvB,EAAC,OAAA,EAAI,WAAWuC,EAAO,MACrB,4BAACvB,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAhB,EAAC6B,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAArB,EAAE,OAAO,GACZ;AAAA,MACA,gBAAAR,EAACU,GAAA,EAAM,UAAAF,EAAE,aAAa,EAAA,CAAE;AAAA,IAAA,GAC1B;AAAA,sBAECgC,GAAA,EAAU,GAAGL,GAAe,OAAO3B,EAAE,OAAO,EAAA,CAAG;AAAA,EAAA,EAAA,CAClD,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"RecoveryCasesList.js","sources":["../../../../../src/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type {\n RecoveryCase,\n RecoveryCaseStatus,\n} from '@gusto/embedded-api/models/components/recoverycase'\nimport { useRecoveryCasesGetSuspense } from '@gusto/embedded-api/react-query/recoveryCasesGet'\nimport { useRecoveryCaseErrorCode } from '../useRecoveryCaseErrorCode'\nimport styles from './RecoveryCasesList.module.scss'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { Flex, FlexItem } from '@/components/Common'\nimport { recoveryCasesEvents } from '@/shared/constants'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\n\ninterface RecoveryCasesListProps extends BaseComponentInterface<'Payroll.RecoveryCasesList'> {\n companyId: string\n onEvent: BaseComponentInterface['onEvent']\n}\n\nexport function RecoveryCasesList(props: RecoveryCasesListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction getStatusBadgeStatus(status: RecoveryCaseStatus | undefined): BadgeProps['status'] {\n if (status === 'open') {\n return 'info'\n }\n return 'warning'\n}\n\nfunction ErrorCodeCell({ errorCode }: { errorCode: string | null | undefined }) {\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Text } = useComponentContext()\n const { title, subtitle } = useRecoveryCaseErrorCode(errorCode)\n\n if (!title && !subtitle) {\n return (\n <span aria-label={t('labels.noLatestErrorCodeAriaLabel')} aria-live=\"polite\">\n {t('labels.noLatestErrorCode')}\n </span>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={4}>\n {title && <Text weight=\"semibold\">{title}</Text>}\n {subtitle && <Text>{subtitle}</Text>}\n </Flex>\n )\n}\n\nfunction StatusCell({ status }: { status: RecoveryCaseStatus | undefined }) {\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Badge } = useComponentContext()\n\n if (!status) {\n return null\n }\n\n const badgeStatus = getStatusBadgeStatus(status)\n const statusLabel = t(`status.${status}`)\n\n return <Badge status={badgeStatus}>{statusLabel}</Badge>\n}\n\nfunction ResolveButton({\n recoveryCase,\n onEvent,\n}: {\n recoveryCase: RecoveryCase\n onEvent: BaseComponentInterface['onEvent']\n}) {\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Button } = useComponentContext()\n\n if (recoveryCase.status !== 'open') {\n return null\n }\n\n return (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESOLVE, {\n recoveryCaseId: recoveryCase.uuid,\n })\n }}\n >\n {t('cta.resolve')}\n </Button>\n )\n}\n\nfunction Root({ companyId, dictionary, onEvent }: RecoveryCasesListProps) {\n useComponentDictionary('Payroll.RecoveryCasesList', dictionary)\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Heading, Text } = useComponentContext()\n\n const { data } = useRecoveryCasesGetSuspense({\n companyUuid: companyId,\n })\n\n const recoveryCases = (data.recoveryCaseList ?? []).filter(rc => rc.status !== 'recovered')\n\n const dataViewProps = useDataView({\n data: recoveryCases,\n columns: [\n {\n key: 'originalDebitDate',\n title: t('columns.originalDebitDate'),\n render: recoveryCase => (\n <FlexItem flexGrow={1}>\n <Text>{recoveryCase.originalDebitDate ?? '-'}</Text>\n </FlexItem>\n ),\n },\n {\n key: 'totalAmount',\n title: t('columns.totalAmount'),\n render: recoveryCase => (\n <Text>\n {recoveryCase.eventTotalAmount\n ? formatNumberAsCurrency(parseFloat(recoveryCase.eventTotalAmount))\n : '-'}\n </Text>\n ),\n },\n {\n key: 'amountOutstanding',\n title: t('columns.amountOutstanding'),\n render: recoveryCase => (\n <Text>\n {recoveryCase.amountOutstanding\n ? formatNumberAsCurrency(parseFloat(recoveryCase.amountOutstanding))\n : '-'}\n </Text>\n ),\n },\n {\n key: 'latestErrorCode',\n title: t('columns.latestErrorCode'),\n render: recoveryCase => <ErrorCodeCell errorCode={recoveryCase.latestErrorCode} />,\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: recoveryCase => <StatusCell status={recoveryCase.status} />,\n },\n ],\n itemMenu: recoveryCase => <ResolveButton recoveryCase={recoveryCase} onEvent={onEvent} />,\n })\n\n return (\n <div className={styles.root}>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('title')}\n </Heading>\n <Text>{t('description')}</Text>\n </Flex>\n\n <DataView {...dataViewProps} label={t('title')} />\n </Flex>\n </div>\n )\n}\n"],"names":["RecoveryCasesList","props","jsx","BaseComponent","Root","getStatusBadgeStatus","status","ErrorCodeCell","errorCode","useI18n","t","useTranslation","Text","useComponentContext","title","subtitle","useRecoveryCaseErrorCode","jsxs","Flex","StatusCell","Badge","badgeStatus","statusLabel","ResolveButton","recoveryCase","onEvent","Button","recoveryCasesEvents","companyId","dictionary","useComponentDictionary","Heading","data","useRecoveryCasesGetSuspense","recoveryCases","rc","dataViewProps","useDataView","FlexItem","formatNumberAsCurrency","styles","DataView"],"mappings":";;;;;;;;;;;;;;;;AAuBO,SAASA,EAAkBC,GAA+B;AAC/D,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASI,EAAqBC,GAA8D;AAC1F,SAAIA,MAAW,SACN,SAEF;AACT;AAEA,SAASC,EAAc,EAAE,WAAAC,KAAuD;AAC9E,EAAAC,EAAQ,2BAA2B;AACnC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,2BAA2B,GAClD,EAAE,MAAAC,EAAA,IAASC,EAAA,GACX,EAAE,OAAAC,GAAO,UAAAC,MAAaC,EAAyBR,CAAS;AAE9D,SAAI,CAACM,KAAS,CAACC,IAEX,gBAAAb,EAAC,QAAA,EAAK,cA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AAW,QAAQK,EAAa,OAAA,CAAQ;AAAA,MAAA;AAAA,IACnE;AAAA,IAEF,UAAU,CAAAA,MAAgB,gBAAAtB,EAACqB,GAAA,EAAc,cAAAC,GAA4B,SAAAC,EAAA,CAAkB;AAAA,EAAA,CACxF;AAED,SACE,gBAAAvB,EAAC,OAAA,EAAI,WAAWsC,EAAO,MACrB,4BAACtB,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAhB,EAAC6B,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAArB,EAAE,OAAO,GACZ;AAAA,MACA,gBAAAR,EAACU,GAAA,EAAM,UAAAF,EAAE,aAAa,EAAA,CAAE;AAAA,IAAA,GAC1B;AAAA,sBAEC+B,GAAA,EAAU,GAAGL,GAAe,OAAO1B,EAAE,OAAO,EAAA,CAAG;AAAA,EAAA,EAAA,CAClD,EAAA,CACF;AAEJ;"}
@@ -7,48 +7,49 @@ import { useRecoveryCaseErrorCode as x } from "../useRecoveryCaseErrorCode.js";
7
7
  import { BaseComponent as D } from "../../../Base/Base.js";
8
8
  import { useBase as B } from "../../../Base/useBase.js";
9
9
  import { Flex as d } from "../../../Common/Flex/Flex.js";
10
- import { useComponentContext as C } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
10
+ import "classnames";
11
+ import { recoveryCasesEvents as C } from "../../../../shared/constants.js";
12
+ import { useComponentContext as y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
11
13
  import "react";
12
14
  import { Form as F } from "../../../Common/Form/Form.js";
13
15
  import { useFlow as A } from "../../../Flow/useFlow.js";
14
16
  import { useComponentDictionary as I, useI18n as O } from "../../../../i18n/I18n.js";
15
- import { recoveryCasesEvents as y } from "../../../../shared/constants.js";
16
17
  const R = "gusto-sdk-recovery-cases-resubmit-form";
17
18
  function T(e) {
18
19
  return /* @__PURE__ */ t(D, { ...e, children: /* @__PURE__ */ t(U, { ...e, children: e.children }) });
19
20
  }
20
21
  function U({ dictionary: e, recoveryCaseId: o }) {
21
22
  I("Payroll.RecoveryCasesResubmit", e);
22
- const { Heading: r, Text: i } = C(), { onEvent: n, baseSubmitHandler: a } = B(), { companyId: f } = A(), { data: p } = S({
23
- companyUuid: f
24
- }), v = p?.recoveryCaseList?.find((s) => s.uuid === o), { title: c, subtitle: m, description: u } = x(
23
+ const { Heading: r, Text: s } = y(), { onEvent: n, baseSubmitHandler: a } = B(), { companyId: p } = A(), { data: f } = S({
24
+ companyUuid: p
25
+ }), v = f?.recoveryCaseList?.find((i) => i.uuid === o), { title: c, subtitle: m, description: u } = x(
25
26
  v?.latestErrorCode ?? void 0
26
- ), E = _(), b = async (s) => {
27
- s.preventDefault(), await a({}, async () => {
27
+ ), E = _(), b = async (i) => {
28
+ i.preventDefault(), await a({}, async () => {
28
29
  await E.mutateAsync({
29
30
  request: {
30
31
  recoveryCaseUuid: o
31
32
  }
32
- }), n(y.RECOVERY_CASE_RESUBMIT_DONE, {
33
+ }), n(C.RECOVERY_CASE_RESUBMIT_DONE, {
33
34
  recoveryCaseId: o
34
35
  });
35
36
  });
36
37
  };
37
38
  return /* @__PURE__ */ l(d, { flexDirection: "column", gap: 16, children: [
38
39
  c && /* @__PURE__ */ t(r, { as: "h2", children: c }),
39
- m && /* @__PURE__ */ t(i, { children: m }),
40
+ m && /* @__PURE__ */ t(s, { children: m }),
40
41
  u.length > 0 && u,
41
42
  /* @__PURE__ */ t(F, { id: R, onSubmit: b, "aria-hidden": "true" })
42
43
  ] });
43
44
  }
44
45
  const P = ({ onEvent: e }) => {
45
46
  O("Payroll.RecoveryCasesResubmit");
46
- const { t: o } = h("Payroll.RecoveryCasesResubmit"), { Button: r } = C(), n = g({
47
+ const { t: o } = h("Payroll.RecoveryCasesResubmit"), { Button: r } = y(), n = g({
47
48
  mutationKey: M()
48
49
  }) > 0;
49
50
  return /* @__PURE__ */ l(d, { justifyContent: "flex-end", gap: 12, children: [
50
51
  /* @__PURE__ */ t(r, { variant: "secondary", onClick: () => {
51
- e(y.RECOVERY_CASE_RESUBMIT_CANCEL);
52
+ e(C.RECOVERY_CASE_RESUBMIT_CANCEL);
52
53
  }, isDisabled: n, children: o("cta.cancel") }),
53
54
  /* @__PURE__ */ t(
54
55
  r,
@@ -1 +1 @@
1
- {"version":3,"file":"RecoveryCasesResubmit.js","sources":["../../../../../src/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIsMutating } from '@tanstack/react-query'\nimport {\n useRecoveryCasesRedebitMutation,\n mutationKeyRecoveryCasesRedebit,\n} from '@gusto/embedded-api/react-query/recoveryCasesRedebit'\nimport { useRecoveryCasesGet } from '@gusto/embedded-api/react-query/recoveryCasesGet'\nimport type { RecoveryCasesContextInterface } from '../RecoveryCasesComponents'\nimport { useRecoveryCaseErrorCode } from '../useRecoveryCaseErrorCode'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { Form } from '@/components/Common/Form'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { recoveryCasesEvents, type EventType } from '@/shared/constants'\n\nconst RECOVERY_CASES_RESUBMIT_FORM_ID = 'gusto-sdk-recovery-cases-resubmit-form'\n\ninterface RecoveryCasesResubmitProps extends BaseComponentInterface<'Payroll.RecoveryCasesResubmit'> {\n recoveryCaseId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function RecoveryCasesResubmit(props: RecoveryCasesResubmitProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ dictionary, recoveryCaseId }: RecoveryCasesResubmitProps) {\n useComponentDictionary('Payroll.RecoveryCasesResubmit', dictionary)\n const { Heading, Text } = useComponentContext()\n const { onEvent, baseSubmitHandler } = useBase()\n const { companyId } = useFlow<RecoveryCasesContextInterface>()\n\n const { data: recoveryCasesData } = useRecoveryCasesGet({\n companyUuid: companyId,\n })\n\n const recoveryCase = recoveryCasesData?.recoveryCaseList?.find(rc => rc.uuid === recoveryCaseId)\n\n const { title, subtitle, description } = useRecoveryCaseErrorCode(\n recoveryCase?.latestErrorCode ?? undefined,\n )\n\n const redebitMutation = useRecoveryCasesRedebitMutation()\n\n const onSubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n await baseSubmitHandler({}, async () => {\n await redebitMutation.mutateAsync({\n request: {\n recoveryCaseUuid: recoveryCaseId,\n },\n })\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE, {\n recoveryCaseId,\n })\n })\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {title && <Heading as=\"h2\">{title}</Heading>}\n {subtitle && <Text>{subtitle}</Text>}\n {description.length > 0 && description}\n {/*\n This empty form is used to connect the Footer's submit button to the submission logic\n via the form attribute. This is semantically incorrect and hidden from assistive tech.\n */}\n <Form id={RECOVERY_CASES_RESUBMIT_FORM_ID} onSubmit={onSubmit} aria-hidden=\"true\">\n {/* Empty form - submission triggered by footer button via form attribute */}\n </Form>\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.RecoveryCasesResubmit')\n const { t } = useTranslation('Payroll.RecoveryCasesResubmit')\n const { Button } = useComponentContext()\n\n const isMutating = useIsMutating({\n mutationKey: mutationKeyRecoveryCasesRedebit(),\n })\n const isPending = isMutating > 0\n\n const handleCancel = () => {\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_CANCEL)\n }\n\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel} isDisabled={isPending}>\n {t('cta.cancel')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={RECOVERY_CASES_RESUBMIT_FORM_ID}\n isLoading={isPending}\n >\n {t('cta.resubmit')}\n </Button>\n </Flex>\n )\n}\n\nRecoveryCasesResubmit.Footer = Footer\n"],"names":["RECOVERY_CASES_RESUBMIT_FORM_ID","RecoveryCasesResubmit","props","jsx","BaseComponent","Root","dictionary","recoveryCaseId","useComponentDictionary","Heading","Text","useComponentContext","onEvent","baseSubmitHandler","useBase","companyId","useFlow","recoveryCasesData","useRecoveryCasesGet","recoveryCase","rc","title","subtitle","description","useRecoveryCaseErrorCode","redebitMutation","useRecoveryCasesRedebitMutation","onSubmit","e","recoveryCasesEvents","jsxs","Flex","Form","Footer","useI18n","t","useTranslation","Button","isPending","useIsMutating","mutationKeyRecoveryCasesRedebit"],"mappings":";;;;;;;;;;;;;;;AAkBA,MAAMA,IAAkC;AAOjC,SAASC,EAAsBC,GAAmC;AACvE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,gBAAAC,KAA8C;AACxE,EAAAC,EAAuB,iCAAiCF,CAAU;AAClE,QAAM,EAAE,SAAAG,GAAS,MAAAC,EAAA,IAASC,EAAA,GACpB,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GACjC,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAEhB,EAAE,MAAMC,EAAA,IAAsBC,EAAoB;AAAA,IACtD,aAAaH;AAAA,EAAA,CACd,GAEKI,IAAeF,GAAmB,kBAAkB,KAAK,CAAAG,MAAMA,EAAG,SAASb,CAAc,GAEzF,EAAE,OAAAc,GAAO,UAAAC,GAAU,aAAAC,EAAA,IAAgBC;AAAA,IACvCL,GAAc,mBAAmB;AAAA,EAAA,GAG7BM,IAAkBC,EAAA,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AAAA,QAEV,YAAE,cAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EACnB,GACF;AAEJ;AAEArC,EAAsB,SAASgC;"}
1
+ {"version":3,"file":"RecoveryCasesResubmit.js","sources":["../../../../../src/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIsMutating } from '@tanstack/react-query'\nimport {\n useRecoveryCasesRedebitMutation,\n mutationKeyRecoveryCasesRedebit,\n} from '@gusto/embedded-api/react-query/recoveryCasesRedebit'\nimport { useRecoveryCasesGet } from '@gusto/embedded-api/react-query/recoveryCasesGet'\nimport type { RecoveryCasesContextInterface } from '../RecoveryCasesComponents'\nimport { useRecoveryCaseErrorCode } from '../useRecoveryCaseErrorCode'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { Form } from '@/components/Common/Form'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { recoveryCasesEvents, type EventType } from '@/shared/constants'\n\nconst RECOVERY_CASES_RESUBMIT_FORM_ID = 'gusto-sdk-recovery-cases-resubmit-form'\n\ninterface RecoveryCasesResubmitProps extends BaseComponentInterface<'Payroll.RecoveryCasesResubmit'> {\n recoveryCaseId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function RecoveryCasesResubmit(props: RecoveryCasesResubmitProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ dictionary, recoveryCaseId }: RecoveryCasesResubmitProps) {\n useComponentDictionary('Payroll.RecoveryCasesResubmit', dictionary)\n const { Heading, Text } = useComponentContext()\n const { onEvent, baseSubmitHandler } = useBase()\n const { companyId } = useFlow<RecoveryCasesContextInterface>()\n\n const { data: recoveryCasesData } = useRecoveryCasesGet({\n companyUuid: companyId,\n })\n\n const recoveryCase = recoveryCasesData?.recoveryCaseList?.find(rc => rc.uuid === recoveryCaseId)\n\n const { title, subtitle, description } = useRecoveryCaseErrorCode(\n recoveryCase?.latestErrorCode ?? undefined,\n )\n\n const redebitMutation = useRecoveryCasesRedebitMutation()\n\n const onSubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n await baseSubmitHandler({}, async () => {\n await redebitMutation.mutateAsync({\n request: {\n recoveryCaseUuid: recoveryCaseId,\n },\n })\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE, {\n recoveryCaseId,\n })\n })\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {title && <Heading as=\"h2\">{title}</Heading>}\n {subtitle && <Text>{subtitle}</Text>}\n {description.length > 0 && description}\n {/*\n This empty form is used to connect the Footer's submit button to the submission logic\n via the form attribute. This is semantically incorrect and hidden from assistive tech.\n */}\n <Form id={RECOVERY_CASES_RESUBMIT_FORM_ID} onSubmit={onSubmit} aria-hidden=\"true\">\n {/* Empty form - submission triggered by footer button via form attribute */}\n </Form>\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.RecoveryCasesResubmit')\n const { t } = useTranslation('Payroll.RecoveryCasesResubmit')\n const { Button } = useComponentContext()\n\n const isMutating = useIsMutating({\n mutationKey: mutationKeyRecoveryCasesRedebit(),\n })\n const isPending = isMutating > 0\n\n const handleCancel = () => {\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_CANCEL)\n }\n\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel} isDisabled={isPending}>\n {t('cta.cancel')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={RECOVERY_CASES_RESUBMIT_FORM_ID}\n isLoading={isPending}\n >\n {t('cta.resubmit')}\n </Button>\n </Flex>\n )\n}\n\nRecoveryCasesResubmit.Footer = Footer\n"],"names":["RECOVERY_CASES_RESUBMIT_FORM_ID","RecoveryCasesResubmit","props","jsx","BaseComponent","Root","dictionary","recoveryCaseId","useComponentDictionary","Heading","Text","useComponentContext","onEvent","baseSubmitHandler","useBase","companyId","useFlow","recoveryCasesData","useRecoveryCasesGet","recoveryCase","rc","title","subtitle","description","useRecoveryCaseErrorCode","redebitMutation","useRecoveryCasesRedebitMutation","onSubmit","e","recoveryCasesEvents","jsxs","Flex","Form","Footer","useI18n","t","useTranslation","Button","isPending","useIsMutating","mutationKeyRecoveryCasesRedebit"],"mappings":";;;;;;;;;;;;;;;;AAkBA,MAAMA,IAAkC;AAOjC,SAASC,EAAsBC,GAAmC;AACvE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,gBAAAC,KAA8C;AACxE,EAAAC,EAAuB,iCAAiCF,CAAU;AAClE,QAAM,EAAE,SAAAG,GAAS,MAAAC,EAAA,IAASC,EAAA,GACpB,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GACjC,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAEhB,EAAE,MAAMC,EAAA,IAAsBC,EAAoB;AAAA,IACtD,aAAaH;AAAA,EAAA,CACd,GAEKI,IAAeF,GAAmB,kBAAkB,KAAK,CAAAG,MAAMA,EAAG,SAASb,CAAc,GAEzF,EAAE,OAAAc,GAAO,UAAAC,GAAU,aAAAC,EAAA,IAAgBC;AAAA,IACvCL,GAAc,mBAAmB;AAAA,EAAA,GAG7BM,IAAkBC,EAAA,GAElBC,IAAW,OAAOC,MAAwC;AAC9D,IAAAA,EAAE,eAAA,GACF,MAAMf,EAAkB,CAAA,GAAI,YAAY;AACtC,YAAMY,EAAgB,YAAY;AAAA,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e, jsxs as d } from "react/jsx-runtime";
2
2
  import { useTranslation as a, Trans as c } from "react-i18next";
3
3
  import p from "./RecoveryCaseErrorCode.module.scss.js";
4
4
  import { Flex as C } from "../../Common/Flex/Flex.js";
5
+ import "classnames";
6
+ import "../../../shared/constants.js";
5
7
  import { useComponentContext as R } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
8
  import "react";
7
9
  import { useI18n as f } from "../../../i18n/I18n.js";
@@ -19,7 +21,7 @@ function h(s) {
19
21
  return "bankError";
20
22
  }
21
23
  }
22
- function g(s) {
24
+ function T(s) {
23
25
  f("Payroll.RecoveryCasesResubmit");
24
26
  const { t: r } = a("Payroll.RecoveryCasesResubmit"), { Text: o } = R();
25
27
  if (!s)
@@ -60,6 +62,6 @@ function g(s) {
60
62
  };
61
63
  }
62
64
  export {
63
- g as useRecoveryCaseErrorCode
65
+ T as useRecoveryCaseErrorCode
64
66
  };
65
67
  //# sourceMappingURL=useRecoveryCaseErrorCode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRecoveryCaseErrorCode.js","sources":["../../../../src/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Trans, useTranslation } from 'react-i18next'\nimport styles from './RecoveryCaseErrorCode.module.scss'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport interface RecoveryCaseErrorCodeContent {\n title: string | null\n subtitle: string | null\n description: ReactNode[]\n}\n\ntype ErrorCodeKey = 'R01' | 'R02' | 'R16' | 'R29' | 'bankError'\n\nfunction getErrorCodeKey(errorCode: string | null | undefined): ErrorCodeKey {\n switch (errorCode) {\n case 'R01':\n return 'R01'\n case 'R02':\n return 'R02'\n case 'R16':\n return 'R16'\n case 'R29':\n return 'R29'\n default:\n return 'bankError'\n }\n}\n\nexport function useRecoveryCaseErrorCode(\n errorCode: string | null | undefined,\n): RecoveryCaseErrorCodeContent {\n useI18n('Payroll.RecoveryCasesResubmit')\n const { t } = useTranslation('Payroll.RecoveryCasesResubmit')\n const { Text } = useComponentContext()\n\n if (!errorCode) {\n return {\n title: null,\n subtitle: null,\n description: [],\n }\n }\n\n const errorCodeKey = getErrorCodeKey(errorCode)\n\n const transComponents = {\n medium: <Text as=\"span\" weight=\"medium\" />,\n }\n\n const description: ReactNode[] = [\n <Text key=\"body\">\n <Trans t={t} i18nKey={`errorCodes.${errorCodeKey}.body`} components={transComponents} />\n </Text>,\n ]\n\n if (errorCodeKey === 'R29') {\n const achCodes = Object.values(t('errorCodes.R29.achCodes', { returnObjects: true }))\n description.push(\n <Flex key=\"instruction\" flexDirection=\"column\" gap={16}>\n <Text>{t('errorCodes.R29.listDescription')}</Text>\n <ul className={styles.compactList}>\n {achCodes.map((code, index) => (\n <li key={index}>{code}</li>\n ))}\n </ul>\n <Text>\n <Trans t={t} i18nKey=\"errorCodes.R29.instruction\" components={transComponents} />\n </Text>\n </Flex>,\n )\n } else {\n const instruction = t(`errorCodes.${errorCodeKey}.instruction`)\n if (instruction) {\n description.push(\n <Text key=\"instruction\">\n <Trans\n t={t}\n i18nKey={`errorCodes.${errorCodeKey}.instruction`}\n components={transComponents}\n />\n </Text>,\n )\n }\n }\n\n return {\n title: t(`errorCodes.${errorCodeKey}.title`),\n subtitle: t(`errorCodes.${errorCodeKey}.subtitle`),\n description,\n }\n}\n"],"names":["getErrorCodeKey","errorCode","useRecoveryCaseErrorCode","useI18n","t","useTranslation","Text","useComponentContext","errorCodeKey","transComponents","jsx","description","Trans","achCodes","jsxs","Flex","styles","code","index"],"mappings":";;;;;;;AAeA,SAASA,EAAgBC,GAAoD;AAC3E,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb;AAEO,SAASC,EACd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BAAAI;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,GAAAR;AAAA,UACA,SAAS,cAAcI,CAAY;AAAA,UACnC,YAAYC;AAAA,QAAA;AAAA,MAAA,KAJN,aAMV;AAAA,IAAA;AAKN,SAAO;AAAA,IACL,OAAOL,EAAE,cAAcI,CAAY,QAAQ;AAAA,IAC3C,UAAUJ,EAAE,cAAcI,CAAY,WAAW;AAAA,IACjD,aAAAG;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"useRecoveryCaseErrorCode.js","sources":["../../../../src/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Trans, useTranslation } from 'react-i18next'\nimport styles from './RecoveryCaseErrorCode.module.scss'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport interface RecoveryCaseErrorCodeContent {\n title: string | null\n subtitle: string | null\n description: ReactNode[]\n}\n\ntype ErrorCodeKey = 'R01' | 'R02' | 'R16' | 'R29' | 'bankError'\n\nfunction getErrorCodeKey(errorCode: string | null | undefined): ErrorCodeKey {\n switch (errorCode) {\n case 'R01':\n return 'R01'\n case 'R02':\n return 'R02'\n case 'R16':\n return 'R16'\n case 'R29':\n return 'R29'\n default:\n return 'bankError'\n }\n}\n\nexport function useRecoveryCaseErrorCode(\n errorCode: string | null | undefined,\n): RecoveryCaseErrorCodeContent {\n useI18n('Payroll.RecoveryCasesResubmit')\n const { t } = useTranslation('Payroll.RecoveryCasesResubmit')\n const { Text } = useComponentContext()\n\n if (!errorCode) {\n return {\n title: null,\n subtitle: null,\n description: [],\n }\n }\n\n const errorCodeKey = getErrorCodeKey(errorCode)\n\n const transComponents = {\n medium: <Text as=\"span\" weight=\"medium\" />,\n }\n\n const description: ReactNode[] = [\n <Text key=\"body\">\n <Trans t={t} i18nKey={`errorCodes.${errorCodeKey}.body`} components={transComponents} />\n </Text>,\n ]\n\n if (errorCodeKey === 'R29') {\n const achCodes = Object.values(t('errorCodes.R29.achCodes', { returnObjects: true }))\n description.push(\n <Flex key=\"instruction\" flexDirection=\"column\" gap={16}>\n <Text>{t('errorCodes.R29.listDescription')}</Text>\n <ul className={styles.compactList}>\n {achCodes.map((code, index) => (\n <li key={index}>{code}</li>\n ))}\n </ul>\n <Text>\n <Trans t={t} i18nKey=\"errorCodes.R29.instruction\" components={transComponents} />\n </Text>\n </Flex>,\n )\n } else {\n const instruction = t(`errorCodes.${errorCodeKey}.instruction`)\n if (instruction) {\n description.push(\n <Text key=\"instruction\">\n <Trans\n t={t}\n i18nKey={`errorCodes.${errorCodeKey}.instruction`}\n components={transComponents}\n />\n </Text>,\n )\n }\n }\n\n return {\n title: t(`errorCodes.${errorCodeKey}.title`),\n subtitle: t(`errorCodes.${errorCodeKey}.subtitle`),\n description,\n }\n}\n"],"names":["getErrorCodeKey","errorCode","useRecoveryCaseErrorCode","useI18n","t","useTranslation","Text","useComponentContext","errorCodeKey","transComponents","jsx","description","Trans","achCodes","jsxs","Flex","styles","code","index"],"mappings":";;;;;;;;;AAeA,SAASA,EAAgBC,GAAoD;AAC3E,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb;AAEO,SAASC,EACdD,GAC8B;AAC9B,EAAAE,EAAQ,+BAA+B;AACvC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,+BAA+B,GACtD,EAAE,MAAAC,EAAA,IAASC,EAAA;AAEjB,MAAI,CAACN;AACH,WAAO;AAAA,MACL,OAAO;AAAA,MACP,UAAU;AAAA,MACV,aAAa,CAAA;AAAA,IAAC;AAIlB,QAAMO,IAAeR,EAAgBC,CAAS,GAExCQ,IAAkB;AAAA,IACtB,QAAQ,gBAAAC,EAACJ,GAAA,EAAK,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from './PayrollEditEmployee/PayrollEditEmployee';
4
4
  export { PayrollHistory } from './PayrollHistory/PayrollHistory';
5
5
  export { PayrollLanding } from './PayrollLanding/PayrollLanding';
6
6
  export { PayrollList } from './PayrollList/PayrollList';
7
+ export { OffCycleReasonSelection } from './OffCycleReasonSelection';
8
+ export type { OffCycleReason, OffCycleReasonDefaults, OffCycleReasonSelectionProps, SelectReasonPayload, } from './OffCycleReasonSelection';
7
9
  export { PayrollOverview } from './PayrollOverview/PayrollOverview';
8
10
  export { PayrollFlow } from './PayrollFlow/PayrollFlow';
9
11
  export { PayrollReceipts } from './PayrollReceipts/PayrollReceipts';
@@ -11,3 +13,5 @@ export { ConfirmWireDetails } from './ConfirmWireDetails/ConfirmWireDetails';
11
13
  export type { ConfirmWireDetailsProps, ConfirmWireDetailsComponentType } from './ConfirmWireDetails';
12
14
  export { PayrollBlockerList, type ApiPayrollBlocker } from './PayrollBlocker';
13
15
  export { RecoveryCases } from './RecoveryCases/RecoveryCases';
16
+ export { PayPeriodDateForm } from './PayPeriodDateForm';
17
+ export type { PayPeriodDateFormProps, PayPeriodDateFormData, PayrollDateType, } from './PayPeriodDateForm';
@@ -1,25 +1,29 @@
1
1
  import { PayrollConfiguration as e } from "./PayrollConfiguration/PayrollConfiguration.js";
2
2
  import { PayrollEditEmployee as t } from "./PayrollEditEmployee/PayrollEditEmployee.js";
3
- import { PayrollHistory as f } from "./PayrollHistory/PayrollHistory.js";
3
+ import { PayrollHistory as a } from "./PayrollHistory/PayrollHistory.js";
4
4
  import { PayrollLanding as p } from "./PayrollLanding/PayrollLanding.js";
5
5
  import { PayrollList as y } from "./PayrollList/PayrollList.js";
6
6
  import { PayrollOverview as P } from "./PayrollOverview/PayrollOverview.js";
7
7
  import { PayrollFlow as n } from "./PayrollFlow/PayrollFlow.js";
8
- import { PayrollReceipts as v } from "./PayrollReceipts/PayrollReceipts.js";
9
- import { ConfirmWireDetails as L } from "./ConfirmWireDetails/ConfirmWireDetails.js";
10
- import { RecoveryCases as g } from "./RecoveryCases/RecoveryCases.js";
8
+ import { PayrollReceipts as C } from "./PayrollReceipts/PayrollReceipts.js";
9
+ import { ConfirmWireDetails as v } from "./ConfirmWireDetails/ConfirmWireDetails.js";
10
+ import { RecoveryCases as R } from "./RecoveryCases/RecoveryCases.js";
11
+ import { OffCycleReasonSelection as w } from "./OffCycleReasonSelection/OffCycleReasonSelection.js";
11
12
  import { PayrollBlockerList as E } from "./PayrollBlocker/components/PayrollBlockerList.js";
13
+ import { PayPeriodDateForm as O } from "./PayPeriodDateForm/PayPeriodDateForm.js";
12
14
  export {
13
- L as ConfirmWireDetails,
15
+ v as ConfirmWireDetails,
16
+ w as OffCycleReasonSelection,
17
+ O as PayPeriodDateForm,
14
18
  E as PayrollBlockerList,
15
19
  e as PayrollConfiguration,
16
20
  t as PayrollEditEmployee,
17
21
  n as PayrollFlow,
18
- f as PayrollHistory,
22
+ a as PayrollHistory,
19
23
  p as PayrollLanding,
20
24
  y as PayrollList,
21
25
  P as PayrollOverview,
22
- v as PayrollReceipts,
23
- g as RecoveryCases
26
+ C as PayrollReceipts,
27
+ R as RecoveryCases
24
28
  };
25
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
@@ -9,11 +9,12 @@ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
9
9
  import "@tanstack/react-query";
10
10
  import { useBase as M } from "../Base/useBase.js";
11
11
  import "../../shared/constants.js";
12
+ import "classnames";
12
13
  import "../../contexts/ComponentAdapter/useComponentContext.js";
13
14
  import "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
15
  import "dompurify";
15
16
  import "../../contexts/LocaleProvider/useLocale.js";
16
- const F = ({
17
+ const J = ({
17
18
  companyId: r,
18
19
  payrollId: s,
19
20
  employeeUuids: a,
@@ -65,6 +66,6 @@ const F = ({
65
66
  };
66
67
  };
67
68
  export {
68
- F as usePreparedPayrollData
69
+ J as usePreparedPayrollData
69
70
  };
70
71
  //# sourceMappingURL=usePreparedPayrollData.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payroll'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayrollPrepareSortBy } from '@gusto/embedded-api/models/components/payrollpreparesortby'\nimport { useBase } from '../Base'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: PayrollPrepareSortBy\n onDataReady?: (preparedPayroll: PayrollPrepared) => void\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleObject | undefined\n isLoading: boolean\n isPaginating: boolean\n hasInitialData: boolean\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n onDataReady,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const hasInitialDataRef = useRef(false)\n const { baseSubmitHandler } = useBase()\n\n const employeeUuidsKey = useMemo(() => employeeUuids?.join(',') ?? '', [employeeUuids])\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n if (result.payrollPrepared) {\n hasInitialDataRef.current = true\n onDataReady?.(result.payrollPrepared)\n }\n })\n }, [\n companyId,\n payrollId,\n preparePayroll,\n employeeUuidsKey,\n baseSubmitHandler,\n sortBy,\n onDataReady,\n ])\n\n useEffect(() => {\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isInitialLoading = isPreparePayrollPending && !hasInitialDataRef.current\n const isPaginating = isPreparePayrollPending && hasInitialDataRef.current\n const isLoading = isInitialLoading || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleObject,\n isLoading,\n isPaginating,\n hasInitialData: hasInitialDataRef.current,\n }\n}\n"],"names":["usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","onDataReady","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","hasInitialDataRef","useRef","baseSubmitHandler","useBase","employeeUuidsKey","useMemo","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","handlePreparePayroll","useCallback","result","useEffect","isInitialLoading","isPaginating","isLoading"],"mappings":";;;;;;;;;;;;;;;AAyBO,MAAMA,IAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AACF,MAAkE;AAChE,QAAM,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GACI,CAACC,GAAiBC,CAAkB,IAAIC,EAAA,GACxCC,IAAoBC,EAAO,EAAK,GAChC,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GAExBC,IAAmBC,EAAQ,MAAMd,GAAe,KAAK,GAAG,KAAK,IAAI,CAACA,CAAa,CAAC,GAEhF,EAAE,MAAMe,GAAiB,WAAWC,MAAyBC;AAAA,IACjE;AAAA,MACE,WAAAnB;AAAA,MACA,eAAeQ,GAAiB,WAAW,mBAAmB;AAAA,IAAA;AAAA,IAEhE;AAAA,MACE,SAAS,CAAC,CAACA,GAAiB,WAAW;AAAA,IAAA;AAAA,EACzC,GAGIY,IAAuBC,EAAY,YAAY;AACnD,UAAMR,EAAkB,MAAM,YAAY;AACxC,YAAMS,IAAS,MAAMjB,EAAe;AAAA,QAClC,SAAS;AAAA,UACP,WAAAL;AAAA,UACA,WAAAC;AAAA,UACA,QAAAE;AAAA,UACA,aAAa;AAAA,YACX,eAAAD;AAAA,UAAA;AAAA,QACF;AAAA,MACF,CACD;AACD,MAAAO,EAAmBa,EAAO,eAAe,GACrCA,EAAO,oBACTX,EAAkB,UAAU,IAC5BP,IAAckB,EAAO,eAAe;AAAA,IAExC,CAAC;AAAA,EACH,GAAG;AAAA,IACDtB;AAAA,IACAC;AAAA,IACAI;AAAA,IACAU;AAAA,IACAF;AAAA,IACAV;AAAA,IACAC;AAAA,EAAA,CACD;AAED,EAAAmB,EAAU,MAAM;AACd,IAAKH,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMI,IAAmBlB,KAA2B,CAACK,EAAkB,SACjEc,IAAenB,KAA2BK,EAAkB,SAC5De,IAAYF,KAAoBN;AAEtC,SAAO;AAAA,IACL,sBAAAE;AAAA,IACA,iBAAAZ;AAAA,IACA,aAAaS,GAAiB;AAAA,IAC9B,WAAAS;AAAA,IACA,cAAAD;AAAA,IACA,gBAAgBd,EAAkB;AAAA,EAAA;AAEtC;"}
1
+ {"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payroll'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayrollPrepareSortBy } from '@gusto/embedded-api/models/components/payrollpreparesortby'\nimport { useBase } from '../Base'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: PayrollPrepareSortBy\n onDataReady?: (preparedPayroll: PayrollPrepared) => void\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleObject | undefined\n isLoading: boolean\n isPaginating: boolean\n hasInitialData: boolean\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n onDataReady,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const hasInitialDataRef = useRef(false)\n const { baseSubmitHandler } = useBase()\n\n const employeeUuidsKey = useMemo(() => employeeUuids?.join(',') ?? '', [employeeUuids])\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n if (result.payrollPrepared) {\n hasInitialDataRef.current = true\n onDataReady?.(result.payrollPrepared)\n }\n })\n }, [\n companyId,\n payrollId,\n preparePayroll,\n employeeUuidsKey,\n baseSubmitHandler,\n sortBy,\n onDataReady,\n ])\n\n useEffect(() => {\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isInitialLoading = isPreparePayrollPending && !hasInitialDataRef.current\n const isPaginating = isPreparePayrollPending && hasInitialDataRef.current\n const isLoading = isInitialLoading || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleObject,\n isLoading,\n isPaginating,\n hasInitialData: hasInitialDataRef.current,\n }\n}\n"],"names":["usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","onDataReady","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","hasInitialDataRef","useRef","baseSubmitHandler","useBase","employeeUuidsKey","useMemo","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","handlePreparePayroll","useCallback","result","useEffect","isInitialLoading","isPaginating","isLoading"],"mappings":";;;;;;;;;;;;;;;;AAyBO,MAAMA,IAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AACF,MAAkE;AAChE,QAAM,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GACI,CAACC,GAAiBC,CAAkB,IAAIC,EAAA,GACxCC,IAAoBC,EAAO,EAAK,GAChC,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GAExBC,IAAmBC,EAAQ,MAAMd,GAAe,KAAK,GAAG,KAAK,IAAI,CAACA,CAAa,CAAC,GAEhF,EAAE,MAAMe,GAAiB,WAAWC,MAAyBC;AAAA,IACjE;AAAA,MACE,WAAAnB;AAAA,MACA,eAAeQ,GAAiB,WAAW,mBAAmB;AAAA,IAAA;AAAA,IAEhE;AAAA,MACE,SAAS,CAAC,CAACA,GAAiB,WAAW;AAAA,IAAA;AAAA,EACzC,GAGIY,IAAuBC,EAAY,YAAY;AACnD,UAAMR,EAAkB,MAAM,YAAY;AACxC,YAAMS,IAAS,MAAMjB,EAAe;AAAA,QAClC,SAAS;AAAA,UACP,WAAAL;AAAA,UACA,WAAAC;AAAA,UACA,QAAAE;AAAA,UACA,aAAa;AAAA,YACX,eAAAD;AAAA,UAAA;AAAA,QACF;AAAA,MACF,CACD;AACD,MAAAO,EAAmBa,EAAO,eAAe,GACrCA,EAAO,oBACTX,EAAkB,UAAU,IAC5BP,IAAckB,EAAO,eAAe;AAAA,IAExC,CAAC;AAAA,EACH,GAAG;AAAA,IACDtB;AAAA,IACAC;AAAA,IACAI;AAAA,IACAU;AAAA,IACAF;AAAA,IACAV;AAAA,IACAC;AAAA,EAAA,CACD;AAED,EAAAmB,EAAU,MAAM;AACd,IAAKH,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMI,IAAmBlB,KAA2B,CAACK,EAAkB,SACjEc,IAAenB,KAA2BK,EAAkB,SAC5De,IAAYF,KAAoBN;AAEtC,SAAO;AAAA,IACL,sBAAAE;AAAA,IACA,iBAAAZ;AAAA,IACA,aAAaS,GAAiB;AAAA,IAC9B,WAAAS;AAAA,IACA,cAAAD;AAAA,IACA,gBAAgBd,EAAkB;AAAA,EAAA;AAEtC;"}
@@ -7,12 +7,13 @@ import { ApiProvider as C } from "../ApiProvider/ApiProvider.js";
7
7
  import { LoadingIndicatorProvider as I } from "../LoadingIndicatorProvider/LoadingIndicatorProvider.js";
8
8
  import { SDKI18next as t } from "./SDKI18next.js";
9
9
  import "../../shared/constants.js";
10
+ import "classnames";
10
11
  import { InternalError as x } from "../../components/Common/InternalError/InternalError.js";
11
12
  import "../ComponentAdapter/useComponentContext.js";
12
13
  import { LocaleProvider as L } from "../LocaleProvider/LocaleProvider.js";
13
14
  import "../LocaleProvider/useLocale.js";
14
15
  import { ThemeProvider as U } from "../ThemeProvider/ThemeProvider.js";
15
- const T = (a) => {
16
+ const z = (a) => {
16
17
  const {
17
18
  children: d,
18
19
  config: e,
@@ -51,6 +52,6 @@ const T = (a) => {
51
52
  ) }, n) }) }) }) }) });
52
53
  };
53
54
  export {
54
- T as GustoProviderCustomUIAdapter
55
+ z as GustoProviderCustomUIAdapter
55
56
  };
56
57
  //# sourceMappingURL=GustoProviderCustomUIAdapter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GustoProviderCustomUIAdapter.js","sources":["../../../src/contexts/GustoProvider/GustoProviderCustomUIAdapter.tsx"],"sourcesContent":["import type React from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { I18nextProvider } from 'react-i18next'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useEffect } from 'react'\nimport { ComponentsProvider } from '../ComponentAdapter/ComponentsProvider'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport { ApiProvider } from '../ApiProvider/ApiProvider'\nimport { LoadingIndicatorProvider } from '../LoadingIndicatorProvider/LoadingIndicatorProvider'\nimport type { LoadingIndicatorContextProps } from '../LoadingIndicatorProvider/useLoadingIndicator'\nimport { SDKI18next } from './SDKI18next'\nimport { InternalError } from '@/components/Common'\nimport { LocaleProvider } from '@/contexts/LocaleProvider'\nimport { ThemeProvider } from '@/contexts/ThemeProvider'\nimport type { GustoSDKTheme } from '@/contexts/ThemeProvider/theme'\nimport type { ResourceDictionary, SupportedLanguages } from '@/types/Helpers'\nimport type { SDKHooks } from '@/types/hooks'\n\nexport interface APIConfig {\n baseUrl: string\n headers?: HeadersInit\n hooks?: SDKHooks\n}\n\nexport interface GustoProviderProps {\n config: APIConfig\n dictionary?: ResourceDictionary\n lng?: string\n locale?: string\n currency?: string\n theme?: GustoSDKTheme\n queryClient?: QueryClient\n components: ComponentsContextType\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n}\n\nexport interface GustoProviderCustomUIAdapterProps extends GustoProviderProps {\n children?: React.ReactNode\n}\n\n/**\n * A provider that accepts UI component adapters through the components prop\n */\nconst GustoProviderCustomUIAdapter: React.FC<GustoProviderCustomUIAdapterProps> = props => {\n const {\n children,\n config,\n dictionary,\n lng = 'en',\n locale = 'en-US',\n currency = 'USD',\n theme,\n components,\n LoaderComponent,\n queryClient,\n } = props\n\n // Handle dictionary resources\n if (dictionary) {\n for (const language in dictionary) {\n const lang = language as SupportedLanguages\n for (const ns in dictionary[lang]) {\n // Adding resources overrides to i18next instance - initial load will override common namespace and add component specific dictionaries provided by partners\n SDKI18next.addResourceBundle(\n lang,\n ns,\n (dictionary[lang] as Record<string, unknown>)[ns],\n true,\n true,\n )\n }\n }\n }\n\n // Handle language change\n useEffect(() => {\n void (async () => {\n await SDKI18next.changeLanguage(lng)\n })()\n }, [lng])\n\n return (\n <ComponentsProvider value={components}>\n <LoadingIndicatorProvider value={LoaderComponent}>\n <ErrorBoundary FallbackComponent={InternalError}>\n <ThemeProvider theme={theme}>\n <LocaleProvider locale={locale} currency={currency}>\n <I18nextProvider i18n={SDKI18next} key={lng}>\n <ApiProvider\n url={config.baseUrl}\n headers={config.headers}\n hooks={config.hooks}\n queryClient={queryClient}\n >\n {children}\n </ApiProvider>\n </I18nextProvider>\n </LocaleProvider>\n </ThemeProvider>\n </ErrorBoundary>\n </LoadingIndicatorProvider>\n </ComponentsProvider>\n )\n}\n\nexport { GustoProviderCustomUIAdapter }\n"],"names":["GustoProviderCustomUIAdapter","props","children","config","dictionary","lng","locale","currency","theme","components","LoaderComponent","queryClient","language","lang","ns","SDKI18next","useEffect","jsx","ComponentsProvider","LoadingIndicatorProvider","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider"],"mappings":";;;;;;;;;;;;;;AA2CA,MAAMA,IAA4E,CAAAC,MAAS;AACzF,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,EAAA,IACEV;AAGJ,MAAIG;AACF,eAAWQ,KAAYR,GAAY;AACjC,YAAMS,IAAOD;AACb,iBAAWE,KAAMV,EAAWS,CAAI;AAE9B,QAAAE,EAAW;AAAA,UACTF;AAAA,UACAC;AAAA,UACCV,EAAWS,CAAI,EAA8BC,CAAE;AAAA,UAChD;AAAA,UACA;AAAA,QAAA;AAAA,IAGN;AAIF,SAAAE,EAAU,MAAM;AACd,KAAM,YACJ,MAAMD,EAAW,eAAeV,CAAG;AAAA,EAEvC,GAAG,CAACA,CAAG,CAAC,GAGN,gBAAAY,EAACC,KAAmB,OAAOT,GACzB,4BAACU,GAAA,EAAyB,OAAOT,GAC/B,UAAA,gBAAAO,EAACG,GAAA,EAAc,mBAAmBC,GAChC,UAAA,gBAAAJ,EAACK,GAAA,EAAc,OAAAd,GACb,UAAA,gBAAAS,EAACM,GAAA,EAAe,QAAAjB,GAAgB,UAAAC,GAC9B,UAAA,gBAAAU,EAACO,GAAA,EAAgB,MAAMT,GACrB,UAAA,gBAAAE;AAAA,IAACQ;AAAA,IAAA;AAAA,MACC,KAAKtB,EAAO;AAAA,MACZ,SAASA,EAAO;AAAA,MAChB,OAAOA,EAAO;AAAA,MACd,aAAAQ;AAAA,MAEC,UAAAT;AAAA,IAAA;AAAA,EAAA,KAPmCG,CASxC,EAAA,CACF,EAAA,CACF,EAAA,CACF,GACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"GustoProviderCustomUIAdapter.js","sources":["../../../src/contexts/GustoProvider/GustoProviderCustomUIAdapter.tsx"],"sourcesContent":["import type React from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { I18nextProvider } from 'react-i18next'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useEffect } from 'react'\nimport { ComponentsProvider } from '../ComponentAdapter/ComponentsProvider'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport { ApiProvider } from '../ApiProvider/ApiProvider'\nimport { LoadingIndicatorProvider } from '../LoadingIndicatorProvider/LoadingIndicatorProvider'\nimport type { LoadingIndicatorContextProps } from '../LoadingIndicatorProvider/useLoadingIndicator'\nimport { SDKI18next } from './SDKI18next'\nimport { InternalError } from '@/components/Common'\nimport { LocaleProvider } from '@/contexts/LocaleProvider'\nimport { ThemeProvider } from '@/contexts/ThemeProvider'\nimport type { GustoSDKTheme } from '@/contexts/ThemeProvider/theme'\nimport type { ResourceDictionary, SupportedLanguages } from '@/types/Helpers'\nimport type { SDKHooks } from '@/types/hooks'\n\nexport interface APIConfig {\n baseUrl: string\n headers?: HeadersInit\n hooks?: SDKHooks\n}\n\nexport interface GustoProviderProps {\n config: APIConfig\n dictionary?: ResourceDictionary\n lng?: string\n locale?: string\n currency?: string\n theme?: GustoSDKTheme\n queryClient?: QueryClient\n components: ComponentsContextType\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n}\n\nexport interface GustoProviderCustomUIAdapterProps extends GustoProviderProps {\n children?: React.ReactNode\n}\n\n/**\n * A provider that accepts UI component adapters through the components prop\n */\nconst GustoProviderCustomUIAdapter: React.FC<GustoProviderCustomUIAdapterProps> = props => {\n const {\n children,\n config,\n dictionary,\n lng = 'en',\n locale = 'en-US',\n currency = 'USD',\n theme,\n components,\n LoaderComponent,\n queryClient,\n } = props\n\n // Handle dictionary resources\n if (dictionary) {\n for (const language in dictionary) {\n const lang = language as SupportedLanguages\n for (const ns in dictionary[lang]) {\n // Adding resources overrides to i18next instance - initial load will override common namespace and add component specific dictionaries provided by partners\n SDKI18next.addResourceBundle(\n lang,\n ns,\n (dictionary[lang] as Record<string, unknown>)[ns],\n true,\n true,\n )\n }\n }\n }\n\n // Handle language change\n useEffect(() => {\n void (async () => {\n await SDKI18next.changeLanguage(lng)\n })()\n }, [lng])\n\n return (\n <ComponentsProvider value={components}>\n <LoadingIndicatorProvider value={LoaderComponent}>\n <ErrorBoundary FallbackComponent={InternalError}>\n <ThemeProvider theme={theme}>\n <LocaleProvider locale={locale} currency={currency}>\n <I18nextProvider i18n={SDKI18next} key={lng}>\n <ApiProvider\n url={config.baseUrl}\n headers={config.headers}\n hooks={config.hooks}\n queryClient={queryClient}\n >\n {children}\n </ApiProvider>\n </I18nextProvider>\n </LocaleProvider>\n </ThemeProvider>\n </ErrorBoundary>\n </LoadingIndicatorProvider>\n </ComponentsProvider>\n )\n}\n\nexport { GustoProviderCustomUIAdapter }\n"],"names":["GustoProviderCustomUIAdapter","props","children","config","dictionary","lng","locale","currency","theme","components","LoaderComponent","queryClient","language","lang","ns","SDKI18next","useEffect","jsx","ComponentsProvider","LoadingIndicatorProvider","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider"],"mappings":";;;;;;;;;;;;;;;AA2CA,MAAMA,IAA4E,CAAAC,MAAS;AACzF,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,EAAA,IACEV;AAGJ,MAAIG;AACF,eAAWQ,KAAYR,GAAY;AACjC,YAAMS,IAAOD;AACb,iBAAWE,KAAMV,EAAWS,CAAI;AAE9B,QAAAE,EAAW;AAAA,UACTF;AAAA,UACAC;AAAA,UACCV,EAAWS,CAAI,EAA8BC,CAAE;AAAA,UAChD;AAAA,UACA;AAAA,QAAA;AAAA,IAGN;AAIF,SAAAE,EAAU,MAAM;AACd,KAAM,YACJ,MAAMD,EAAW,eAAeV,CAAG;AAAA,EAEvC,GAAG,CAACA,CAAG,CAAC,GAGN,gBAAAY,EAACC,KAAmB,OAAOT,GACzB,4BAACU,GAAA,EAAyB,OAAOT,GAC/B,UAAA,gBAAAO,EAACG,GAAA,EAAc,mBAAmBC,GAChC,UAAA,gBAAAJ,EAACK,GAAA,EAAc,OAAAd,GACb,UAAA,gBAAAS,EAACM,GAAA,EAAe,QAAAjB,GAAgB,UAAAC,GAC9B,UAAA,gBAAAU,EAACO,GAAA,EAAgB,MAAMT,GACrB,UAAA,gBAAAE;AAAA,IAACQ;AAAA,IAAA;AAAA,MACC,KAAKtB,EAAO;AAAA,MACZ,SAASA,EAAO;AAAA,MAChB,OAAOA,EAAO;AAAA,MACd,aAAAQ;AAAA,MAEC,UAAAT;AAAA,IAAA;AAAA,EAAA,KAPmCG,CASxC,EAAA,CACF,EAAA,CACF,EAAA,CACF,GACF,GACF;AAEJ;"}