@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gusto/embedded-react-sdk",
3
- "version": "0.44.2",
3
+ "version": "0.45.0",
4
4
  "homepage": "https://github.com/Gusto/embedded-react-sdk",
5
5
  "bugs": {
6
6
  "url": "https://github.com/Gusto/embedded-react-sdk/issues"
@@ -68,7 +68,12 @@
68
68
  "test:e2e:demo": "playwright test --config playwright.demo.config.ts",
69
69
  "test:e2e:ui": "playwright test --ui",
70
70
  "e2e:serve": "vite --config e2e/vite.config.ts",
71
+ "e2e:setup": "npx tsx e2e/scripts/runGlobalSetup.ts",
71
72
  "e2e:refresh-token": "npx tsx e2e/scripts/refreshToken.ts",
73
+ "scenarios:types": "json2ts e2e/scenarios/schema/scenario.schema.json -o e2e/scenarios/schema/scenario.types.ts",
74
+ "scenarios:validate": "node e2e/scenarios/scripts/validate.mjs",
75
+ "e2e:scenarios:prewarm": "npx tsx e2e/scenario/scripts.ts prewarm",
76
+ "test:scenarios": "vitest run --config vitest.scenario.config.ts",
72
77
  "tsc": "tsc --pretty",
73
78
  "storybook": "storybook dev -p 6006",
74
79
  "build-storybook": "storybook build",
@@ -82,16 +87,16 @@
82
87
  "sdk-app:analyze-props": "npx tsx sdk-app/scripts/analyze-component-props.ts"
83
88
  },
84
89
  "devDependencies": {
85
- "@commitlint/cli": "^21.0.0",
86
- "@commitlint/config-conventional": "^21.0.0",
90
+ "@commitlint/cli": "^21.0.1",
91
+ "@commitlint/config-conventional": "^21.0.1",
87
92
  "@eslint/js": "^9.39.2",
88
93
  "@playwright/test": "^1.60.0",
89
94
  "@release-it/conventional-changelog": "^11.0.0",
90
- "@storybook/addon-a11y": "^10.3.6",
91
- "@storybook/addon-docs": "^10.3.6",
92
- "@storybook/addon-onboarding": "^10.3.6",
93
- "@storybook/react-vite": "^10.3.6",
94
- "@storybook/test-runner": "^0.24.3",
95
+ "@storybook/addon-a11y": "^10.4.0",
96
+ "@storybook/addon-docs": "^10.4.0",
97
+ "@storybook/addon-onboarding": "^10.4.0",
98
+ "@storybook/react-vite": "^10.4.0",
99
+ "@storybook/test-runner": "^0.24.4",
95
100
  "@testing-library/jest-dom": "^6.9.1",
96
101
  "@testing-library/react": "^16.3.2",
97
102
  "@testing-library/user-event": "^14.6.1",
@@ -99,10 +104,11 @@
99
104
  "@types/jest-axe": "^3.5.9",
100
105
  "@types/js-yaml": "^4.0.9",
101
106
  "@types/pngjs": "^6.0.5",
102
- "@types/react": "^19.2.14",
107
+ "@types/react": "^19.2.15",
103
108
  "@types/react-dom": "^19.2.3",
104
- "@vitejs/plugin-react-swc": "^4.3.0",
105
- "@vitest/coverage-v8": "^4.1.5",
109
+ "@vitejs/plugin-react-swc": "^4.3.1",
110
+ "@vitest/coverage-v8": "^4.1.7",
111
+ "ajv": "^8.20.0",
106
112
  "axe-core": "^4.11.4",
107
113
  "dotenv": "^17.4.2",
108
114
  "eslint": "^9.39.4",
@@ -111,14 +117,16 @@
111
117
  "eslint-plugin-react": "^7.37.5",
112
118
  "eslint-plugin-react-hooks": "^7.1.1",
113
119
  "eslint-plugin-react-refresh": "^0.4.24",
114
- "eslint-plugin-storybook": "^10.3.6",
120
+ "eslint-plugin-storybook": "^10.4.0",
121
+ "fuse.js": "^7.3.0",
115
122
  "globals": "^17.6.0",
116
123
  "husky": "^9.1.7",
117
124
  "jest-axe": "^9.0.0",
118
125
  "js-yaml": "^4.1.1",
119
126
  "jsdom": "^26.1.0",
120
127
  "jsdom-testing-mocks": "^1.16.0",
121
- "lint-staged": "^17.0.4",
128
+ "json-schema-to-typescript": "^15.0.4",
129
+ "lint-staged": "^17.0.5",
122
130
  "msw": "^2.14.6",
123
131
  "npm-run-all": "^4.1.5",
124
132
  "pixelmatch": "^7.2.0",
@@ -127,14 +135,14 @@
127
135
  "prism-react-renderer": "^2.4.1",
128
136
  "react-dnd": "^16.0.1",
129
137
  "react-dnd-html5-backend": "^16.0.1",
130
- "react-router-dom": "^7.15.0",
138
+ "react-router-dom": "^7.15.1",
131
139
  "release-it": "^20.0.1",
132
140
  "sass-embedded": "^1.99.0",
133
141
  "storybook": "^10.3.4",
134
142
  "stylelint-config-standard": "^40.0.0",
135
143
  "ts-morph": "^28.0.0",
136
- "tsx": "^4.21.0",
137
- "typescript-eslint": "^8.59.3",
144
+ "tsx": "^4.22.3",
145
+ "typescript-eslint": "^8.59.4",
138
146
  "vite": "^6.4.2",
139
147
  "vite-plugin-checker": "^0.13.0",
140
148
  "vite-plugin-circular-dependency": "^0.6.0",
@@ -142,7 +150,7 @@
142
150
  "vite-plugin-externalize-deps": "^0.10.0",
143
151
  "vite-plugin-stylelint": "^6.1.0",
144
152
  "vite-plugin-svgr": "^5.2.0",
145
- "vitest": "^4.1.6"
153
+ "vitest": "^4.1.7"
146
154
  },
147
155
  "peerDependencies": {
148
156
  "@tanstack/react-query": "^5",
@@ -158,13 +166,13 @@
158
166
  "@internationalized/number": "^3.6.6",
159
167
  "classnames": "^2.5.1",
160
168
  "deepmerge": "^4.3.1",
161
- "dompurify": "^3.4.2",
162
- "i18next": "^26.1.0",
169
+ "dompurify": "^3.4.5",
170
+ "i18next": "^26.2.0",
163
171
  "react-aria": "^3.47.0",
164
172
  "react-aria-components": "1.16.0",
165
173
  "react-error-boundary": "^6.1.1",
166
- "react-hook-form": "^7.75.0",
167
- "react-i18next": "^17.0.7",
174
+ "react-hook-form": "^7.76.0",
175
+ "react-i18next": "^17.0.8",
168
176
  "react-robot": "^1.2.1",
169
177
  "robot3": "^1.2.0",
170
178
  "zod": "^4.3.6"
@@ -1,87 +0,0 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { useMemo as c } from "react";
3
- import { createMachine as f } from "robot3";
4
- import { useTranslation as d } from "react-i18next";
5
- import { useJobsAndCompensationsGetJobsSuspense as C } from "@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs";
6
- import { JobsListContextual as b, InitialEditCompensationContextual as J } from "./CompensationFlowComponents.js";
7
- import { compensationStateMachine as E } from "./compensationStateMachine.js";
8
- import { FlsaStatus as w } from "../../../shared/constants.js";
9
- import { useComponentDictionary as I } from "../../../i18n/I18n.js";
10
- import { BaseComponent as S } from "../../Base/Base.js";
11
- import "../../Base/useBase.js";
12
- import { Flow as h } from "../../Flow/Flow.js";
13
- import { useFlow as v } from "../../Flow/useFlow.js";
14
- import { JobsList as x } from "./JobsList/JobsList.js";
15
- import { EditCompensation as F } from "./EditCompensation/EditCompensation.js";
16
- const T = {
17
- initialEditJob: J,
18
- viewJobs: b
19
- };
20
- function g(t) {
21
- if (t.length === 0)
22
- return { initialState: "initialEditJob", currentJobId: null };
23
- const o = t.length === 1 ? t[0] ?? null : null, n = M(o);
24
- return o && n?.flsaStatus !== w.NONEXEMPT ? { initialState: "initialEditJob", currentJobId: o.uuid } : { initialState: "viewJobs", currentJobId: null };
25
- }
26
- function s(t) {
27
- return /* @__PURE__ */ i(S, { ...t, children: /* @__PURE__ */ i(N, { ...t }) });
28
- }
29
- const M = (t) => t?.compensations?.find((o) => o.uuid === t.currentCompensationUuid);
30
- function N({
31
- employeeId: t,
32
- startDate: o,
33
- defaultValues: n,
34
- dictionary: r,
35
- onEvent: e
36
- }) {
37
- I("Employee.Compensation", r);
38
- const { data: u } = C({ employeeId: t }), { initialState: a, currentJobId: m } = g(u.jobs ?? []), l = c(
39
- () => f(
40
- a,
41
- E,
42
- (p) => ({
43
- ...p,
44
- component: T[a],
45
- employeeId: t,
46
- startDate: o,
47
- partnerDefaultValues: n,
48
- currentJobId: m
49
- })
50
- ),
51
- // `defaultValues` is intentionally omitted: it's a partner-supplied prop that may
52
- // arrive as a fresh object reference on every render. It seeds the form once at
53
- // initialization, so re-creating the machine on reference churn would only serve
54
- // to discard in-flight state. Genuine API state changes (different employee, a
55
- // change in the only-job FLSA status) flow through the scalar deps below.
56
- // eslint-disable-next-line react-hooks/exhaustive-deps
57
- [t, o, a, m]
58
- );
59
- return /* @__PURE__ */ i(h, { machine: l, onEvent: e });
60
- }
61
- const q = () => {
62
- const { employeeId: t, onEvent: o, startDate: n, defaultValues: r } = v(), { t: e } = d("common");
63
- if (!t || !n)
64
- throw new Error(
65
- e("errors.missingParamsOrContext", {
66
- component: "Compensation",
67
- param: t ? "startDate" : "employeeId",
68
- provider: "FlowProvider"
69
- })
70
- );
71
- return /* @__PURE__ */ i(
72
- s,
73
- {
74
- employeeId: t,
75
- startDate: n,
76
- onEvent: o,
77
- defaultValues: r?.compensation
78
- }
79
- );
80
- };
81
- s.JobsList = x;
82
- s.EditCompensation = F;
83
- export {
84
- s as Compensation,
85
- q as CompensationContextual
86
- };
87
- //# sourceMappingURL=Compensation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Compensation.js","sources":["../../../../src/components/Employee/Compensation/Compensation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { createMachine } from 'robot3'\nimport { useTranslation } from 'react-i18next'\nimport { useJobsAndCompensationsGetJobsSuspense } from '@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs'\nimport { type Job } from '@gusto/embedded-api/models/components/job'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlowComponents'\nimport {\n InitialEditCompensationContextual,\n JobsListContextual,\n type CompensationFlowContextInterface,\n} from './CompensationFlowComponents'\nimport { compensationStateMachine } from './compensationStateMachine'\nimport { JobsList } from './JobsList'\nimport { EditCompensation } from './EditCompensation'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport type { PAY_PERIODS } from '@/shared/constants'\nimport { FlsaStatus } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Flow } from '@/components/Flow/Flow'\nimport { useFlow } from '@/components/Flow/useFlow'\n\ntype CompensationInitialState = 'initialEditJob' | 'viewJobs'\n\ninterface InitialFlowConfig {\n initialState: CompensationInitialState\n currentJobId: string | null\n}\n\nconst INITIAL_COMPONENT_BY_STATE: Record<\n CompensationInitialState,\n React.ComponentType<CommonComponentInterface>\n> = {\n initialEditJob: InitialEditCompensationContextual,\n viewJobs: JobsListContextual,\n}\n\nfunction deriveInitialFlowConfig(employeeJobs: Job[]): InitialFlowConfig {\n if (employeeJobs.length === 0) {\n return { initialState: 'initialEditJob', currentJobId: null }\n }\n\n const onlyJob = employeeJobs.length === 1 ? (employeeJobs[0] ?? null) : null\n const onlyJobCompensation = findCurrentCompensation(onlyJob)\n\n if (onlyJob && onlyJobCompensation?.flsaStatus !== FlsaStatus.NONEXEMPT) {\n return { initialState: 'initialEditJob', currentJobId: onlyJob.uuid }\n }\n\n return { initialState: 'viewJobs', currentJobId: null }\n}\n\nexport type CompensationDefaultValues = RequireAtLeastOne<{\n rate?: Job['rate']\n title?: Job['title']\n paymentUnit?: (typeof PAY_PERIODS)[keyof typeof PAY_PERIODS]\n flsaStatus?: FlsaStatusType\n}>\n\nexport interface CompensationProps extends BaseComponentInterface<'Employee.Compensation'> {\n employeeId: string\n startDate: string\n defaultValues?: CompensationDefaultValues\n}\n\nexport function Compensation(props: CompensationProps) {\n return (\n <BaseComponent {...props}>\n <CompensationFlow {...props} />\n </BaseComponent>\n )\n}\n\nconst findCurrentCompensation = (job?: Job | null) => {\n return job?.compensations?.find(comp => comp.uuid === job.currentCompensationUuid)\n}\n\nfunction CompensationFlow({\n employeeId,\n startDate,\n defaultValues,\n dictionary,\n onEvent,\n}: CompensationProps) {\n useComponentDictionary('Employee.Compensation', dictionary)\n\n const { data: jobsData } = useJobsAndCompensationsGetJobsSuspense({ employeeId })\n\n const { initialState, currentJobId } = deriveInitialFlowConfig(jobsData.jobs ?? [])\n\n const manageCompensation = useMemo(\n () =>\n createMachine(\n initialState,\n compensationStateMachine,\n (initialContext: CompensationFlowContextInterface) => ({\n ...initialContext,\n component: INITIAL_COMPONENT_BY_STATE[initialState],\n employeeId,\n startDate,\n partnerDefaultValues: defaultValues,\n currentJobId,\n }),\n ),\n // `defaultValues` is intentionally omitted: it's a partner-supplied prop that may\n // arrive as a fresh object reference on every render. It seeds the form once at\n // initialization, so re-creating the machine on reference churn would only serve\n // to discard in-flight state. Genuine API state changes (different employee, a\n // change in the only-job FLSA status) flow through the scalar deps below.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [employeeId, startDate, initialState, currentJobId],\n )\n\n return <Flow machine={manageCompensation} onEvent={onEvent} />\n}\n\nexport const CompensationContextual = () => {\n const { employeeId, onEvent, startDate, defaultValues } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId || !startDate) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Compensation',\n param: !employeeId ? 'employeeId' : 'startDate',\n provider: 'FlowProvider',\n }),\n )\n }\n return (\n <Compensation\n employeeId={employeeId}\n startDate={startDate}\n onEvent={onEvent}\n defaultValues={defaultValues?.compensation}\n />\n )\n}\n\nCompensation.JobsList = JobsList\nCompensation.EditCompensation = EditCompensation\n"],"names":["INITIAL_COMPONENT_BY_STATE","InitialEditCompensationContextual","JobsListContextual","deriveInitialFlowConfig","employeeJobs","onlyJob","onlyJobCompensation","findCurrentCompensation","FlsaStatus","Compensation","props","jsx","BaseComponent","CompensationFlow","job","comp","employeeId","startDate","defaultValues","dictionary","onEvent","useComponentDictionary","jobsData","useJobsAndCompensationsGetJobsSuspense","initialState","currentJobId","manageCompensation","useMemo","createMachine","compensationStateMachine","initialContext","Flow","CompensationContextual","useFlow","t","useTranslation","JobsList","EditCompensation"],"mappings":";;;;;;;;;;;;;;;AAkCA,MAAMA,IAGF;AAAA,EACF,gBAAgBC;AAAA,EAChB,UAAUC;AACZ;AAEA,SAASC,EAAwBC,GAAwC;AACvE,MAAIA,EAAa,WAAW;AAC1B,WAAO,EAAE,cAAc,kBAAkB,cAAc,KAAA;AAGzD,QAAMC,IAAUD,EAAa,WAAW,IAAKA,EAAa,CAAC,KAAK,OAAQ,MAClEE,IAAsBC,EAAwBF,CAAO;AAE3D,SAAIA,KAAWC,GAAqB,eAAeE,EAAW,YACrD,EAAE,cAAc,kBAAkB,cAAcH,EAAQ,KAAA,IAG1D,EAAE,cAAc,YAAY,cAAc,KAAA;AACnD;AAeO,SAASI,EAAaC,GAA0B;AACrD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAkB,GAAGH,GAAO,EAAA,CAC/B;AAEJ;AAEA,MAAMH,IAA0B,CAACO,MACxBA,GAAK,eAAe,KAAK,OAAQC,EAAK,SAASD,EAAI,uBAAuB;AAGnF,SAASD,EAAiB;AAAA,EACxB,YAAAG;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AACF,GAAsB;AACpB,EAAAC,EAAuB,yBAAyBF,CAAU;AAE1D,QAAM,EAAE,MAAMG,EAAA,IAAaC,EAAuC,EAAE,YAAAP,GAAY,GAE1E,EAAE,cAAAQ,GAAc,cAAAC,EAAA,IAAiBtB,EAAwBmB,EAAS,QAAQ,EAAE,GAE5EI,IAAqBC;AAAA,IACzB,MACEC;AAAA,MACEJ;AAAA,MACAK;AAAA,MACA,CAACC,OAAsD;AAAA,QACrD,GAAGA;AAAA,QACH,WAAW9B,EAA2BwB,CAAY;AAAA,QAClD,YAAAR;AAAA,QACA,WAAAC;AAAA,QACA,sBAAsBC;AAAA,QACtB,cAAAO;AAAA,MAAA;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQJ,CAACT,GAAYC,GAAWO,GAAcC,CAAY;AAAA,EAAA;AAGpD,SAAO,gBAAAd,EAACoB,GAAA,EAAK,SAASL,GAAoB,SAAAN,EAAA,CAAkB;AAC9D;AAEO,MAAMY,IAAyB,MAAM;AAC1C,QAAM,EAAE,YAAAhB,GAAY,SAAAI,GAAS,WAAAH,GAAW,eAAAC,EAAA,IAAkBe,EAAA,GACpD,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ;AAErC,MAAI,CAACnB,KAAc,CAACC;AAClB,UAAM,IAAI;AAAA,MACRiB,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAQlB,IAA4B,cAAf;AAAA,QACrB,UAAU;AAAA,MAAA,CACX;AAAA,IAAA;AAGL,SACE,gBAAAL;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,YAAAO;AAAA,MACA,WAAAC;AAAA,MACA,SAAAG;AAAA,MACA,eAAeF,GAAe;AAAA,IAAA;AAAA,EAAA;AAGpC;AAEAT,EAAa,WAAW2B;AACxB3B,EAAa,mBAAmB4B;"}
@@ -1,61 +0,0 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { useTranslation as l } from "react-i18next";
3
- import { useFlow as E } from "../../Flow/useFlow.js";
4
- import { useI18n as p } from "../../../i18n/I18n.js";
5
- import { FlsaStatus as d, componentEvents as s } from "../../../shared/constants.js";
6
- import { ensureRequired as a } from "../../../helpers/ensureRequired.js";
7
- import { JobsList as I } from "./JobsList/JobsList.js";
8
- import { EditCompensation as u } from "./EditCompensation/EditCompensation.js";
9
- function y() {
10
- const { employeeId: o, onEvent: n } = E();
11
- return /* @__PURE__ */ m(I, { employeeId: a(o), onEvent: n });
12
- }
13
- function S() {
14
- const { employeeId: o, startDate: n, currentJobId: r, partnerDefaultValues: i, onEvent: t } = E();
15
- p("Employee.Compensation");
16
- const { t: e } = l("Employee.Compensation");
17
- return /* @__PURE__ */ m(
18
- u,
19
- {
20
- employeeId: a(o),
21
- startDate: a(n),
22
- currentJobId: r,
23
- title: e("title"),
24
- submitCtaLabel: e("submitCta"),
25
- onSaved: (C) => {
26
- C.flsaStatus !== d.NONEXEMPT ? t(s.EMPLOYEE_COMPENSATION_DONE) : t(s.EMPLOYEE_COMPENSATION_RETURN_TO_LIST);
27
- },
28
- partnerDefaultValues: i,
29
- onEvent: t
30
- }
31
- );
32
- }
33
- function M() {
34
- const { employeeId: o, startDate: n, currentJobId: r, partnerDefaultValues: i, onEvent: t } = E();
35
- p("Employee.Compensation");
36
- const { t: e } = l("Employee.Compensation");
37
- return /* @__PURE__ */ m(
38
- u,
39
- {
40
- employeeId: a(o),
41
- startDate: a(n),
42
- currentJobId: r,
43
- title: e(r ? "editTitle" : "addTitle"),
44
- submitCtaLabel: e("saveNewJobCta"),
45
- onSaved: () => {
46
- t(s.EMPLOYEE_COMPENSATION_RETURN_TO_LIST);
47
- },
48
- onCancel: () => {
49
- t(s.EMPLOYEE_COMPENSATION_CANCEL);
50
- },
51
- partnerDefaultValues: i,
52
- onEvent: t
53
- }
54
- );
55
- }
56
- export {
57
- M as EditCompensationContextual,
58
- S as InitialEditCompensationContextual,
59
- y as JobsListContextual
60
- };
61
- //# sourceMappingURL=CompensationFlowComponents.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CompensationFlowComponents.js","sources":["../../../../src/components/Employee/Compensation/CompensationFlowComponents.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Job } from '@gusto/embedded-api/models/components/job'\nimport type { Compensation } from '@gusto/embedded-api/models/components/compensation'\nimport type { CompensationDefaultValues } from './Compensation'\nimport { JobsList } from './JobsList'\nimport { EditCompensation } from './EditCompensation'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport { useI18n } from '@/i18n'\nimport { componentEvents, FlsaStatus } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\nexport type EventPayloads = {\n [componentEvents.EMPLOYEE_JOB_ADD]: undefined\n [componentEvents.EMPLOYEE_JOB_EDIT]: { uuid: string }\n [componentEvents.EMPLOYEE_JOB_CREATED]: Job\n [componentEvents.EMPLOYEE_JOB_UPDATED]: Job\n [componentEvents.EMPLOYEE_JOB_DELETED]: undefined\n [componentEvents.EMPLOYEE_COMPENSATION_UPDATED]: Compensation | undefined\n [componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST]: undefined\n [componentEvents.EMPLOYEE_COMPENSATION_CANCEL]: undefined\n [componentEvents.EMPLOYEE_COMPENSATION_DONE]: undefined\n}\n\nexport interface CompensationFlowContextInterface extends FlowContextInterface {\n employeeId: string\n startDate: string\n currentJobId?: string | null\n partnerDefaultValues?: CompensationDefaultValues\n}\n\nexport function JobsListContextual() {\n const { employeeId, onEvent } = useFlow<CompensationFlowContextInterface>()\n return <JobsList employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function InitialEditCompensationContextual() {\n const { employeeId, startDate, currentJobId, partnerDefaultValues, onEvent } =\n useFlow<CompensationFlowContextInterface>()\n useI18n('Employee.Compensation')\n const { t } = useTranslation('Employee.Compensation')\n\n return (\n <EditCompensation\n employeeId={ensureRequired(employeeId)}\n startDate={ensureRequired(startDate)}\n currentJobId={currentJobId}\n title={t('title')}\n submitCtaLabel={t('submitCta')}\n onSaved={data => {\n if (data.flsaStatus !== FlsaStatus.NONEXEMPT) {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_DONE)\n } else {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST)\n }\n }}\n partnerDefaultValues={partnerDefaultValues}\n onEvent={onEvent}\n />\n )\n}\n\nexport function EditCompensationContextual() {\n const { employeeId, startDate, currentJobId, partnerDefaultValues, onEvent } =\n useFlow<CompensationFlowContextInterface>()\n useI18n('Employee.Compensation')\n const { t } = useTranslation('Employee.Compensation')\n\n return (\n <EditCompensation\n employeeId={ensureRequired(employeeId)}\n startDate={ensureRequired(startDate)}\n currentJobId={currentJobId}\n title={currentJobId ? t('editTitle') : t('addTitle')}\n submitCtaLabel={t('saveNewJobCta')}\n onSaved={() => {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST)\n }}\n onCancel={() => {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_CANCEL)\n }}\n partnerDefaultValues={partnerDefaultValues}\n onEvent={onEvent}\n />\n )\n}\n"],"names":["JobsListContextual","employeeId","onEvent","useFlow","JobsList","ensureRequired","InitialEditCompensationContextual","startDate","currentJobId","partnerDefaultValues","useI18n","t","useTranslation","jsx","EditCompensation","data","FlsaStatus","componentEvents","EditCompensationContextual"],"mappings":";;;;;;;;AA8BO,SAASA,IAAqB;AACnC,QAAM,EAAE,YAAAC,GAAY,SAAAC,EAAA,IAAYC,EAAA;AAChC,2BAAQC,GAAA,EAAS,YAAYC,EAAeJ,CAAU,GAAG,SAAAC,GAAkB;AAC7E;AAEO,SAASI,IAAoC;AAClD,QAAM,EAAE,YAAAL,GAAY,WAAAM,GAAW,cAAAC,GAAc,sBAAAC,GAAsB,SAAAP,EAAA,IACjEC,EAAA;AACF,EAAAO,EAAQ,uBAAuB;AAC/B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB;AAEpD,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAYT,EAAeJ,CAAU;AAAA,MACrC,WAAWI,EAAeE,CAAS;AAAA,MACnC,cAAAC;AAAA,MACA,OAAOG,EAAE,OAAO;AAAA,MAChB,gBAAgBA,EAAE,WAAW;AAAA,MAC7B,SAAS,CAAAI,MAAQ;AACf,QAAIA,EAAK,eAAeC,EAAW,YACjCd,EAAQe,EAAgB,0BAA0B,IAElDf,EAAQe,EAAgB,oCAAoC;AAAA,MAEhE;AAAA,MACA,sBAAAR;AAAA,MACA,SAAAP;AAAA,IAAA;AAAA,EAAA;AAGN;AAEO,SAASgB,IAA6B;AAC3C,QAAM,EAAE,YAAAjB,GAAY,WAAAM,GAAW,cAAAC,GAAc,sBAAAC,GAAsB,SAAAP,EAAA,IACjEC,EAAA;AACF,EAAAO,EAAQ,uBAAuB;AAC/B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB;AAEpD,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAYT,EAAeJ,CAAU;AAAA,MACrC,WAAWI,EAAeE,CAAS;AAAA,MACnC,cAAAC;AAAA,MACA,OAAsBG,EAAfH,IAAiB,cAAiB,UAAN;AAAA,MACnC,gBAAgBG,EAAE,eAAe;AAAA,MACjC,SAAS,MAAM;AACb,QAAAT,EAAQe,EAAgB,oCAAoC;AAAA,MAC9D;AAAA,MACA,UAAU,MAAM;AACd,QAAAf,EAAQe,EAAgB,4BAA4B;AAAA,MACtD;AAAA,MACA,sBAAAR;AAAA,MACA,SAAAP;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,14 +0,0 @@
1
- import { CompensationDefaultValues } from '../Compensation';
2
- import { CompensationOutputs } from '../compensationSchema';
3
- import { BaseComponentInterface, CommonComponentInterface } from '../../../Base';
4
- export interface EditCompensationProps extends CommonComponentInterface<'Employee.Compensation'> {
5
- employeeId: string;
6
- startDate: string;
7
- currentJobId?: string | null;
8
- title: string;
9
- submitCtaLabel: string;
10
- onSaved: (data: CompensationOutputs) => void;
11
- onCancel?: () => void;
12
- partnerDefaultValues?: CompensationDefaultValues;
13
- }
14
- export declare function EditCompensation(props: EditCompensationProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
@@ -1,128 +0,0 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { useMemo as l } from "react";
3
- import { useJobsAndCompensationsCreateJobMutation as N } from "@gusto/embedded-api/react-query/jobsAndCompensationsCreateJob";
4
- import { useJobsAndCompensationsGetJobsSuspense as Y } from "@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs";
5
- import { useJobsAndCompensationsUpdateMutation as H } from "@gusto/embedded-api/react-query/jobsAndCompensationsUpdate";
6
- import { useJobsAndCompensationsUpdateCompensationMutation as I } from "@gusto/embedded-api/react-query/jobsAndCompensationsUpdateCompensation";
7
- import { useEmployeeAddressesGetWorkAddressesSuspense as z } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
8
- import { useEmployeesGetSuspense as K } from "@gusto/embedded-api/react-query/employeesGet";
9
- import { useFederalTaxDetailsGetSuspense as Q } from "@gusto/embedded-api/react-query/federalTaxDetailsGet";
10
- import { useLocationsGetMinimumWagesSuspense as X } from "@gusto/embedded-api/react-query/locationsGetMinimumWages";
11
- import { EditCompensationPresentation as Z } from "./EditCompensationPresentation.js";
12
- import { BaseComponent as $ } from "../../../Base/Base.js";
13
- import { useBase as V } from "../../../Base/useBase.js";
14
- import { useComponentDictionary as ee, useI18n as te } from "../../../../i18n/I18n.js";
15
- import { componentEvents as y } from "../../../../shared/constants.js";
16
- function he(t) {
17
- return ee("Employee.Compensation", t.dictionary), /* @__PURE__ */ p($, { ...t, children: /* @__PURE__ */ p(se, { ...t }) });
18
- }
19
- const oe = (t) => t?.compensations?.find((d) => d.uuid === t.currentCompensationUuid);
20
- function se({
21
- employeeId: t,
22
- startDate: d,
23
- currentJobId: C,
24
- title: P,
25
- submitCtaLabel: U,
26
- onSaved: M,
27
- onCancel: j,
28
- partnerDefaultValues: r,
29
- className: J
30
- }) {
31
- te("Employee.Compensation");
32
- const { onEvent: f, baseSubmitHandler: R } = V(), { data: h } = Y({ employeeId: t }), n = l(() => h.jobs ?? [], [h.jobs]), { data: T } = z({ employeeId: t }), b = T.employeeWorkAddressesList ?? [], E = b.find((o) => o.active) ?? b[0];
33
- if (!E?.locationUuid)
34
- throw new Error("No active work address with a location found for this employee");
35
- const {
36
- data: { minimumWageList: D }
37
- } = X({
38
- locationUuid: E.locationUuid
39
- }), B = D ?? [], {
40
- data: { employee: S }
41
- } = K({ employeeId: t });
42
- if (!S)
43
- throw new Error("Employee not found");
44
- const { data: F } = Q({ companyId: S.companyUuid }), O = F.federalTaxDetails?.taxableAsScorp === !0, e = l(
45
- () => C ? n.find((o) => o.uuid === C) ?? null : null,
46
- [n, C]
47
- ), a = oe(e), g = l(() => n.reduce((o, u) => {
48
- const m = u.compensations?.find(
49
- (c) => c.uuid === u.currentCompensationUuid
50
- );
51
- return !u.primary || !m ? o : m.flsaStatus ?? o;
52
- }, void 0), [n]), k = l(() => ({
53
- jobTitle: e?.title && e.title !== "" ? e.title : r?.title ?? "",
54
- flsaStatus: a?.flsaStatus ?? g ?? r?.flsaStatus,
55
- rate: Number(a?.rate ?? r?.rate ?? 0),
56
- adjustForMinimumWage: a?.adjustForMinimumWage ?? !1,
57
- minimumWageId: a?.minimumWages?.[0]?.uuid ?? "",
58
- paymentUnit: a?.paymentUnit ?? r?.paymentUnit ?? "Hour",
59
- stateWcCovered: e?.stateWcCovered ?? !1,
60
- stateWcClassCode: e?.stateWcClassCode ?? "",
61
- twoPercentShareholder: e?.twoPercentShareholder ?? !1
62
- }), [e, a, g, r]), v = I(), w = N(), A = H(), q = v.isPending || w.isPending || A.isPending, L = e ? n.filter((o) => o.uuid !== e.uuid).length : n.length, _ = async (o) => {
63
- await R(o, async (u) => {
64
- const { jobTitle: m, twoPercentShareholder: c, ...s } = u;
65
- let i;
66
- e ? (i = (await A.mutateAsync({
67
- request: {
68
- jobId: e.uuid,
69
- jobsUpdateRequestBody: {
70
- title: m,
71
- version: e.version,
72
- hireDate: d,
73
- stateWcClassCode: s.stateWcCovered ? s.stateWcClassCode : null,
74
- stateWcCovered: s.stateWcCovered,
75
- twoPercentShareholder: c ?? !1
76
- }
77
- }
78
- })).job, f(y.EMPLOYEE_JOB_UPDATED, i)) : (i = (await w.mutateAsync({
79
- request: {
80
- employeeId: t,
81
- jobsCreateRequestBody: {
82
- title: m,
83
- hireDate: d,
84
- stateWcCovered: s.stateWcCovered,
85
- stateWcClassCode: s.stateWcCovered ? s.stateWcClassCode : null,
86
- twoPercentShareholder: c ?? !1
87
- }
88
- }
89
- })).job, f(y.EMPLOYEE_JOB_CREATED, i));
90
- const { compensation: G } = await v.mutateAsync({
91
- request: {
92
- compensationId: i.currentCompensationUuid,
93
- compensationsUpdateRequestBody: {
94
- // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
95
- version: i.compensations?.find(
96
- (W) => W.uuid === i.currentCompensationUuid
97
- )?.version,
98
- ...s,
99
- rate: String(s.rate),
100
- minimumWages: s.adjustForMinimumWage ? [{ uuid: s.minimumWageId }] : []
101
- }
102
- }
103
- });
104
- f(y.EMPLOYEE_COMPENSATION_UPDATED, G), M(o);
105
- });
106
- }, x = e?.primary === !0 || n.length === 0;
107
- return /* @__PURE__ */ p("section", { className: J, children: /* @__PURE__ */ p(
108
- Z,
109
- {
110
- defaultValues: k,
111
- title: P,
112
- submitCtaLabel: U,
113
- canChangeFlsaClassification: x,
114
- currentCompensationFlsaStatus: a?.flsaStatus ?? void 0,
115
- otherJobsCount: L,
116
- state: E.state,
117
- minimumWages: B,
118
- showTwoPercentStakeholder: O,
119
- isPending: q,
120
- onSave: _,
121
- onCancel: j
122
- }
123
- ) });
124
- }
125
- export {
126
- he as EditCompensation
127
- };
128
- //# sourceMappingURL=EditCompensation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EditCompensation.js","sources":["../../../../../src/components/Employee/Compensation/EditCompensation/EditCompensation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport type { Job } from '@gusto/embedded-api/models/components/job'\nimport { useJobsAndCompensationsCreateJobMutation } from '@gusto/embedded-api/react-query/jobsAndCompensationsCreateJob'\nimport { useJobsAndCompensationsGetJobsSuspense } from '@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs'\nimport { useJobsAndCompensationsUpdateMutation } from '@gusto/embedded-api/react-query/jobsAndCompensationsUpdate'\nimport { useJobsAndCompensationsUpdateCompensationMutation } from '@gusto/embedded-api/react-query/jobsAndCompensationsUpdateCompensation'\nimport { useEmployeeAddressesGetWorkAddressesSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useFederalTaxDetailsGetSuspense } from '@gusto/embedded-api/react-query/federalTaxDetailsGet'\nimport { useLocationsGetMinimumWagesSuspense } from '@gusto/embedded-api/react-query/locationsGetMinimumWages'\nimport type { CompensationDefaultValues } from '../Compensation'\nimport { type CompensationInputs, type CompensationOutputs } from '../compensationSchema'\nimport { EditCompensationPresentation } from './EditCompensationPresentation'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\nexport interface EditCompensationProps extends CommonComponentInterface<'Employee.Compensation'> {\n employeeId: string\n startDate: string\n currentJobId?: string | null\n title: string\n submitCtaLabel: string\n onSaved: (data: CompensationOutputs) => void\n onCancel?: () => void\n partnerDefaultValues?: CompensationDefaultValues\n}\n\nexport function EditCompensation(props: EditCompensationProps & BaseComponentInterface) {\n useComponentDictionary('Employee.Compensation', props.dictionary)\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nconst findCurrentCompensation = (job?: Job | null) => {\n return job?.compensations?.find(comp => comp.uuid === job.currentCompensationUuid)\n}\n\nfunction Root({\n employeeId,\n startDate,\n currentJobId,\n title,\n submitCtaLabel,\n onSaved,\n onCancel,\n partnerDefaultValues,\n className,\n}: EditCompensationProps) {\n useI18n('Employee.Compensation')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data: jobsData } = useJobsAndCompensationsGetJobsSuspense({ employeeId })\n const employeeJobs = useMemo(() => jobsData.jobs ?? [], [jobsData.jobs])\n\n const { data: addressesData } = useEmployeeAddressesGetWorkAddressesSuspense({ employeeId })\n const workAddresses = addressesData.employeeWorkAddressesList ?? []\n const currentWorkAddress = workAddresses.find(address => address.active) ?? workAddresses[0]\n\n if (!currentWorkAddress?.locationUuid) {\n throw new Error('No active work address with a location found for this employee')\n }\n\n const {\n data: { minimumWageList },\n } = useLocationsGetMinimumWagesSuspense({\n locationUuid: currentWorkAddress.locationUuid,\n })\n const minimumWages = minimumWageList ?? []\n\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n\n if (!employee) {\n throw new Error('Employee not found')\n }\n\n const { data } = useFederalTaxDetailsGetSuspense({ companyId: employee.companyUuid! })\n const showTwoPercentStakeholder = data.federalTaxDetails?.taxableAsScorp === true\n\n const currentJob = useMemo(\n () => (currentJobId ? (employeeJobs.find(job => job.uuid === currentJobId) ?? null) : null),\n [employeeJobs, currentJobId],\n )\n const currentCompensation = findCurrentCompensation(currentJob)\n\n const primaryFlsaStatus = useMemo<string | undefined>(() => {\n return employeeJobs.reduce<string | undefined>((prev, curr) => {\n const compensation = curr.compensations?.find(\n comp => comp.uuid === curr.currentCompensationUuid,\n )\n if (!curr.primary || !compensation) return prev\n return compensation.flsaStatus ?? prev\n }, undefined)\n }, [employeeJobs])\n\n const defaultValues = useMemo<CompensationInputs>(() => {\n return {\n jobTitle:\n currentJob?.title && currentJob.title !== ''\n ? currentJob.title\n : (partnerDefaultValues?.title ?? ''),\n flsaStatus:\n currentCompensation?.flsaStatus ?? primaryFlsaStatus ?? partnerDefaultValues?.flsaStatus,\n rate: Number(currentCompensation?.rate ?? partnerDefaultValues?.rate ?? 0),\n adjustForMinimumWage: currentCompensation?.adjustForMinimumWage ?? false,\n minimumWageId: currentCompensation?.minimumWages?.[0]?.uuid ?? '',\n paymentUnit: currentCompensation?.paymentUnit ?? partnerDefaultValues?.paymentUnit ?? 'Hour',\n stateWcCovered: currentJob?.stateWcCovered ?? false,\n stateWcClassCode: currentJob?.stateWcClassCode ?? '',\n twoPercentShareholder: currentJob?.twoPercentShareholder ?? false,\n } as CompensationInputs\n }, [currentJob, currentCompensation, primaryFlsaStatus, partnerDefaultValues])\n\n const updateCompensationMutation = useJobsAndCompensationsUpdateCompensationMutation()\n const createEmployeeJobMutation = useJobsAndCompensationsCreateJobMutation()\n const updateEmployeeJobMutation = useJobsAndCompensationsUpdateMutation()\n\n const isPending =\n updateCompensationMutation.isPending ||\n createEmployeeJobMutation.isPending ||\n updateEmployeeJobMutation.isPending\n\n const otherJobsCount = currentJob\n ? employeeJobs.filter(job => job.uuid !== currentJob.uuid).length\n : employeeJobs.length\n\n const onSave = async (formData: CompensationOutputs) => {\n await baseSubmitHandler(formData, async payload => {\n const { jobTitle, twoPercentShareholder, ...compensationData } = payload\n let updatedJobData: Job\n\n if (!currentJob) {\n const createResult = await createEmployeeJobMutation.mutateAsync({\n request: {\n employeeId,\n jobsCreateRequestBody: {\n title: jobTitle,\n hireDate: startDate,\n stateWcCovered: compensationData.stateWcCovered,\n stateWcClassCode: compensationData.stateWcCovered\n ? compensationData.stateWcClassCode\n : null,\n twoPercentShareholder: twoPercentShareholder ?? false,\n },\n },\n })\n updatedJobData = createResult.job!\n onEvent(componentEvents.EMPLOYEE_JOB_CREATED, updatedJobData)\n } else {\n const updateResult = await updateEmployeeJobMutation.mutateAsync({\n request: {\n jobId: currentJob.uuid,\n jobsUpdateRequestBody: {\n title: jobTitle,\n version: currentJob.version as string,\n hireDate: startDate,\n stateWcClassCode: compensationData.stateWcCovered\n ? compensationData.stateWcClassCode\n : null,\n stateWcCovered: compensationData.stateWcCovered,\n twoPercentShareholder: twoPercentShareholder ?? false,\n },\n },\n })\n updatedJobData = updateResult.job!\n onEvent(componentEvents.EMPLOYEE_JOB_UPDATED, updatedJobData)\n }\n\n const { compensation } = await updateCompensationMutation.mutateAsync({\n request: {\n compensationId: updatedJobData.currentCompensationUuid!,\n compensationsUpdateRequestBody: {\n // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain\n version: updatedJobData.compensations?.find(\n comp => comp.uuid === updatedJobData.currentCompensationUuid,\n )?.version!,\n ...compensationData,\n rate: String(compensationData.rate),\n minimumWages: compensationData.adjustForMinimumWage\n ? [{ uuid: compensationData.minimumWageId }]\n : [],\n },\n },\n })\n\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_UPDATED, compensation)\n\n onSaved(formData)\n })\n }\n\n const canChangeFlsaClassification = currentJob?.primary === true || employeeJobs.length === 0\n\n return (\n <section className={className}>\n <EditCompensationPresentation\n defaultValues={defaultValues}\n title={title}\n submitCtaLabel={submitCtaLabel}\n canChangeFlsaClassification={canChangeFlsaClassification}\n currentCompensationFlsaStatus={currentCompensation?.flsaStatus ?? undefined}\n otherJobsCount={otherJobsCount}\n state={currentWorkAddress.state}\n minimumWages={minimumWages}\n showTwoPercentStakeholder={showTwoPercentStakeholder}\n isPending={isPending}\n onSave={onSave}\n onCancel={onCancel}\n />\n </section>\n )\n}\n"],"names":["EditCompensation","props","useComponentDictionary","jsx","BaseComponent","Root","findCurrentCompensation","job","comp","employeeId","startDate","currentJobId","title","submitCtaLabel","onSaved","onCancel","partnerDefaultValues","className","useI18n","onEvent","baseSubmitHandler","useBase","jobsData","useJobsAndCompensationsGetJobsSuspense","employeeJobs","useMemo","addressesData","useEmployeeAddressesGetWorkAddressesSuspense","workAddresses","currentWorkAddress","address","minimumWageList","useLocationsGetMinimumWagesSuspense","minimumWages","employee","useEmployeesGetSuspense","data","useFederalTaxDetailsGetSuspense","showTwoPercentStakeholder","currentJob","currentCompensation","primaryFlsaStatus","prev","curr","compensation","defaultValues","updateCompensationMutation","useJobsAndCompensationsUpdateCompensationMutation","createEmployeeJobMutation","useJobsAndCompensationsCreateJobMutation","updateEmployeeJobMutation","useJobsAndCompensationsUpdateMutation","isPending","otherJobsCount","onSave","formData","payload","jobTitle","twoPercentShareholder","compensationData","updatedJobData","componentEvents","canChangeFlsaClassification","EditCompensationPresentation"],"mappings":";;;;;;;;;;;;;;;AAiCO,SAASA,GAAiBC,GAAuD;AACtF,SAAAC,GAAuB,yBAAyBD,EAAM,UAAU,GAE9D,gBAAAE,EAACC,KAAe,GAAGH,GACjB,4BAACI,IAAA,EAAM,GAAGJ,GAAO,EAAA,CACnB;AAEJ;AAEA,MAAMK,KAA0B,CAACC,MACxBA,GAAK,eAAe,KAAK,OAAQC,EAAK,SAASD,EAAI,uBAAuB;AAGnF,SAASF,GAAK;AAAA,EACZ,YAAAI;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,WAAAC;AACF,GAA0B;AACxB,EAAAC,GAAQ,uBAAuB;AAC/B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC,EAAE,MAAMC,EAAA,IAAaC,EAAuC,EAAE,YAAAd,GAAY,GAC1Ee,IAAeC,EAAQ,MAAMH,EAAS,QAAQ,IAAI,CAACA,EAAS,IAAI,CAAC,GAEjE,EAAE,MAAMI,EAAA,IAAkBC,EAA6C,EAAE,YAAAlB,GAAY,GACrFmB,IAAgBF,EAAc,6BAA6B,CAAA,GAC3DG,IAAqBD,EAAc,KAAK,CAAAE,MAAWA,EAAQ,MAAM,KAAKF,EAAc,CAAC;AAE3F,MAAI,CAACC,GAAoB;AACvB,UAAM,IAAI,MAAM,gEAAgE;AAGlF,QAAM;AAAA,IACJ,MAAM,EAAE,iBAAAE,EAAA;AAAA,EAAgB,IACtBC,EAAoC;AAAA,IACtC,cAAcH,EAAmB;AAAA,EAAA,CAClC,GACKI,IAAeF,KAAmB,CAAA,GAElC;AAAA,IACJ,MAAM,EAAE,UAAAG,EAAA;AAAA,EAAS,IACfC,EAAwB,EAAE,YAAA1B,GAAY;AAE1C,MAAI,CAACyB;AACH,UAAM,IAAI,MAAM,oBAAoB;AAGtC,QAAM,EAAE,MAAAE,MAASC,EAAgC,EAAE,WAAWH,EAAS,aAAc,GAC/EI,IAA4BF,EAAK,mBAAmB,mBAAmB,IAEvEG,IAAad;AAAA,IACjB,MAAOd,IAAgBa,EAAa,KAAK,OAAOjB,EAAI,SAASI,CAAY,KAAK,OAAQ;AAAA,IACtF,CAACa,GAAcb,CAAY;AAAA,EAAA,GAEvB6B,IAAsBlC,GAAwBiC,CAAU,GAExDE,IAAoBhB,EAA4B,MAC7CD,EAAa,OAA2B,CAACkB,GAAMC,MAAS;AAC7D,UAAMC,IAAeD,EAAK,eAAe;AAAA,MACvC,CAAAnC,MAAQA,EAAK,SAASmC,EAAK;AAAA,IAAA;AAE7B,WAAI,CAACA,EAAK,WAAW,CAACC,IAAqBF,IACpCE,EAAa,cAAcF;AAAA,EACpC,GAAG,MAAS,GACX,CAAClB,CAAY,CAAC,GAEXqB,IAAgBpB,EAA4B,OACzC;AAAA,IACL,UACEc,GAAY,SAASA,EAAW,UAAU,KACtCA,EAAW,QACVvB,GAAsB,SAAS;AAAA,IACtC,YACEwB,GAAqB,cAAcC,KAAqBzB,GAAsB;AAAA,IAChF,MAAM,OAAOwB,GAAqB,QAAQxB,GAAsB,QAAQ,CAAC;AAAA,IACzE,sBAAsBwB,GAAqB,wBAAwB;AAAA,IACnE,eAAeA,GAAqB,eAAe,CAAC,GAAG,QAAQ;AAAA,IAC/D,aAAaA,GAAqB,eAAexB,GAAsB,eAAe;AAAA,IACtF,gBAAgBuB,GAAY,kBAAkB;AAAA,IAC9C,kBAAkBA,GAAY,oBAAoB;AAAA,IAClD,uBAAuBA,GAAY,yBAAyB;AAAA,EAAA,IAE7D,CAACA,GAAYC,GAAqBC,GAAmBzB,CAAoB,CAAC,GAEvE8B,IAA6BC,EAAA,GAC7BC,IAA4BC,EAAA,GAC5BC,IAA4BC,EAAA,GAE5BC,IACJN,EAA2B,aAC3BE,EAA0B,aAC1BE,EAA0B,WAEtBG,IAAiBd,IACnBf,EAAa,OAAO,CAAAjB,MAAOA,EAAI,SAASgC,EAAW,IAAI,EAAE,SACzDf,EAAa,QAEX8B,IAAS,OAAOC,MAAkC;AACtD,UAAMnC,EAAkBmC,GAAU,OAAMC,MAAW;AACjD,YAAM,EAAE,UAAAC,GAAU,uBAAAC,GAAuB,GAAGC,MAAqBH;AACjE,UAAII;AAEJ,MAAKrB,KAiCHqB,KAfqB,MAAMV,EAA0B,YAAY;AAAA,QAC/D,SAAS;AAAA,UACP,OAAOX,EAAW;AAAA,UAClB,uBAAuB;AAAA,YACrB,OAAOkB;AAAA,YACP,SAASlB,EAAW;AAAA,YACpB,UAAU7B;AAAA,YACV,kBAAkBiD,EAAiB,iBAC/BA,EAAiB,mBACjB;AAAA,YACJ,gBAAgBA,EAAiB;AAAA,YACjC,uBAAuBD,KAAyB;AAAA,UAAA;AAAA,QAClD;AAAA,MACF,CACD,GAC6B,KAC9BvC,EAAQ0C,EAAgB,sBAAsBD,CAAc,MAnB5DA,KAdqB,MAAMZ,EAA0B,YAAY;AAAA,QAC/D,SAAS;AAAA,UACP,YAAAvC;AAAA,UACA,uBAAuB;AAAA,YACrB,OAAOgD;AAAA,YACP,UAAU/C;AAAA,YACV,gBAAgBiD,EAAiB;AAAA,YACjC,kBAAkBA,EAAiB,iBAC/BA,EAAiB,mBACjB;AAAA,YACJ,uBAAuBD,KAAyB;AAAA,UAAA;AAAA,QAClD;AAAA,MACF,CACD,GAC6B,KAC9BvC,EAAQ0C,EAAgB,sBAAsBD,CAAc;AAqB9D,YAAM,EAAE,cAAAhB,EAAA,IAAiB,MAAME,EAA2B,YAAY;AAAA,QACpE,SAAS;AAAA,UACP,gBAAgBc,EAAe;AAAA,UAC/B,gCAAgC;AAAA;AAAA,YAE9B,SAASA,EAAe,eAAe;AAAA,cACrC,CAAApD,MAAQA,EAAK,SAASoD,EAAe;AAAA,YAAA,GACpC;AAAA,YACH,GAAGD;AAAA,YACH,MAAM,OAAOA,EAAiB,IAAI;AAAA,YAClC,cAAcA,EAAiB,uBAC3B,CAAC,EAAE,MAAMA,EAAiB,cAAA,CAAe,IACzC,CAAA;AAAA,UAAC;AAAA,QACP;AAAA,MACF,CACD;AAED,MAAAxC,EAAQ0C,EAAgB,+BAA+BjB,CAAY,GAEnE9B,EAAQyC,CAAQ;AAAA,IAClB,CAAC;AAAA,EACH,GAEMO,IAA8BvB,GAAY,YAAY,MAAQf,EAAa,WAAW;AAE5F,SACE,gBAAArB,EAAC,aAAQ,WAAAc,GACP,UAAA,gBAAAd;AAAA,IAAC4D;AAAA,IAAA;AAAA,MACC,eAAAlB;AAAA,MACA,OAAAjC;AAAA,MACA,gBAAAC;AAAA,MACA,6BAAAiD;AAAA,MACA,+BAA+BtB,GAAqB,cAAc;AAAA,MAClE,gBAAAa;AAAA,MACA,OAAOxB,EAAmB;AAAA,MAC1B,cAAAI;AAAA,MACA,2BAAAK;AAAA,MACA,WAAAc;AAAA,MACA,QAAAE;AAAA,MACA,UAAAvC;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -1,17 +0,0 @@
1
- import { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage';
2
- import { CompensationInputs, CompensationOutputs } from '../compensationSchema';
3
- export interface EditCompensationPresentationProps {
4
- defaultValues: CompensationInputs;
5
- title: string;
6
- submitCtaLabel: string;
7
- canChangeFlsaClassification: boolean;
8
- currentCompensationFlsaStatus: string | undefined;
9
- otherJobsCount: number;
10
- state: string | undefined;
11
- minimumWages: MinimumWage[];
12
- showTwoPercentStakeholder: boolean;
13
- isPending: boolean;
14
- onSave: (data: CompensationOutputs) => void | Promise<void>;
15
- onCancel?: () => void;
16
- }
17
- export declare function EditCompensationPresentation({ defaultValues, title, submitCtaLabel, canChangeFlsaClassification, currentCompensationFlsaStatus, otherJobsCount, state, minimumWages, showTwoPercentStakeholder, isPending, onSave, onCancel, }: EditCompensationPresentationProps): import("react/jsx-runtime").JSX.Element;