@gusto/embedded-react-sdk 0.44.2 → 0.45.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 (593) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/components/Common/DetailViewLayout/DetailViewLayout.js +7 -7
  3. package/dist/components/Common/DetailViewLayout/DetailViewLayout.js.map +1 -1
  4. package/dist/components/Common/UI/Alert/Alert.js +24 -23
  5. package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
  6. package/dist/components/Common/UI/Alert/Alert.module.scss.js +16 -14
  7. package/dist/components/Common/UI/Alert/Alert.module.scss.js.map +1 -1
  8. package/dist/components/Common/UI/Alert/AlertTypes.d.ts +8 -0
  9. package/dist/components/Common/UI/Alert/AlertTypes.js.map +1 -1
  10. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +38 -38
  11. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  12. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -20
  13. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  14. package/dist/components/Company/AssignSignatory/Head.js +12 -9
  15. package/dist/components/Company/AssignSignatory/Head.js.map +1 -1
  16. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +25 -25
  17. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  18. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -20
  19. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  20. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -22
  21. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  22. package/dist/components/Company/BankAccount/BankAccountForm/Head.js +11 -8
  23. package/dist/components/Company/BankAccount/BankAccountForm/Head.js.map +1 -1
  24. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -20
  25. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  26. package/dist/components/Company/BankAccount/BankAccountList/Head.js +44 -39
  27. package/dist/components/Company/BankAccount/BankAccountList/Head.js.map +1 -1
  28. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -20
  29. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  30. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +26 -26
  31. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  32. package/dist/components/Company/FederalTaxes/FederalTaxes.js +9 -9
  33. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  34. package/dist/components/Company/FederalTaxes/Head.js +7 -6
  35. package/dist/components/Company/FederalTaxes/Head.js.map +1 -1
  36. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +12 -28
  37. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  38. package/dist/components/Company/Industry/Context.js +7 -23
  39. package/dist/components/Company/Industry/Context.js.map +1 -1
  40. package/dist/components/Company/Industry/Head.js +10 -9
  41. package/dist/components/Company/Industry/Head.js.map +1 -1
  42. package/dist/components/Company/Industry/IndustrySelect.js +22 -19
  43. package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
  44. package/dist/components/Company/Locations/LocationForm/Head.js +9 -8
  45. package/dist/components/Company/Locations/LocationForm/Head.js.map +1 -1
  46. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -20
  47. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  48. package/dist/components/Company/Locations/LocationsList/Head.js +11 -10
  49. package/dist/components/Company/Locations/LocationsList/Head.js.map +1 -1
  50. package/dist/components/Company/Locations/LocationsList/LocationsList.js +11 -11
  51. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  52. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -20
  53. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  54. package/dist/components/Company/OnboardingOverview/context.js +4 -20
  55. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  56. package/dist/components/Company/PaySchedule/PayScheduleList.js +18 -18
  57. package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -1
  58. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -20
  59. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  60. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -20
  61. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  62. package/dist/components/Contractor/Address/useAddress.js +6 -22
  63. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  64. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +1 -1
  65. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  66. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +7 -7
  67. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  68. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -2
  69. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  70. package/dist/components/Contractor/Profile/useContractorProfile.js +42 -52
  71. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  72. package/dist/components/Employee/Compensation/index.d.ts +1 -1
  73. package/dist/components/Employee/Compensation/{Compensation.d.ts → onboarding/Compensation.d.ts} +3 -3
  74. package/dist/components/Employee/Compensation/onboarding/Compensation.js +88 -0
  75. package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -0
  76. package/dist/components/Employee/Compensation/{CompensationFlowComponents.d.ts → onboarding/CompensationFlowComponents.d.ts} +3 -3
  77. package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.js +59 -0
  78. package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.js.map +1 -0
  79. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +21 -0
  80. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +249 -0
  81. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -0
  82. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.module.scss.js +8 -0
  83. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.module.scss.js.map +1 -0
  84. package/dist/components/Employee/Compensation/onboarding/EditCompensation/index.d.ts +3 -0
  85. package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/JobsList.d.ts +1 -1
  86. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js +43 -0
  87. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js.map +1 -0
  88. package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/JobsListPresentation.js +10 -10
  89. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js.map +1 -0
  90. package/dist/components/Employee/Compensation/{compensationStateMachine.js → onboarding/compensationStateMachine.js} +1 -1
  91. package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js.map +1 -0
  92. package/dist/components/Employee/Compensation/onboarding/index.d.ts +2 -0
  93. package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.d.ts +9 -0
  94. package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.js +10 -0
  95. package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.js.map +1 -0
  96. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +7 -0
  97. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js +41 -35
  98. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
  99. package/dist/components/Employee/Compensation/shared/useCompensationForm/index.d.ts +0 -2
  100. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts +24 -3
  101. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +193 -181
  102. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
  103. package/dist/components/Employee/Compensation/shared/useJobForm/index.d.ts +0 -2
  104. package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +8 -0
  105. package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js +14 -13
  106. package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
  107. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +19 -2
  108. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +133 -130
  109. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
  110. package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +13 -0
  111. package/dist/components/Employee/Dashboard/BasicDetailsView.js +87 -65
  112. package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
  113. package/dist/components/Employee/Dashboard/CompensationCard.d.ts +13 -0
  114. package/dist/components/Employee/Dashboard/Dashboard.js +89 -109
  115. package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
  116. package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +15 -0
  117. package/dist/components/Employee/Dashboard/DashboardComponents.js +120 -25
  118. package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
  119. package/dist/components/Employee/Dashboard/DocumentsView.d.ts +11 -0
  120. package/dist/components/Employee/Dashboard/DocumentsView.js +24 -17
  121. package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
  122. package/dist/components/Employee/Dashboard/JobAndPayView.d.ts +9 -17
  123. package/dist/components/Employee/Dashboard/JobAndPayView.js +495 -114
  124. package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
  125. package/dist/components/Employee/Dashboard/PendingChangesReviewModal.d.ts +10 -0
  126. package/dist/components/Employee/Dashboard/PendingChangesReviewModal.js +64 -0
  127. package/dist/components/Employee/Dashboard/PendingChangesReviewModal.js.map +1 -0
  128. package/dist/components/Employee/Dashboard/TaxesView.d.ts +13 -0
  129. package/dist/components/Employee/Dashboard/TaxesView.js +82 -60
  130. package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
  131. package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +7 -0
  132. package/dist/components/Employee/Dashboard/dashboardStateMachine.js +227 -40
  133. package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
  134. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.d.ts +50 -0
  135. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js +57 -0
  136. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js.map +1 -0
  137. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.test.d.ts +1 -0
  138. package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +7 -4
  139. package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -1
  140. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +14 -8
  141. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +60 -36
  142. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
  143. package/dist/components/Employee/Dashboard/usePendingChangeDetailRenderer.d.ts +8 -0
  144. package/dist/components/Employee/Dashboard/usePendingChangeDetailRenderer.js +61 -0
  145. package/dist/components/Employee/Dashboard/usePendingChangeDetailRenderer.js.map +1 -0
  146. package/dist/components/Employee/Deductions/Deductions.d.ts +2 -8
  147. package/dist/components/Employee/Deductions/Deductions.js +25 -52
  148. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  149. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.d.ts +9 -0
  150. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.js +137 -0
  151. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.js.map +1 -0
  152. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +9 -5
  153. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +97 -94
  154. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
  155. package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.d.ts +18 -0
  156. package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.js +137 -0
  157. package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.js.map +1 -0
  158. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.d.ts +10 -5
  159. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +57 -77
  160. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  161. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.d.ts +5 -5
  162. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +29 -39
  163. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
  164. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +8 -6
  165. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -1
  166. package/dist/components/Employee/Deductions/{DeductionsComponents.d.ts → deductionsContextualComponents.d.ts} +7 -8
  167. package/dist/components/Employee/Deductions/deductionsContextualComponents.js +74 -0
  168. package/dist/components/Employee/Deductions/deductionsContextualComponents.js.map +1 -0
  169. package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.d.ts +7 -0
  170. package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.js +31 -0
  171. package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.js.map +1 -0
  172. package/dist/components/Employee/Deductions/shared/formatDeductionAmount.d.ts +7 -0
  173. package/dist/components/Employee/Deductions/shared/formatDeductionAmount.js +10 -0
  174. package/dist/components/Employee/Deductions/shared/formatDeductionAmount.js.map +1 -0
  175. package/dist/components/Employee/Deductions/shared/formatDeductionAmount.test.d.ts +1 -0
  176. package/dist/components/Employee/Deductions/shared/index.d.ts +7 -0
  177. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +63 -0
  178. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js +64 -0
  179. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js.map +1 -0
  180. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.d.ts +36 -0
  181. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +39 -0
  182. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js.map +1 -0
  183. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/index.d.ts +4 -0
  184. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.d.ts +62 -0
  185. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js +208 -0
  186. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js.map +1 -0
  187. package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.d.ts +63 -0
  188. package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js +52 -0
  189. package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js.map +1 -0
  190. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.d.ts +25 -0
  191. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +36 -0
  192. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js.map +1 -0
  193. package/dist/components/Employee/Deductions/shared/useDeductionForm/index.d.ts +4 -0
  194. package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.d.ts +64 -0
  195. package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js +203 -0
  196. package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js.map +1 -0
  197. package/dist/components/Employee/Deductions/shared/useDeductionsList.d.ts +22 -0
  198. package/dist/components/Employee/Deductions/shared/useDeductionsList.js +50 -0
  199. package/dist/components/Employee/Deductions/shared/useDeductionsList.js.map +1 -0
  200. package/dist/components/Employee/Deductions/shared/useDeleteDeduction.d.ts +13 -0
  201. package/dist/components/Employee/Deductions/shared/useDeleteDeduction.js +17 -0
  202. package/dist/components/Employee/Deductions/shared/useDeleteDeduction.js.map +1 -0
  203. package/dist/components/Employee/Deductions/stateMachine.d.ts +4 -5
  204. package/dist/components/Employee/Deductions/stateMachine.js +67 -89
  205. package/dist/components/Employee/Deductions/stateMachine.js.map +1 -1
  206. package/dist/components/Employee/Documents/management/DocumentManager.d.ts +6 -0
  207. package/dist/components/Employee/Documents/management/DocumentManager.js +60 -0
  208. package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -0
  209. package/dist/components/Employee/Documents/management/index.d.ts +3 -0
  210. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Actions.js +3 -3
  211. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js.map +1 -0
  212. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/DocumentList.d.ts +1 -1
  213. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/DocumentList.js +5 -5
  214. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -0
  215. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Head.js +1 -1
  216. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Head.js.map +1 -0
  217. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/List.js +3 -3
  218. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js.map +1 -0
  219. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +8 -0
  220. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -0
  221. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentSigner.d.ts +1 -1
  222. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentSigner.js +5 -5
  223. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -0
  224. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibility.d.ts +1 -1
  225. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibility.js +4 -4
  226. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -0
  227. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilityPresentation.js +11 -11
  228. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -0
  229. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -0
  230. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.test.d.ts +1 -0
  231. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/countries.js.map +1 -0
  232. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.d.ts +1 -1
  233. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.js +13 -13
  234. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -0
  235. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/documentSignerStateMachine.d.ts +2 -2
  236. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/documentSignerStateMachine.js +8 -8
  237. package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.js.map +1 -0
  238. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/stateMachine.js +1 -1
  239. package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.js.map +1 -0
  240. package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/EmployeeDocuments.d.ts +3 -3
  241. package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/EmployeeDocuments.js +6 -6
  242. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -0
  243. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js +117 -0
  244. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -0
  245. package/dist/components/Employee/{DocumentSigner → Documents/shared}/SignatureForm/SignatureForm.d.ts +1 -1
  246. package/dist/components/Employee/{DocumentSigner → Documents/shared}/SignatureForm/SignatureForm.js +14 -14
  247. package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -0
  248. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js.map +1 -0
  249. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -0
  250. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -0
  251. package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +89 -82
  252. package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js.map +1 -1
  253. package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +37 -35
  254. package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
  255. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -0
  256. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +14 -8
  257. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
  258. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +38 -39
  259. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  260. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +29 -27
  261. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
  262. package/dist/components/Employee/PaymentMethod/index.d.ts +1 -1
  263. package/dist/components/Employee/PaymentMethod/management/ListView.d.ts +8 -0
  264. package/dist/components/Employee/PaymentMethod/management/ListView.js +138 -0
  265. package/dist/components/Employee/PaymentMethod/management/ListView.js.map +1 -0
  266. package/dist/components/Employee/PaymentMethod/management/PaymentMethod.d.ts +11 -0
  267. package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js +49 -0
  268. package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -0
  269. package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.d.ts +8 -0
  270. package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js +23 -0
  271. package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js.map +1 -0
  272. package/dist/components/Employee/PaymentMethod/management/index.d.ts +4 -0
  273. package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.d.ts +5 -0
  274. package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js +75 -0
  275. package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js.map +1 -0
  276. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.d.ts +8 -0
  277. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +66 -0
  278. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js.map +1 -0
  279. package/dist/components/Employee/PaymentMethod/onboarding/ListView.d.ts +9 -0
  280. package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +168 -0
  281. package/dist/components/Employee/PaymentMethod/onboarding/ListView.js.map +1 -0
  282. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.d.ts +11 -0
  283. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js +44 -0
  284. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -0
  285. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.d.ts +8 -0
  286. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js +23 -0
  287. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js.map +1 -0
  288. package/dist/components/Employee/PaymentMethod/onboarding/SplitView.d.ts +8 -0
  289. package/dist/components/Employee/PaymentMethod/onboarding/SplitView.js +97 -0
  290. package/dist/components/Employee/PaymentMethod/onboarding/SplitView.js.map +1 -0
  291. package/dist/components/Employee/PaymentMethod/onboarding/index.d.ts +2 -0
  292. package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.d.ts +5 -0
  293. package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js +75 -0
  294. package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js.map +1 -0
  295. package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.d.ts +9 -0
  296. package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.js +31 -0
  297. package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.js.map +1 -0
  298. package/dist/components/Employee/PaymentMethod/shared/index.d.ts +7 -0
  299. package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.d.ts +15 -0
  300. package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +22 -0
  301. package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js.map +1 -0
  302. package/dist/components/Employee/PaymentMethod/shared/useBankForm/index.d.ts +5 -0
  303. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.d.ts +37 -0
  304. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js +105 -0
  305. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js.map +1 -0
  306. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.d.ts +39 -0
  307. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.js +26 -0
  308. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.js.map +1 -0
  309. package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.d.ts +13 -0
  310. package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.js +19 -0
  311. package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.js.map +1 -0
  312. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.d.ts +6 -0
  313. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.js +9 -0
  314. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.js.map +1 -0
  315. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/index.d.ts +5 -0
  316. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.d.ts +31 -0
  317. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js +94 -0
  318. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js.map +1 -0
  319. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.d.ts +31 -0
  320. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.js +22 -0
  321. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.js.map +1 -0
  322. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.d.ts +20 -0
  323. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js +68 -0
  324. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js.map +1 -0
  325. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.d.ts +6 -0
  326. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.js +9 -0
  327. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.js.map +1 -0
  328. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/index.d.ts +6 -0
  329. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.d.ts +48 -0
  330. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +46 -0
  331. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js.map +1 -0
  332. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.d.ts +65 -0
  333. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js +209 -0
  334. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js.map +1 -0
  335. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.d.ts +53 -0
  336. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.js +93 -0
  337. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.js.map +1 -0
  338. package/dist/components/Employee/Profile/onboarding/AdminProfile.js +88 -87
  339. package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
  340. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js +2 -2
  341. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
  342. package/dist/components/Employee/Taxes/FederalForm.js +27 -26
  343. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  344. package/dist/components/Employee/Taxes/FederalHead.js +13 -10
  345. package/dist/components/Employee/Taxes/FederalHead.js.map +1 -1
  346. package/dist/components/Employee/Taxes/StateForm.js +17 -14
  347. package/dist/components/Employee/Taxes/StateForm.js.map +1 -1
  348. package/dist/components/Employee/Taxes/Taxes.js +75 -69
  349. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  350. package/dist/components/Employee/Taxes/useTaxes.js +4 -20
  351. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  352. package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +26 -26
  353. package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
  354. package/dist/components/Employee/exports/employeeManagement.d.ts +4 -1
  355. package/dist/components/Employee/exports/employeeManagement.js +22 -18
  356. package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
  357. package/dist/components/Employee/exports/employeeOnboarding.d.ts +3 -3
  358. package/dist/components/Employee/exports/employeeOnboarding.js +4 -4
  359. package/dist/components/Employee/index.d.ts +4 -4
  360. package/dist/components/Employee/index.js +5 -5
  361. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +26 -34
  362. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  363. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +35 -35
  364. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  365. package/dist/components/Payroll/usePreparedPayrollData.js +22 -36
  366. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  367. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js +84 -82
  368. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -1
  369. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.d.ts +1 -1
  370. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +49 -48
  371. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
  372. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailTypes.d.ts +1 -0
  373. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +39 -37
  374. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
  375. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js +31 -31
  376. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -1
  377. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormTypes.d.ts +1 -0
  378. package/dist/components/TimeOff/PolicyList/PolicyList.js +27 -27
  379. package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
  380. package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +50 -50
  381. package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
  382. package/dist/components/TimeOff/PolicySettings/PolicySettings.d.ts +1 -0
  383. package/dist/components/TimeOff/PolicySettings/PolicySettings.js +66 -41
  384. package/dist/components/TimeOff/PolicySettings/PolicySettings.js.map +1 -1
  385. package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.d.ts +1 -1
  386. package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +59 -48
  387. package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -1
  388. package/dist/components/TimeOff/PolicySettings/PolicySettingsTypes.d.ts +3 -0
  389. package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +34 -33
  390. package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -1
  391. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +3 -0
  392. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js +69 -61
  393. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
  394. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +119 -75
  395. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
  396. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +72 -61
  397. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
  398. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -1
  399. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +103 -84
  400. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
  401. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +2 -0
  402. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +51 -49
  403. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
  404. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -1
  405. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +78 -59
  406. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
  407. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.module.scss.js +8 -0
  408. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.module.scss.js.map +1 -0
  409. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +6 -2
  410. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +209 -154
  411. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
  412. package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.d.ts +3 -1
  413. package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js +36 -34
  414. package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -1
  415. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +136 -134
  416. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
  417. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.module.scss.js +6 -6
  418. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.d.ts +1 -1
  419. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js +63 -65
  420. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js.map +1 -1
  421. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailTypes.d.ts +1 -0
  422. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +50 -49
  423. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
  424. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.module.scss.js +4 -4
  425. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.d.ts +1 -1
  426. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +66 -55
  427. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
  428. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayoutTypes.d.ts +1 -0
  429. package/dist/contexts/ApiProvider/ApiProvider.js +33 -39
  430. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  431. package/dist/contexts/ApiProvider/createSdkQueryClient.d.ts +17 -0
  432. package/dist/contexts/ApiProvider/createSdkQueryClient.js +14 -0
  433. package/dist/contexts/ApiProvider/createSdkQueryClient.js.map +1 -0
  434. package/dist/helpers/formattedStrings.d.ts +12 -0
  435. package/dist/helpers/formattedStrings.js +55 -33
  436. package/dist/helpers/formattedStrings.js.map +1 -1
  437. package/dist/hooks/useClientPagination/useClientPagination.d.ts +44 -0
  438. package/dist/hooks/useClientPagination/useClientPagination.js +69 -0
  439. package/dist/hooks/useClientPagination/useClientPagination.js.map +1 -0
  440. package/dist/hooks/useClientPagination/useClientPagination.test.d.ts +1 -0
  441. package/dist/i18n/I18n.js +6 -5
  442. package/dist/i18n/I18n.js.map +1 -1
  443. package/dist/i18n/en/Company.PaySchedule.json.js +22 -20
  444. package/dist/i18n/en/Company.PaySchedule.json.js.map +1 -1
  445. package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +8 -6
  446. package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js.map +1 -1
  447. package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js +9 -9
  448. package/dist/i18n/en/Company.TimeOff.PolicyDetail.json.js +6 -4
  449. package/dist/i18n/en/Company.TimeOff.PolicyDetail.json.js.map +1 -1
  450. package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js +17 -15
  451. package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js.map +1 -1
  452. package/dist/i18n/en/Company.TimeOff.SelectPolicyType.json.js +10 -8
  453. package/dist/i18n/en/Company.TimeOff.SelectPolicyType.json.js.map +1 -1
  454. package/dist/i18n/en/Employee.Dashboard.json.js +16 -12
  455. package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -1
  456. package/dist/i18n/en/Employee.Deductions.json.js +104 -76
  457. package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
  458. package/dist/i18n/en/Employee.DocumentManager.json.js +12 -0
  459. package/dist/i18n/en/Employee.DocumentManager.json.js.map +1 -0
  460. package/dist/i18n/en/Employee.PaymentMethod.json.js +76 -64
  461. package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
  462. package/dist/i18n/en/common.json.d.ts +7 -0
  463. package/dist/i18n/en/common.json.js +19 -17
  464. package/dist/i18n/en/common.json.js.map +1 -1
  465. package/dist/index.d.ts +16 -6
  466. package/dist/index.js +138 -112
  467. package/dist/index.js.map +1 -1
  468. package/dist/partner-hook-utils/form/fields/NumberInputHookField.d.ts +2 -1
  469. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +20 -18
  470. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
  471. package/dist/shared/constants.d.ts +8 -2
  472. package/dist/shared/constants.js +11 -8
  473. package/dist/shared/constants.js.map +1 -1
  474. package/dist/style.css +1 -1
  475. package/dist/test-utils/assertions.d.ts +16 -0
  476. package/dist/types/i18next.d.ts +140 -4
  477. package/dist/types/sdkError.js +58 -47
  478. package/dist/types/sdkError.js.map +1 -1
  479. package/docs/reference/endpoint-inventory.json +980 -1170
  480. package/package.json +29 -21
  481. package/dist/components/Employee/Compensation/Compensation.js +0 -87
  482. package/dist/components/Employee/Compensation/Compensation.js.map +0 -1
  483. package/dist/components/Employee/Compensation/CompensationFlowComponents.js +0 -61
  484. package/dist/components/Employee/Compensation/CompensationFlowComponents.js.map +0 -1
  485. package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.d.ts +0 -14
  486. package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.js +0 -128
  487. package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.js.map +0 -1
  488. package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.d.ts +0 -17
  489. package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.js +0 -224
  490. package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.js.map +0 -1
  491. package/dist/components/Employee/Compensation/EditCompensation/index.d.ts +0 -5
  492. package/dist/components/Employee/Compensation/JobsList/JobsList.js +0 -47
  493. package/dist/components/Employee/Compensation/JobsList/JobsList.js.map +0 -1
  494. package/dist/components/Employee/Compensation/JobsList/JobsListPresentation.js.map +0 -1
  495. package/dist/components/Employee/Compensation/compensationSchema.d.ts +0 -29
  496. package/dist/components/Employee/Compensation/compensationSchema.js +0 -63
  497. package/dist/components/Employee/Compensation/compensationSchema.js.map +0 -1
  498. package/dist/components/Employee/Compensation/compensationStateMachine.js.map +0 -1
  499. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.d.ts +0 -15
  500. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.js +0 -27
  501. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.js.map +0 -1
  502. package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.d.ts +0 -13
  503. package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.js +0 -26
  504. package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.js.map +0 -1
  505. package/dist/components/Employee/Deductions/Actions.d.ts +0 -1
  506. package/dist/components/Employee/Deductions/DeductionsComponents.js +0 -31
  507. package/dist/components/Employee/Deductions/DeductionsComponents.js.map +0 -1
  508. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.d.ts +0 -39
  509. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +0 -237
  510. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +0 -1
  511. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +0 -22
  512. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +0 -162
  513. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +0 -1
  514. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +0 -34
  515. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +0 -168
  516. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +0 -1
  517. package/dist/components/Employee/Deductions/Head.d.ts +0 -1
  518. package/dist/components/Employee/Deductions/useDeductions.d.ts +0 -30
  519. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +0 -1
  520. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +0 -1
  521. package/dist/components/Employee/DocumentSigner/DocumentList/Head.js.map +0 -1
  522. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +0 -1
  523. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +0 -24
  524. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +0 -1
  525. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +0 -1
  526. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +0 -1
  527. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +0 -1
  528. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +0 -1
  529. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/countries.js.map +0 -1
  530. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +0 -1
  531. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +0 -1
  532. package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.js.map +0 -1
  533. package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.js.map +0 -1
  534. package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +0 -1
  535. package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +0 -1
  536. package/dist/components/Employee/DocumentSigner/stateMachine.js.map +0 -1
  537. package/dist/components/Employee/EmployeeDocuments/EmployeeDocuments.js.map +0 -1
  538. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +0 -115
  539. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +0 -1
  540. package/dist/components/Employee/PaymentMethod/Actions.d.ts +0 -1
  541. package/dist/components/Employee/PaymentMethod/Actions.js +0 -20
  542. package/dist/components/Employee/PaymentMethod/Actions.js.map +0 -1
  543. package/dist/components/Employee/PaymentMethod/BankAccount.d.ts +0 -13
  544. package/dist/components/Employee/PaymentMethod/BankAccount.js +0 -13
  545. package/dist/components/Employee/PaymentMethod/BankAccount.js.map +0 -1
  546. package/dist/components/Employee/PaymentMethod/BankAccountEdit.d.ts +0 -1
  547. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +0 -58
  548. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +0 -1
  549. package/dist/components/Employee/PaymentMethod/BankAccountsList.d.ts +0 -1
  550. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +0 -51
  551. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +0 -1
  552. package/dist/components/Employee/PaymentMethod/Head.d.ts +0 -1
  553. package/dist/components/Employee/PaymentMethod/Head.js +0 -13
  554. package/dist/components/Employee/PaymentMethod/Head.js.map +0 -1
  555. package/dist/components/Employee/PaymentMethod/PaymentMethod.d.ts +0 -9
  556. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +0 -183
  557. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +0 -1
  558. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.d.ts +0 -10
  559. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +0 -38
  560. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +0 -1
  561. package/dist/components/Employee/PaymentMethod/Split.d.ts +0 -1
  562. package/dist/components/Employee/PaymentMethod/Split.js +0 -175
  563. package/dist/components/Employee/PaymentMethod/Split.js.map +0 -1
  564. package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +0 -54
  565. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +0 -68
  566. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +0 -1
  567. /package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/JobsListPresentation.d.ts +0 -0
  568. /package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/index.d.ts +0 -0
  569. /package/dist/components/Employee/Compensation/{compensationStateMachine.d.ts → onboarding/compensationStateMachine.d.ts} +0 -0
  570. /package/dist/components/Employee/{DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.test.d.ts → Compensation/shared/derivePrimaryFlsaStatus.test.d.ts} +0 -0
  571. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Actions.d.ts +0 -0
  572. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Head.d.ts +0 -0
  573. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/List.d.ts +0 -0
  574. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/useDocumentList.d.ts +0 -0
  575. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilityPresentation.d.ts +0 -0
  576. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilitySchema.d.ts +0 -0
  577. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilitySchema.js +0 -0
  578. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/countries.d.ts +0 -0
  579. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/countries.js +0 -0
  580. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/index.d.ts +0 -0
  581. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.module.scss.js +0 -0
  582. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.module.scss.js.map +0 -0
  583. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/index.d.ts +0 -0
  584. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/stateMachine.d.ts +0 -0
  585. /package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/EmployeeDocumentsPresentation.d.ts +0 -0
  586. /package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/index.d.ts +0 -0
  587. /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/fields.d.ts +0 -0
  588. /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/fields.js +0 -0
  589. /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/index.d.ts +0 -0
  590. /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +0 -0
  591. /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/signEmployeeFormSchema.js +0 -0
  592. /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +0 -0
  593. /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/useSignEmployeeForm.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"compensationSchema.js","sources":["../../../../../../src/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n type OptionalFieldsToRequire,\n} from '@/partner-hook-utils/form/buildFormSchema'\nimport { coerceNaN, coerceToISODate } from '@/partner-hook-utils/form/preprocessors'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus, PAY_PERIODS } from '@/shared/constants'\nimport { yearlyRate } from '@/helpers/payRateCalculator'\n\n// ── Error codes ────────────────────────────────────────────────────────\n\nexport const CompensationErrorCodes = {\n REQUIRED: 'REQUIRED',\n RATE_MINIMUM: 'RATE_MINIMUM',\n RATE_EXEMPT_THRESHOLD: 'RATE_EXEMPT_THRESHOLD',\n PAYMENT_UNIT_OWNER: 'PAYMENT_UNIT_OWNER',\n PAYMENT_UNIT_COMMISSION: 'PAYMENT_UNIT_COMMISSION',\n RATE_COMMISSION_ZERO: 'RATE_COMMISSION_ZERO',\n EFFECTIVE_DATE_BEFORE_HIRE: 'EFFECTIVE_DATE_BEFORE_HIRE',\n} as const\n\nexport type CompensationErrorCode =\n (typeof CompensationErrorCodes)[keyof typeof CompensationErrorCodes]\n\nconst fieldValidators = {\n /**\n * Optional in both modes. Setting title here scopes the change to this\n * compensation's `effectiveDate` — pair it with a future-dated comp to\n * schedule a promotion title alongside a rate change. Use\n * `useJobForm.Fields.Title` instead when creating a job (title is required\n * by the API on job creation) or when renaming the active role\n * immediately, and avoid rendering both fields on the same screen.\n */\n title: z.string(),\n // `flsaStatus` is `.optional()` so the field can render an empty placeholder\n // until the user (or partner default) picks one. Requiredness is still\n // enforced via `requiredFieldsConfig` on submit in `create` mode.\n flsaStatus: z\n .enum([\n FlsaStatus.EXEMPT,\n FlsaStatus.SALARIED_NONEXEMPT,\n FlsaStatus.NONEXEMPT,\n FlsaStatus.OWNER,\n FlsaStatus.COMMISSION_ONLY_EXEMPT,\n FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n ])\n .optional(),\n paymentUnit: z.enum([\n PAY_PERIODS.HOUR,\n PAY_PERIODS.WEEK,\n PAY_PERIODS.MONTH,\n PAY_PERIODS.YEAR,\n PAY_PERIODS.PAYCHECK,\n ]),\n rate: z.preprocess(coerceNaN(0), z.number()),\n /**\n * The effective date a new compensation should take effect on.\n *\n * - **create mode (`compensationId` absent)**: required; partners typically default\n * to the parent job's `hireDate` (onboarding stub-fill) or a future date\n * (rate change). Must be on or after `hireDate`. Server-side this maps to\n * POST /v1/jobs/:jobId/compensations.\n * - **update mode (`compensationId` present)**: optional; if omitted the API\n * keeps the existing effective date. The `hireDate` lower bound is **not**\n * enforced — loaded values may legitimately predate the hire date. Maps to\n * PUT /v1/compensations/:id.\n */\n effectiveDate: z.preprocess(coerceToISODate, z.iso.date().nullable()),\n adjustForMinimumWage: z.boolean(),\n minimumWageId: z.string(),\n}\n\nexport type CompensationFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\n\nconst requiredFieldsConfig = {\n title: 'never',\n flsaStatus: 'create',\n paymentUnit: 'create',\n rate: 'create',\n effectiveDate: 'create',\n minimumWageId: data => data.adjustForMinimumWage,\n} satisfies RequiredFieldConfig<typeof fieldValidators>\n\nfunction validateFlsaRules(data: CompensationFormData, ctx: z.RefinementCtx) {\n const { flsaStatus, paymentUnit, rate } = data\n\n if (\n flsaStatus === FlsaStatus.EXEMPT ||\n flsaStatus === FlsaStatus.SALARIED_NONEXEMPT ||\n flsaStatus === FlsaStatus.NONEXEMPT\n ) {\n // Surface the EXEMPT salary-threshold issue *before* the generic minimum,\n // so a partner setting rate=0 with EXEMPT sees the more actionable\n // \"must meet salary threshold\" message rather than the generic\n // \"amount must be at least $1.00\".\n if (\n flsaStatus === FlsaStatus.EXEMPT &&\n yearlyRate(rate, paymentUnit) < FLSA_OVERTIME_SALARY_LIMIT\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_EXEMPT_THRESHOLD,\n })\n } else if (rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_MINIMUM,\n })\n }\n } else if (flsaStatus === FlsaStatus.OWNER) {\n if (paymentUnit !== PAY_PERIODS.PAYCHECK) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: CompensationErrorCodes.PAYMENT_UNIT_OWNER,\n })\n }\n if (rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_MINIMUM,\n })\n }\n } else if (\n flsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT ||\n flsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT\n ) {\n if (paymentUnit !== PAY_PERIODS.YEAR) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: CompensationErrorCodes.PAYMENT_UNIT_COMMISSION,\n })\n }\n if (rate !== 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_COMMISSION_ZERO,\n })\n }\n }\n}\n\nexport type CompensationOptionalFieldsToRequire = OptionalFieldsToRequire<\n typeof requiredFieldsConfig\n>\nexport type CompensationFormOutputs = CompensationFormData\n\nexport interface CompensationSchemaOptions {\n mode?: 'create' | 'update'\n optionalFieldsToRequire?: CompensationOptionalFieldsToRequire\n /**\n * Lower bound for `effectiveDate` (typically the parent job's `hireDate`).\n * Only enforced in `create` mode — on `update` the loaded effective date\n * may legitimately predate the hire date and is left as-is. Surfaces an\n * `EFFECTIVE_DATE_BEFORE_HIRE` issue when violated.\n */\n hireDate?: string | null\n}\n\nexport function createCompensationSchema(options: CompensationSchemaOptions = {}) {\n const { mode = 'create', optionalFieldsToRequire, hireDate } = options\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: CompensationErrorCodes.REQUIRED,\n mode,\n optionalFieldsToRequire,\n superRefine: (data, ctx) => {\n validateFlsaRules(data, ctx)\n // Only enforce the hire-date lower bound when picking a brand-new\n // effective date (create mode). On update, the loaded effectiveDate\n // can legitimately predate the parent job's hireDate (e.g. carried\n // over from a stub or out-of-order data) and the API accepts the\n // unchanged value or omitting it entirely. Blocking the submit here\n // would trap partners whose flow doesn't render Fields.EffectiveDate.\n if (mode === 'create' && hireDate && data.effectiveDate && data.effectiveDate < hireDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['effectiveDate'],\n message: CompensationErrorCodes.EFFECTIVE_DATE_BEFORE_HIRE,\n })\n }\n },\n })\n}\n"],"names":["CompensationErrorCodes","fieldValidators","z","FlsaStatus","PAY_PERIODS","coerceNaN","coerceToISODate","requiredFieldsConfig","data","validateFlsaRules","ctx","flsaStatus","paymentUnit","rate","yearlyRate","FLSA_OVERTIME_SALARY_LIMIT","createCompensationSchema","options","mode","optionalFieldsToRequire","hireDate","buildFormSchema"],"mappings":"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"}
1
+ {"version":3,"file":"compensationSchema.js","sources":["../../../../../../src/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n type OptionalFieldsToRequire,\n} from '@/partner-hook-utils/form/buildFormSchema'\nimport { coerceNaN, coerceToISODate } from '@/partner-hook-utils/form/preprocessors'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus, PAY_PERIODS } from '@/shared/constants'\nimport { yearlyRate } from '@/helpers/payRateCalculator'\n\n// ── Error codes ────────────────────────────────────────────────────────\n\nexport const CompensationErrorCodes = {\n REQUIRED: 'REQUIRED',\n RATE_MINIMUM: 'RATE_MINIMUM',\n RATE_EXEMPT_THRESHOLD: 'RATE_EXEMPT_THRESHOLD',\n PAYMENT_UNIT_OWNER: 'PAYMENT_UNIT_OWNER',\n PAYMENT_UNIT_COMMISSION: 'PAYMENT_UNIT_COMMISSION',\n RATE_COMMISSION_ZERO: 'RATE_COMMISSION_ZERO',\n EFFECTIVE_DATE_BEFORE_HIRE: 'EFFECTIVE_DATE_BEFORE_HIRE',\n} as const\n\nexport type CompensationErrorCode =\n (typeof CompensationErrorCodes)[keyof typeof CompensationErrorCodes]\n\nconst fieldValidators = {\n /**\n * Optional in both modes. Setting title here scopes the change to this\n * compensation's `effectiveDate` — pair it with a future-dated comp to\n * schedule a promotion title alongside a rate change. Use\n * `useJobForm.Fields.Title` instead when creating a job (title is required\n * by the API on job creation) or when renaming the active role\n * immediately, and avoid rendering both fields on the same screen.\n */\n title: z.string(),\n // `flsaStatus` is `.optional()` so the field can render an empty placeholder\n // until the user (or partner default) picks one. Requiredness is still\n // enforced via `requiredFieldsConfig` on submit in `create` mode.\n flsaStatus: z\n .enum([\n FlsaStatus.EXEMPT,\n FlsaStatus.SALARIED_NONEXEMPT,\n FlsaStatus.NONEXEMPT,\n FlsaStatus.OWNER,\n FlsaStatus.COMMISSION_ONLY_EXEMPT,\n FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n ])\n .optional(),\n paymentUnit: z.enum([\n PAY_PERIODS.HOUR,\n PAY_PERIODS.WEEK,\n PAY_PERIODS.MONTH,\n PAY_PERIODS.YEAR,\n PAY_PERIODS.PAYCHECK,\n ]),\n rate: z.preprocess(coerceNaN(0), z.number()),\n /**\n * The effective date a new compensation should take effect on.\n *\n * - **create mode (`compensationId` absent)**: required; partners typically default\n * to the parent job's `hireDate` (onboarding stub-fill) or a future date\n * (rate change). Must be on or after `hireDate`. Server-side this maps to\n * POST /v1/jobs/:jobId/compensations.\n * - **update mode (`compensationId` present)**: optional; if omitted the API\n * keeps the existing effective date. The `hireDate` lower bound is **not**\n * enforced — loaded values may legitimately predate the hire date. Maps to\n * PUT /v1/compensations/:id.\n */\n effectiveDate: z.preprocess(coerceToISODate, z.iso.date().nullable()),\n adjustForMinimumWage: z.boolean(),\n minimumWageId: z.string(),\n}\n\nexport type CompensationFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\n\nconst requiredFieldsConfig = {\n title: 'never',\n flsaStatus: 'create',\n paymentUnit: 'create',\n rate: 'create',\n effectiveDate: 'create',\n minimumWageId: data => data.adjustForMinimumWage,\n} satisfies RequiredFieldConfig<typeof fieldValidators>\n\nfunction validateFlsaRules(data: CompensationFormData, ctx: z.RefinementCtx) {\n const { flsaStatus, paymentUnit, rate } = data\n\n if (\n flsaStatus === FlsaStatus.EXEMPT ||\n flsaStatus === FlsaStatus.SALARIED_NONEXEMPT ||\n flsaStatus === FlsaStatus.NONEXEMPT\n ) {\n // Surface the EXEMPT salary-threshold issue *before* the generic minimum,\n // so a partner setting rate=0 with EXEMPT sees the more actionable\n // \"must meet salary threshold\" message rather than the generic\n // \"amount must be at least $1.00\".\n if (\n flsaStatus === FlsaStatus.EXEMPT &&\n yearlyRate(rate, paymentUnit) < FLSA_OVERTIME_SALARY_LIMIT\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_EXEMPT_THRESHOLD,\n })\n } else if (rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_MINIMUM,\n })\n }\n } else if (flsaStatus === FlsaStatus.OWNER) {\n if (paymentUnit !== PAY_PERIODS.PAYCHECK) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: CompensationErrorCodes.PAYMENT_UNIT_OWNER,\n })\n }\n if (rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_MINIMUM,\n })\n }\n } else if (\n flsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT ||\n flsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT\n ) {\n if (paymentUnit !== PAY_PERIODS.YEAR) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: CompensationErrorCodes.PAYMENT_UNIT_COMMISSION,\n })\n }\n if (rate !== 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_COMMISSION_ZERO,\n })\n }\n }\n}\n\nexport type CompensationOptionalFieldsToRequire = OptionalFieldsToRequire<\n typeof requiredFieldsConfig\n>\nexport type CompensationFormOutputs = CompensationFormData\n\nexport interface CompensationSchemaOptions {\n mode?: 'create' | 'update'\n optionalFieldsToRequire?: CompensationOptionalFieldsToRequire\n /**\n * Lower bound for `effectiveDate` (typically the parent job's `hireDate`).\n * Only enforced in `create` mode — on `update` the loaded effective date\n * may legitimately predate the hire date and is left as-is. Surfaces an\n * `EFFECTIVE_DATE_BEFORE_HIRE` issue when violated.\n */\n hireDate?: string | null\n /**\n * When `false`, drops `effectiveDate` from the validated shape — the field\n * becomes hook-managed (e.g. seeded from the parent job's `hireDate` during\n * onboarding). Partners may still supply the value at submit time via\n * `CompensationSubmitOptions.effectiveDate`. Defaults to `true`.\n */\n withEffectiveDateField?: boolean\n}\n\nexport function createCompensationSchema(options: CompensationSchemaOptions = {}) {\n const {\n mode = 'create',\n optionalFieldsToRequire,\n hireDate,\n withEffectiveDateField = true,\n } = options\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: CompensationErrorCodes.REQUIRED,\n mode,\n optionalFieldsToRequire,\n excludeFields: withEffectiveDateField ? [] : ['effectiveDate'],\n superRefine: (data, ctx) => {\n validateFlsaRules(data, ctx)\n // Only enforce the hire-date lower bound when picking a brand-new\n // effective date (create mode). On update, the loaded effectiveDate\n // can legitimately predate the parent job's hireDate (e.g. carried\n // over from a stub or out-of-order data) and the API accepts the\n // unchanged value or omitting it entirely. Blocking the submit here\n // would trap partners whose flow doesn't render Fields.EffectiveDate.\n // When `withEffectiveDateField` is false the field is excluded from\n // the shape and `data.effectiveDate` is undefined — this check\n // naturally short-circuits.\n if (mode === 'create' && hireDate && data.effectiveDate && data.effectiveDate < hireDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['effectiveDate'],\n message: CompensationErrorCodes.EFFECTIVE_DATE_BEFORE_HIRE,\n })\n }\n },\n })\n}\n"],"names":["CompensationErrorCodes","fieldValidators","z","FlsaStatus","PAY_PERIODS","coerceNaN","coerceToISODate","requiredFieldsConfig","data","validateFlsaRules","ctx","flsaStatus","paymentUnit","rate","yearlyRate","FLSA_OVERTIME_SALARY_LIMIT","createCompensationSchema","options","mode","optionalFieldsToRequire","hireDate","withEffectiveDateField","buildFormSchema"],"mappings":"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"}
@@ -1,7 +1,5 @@
1
1
  import "./types/i18next.d.ts"
2
2
  export { useCompensationForm } from './useCompensationForm';
3
- export { useCurrentCompensationForm } from './useCurrentCompensationForm';
4
3
  export type { CompensationSubmitOptions, UseCompensationFormProps, UseCompensationFormResult, UseCompensationFormReady, CompensationFieldsMetadata, CompensationFormFields, } from './useCompensationForm';
5
- export type { UseCurrentCompensationFormProps } from './useCurrentCompensationForm';
6
4
  export { createCompensationSchema, CompensationErrorCodes, type CompensationErrorCode, type CompensationOptionalFieldsToRequire, type CompensationFormData, type CompensationFormOutputs, type CompensationSchemaOptions, } from './compensationSchema';
7
5
  export type { RequiredValidation, RateValidation, EffectiveDateValidation, TitleFieldProps, EffectiveDateFieldProps, FlsaStatusFieldProps, RateFieldProps, PaymentUnitFieldProps, AdjustForMinimumWageFieldProps, MinimumWageIdFieldProps, } from './fields';
@@ -17,10 +17,18 @@ export interface CompensationSubmitOptions {
17
17
  * version from its cached `currentCompensation`.
18
18
  */
19
19
  compensationVersion?: string;
20
+ /**
21
+ * Supply `effectiveDate` at submit time. When `withEffectiveDateField`
22
+ * is `true`, this overrides the form's value. When `withEffectiveDateField`
23
+ * is `false`, this is the only way to put `effective_date` on the wire —
24
+ * the form value is not read in that mode (matching the options-only
25
+ * convention of `useWorkAddressForm` / `useHomeAddressForm` / `useJobForm`).
26
+ */
27
+ effectiveDate?: string;
20
28
  }
21
29
  export interface UseCompensationFormProps {
22
30
  employeeId?: string;
23
- /** When updating, the parent job's UUID. Used to scope minimum wages and to derive `status.willDeleteSecondaryJobs`. */
31
+ /** The parent job's UUID. Required in create mode (scopes `POST /v1/jobs/:jobId/compensations`). Optional in update mode — the parent job is derived from the loaded compensation. */
24
32
  jobId?: string;
25
33
  /** Present → update mode (PUT /v1/compensations/:id). Omitted → create mode (POST /v1/jobs/:jobId/compensations). */
26
34
  compensationId?: string;
@@ -28,6 +36,19 @@ export interface UseCompensationFormProps {
28
36
  defaultValues?: Partial<CompensationFormData>;
29
37
  validationMode?: UseFormProps['mode'];
30
38
  shouldFocusError?: boolean;
39
+ /**
40
+ * When `false`, hides `Fields.EffectiveDate` (becomes `undefined`) and
41
+ * removes `effectiveDate` from schema validation. In this mode the hook
42
+ * does not read any form value at submit time — `effective_date` is
43
+ * omitted from the request body unless explicitly supplied via
44
+ * `CompensationSubmitOptions.effectiveDate`. This matches the
45
+ * options-only convention of `useWorkAddressForm` /
46
+ * `useHomeAddressForm` / `useJobForm`, and means the
47
+ * `willDeleteSecondaryJobs` carve-out's form-state side effects do not
48
+ * leak onto the wire (there is no field to render them in anyway).
49
+ * Defaults to `true`.
50
+ */
51
+ withEffectiveDateField?: boolean;
31
52
  }
32
53
  export interface CompensationFormFields {
33
54
  Title: typeof TitleField;
@@ -42,7 +63,7 @@ export interface UseCompensationFormReady extends BaseFormHookReady<FieldsMetada
42
63
  data: {
43
64
  /** The compensation row loaded for update; `null` in create mode. */
44
65
  compensation: Compensation | null;
45
- /** The parent job (when `jobId` resolves), used for derived helpers. */
66
+ /** The parent job. In update mode it's derived from the loaded compensation; in create mode it's looked up by `jobId`. `null` if neither resolves. */
46
67
  currentJob: Job | null;
47
68
  minimumWages: MinimumWage[];
48
69
  /** Lower bound for `effectiveDate` (typically the parent job's hire date). */
@@ -80,6 +101,6 @@ export interface UseCompensationFormReady extends BaseFormHookReady<FieldsMetada
80
101
  onSubmit: (options?: CompensationSubmitOptions) => Promise<HookSubmitResult<Compensation> | undefined>;
81
102
  };
82
103
  }
83
- export declare function useCompensationForm({ employeeId, jobId, compensationId, optionalFieldsToRequire, defaultValues: partnerDefaults, validationMode, shouldFocusError, }: UseCompensationFormProps): HookLoadingResult | UseCompensationFormReady;
104
+ export declare function useCompensationForm({ employeeId, jobId, compensationId, optionalFieldsToRequire, defaultValues: partnerDefaults, validationMode, shouldFocusError, withEffectiveDateField, }: UseCompensationFormProps): HookLoadingResult | UseCompensationFormReady;
84
105
  export type UseCompensationFormResult = HookLoadingResult | UseCompensationFormReady;
85
106
  export type CompensationFieldsMetadata = UseCompensationFormReady['form']['fieldsMetadata'];
@@ -1,197 +1,209 @@
1
- import { useMemo as l, useEffect as X, useRef as se } from "react";
2
- import { useForm as ye, useWatch as ie } from "react-hook-form";
3
- import { zodResolver as Ce } from "@hookform/resolvers/zod";
4
- import { useJobsAndCompensationsGetJobs as Pe } from "@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs";
5
- import { useJobsAndCompensationsCreateCompensationMutation as De } from "@gusto/embedded-api/react-query/jobsAndCompensationsCreateCompensation";
6
- import { useJobsAndCompensationsUpdateCompensationMutation as Ie } from "@gusto/embedded-api/react-query/jobsAndCompensationsUpdateCompensation";
7
- import { useLocationsGetMinimumWages as Ue } from "@gusto/embedded-api/react-query/locationsGetMinimumWages";
8
- import { useEmployeeAddressesGetWorkAddresses as Ae } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
1
+ import { useRef as X, useMemo as oe, useEffect as V } from "react";
2
+ import { useForm as De, useWatch as se } from "react-hook-form";
3
+ import { zodResolver as Ae } from "@hookform/resolvers/zod";
4
+ import { useJobsAndCompensationsGetJobs as Ie } from "@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs";
5
+ import { useJobsAndCompensationsCreateCompensationMutation as Ue } from "@gusto/embedded-api/react-query/jobsAndCompensationsCreateCompensation";
6
+ import { useJobsAndCompensationsUpdateCompensationMutation as Re } from "@gusto/embedded-api/react-query/jobsAndCompensationsUpdateCompensation";
7
+ import { useLocationsGetMinimumWages as Te } from "@gusto/embedded-api/react-query/locationsGetMinimumWages";
8
+ import { useEmployeeAddressesGetWorkAddresses as je } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
9
9
  import { useEmployeesGet as we } from "@gusto/embedded-api/react-query/employeesGet";
10
- import { createCompensationSchema as Te } from "./compensationSchema.js";
11
- import { EffectiveDateField as Re, MinimumWageIdField as je, AdjustForMinimumWageField as Le, PaymentUnitField as _e, RateField as Xe, FlsaStatusField as Ve, TitleField as Ye } from "./fields.js";
12
- import { withOptions as V } from "../../../../../partner-hook-utils/form/withOptions.js";
13
- import { createGetFormSubmissionValues as ke } from "../../../../../partner-hook-utils/form/getFormSubmissionValues.js";
14
- import { useDeriveFieldsMetadata as qe } from "../../../../../partner-hook-utils/form/useDeriveFieldsMetadata.js";
15
- import { useHookFormInternals as Je } from "../../../../../partner-hook-utils/form/useHookFormInternals.js";
16
- import { composeErrorHandler as He } from "../../../../../partner-hook-utils/composeErrorHandler.js";
17
- import { PAY_PERIODS as f, FlsaStatus as t, TIP_CREDITS_UNSUPPORTED_STATES as Be } from "../../../../../shared/constants.js";
18
- import { useBaseSubmit as Ge } from "../../../../Base/useBaseSubmit.js";
19
- import { SDKInternalError as g } from "../../../../../types/sdkError.js";
20
- function Ke(s, p) {
21
- return !s || !p ? null : s.compensations?.find((S) => S.uuid === p) ?? null;
10
+ import { createCompensationSchema as Le } from "./compensationSchema.js";
11
+ import { EffectiveDateField as _e, MinimumWageIdField as Xe, AdjustForMinimumWageField as Ve, PaymentUnitField as Je, RateField as Ye, FlsaStatusField as ke, TitleField as qe } from "./fields.js";
12
+ import { withOptions as J } from "../../../../../partner-hook-utils/form/withOptions.js";
13
+ import { createGetFormSubmissionValues as He } from "../../../../../partner-hook-utils/form/getFormSubmissionValues.js";
14
+ import { useDeriveFieldsMetadata as Be } from "../../../../../partner-hook-utils/form/useDeriveFieldsMetadata.js";
15
+ import { useHookFormInternals as Ge } from "../../../../../partner-hook-utils/form/useHookFormInternals.js";
16
+ import { composeErrorHandler as Ke } from "../../../../../partner-hook-utils/composeErrorHandler.js";
17
+ import { PAY_PERIODS as d, FlsaStatus as t, TIP_CREDITS_UNSUPPORTED_STATES as Qe } from "../../../../../shared/constants.js";
18
+ import { useBaseSubmit as $e } from "../../../../Base/useBaseSubmit.js";
19
+ import { SDKInternalError as E } from "../../../../../types/sdkError.js";
20
+ function xe(e, n, s) {
21
+ if (!e) return { compensation: null, job: null };
22
+ if (n) {
23
+ for (const i of e) {
24
+ const a = i.compensations?.find((C) => C.uuid === n);
25
+ if (a) return { compensation: a, job: i };
26
+ }
27
+ return { compensation: null, job: null };
28
+ }
29
+ return s ? { compensation: null, job: e.find((i) => i.uuid === s) ?? null } : { compensation: null, job: null };
30
+ }
31
+ function ze(e) {
32
+ if (!e) return null;
33
+ for (const n of e) {
34
+ if (!n.primary) continue;
35
+ const s = n.compensations?.find((i) => i.uuid === n.currentCompensationUuid);
36
+ if (s?.flsaStatus) return s.flsaStatus;
37
+ }
38
+ return null;
39
+ }
40
+ function Ze(e) {
41
+ if (!e?.compensations) return [];
42
+ const n = re();
43
+ return e.compensations.filter((s) => s.effectiveDate !== void 0 && s.effectiveDate > n);
22
44
  }
23
- const oe = [
45
+ function et(e) {
46
+ return e.length === 0 ? null : e.reduce((n, s) => {
47
+ const i = s.effectiveDate;
48
+ return i && (!n || i < n) ? i : n;
49
+ }, null);
50
+ }
51
+ const ie = [
24
52
  t.EXEMPT,
25
53
  t.SALARIED_NONEXEMPT,
26
54
  t.NONEXEMPT,
27
55
  t.OWNER,
28
56
  t.COMMISSION_ONLY_EXEMPT,
29
57
  t.COMMISSION_ONLY_NONEXEMPT
30
- ], Qe = oe.map((s) => ({ value: s, label: s })), ae = [
31
- f.HOUR,
32
- f.WEEK,
33
- f.MONTH,
34
- f.YEAR,
35
- f.PAYCHECK
36
- ], $e = ae.map((s) => ({ value: s, label: s }));
37
- function ne() {
58
+ ], tt = ie.map((e) => ({ value: e, label: e })), ae = [
59
+ d.HOUR,
60
+ d.WEEK,
61
+ d.MONTH,
62
+ d.YEAR,
63
+ d.PAYCHECK
64
+ ], nt = ae.map((e) => ({ value: e, label: e }));
65
+ function re() {
38
66
  return (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
39
67
  }
40
- function vt({
41
- employeeId: s,
42
- jobId: p,
43
- compensationId: S,
44
- optionalFieldsToRequire: Y,
45
- defaultValues: d,
46
- validationMode: re = "onSubmit",
47
- shouldFocusError: ue = !0
68
+ function ht({
69
+ employeeId: e,
70
+ jobId: n,
71
+ compensationId: s,
72
+ optionalFieldsToRequire: i,
73
+ defaultValues: a,
74
+ validationMode: C = "onSubmit",
75
+ shouldFocusError: ue = !0,
76
+ withEffectiveDateField: O = !0
48
77
  }) {
49
- const P = Pe(
50
- { employeeId: s ?? "" },
51
- { enabled: !!s }
52
- ), D = Ae(
53
- { employeeId: s ?? "" },
54
- { enabled: !!s }
55
- ), I = we({ employeeId: s ?? "" }, { enabled: !!s }), r = P.data?.jobs, k = D.data?.employeeWorkAddressesList?.find((e) => e.active), q = k?.locationUuid, me = I.data?.employee, U = Ue(
56
- { locationUuid: q ?? "" },
57
- { enabled: !!q }
58
- ), F = U.data?.minimumWageList ?? [], n = l(() => r && p ? r.find((e) => e.uuid === p) ?? null : null, [r, p]), o = l(
59
- () => Ke(n, S),
60
- [n, S]
61
- ), A = l(() => !r || !n ? 0 : r.filter((e) => e.uuid !== n.uuid).length, [r, n]), W = l(() => {
62
- if (!r) return null;
63
- for (const e of r) {
64
- if (!e.primary) continue;
65
- const u = e.compensations?.find((c) => c.uuid === e.currentCompensationUuid);
66
- if (u?.flsaStatus) return u.flsaStatus;
67
- }
68
- return null;
69
- }, [r]), w = n?.hireDate ?? null, h = l(() => {
70
- if (!n?.compensations) return [];
71
- const e = ne();
72
- return n.compensations.filter(
73
- (u) => u.effectiveDate !== void 0 && u.effectiveDate > e
74
- );
75
- }, [n]), de = h.length > 0, ce = l(() => h.length === 0 ? null : h.reduce((e, u) => {
76
- const c = u.effectiveDate;
77
- return c && (!e || c < e) ? c : e;
78
- }, null), [h]), E = !S, J = E ? "create" : "update", T = E && W === t.NONEXEMPT, [H, le] = l(
79
- () => Te({ mode: J, optionalFieldsToRequire: Y, hireDate: w }),
80
- [J, Y, w]
81
- ), B = k?.state, y = l(
78
+ const P = Ie(
79
+ { employeeId: e ?? "" },
80
+ { enabled: !!e }
81
+ ), D = je(
82
+ { employeeId: e ?? "" },
83
+ { enabled: !!e }
84
+ ), A = we({ employeeId: e ?? "" }, { enabled: !!e }), l = P.data?.jobs, Y = D.data?.employeeWorkAddressesList?.find((o) => o.active), k = Y?.locationUuid, me = A.data?.employee, I = Te(
85
+ { locationUuid: k ?? "" },
86
+ { enabled: !!k }
87
+ ), y = I.data?.minimumWageList ?? [], { compensation: r, job: p } = xe(
88
+ l,
89
+ s,
90
+ n
91
+ ), ce = l && p ? l.filter((o) => o.uuid !== p.uuid).length : 0, U = X(null);
92
+ U.current === null && l !== void 0 && (U.current = l.some((o) => o.primary));
93
+ const W = U.current === !0 ? ze(l) : null, R = p?.hireDate ?? null, q = Ze(p), de = q.length > 0, le = et(q), F = !s, T = F ? "create" : "update", j = F && W === t.NONEXEMPT, [H, fe] = oe(
94
+ () => Le({
95
+ mode: T,
96
+ optionalFieldsToRequire: i,
97
+ hireDate: R,
98
+ withEffectiveDateField: O
99
+ }),
100
+ [T, i, R, O]
101
+ ), B = Y?.state, N = oe(
82
102
  () => ({
83
- title: o?.title ?? d?.title ?? "",
103
+ title: r?.title ?? a?.title ?? "",
84
104
  // When adding a secondary, the FLSA must match the primary's — force it
85
105
  // here (overriding any partner default) so the form submits the right
86
106
  // value even though `Fields.FlsaStatus` is hidden.
87
- flsaStatus: T ? W : o?.flsaStatus ?? d?.flsaStatus ?? W ?? void 0,
88
- rate: Number(o?.rate ?? d?.rate ?? 0),
89
- adjustForMinimumWage: o?.adjustForMinimumWage ?? d?.adjustForMinimumWage ?? !1,
90
- minimumWageId: o?.minimumWages?.[0]?.uuid ?? d?.minimumWageId ?? "",
91
- paymentUnit: o?.paymentUnit ?? d?.paymentUnit ?? f.HOUR,
92
- effectiveDate: o?.effectiveDate ?? d?.effectiveDate ?? null
107
+ flsaStatus: j ? W : r?.flsaStatus ?? a?.flsaStatus ?? W ?? void 0,
108
+ rate: Number(r?.rate ?? a?.rate ?? 0),
109
+ adjustForMinimumWage: r?.adjustForMinimumWage ?? a?.adjustForMinimumWage ?? !1,
110
+ minimumWageId: r?.minimumWages?.[0]?.uuid ?? a?.minimumWageId ?? "",
111
+ paymentUnit: r?.paymentUnit ?? a?.paymentUnit ?? d.HOUR,
112
+ effectiveDate: r?.effectiveDate ?? a?.effectiveDate ?? null
93
113
  }),
94
- [o, d, W, T]
95
- ), v = ye({
96
- resolver: Ce(H),
97
- mode: re,
114
+ [r, a, W, j]
115
+ ), M = De({
116
+ resolver: Ae(H),
117
+ mode: C,
98
118
  shouldFocusError: ue,
99
- defaultValues: y,
100
- values: y,
119
+ defaultValues: N,
120
+ values: N,
101
121
  resetOptions: { keepDirtyValues: !0 }
102
- }), { control: G, getValues: O, setValue: a } = v, i = ie({ control: G, name: "flsaStatus" }), fe = ie({
122
+ }), { control: G, getValues: S, setValue: u } = M, m = se({ control: G, name: "flsaStatus" }), pe = se({
103
123
  control: G,
104
124
  name: "adjustForMinimumWage"
105
125
  });
106
- X(() => {
107
- i === t.OWNER ? a("paymentUnit", f.PAYCHECK) : i === t.COMMISSION_ONLY_NONEXEMPT || i === t.COMMISSION_ONLY_EXEMPT ? (a("paymentUnit", f.YEAR), a("rate", 0)) : a("paymentUnit", y.paymentUnit);
108
- }, [i, a, y.paymentUnit]);
109
- const R = o?.flsaStatus, C = se(!1), j = se(null);
110
- X(() => {
111
- const e = !E && R === t.NONEXEMPT && i !== void 0 && i !== t.NONEXEMPT && A > 0;
112
- e && !C.current ? (j.current = O("effectiveDate") ?? null, a("effectiveDate", ne(), { shouldDirty: !0, shouldValidate: !1 }), C.current = !0) : !e && C.current && (a("effectiveDate", j.current ?? null, {
126
+ V(() => {
127
+ m === t.OWNER ? u("paymentUnit", d.PAYCHECK) : m === t.COMMISSION_ONLY_NONEXEMPT || m === t.COMMISSION_ONLY_EXEMPT ? (u("paymentUnit", d.YEAR), u("rate", 0)) : u("paymentUnit", N.paymentUnit);
128
+ }, [m, u, N.paymentUnit]);
129
+ const Ee = r?.flsaStatus, v = !F && Ee === t.NONEXEMPT && m !== void 0 && m !== t.NONEXEMPT && ce > 0, h = X(!1), w = X(null);
130
+ V(() => {
131
+ v && !h.current ? (w.current = S("effectiveDate") ?? null, u("effectiveDate", re(), { shouldDirty: !0, shouldValidate: !1 }), h.current = !0) : !v && h.current && (u("effectiveDate", w.current ?? null, {
113
132
  shouldDirty: !0,
114
133
  shouldValidate: !1
115
- }), j.current = null, C.current = !1);
116
- }, [
117
- E,
118
- R,
119
- i,
120
- A,
121
- O,
122
- a
123
- ]);
124
- const K = Ie(), Q = De(), pe = K.isPending || Q.isPending, {
125
- baseSubmitHandler: Ee,
126
- error: Me,
127
- setError: Se
128
- } = Ge("CompensationForm"), $ = He(s ? [P, D, I, U] : [], { submitError: Me, setSubmitError: Se }), x = i === t.COMMISSION_ONLY_NONEXEMPT || i === t.COMMISSION_ONLY_EXEMPT, ge = i === t.OWNER, ve = !T && (i !== t.NONEXEMPT || n?.primary === !0 || E), N = i === t.NONEXEMPT && F.length > 0 && B !== void 0 && !Be.includes(B);
129
- X(() => {
130
- N || (O("adjustForMinimumWage") && a("adjustForMinimumWage", !1, { shouldDirty: !0, shouldValidate: !1 }), O("minimumWageId") && a("minimumWageId", "", { shouldDirty: !0, shouldValidate: !1 }));
131
- }, [N, O, a]);
132
- const Oe = F.map((e) => ({
133
- value: e.uuid,
134
- label: `${e.wage} - ${e.authority}: ${e.notes ?? ""}`
135
- })), z = !E && R === t.NONEXEMPT && i !== void 0 && i !== t.NONEXEMPT && A > 0, M = qe(le, v.control), Ne = {
136
- title: M.title,
137
- effectiveDate: { ...M.effectiveDate, isDisabled: z },
138
- flsaStatus: V(
139
- M.flsaStatus,
140
- Qe,
141
- oe
134
+ }), w.current = null, h.current = !1);
135
+ }, [v, S, u]);
136
+ const K = Re(), Q = Ue(), Me = K.isPending || Q.isPending, {
137
+ baseSubmitHandler: Se,
138
+ error: ve,
139
+ setError: ge
140
+ } = $e("CompensationForm"), $ = Ke(e ? [P, D, A, I] : [], { submitError: ve, setSubmitError: ge }), x = m === t.COMMISSION_ONLY_NONEXEMPT || m === t.COMMISSION_ONLY_EXEMPT, be = m === t.OWNER, Oe = !j && (m !== t.NONEXEMPT || p?.primary === !0 || F), g = m === t.NONEXEMPT && y.length > 0 && B !== void 0 && !Qe.includes(B);
141
+ V(() => {
142
+ g || (S("adjustForMinimumWage") && u("adjustForMinimumWage", !1, { shouldDirty: !0, shouldValidate: !1 }), S("minimumWageId") && u("minimumWageId", "", { shouldDirty: !0, shouldValidate: !1 }));
143
+ }, [g, S, u]);
144
+ const ye = y.map((o) => ({
145
+ value: o.uuid,
146
+ label: `${o.wage} - ${o.authority}: ${o.notes ?? ""}`
147
+ })), f = Be(fe, M.control), We = {
148
+ title: f.title,
149
+ effectiveDate: { ...f.effectiveDate, isDisabled: v },
150
+ flsaStatus: J(
151
+ f.flsaStatus,
152
+ tt,
153
+ ie
142
154
  ),
143
- rate: { ...M.rate, isDisabled: x },
144
- paymentUnit: V(
145
- { ...M.paymentUnit, isDisabled: ge || x },
146
- $e,
155
+ rate: { ...f.rate, isDisabled: x },
156
+ paymentUnit: J(
157
+ { ...f.paymentUnit, isDisabled: be || x },
158
+ nt,
147
159
  ae
148
160
  ),
149
161
  adjustForMinimumWage: {
150
- ...M.adjustForMinimumWage,
151
- isDisabled: !N
162
+ ...f.adjustForMinimumWage,
163
+ isDisabled: !g
152
164
  },
153
- minimumWageId: V(
154
- M.minimumWageId,
155
- Oe,
156
- F
165
+ minimumWageId: J(
166
+ f.minimumWageId,
167
+ ye,
168
+ y
157
169
  )
158
- }, be = async (e) => {
159
- let u;
160
- return await new Promise((c) => {
161
- v.handleSubmit(
162
- async (he) => {
163
- await Ee(he, async (m) => {
164
- const Z = e?.jobId ?? p, L = e?.compensationId ?? S, ee = L ? "update" : "create", te = {
165
- rate: String(m.rate),
166
- paymentUnit: m.paymentUnit,
167
- flsaStatus: m.flsaStatus,
168
- effectiveDate: m.effectiveDate ?? void 0,
169
- title: m.title || void 0,
170
- adjustForMinimumWage: m.adjustForMinimumWage,
171
- minimumWages: m.adjustForMinimumWage ? [{ uuid: m.minimumWageId }] : []
170
+ }, Fe = async (o) => {
171
+ let z;
172
+ return await new Promise((Z) => {
173
+ M.handleSubmit(
174
+ async (Ce) => {
175
+ await Se(Ce, async (c) => {
176
+ const ee = o?.jobId ?? n, L = o?.compensationId ?? s, te = L ? "update" : "create", Pe = O ? o?.effectiveDate ?? c.effectiveDate ?? void 0 : o?.effectiveDate ?? void 0, ne = {
177
+ rate: String(c.rate),
178
+ paymentUnit: c.paymentUnit,
179
+ flsaStatus: c.flsaStatus,
180
+ effectiveDate: Pe,
181
+ title: c.title || void 0,
182
+ adjustForMinimumWage: c.adjustForMinimumWage,
183
+ minimumWages: c.adjustForMinimumWage ? [{ uuid: c.minimumWageId }] : []
172
184
  };
173
185
  let b;
174
- if (ee === "create") {
175
- if (!Z)
176
- throw new g(
186
+ if (te === "create") {
187
+ if (!ee)
188
+ throw new E(
177
189
  "jobId is required to create a compensation. Pass it as a hook prop or via submit options."
178
190
  );
179
- if (!m.flsaStatus)
180
- throw new g("flsaStatus is required to create a compensation.");
191
+ if (!c.flsaStatus)
192
+ throw new E("flsaStatus is required to create a compensation.");
181
193
  if (b = (await Q.mutateAsync({
182
194
  request: {
183
- jobId: Z,
184
- compensationsRequestBody: { ...te, flsaStatus: m.flsaStatus }
195
+ jobId: ee,
196
+ compensationsRequestBody: { ...ne, flsaStatus: c.flsaStatus }
185
197
  }
186
- })).compensation, !b) throw new g("Compensation creation failed");
198
+ })).compensation, !b) throw new E("Compensation creation failed");
187
199
  } else {
188
200
  if (!L)
189
- throw new g(
201
+ throw new E(
190
202
  "compensationId is required to update a compensation. Pass it as a hook prop or via submit options."
191
203
  );
192
- const _ = e?.compensationVersion ?? o?.version;
204
+ const _ = o?.compensationVersion ?? r?.version;
193
205
  if (!_)
194
- throw new g(
206
+ throw new E(
195
207
  "compensation version is required to update a compensation. Pass it via submit options when threading post-create, or ensure the compensation is loaded."
196
208
  );
197
209
  if (b = (await K.mutateAsync({
@@ -199,54 +211,54 @@ function vt({
199
211
  compensationId: L,
200
212
  compensationsUpdateRequestBody: {
201
213
  version: _,
202
- ...te
214
+ ...ne
203
215
  }
204
216
  }
205
- })).compensation, !b) throw new g("Compensation update failed");
217
+ })).compensation, !b) throw new E("Compensation update failed");
206
218
  }
207
- u = { mode: ee, data: b };
208
- }), c();
219
+ z = { mode: te, data: b };
220
+ }), Z();
209
221
  },
210
222
  () => {
211
- c();
223
+ Z();
212
224
  }
213
225
  )();
214
- }), u;
215
- }, Fe = s ? P.isLoading || D.isLoading || I.isLoading || U.isLoading : !1, We = Je(v);
216
- return Fe || s && (!r || !me) ? { isLoading: !0, errorHandling: $ } : {
226
+ }), z;
227
+ }, Ne = e ? P.isLoading || D.isLoading || A.isLoading || I.isLoading : !1, he = Ge(M);
228
+ return Ne || e && (!l || !me) ? { isLoading: !0, errorHandling: $ } : {
217
229
  isLoading: !1,
218
230
  data: {
219
- compensation: o,
220
- currentJob: n,
221
- minimumWages: F,
222
- minimumEffectiveDate: w,
223
- maximumEffectiveDate: ce,
231
+ compensation: r,
232
+ currentJob: p,
233
+ minimumWages: y,
234
+ minimumEffectiveDate: R,
235
+ maximumEffectiveDate: le,
224
236
  hasPendingFutureCompensation: de
225
237
  },
226
238
  status: {
227
- isPending: pe,
228
- mode: E ? "create" : "update",
229
- willDeleteSecondaryJobs: z
239
+ isPending: Me,
240
+ mode: T,
241
+ willDeleteSecondaryJobs: v
230
242
  },
231
- actions: { onSubmit: be },
243
+ actions: { onSubmit: Fe },
232
244
  errorHandling: $,
233
245
  form: {
234
246
  Fields: {
235
- Title: Ye,
236
- FlsaStatus: ve ? Ve : void 0,
237
- Rate: Xe,
238
- PaymentUnit: _e,
239
- AdjustForMinimumWage: N ? Le : void 0,
240
- MinimumWageId: N && fe ? je : void 0,
241
- EffectiveDate: Re
247
+ Title: qe,
248
+ FlsaStatus: Oe ? ke : void 0,
249
+ Rate: Ye,
250
+ PaymentUnit: Je,
251
+ AdjustForMinimumWage: g ? Ve : void 0,
252
+ MinimumWageId: g && pe ? Xe : void 0,
253
+ EffectiveDate: O ? _e : void 0
242
254
  },
243
- fieldsMetadata: Ne,
244
- hookFormInternals: We,
245
- getFormSubmissionValues: ke(v, H)
255
+ fieldsMetadata: We,
256
+ hookFormInternals: he,
257
+ getFormSubmissionValues: He(M, H)
246
258
  }
247
259
  };
248
260
  }
249
261
  export {
250
- vt as useCompensationForm
262
+ ht as useCompensationForm
251
263
  };
252
264
  //# sourceMappingURL=useCompensationForm.js.map