@gusto/embedded-react-sdk 0.31.1 → 0.32.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 (415) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/assets/icons/icon-arrow-right.svg.js +10 -0
  3. package/dist/assets/icons/icon-arrow-right.svg.js.map +1 -0
  4. package/dist/components/Base/Base.js +46 -45
  5. package/dist/components/Base/Base.js.map +1 -1
  6. package/dist/components/Base/useBase.d.ts +2 -3
  7. package/dist/components/Base/useBase.js.map +1 -1
  8. package/dist/components/Base/useBaseSubmit.js +32 -19
  9. package/dist/components/Base/useBaseSubmit.js.map +1 -1
  10. package/dist/components/Common/DataView/DataView.js +1 -1
  11. package/dist/components/Common/DocumentList/DocumentList.js +1 -1
  12. package/dist/components/Common/DocumentViewer/DocumentViewer.js +1 -1
  13. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +1 -1
  14. package/dist/components/Common/RequirementsList/RequirementsList.js +1 -1
  15. package/dist/components/Common/RequirementsList/RequirementsList.js.map +1 -1
  16. package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +1 -1
  17. package/dist/components/Common/SignatureForm/SignatureForm.js +12 -10
  18. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  19. package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -2
  20. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  21. package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -6
  22. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  23. package/dist/components/Common/UI/Box/Box.d.ts +2 -0
  24. package/dist/components/Common/UI/Box/Box.js +13 -0
  25. package/dist/components/Common/UI/Box/Box.js.map +1 -0
  26. package/dist/components/Common/UI/Box/Box.module.scss.js +12 -0
  27. package/dist/components/Common/UI/Box/Box.module.scss.js.map +1 -0
  28. package/dist/components/Common/UI/Box/BoxTypes.d.ts +15 -0
  29. package/dist/components/Common/UI/Box/index.d.ts +2 -0
  30. package/dist/components/Common/UI/Dialog/Dialog.js +1 -1
  31. package/dist/components/Common/UI/Input/InputTypes.d.ts +1 -1
  32. package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
  33. package/dist/components/Common/UI/List/List.module.scss.js +1 -1
  34. package/dist/components/Common/UI/Modal/Modal.js +1 -1
  35. package/dist/components/Common/UI/Tabs/Tabs.js +1 -1
  36. package/dist/components/Common/UI/TextInput/TextInput.js +30 -28
  37. package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
  38. package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -1
  39. package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
  40. package/dist/components/Company/AssignSignatory/AssignSignatory.js +3 -2
  41. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  42. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +4 -3
  43. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  44. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
  45. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  46. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
  47. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
  48. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -4
  49. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  50. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
  51. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  52. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
  53. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  54. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -4
  55. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  56. package/dist/components/Company/AssignSignatory/TitleSelect.js +5 -5
  57. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  58. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -6
  59. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  60. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
  61. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  62. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -5
  63. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  64. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -4
  65. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  66. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +3 -2
  67. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  68. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -6
  69. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  70. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +7 -5
  71. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  72. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
  73. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  74. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
  75. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  76. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  77. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  78. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +4 -3
  79. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  80. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
  81. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  82. package/dist/components/Company/FederalTaxes/Actions.js +7 -6
  83. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  84. package/dist/components/Company/FederalTaxes/FederalTaxes.js +4 -3
  85. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  86. package/dist/components/Company/FederalTaxes/Form.js +5 -3
  87. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  88. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +7 -6
  89. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  90. package/dist/components/Company/Industry/Actions.js +8 -7
  91. package/dist/components/Company/Industry/Actions.js.map +1 -1
  92. package/dist/components/Company/Industry/Context.js +8 -7
  93. package/dist/components/Company/Industry/Context.js.map +1 -1
  94. package/dist/components/Company/Industry/Edit.js +3 -2
  95. package/dist/components/Company/Industry/Edit.js.map +1 -1
  96. package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
  97. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  98. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  99. package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -3
  100. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  101. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -4
  102. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  103. package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
  104. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  105. package/dist/components/Company/Locations/LocationsList/List.js +7 -6
  106. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  107. package/dist/components/Company/Locations/LocationsList/LocationsList.js +4 -3
  108. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  109. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -4
  110. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  111. package/dist/components/Company/OnboardingOverview/Completed.js +12 -10
  112. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  113. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +39 -26
  114. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  115. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +8 -7
  116. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  117. package/dist/components/Company/OnboardingOverview/context.js +5 -4
  118. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  119. package/dist/components/Company/PaySchedule/PaySchedule.js +25 -22
  120. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  121. package/dist/components/Company/PaySchedule/_parts/Actions.js +3 -2
  122. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  123. package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
  124. package/dist/components/Company/PaySchedule/_parts/Head.js +13 -11
  125. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  126. package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
  127. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  128. package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -6
  129. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  130. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
  131. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  132. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -4
  133. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  134. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
  135. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  136. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
  137. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  138. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -4
  139. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  140. package/dist/components/Company/index.js +20 -20
  141. package/dist/components/Contractor/Address/Address.js +7 -7
  142. package/dist/components/Contractor/Address/Address.js.map +1 -1
  143. package/dist/components/Contractor/Address/Form.js +1 -1
  144. package/dist/components/Contractor/Address/useAddress.js +7 -6
  145. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  146. package/dist/components/Contractor/ContractorList/index.js +32 -31
  147. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  148. package/dist/components/Contractor/NewHireReport/NewHireReport.js +14 -13
  149. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  150. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +12 -11
  151. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  152. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  153. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  154. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +4 -3
  155. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  156. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +135 -108
  157. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  158. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +4 -2
  159. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  160. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +84 -0
  161. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js +23 -0
  162. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js.map +1 -0
  163. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.d.ts +3 -31
  164. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +63 -69
  165. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  166. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +2 -1
  167. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +29 -29
  168. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  169. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +2 -1
  170. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +32 -29
  171. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  172. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +0 -1
  173. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
  174. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +4 -2
  175. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  176. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +8 -6
  177. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  178. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +4 -2
  179. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  180. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +28 -27
  181. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  182. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  183. package/dist/components/Contractor/Profile/useContractorProfile.js +4 -3
  184. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  185. package/dist/components/Contractor/Submit/Submit.js +21 -20
  186. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  187. package/dist/components/Employee/Compensation/Actions.js +13 -12
  188. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  189. package/dist/components/Employee/Compensation/Edit.js +17 -16
  190. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  191. package/dist/components/Employee/Compensation/List.js +23 -22
  192. package/dist/components/Employee/Compensation/List.js.map +1 -1
  193. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +12 -11
  194. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  195. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +13 -12
  196. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  197. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +13 -12
  198. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  199. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +8 -7
  200. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  201. package/dist/components/Employee/Deductions/stateMachine.js +1 -1
  202. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +9 -8
  203. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  204. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +24 -22
  205. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  206. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
  207. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  208. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.d.ts +1 -0
  209. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  210. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  211. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +9 -9
  212. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  213. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +49 -43
  214. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
  215. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +150 -111
  216. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
  217. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
  218. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  219. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
  220. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  221. package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.d.ts +1 -0
  222. package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.js.map +1 -1
  223. package/dist/components/Employee/DocumentSigner/stateMachine.js +34 -22
  224. package/dist/components/Employee/DocumentSigner/stateMachine.js.map +1 -1
  225. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +4 -2
  226. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
  227. package/dist/components/Employee/EmployeeList/Actions.js +7 -6
  228. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  229. package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
  230. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  231. package/dist/components/Employee/EmployeeList/Head.js +7 -5
  232. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  233. package/dist/components/Employee/EmployeeList/List.js +3 -2
  234. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  235. package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -4
  236. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  237. package/dist/components/Employee/FederalTaxes/Actions.js +6 -5
  238. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  239. package/dist/components/Employee/FederalTaxes/FederalForm.js +12 -11
  240. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  241. package/dist/components/Employee/FederalTaxes/FederalTaxes.js +16 -15
  242. package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
  243. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +5 -4
  244. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  245. package/dist/components/Employee/Landing/Landing.js +50 -44
  246. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  247. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  248. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  249. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  250. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -4
  251. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  252. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
  253. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  254. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -6
  255. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  256. package/dist/components/Employee/PaymentMethod/Split.js +11 -10
  257. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  258. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -6
  259. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  260. package/dist/components/Employee/Profile/Actions.js +6 -5
  261. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  262. package/dist/components/Employee/Profile/AdminPersonalDetails.js +9 -8
  263. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  264. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  265. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  266. package/dist/components/Employee/Profile/useProfile.js +5 -4
  267. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  268. package/dist/components/Employee/StateTaxes/Actions.js +6 -5
  269. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  270. package/dist/components/Employee/StateTaxes/StateTaxes.js +29 -29
  271. package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
  272. package/dist/components/Employee/StateTaxes/useStateTaxes.js +5 -4
  273. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  274. package/dist/components/Employee/Taxes/Actions.js +7 -6
  275. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  276. package/dist/components/Employee/Taxes/FederalForm.js +14 -13
  277. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  278. package/dist/components/Employee/Taxes/Taxes.js +19 -19
  279. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  280. package/dist/components/Employee/Taxes/useTaxes.js +5 -4
  281. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  282. package/dist/components/Employee/index.js +22 -22
  283. package/dist/components/Flow/Flow.js +9 -7
  284. package/dist/components/Flow/Flow.js.map +1 -1
  285. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +17 -16
  286. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  287. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +0 -1
  288. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +32 -37
  289. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  290. package/dist/components/InformationRequests/InformationRequests.d.ts +1 -2
  291. package/dist/components/InformationRequests/InformationRequests.js +36 -43
  292. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  293. package/dist/components/InformationRequests/index.js +4 -4
  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/OffCycle/OffCycleFlowComponents.js +23 -21
  297. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  298. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.d.ts +2 -0
  299. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +79 -0
  300. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -0
  301. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +2 -0
  302. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +47 -0
  303. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -0
  304. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +14 -0
  305. package/dist/components/Payroll/OffCycleCreation/index.d.ts +3 -0
  306. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +2 -0
  307. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js +44 -0
  308. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -0
  309. package/dist/components/Payroll/OffCycleDeductionsSetting/index.d.ts +3 -0
  310. package/dist/components/Payroll/OffCycleDeductionsSetting/types.d.ts +10 -0
  311. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +1 -2
  312. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +37 -0
  313. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -0
  314. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +12 -0
  315. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js.map +1 -0
  316. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.d.ts +0 -4
  317. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +48 -0
  318. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -0
  319. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +18 -0
  320. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -0
  321. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js +26 -27
  322. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -1
  323. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +3 -3
  324. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +17 -16
  325. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
  326. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.d.ts +2 -0
  327. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModalTypes.d.ts +8 -0
  328. package/dist/components/Payroll/OffCycleTaxWithholdingModal/index.d.ts +3 -0
  329. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.d.ts +2 -0
  330. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +17 -0
  331. package/dist/components/Payroll/OffCycleTaxWithholdingTable/index.d.ts +3 -0
  332. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.d.ts +3 -8
  333. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +38 -35
  334. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  335. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +25 -33
  336. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  337. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +2 -0
  338. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +21 -19
  339. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
  340. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +26 -26
  341. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  342. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +36 -36
  343. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +21 -19
  344. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  345. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +17 -15
  346. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  347. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +32 -32
  348. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  349. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +20 -18
  350. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  351. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +70 -67
  352. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  353. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
  354. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +38 -36
  355. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  356. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -1
  357. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +20 -20
  358. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  359. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +4 -3
  360. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  361. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +4 -3
  362. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  363. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +12 -11
  364. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
  365. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +5 -3
  366. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
  367. package/dist/components/Payroll/index.d.ts +4 -0
  368. package/dist/components/Payroll/index.js +22 -18
  369. package/dist/components/Payroll/index.js.map +1 -1
  370. package/dist/components/Payroll/usePreparedPayrollData.js +4 -3
  371. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  372. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +48 -46
  373. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  374. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  375. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  376. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  377. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
  378. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  379. package/dist/contexts/ThemeProvider/theme.d.ts +1 -0
  380. package/dist/contexts/ThemeProvider/theme.js +1 -0
  381. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  382. package/dist/helpers/apiErrorToList.js +14 -8
  383. package/dist/helpers/apiErrorToList.js.map +1 -1
  384. package/dist/helpers/dateFormatting.js +61 -45
  385. package/dist/helpers/dateFormatting.js.map +1 -1
  386. package/dist/helpers/formattedStrings.d.ts +1 -0
  387. package/dist/helpers/formattedStrings.js +21 -20
  388. package/dist/helpers/formattedStrings.js.map +1 -1
  389. package/dist/hooks/useOverflowDetection/useOverflowDetection.js +5 -6
  390. package/dist/i18n/I18n.js +7 -7
  391. package/dist/i18n/I18n.js.map +1 -1
  392. package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +12 -12
  393. package/dist/i18n/en/Employee.EmployeeDocuments.json.js +1 -1
  394. package/dist/i18n/en/Employee.I9SignatureForm.json.js +83 -65
  395. package/dist/i18n/en/Employee.I9SignatureForm.json.js.map +1 -1
  396. package/dist/i18n/en/Employee.Landing.json.js +7 -9
  397. package/dist/i18n/en/Employee.Landing.json.js.map +1 -1
  398. package/dist/i18n/en/Payroll.OffCycleCreation.json.js +14 -0
  399. package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -0
  400. package/dist/i18n/en/Payroll.OffCycleDeductionsSetting.json.js +12 -0
  401. package/dist/i18n/en/Payroll.OffCycleDeductionsSetting.json.js.map +1 -0
  402. package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +18 -0
  403. package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js.map +1 -0
  404. package/dist/i18n/en/Payroll.PayrollBlocker.json.js +21 -19
  405. package/dist/i18n/en/Payroll.PayrollBlocker.json.js.map +1 -1
  406. package/dist/i18n/en/Payroll.PayrollOverview.json.js +1 -1
  407. package/dist/shared/constants.d.ts +4 -0
  408. package/dist/shared/constants.js +6 -4
  409. package/dist/shared/constants.js.map +1 -1
  410. package/dist/style.css +1 -1
  411. package/dist/types/i18next.d.ts +76 -2
  412. package/docs/reference/endpoint-inventory.json +1706 -0
  413. package/package.json +27 -11
  414. package/dist/components/Employee/Landing/Landing.module.scss.js +0 -8
  415. package/dist/components/Employee/Landing/Landing.module.scss.js.map +0 -1
@@ -1,45 +1,47 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { useMemo as f, Suspense as s } from "react";
3
- import { usePayrollsGetSuspense as d } from "@gusto/embedded-api/react-query/payrollsGet";
4
- import { PayrollExecutionFlow as m } from "../PayrollExecutionFlow/PayrollExecutionFlow.js";
5
- import { useFlow as p } from "../../Flow/useFlow.js";
6
- import { ensureRequired as c } from "../../../helpers/ensureRequired.js";
7
- function b() {
8
- return /* @__PURE__ */ t("div", { children: "Off-Cycle Creation placeholder" });
2
+ import { useMemo as m, Suspense as s } from "react";
3
+ import { usePayrollsGetSuspense as p } from "@gusto/embedded-api/react-query/payrollsGet";
4
+ import { PayrollExecutionFlow as y } from "../PayrollExecutionFlow/PayrollExecutionFlow.js";
5
+ import { useFlow as l } from "../../Flow/useFlow.js";
6
+ import { ensureRequired as i } from "../../../helpers/ensureRequired.js";
7
+ import { OffCycleCreation as d } from "../OffCycleCreation/OffCycleCreation.js";
8
+ function h() {
9
+ const { companyId: o, onEvent: e } = l();
10
+ return /* @__PURE__ */ t(d, { companyId: i(o), onEvent: e });
9
11
  }
10
- function E() {
11
- const { companyId: o, payrollUuid: e, onEvent: n, breadcrumbs: r } = p(), l = f(() => {
12
- const i = r?.createOffCyclePayroll?.[0];
13
- return i ? [i] : void 0;
14
- }, [r]), a = c(o), u = c(e);
12
+ function w() {
13
+ const { companyId: o, payrollUuid: e, onEvent: n, breadcrumbs: r } = l(), c = m(() => {
14
+ const a = r?.createOffCyclePayroll?.[0];
15
+ return a ? [a] : void 0;
16
+ }, [r]), f = i(o), u = i(e);
15
17
  return /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
16
- y,
18
+ C,
17
19
  {
18
- companyId: a,
20
+ companyId: f,
19
21
  payrollId: u,
20
22
  onEvent: n,
21
- prefixBreadcrumbs: l
23
+ prefixBreadcrumbs: c
22
24
  }
23
25
  ) });
24
26
  }
25
- function y({
27
+ function C({
26
28
  companyId: o,
27
29
  payrollId: e,
28
30
  ...n
29
31
  }) {
30
- const { data: r } = d({ companyId: o, payrollId: e }), l = r.payrollShow?.payPeriod;
32
+ const { data: r } = p({ companyId: o, payrollId: e }), c = r.payrollShow?.payPeriod;
31
33
  return /* @__PURE__ */ t(
32
- m,
34
+ y,
33
35
  {
34
36
  companyId: o,
35
37
  payrollId: e,
36
- initialPayPeriod: l,
38
+ initialPayPeriod: c,
37
39
  ...n
38
40
  }
39
41
  );
40
42
  }
41
43
  export {
42
- b as OffCycleCreationContextual,
43
- E as OffCycleExecutionContextual
44
+ h as OffCycleCreationContextual,
45
+ w as OffCycleExecutionContextual
44
46
  };
45
47
  //# sourceMappingURL=OffCycleFlowComponents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OffCycleFlowComponents.js","sources":["../../../../src/components/Payroll/OffCycle/OffCycleFlowComponents.tsx"],"sourcesContent":["import { Suspense, useMemo } from 'react'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport {\n PayrollExecutionFlow,\n type PayrollExecutionFlowProps,\n} from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\nexport interface OffCycleFlowContextInterface extends FlowContextInterface {\n companyId: string\n payrollUuid?: string\n}\n\nexport interface OffCycleFlowProps {\n companyId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\n// TODO: Wire to OffCycleCreation component in follow-up PR\nexport function OffCycleCreationContextual() {\n return <div>Off-Cycle Creation placeholder</div>\n}\n\nexport function OffCycleExecutionContextual() {\n const { companyId, payrollUuid, onEvent, breadcrumbs } = useFlow<OffCycleFlowContextInterface>()\n\n const prefixBreadcrumbs = useMemo(() => {\n const offCycleCreationBreadcrumb = breadcrumbs?.['createOffCyclePayroll']?.[0]\n return offCycleCreationBreadcrumb ? [offCycleCreationBreadcrumb] : undefined\n }, [breadcrumbs])\n\n const resolvedCompanyId = ensureRequired(companyId)\n const resolvedPayrollId = ensureRequired(payrollUuid)\n\n return (\n <Suspense>\n <OffCycleExecutionWithData\n companyId={resolvedCompanyId}\n payrollId={resolvedPayrollId}\n onEvent={onEvent}\n prefixBreadcrumbs={prefixBreadcrumbs}\n />\n </Suspense>\n )\n}\n\ntype OffCycleExecutionWithDataProps = Pick<\n PayrollExecutionFlowProps,\n 'companyId' | 'payrollId' | 'onEvent' | 'prefixBreadcrumbs'\n>\n\nfunction OffCycleExecutionWithData({\n companyId,\n payrollId,\n ...rest\n}: OffCycleExecutionWithDataProps) {\n const { data } = usePayrollsGetSuspense({ companyId, payrollId })\n const initialPayPeriod = data.payrollShow?.payPeriod\n\n return (\n <PayrollExecutionFlow\n companyId={companyId}\n payrollId={payrollId}\n initialPayPeriod={initialPayPeriod}\n {...rest}\n />\n )\n}\n"],"names":["OffCycleCreationContextual","jsx","OffCycleExecutionContextual","companyId","payrollUuid","onEvent","breadcrumbs","useFlow","prefixBreadcrumbs","useMemo","offCycleCreationBreadcrumb","resolvedCompanyId","ensureRequired","resolvedPayrollId","Suspense","OffCycleExecutionWithData","payrollId","rest","data","usePayrollsGetSuspense","initialPayPeriod","PayrollExecutionFlow"],"mappings":";;;;;;AAsBO,SAASA,IAA6B;AAC3C,SAAO,gBAAAC,EAAC,SAAI,UAAA,iCAAA,CAA8B;AAC5C;AAEO,SAASC,IAA8B;AAC5C,QAAM,EAAE,WAAAC,GAAW,aAAAC,GAAa,SAAAC,GAAS,aAAAC,EAAA,IAAgBC,EAAA,GAEnDC,IAAoBC,EAAQ,MAAM;AACtC,UAAMC,IAA6BJ,GAAc,wBAA2B,CAAC;AAC7E,WAAOI,IAA6B,CAACA,CAA0B,IAAI;AAAA,EACrE,GAAG,CAACJ,CAAW,CAAC,GAEVK,IAAoBC,EAAeT,CAAS,GAC5CU,IAAoBD,EAAeR,CAAW;AAEpD,2BACGU,GAAA,EACC,UAAA,gBAAAb;AAAA,IAACc;AAAA,IAAA;AAAA,MACC,WAAWJ;AAAA,MACX,WAAWE;AAAA,MACX,SAAAR;AAAA,MACA,mBAAAG;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAOA,SAASO,EAA0B;AAAA,EACjC,WAAAZ;AAAA,EACA,WAAAa;AAAA,EACA,GAAGC;AACL,GAAmC;AACjC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAuB,EAAE,WAAAhB,GAAW,WAAAa,GAAW,GAC1DI,IAAmBF,EAAK,aAAa;AAE3C,SACE,gBAAAjB;AAAA,IAACoB;AAAA,IAAA;AAAA,MACC,WAAAlB;AAAA,MACA,WAAAa;AAAA,MACA,kBAAAI;AAAA,MACC,GAAGH;AAAA,IAAA;AAAA,EAAA;AAGV;"}
1
+ {"version":3,"file":"OffCycleFlowComponents.js","sources":["../../../../src/components/Payroll/OffCycle/OffCycleFlowComponents.tsx"],"sourcesContent":["import { Suspense, useMemo } from 'react'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { OffCycleCreation } from '../OffCycleCreation'\nimport {\n PayrollExecutionFlow,\n type PayrollExecutionFlowProps,\n} from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\nexport interface OffCycleFlowContextInterface extends FlowContextInterface {\n companyId: string\n payrollUuid?: string\n}\n\nexport interface OffCycleFlowProps {\n companyId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function OffCycleCreationContextual() {\n const { companyId, onEvent } = useFlow<OffCycleFlowContextInterface>()\n return <OffCycleCreation companyId={ensureRequired(companyId)} onEvent={onEvent} />\n}\n\nexport function OffCycleExecutionContextual() {\n const { companyId, payrollUuid, onEvent, breadcrumbs } = useFlow<OffCycleFlowContextInterface>()\n\n const prefixBreadcrumbs = useMemo(() => {\n const offCycleCreationBreadcrumb = breadcrumbs?.['createOffCyclePayroll']?.[0]\n return offCycleCreationBreadcrumb ? [offCycleCreationBreadcrumb] : undefined\n }, [breadcrumbs])\n\n const resolvedCompanyId = ensureRequired(companyId)\n const resolvedPayrollId = ensureRequired(payrollUuid)\n\n return (\n <Suspense>\n <OffCycleExecutionWithData\n companyId={resolvedCompanyId}\n payrollId={resolvedPayrollId}\n onEvent={onEvent}\n prefixBreadcrumbs={prefixBreadcrumbs}\n />\n </Suspense>\n )\n}\n\ntype OffCycleExecutionWithDataProps = Pick<\n PayrollExecutionFlowProps,\n 'companyId' | 'payrollId' | 'onEvent' | 'prefixBreadcrumbs'\n>\n\nfunction OffCycleExecutionWithData({\n companyId,\n payrollId,\n ...rest\n}: OffCycleExecutionWithDataProps) {\n const { data } = usePayrollsGetSuspense({ companyId, payrollId })\n const initialPayPeriod = data.payrollShow?.payPeriod\n\n return (\n <PayrollExecutionFlow\n companyId={companyId}\n payrollId={payrollId}\n initialPayPeriod={initialPayPeriod}\n {...rest}\n />\n )\n}\n"],"names":["OffCycleCreationContextual","companyId","onEvent","useFlow","OffCycleCreation","ensureRequired","OffCycleExecutionContextual","payrollUuid","breadcrumbs","prefixBreadcrumbs","useMemo","offCycleCreationBreadcrumb","resolvedCompanyId","resolvedPayrollId","Suspense","jsx","OffCycleExecutionWithData","payrollId","rest","data","usePayrollsGetSuspense","initialPayPeriod","PayrollExecutionFlow"],"mappings":";;;;;;;AAsBO,SAASA,IAA6B;AAC3C,QAAM,EAAE,WAAAC,GAAW,SAAAC,EAAA,IAAYC,EAAA;AAC/B,2BAAQC,GAAA,EAAiB,WAAWC,EAAeJ,CAAS,GAAG,SAAAC,GAAkB;AACnF;AAEO,SAASI,IAA8B;AAC5C,QAAM,EAAE,WAAAL,GAAW,aAAAM,GAAa,SAAAL,GAAS,aAAAM,EAAA,IAAgBL,EAAA,GAEnDM,IAAoBC,EAAQ,MAAM;AACtC,UAAMC,IAA6BH,GAAc,wBAA2B,CAAC;AAC7E,WAAOG,IAA6B,CAACA,CAA0B,IAAI;AAAA,EACrE,GAAG,CAACH,CAAW,CAAC,GAEVI,IAAoBP,EAAeJ,CAAS,GAC5CY,IAAoBR,EAAeE,CAAW;AAEpD,2BACGO,GAAA,EACC,UAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWJ;AAAA,MACX,WAAWC;AAAA,MACX,SAAAX;AAAA,MACA,mBAAAO;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAOA,SAASO,EAA0B;AAAA,EACjC,WAAAf;AAAA,EACA,WAAAgB;AAAA,EACA,GAAGC;AACL,GAAmC;AACjC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAuB,EAAE,WAAAnB,GAAW,WAAAgB,GAAW,GAC1DI,IAAmBF,EAAK,aAAa;AAE3C,SACE,gBAAAJ;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,WAAArB;AAAA,MACA,WAAAgB;AAAA,MACA,kBAAAI;AAAA,MACC,GAAGH;AAAA,IAAA;AAAA,EAAA;AAGV;"}
@@ -0,0 +1,2 @@
1
+ import { OffCycleCreationProps } from './OffCycleCreationTypes';
2
+ export declare function OffCycleCreation(props: OffCycleCreationProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,79 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { useEffect as v } from "react";
3
+ import { useForm as A, FormProvider as L } from "react-hook-form";
4
+ import { zodResolver as B } from "@hookform/resolvers/zod";
5
+ import { z as y } from "zod";
6
+ import { useTranslation as d } from "react-i18next";
7
+ import { usePayrollsCreateOffCycleMutation as T } from "@gusto/embedded-api/react-query/payrollsCreateOffCycle";
8
+ import { OffCycleReason as p } from "@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls";
9
+ import { RFCDate as u } from "@gusto/embedded-api/types/rfcdate";
10
+ import { createOffCyclePayPeriodDateFormSchema as V } from "../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js";
11
+ import { useOffCyclePayPeriodDateValidation as I } from "../OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js";
12
+ import { OffCycleCreationPresentation as U } from "./OffCycleCreationPresentation.js";
13
+ import { BaseComponent as j } from "../../Base/Base.js";
14
+ import { useBase as q } from "../../Base/useBase.js";
15
+ import { useComponentDictionary as x, useI18n as c } from "../../../i18n/I18n.js";
16
+ import { componentEvents as z } from "../../../shared/constants.js";
17
+ import { Form as N } from "../../Common/Form/Form.js";
18
+ import { OFF_CYCLE_REASON_DEFAULTS as D } from "../OffCycleReasonSelection/types.js";
19
+ const Y = {
20
+ bonus: p.Bonus,
21
+ correction: p.Correction
22
+ };
23
+ function me(n) {
24
+ return /* @__PURE__ */ t(j, { ...n, children: /* @__PURE__ */ t(H, { ...n }) });
25
+ }
26
+ function H({ dictionary: n, companyId: O, payrollType: i = "bonus" }) {
27
+ x("Payroll.OffCycleCreation", n), c("Payroll.OffCycleCreation"), c("Payroll.OffCycleReasonSelection"), c("Payroll.OffCyclePayPeriodDateForm"), c("Payroll.OffCycleDeductionsSetting");
28
+ const { t: P } = d("Payroll.OffCyclePayPeriodDateForm"), { t: h } = d("Payroll.OffCycleCreation"), { onEvent: k, baseSubmitHandler: R } = q(), { minCheckDate: F, today: E } = I(), { mutateAsync: S, isPending: b } = T(), w = (e) => P(e), o = A({
29
+ resolver: (e, a, r) => {
30
+ const l = e.reason, m = e.isCheckOnly, s = V(
31
+ w,
32
+ l === "correction" ? "correction" : i,
33
+ m ? E : F
34
+ ), _ = y.object({ reason: y.enum(["bonus", "correction"]), skipRegularDeductions: y.boolean() }).and(s);
35
+ return B(_)(e, a, r);
36
+ },
37
+ defaultValues: {
38
+ reason: i,
39
+ isCheckOnly: !1,
40
+ startDate: null,
41
+ endDate: null,
42
+ checkDate: null,
43
+ skipRegularDeductions: D[i].skipDeductions
44
+ }
45
+ }), C = o.watch("reason");
46
+ v(() => {
47
+ o.setValue(
48
+ "skipRegularDeductions",
49
+ D[C].skipDeductions
50
+ );
51
+ }, [C, o]);
52
+ const g = async (e) => {
53
+ const a = e.reason, r = e.checkDate, l = e.isCheckOnly ? r : e.startDate, m = e.isCheckOnly ? r : e.endDate;
54
+ await R(e, async () => {
55
+ const f = await S({
56
+ request: {
57
+ companyId: O,
58
+ requestBody: {
59
+ offCycle: !0,
60
+ offCycleReason: Y[a],
61
+ startDate: new u(l),
62
+ endDate: new u(m),
63
+ checkDate: new u(r),
64
+ skipRegularDeductions: e.skipRegularDeductions,
65
+ isCheckOnlyPayroll: e.isCheckOnly
66
+ }
67
+ }
68
+ }), s = f.payrollPrepared?.payrollUuid ?? f.payrollPrepared?.uuid;
69
+ if (!s)
70
+ throw new Error(h("errors.missingPayrollId"));
71
+ k(z.OFF_CYCLE_CREATED, { payrollUuid: s });
72
+ });
73
+ };
74
+ return /* @__PURE__ */ t(L, { ...o, children: /* @__PURE__ */ t(N, { onSubmit: o.handleSubmit(g), children: /* @__PURE__ */ t(U, { isPending: b }) }) });
75
+ }
76
+ export {
77
+ me as OffCycleCreation
78
+ };
79
+ //# sourceMappingURL=OffCycleCreation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OffCycleCreation.js","sources":["../../../../src/components/Payroll/OffCycleCreation/OffCycleCreation.tsx"],"sourcesContent":["import { useEffect } from 'react'\nimport { FormProvider, useForm, type Resolver } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { usePayrollsCreateOffCycleMutation } from '@gusto/embedded-api/react-query/payrollsCreateOffCycle'\nimport { OffCycleReason as ApiOffCycleReason } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { OFF_CYCLE_REASON_DEFAULTS, type OffCycleReason } from '../OffCycleReasonSelection'\nimport {\n createOffCyclePayPeriodDateFormSchema,\n type OffCyclePayrollDateType,\n} from '../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes'\nimport { useOffCyclePayPeriodDateValidation } from '../OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation'\nimport type { OffCycleCreationFormData, OffCycleCreationProps } from './OffCycleCreationTypes'\nimport { OffCycleCreationPresentation } from './OffCycleCreationPresentation'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Form } from '@/components/Common/Form'\n\nconst LOCAL_TO_API_REASON: Record<OffCycleReason, ApiOffCycleReason> = {\n bonus: ApiOffCycleReason.Bonus,\n correction: ApiOffCycleReason.Correction,\n}\n\nexport function OffCycleCreation(props: OffCycleCreationProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ dictionary, companyId, payrollType = 'bonus' }: OffCycleCreationProps) {\n useComponentDictionary('Payroll.OffCycleCreation', dictionary)\n useI18n('Payroll.OffCycleCreation')\n useI18n('Payroll.OffCycleReasonSelection')\n useI18n('Payroll.OffCyclePayPeriodDateForm')\n useI18n('Payroll.OffCycleDeductionsSetting')\n\n const { t } = useTranslation('Payroll.OffCyclePayPeriodDateForm')\n const { t: tCreation } = useTranslation('Payroll.OffCycleCreation')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { minCheckDate, today } = useOffCyclePayPeriodDateValidation()\n const { mutateAsync: createOffCyclePayroll, isPending } = usePayrollsCreateOffCycleMutation()\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const translateValidation = (key: string): string => t(key as any) as string\n\n const dynamicResolver: Resolver<OffCycleCreationFormData> = (values, context, options) => {\n const reason = values.reason\n const isCheckOnly = values.isCheckOnly\n const resolvedPayrollType: OffCyclePayrollDateType =\n reason === 'correction' ? 'correction' : payrollType\n\n const dateSchema = createOffCyclePayPeriodDateFormSchema(\n translateValidation,\n resolvedPayrollType,\n isCheckOnly ? today : minCheckDate,\n )\n const schema = z\n .object({ reason: z.enum(['bonus', 'correction']), skipRegularDeductions: z.boolean() })\n .and(dateSchema)\n\n return zodResolver(schema)(values, context, options)\n }\n\n const methods = useForm<OffCycleCreationFormData>({\n resolver: dynamicResolver,\n defaultValues: {\n reason: payrollType,\n isCheckOnly: false,\n startDate: null,\n endDate: null,\n checkDate: null,\n skipRegularDeductions: OFF_CYCLE_REASON_DEFAULTS[payrollType].skipDeductions,\n },\n })\n\n const watchedReason = methods.watch('reason')\n\n useEffect(() => {\n methods.setValue(\n 'skipRegularDeductions',\n OFF_CYCLE_REASON_DEFAULTS[watchedReason].skipDeductions,\n )\n }, [watchedReason, methods])\n\n const onSubmit = async (data: OffCycleCreationFormData) => {\n const reason = data.reason\n const checkDate = data.checkDate!\n const startDate = data.isCheckOnly ? checkDate : data.startDate!\n const endDate = data.isCheckOnly ? checkDate : data.endDate!\n\n await baseSubmitHandler(data, async () => {\n const response = await createOffCyclePayroll({\n request: {\n companyId,\n requestBody: {\n offCycle: true,\n offCycleReason: LOCAL_TO_API_REASON[reason],\n startDate: new RFCDate(startDate),\n endDate: new RFCDate(endDate),\n checkDate: new RFCDate(checkDate),\n skipRegularDeductions: data.skipRegularDeductions,\n isCheckOnlyPayroll: data.isCheckOnly,\n },\n },\n })\n\n const payrollUuid = response.payrollPrepared?.payrollUuid ?? response.payrollPrepared?.uuid\n\n if (!payrollUuid) {\n throw new Error(tCreation('errors.missingPayrollId'))\n }\n\n onEvent(componentEvents.OFF_CYCLE_CREATED, { payrollUuid })\n })\n }\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)}>\n <OffCycleCreationPresentation isPending={isPending} />\n </Form>\n </FormProvider>\n )\n}\n"],"names":["LOCAL_TO_API_REASON","ApiOffCycleReason","OffCycleCreation","props","jsx","BaseComponent","Root","dictionary","companyId","payrollType","useComponentDictionary","useI18n","t","useTranslation","tCreation","onEvent","baseSubmitHandler","useBase","minCheckDate","today","useOffCyclePayPeriodDateValidation","createOffCyclePayroll","isPending","usePayrollsCreateOffCycleMutation","translateValidation","key","methods","useForm","values","context","options","reason","isCheckOnly","dateSchema","createOffCyclePayPeriodDateFormSchema","schema","z","zodResolver","OFF_CYCLE_REASON_DEFAULTS","watchedReason","useEffect","onSubmit","data","checkDate","startDate","endDate","response","RFCDate","payrollUuid","componentEvents","FormProvider","Form","OffCycleCreationPresentation"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,MAAMA,IAAiE;AAAA,EACrE,OAAOC,EAAkB;AAAA,EACzB,YAAYA,EAAkB;AAChC;AAEO,SAASC,GAAiBC,GAA8B;AAC7D,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,WAAAC,GAAW,aAAAC,IAAc,WAAkC;AACrF,EAAAC,EAAuB,4BAA4BH,CAAU,GAC7DI,EAAQ,0BAA0B,GAClCA,EAAQ,iCAAiC,GACzCA,EAAQ,mCAAmC,GAC3CA,EAAQ,mCAAmC;AAE3C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mCAAmC,GAC1D,EAAE,GAAGC,MAAcD,EAAe,0BAA0B,GAC5D,EAAE,SAAAE,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC,EAAE,cAAAC,GAAc,OAAAC,EAAA,IAAUC,EAAA,GAC1B,EAAE,aAAaC,GAAuB,WAAAC,EAAA,IAAcC,EAAA,GAGpDC,IAAsB,CAACC,MAAwBb,EAAEa,CAAU,GAoB3DC,IAAUC,EAAkC;AAAA,IAChD,UAnB0D,CAACC,GAAQC,GAASC,MAAY;AACxF,YAAMC,IAASH,EAAO,QAChBI,IAAcJ,EAAO,aAIrBK,IAAaC;AAAA,QACjBV;AAAA,QAHAO,MAAW,eAAe,eAAetB;AAAA,QAKzCuB,IAAcb,IAAQD;AAAA,MAAA,GAElBiB,IAASC,EACZ,OAAO,EAAE,QAAQA,EAAE,KAAK,CAAC,SAAS,YAAY,CAAC,GAAG,uBAAuBA,EAAE,QAAA,GAAW,EACtF,IAAIH,CAAU;AAEjB,aAAOI,EAAYF,CAAM,EAAEP,GAAQC,GAASC,CAAO;AAAA,IACrD;AAAA,IAIE,eAAe;AAAA,MACb,QAAQrB;AAAA,MACR,aAAa;AAAA,MACb,WAAW;AAAA,MACX,SAAS;AAAA,MACT,WAAW;AAAA,MACX,uBAAuB6B,EAA0B7B,CAAW,EAAE;AAAA,IAAA;AAAA,EAChE,CACD,GAEK8B,IAAgBb,EAAQ,MAAM,QAAQ;AAE5C,EAAAc,EAAU,MAAM;AACd,IAAAd,EAAQ;AAAA,MACN;AAAA,MACAY,EAA0BC,CAAa,EAAE;AAAA,IAAA;AAAA,EAE7C,GAAG,CAACA,GAAeb,CAAO,CAAC;AAE3B,QAAMe,IAAW,OAAOC,MAAmC;AACzD,UAAMX,IAASW,EAAK,QACdC,IAAYD,EAAK,WACjBE,IAAYF,EAAK,cAAcC,IAAYD,EAAK,WAChDG,IAAUH,EAAK,cAAcC,IAAYD,EAAK;AAEpD,UAAM1B,EAAkB0B,GAAM,YAAY;AACxC,YAAMI,IAAW,MAAMzB,EAAsB;AAAA,QAC3C,SAAS;AAAA,UACP,WAAAb;AAAA,UACA,aAAa;AAAA,YACX,UAAU;AAAA,YACV,gBAAgBR,EAAoB+B,CAAM;AAAA,YAC1C,WAAW,IAAIgB,EAAQH,CAAS;AAAA,YAChC,SAAS,IAAIG,EAAQF,CAAO;AAAA,YAC5B,WAAW,IAAIE,EAAQJ,CAAS;AAAA,YAChC,uBAAuBD,EAAK;AAAA,YAC5B,oBAAoBA,EAAK;AAAA,UAAA;AAAA,QAC3B;AAAA,MACF,CACD,GAEKM,IAAcF,EAAS,iBAAiB,eAAeA,EAAS,iBAAiB;AAEvF,UAAI,CAACE;AACH,cAAM,IAAI,MAAMlC,EAAU,yBAAyB,CAAC;AAGtD,MAAAC,EAAQkC,EAAgB,mBAAmB,EAAE,aAAAD,EAAA,CAAa;AAAA,IAC5D,CAAC;AAAA,EACH;AAEA,SACE,gBAAA5C,EAAC8C,GAAA,EAAc,GAAGxB,GAChB,4BAACyB,GAAA,EAAK,UAAUzB,EAAQ,aAAae,CAAQ,GAC3C,UAAA,gBAAArC,EAACgD,GAAA,EAA6B,WAAA9B,EAAA,CAAsB,GACtD,GACF;AAEJ;"}
@@ -0,0 +1,2 @@
1
+ import { OffCycleCreationPresentationProps } from './OffCycleCreationTypes';
2
+ export declare function OffCycleCreationPresentation({ isPending }: OffCycleCreationPresentationProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,47 @@
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
+ import { useTranslation as l } from "react-i18next";
3
+ import { OffCyclePayPeriodDateFormPresentation as u } from "../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js";
4
+ import { useI18n as a } from "../../../i18n/I18n.js";
5
+ import { useComponentContext as d } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
+ import { Flex as o } from "../../Common/Flex/Flex.js";
7
+ import "classnames";
8
+ import "../../../shared/constants.js";
9
+ import { RadioGroupField as g } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
10
+ import "react";
11
+ import { OffCycleReasonSelectionPresentation as y } from "../OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js";
12
+ function F({ isPending: n }) {
13
+ a("Payroll.OffCycleCreation"), a("Payroll.OffCycleDeductionsSetting");
14
+ const { t: i } = l("Payroll.OffCycleCreation"), { t } = l("Payroll.OffCycleDeductionsSetting"), { Heading: c, Text: s, Button: p } = d(), f = [
15
+ {
16
+ value: !1,
17
+ label: t("options.include.label")
18
+ },
19
+ {
20
+ value: !0,
21
+ label: t("options.skip.label")
22
+ }
23
+ ];
24
+ return /* @__PURE__ */ r(o, { flexDirection: "column", gap: 32, children: [
25
+ /* @__PURE__ */ r(o, { flexDirection: "column", gap: 4, children: [
26
+ /* @__PURE__ */ e(c, { as: "h2", children: i("pageTitle") }),
27
+ /* @__PURE__ */ e(s, { variant: "supporting", children: i("pageDescription") })
28
+ ] }),
29
+ /* @__PURE__ */ e(o, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(u, {}) }),
30
+ /* @__PURE__ */ e(o, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(y, { name: "reason" }) }),
31
+ /* @__PURE__ */ e(o, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(
32
+ g,
33
+ {
34
+ name: "skipRegularDeductions",
35
+ label: t("title"),
36
+ description: t("description"),
37
+ options: f,
38
+ convertValueToString: (m) => String(m)
39
+ }
40
+ ) }),
41
+ /* @__PURE__ */ e(o, { justifyContent: "flex-end", gap: 12, children: /* @__PURE__ */ e(p, { type: "submit", isLoading: n, isDisabled: n, children: i("continueCta") }) })
42
+ ] });
43
+ }
44
+ export {
45
+ F as OffCycleCreationPresentation
46
+ };
47
+ //# sourceMappingURL=OffCycleCreationPresentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OffCycleCreationPresentation.js","sources":["../../../../src/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { OffCycleReasonSelectionPresentation } from '../OffCycleReasonSelection'\nimport { OffCyclePayPeriodDateFormPresentation } from '../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation'\nimport type { OffCycleCreationPresentationProps } from './OffCycleCreationTypes'\nimport { useI18n } from '@/i18n'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, RadioGroupField } from '@/components/Common'\n\nexport function OffCycleCreationPresentation({ isPending }: OffCycleCreationPresentationProps) {\n useI18n('Payroll.OffCycleCreation')\n useI18n('Payroll.OffCycleDeductionsSetting')\n const { t } = useTranslation('Payroll.OffCycleCreation')\n const { t: tDeductions } = useTranslation('Payroll.OffCycleDeductionsSetting')\n const { Heading, Text, Button } = useComponentContext()\n\n const deductionsOptions = [\n {\n value: false,\n label: tDeductions('options.include.label'),\n },\n {\n value: true,\n label: tDeductions('options.skip.label'),\n },\n ]\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\">{t('pageTitle')}</Heading>\n <Text variant=\"supporting\">{t('pageDescription')}</Text>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={20}>\n <OffCyclePayPeriodDateFormPresentation />\n </Flex>\n\n <Flex flexDirection=\"column\" gap={20}>\n <OffCycleReasonSelectionPresentation name=\"reason\" />\n </Flex>\n\n {/* TODO: EmployeeSelection section — will compose EmployeeSelectionPresentation */}\n\n <Flex flexDirection=\"column\" gap={20}>\n <RadioGroupField<boolean>\n name=\"skipRegularDeductions\"\n label={tDeductions('title')}\n description={tDeductions('description')}\n options={deductionsOptions}\n convertValueToString={value => String(value)}\n />\n </Flex>\n\n {/* TODO: TaxWithholdingRates section — will compose TaxWithholdingRatesPresentation */}\n\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button type=\"submit\" isLoading={isPending} isDisabled={isPending}>\n {t('continueCta')}\n </Button>\n </Flex>\n </Flex>\n )\n}\n"],"names":["OffCycleCreationPresentation","isPending","useI18n","t","useTranslation","tDeductions","Heading","Text","Button","useComponentContext","deductionsOptions","jsxs","Flex","jsx","OffCyclePayPeriodDateFormPresentation","OffCycleReasonSelectionPresentation","RadioGroupField","value"],"mappings":";;;;;;;;;;;AAQO,SAASA,EAA6B,EAAE,WAAAC,KAAgD;AAC7F,EAAAC,EAAQ,0BAA0B,GAClCA,EAAQ,mCAAmC;AAC3C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,0BAA0B,GACjD,EAAEC,MAAmBD,EAAe,mCAAmC,GACvE,EAAE,SAAAE,GAAS,MAAAC,GAAM,QAAAC,EAAA,IAAWC,EAAA,GAE5BC,IAAoB;AAAA,IACxB;AAAA,MACE,OAAO;AAAA,MACP,OAAOL,EAAY,uBAAuB;AAAA,IAAA;AAAA,IAE5C;AAAA,MACE,OAAO;AAAA,MACP,OAAOA,EAAY,oBAAoB;AAAA,IAAA;AAAA,EACzC;AAGF,SACE,gBAAAM,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAC,EAACP,GAAA,EAAQ,IAAG,MAAM,UAAAH,EAAE,WAAW,GAAE;AAAA,wBAChCI,GAAA,EAAK,SAAQ,cAAc,UAAAJ,EAAE,iBAAiB,EAAA,CAAE;AAAA,IAAA,GACnD;AAAA,IAEA,gBAAAU,EAACD,KAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAC,EAACC,KAAsC,EAAA,CACzC;AAAA,IAEA,gBAAAD,EAACD,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAC,EAACE,GAAA,EAAoC,MAAK,SAAA,CAAS,EAAA,CACrD;AAAA,IAIA,gBAAAF,EAACD,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAC;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOX,EAAY,OAAO;AAAA,QAC1B,aAAaA,EAAY,aAAa;AAAA,QACtC,SAASK;AAAA,QACT,sBAAsB,CAAAO,MAAS,OAAOA,CAAK;AAAA,MAAA;AAAA,IAAA,GAE/C;AAAA,sBAICL,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA,gBAAAC,EAACL,GAAA,EAAO,MAAK,UAAS,WAAWP,GAAW,YAAYA,GACrD,UAAAE,EAAE,aAAa,GAClB,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
@@ -0,0 +1,14 @@
1
+ import { OffCycleReason } from '../OffCycleReasonSelection';
2
+ import { OffCyclePayPeriodDateFormData, OffCyclePayrollDateType } from '../OffCyclePayPeriodDateForm';
3
+ import { BaseComponentInterface } from '../../Base/Base';
4
+ export interface OffCycleCreationProps extends BaseComponentInterface<'Payroll.OffCycleCreation'> {
5
+ companyId: string;
6
+ payrollType?: OffCyclePayrollDateType;
7
+ }
8
+ export interface OffCycleCreationFormData extends OffCyclePayPeriodDateFormData {
9
+ reason: OffCycleReason;
10
+ skipRegularDeductions: boolean;
11
+ }
12
+ export interface OffCycleCreationPresentationProps {
13
+ isPending?: boolean;
14
+ }
@@ -0,0 +1,3 @@
1
+ import "./types/i18next.d.ts"
2
+ export { OffCycleCreation } from './OffCycleCreation';
3
+ export type { OffCycleCreationProps, OffCycleCreationFormData, OffCycleCreationPresentationProps, } from './OffCycleCreationTypes';
@@ -0,0 +1,2 @@
1
+ import { OffCycleDeductionsSettingProps } from './types';
2
+ export declare function OffCycleDeductionsSetting({ dictionary, skipRegularDeductions, onEvent, }: OffCycleDeductionsSettingProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,44 @@
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { useMemo as u } from "react";
3
+ import { useTranslation as a } from "react-i18next";
4
+ import { useComponentDictionary as m, useI18n as f } from "../../../i18n/I18n.js";
5
+ import { componentEvents as d } from "../../../shared/constants.js";
6
+ import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
+ function S({
8
+ dictionary: o,
9
+ skipRegularDeductions: t,
10
+ onEvent: n
11
+ }) {
12
+ m("Payroll.OffCycleDeductionsSetting", o), f("Payroll.OffCycleDeductionsSetting");
13
+ const { t: e } = a("Payroll.OffCycleDeductionsSetting"), { RadioGroup: i } = C(), l = u(
14
+ () => [
15
+ {
16
+ value: "include",
17
+ label: e("options.include.label")
18
+ },
19
+ {
20
+ value: "skip",
21
+ label: e("options.skip.label")
22
+ }
23
+ ],
24
+ [e]
25
+ ), s = (c) => {
26
+ n(d.OFF_CYCLE_DEDUCTIONS_CHANGE, {
27
+ skipRegularDeductions: c === "skip"
28
+ });
29
+ }, r = t ? "skip" : "include";
30
+ return /* @__PURE__ */ p(
31
+ i,
32
+ {
33
+ label: e("title"),
34
+ description: e("description"),
35
+ options: l,
36
+ value: r,
37
+ onChange: s
38
+ }
39
+ );
40
+ }
41
+ export {
42
+ S as OffCycleDeductionsSetting
43
+ };
44
+ //# sourceMappingURL=OffCycleDeductionsSetting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OffCycleDeductionsSetting.js","sources":["../../../../src/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { OffCycleDeductionsSettingProps } from './types'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype DeductionsValue = 'include' | 'skip'\n\nexport function OffCycleDeductionsSetting({\n dictionary,\n skipRegularDeductions,\n onEvent,\n}: OffCycleDeductionsSettingProps) {\n useComponentDictionary('Payroll.OffCycleDeductionsSetting', dictionary)\n useI18n('Payroll.OffCycleDeductionsSetting')\n\n const { t } = useTranslation('Payroll.OffCycleDeductionsSetting')\n const { RadioGroup } = useComponentContext()\n\n const options = useMemo(\n () => [\n {\n value: 'include' as const,\n label: t('options.include.label'),\n },\n {\n value: 'skip' as const,\n label: t('options.skip.label'),\n },\n ],\n [t],\n )\n\n const handleChange = (value: string) => {\n onEvent(componentEvents.OFF_CYCLE_DEDUCTIONS_CHANGE, {\n skipRegularDeductions: value === 'skip',\n })\n }\n\n const selectedValue: DeductionsValue = skipRegularDeductions ? 'skip' : 'include'\n\n return (\n <RadioGroup\n label={t('title')}\n description={t('description')}\n options={options}\n value={selectedValue}\n onChange={handleChange}\n />\n )\n}\n"],"names":["OffCycleDeductionsSetting","dictionary","skipRegularDeductions","onEvent","useComponentDictionary","useI18n","t","useTranslation","RadioGroup","useComponentContext","options","useMemo","handleChange","value","componentEvents","selectedValue","jsx"],"mappings":";;;;;;AASO,SAASA,EAA0B;AAAA,EACxC,YAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,SAAAC;AACF,GAAmC;AACjC,EAAAC,EAAuB,qCAAqCH,CAAU,GACtEI,EAAQ,mCAAmC;AAE3C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mCAAmC,GAC1D,EAAE,YAAAC,EAAA,IAAeC,EAAA,GAEjBC,IAAUC;AAAA,IACd,MAAM;AAAA,MACJ;AAAA,QACE,OAAO;AAAA,QACP,OAAOL,EAAE,uBAAuB;AAAA,MAAA;AAAA,MAElC;AAAA,QACE,OAAO;AAAA,QACP,OAAOA,EAAE,oBAAoB;AAAA,MAAA;AAAA,IAC/B;AAAA,IAEF,CAACA,CAAC;AAAA,EAAA,GAGEM,IAAe,CAACC,MAAkB;AACtC,IAAAV,EAAQW,EAAgB,6BAA6B;AAAA,MACnD,uBAAuBD,MAAU;AAAA,IAAA,CAClC;AAAA,EACH,GAEME,IAAiCb,IAAwB,SAAS;AAExE,SACE,gBAAAc;AAAA,IAACR;AAAA,IAAA;AAAA,MACC,OAAOF,EAAE,OAAO;AAAA,MAChB,aAAaA,EAAE,aAAa;AAAA,MAC5B,SAAAI;AAAA,MACA,OAAOK;AAAA,MACP,UAAUH;AAAA,IAAA;AAAA,EAAA;AAGhB;"}
@@ -0,0 +1,3 @@
1
+ import "./types/i18next.d.ts"
2
+ export { OffCycleDeductionsSetting } from './OffCycleDeductionsSetting';
3
+ export type { OffCycleDeductionsSettingProps, OffCycleDeductionsSettingChangePayload, } from './types';
@@ -0,0 +1,10 @@
1
+ import { CommonComponentInterface } from '../../Base/Base';
2
+ import { OnEventType } from '../../Base/useBase';
3
+ import { EventType } from '../../../shared/constants';
4
+ export interface OffCycleDeductionsSettingProps extends CommonComponentInterface<'Payroll.OffCycleDeductionsSetting'> {
5
+ skipRegularDeductions: boolean;
6
+ onEvent: OnEventType<EventType, unknown>;
7
+ }
8
+ export interface OffCycleDeductionsSettingChangePayload {
9
+ skipRegularDeductions: boolean;
10
+ }
@@ -1,2 +1 @@
1
- import { OffCyclePayPeriodDateFormPresentationProps } from './OffCyclePayPeriodDateFormTypes';
2
- export declare function OffCyclePayPeriodDateFormPresentation({ isCheckOnly, onCheckOnlyChange, }: OffCyclePayPeriodDateFormPresentationProps): import("react/jsx-runtime").JSX.Element;
1
+ export declare function OffCyclePayPeriodDateFormPresentation(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,37 @@
1
+ import { jsxs as o, jsx as t } from "react/jsx-runtime";
2
+ import { useFormContext as m, useWatch as d } from "react-hook-form";
3
+ import { useTranslation as h } from "react-i18next";
4
+ import a from "./OffCyclePayPeriodDateFormPresentation.module.scss.js";
5
+ import { useI18n as f } from "../../../i18n/I18n.js";
6
+ import "../../../shared/constants.js";
7
+ import "classnames";
8
+ import { DatePickerField as r } from "../../Common/Fields/DatePickerField/DatePickerField.js";
9
+ import "../../../contexts/ComponentAdapter/useComponentContext.js";
10
+ import "react";
11
+ import { CheckboxField as u } from "../../Common/Fields/CheckboxField/CheckboxField.js";
12
+ function q() {
13
+ f("Payroll.OffCyclePayPeriodDateForm");
14
+ const { t: e } = h("Payroll.OffCyclePayPeriodDateForm"), { control: i, setValue: l } = m(), n = d({ control: i, name: "isCheckOnly" }), c = (s) => {
15
+ s && (l("startDate", null), l("endDate", null));
16
+ };
17
+ return /* @__PURE__ */ o("div", { className: a.root, children: [
18
+ !n && /* @__PURE__ */ o("div", { className: a.dateFields, children: [
19
+ /* @__PURE__ */ t(r, { name: "startDate", label: e("startDateLabel"), isRequired: !0 }),
20
+ /* @__PURE__ */ t(r, { name: "endDate", label: e("endDateLabel"), isRequired: !0 })
21
+ ] }),
22
+ /* @__PURE__ */ t("div", { className: a.checkDateField, children: /* @__PURE__ */ t(r, { name: "checkDate", label: e("checkDateLabel"), isRequired: !0 }) }),
23
+ /* @__PURE__ */ t(
24
+ u,
25
+ {
26
+ name: "isCheckOnly",
27
+ label: e("checkOnlyLabel"),
28
+ description: e("checkOnlyDescription"),
29
+ onChange: c
30
+ }
31
+ )
32
+ ] });
33
+ }
34
+ export {
35
+ q as OffCyclePayPeriodDateFormPresentation
36
+ };
37
+ //# sourceMappingURL=OffCyclePayPeriodDateFormPresentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OffCyclePayPeriodDateFormPresentation.js","sources":["../../../../src/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport styles from './OffCyclePayPeriodDateFormPresentation.module.scss'\nimport type { OffCyclePayPeriodDateFormData } from './OffCyclePayPeriodDateFormTypes'\nimport { useI18n } from '@/i18n'\nimport { CheckboxField, DatePickerField } from '@/components/Common'\n\nexport function OffCyclePayPeriodDateFormPresentation() {\n useI18n('Payroll.OffCyclePayPeriodDateForm')\n const { t } = useTranslation('Payroll.OffCyclePayPeriodDateForm')\n const { control, setValue } = useFormContext<OffCyclePayPeriodDateFormData>()\n const isCheckOnly = useWatch({ control, name: 'isCheckOnly' })\n\n const handleCheckOnlyChange = (checked: boolean) => {\n if (checked) {\n setValue('startDate', null)\n setValue('endDate', null)\n }\n }\n\n return (\n <div className={styles.root}>\n {!isCheckOnly && (\n <div className={styles.dateFields}>\n <DatePickerField name=\"startDate\" label={t('startDateLabel')} isRequired />\n <DatePickerField name=\"endDate\" label={t('endDateLabel')} isRequired />\n </div>\n )}\n\n <div className={styles.checkDateField}>\n <DatePickerField name=\"checkDate\" label={t('checkDateLabel')} isRequired />\n </div>\n\n <CheckboxField\n name=\"isCheckOnly\"\n label={t('checkOnlyLabel')}\n description={t('checkOnlyDescription')}\n onChange={handleCheckOnlyChange}\n />\n </div>\n )\n}\n"],"names":["OffCyclePayPeriodDateFormPresentation","useI18n","t","useTranslation","control","setValue","useFormContext","isCheckOnly","useWatch","handleCheckOnlyChange","checked","jsxs","styles","jsx","DatePickerField","CheckboxField"],"mappings":";;;;;;;;;;;AAOO,SAASA,IAAwC;AACtD,EAAAC,EAAQ,mCAAmC;AAC3C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mCAAmC,GAC1D,EAAE,SAAAC,GAAS,UAAAC,EAAA,IAAaC,EAAA,GACxBC,IAAcC,EAAS,EAAE,SAAAJ,GAAS,MAAM,eAAe,GAEvDK,IAAwB,CAACC,MAAqB;AAClD,IAAIA,MACFL,EAAS,aAAa,IAAI,GAC1BA,EAAS,WAAW,IAAI;AAAA,EAE5B;AAEA,SACE,gBAAAM,EAAC,OAAA,EAAI,WAAWC,EAAO,MACpB,UAAA;AAAA,IAAA,CAACL,KACA,gBAAAI,EAAC,OAAA,EAAI,WAAWC,EAAO,YACrB,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAA,EAAgB,MAAK,aAAY,OAAOZ,EAAE,gBAAgB,GAAG,YAAU,IAAC;AAAA,MACzE,gBAAAW,EAACC,KAAgB,MAAK,WAAU,OAAOZ,EAAE,cAAc,GAAG,YAAU,GAAA,CAAC;AAAA,IAAA,GACvE;AAAA,IAGF,gBAAAW,EAAC,OAAA,EAAI,WAAWD,EAAO,gBACrB,UAAA,gBAAAC,EAACC,GAAA,EAAgB,MAAK,aAAY,OAAOZ,EAAE,gBAAgB,GAAG,YAAU,IAAC,GAC3E;AAAA,IAEA,gBAAAW;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOb,EAAE,gBAAgB;AAAA,QACzB,aAAaA,EAAE,sBAAsB;AAAA,QACrC,UAAUO;AAAA,MAAA;AAAA,IAAA;AAAA,EACZ,GACF;AAEJ;"}
@@ -0,0 +1,12 @@
1
+ const e = "_root_erc2u_1", t = "_dateFields_erc2u_7", c = "_checkDateField_erc2u_16", o = {
2
+ root: e,
3
+ dateFields: t,
4
+ checkDateField: c
5
+ };
6
+ export {
7
+ c as checkDateField,
8
+ t as dateFields,
9
+ o as default,
10
+ e as root
11
+ };
12
+ //# sourceMappingURL=OffCyclePayPeriodDateFormPresentation.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OffCyclePayPeriodDateFormPresentation.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1,9 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  export type OffCyclePayrollDateType = 'bonus' | 'correction';
3
- export interface OffCyclePayPeriodDateFormPresentationProps {
4
- isCheckOnly: boolean;
5
- onCheckOnlyChange: (value: boolean) => void;
6
- }
7
3
  export interface OffCyclePayPeriodDateFormData {
8
4
  isCheckOnly: boolean;
9
5
  startDate: Date | null;
@@ -0,0 +1,48 @@
1
+ import { z as s } from "zod";
2
+ const r = (t, c, i) => s.object({
3
+ isCheckOnly: s.boolean(),
4
+ startDate: s.date().nullable(),
5
+ endDate: s.date().nullable(),
6
+ checkDate: s.date().nullable()
7
+ }).superRefine((e, a) => {
8
+ if (!e.isCheckOnly && (e.startDate || a.addIssue({
9
+ code: s.ZodIssueCode.custom,
10
+ path: ["startDate"],
11
+ message: t("validations.startDateRequired")
12
+ }), e.endDate || a.addIssue({
13
+ code: s.ZodIssueCode.custom,
14
+ path: ["endDate"],
15
+ message: t("validations.endDateRequired")
16
+ }), e.startDate && e.endDate && e.endDate < e.startDate && a.addIssue({
17
+ code: s.ZodIssueCode.custom,
18
+ path: ["endDate"],
19
+ message: t("validations.endDateAfterStart")
20
+ }), c === "correction" && e.startDate)) {
21
+ const o = /* @__PURE__ */ new Date();
22
+ o.setHours(0, 0, 0, 0), e.startDate > o && a.addIssue({
23
+ code: s.ZodIssueCode.custom,
24
+ path: ["startDate"],
25
+ message: t("validations.startDateNotFuture")
26
+ });
27
+ }
28
+ if (!e.checkDate)
29
+ a.addIssue({
30
+ code: s.ZodIssueCode.custom,
31
+ path: ["checkDate"],
32
+ message: t("validations.checkDateRequired")
33
+ });
34
+ else if (!e.isCheckOnly) {
35
+ const o = new Date(e.checkDate);
36
+ o.setHours(0, 0, 0, 0);
37
+ const d = new Date(i);
38
+ d.setHours(0, 0, 0, 0), o < d && a.addIssue({
39
+ code: s.ZodIssueCode.custom,
40
+ path: ["checkDate"],
41
+ message: t("validations.checkDateAchLeadTime")
42
+ });
43
+ }
44
+ });
45
+ export {
46
+ r as createOffCyclePayPeriodDateFormSchema
47
+ };
48
+ //# sourceMappingURL=OffCyclePayPeriodDateFormTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OffCyclePayPeriodDateFormTypes.js","sources":["../../../../src/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport type OffCyclePayrollDateType = 'bonus' | 'correction'\n\nexport interface OffCyclePayPeriodDateFormData {\n isCheckOnly: boolean\n startDate: Date | null\n endDate: Date | null\n checkDate: Date | null\n}\n\nexport const createOffCyclePayPeriodDateFormSchema = (\n t: (key: string) => string,\n payrollType: OffCyclePayrollDateType,\n minCheckDate: Date,\n) => {\n return z\n .object({\n isCheckOnly: z.boolean(),\n startDate: z.date().nullable(),\n endDate: z.date().nullable(),\n checkDate: z.date().nullable(),\n })\n .superRefine((data, ctx) => {\n if (!data.isCheckOnly) {\n if (!data.startDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['startDate'],\n message: t('validations.startDateRequired'),\n })\n }\n\n if (!data.endDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['endDate'],\n message: t('validations.endDateRequired'),\n })\n }\n\n if (data.startDate && data.endDate && data.endDate < data.startDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['endDate'],\n message: t('validations.endDateAfterStart'),\n })\n }\n\n if (payrollType === 'correction' && data.startDate) {\n const today = new Date()\n today.setHours(0, 0, 0, 0)\n if (data.startDate > today) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['startDate'],\n message: t('validations.startDateNotFuture'),\n })\n }\n }\n }\n\n if (!data.checkDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['checkDate'],\n message: t('validations.checkDateRequired'),\n })\n } else if (!data.isCheckOnly) {\n const checkDateNormalized = new Date(data.checkDate)\n checkDateNormalized.setHours(0, 0, 0, 0)\n const minCheckDateNormalized = new Date(minCheckDate)\n minCheckDateNormalized.setHours(0, 0, 0, 0)\n\n if (checkDateNormalized < minCheckDateNormalized) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['checkDate'],\n message: t('validations.checkDateAchLeadTime'),\n })\n }\n }\n })\n}\n\nexport type OffCyclePayPeriodDateFormSchema = ReturnType<\n typeof createOffCyclePayPeriodDateFormSchema\n>\n"],"names":["createOffCyclePayPeriodDateFormSchema","payrollType","minCheckDate","z","data","ctx","today","checkDateNormalized","minCheckDateNormalized"],"mappings":";AAWO,MAAMA,IAAwC,CACnD,GACAC,GACAC,MAEOC,EACJ,OAAO;AAAA,EACN,aAAaA,EAAE,QAAA;AAAA,EACf,WAAWA,EAAE,KAAA,EAAO,SAAA;AAAA,EACpB,SAASA,EAAE,KAAA,EAAO,SAAA;AAAA,EAClB,WAAWA,EAAE,KAAA,EAAO,SAAA;AAAS,CAC9B,EACA,YAAY,CAACC,GAAMC,MAAQ;AAC1B,MAAI,CAACD,EAAK,gBACHA,EAAK,aACRC,EAAI,SAAS;AAAA,IACX,MAAMF,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,WAAW;AAAA,IAClB,SAAS,EAAE,+BAA+B;AAAA,EAAA,CAC3C,GAGEC,EAAK,WACRC,EAAI,SAAS;AAAA,IACX,MAAMF,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,SAAS;AAAA,IAChB,SAAS,EAAE,6BAA6B;AAAA,EAAA,CACzC,GAGCC,EAAK,aAAaA,EAAK,WAAWA,EAAK,UAAUA,EAAK,aACxDC,EAAI,SAAS;AAAA,IACX,MAAMF,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,SAAS;AAAA,IAChB,SAAS,EAAE,+BAA+B;AAAA,EAAA,CAC3C,GAGCF,MAAgB,gBAAgBG,EAAK,YAAW;AAClD,UAAME,wBAAY,KAAA;AAClB,IAAAA,EAAM,SAAS,GAAG,GAAG,GAAG,CAAC,GACrBF,EAAK,YAAYE,KACnBD,EAAI,SAAS;AAAA,MACX,MAAMF,EAAE,aAAa;AAAA,MACrB,MAAM,CAAC,WAAW;AAAA,MAClB,SAAS,EAAE,gCAAgC;AAAA,IAAA,CAC5C;AAAA,EAEL;AAGF,MAAI,CAACC,EAAK;AACR,IAAAC,EAAI,SAAS;AAAA,MACX,MAAMF,EAAE,aAAa;AAAA,MACrB,MAAM,CAAC,WAAW;AAAA,MAClB,SAAS,EAAE,+BAA+B;AAAA,IAAA,CAC3C;AAAA,WACQ,CAACC,EAAK,aAAa;AAC5B,UAAMG,IAAsB,IAAI,KAAKH,EAAK,SAAS;AACnD,IAAAG,EAAoB,SAAS,GAAG,GAAG,GAAG,CAAC;AACvC,UAAMC,IAAyB,IAAI,KAAKN,CAAY;AACpD,IAAAM,EAAuB,SAAS,GAAG,GAAG,GAAG,CAAC,GAEtCD,IAAsBC,KACxBH,EAAI,SAAS;AAAA,MACX,MAAMF,EAAE,aAAa;AAAA,MACrB,MAAM,CAAC,WAAW;AAAA,MAClB,SAAS,EAAE,kCAAkC;AAAA,IAAA,CAC9C;AAAA,EAEL;AACF,CAAC;"}
@@ -0,0 +1,18 @@
1
+ import { useMemo as o } from "react";
2
+ import { addBusinessDays as r } from "../../../helpers/dateFormatting.js";
3
+ const s = 2;
4
+ function u() {
5
+ const e = o(() => {
6
+ const t = /* @__PURE__ */ new Date();
7
+ return t.setHours(0, 0, 0, 0), t;
8
+ }, []), n = o(() => r(e, s), [e]);
9
+ return {
10
+ today: e,
11
+ minCheckDate: n,
12
+ achLeadTimeBusinessDays: s
13
+ };
14
+ }
15
+ export {
16
+ u as useOffCyclePayPeriodDateValidation
17
+ };
18
+ //# sourceMappingURL=useOffCyclePayPeriodDateValidation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOffCyclePayPeriodDateValidation.js","sources":["../../../../src/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { addBusinessDays } from '@/helpers/dateFormatting'\n\nconst ACH_LEAD_TIME_BUSINESS_DAYS = 2\n\nexport function useOffCyclePayPeriodDateValidation() {\n const today = useMemo(() => {\n const now = new Date()\n now.setHours(0, 0, 0, 0)\n return now\n }, [])\n\n const minCheckDate = useMemo(() => {\n return addBusinessDays(today, ACH_LEAD_TIME_BUSINESS_DAYS)\n }, [today])\n\n return {\n today,\n minCheckDate,\n achLeadTimeBusinessDays: ACH_LEAD_TIME_BUSINESS_DAYS,\n }\n}\n"],"names":["ACH_LEAD_TIME_BUSINESS_DAYS","useOffCyclePayPeriodDateValidation","today","useMemo","now","minCheckDate","addBusinessDays"],"mappings":";;AAGA,MAAMA,IAA8B;AAE7B,SAASC,IAAqC;AACnD,QAAMC,IAAQC,EAAQ,MAAM;AAC1B,UAAMC,wBAAU,KAAA;AAChB,WAAAA,EAAI,SAAS,GAAG,GAAG,GAAG,CAAC,GAChBA;AAAA,EACT,GAAG,CAAA,CAAE,GAECC,IAAeF,EAAQ,MACpBG,EAAgBJ,GAAOF,CAA2B,GACxD,CAACE,CAAK,CAAC;AAEV,SAAO;AAAA,IACL,OAAAA;AAAA,IACA,cAAAG;AAAA,IACA,yBAAyBL;AAAA,EAAA;AAE7B;"}
@@ -1,33 +1,32 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { useState as l } from "react";
3
- import { OffCycleReasonSelectionPresentation as c } from "./OffCycleReasonSelectionPresentation.js";
4
- import { OFF_CYCLE_REASON_DEFAULTS as f } from "./types.js";
5
- import { BaseComponent as m } from "../../Base/Base.js";
6
- import { useBase as i } from "../../Base/useBase.js";
7
- import { useComponentDictionary as C, useI18n as R } from "../../../i18n/I18n.js";
8
- import { componentEvents as p } from "../../../shared/constants.js";
9
- function g(e) {
10
- return /* @__PURE__ */ n(m, { ...e, children: /* @__PURE__ */ n(u, { ...e }) });
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { useCallback as a } from "react";
3
+ import { useForm as f, FormProvider as i } from "react-hook-form";
4
+ import { OffCycleReasonSelectionPresentation as l } from "./OffCycleReasonSelectionPresentation.js";
5
+ import { OFF_CYCLE_REASON_DEFAULTS as c } from "./types.js";
6
+ import { BaseComponent as C } from "../../Base/Base.js";
7
+ import { useBase as u } from "../../Base/useBase.js";
8
+ import { useComponentDictionary as p, useI18n as E } from "../../../i18n/I18n.js";
9
+ import { componentEvents as O } from "../../../shared/constants.js";
10
+ function A(o) {
11
+ return /* @__PURE__ */ e(C, { ...o, children: /* @__PURE__ */ e(R, { ...o }) });
11
12
  }
12
- function u({ dictionary: e }) {
13
- C("Payroll.OffCycleReasonSelection", e), R("Payroll.OffCycleReasonSelection");
14
- const { onEvent: t } = i(), [r, s] = l(null);
15
- return /* @__PURE__ */ n(
16
- c,
17
- {
18
- selectedReason: r,
19
- onReasonChange: (o) => {
20
- s(o);
21
- const a = f[o];
22
- t(p.OFF_CYCLE_SELECT_REASON, {
23
- reason: o,
24
- defaults: a
25
- });
26
- }
27
- }
13
+ function R({ dictionary: o }) {
14
+ p("Payroll.OffCycleReasonSelection", o), E("Payroll.OffCycleReasonSelection");
15
+ const { onEvent: n } = u(), r = f({
16
+ defaultValues: { reason: "" }
17
+ }), m = a(
18
+ (t) => {
19
+ const s = c[t];
20
+ n(O.OFF_CYCLE_SELECT_REASON, {
21
+ reason: t,
22
+ defaults: s
23
+ });
24
+ },
25
+ [n]
28
26
  );
27
+ return /* @__PURE__ */ e(i, { ...r, children: /* @__PURE__ */ e(l, { name: "reason", onChange: m }) });
29
28
  }
30
29
  export {
31
- g as OffCycleReasonSelection
30
+ A as OffCycleReasonSelection
32
31
  };
33
32
  //# sourceMappingURL=OffCycleReasonSelection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OffCycleReasonSelection.js","sources":["../../../../src/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { OffCycleReasonSelectionPresentation } from './OffCycleReasonSelectionPresentation'\nimport {\n OFF_CYCLE_REASON_DEFAULTS,\n type OffCycleReason,\n type OffCycleReasonSelectionProps,\n} from './types'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\nexport function OffCycleReasonSelection(props: OffCycleReasonSelectionProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ dictionary }: OffCycleReasonSelectionProps) {\n useComponentDictionary('Payroll.OffCycleReasonSelection', dictionary)\n useI18n('Payroll.OffCycleReasonSelection')\n\n const { onEvent } = useBase()\n const [selectedReason, setSelectedReason] = useState<OffCycleReason | null>(null)\n\n const handleReasonChange = (reason: OffCycleReason) => {\n setSelectedReason(reason)\n const defaults = OFF_CYCLE_REASON_DEFAULTS[reason]\n onEvent(componentEvents.OFF_CYCLE_SELECT_REASON, {\n reason,\n defaults,\n })\n }\n\n return (\n <OffCycleReasonSelectionPresentation\n selectedReason={selectedReason}\n onReasonChange={handleReasonChange}\n />\n )\n}\n"],"names":["OffCycleReasonSelection","props","jsx","BaseComponent","Root","dictionary","useComponentDictionary","useI18n","onEvent","useBase","selectedReason","setSelectedReason","useState","OffCycleReasonSelectionPresentation","reason","defaults","OFF_CYCLE_REASON_DEFAULTS","componentEvents"],"mappings":";;;;;;;;AAYO,SAASA,EAAwBC,GAAqC;AAC3E,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,KAA4C;AAC1D,EAAAC,EAAuB,mCAAmCD,CAAU,GACpEE,EAAQ,iCAAiC;AAEzC,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACd,CAACC,GAAgBC,CAAiB,IAAIC,EAAgC,IAAI;AAWhF,SACE,gBAAAV;AAAA,IAACW;AAAA,IAAA;AAAA,MACC,gBAAAH;AAAA,MACA,gBAZuB,CAACI,MAA2B;AACrD,QAAAH,EAAkBG,CAAM;AACxB,cAAMC,IAAWC,EAA0BF,CAAM;AACjD,QAAAN,EAAQS,EAAgB,yBAAyB;AAAA,UAC/C,QAAAH;AAAA,UACA,UAAAC;AAAA,QAAA,CACD;AAAA,MACH;AAAA,IAKoB;AAAA,EAAA;AAGtB;"}
1
+ {"version":3,"file":"OffCycleReasonSelection.js","sources":["../../../../src/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.tsx"],"sourcesContent":["import { useCallback } from 'react'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { OffCycleReasonSelectionPresentation } from './OffCycleReasonSelectionPresentation'\nimport {\n OFF_CYCLE_REASON_DEFAULTS,\n type OffCycleReason,\n type OffCycleReasonSelectionProps,\n} from './types'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\nexport function OffCycleReasonSelection(props: OffCycleReasonSelectionProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ dictionary }: OffCycleReasonSelectionProps) {\n useComponentDictionary('Payroll.OffCycleReasonSelection', dictionary)\n useI18n('Payroll.OffCycleReasonSelection')\n\n const { onEvent } = useBase()\n const methods = useForm<{ reason: OffCycleReason | '' }>({\n defaultValues: { reason: '' },\n })\n\n const handleReasonChange = useCallback(\n (reason: OffCycleReason) => {\n const defaults = OFF_CYCLE_REASON_DEFAULTS[reason]\n onEvent(componentEvents.OFF_CYCLE_SELECT_REASON, {\n reason,\n defaults,\n })\n },\n [onEvent],\n )\n\n return (\n <FormProvider {...methods}>\n <OffCycleReasonSelectionPresentation name=\"reason\" onChange={handleReasonChange} />\n </FormProvider>\n )\n}\n"],"names":["OffCycleReasonSelection","props","jsx","BaseComponent","Root","dictionary","useComponentDictionary","useI18n","onEvent","useBase","methods","useForm","handleReasonChange","useCallback","reason","defaults","OFF_CYCLE_REASON_DEFAULTS","componentEvents","FormProvider","OffCycleReasonSelectionPresentation"],"mappings":";;;;;;;;;AAaO,SAASA,EAAwBC,GAAqC;AAC3E,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,KAA4C;AAC1D,EAAAC,EAAuB,mCAAmCD,CAAU,GACpEE,EAAQ,iCAAiC;AAEzC,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACdC,IAAUC,EAAyC;AAAA,IACvD,eAAe,EAAE,QAAQ,GAAA;AAAA,EAAG,CAC7B,GAEKC,IAAqBC;AAAA,IACzB,CAACC,MAA2B;AAC1B,YAAMC,IAAWC,EAA0BF,CAAM;AACjD,MAAAN,EAAQS,EAAgB,yBAAyB;AAAA,QAC/C,QAAAH;AAAA,QACA,UAAAC;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACP,CAAO;AAAA,EAAA;AAGV,SACE,gBAAAN,EAACgB,GAAA,EAAc,GAAGR,GAChB,UAAA,gBAAAR,EAACiB,KAAoC,MAAK,UAAS,UAAUP,EAAA,CAAoB,EAAA,CACnF;AAEJ;"}