@gusto/embedded-react-sdk 0.47.0 → 0.48.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 (850) hide show
  1. package/CHANGELOG.md +151 -0
  2. package/dist/components/Common/ActionsLayout/ActionsLayout.d.ts +1 -0
  3. package/dist/components/Common/ActionsLayout/ActionsLayout.js.map +1 -1
  4. package/dist/components/Common/Alert/Alert.d.ts +2 -0
  5. package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -0
  6. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  7. package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -0
  8. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  9. package/dist/components/Common/DataView/DataView.d.ts +2 -0
  10. package/dist/components/Common/DataView/DataView.js.map +1 -1
  11. package/dist/components/Common/DataView/useDataView.d.ts +4 -0
  12. package/dist/components/Common/DataView/useDataView.js.map +1 -1
  13. package/dist/components/Common/DataView/useSelectionState.d.ts +1 -0
  14. package/dist/components/Common/DataView/useSelectionState.js.map +1 -1
  15. package/dist/components/Common/DateRangeFilter/DateRangeFilter.d.ts +1 -0
  16. package/dist/components/Common/DateRangeFilter/DateRangeFilter.js.map +1 -1
  17. package/dist/components/Common/DetailViewLayout/DetailViewLayout.d.ts +1 -0
  18. package/dist/components/Common/DetailViewLayout/DetailViewLayout.js.map +1 -1
  19. package/dist/components/Common/DetailViewLayout/DetailViewLayoutTypes.d.ts +1 -0
  20. package/dist/components/Common/DocumentList/DocumentList.d.ts +6 -0
  21. package/dist/components/Common/DocumentList/DocumentList.js.map +1 -1
  22. package/dist/components/Common/DocumentViewer/DocumentViewer.d.ts +1 -0
  23. package/dist/components/Common/DocumentViewer/DocumentViewer.js.map +1 -1
  24. package/dist/components/Common/EmptyData/EmptyData.d.ts +1 -0
  25. package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
  26. package/dist/components/Common/FadeIn/FadeIn.d.ts +1 -0
  27. package/dist/components/Common/FadeIn/FadeIn.js.map +1 -1
  28. package/dist/components/Common/FieldCaption/FieldCaption.d.ts +8 -0
  29. package/dist/components/Common/FieldCaption/FieldCaption.js.map +1 -1
  30. package/dist/components/Common/FieldDescription/FieldDescription.d.ts +5 -0
  31. package/dist/components/Common/FieldDescription/FieldDescription.js.map +1 -1
  32. package/dist/components/Common/FieldErrorMessage/FieldErrorMessage.d.ts +5 -0
  33. package/dist/components/Common/FieldErrorMessage/FieldErrorMessage.js.map +1 -1
  34. package/dist/components/Common/FieldLayout/FieldLayout.d.ts +5 -0
  35. package/dist/components/Common/FieldLayout/FieldLayout.js.map +1 -1
  36. package/dist/components/Common/FieldLayout/FieldLayoutTypes.d.ts +15 -0
  37. package/dist/components/Common/Fieldset/Fieldset.d.ts +2 -0
  38. package/dist/components/Common/Fieldset/Fieldset.js.map +1 -1
  39. package/dist/components/Common/Flex/Flex.d.ts +4 -0
  40. package/dist/components/Common/Flex/Flex.js.map +1 -1
  41. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.d.ts +20 -0
  42. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
  43. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes.d.ts +33 -7
  44. package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.d.ts +16 -0
  45. package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js.map +1 -1
  46. package/dist/components/Common/Form/Form.d.ts +2 -0
  47. package/dist/components/Common/Form/Form.js.map +1 -1
  48. package/dist/components/Common/Grid/Grid.d.ts +2 -0
  49. package/dist/components/Common/Grid/Grid.js.map +1 -1
  50. package/dist/components/Common/HamburgerMenu/HamburgerMenu.d.ts +7 -0
  51. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
  52. package/dist/components/Common/HamburgerMenu/HamburgerMenuTypes.d.ts +11 -0
  53. package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.d.ts +7 -0
  54. package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.js.map +1 -1
  55. package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayoutTypes.d.ts +14 -0
  56. package/dist/components/Common/InlineSpinner/InlineSpinner.d.ts +1 -0
  57. package/dist/components/Common/InlineSpinner/InlineSpinner.js.map +1 -1
  58. package/dist/components/Common/InternalError/InternalError.d.ts +1 -0
  59. package/dist/components/Common/InternalError/InternalError.js.map +1 -1
  60. package/dist/components/Common/Loading/Loading.d.ts +2 -0
  61. package/dist/components/Common/Loading/Loading.js.map +1 -1
  62. package/dist/components/Common/OnboardingStatusBadge/index.d.ts +3 -0
  63. package/dist/components/Common/OnboardingStatusBadge/index.js.map +1 -1
  64. package/dist/components/Common/ReorderableList/DropZone.d.ts +1 -0
  65. package/dist/components/Common/ReorderableList/DropZone.js.map +1 -1
  66. package/dist/components/Common/ReorderableList/ReorderableItem.d.ts +1 -3
  67. package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
  68. package/dist/components/Common/ReorderableList/ReorderableList.d.ts +1 -0
  69. package/dist/components/Common/ReorderableList/ReorderableList.js.map +1 -1
  70. package/dist/components/Common/ReorderableList/ReorderableListTypes.d.ts +4 -0
  71. package/dist/components/Common/ReorderableList/constants.d.ts +1 -3
  72. package/dist/components/Common/ReorderableList/constants.js.map +1 -1
  73. package/dist/components/Common/RequirementsList/RequirementsList.d.ts +1 -0
  74. package/dist/components/Common/RequirementsList/RequirementsList.js.map +1 -1
  75. package/dist/components/Common/TaxInputs/TaxInputs.d.ts +7 -0
  76. package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
  77. package/dist/components/Common/Toast/Toast.d.ts +1 -0
  78. package/dist/components/Common/VisuallyHidden/VisuallyHidden.d.ts +2 -0
  79. package/dist/components/Common/VisuallyHidden/VisuallyHidden.js.map +1 -1
  80. package/dist/components/Company/AssignSignatory/AssignSignatory.js +10 -7
  81. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  82. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +4 -3
  83. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  84. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +1 -1
  85. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +9 -6
  86. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  87. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +16 -15
  88. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  89. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -5
  90. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  91. package/dist/components/Company/AssignSignatory/Head.js +9 -8
  92. package/dist/components/Company/AssignSignatory/Head.js.map +1 -1
  93. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +1 -1
  94. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +8 -5
  95. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  96. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +21 -20
  97. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  98. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -5
  99. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  100. package/dist/components/Company/AssignSignatory/TitleSelect.js +4 -2
  101. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  102. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -7
  103. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  104. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
  105. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  106. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +11 -9
  107. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  108. package/dist/components/Company/BankAccount/BankAccountForm/Head.js +3 -2
  109. package/dist/components/Company/BankAccount/BankAccountForm/Head.js.map +1 -1
  110. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -5
  111. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  112. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +1 -1
  113. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +1 -1
  114. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -4
  115. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  116. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +1 -1
  117. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +14 -11
  118. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  119. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -5
  120. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  121. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +8 -7
  122. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  123. package/dist/components/Company/FederalTaxes/Actions.js +1 -1
  124. package/dist/components/Company/FederalTaxes/FederalTaxes.js +10 -7
  125. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  126. package/dist/components/Company/FederalTaxes/Form.js +5 -5
  127. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  128. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -10
  129. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  130. package/dist/components/Company/Industry/Actions.js +1 -1
  131. package/dist/components/Company/Industry/Context.js +6 -8
  132. package/dist/components/Company/Industry/Context.js.map +1 -1
  133. package/dist/components/Company/Industry/Edit.js +6 -5
  134. package/dist/components/Company/Industry/Edit.js.map +1 -1
  135. package/dist/components/Company/Industry/IndustrySelect.js +8 -6
  136. package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
  137. package/dist/components/Company/Locations/LocationForm/Actions.js +1 -1
  138. package/dist/components/Company/Locations/LocationForm/Form.js +6 -4
  139. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  140. package/dist/components/Company/Locations/LocationForm/LocationForm.js +17 -14
  141. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  142. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -5
  143. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  144. package/dist/components/Company/Locations/LocationsList/Actions.js +1 -1
  145. package/dist/components/Company/Locations/LocationsList/List.js +11 -12
  146. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  147. package/dist/components/Company/Locations/LocationsList/LocationsList.js +12 -9
  148. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  149. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -5
  150. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  151. package/dist/components/Company/OnboardingOverview/Completed.js +6 -5
  152. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  153. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +9 -8
  154. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  155. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +5 -2
  156. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  157. package/dist/components/Company/OnboardingOverview/context.js +3 -5
  158. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  159. package/dist/components/Company/PaySchedule/PayScheduleList.js +8 -8
  160. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +1 -1
  161. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -5
  162. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  163. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +1 -1
  164. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
  165. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  166. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -5
  167. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  168. package/dist/components/Contractor/Address/Address.js +5 -2
  169. package/dist/components/Contractor/Address/Address.js.map +1 -1
  170. package/dist/components/Contractor/Address/Form.js +8 -6
  171. package/dist/components/Contractor/Address/Form.js.map +1 -1
  172. package/dist/components/Contractor/Address/Head.js +5 -4
  173. package/dist/components/Contractor/Address/Head.js.map +1 -1
  174. package/dist/components/Contractor/Address/useAddress.js +5 -7
  175. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  176. package/dist/components/Contractor/ContractorList/index.js +4 -4
  177. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +4 -2
  178. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  179. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +4 -2
  180. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  181. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +10 -10
  182. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +2 -2
  183. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +3 -2
  184. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  185. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +15 -15
  186. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +4 -3
  187. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  188. package/dist/components/Contractor/Profile/useContractorProfile.d.ts +6 -6
  189. package/dist/components/Contractor/Submit/Submit.js +3 -2
  190. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  191. package/dist/components/Contractor/exports/contractorManagement.d.ts +6 -0
  192. package/dist/components/Contractor/exports/contractorManagement.js +15 -0
  193. package/dist/components/Contractor/exports/contractorManagement.js.map +1 -0
  194. package/dist/components/Employee/Compensation/management/Compensation.d.ts +35 -0
  195. package/dist/components/Employee/Compensation/management/Compensation.js.map +1 -1
  196. package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.d.ts +23 -3
  197. package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.js.map +1 -1
  198. package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.d.ts +21 -10
  199. package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.js.map +1 -1
  200. package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.d.ts +24 -7
  201. package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js +18 -18
  202. package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js.map +1 -1
  203. package/dist/components/Employee/Compensation/management/CompensationCard/index.d.ts +0 -1
  204. package/dist/components/Employee/Compensation/management/CompensationComponents.d.ts +7 -1
  205. package/dist/components/Employee/Compensation/management/CompensationComponents.js.map +1 -1
  206. package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.d.ts +27 -15
  207. package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js.map +1 -1
  208. package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.d.ts +12 -0
  209. package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js.map +1 -1
  210. package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.d.ts +12 -0
  211. package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.js.map +1 -1
  212. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.d.ts +3 -0
  213. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +3 -2
  214. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -1
  215. package/dist/components/Employee/Compensation/management/compensationStateMachine.d.ts +1 -0
  216. package/dist/components/Employee/Compensation/management/compensationStateMachine.js.map +1 -1
  217. package/dist/components/Employee/Compensation/management/useManagementCompensationDictionary.d.ts +2 -0
  218. package/dist/components/Employee/Compensation/management/useManagementCompensationDictionary.js.map +1 -1
  219. package/dist/components/Employee/Compensation/onboarding/Compensation.d.ts +61 -0
  220. package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -1
  221. package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.d.ts +5 -0
  222. package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.js.map +1 -1
  223. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +32 -9
  224. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
  225. package/dist/components/Employee/Compensation/onboarding/EditCompensation/index.d.ts +1 -2
  226. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.d.ts +3 -0
  227. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js.map +1 -1
  228. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.d.ts +9 -0
  229. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js +7 -7
  230. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js.map +1 -1
  231. package/dist/components/Employee/Compensation/onboarding/JobsList/index.d.ts +1 -4
  232. package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.d.ts +1 -0
  233. package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js.map +1 -1
  234. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.d.ts +5 -0
  235. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +3 -2
  236. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -1
  237. package/dist/components/Employee/Compensation/shared/PendingChangesReviewModal.d.ts +2 -0
  238. package/dist/components/Employee/Compensation/shared/PendingChangesReviewModal.js.map +1 -1
  239. package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.d.ts +2 -0
  240. package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.js.map +1 -1
  241. package/dist/components/Employee/Compensation/shared/getPendingCompensationChanges.d.ts +4 -0
  242. package/dist/components/Employee/Compensation/shared/getPendingCompensationChanges.js.map +1 -1
  243. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +98 -0
  244. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
  245. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +168 -0
  246. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
  247. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
  248. package/dist/components/Employee/Compensation/shared/useCompensationForm/index.d.ts +1 -0
  249. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts +153 -6
  250. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
  251. package/dist/components/Employee/Compensation/shared/useCompensationManagement/index.d.ts +1 -1
  252. package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.d.ts +19 -0
  253. package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.js.map +1 -1
  254. package/dist/components/Employee/Compensation/shared/useJobForm/fields.d.ts +101 -0
  255. package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +10 -10
  256. package/dist/components/Employee/Compensation/shared/useJobForm/fields.js.map +1 -1
  257. package/dist/components/Employee/Compensation/shared/useJobForm/index.d.ts +1 -0
  258. package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +75 -0
  259. package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
  260. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +137 -8
  261. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
  262. package/dist/components/Employee/Compensation/shared/usePendingChangeDetailRenderer.d.ts +2 -0
  263. package/dist/components/Employee/Compensation/shared/usePendingChangeDetailRenderer.js.map +1 -1
  264. package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +18 -4
  265. package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
  266. package/dist/components/Employee/Dashboard/Dashboard.d.ts +3 -0
  267. package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
  268. package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +21 -1
  269. package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
  270. package/dist/components/Employee/Dashboard/DashboardFlow.d.ts +116 -0
  271. package/dist/components/Employee/Dashboard/DashboardFlow.js.map +1 -1
  272. package/dist/components/Employee/Dashboard/JobAndPayView.d.ts +20 -0
  273. package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
  274. package/dist/components/Employee/Dashboard/TaxesView.d.ts +36 -3
  275. package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
  276. package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +1 -0
  277. package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
  278. package/dist/components/Employee/Dashboard/index.d.ts +0 -6
  279. package/dist/components/Employee/Deductions/management/Deductions.d.ts +30 -0
  280. package/dist/components/Employee/Deductions/management/Deductions.js.map +1 -1
  281. package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.d.ts +21 -8
  282. package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js +16 -16
  283. package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js.map +1 -1
  284. package/dist/components/Employee/Deductions/management/DeductionsComponents.d.ts +5 -1
  285. package/dist/components/Employee/Deductions/management/DeductionsComponents.js.map +1 -1
  286. package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.d.ts +21 -7
  287. package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js.map +1 -1
  288. package/dist/components/Employee/Deductions/management/DeductionsEditForm/useFormDictionary.d.ts +2 -0
  289. package/dist/components/Employee/Deductions/management/DeductionsEditForm/useFormDictionary.js.map +1 -1
  290. package/dist/components/Employee/Deductions/management/deductionsStateMachine.d.ts +1 -0
  291. package/dist/components/Employee/Deductions/management/deductionsStateMachine.js.map +1 -1
  292. package/dist/components/Employee/Deductions/onboarding/Deductions.d.ts +45 -0
  293. package/dist/components/Employee/Deductions/onboarding/Deductions.js.map +1 -1
  294. package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.d.ts +2 -0
  295. package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.js +12 -12
  296. package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.js.map +1 -1
  297. package/dist/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.d.ts +2 -0
  298. package/dist/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.js +6 -5
  299. package/dist/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.js.map +1 -1
  300. package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.d.ts +5 -0
  301. package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.js.map +1 -1
  302. package/dist/components/Employee/Deductions/onboarding/stateMachine.d.ts +1 -0
  303. package/dist/components/Employee/Deductions/onboarding/stateMachine.js.map +1 -1
  304. package/dist/components/Employee/Deductions/onboarding/useFormDictionary.d.ts +2 -0
  305. package/dist/components/Employee/Deductions/onboarding/useFormDictionary.js.map +1 -1
  306. package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.d.ts +1 -0
  307. package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js +7 -6
  308. package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js.map +1 -1
  309. package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.d.ts +7 -0
  310. package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.js.map +1 -1
  311. package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.d.ts +1 -0
  312. package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js +15 -14
  313. package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js.map +1 -1
  314. package/dist/components/Employee/Deductions/shared/DeductionsForm/index.d.ts +1 -1
  315. package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.d.ts +2 -0
  316. package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.js.map +1 -1
  317. package/dist/components/Employee/Deductions/shared/formatDeductionAmount.d.ts +2 -0
  318. package/dist/components/Employee/Deductions/shared/formatDeductionAmount.js.map +1 -1
  319. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +38 -5
  320. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js.map +1 -1
  321. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.d.ts +207 -0
  322. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
  323. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js.map +1 -1
  324. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/index.d.ts +3 -2
  325. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.d.ts +129 -3
  326. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js.map +1 -1
  327. package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.d.ts +29 -1
  328. package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js.map +1 -1
  329. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.d.ts +158 -0
  330. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
  331. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js.map +1 -1
  332. package/dist/components/Employee/Deductions/shared/useDeductionForm/index.d.ts +3 -2
  333. package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.d.ts +131 -4
  334. package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js.map +1 -1
  335. package/dist/components/Employee/Deductions/shared/useDeductionsList.d.ts +6 -1
  336. package/dist/components/Employee/Deductions/shared/useDeductionsList.js.map +1 -1
  337. package/dist/components/Employee/Deductions/shared/useDeleteDeduction.d.ts +2 -0
  338. package/dist/components/Employee/Deductions/shared/useDeleteDeduction.js.map +1 -1
  339. package/dist/components/Employee/Documents/management/DocumentManager.d.ts +3 -0
  340. package/dist/components/Employee/Documents/management/DocumentManager.js +7 -6
  341. package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -1
  342. package/dist/components/Employee/Documents/management/Documents.d.ts +24 -0
  343. package/dist/components/Employee/Documents/management/Documents.js.map +1 -1
  344. package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.d.ts +17 -7
  345. package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js +15 -14
  346. package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -1
  347. package/dist/components/Employee/Documents/management/DocumentsComponents.d.ts +3 -0
  348. package/dist/components/Employee/Documents/management/DocumentsComponents.js.map +1 -1
  349. package/dist/components/Employee/Documents/management/documentsStateMachine.d.ts +1 -0
  350. package/dist/components/Employee/Documents/management/documentsStateMachine.js.map +1 -1
  351. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.d.ts +1 -0
  352. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js +1 -1
  353. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js.map +1 -1
  354. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.d.ts +1 -0
  355. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js +13 -10
  356. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  357. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Head.d.ts +1 -0
  358. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Head.js.map +1 -1
  359. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.d.ts +1 -0
  360. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js +4 -2
  361. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js.map +1 -1
  362. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -5
  363. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  364. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.d.ts +29 -0
  365. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
  366. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.d.ts +23 -0
  367. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
  368. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.d.ts +1 -0
  369. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +6 -6
  370. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
  371. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.d.ts +3 -0
  372. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -1
  373. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/countries.d.ts +1 -0
  374. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/countries.js.map +1 -1
  375. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.d.ts +1 -0
  376. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js +4 -3
  377. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
  378. package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.d.ts +6 -0
  379. package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.js.map +1 -1
  380. package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.d.ts +1 -0
  381. package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.js.map +1 -1
  382. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.d.ts +27 -2
  383. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -1
  384. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.d.ts +3 -0
  385. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js +7 -6
  386. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
  387. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/index.d.ts +1 -1
  388. package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.d.ts +1 -0
  389. package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js +11 -10
  390. package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -1
  391. package/dist/components/Employee/Documents/shared/useDocumentsList/index.d.ts +0 -1
  392. package/dist/components/Employee/Documents/shared/useDocumentsList/useDocumentsList.d.ts +23 -6
  393. package/dist/components/Employee/Documents/shared/useDocumentsList/useDocumentsList.js.map +1 -1
  394. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.d.ts +326 -0
  395. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
  396. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js.map +1 -1
  397. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/index.d.ts +2 -1
  398. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +62 -0
  399. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -1
  400. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +130 -0
  401. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -1
  402. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.d.ts +30 -3
  403. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js +17 -21
  404. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -1
  405. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.d.ts +2 -0
  406. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js +12 -12
  407. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
  408. package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.d.ts +23 -2
  409. package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js +38 -35
  410. package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js.map +1 -1
  411. package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.d.ts +2 -0
  412. package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js +10 -10
  413. package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js.map +1 -1
  414. package/dist/components/Employee/EmployeeList/shared/index.d.ts +1 -1
  415. package/dist/components/Employee/EmployeeList/shared/useEmployeeList.d.ts +86 -11
  416. package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js +50 -62
  417. package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js.map +1 -1
  418. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +34 -0
  419. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -1
  420. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +11 -0
  421. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js.map +1 -1
  422. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.d.ts +1 -0
  423. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -1
  424. package/dist/components/Employee/FederalTaxes/index.d.ts +2 -5
  425. package/dist/components/Employee/FederalTaxes/management/FederalTaxes.d.ts +27 -0
  426. package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js.map +1 -1
  427. package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.d.ts +9 -0
  428. package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js +16 -15
  429. package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js.map +1 -1
  430. package/dist/components/Employee/FederalTaxes/management/FederalTaxesComponents.d.ts +5 -1
  431. package/dist/components/Employee/FederalTaxes/management/FederalTaxesComponents.js.map +1 -1
  432. package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.d.ts +24 -0
  433. package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +8 -7
  434. package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
  435. package/dist/components/Employee/FederalTaxes/management/federalTaxesStateMachine.d.ts +1 -0
  436. package/dist/components/Employee/FederalTaxes/management/federalTaxesStateMachine.js.map +1 -1
  437. package/dist/components/Employee/FederalTaxes/management/useViewDictionary.d.ts +2 -0
  438. package/dist/components/Employee/FederalTaxes/management/useViewDictionary.js.map +1 -1
  439. package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.d.ts +24 -0
  440. package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +13 -12
  441. package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
  442. package/dist/components/Employee/FederalTaxes/onboarding/useViewDictionary.d.ts +2 -0
  443. package/dist/components/Employee/FederalTaxes/onboarding/useViewDictionary.js.map +1 -1
  444. package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.d.ts +4 -0
  445. package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js.map +1 -1
  446. package/dist/components/Employee/FederalTaxes/shared/index.d.ts +1 -2
  447. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.d.ts +46 -0
  448. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.js.map +1 -1
  449. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.d.ts +112 -0
  450. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
  451. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js.map +1 -1
  452. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/index.d.ts +1 -0
  453. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.d.ts +112 -0
  454. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.js.map +1 -1
  455. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/index.d.ts +0 -1
  456. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/useFederalTaxesSummary.d.ts +14 -1
  457. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/useFederalTaxesSummary.js.map +1 -1
  458. package/dist/components/Employee/HomeAddress/management/HomeAddress.d.ts +21 -0
  459. package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
  460. package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.d.ts +17 -5
  461. package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js +8 -7
  462. package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js.map +1 -1
  463. package/dist/components/Employee/HomeAddress/management/HomeAddressComponents.d.ts +3 -0
  464. package/dist/components/Employee/HomeAddress/management/HomeAddressComponents.js.map +1 -1
  465. package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.d.ts +20 -0
  466. package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.js.map +1 -1
  467. package/dist/components/Employee/HomeAddress/management/HomeAddressView.d.ts +2 -0
  468. package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +5 -5
  469. package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
  470. package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.d.ts +7 -1
  471. package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.js.map +1 -1
  472. package/dist/components/Employee/HomeAddress/management/homeAddressStateMachine.d.ts +1 -0
  473. package/dist/components/Employee/HomeAddress/management/homeAddressStateMachine.js.map +1 -1
  474. package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.d.ts +46 -7
  475. package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js.map +1 -1
  476. package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/index.d.ts +0 -1
  477. package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/useHomeAddressSummary.d.ts +21 -6
  478. package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/useHomeAddressSummary.js.map +1 -1
  479. package/dist/components/Employee/Landing/Landing.d.ts +6 -0
  480. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  481. package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.d.ts +43 -0
  482. package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.js.map +1 -1
  483. package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.d.ts +17 -0
  484. package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.js.map +1 -1
  485. package/dist/components/Employee/OnboardingExecutionFlow/index.d.ts +2 -2
  486. package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.d.ts +7 -0
  487. package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.js.map +1 -1
  488. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +59 -0
  489. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
  490. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +2 -1
  491. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
  492. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.d.ts +1 -0
  493. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  494. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.d.ts +7 -0
  495. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +4 -4
  496. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
  497. package/dist/components/Employee/PaymentMethod/management/PaymentMethod.d.ts +39 -0
  498. package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -1
  499. package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.d.ts +23 -6
  500. package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js.map +1 -1
  501. package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.d.ts +24 -7
  502. package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.js +14 -14
  503. package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.js.map +1 -1
  504. package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.d.ts +5 -0
  505. package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js.map +1 -1
  506. package/dist/components/Employee/PaymentMethod/management/PaymentMethodSplitForm.d.ts +23 -6
  507. package/dist/components/Employee/PaymentMethod/management/PaymentMethodSplitForm.js.map +1 -1
  508. package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.d.ts +1 -0
  509. package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js.map +1 -1
  510. package/dist/components/Employee/PaymentMethod/management/useFormDictionary.d.ts +4 -0
  511. package/dist/components/Employee/PaymentMethod/management/useFormDictionary.js.map +1 -1
  512. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.d.ts +2 -0
  513. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js.map +1 -1
  514. package/dist/components/Employee/PaymentMethod/onboarding/ListView.d.ts +1 -0
  515. package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +8 -8
  516. package/dist/components/Employee/PaymentMethod/onboarding/ListView.js.map +1 -1
  517. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.d.ts +43 -0
  518. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -1
  519. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.d.ts +4 -0
  520. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js.map +1 -1
  521. package/dist/components/Employee/PaymentMethod/onboarding/SplitView.d.ts +2 -0
  522. package/dist/components/Employee/PaymentMethod/onboarding/SplitView.js.map +1 -1
  523. package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.d.ts +1 -0
  524. package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js.map +1 -1
  525. package/dist/components/Employee/PaymentMethod/onboarding/useFormDictionary.d.ts +4 -0
  526. package/dist/components/Employee/PaymentMethod/onboarding/useFormDictionary.js.map +1 -1
  527. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.d.ts +4 -0
  528. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js +6 -6
  529. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js.map +1 -1
  530. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/index.d.ts +1 -1
  531. package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.d.ts +2 -0
  532. package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.js.map +1 -1
  533. package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.d.ts +4 -0
  534. package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js +11 -10
  535. package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js.map +1 -1
  536. package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/index.d.ts +1 -1
  537. package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.d.ts +80 -0
  538. package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
  539. package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js.map +1 -1
  540. package/dist/components/Employee/PaymentMethod/shared/useBankForm/index.d.ts +1 -1
  541. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.d.ts +84 -1
  542. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js.map +1 -1
  543. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.d.ts +45 -0
  544. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.js.map +1 -1
  545. package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.d.ts +1 -0
  546. package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.js.map +1 -1
  547. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.d.ts +22 -0
  548. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.js.map +1 -1
  549. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/index.d.ts +2 -2
  550. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.d.ts +84 -1
  551. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js.map +1 -1
  552. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.d.ts +45 -0
  553. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.js.map +1 -1
  554. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.d.ts +6 -0
  555. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js.map +1 -1
  556. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.d.ts +22 -0
  557. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.js.map +1 -1
  558. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/index.d.ts +2 -2
  559. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.d.ts +25 -0
  560. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js.map +1 -1
  561. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.d.ts +124 -7
  562. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js.map +1 -1
  563. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.d.ts +52 -6
  564. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.js +1 -2
  565. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.js.map +1 -1
  566. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.d.ts +9 -0
  567. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +12 -12
  568. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
  569. package/dist/components/Employee/Paystubs/shared/usePaystubsList/index.d.ts +1 -1
  570. package/dist/components/Employee/Paystubs/shared/usePaystubsList/usePaystubsList.d.ts +25 -0
  571. package/dist/components/Employee/Paystubs/shared/usePaystubsList/usePaystubsList.js.map +1 -1
  572. package/dist/components/Employee/Profile/management/Profile.d.ts +25 -0
  573. package/dist/components/Employee/Profile/management/Profile.js.map +1 -1
  574. package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.d.ts +22 -6
  575. package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js +12 -11
  576. package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js.map +1 -1
  577. package/dist/components/Employee/Profile/management/ProfileComponents.d.ts +5 -1
  578. package/dist/components/Employee/Profile/management/ProfileComponents.js.map +1 -1
  579. package/dist/components/Employee/Profile/management/ProfileEditForm.d.ts +25 -0
  580. package/dist/components/Employee/Profile/management/ProfileEditForm.js +8 -8
  581. package/dist/components/Employee/Profile/management/ProfileEditForm.js.map +1 -1
  582. package/dist/components/Employee/Profile/management/profileStateMachine.d.ts +1 -0
  583. package/dist/components/Employee/Profile/management/profileStateMachine.js.map +1 -1
  584. package/dist/components/Employee/Profile/onboarding/AdminProfile.d.ts +1 -0
  585. package/dist/components/Employee/Profile/onboarding/AdminProfile.js +6 -6
  586. package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
  587. package/dist/components/Employee/Profile/onboarding/EmployeeProfile.d.ts +1 -0
  588. package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +7 -7
  589. package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js.map +1 -1
  590. package/dist/components/Employee/Profile/onboarding/Profile.d.ts +61 -0
  591. package/dist/components/Employee/Profile/onboarding/Profile.js.map +1 -1
  592. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +37 -0
  593. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -1
  594. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.d.ts +170 -0
  595. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +4 -4
  596. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js.map +1 -1
  597. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/index.d.ts +4 -2
  598. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +140 -1
  599. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -1
  600. package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/index.d.ts +0 -1
  601. package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.d.ts +37 -4
  602. package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.js.map +1 -1
  603. package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.d.ts +130 -0
  604. package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +4 -4
  605. package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js.map +1 -1
  606. package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.d.ts +35 -0
  607. package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js.map +1 -1
  608. package/dist/components/Employee/Profile/shared/useHomeAddressForm/index.d.ts +2 -1
  609. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.d.ts +45 -0
  610. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js.map +1 -1
  611. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +77 -1
  612. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -1
  613. package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.d.ts +43 -0
  614. package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js.map +1 -1
  615. package/dist/components/Employee/Profile/shared/useWorkAddressForm/index.d.ts +2 -1
  616. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.d.ts +42 -0
  617. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js.map +1 -1
  618. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.d.ts +85 -0
  619. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
  620. package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.d.ts +35 -0
  621. package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.js.map +1 -1
  622. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +16 -0
  623. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
  624. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +31 -0
  625. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -1
  626. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.d.ts +1 -0
  627. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
  628. package/dist/components/Employee/StateTaxes/index.d.ts +1 -1
  629. package/dist/components/Employee/StateTaxes/management/StateTaxes.d.ts +24 -0
  630. package/dist/components/Employee/StateTaxes/management/StateTaxes.js.map +1 -1
  631. package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.d.ts +21 -6
  632. package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js +12 -11
  633. package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js.map +1 -1
  634. package/dist/components/Employee/StateTaxes/management/StateTaxesComponents.d.ts +4 -0
  635. package/dist/components/Employee/StateTaxes/management/StateTaxesComponents.js.map +1 -1
  636. package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.d.ts +20 -8
  637. package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +11 -10
  638. package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js.map +1 -1
  639. package/dist/components/Employee/StateTaxes/management/stateTaxesStateMachine.d.ts +1 -0
  640. package/dist/components/Employee/StateTaxes/management/stateTaxesStateMachine.js.map +1 -1
  641. package/dist/components/Employee/StateTaxes/management/useViewDictionary.d.ts +2 -0
  642. package/dist/components/Employee/StateTaxes/management/useViewDictionary.js.map +1 -1
  643. package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.d.ts +22 -0
  644. package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +8 -7
  645. package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js.map +1 -1
  646. package/dist/components/Employee/StateTaxes/onboarding/useViewDictionary.d.ts +2 -0
  647. package/dist/components/Employee/StateTaxes/onboarding/useViewDictionary.js.map +1 -1
  648. package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.d.ts +4 -0
  649. package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js.map +1 -1
  650. package/dist/components/Employee/StateTaxes/shared/index.d.ts +1 -2
  651. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/employeeStateTaxesSchema.d.ts +39 -16
  652. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/employeeStateTaxesSchema.js.map +1 -1
  653. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.d.ts +6 -0
  654. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js.map +1 -1
  655. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMapping.d.ts +4 -9
  656. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMapping.js.map +1 -1
  657. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMeta.d.ts +5 -1
  658. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldProps.d.ts +52 -0
  659. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.d.ts +26 -5
  660. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.js.map +1 -1
  661. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.d.ts +106 -0
  662. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js.map +1 -1
  663. package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/index.d.ts +0 -1
  664. package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/useStateTaxesSummary.d.ts +5 -8
  665. package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/useStateTaxesSummary.js.map +1 -1
  666. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +53 -0
  667. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
  668. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +1 -0
  669. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +7 -6
  670. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
  671. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +47 -0
  672. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -1
  673. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +20 -0
  674. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +10 -9
  675. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
  676. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +2 -0
  677. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -1
  678. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +48 -0
  679. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -1
  680. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.d.ts +1 -0
  681. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +3 -2
  682. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
  683. package/dist/components/Employee/Terminations/types.d.ts +16 -0
  684. package/dist/components/Employee/WorkAddress/management/WorkAddress.d.ts +21 -0
  685. package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
  686. package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.d.ts +17 -6
  687. package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js +17 -16
  688. package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js.map +1 -1
  689. package/dist/components/Employee/WorkAddress/management/WorkAddressComponents.d.ts +3 -0
  690. package/dist/components/Employee/WorkAddress/management/WorkAddressComponents.js.map +1 -1
  691. package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.d.ts +20 -0
  692. package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.js.map +1 -1
  693. package/dist/components/Employee/WorkAddress/management/WorkAddressView.d.ts +2 -0
  694. package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +7 -7
  695. package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
  696. package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.d.ts +2 -0
  697. package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.js.map +1 -1
  698. package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.d.ts +46 -7
  699. package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js.map +1 -1
  700. package/dist/components/Employee/WorkAddress/management/workAddressStateMachine.d.ts +1 -0
  701. package/dist/components/Employee/WorkAddress/management/workAddressStateMachine.js.map +1 -1
  702. package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/index.d.ts +0 -1
  703. package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.d.ts +21 -4
  704. package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.js.map +1 -1
  705. package/dist/components/Employee/exports/employeeManagement.d.ts +7 -4
  706. package/dist/components/Employee/exports/employeeManagement.js +26 -26
  707. package/dist/components/Employee/exports/employeeOnboarding.d.ts +11 -9
  708. package/dist/components/Employee/exports/employeeOnboarding.js +20 -16
  709. package/dist/components/Employee/exports/employeeOnboarding.js.map +1 -1
  710. package/dist/components/Employee/index.d.ts +0 -1
  711. package/dist/components/Flow/FlowHeader.js +4 -3
  712. package/dist/components/Flow/FlowHeader.js.map +1 -1
  713. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +19 -18
  714. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  715. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +8 -7
  716. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  717. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +5 -4
  718. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  719. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +9 -8
  720. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
  721. package/dist/components/Payroll/Dismissal/index.d.ts +2 -0
  722. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +5 -5
  723. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +10 -10
  724. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +2 -1
  725. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
  726. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +1 -1
  727. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +2 -3
  728. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
  729. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +8 -7
  730. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  731. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +18 -18
  732. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +295 -289
  733. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  734. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +18 -18
  735. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +15 -15
  736. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +4 -4
  737. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +3 -2
  738. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  739. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +3 -2
  740. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  741. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +2 -1
  742. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
  743. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +3 -2
  744. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
  745. package/dist/components/Payroll/index.d.ts +2 -0
  746. package/dist/components/Payroll/index.js +24 -22
  747. package/dist/components/Payroll/index.js.map +1 -1
  748. package/dist/components/Payroll/usePreparedPayrollData.js +8 -10
  749. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  750. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js +14 -14
  751. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -1
  752. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +1 -1
  753. package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +8 -8
  754. package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +4 -4
  755. package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +4 -4
  756. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js +36 -34
  757. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
  758. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +4 -4
  759. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +16 -16
  760. package/dist/components/TimeOff/index.d.ts +6 -2
  761. package/dist/components/TimeOff/index.js +21 -17
  762. package/dist/components/TimeOff/index.js.map +1 -1
  763. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +1 -1
  764. package/dist/components/index.d.ts +1 -6
  765. package/dist/contexts/GustoProvider/GustoProvider.d.ts +28 -2
  766. package/dist/contexts/GustoProvider/GustoProvider.js +10 -11
  767. package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
  768. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +42 -2
  769. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +1 -1
  770. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  771. package/dist/contexts/GustoProvider/SDKI18next.d.ts +1 -1
  772. package/dist/contexts/GustoProvider/SDKI18next.js.map +1 -1
  773. package/dist/contexts/GustoProvider/index.d.ts +1 -3
  774. package/dist/contexts/ThemeProvider/ThemeProvider.d.ts +5 -1
  775. package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
  776. package/dist/contexts/ThemeProvider/customRender.d.ts +1 -0
  777. package/dist/contexts/ThemeProvider/index.d.ts +0 -1
  778. package/dist/contexts/ThemeProvider/theme.d.ts +7 -101
  779. package/dist/contexts/ThemeProvider/theme.js +58 -64
  780. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  781. package/dist/contexts/ThemeProvider/types.d.ts +181 -0
  782. package/dist/contexts/ThemeProvider/useTheme.d.ts +4 -0
  783. package/dist/contexts/ThemeProvider/useTheme.js.map +1 -1
  784. package/dist/contexts/index.d.ts +1 -1
  785. package/dist/i18n/I18n.js +0 -1
  786. package/dist/i18n/I18n.js.map +1 -1
  787. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +56 -40
  788. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
  789. package/dist/index.d.ts +20 -17
  790. package/dist/index.js +228 -158
  791. package/dist/index.js.map +1 -1
  792. package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +13 -11
  793. package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
  794. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +17 -15
  795. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
  796. package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +11 -9
  797. package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
  798. package/dist/partner-hook-utils/form/fields/SelectHookField.js +15 -13
  799. package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
  800. package/dist/partner-hook-utils/form/fields/SwitchHookField.js +13 -11
  801. package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
  802. package/dist/partner-hook-utils/form/fields/TextInputHookField.js +8 -6
  803. package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
  804. package/dist/partner-hook-utils/form/fields/index.d.ts +2 -0
  805. package/dist/partner-hook-utils/form/index.d.ts +1 -1
  806. package/dist/shared/constants.d.ts +5 -3
  807. package/dist/shared/constants.js +0 -1
  808. package/dist/shared/constants.js.map +1 -1
  809. package/dist/style.css +1 -1
  810. package/dist/types/i18next.d.ts +9 -32
  811. package/docs/reference/endpoint-inventory.json +322 -1101
  812. package/package.json +20 -17
  813. package/dist/components/Company/index.js +0 -37
  814. package/dist/components/Company/index.js.map +0 -1
  815. package/dist/components/Contractor/index.js +0 -29
  816. package/dist/components/Contractor/index.js.map +0 -1
  817. package/dist/components/Employee/Compensation/management/CompensationEditJobForm/index.d.ts +0 -3
  818. package/dist/components/Employee/Deductions/shared/index.d.ts +0 -8
  819. package/dist/components/Employee/Documents/shared/index.d.ts +0 -3
  820. package/dist/components/Employee/FederalTaxes/onboarding/index.d.ts +0 -2
  821. package/dist/components/Employee/HomeAddress/shared/index.d.ts +0 -3
  822. package/dist/components/Employee/Paystubs/shared/index.d.ts +0 -3
  823. package/dist/components/Employee/Taxes/Actions.d.ts +0 -1
  824. package/dist/components/Employee/Taxes/Actions.js +0 -14
  825. package/dist/components/Employee/Taxes/Actions.js.map +0 -1
  826. package/dist/components/Employee/Taxes/FederalForm.d.ts +0 -12
  827. package/dist/components/Employee/Taxes/FederalForm.js +0 -109
  828. package/dist/components/Employee/Taxes/FederalForm.js.map +0 -1
  829. package/dist/components/Employee/Taxes/FederalHead.d.ts +0 -1
  830. package/dist/components/Employee/Taxes/FederalHead.js +0 -25
  831. package/dist/components/Employee/Taxes/FederalHead.js.map +0 -1
  832. package/dist/components/Employee/Taxes/StateForm.d.ts +0 -6
  833. package/dist/components/Employee/Taxes/StateForm.js +0 -35
  834. package/dist/components/Employee/Taxes/StateForm.js.map +0 -1
  835. package/dist/components/Employee/Taxes/Taxes.d.ts +0 -13
  836. package/dist/components/Employee/Taxes/Taxes.js +0 -133
  837. package/dist/components/Employee/Taxes/Taxes.js.map +0 -1
  838. package/dist/components/Employee/Taxes/index.d.ts +0 -2
  839. package/dist/components/Employee/Taxes/useTaxes.d.ts +0 -8
  840. package/dist/components/Employee/Taxes/useTaxes.js +0 -23
  841. package/dist/components/Employee/Taxes/useTaxes.js.map +0 -1
  842. package/dist/components/Employee/Terminations/TerminationFlow/index.d.ts +0 -3
  843. package/dist/components/Employee/Terminations/TerminationsData.d.ts +0 -6
  844. package/dist/components/Employee/Terminations/index.d.ts +0 -8
  845. package/dist/components/Employee/WorkAddress/shared/index.d.ts +0 -3
  846. package/dist/components/Employee/index.js +0 -49
  847. package/dist/components/Employee/index.js.map +0 -1
  848. package/dist/contexts/GustoApiProvider/index.d.ts +0 -3
  849. package/dist/i18n/en/Employee.Taxes.json.js +0 -58
  850. package/dist/i18n/en/Employee.Taxes.json.js.map +0 -1
@@ -5,6 +5,18 @@ import { MinimumWage } from '@gusto/embedded-api-v-2025-11-15/models/components/
5
5
  import { CompensationOptionalFieldsToRequire, CompensationFormData } from './compensationSchema';
6
6
  import { TitleField, FlsaStatusField, RateField, PaymentUnitField, AdjustForMinimumWageField, MinimumWageIdField, EffectiveDateField } from './fields';
7
7
  import { BaseFormHookReady, FieldsMetadata, HookLoadingResult, HookSubmitResult } from '../../../../../partner-hook-utils/types';
8
+ /**
9
+ * Optional values supplied to {@link useCompensationForm}'s `actions.onSubmit` at submit time.
10
+ *
11
+ * @remarks
12
+ * Use these to override hook-construction props when an ID isn't known at
13
+ * mount — most commonly the **onboarding stub-fill** chain, where `useJobForm`
14
+ * creates the parent job and returns the auto-created stub compensation, and
15
+ * the IDs and version are threaded into this hook's `onSubmit` to PUT the
16
+ * stub.
17
+ *
18
+ * @public
19
+ */
8
20
  export interface CompensationSubmitOptions {
9
21
  /** Override jobId — required when creating a compensation if not configured at hook construction (e.g. when the parent job was just created in the same submit chain). */
10
22
  jobId?: string;
@@ -26,45 +38,94 @@ export interface CompensationSubmitOptions {
26
38
  */
27
39
  effectiveDate?: string;
28
40
  }
41
+ /**
42
+ * Configuration options for {@link useCompensationForm}.
43
+ *
44
+ * @remarks
45
+ * Presence or absence of `compensationId` selects the API verb — see the
46
+ * `compensationId` field description. `employeeId` is optional so the hook
47
+ * can be composed alongside an employee-creation step. `jobId` is optional in
48
+ * update mode (derived from the loaded compensation) and required in create
49
+ * mode (scopes the POST); supply it at submit time via
50
+ * {@link CompensationSubmitOptions.jobId} when the parent job is created in
51
+ * the same submit chain.
52
+ *
53
+ * @public
54
+ */
29
55
  export interface UseCompensationFormProps {
56
+ /** UUID of the employee whose compensation is being created or edited. Drives data fetching for derived helpers (jobs list, work address, minimum wages). May be omitted when composing alongside an employee-creation step. */
30
57
  employeeId?: string;
31
58
  /** The parent job's UUID. Required in create mode (scopes `POST /v1/jobs/:jobId/compensations`). Optional in update mode — the parent job is derived from the loaded compensation. */
32
59
  jobId?: string;
33
60
  /** Present → update mode (PUT /v1/compensations/:id). Omitted → create mode (POST /v1/jobs/:jobId/compensations). */
34
61
  compensationId?: string;
62
+ /** Override fields that are optional on a given mode to be required. See {@link CompensationOptionalFieldsToRequire}. */
35
63
  optionalFieldsToRequire?: CompensationOptionalFieldsToRequire;
64
+ /** Pre-fill form values. Server data takes precedence on update mode. */
36
65
  defaultValues?: Partial<CompensationFormData>;
66
+ /** Passed through to react-hook-form. Defaults to `'onSubmit'`. */
37
67
  validationMode?: UseFormProps['mode'];
68
+ /** Auto-focus the first invalid field on submit. Set to `false` when using `composeSubmitHandler` so submit-time focus is coordinated across multiple forms. Defaults to `true`. */
38
69
  shouldFocusError?: boolean;
39
70
  /**
40
71
  * When `false`, hides `Fields.EffectiveDate` (becomes `undefined`) and
41
72
  * removes `effectiveDate` from schema validation. In this mode the hook
42
73
  * does not read any form value at submit time — `effective_date` is
43
74
  * omitted from the request body unless explicitly supplied via
44
- * `CompensationSubmitOptions.effectiveDate`. This matches the
45
- * options-only convention of `useWorkAddressForm` /
46
- * `useHomeAddressForm` / `useJobForm`, and means the
75
+ * {@link CompensationSubmitOptions.effectiveDate}. This matches the
76
+ * options-only convention of other form hooks, and means the
47
77
  * `willDeleteSecondaryJobs` carve-out's form-state side effects do not
48
78
  * leak onto the wire (there is no field to render them in anyway).
49
79
  * Defaults to `true`.
50
80
  */
51
81
  withEffectiveDateField?: boolean;
52
82
  }
83
+ /**
84
+ * Pre-bound field components exposed on `useCompensationForm().form.Fields`.
85
+ *
86
+ * @remarks
87
+ * Each property is either the field component or `undefined`. A field is
88
+ * `undefined` when conditions for rendering it aren't met — see each member
89
+ * for its visibility rule. Always null-check conditional fields (e.g.
90
+ * `{Fields.FlsaStatus && <Fields.FlsaStatus ... />}`) before rendering.
91
+ *
92
+ * @public
93
+ */
53
94
  export interface CompensationFormFields {
95
+ /** Title text input. Always available. Optional in both modes unless `optionalFieldsToRequire` requires it. */
54
96
  Title: typeof TitleField;
97
+ /** FLSA classification select. `undefined` when the status is not user-editable (e.g. secondary jobs that must match the primary). */
55
98
  FlsaStatus: typeof FlsaStatusField | undefined;
99
+ /** Compensation amount input. `undefined` for commission-only FLSA statuses, which don't accept a partner-supplied rate. */
56
100
  Rate: typeof RateField | undefined;
101
+ /** Payment unit select. `undefined` for commission-only FLSA statuses (the hook forces `paymentUnit=Year`). */
57
102
  PaymentUnit: typeof PaymentUnitField | undefined;
103
+ /** Minimum-wage adjustment checkbox. `undefined` unless `flsaStatus === Nonexempt`, the employee's work location has minimum wages, and the state supports tip credits. */
58
104
  AdjustForMinimumWage: typeof AdjustForMinimumWageField | undefined;
105
+ /** Minimum-wage selection. `undefined` unless `Fields.AdjustForMinimumWage` is rendered and checked. */
59
106
  MinimumWageId: typeof MinimumWageIdField | undefined;
107
+ /** Effective-date picker. `undefined` when `withEffectiveDateField: false`; supply the value via `CompensationSubmitOptions.effectiveDate` in that mode. */
60
108
  EffectiveDate: typeof EffectiveDateField | undefined;
61
109
  }
110
+ /**
111
+ * Ready-state shape returned by {@link useCompensationForm} once data has loaded.
112
+ *
113
+ * @remarks
114
+ * Discriminated by `isLoading: false`. Extends {@link BaseFormHookReady} with
115
+ * the compensation-specific `data`, `status`, `actions`, and `form.Fields`
116
+ * shape. Static, entity-derived values live under `data.*`; reactive values
117
+ * that flip with form input live under `status.*`.
118
+ *
119
+ * @public
120
+ */
62
121
  export interface UseCompensationFormReady extends BaseFormHookReady<FieldsMetadata, CompensationFormData, CompensationFormFields> {
122
+ /** Compensation-specific data payload: the loaded compensation, the parent job, available minimum wages, and effective-date bounds. */
63
123
  data: {
64
124
  /** The compensation row loaded for update; `null` in create mode. */
65
125
  compensation: Compensation | null;
66
126
  /** The parent job. In update mode it's derived from the loaded compensation; in create mode it's looked up by `jobId`. `null` if neither resolves. */
67
127
  currentJob: Job | null;
128
+ /** Minimum wages available at the employee's active work location. Empty when no location is set or no minimums are defined. */
68
129
  minimumWages: MinimumWage[];
69
130
  /** Lower bound for `effectiveDate` (typically the parent job's hire date). */
70
131
  minimumEffectiveDate: string | null;
@@ -73,8 +134,11 @@ export interface UseCompensationFormReady extends BaseFormHookReady<FieldsMetada
73
134
  /** True when at least one future-dated compensation already exists for this job. */
74
135
  hasPendingFutureCompensation: boolean;
75
136
  };
137
+ /** Submission state and reactive flags derived from current form input. `isPending` is `true` while a create/update mutation is in flight; `mode` reflects whether the next submit will create or update; the `show*Alert` flags drive FLSA-specific inline warnings. */
76
138
  status: {
139
+ /** `true` while a create or update mutation is in flight. */
77
140
  isPending: boolean;
141
+ /** Reflects whether the next submit will POST a new compensation or PUT an existing one. */
78
142
  mode: 'create' | 'update';
79
143
  /**
80
144
  * True when submitting the form right now would delete the employee's
@@ -114,16 +178,99 @@ export interface UseCompensationFormReady extends BaseFormHookReady<FieldsMetada
114
178
  showCommissionMinimumWageAlert: boolean;
115
179
  /**
116
180
  * True when the current `flsaStatus` is `OWNER` (Owner's draw). Render
117
- * an informational alert reminding partners that the IRS requires
118
- * S-corp owners to pay themselves a reasonable salary for similar
119
- * work before taking distributions.
181
+ * an informational alert noting that the IRS requires S-corp owners to
182
+ * pay themselves a reasonable salary for similar work before taking
183
+ * distributions.
120
184
  */
121
185
  showOwnerSalaryAlert: boolean;
122
186
  };
187
+ /** Submit actions exposed by the hook. */
123
188
  actions: {
189
+ /** Validates the form, runs the appropriate create/update mutation, and resolves to a {@link HookSubmitResult} containing the saved compensation. Resolves to `undefined` on validation failure or mutation error. Accepts {@link CompensationSubmitOptions} for threading IDs/version into the onboarding stub-fill chain. */
124
190
  onSubmit: (options?: CompensationSubmitOptions) => Promise<HookSubmitResult<Compensation> | undefined>;
125
191
  };
126
192
  }
193
+ /**
194
+ * Headless hook for creating or updating a compensation row on a job — FLSA classification, pay rate, payment unit, effective date, and optional minimum-wage adjustment.
195
+ *
196
+ * @remarks
197
+ * Companion hook to `useJobForm`. Jobs and their compensations are separate
198
+ * entities in the Gusto API and this hook focuses exclusively on the
199
+ * compensation side. Presence of `compensationId` selects the verb:
200
+ *
201
+ * | Hook config / submit options | Mode | API call |
202
+ * | ---------------------------- | ---- | -------- |
203
+ * | `{ jobId, compensationId }` | update | `PUT /v1/compensations/:compensationId` (with `version`) |
204
+ * | `{ jobId }` (no `compensationId`) | create | `POST /v1/jobs/:jobId/compensations` |
205
+ * | `{ employeeId }` + submit `{ jobId, compensationId, compensationVersion }` | update | `PUT /v1/compensations/:compensationId` (with the supplied `version`) |
206
+ * | `{ employeeId }` + submit `{ jobId }` (no `compensationId`) | create | `POST /v1/jobs/:options.jobId/compensations` |
207
+ *
208
+ * Use the submit-options form for the **onboarding stub-fill** chain: after
209
+ * `useJobForm.actions.onSubmit()` creates a job, capture the auto-created
210
+ * compensation's UUID and version from the response, and pass them as
211
+ * `{ jobId, compensationId, compensationVersion }` to this hook's `onSubmit`
212
+ * to PUT the stub.
213
+ *
214
+ * The hook exposes several derived helpers for driving UX — static
215
+ * entity-derived values under `data.*` (effective-date bounds, pending
216
+ * future compensations) and reactive flags under `status.*` (the
217
+ * `willDeleteSecondaryJobs` carve-out, plus FLSA-specific alerts for
218
+ * commission-only and owner classifications). When
219
+ * `willDeleteSecondaryJobs` is `true` in update mode, the hook also locks
220
+ * the `effectiveDate` field (forces to today, renders disabled) until the
221
+ * FLSA selection is reverted.
222
+ *
223
+ * @param input - {@link UseCompensationFormProps} — `employeeId`, `jobId`, `compensationId` (toggle create/update), required-field overrides, default values, and which fields the hook renders.
224
+ * @returns A {@link HookLoadingResult} while data is loading, or a {@link UseCompensationFormReady} once ready.
225
+ * @public
226
+ *
227
+ * @example
228
+ * ```tsx
229
+ * import { useCompensationForm, SDKFormProvider } from '@gusto/embedded-react-sdk'
230
+ *
231
+ * function CompensationForm({ employeeId, jobId }: { employeeId: string; jobId: string }) {
232
+ * const comp = useCompensationForm({ employeeId, jobId })
233
+ * if (comp.isLoading) return null
234
+ *
235
+ * const { Fields } = comp.form
236
+ * return (
237
+ * <form onSubmit={e => { e.preventDefault(); comp.actions.onSubmit() }}>
238
+ * <SDKFormProvider formHookResult={comp}>
239
+ * {Fields.FlsaStatus && <Fields.FlsaStatus label="Employee type" />}
240
+ * <Fields.Rate label="Compensation amount" />
241
+ * <Fields.PaymentUnit label="Payment unit" />
242
+ * {Fields.EffectiveDate && <Fields.EffectiveDate label="Effective date" />}
243
+ * </SDKFormProvider>
244
+ * {comp.status.willDeleteSecondaryJobs && (
245
+ * <p>Saving will remove this employee's secondary jobs.</p>
246
+ * )}
247
+ * <button type="submit" disabled={comp.status.isPending}>Save</button>
248
+ * </form>
249
+ * )
250
+ * }
251
+ * ```
252
+ */
127
253
  export declare function useCompensationForm({ employeeId, jobId, compensationId, optionalFieldsToRequire, defaultValues: partnerDefaults, validationMode, shouldFocusError, withEffectiveDateField, }: UseCompensationFormProps): HookLoadingResult | UseCompensationFormReady;
254
+ /**
255
+ * Discriminated union returned by {@link useCompensationForm} — either the loading state or the ready state.
256
+ *
257
+ * @remarks
258
+ * Use this type when threading the hook result through helpers (e.g.
259
+ * presentational components). Discriminate on `isLoading` to narrow to
260
+ * {@link UseCompensationFormReady}.
261
+ *
262
+ * @public
263
+ */
128
264
  export type UseCompensationFormResult = HookLoadingResult | UseCompensationFormReady;
265
+ /**
266
+ * Metadata for each {@link useCompensationForm} field, exposed on `form.fieldsMetadata`.
267
+ *
268
+ * @remarks
269
+ * Includes per-field `isDisabled`, `isRequired`, and the dynamic option list
270
+ * for select fields (`flsaStatus`, `paymentUnit`, `minimumWageId`).
271
+ * `effectiveDate` additionally carries `minDate` / `maxDate` derived from
272
+ * the parent job's hire date and any pending future compensation.
273
+ *
274
+ * @public
275
+ */
129
276
  export type CompensationFieldsMetadata = UseCompensationFormReady['form']['fieldsMetadata'];
@@ -1 +1 @@
1
- {"version":3,"file":"useCompensationForm.js","sources":["../../../../../../src/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef } from 'react'\nimport { useForm, useWatch } from 'react-hook-form'\nimport type { UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type {\n Compensation,\n PaymentUnit,\n} from '@gusto/embedded-api-v-2025-11-15/models/components/compensation'\nimport type { Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job'\nimport type { FlsaStatusType } from '@gusto/embedded-api-v-2025-11-15/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api-v-2025-11-15/models/components/minimumwage'\nimport { useJobsAndCompensationsGetJobs } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsGetJobs'\nimport { GetV1EmployeesEmployeeIdJobsQueryParamInclude } from '@gusto/embedded-api-v-2025-11-15/models/operations/getv1employeesemployeeidjobs'\nimport { useJobsAndCompensationsCreateCompensationMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsCreateCompensation'\nimport { useJobsAndCompensationsUpdateCompensationMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsUpdateCompensation'\nimport { useLocationsGetMinimumWages } from '@gusto/embedded-api-v-2025-11-15/react-query/locationsGetMinimumWages'\nimport { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api-v-2025-11-15/react-query/employeeAddressesGetWorkAddresses'\nimport { useEmployeesGet } from '@gusto/embedded-api-v-2025-11-15/react-query/employeesGet'\nimport {\n createCompensationSchema,\n type CompensationOptionalFieldsToRequire,\n type CompensationFormData,\n type CompensationFormOutputs,\n} from './compensationSchema'\nimport {\n TitleField,\n FlsaStatusField,\n RateField,\n PaymentUnitField,\n AdjustForMinimumWageField,\n MinimumWageIdField,\n EffectiveDateField,\n} from './fields'\nimport { withOptions } from '@/partner-hook-utils/form/withOptions'\nimport { createGetFormSubmissionValues } from '@/partner-hook-utils/form/getFormSubmissionValues'\nimport { useDeriveFieldsMetadata } from '@/partner-hook-utils/form/useDeriveFieldsMetadata'\nimport { useHookFormInternals } from '@/partner-hook-utils/form/useHookFormInternals'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type {\n BaseFormHookReady,\n FieldsMetadata,\n HookLoadingResult,\n HookSubmitResult,\n} from '@/partner-hook-utils/types'\nimport { FlsaStatus, PAY_PERIODS, TIP_CREDITS_UNSUPPORTED_STATES } from '@/shared/constants'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { addDays, formatDateToStringDate } from '@/helpers/dateFormatting'\n\nexport interface CompensationSubmitOptions {\n /** Override jobId — required when creating a compensation if not configured at hook construction (e.g. when the parent job was just created in the same submit chain). */\n jobId?: string\n /** Override compensationId — when present, forces update (PUT) routing regardless of hook construction. */\n compensationId?: string\n /**\n * Compensation version for optimistic locking on PUT. Required when forcing\n * update routing post-create (e.g. updating the auto-created stub returned\n * from `POST /v1/employees/:id/jobs`). When omitted, the hook reads the\n * version from its cached `currentCompensation`.\n */\n compensationVersion?: string\n /**\n * Supply `effectiveDate` at submit time. When `withEffectiveDateField`\n * is `true`, this overrides the form's value. When `withEffectiveDateField`\n * is `false`, this is the only way to put `effective_date` on the wire —\n * the form value is not read in that mode (matching the options-only\n * convention of `useWorkAddressForm` / `useHomeAddressForm` / `useJobForm`).\n */\n effectiveDate?: string\n}\n\nexport interface UseCompensationFormProps {\n employeeId?: string\n /** The parent job's UUID. Required in create mode (scopes `POST /v1/jobs/:jobId/compensations`). Optional in update mode — the parent job is derived from the loaded compensation. */\n jobId?: string\n /** Present → update mode (PUT /v1/compensations/:id). Omitted → create mode (POST /v1/jobs/:jobId/compensations). */\n compensationId?: string\n optionalFieldsToRequire?: CompensationOptionalFieldsToRequire\n defaultValues?: Partial<CompensationFormData>\n validationMode?: UseFormProps['mode']\n shouldFocusError?: boolean\n /**\n * When `false`, hides `Fields.EffectiveDate` (becomes `undefined`) and\n * removes `effectiveDate` from schema validation. In this mode the hook\n * does not read any form value at submit time — `effective_date` is\n * omitted from the request body unless explicitly supplied via\n * `CompensationSubmitOptions.effectiveDate`. This matches the\n * options-only convention of `useWorkAddressForm` /\n * `useHomeAddressForm` / `useJobForm`, and means the\n * `willDeleteSecondaryJobs` carve-out's form-state side effects do not\n * leak onto the wire (there is no field to render them in anyway).\n * Defaults to `true`.\n */\n withEffectiveDateField?: boolean\n}\n\nexport interface CompensationFormFields {\n Title: typeof TitleField\n FlsaStatus: typeof FlsaStatusField | undefined\n Rate: typeof RateField | undefined\n PaymentUnit: typeof PaymentUnitField | undefined\n AdjustForMinimumWage: typeof AdjustForMinimumWageField | undefined\n MinimumWageId: typeof MinimumWageIdField | undefined\n EffectiveDate: typeof EffectiveDateField | undefined\n}\n\nexport interface UseCompensationFormReady extends BaseFormHookReady<\n FieldsMetadata,\n CompensationFormData,\n CompensationFormFields\n> {\n data: {\n /** The compensation row loaded for update; `null` in create mode. */\n compensation: Compensation | null\n /** The parent job. In update mode it's derived from the loaded compensation; in create mode it's looked up by `jobId`. `null` if neither resolves. */\n currentJob: Job | null\n minimumWages: MinimumWage[]\n /** Lower bound for `effectiveDate` (typically the parent job's hire date). */\n minimumEffectiveDate: string | null\n /** Upper bound for `effectiveDate` — the next scheduled future compensation's effective date, when one exists. */\n maximumEffectiveDate: string | null\n /** True when at least one future-dated compensation already exists for this job. */\n hasPendingFutureCompensation: boolean\n }\n status: {\n isPending: boolean\n mode: 'create' | 'update'\n /**\n * True when submitting the form right now would delete the employee's\n * secondary jobs server-side (the \"carve-out\" branch). Reactive:\n * derived from the current `flsaStatus` form value, the loaded\n * compensation, and the other-jobs count, so this flips as you change\n * inputs.\n *\n * Conditions: update mode, the loaded compensation is Nonexempt, the\n * form's `flsaStatus` has been changed to a non-Nonexempt value, and\n * the employee has at least one secondary job.\n *\n * While this flag is true the hook also takes the `effectiveDate`\n * field over: it forces the form value to today (so submits route\n * through a PUT that immediately deletes secondaries) and exposes\n * `fieldsMetadata.effectiveDate.isDisabled = true` so `Fields.EffectiveDate`\n * renders as disabled. On revert (FLSA back to Nonexempt) the prior\n * `effectiveDate` is restored. Render an inline warning keyed off\n * this flag — no separate confirmation step is needed.\n */\n willDeleteSecondaryJobs: boolean\n /**\n * True when the current `flsaStatus` is `COMMISSION_ONLY_EXEMPT`\n * (Commission Only/No Overtime). Render the federal-minimum-pay\n * warning alert when this flag is true. While this flag is true,\n * `Fields.Rate` and `Fields.PaymentUnit` are also `undefined` (the\n * hook forces `rate=0`, `paymentUnit=YEAR` on the form values).\n */\n showCommissionFederalMinimumPayAlert: boolean\n /**\n * True when the current `flsaStatus` is `COMMISSION_ONLY_NONEXEMPT`\n * (Commission Only/Eligible for overtime). Render the local-minimum-wage\n * warning alert when this flag is true. While this flag is true,\n * `Fields.Rate` and `Fields.PaymentUnit` are also `undefined` (the\n * hook forces `rate=0`, `paymentUnit=YEAR` on the form values).\n */\n showCommissionMinimumWageAlert: boolean\n /**\n * True when the current `flsaStatus` is `OWNER` (Owner's draw). Render\n * an informational alert reminding partners that the IRS requires\n * S-corp owners to pay themselves a reasonable salary for similar\n * work before taking distributions.\n */\n showOwnerSalaryAlert: boolean\n }\n actions: {\n onSubmit: (\n options?: CompensationSubmitOptions,\n ) => Promise<HookSubmitResult<Compensation> | undefined>\n }\n}\n\nfunction resolveCompAndJob(\n jobs: Job[] | undefined,\n compensationId: string | undefined,\n jobId: string | undefined,\n): { compensation: Compensation | null; job: Job | null } {\n if (!jobs) return { compensation: null, job: null }\n if (compensationId) {\n for (const job of jobs) {\n const compensation = job.compensations?.find(c => c.uuid === compensationId)\n if (compensation) return { compensation, job }\n }\n // If the comp isn't in any job's compensations list, still try to resolve\n // the job by jobId so callers can check job metadata (e.g. job.primary).\n const fallbackJob = jobId ? (jobs.find(j => j.uuid === jobId) ?? null) : null\n return { compensation: null, job: fallbackJob }\n }\n if (jobId) return { compensation: null, job: jobs.find(j => j.uuid === jobId) ?? null }\n return { compensation: null, job: null }\n}\n\nfunction findPrimaryFlsaStatus(jobs: Job[] | undefined): FlsaStatusType | null {\n if (!jobs) return null\n for (const job of jobs) {\n if (!job.primary) continue\n const compensation = job.compensations?.find(c => c.uuid === job.currentCompensationUuid)\n if (compensation?.flsaStatus) return compensation.flsaStatus\n }\n return null\n}\n\nfunction findFutureCompensations(job: Job | null): Compensation[] {\n if (!job?.compensations) return []\n const today = todayISO()\n return job.compensations.filter(c => c.effectiveDate !== undefined && c.effectiveDate > today)\n}\n\nfunction earliestEffectiveDate(comps: Compensation[]): string | null {\n if (comps.length === 0) return null\n return comps.reduce<string | null>((min, c) => {\n const d = c.effectiveDate\n if (!d) return min\n if (!min || d < min) return d\n return min\n }, null)\n}\n\nconst flsaStatusEntries: FlsaStatusType[] = [\n FlsaStatus.EXEMPT,\n FlsaStatus.SALARIED_NONEXEMPT,\n FlsaStatus.NONEXEMPT,\n FlsaStatus.OWNER,\n FlsaStatus.COMMISSION_ONLY_EXEMPT,\n FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n]\n\nconst flsaOptions = flsaStatusEntries.map(status => ({ value: status, label: status }))\n\nconst paymentUnitEntries: PaymentUnit[] = [\n PAY_PERIODS.HOUR,\n PAY_PERIODS.WEEK,\n PAY_PERIODS.MONTH,\n PAY_PERIODS.YEAR,\n PAY_PERIODS.PAYCHECK,\n]\n\nconst paymentUnitOptions = paymentUnitEntries.map(unit => ({ value: unit, label: unit }))\n\nfunction todayISO(): string {\n return new Date().toISOString().split('T')[0]!\n}\n\nexport function useCompensationForm({\n employeeId,\n jobId,\n compensationId,\n optionalFieldsToRequire,\n defaultValues: partnerDefaults,\n validationMode = 'onSubmit',\n shouldFocusError = true,\n withEffectiveDateField = true,\n}: UseCompensationFormProps): HookLoadingResult | UseCompensationFormReady {\n const jobsQuery = useJobsAndCompensationsGetJobs(\n {\n employeeId: employeeId ?? '',\n // Fetch all effective-dated compensations when editing an existing one so\n // resolveCompAndJob can find the target comp (future-dated comps are\n // omitted from the default response, which only returns the current comp).\n include: compensationId\n ? GetV1EmployeesEmployeeIdJobsQueryParamInclude.AllCompensations\n : undefined,\n },\n { enabled: !!employeeId },\n )\n const addressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId: employeeId ?? '' },\n { enabled: !!employeeId },\n )\n const employeeQuery = useEmployeesGet({ employeeId: employeeId ?? '' }, { enabled: !!employeeId })\n\n const employeeJobs = jobsQuery.data?.jobs\n const workAddresses = addressesQuery.data?.employeeWorkAddressesList\n const currentWorkAddress = workAddresses?.find(address => address.active)\n const locationUuid = currentWorkAddress?.locationUuid\n const employee = employeeQuery.data?.employee\n\n const minWagesQuery = useLocationsGetMinimumWages(\n { locationUuid: locationUuid ?? '' },\n { enabled: !!locationUuid },\n )\n\n const minimumWages = minWagesQuery.data?.minimumWageList ?? []\n\n const { compensation: currentCompensation, job: currentJob } = resolveCompAndJob(\n employeeJobs,\n compensationId,\n jobId,\n )\n\n const otherJobsCount =\n employeeJobs && currentJob ? employeeJobs.filter(j => j.uuid !== currentJob.uuid).length : 0\n\n // Snapshot — written exactly once, on the first render where `employeeJobs`\n // is defined (i.e., the initial `getJobs` query has resolved) — capturing\n // whether the employee already had a primary job at that moment.\n //\n // Used to ignore the API-generated stub primary (FLSA Nonexempt, rate \"0.00\")\n // that briefly appears between the chained job POST and comp PUT during\n // onboarding: `getJobs` invalidates between the two mutations and\n // momentarily includes the stub, which would otherwise flip\n // `isAddingSecondaryJob` to true and hide `Fields.FlsaStatus` mid-submit.\n //\n // In steady-state flows (edit primary, edit secondary, add secondary), the\n // real primary already exists when the query first resolves, so the snapshot\n // is `true` and live `employeeJobs` continues to drive `primaryFlsaStatus`.\n // Recovery for the rare case where a partner mounts before any jobs exist\n // and a primary is created externally mid-form is to remount the hook\n // (e.g., via a `key` change).\n const hadPrimaryAtMountRef = useRef<boolean | null>(null)\n if (hadPrimaryAtMountRef.current === null && employeeJobs !== undefined) {\n hadPrimaryAtMountRef.current = employeeJobs.some(job => job.primary)\n }\n const hadPrimaryAtMount = hadPrimaryAtMountRef.current === true\n\n // FLSA status of the employee's primary job's current compensation, when one\n // exists. Used as a fallback default when adding a *secondary* job/comp so the\n // multi-job classification stays consistent with the primary by default — the\n // user can still override it (when allowed). Null when there was no primary\n // job at the moment the hook first observed `employeeJobs`, or when the\n // primary has no current compensation yet.\n const primaryFlsaStatus = hadPrimaryAtMount ? findPrimaryFlsaStatus(employeeJobs) : null\n\n const hireDate =\n currentJob?.hireDate ??\n // Secondary jobs being created (CompensationAddAnotherJobForm) have no hireDate until the\n // job POST completes. Fall back to the primary job's hireDate so the schema\n // can enforce EFFECTIVE_DATE_BEFORE_HIRE during that window.\n employeeJobs?.find(j => j.primary)?.hireDate ??\n null\n\n // In update mode, exclude the compensation being edited so it doesn't\n // bound `maximumEffectiveDate` to its own current date — that would prevent\n // the user from pushing the pending effective date further out.\n const futureCompensations = findFutureCompensations(currentJob).filter(\n c => c.uuid !== compensationId,\n )\n const hasPendingFutureCompensation = futureCompensations.length > 0\n const maximumEffectiveDate = earliestEffectiveDate(futureCompensations)\n\n const isCreateMode = !compensationId\n const mode = isCreateMode ? 'create' : 'update'\n // Adding a secondary job (the employee already has a primary). The Gusto API\n // only allows secondaries when the primary's current FLSA is Nonexempt, and\n // the secondary itself must match — so the FLSA field is not user-editable\n // in this branch. We force the form value to the primary's FLSA below and\n // hide `Fields.FlsaStatus`.\n // True when adding a brand-new secondary job (not when scheduling a future\n // comp for the primary). The distinction matters: for the primary's future\n // comp, FLSA should be editable; for a secondary, it must match the primary.\n const isAddingSecondaryJob =\n isCreateMode && primaryFlsaStatus === FlsaStatus.NONEXEMPT && currentJob?.primary !== true\n\n // Derive the effective-date floor internally so consumers don't need to wire\n // it up. Rules by mode and job type:\n // create (any job): tomorrow — new comp must be future-dated\n // update, primary: undefined — the carve-out (willDeleteSecondaryJobs) can\n // force effectiveDate to today on a disabled field; enforcing a floor here\n // would produce a spurious EFFECTIVE_DATE_BEFORE_MIN on submit.\n // update, secondary: tomorrow — must be in the future\n // The hire-date lower bound is handled separately in the schema via the\n // `hireDate` option (→ EFFECTIVE_DATE_BEFORE_HIRE), which fires alongside\n // this check so each violation gets its own error message.\n const internalMinEffectiveDate = useMemo(() => {\n if (!withEffectiveDateField) return undefined\n if (!isCreateMode && currentJob?.primary === true) return undefined\n\n return formatDateToStringDate(addDays(new Date(), 1)) ?? undefined\n }, [isCreateMode, currentJob?.primary, withEffectiveDateField])\n\n const [schema, metadataConfig] = useMemo(\n () =>\n createCompensationSchema({\n mode,\n optionalFieldsToRequire,\n hireDate,\n minEffectiveDate: internalMinEffectiveDate,\n withEffectiveDateField,\n }),\n [mode, optionalFieldsToRequire, hireDate, internalMinEffectiveDate, withEffectiveDateField],\n )\n\n const state = currentWorkAddress?.state\n\n // `flsaStatus` is intentionally allowed to be undefined so the field renders\n // an empty placeholder when nothing is provided — partners can choose to\n // seed it via `defaultValues.flsaStatus`. When a `compensation` is loaded we\n // seed from it; for a brand-new secondary job we inherit from the primary's\n // current compensation so multi-job classification stays consistent. The\n // schema enforces requiredness on submit in `create` mode (see\n // `requiredFieldsConfig` in compensationSchema.ts).\n //\n // `title` lives on compensation in the API — `job.title` is a denormalized\n // snapshot of the primary comp's title that can lag behind comp-level edits\n // on secondaries. Seed directly from the loaded compensation so editing in\n // place can't silently re-introduce a stale title from the job record.\n const resolvedDefaults: CompensationFormData = useMemo(\n () => ({\n title: currentCompensation?.title ?? partnerDefaults?.title ?? '',\n // When adding a secondary, the FLSA must match the primary's — force it\n // here (overriding any partner default) so the form submits the right\n // value even though `Fields.FlsaStatus` is hidden.\n flsaStatus: isAddingSecondaryJob\n ? primaryFlsaStatus\n : (currentCompensation?.flsaStatus ??\n partnerDefaults?.flsaStatus ??\n primaryFlsaStatus ??\n undefined),\n rate: Number(currentCompensation?.rate ?? partnerDefaults?.rate ?? 0),\n adjustForMinimumWage:\n currentCompensation?.adjustForMinimumWage ?? partnerDefaults?.adjustForMinimumWage ?? false,\n minimumWageId:\n currentCompensation?.minimumWages?.[0]?.uuid ?? partnerDefaults?.minimumWageId ?? '',\n paymentUnit:\n currentCompensation?.paymentUnit ?? partnerDefaults?.paymentUnit ?? PAY_PERIODS.HOUR,\n effectiveDate: currentCompensation?.effectiveDate ?? partnerDefaults?.effectiveDate ?? null,\n }),\n [currentCompensation, currentJob, partnerDefaults, primaryFlsaStatus, isAddingSecondaryJob],\n )\n\n const formMethods = useForm<CompensationFormData, unknown, CompensationFormOutputs>({\n resolver: zodResolver(schema),\n mode: validationMode,\n shouldFocusError,\n defaultValues: resolvedDefaults,\n values: resolvedDefaults,\n resetOptions: { keepDirtyValues: true },\n })\n\n const { control, getValues, setValue, clearErrors } = formMethods\n const watchedFlsaStatus = useWatch({ control, name: 'flsaStatus' })\n const watchedAdjustForMinimumWage = useWatch({\n control,\n name: 'adjustForMinimumWage',\n })\n\n // Validation rules for `paymentUnit` and `rate` are FLSA-driven, so any\n // prior error on those fields is stale once FLSA changes. RHF doesn't clear\n // them on its own (`setValue` without `shouldValidate` skips the resolver,\n // and reValidate is per-field) — clear eagerly and let the next blur/submit\n // re-establish the error if it still applies.\n useEffect(() => {\n clearErrors(['paymentUnit', 'rate'])\n if (watchedFlsaStatus === FlsaStatus.OWNER) {\n setValue('paymentUnit', PAY_PERIODS.PAYCHECK)\n } else if (\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n ) {\n setValue('paymentUnit', PAY_PERIODS.YEAR)\n setValue('rate', 0)\n } else {\n setValue('paymentUnit', resolvedDefaults.paymentUnit)\n }\n }, [watchedFlsaStatus, setValue, clearErrors, resolvedDefaults.paymentUnit])\n\n // The FLSA status that represents the employee's current classification.\n // In update mode this is the compensation being edited. In create mode\n // `currentCompensation` is null, so fall back to the job's active\n // compensation (identified by currentCompensationUuid) — this lets the\n // secondary-job warning fire even when scheduling a future-dated change.\n const currentJobActiveComp = currentJob\n ? currentJob.compensations?.find(c => c.uuid === currentJob.currentCompensationUuid)\n : undefined\n const effectiveBaseFlsaStatus =\n currentCompensation?.flsaStatus ?? currentJobActiveComp?.flsaStatus ?? null\n\n // True when the user is changing FLSA away from Nonexempt on a job that has\n // secondary jobs — those secondaries will be deleted by the API when the\n // new classification takes effect (immediately in update mode, at the chosen\n // effective date in create mode). Drives the warning and, in update mode\n // only, the effectiveDate-lock side effect below.\n const willDeleteSecondaryJobs =\n effectiveBaseFlsaStatus === FlsaStatus.NONEXEMPT &&\n watchedFlsaStatus !== undefined &&\n watchedFlsaStatus !== FlsaStatus.NONEXEMPT &&\n otherJobsCount > 0\n\n // Carve-out UX — update mode only: while willDeleteSecondaryJobs is active\n // the server deletes secondaries immediately on PUT. Mirror this by forcing\n // `effectiveDate` to today and disabling the field. In create mode the\n // deletion happens at the chosen future date, so we show the warning but\n // leave the date field editable.\n const carveOutActiveRef = useRef(false)\n const priorEffectiveDateRef = useRef<string | null>(null)\n useEffect(() => {\n if (!isCreateMode && willDeleteSecondaryJobs && !carveOutActiveRef.current) {\n priorEffectiveDateRef.current = getValues('effectiveDate') ?? null\n setValue('effectiveDate', todayISO(), { shouldDirty: true, shouldValidate: false })\n carveOutActiveRef.current = true\n } else if (!isCreateMode && !willDeleteSecondaryJobs && carveOutActiveRef.current) {\n setValue('effectiveDate', priorEffectiveDateRef.current ?? null, {\n shouldDirty: true,\n shouldValidate: false,\n })\n priorEffectiveDateRef.current = null\n carveOutActiveRef.current = false\n }\n }, [isCreateMode, willDeleteSecondaryJobs, getValues, setValue])\n\n const updateCompensationMutation = useJobsAndCompensationsUpdateCompensationMutation()\n const createCompensationMutation = useJobsAndCompensationsCreateCompensationMutation()\n\n const isPending = updateCompensationMutation.isPending || createCompensationMutation.isPending\n\n const {\n baseSubmitHandler,\n error: submitError,\n setError: setSubmitError,\n } = useBaseSubmit('CompensationForm')\n\n const queriesForErrors = employeeId\n ? [jobsQuery, addressesQuery, employeeQuery, minWagesQuery]\n : []\n const errorHandling = composeErrorHandler(queriesForErrors, { submitError, setSubmitError })\n\n const isCommissionOnly =\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n const isOwner = watchedFlsaStatus === FlsaStatus.OWNER\n\n // Hide `Fields.FlsaStatus` when the user has no meaningful choice:\n // - update mode editing a secondary whose comp is already Nonexempt\n // (must keep matching the primary), and\n // - create mode while adding a secondary (must inherit primary's FLSA).\n // The first job's create flow and primary-job edits keep the field exposed.\n const isFlsaSelectionEnabled =\n !isAddingSecondaryJob &&\n (watchedFlsaStatus !== FlsaStatus.NONEXEMPT || currentJob?.primary === true || isCreateMode)\n\n const isAdjustMinimumWageEnabled =\n watchedFlsaStatus === FlsaStatus.NONEXEMPT &&\n minimumWages.length > 0 &&\n state !== undefined &&\n !TIP_CREDITS_UNSUPPORTED_STATES.includes(state)\n\n // Min-wage adjustment is only valid for Nonexempt FLSA (and a state that\n // allows tip credit). When the gate flips off — typically because the user\n // changed FLSA away from Nonexempt — `Fields.AdjustForMinimumWage` and\n // `Fields.MinimumWageId` stop rendering, but the underlying form values\n // persist in react-hook-form state. That would leak an\n // `adjust_for_minimum_wage: true` + `minimum_wages: [...]` body on submit\n // (server rejects with \"Minimum wage adjustments only valid for\n // flsa_status: Nonexempt\"). Reset both values to safe defaults so the\n // submitted payload always matches what the user can actually see.\n useEffect(() => {\n if (isAdjustMinimumWageEnabled) return\n if (getValues('adjustForMinimumWage')) {\n setValue('adjustForMinimumWage', false, { shouldDirty: true, shouldValidate: false })\n }\n if (getValues('minimumWageId')) {\n setValue('minimumWageId', '', { shouldDirty: true, shouldValidate: false })\n }\n // Both fields stop rendering once the gate closes — clear errors so a\n // stale one doesn't silently fail the next submit with no visible UI to fix.\n clearErrors(['adjustForMinimumWage', 'minimumWageId'])\n }, [isAdjustMinimumWageEnabled, getValues, setValue, clearErrors])\n\n const minimumWageOptions = minimumWages.map(wage => ({\n value: wage.uuid,\n label: `${wage.wage} - ${wage.authority}: ${wage.notes ?? ''}`,\n }))\n\n const baseMetadata = useDeriveFieldsMetadata(metadataConfig, formMethods.control)\n const effectiveDateMinDate = useMemo(\n () =>\n [internalMinEffectiveDate, hireDate]\n .filter((d): d is string => !!d)\n .reduce<string | null>((max, d) => (!max || d > max ? d : max), null),\n [internalMinEffectiveDate, hireDate],\n )\n const fieldsMetadata = {\n title: baseMetadata.title,\n effectiveDate: {\n ...baseMetadata.effectiveDate,\n isDisabled: willDeleteSecondaryJobs && !isCreateMode,\n minDate: effectiveDateMinDate,\n maxDate: maximumEffectiveDate,\n },\n flsaStatus: withOptions<FlsaStatusType>(\n baseMetadata.flsaStatus,\n flsaOptions,\n flsaStatusEntries,\n ),\n rate: { ...baseMetadata.rate, isDisabled: isCommissionOnly },\n paymentUnit: withOptions<PaymentUnit>(\n { ...baseMetadata.paymentUnit, isDisabled: isOwner || isCommissionOnly },\n paymentUnitOptions,\n paymentUnitEntries,\n ),\n adjustForMinimumWage: {\n ...baseMetadata.adjustForMinimumWage,\n isDisabled: !isAdjustMinimumWageEnabled,\n },\n minimumWageId: withOptions<MinimumWage>(\n baseMetadata.minimumWageId,\n minimumWageOptions,\n minimumWages,\n ),\n }\n\n const onSubmit = async (\n options?: CompensationSubmitOptions,\n ): Promise<HookSubmitResult<Compensation> | undefined> => {\n let submitResult: HookSubmitResult<Compensation> | undefined\n\n await new Promise<void>(resolve => {\n void formMethods.handleSubmit(\n async (data: CompensationFormOutputs) => {\n await baseSubmitHandler(data, async payload => {\n const resolvedJobId = options?.jobId ?? jobId\n const resolvedCompensationId = options?.compensationId ?? compensationId\n const resolvedMode = resolvedCompensationId ? 'update' : 'create'\n\n // When the field is rendered, the validated payload value wins\n // unless an explicit submit-time override is supplied. When the\n // field is hidden (`withEffectiveDateField: false`) we are\n // strictly options-only — matching `useWorkAddressForm` and the\n // hidden-field behavior of `useHomeAddressForm` / `useJobForm`.\n // The carve-out's form-state side effect (force value to today)\n // is therefore inert in the hidden-field path; partners who\n // need a specific date there must supply it via\n // `CompensationSubmitOptions.effectiveDate`.\n const resolvedEffectiveDate = withEffectiveDateField\n ? (options?.effectiveDate ?? payload.effectiveDate ?? undefined)\n : (options?.effectiveDate ?? undefined)\n\n const requestBodyBase = {\n rate: String(payload.rate),\n paymentUnit: payload.paymentUnit,\n flsaStatus: payload.flsaStatus,\n effectiveDate: resolvedEffectiveDate,\n title: payload.title || undefined,\n adjustForMinimumWage: payload.adjustForMinimumWage,\n minimumWages: payload.adjustForMinimumWage ? [{ uuid: payload.minimumWageId }] : [],\n }\n\n let result: Compensation | undefined\n\n if (resolvedMode === 'create') {\n if (!resolvedJobId) {\n throw new SDKInternalError(\n 'jobId is required to create a compensation. Pass it as a hook prop or via submit options.',\n )\n }\n // Schema's `requiredFieldsConfig` guarantees `flsaStatus` is set\n // on create-mode submit; the runtime guard appeases the API\n // request-body type (which requires a non-undefined value on\n // POST, vs. the optional PUT body).\n if (!payload.flsaStatus) {\n throw new SDKInternalError('flsaStatus is required to create a compensation.')\n }\n const createResponse = await createCompensationMutation.mutateAsync({\n request: {\n jobId: resolvedJobId,\n compensationsRequestBody: { ...requestBodyBase, flsaStatus: payload.flsaStatus },\n },\n })\n result = createResponse.compensation\n if (!result) throw new SDKInternalError('Compensation creation failed')\n } else {\n if (!resolvedCompensationId) {\n throw new SDKInternalError(\n 'compensationId is required to update a compensation. Pass it as a hook prop or via submit options.',\n )\n }\n const resolvedVersion =\n options?.compensationVersion ?? (currentCompensation?.version as string | undefined)\n if (!resolvedVersion) {\n throw new SDKInternalError(\n 'compensation version is required to update a compensation. Pass it via submit options when threading post-create, or ensure the compensation is loaded.',\n )\n }\n const updateResponse = await updateCompensationMutation.mutateAsync({\n request: {\n compensationId: resolvedCompensationId,\n compensationsUpdateRequestBody: {\n version: resolvedVersion,\n ...requestBodyBase,\n },\n },\n })\n result = updateResponse.compensation\n if (!result) throw new SDKInternalError('Compensation update failed')\n }\n\n submitResult = { mode: resolvedMode, data: result }\n })\n resolve()\n },\n () => {\n resolve()\n },\n )()\n })\n\n return submitResult\n }\n\n const isDataLoading = employeeId\n ? jobsQuery.isLoading ||\n addressesQuery.isLoading ||\n employeeQuery.isLoading ||\n minWagesQuery.isLoading\n : false\n\n const hookFormInternals = useHookFormInternals(formMethods)\n\n if (isDataLoading || (employeeId && (!employeeJobs || !employee))) {\n return { isLoading: true as const, errorHandling }\n }\n\n return {\n isLoading: false as const,\n data: {\n compensation: currentCompensation,\n currentJob,\n minimumWages,\n minimumEffectiveDate: effectiveDateMinDate,\n maximumEffectiveDate,\n hasPendingFutureCompensation,\n },\n status: {\n isPending,\n mode,\n willDeleteSecondaryJobs,\n showCommissionFederalMinimumPayAlert: watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT,\n showCommissionMinimumWageAlert: watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n showOwnerSalaryAlert: watchedFlsaStatus === FlsaStatus.OWNER,\n },\n actions: { onSubmit },\n errorHandling,\n form: {\n Fields: {\n Title: TitleField,\n FlsaStatus: isFlsaSelectionEnabled ? FlsaStatusField : undefined,\n Rate: isCommissionOnly ? undefined : RateField,\n PaymentUnit: isCommissionOnly ? undefined : PaymentUnitField,\n AdjustForMinimumWage: isAdjustMinimumWageEnabled ? AdjustForMinimumWageField : undefined,\n MinimumWageId:\n isAdjustMinimumWageEnabled && watchedAdjustForMinimumWage\n ? MinimumWageIdField\n : undefined,\n EffectiveDate: withEffectiveDateField ? EffectiveDateField : undefined,\n },\n fieldsMetadata,\n hookFormInternals,\n getFormSubmissionValues: createGetFormSubmissionValues(formMethods, schema),\n },\n }\n}\n\nexport type UseCompensationFormResult = HookLoadingResult | UseCompensationFormReady\nexport type CompensationFieldsMetadata = UseCompensationFormReady['form']['fieldsMetadata']\n"],"names":["resolveCompAndJob","jobs","compensationId","jobId","job","compensation","c","j","findPrimaryFlsaStatus","findFutureCompensations","today","todayISO","earliestEffectiveDate","comps","min","d","flsaStatusEntries","FlsaStatus","flsaOptions","status","paymentUnitEntries","PAY_PERIODS","paymentUnitOptions","unit","useCompensationForm","employeeId","optionalFieldsToRequire","partnerDefaults","validationMode","shouldFocusError","withEffectiveDateField","jobsQuery","useJobsAndCompensationsGetJobs","GetV1EmployeesEmployeeIdJobsQueryParamInclude","addressesQuery","useEmployeeAddressesGetWorkAddresses","employeeQuery","useEmployeesGet","employeeJobs","currentWorkAddress","address","locationUuid","employee","minWagesQuery","useLocationsGetMinimumWages","minimumWages","currentCompensation","currentJob","otherJobsCount","hadPrimaryAtMountRef","useRef","primaryFlsaStatus","hireDate","futureCompensations","hasPendingFutureCompensation","maximumEffectiveDate","isCreateMode","mode","isAddingSecondaryJob","internalMinEffectiveDate","useMemo","formatDateToStringDate","addDays","schema","metadataConfig","createCompensationSchema","state","resolvedDefaults","formMethods","useForm","zodResolver","control","getValues","setValue","clearErrors","watchedFlsaStatus","useWatch","watchedAdjustForMinimumWage","useEffect","currentJobActiveComp","willDeleteSecondaryJobs","carveOutActiveRef","priorEffectiveDateRef","updateCompensationMutation","useJobsAndCompensationsUpdateCompensationMutation","createCompensationMutation","useJobsAndCompensationsCreateCompensationMutation","isPending","baseSubmitHandler","submitError","setSubmitError","useBaseSubmit","errorHandling","composeErrorHandler","isCommissionOnly","isOwner","isFlsaSelectionEnabled","isAdjustMinimumWageEnabled","TIP_CREDITS_UNSUPPORTED_STATES","minimumWageOptions","wage","baseMetadata","useDeriveFieldsMetadata","effectiveDateMinDate","max","fieldsMetadata","withOptions","onSubmit","options","submitResult","resolve","data","payload","resolvedJobId","resolvedCompensationId","resolvedMode","resolvedEffectiveDate","requestBodyBase","result","SDKInternalError","resolvedVersion","isDataLoading","hookFormInternals","useHookFormInternals","TitleField","FlsaStatusField","RateField","PaymentUnitField","AdjustForMinimumWageField","MinimumWageIdField","EffectiveDateField","createGetFormSubmissionValues"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkLA,SAASA,GACPC,GACAC,GACAC,GACwD;AACxD,MAAI,CAACF,EAAM,QAAO,EAAE,cAAc,MAAM,KAAK,KAAA;AAC7C,MAAIC,GAAgB;AAClB,eAAWE,KAAOH,GAAM;AACtB,YAAMI,IAAeD,EAAI,eAAe,KAAK,CAAAE,MAAKA,EAAE,SAASJ,CAAc;AAC3E,UAAIG,EAAc,QAAO,EAAE,cAAAA,GAAc,KAAAD,EAAA;AAAA,IAC3C;AAIA,WAAO,EAAE,cAAc,MAAM,KADTD,IAASF,EAAK,KAAK,OAAKM,EAAE,SAASJ,CAAK,KAAK,OAAQ,KACvC;AAAA,EACpC;AACA,SAAIA,IAAc,EAAE,cAAc,MAAM,KAAKF,EAAK,KAAK,CAAAM,MAAKA,EAAE,SAASJ,CAAK,KAAK,KAAA,IAC1E,EAAE,cAAc,MAAM,KAAK,KAAA;AACpC;AAEA,SAASK,GAAsBP,GAAgD;AAC7E,MAAI,CAACA,EAAM,QAAO;AAClB,aAAWG,KAAOH,GAAM;AACtB,QAAI,CAACG,EAAI,QAAS;AAClB,UAAMC,IAAeD,EAAI,eAAe,KAAK,OAAKE,EAAE,SAASF,EAAI,uBAAuB;AACxF,QAAIC,GAAc,WAAY,QAAOA,EAAa;AAAA,EACpD;AACA,SAAO;AACT;AAEA,SAASI,GAAwBL,GAAiC;AAChE,MAAI,CAACA,GAAK,cAAe,QAAO,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AAoBC,GAAqBvD,CAAW;AAE1D,SAAIqD,MAAkBhG,MAAe,CAACa,KAAgB,CAACI,MAC9C,EAAE,WAAW,IAAe,eAAAkD,GAAA,IAG9B;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,cAAc9C;AAAA,MACd,YAAAC;AAAA,MACA,cAAAF;AAAA,MACA,sBAAsB0D;AAAA,MACtB,sBAAAhD;AAAA,MACA,8BAAAD;AAAA,IAAA;AAAA,IAEF,QAAQ;AAAA,MACN,WAAAiC;AAAA,MACA,MAAA9B;AAAA,MACA,yBAAAuB;AAAA,MACA,sCAAsCL,MAAsB1D,EAAW;AAAA,MACvE,gCAAgC0D,MAAsB1D,EAAW;AAAA,MACjE,sBAAsB0D,MAAsB1D,EAAW;AAAA,IAAA;AAAA,IAEzD,SAAS,EAAE,UAAA0F,GAAA;AAAA,IACX,eAAAf;AAAA,IACA,MAAM;AAAA,MACJ,QAAQ;AAAA,QACN,OAAOgC;AAAA,QACP,YAAY5B,KAAyB6B,KAAkB;AAAA,QACvD,MAAM/B,IAAmB,SAAYgC;AAAA,QACrC,aAAahC,IAAmB,SAAYiC;AAAA,QAC5C,sBAAsB9B,IAA6B+B,KAA4B;AAAA,QAC/E,eACE/B,KAA8BpB,KAC1BoD,KACA;AAAA,QACN,eAAenG,IAAyBoG,KAAqB;AAAA,MAAA;AAAA,MAE/D,gBAAAzB;AAAA,MACA,mBAAAiB;AAAA,MACA,yBAAyBS,GAA8B/D,GAAaL,CAAM;AAAA,IAAA;AAAA,EAC5E;AAEJ;"}
1
+ {"version":3,"file":"useCompensationForm.js","sources":["../../../../../../src/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef } from 'react'\nimport { useForm, useWatch } from 'react-hook-form'\nimport type { UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type {\n Compensation,\n PaymentUnit,\n} from '@gusto/embedded-api-v-2025-11-15/models/components/compensation'\nimport type { Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job'\nimport type { FlsaStatusType } from '@gusto/embedded-api-v-2025-11-15/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api-v-2025-11-15/models/components/minimumwage'\nimport { useJobsAndCompensationsGetJobs } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsGetJobs'\nimport { GetV1EmployeesEmployeeIdJobsQueryParamInclude } from '@gusto/embedded-api-v-2025-11-15/models/operations/getv1employeesemployeeidjobs'\nimport { useJobsAndCompensationsCreateCompensationMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsCreateCompensation'\nimport { useJobsAndCompensationsUpdateCompensationMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsUpdateCompensation'\nimport { useLocationsGetMinimumWages } from '@gusto/embedded-api-v-2025-11-15/react-query/locationsGetMinimumWages'\nimport { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api-v-2025-11-15/react-query/employeeAddressesGetWorkAddresses'\nimport { useEmployeesGet } from '@gusto/embedded-api-v-2025-11-15/react-query/employeesGet'\nimport {\n createCompensationSchema,\n type CompensationOptionalFieldsToRequire,\n type CompensationFormData,\n type CompensationFormOutputs,\n} from './compensationSchema'\nimport {\n TitleField,\n FlsaStatusField,\n RateField,\n PaymentUnitField,\n AdjustForMinimumWageField,\n MinimumWageIdField,\n EffectiveDateField,\n} from './fields'\nimport { withOptions } from '@/partner-hook-utils/form/withOptions'\nimport { createGetFormSubmissionValues } from '@/partner-hook-utils/form/getFormSubmissionValues'\nimport { useDeriveFieldsMetadata } from '@/partner-hook-utils/form/useDeriveFieldsMetadata'\nimport { useHookFormInternals } from '@/partner-hook-utils/form/useHookFormInternals'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type {\n BaseFormHookReady,\n FieldsMetadata,\n HookLoadingResult,\n HookSubmitResult,\n} from '@/partner-hook-utils/types'\nimport { FlsaStatus, PAY_PERIODS, TIP_CREDITS_UNSUPPORTED_STATES } from '@/shared/constants'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { addDays, formatDateToStringDate } from '@/helpers/dateFormatting'\n\n/**\n * Optional values supplied to {@link useCompensationForm}'s `actions.onSubmit` at submit time.\n *\n * @remarks\n * Use these to override hook-construction props when an ID isn't known at\n * mount — most commonly the **onboarding stub-fill** chain, where `useJobForm`\n * creates the parent job and returns the auto-created stub compensation, and\n * the IDs and version are threaded into this hook's `onSubmit` to PUT the\n * stub.\n *\n * @public\n */\nexport interface CompensationSubmitOptions {\n /** Override jobId — required when creating a compensation if not configured at hook construction (e.g. when the parent job was just created in the same submit chain). */\n jobId?: string\n /** Override compensationId — when present, forces update (PUT) routing regardless of hook construction. */\n compensationId?: string\n /**\n * Compensation version for optimistic locking on PUT. Required when forcing\n * update routing post-create (e.g. updating the auto-created stub returned\n * from `POST /v1/employees/:id/jobs`). When omitted, the hook reads the\n * version from its cached `currentCompensation`.\n */\n compensationVersion?: string\n /**\n * Supply `effectiveDate` at submit time. When `withEffectiveDateField`\n * is `true`, this overrides the form's value. When `withEffectiveDateField`\n * is `false`, this is the only way to put `effective_date` on the wire —\n * the form value is not read in that mode (matching the options-only\n * convention of `useWorkAddressForm` / `useHomeAddressForm` / `useJobForm`).\n */\n effectiveDate?: string\n}\n\n/**\n * Configuration options for {@link useCompensationForm}.\n *\n * @remarks\n * Presence or absence of `compensationId` selects the API verb — see the\n * `compensationId` field description. `employeeId` is optional so the hook\n * can be composed alongside an employee-creation step. `jobId` is optional in\n * update mode (derived from the loaded compensation) and required in create\n * mode (scopes the POST); supply it at submit time via\n * {@link CompensationSubmitOptions.jobId} when the parent job is created in\n * the same submit chain.\n *\n * @public\n */\nexport interface UseCompensationFormProps {\n /** UUID of the employee whose compensation is being created or edited. Drives data fetching for derived helpers (jobs list, work address, minimum wages). May be omitted when composing alongside an employee-creation step. */\n employeeId?: string\n /** The parent job's UUID. Required in create mode (scopes `POST /v1/jobs/:jobId/compensations`). Optional in update mode — the parent job is derived from the loaded compensation. */\n jobId?: string\n /** Present → update mode (PUT /v1/compensations/:id). Omitted → create mode (POST /v1/jobs/:jobId/compensations). */\n compensationId?: string\n /** Override fields that are optional on a given mode to be required. See {@link CompensationOptionalFieldsToRequire}. */\n optionalFieldsToRequire?: CompensationOptionalFieldsToRequire\n /** Pre-fill form values. Server data takes precedence on update mode. */\n defaultValues?: Partial<CompensationFormData>\n /** Passed through to react-hook-form. Defaults to `'onSubmit'`. */\n validationMode?: UseFormProps['mode']\n /** Auto-focus the first invalid field on submit. Set to `false` when using `composeSubmitHandler` so submit-time focus is coordinated across multiple forms. Defaults to `true`. */\n shouldFocusError?: boolean\n /**\n * When `false`, hides `Fields.EffectiveDate` (becomes `undefined`) and\n * removes `effectiveDate` from schema validation. In this mode the hook\n * does not read any form value at submit time — `effective_date` is\n * omitted from the request body unless explicitly supplied via\n * {@link CompensationSubmitOptions.effectiveDate}. This matches the\n * options-only convention of other form hooks, and means the\n * `willDeleteSecondaryJobs` carve-out's form-state side effects do not\n * leak onto the wire (there is no field to render them in anyway).\n * Defaults to `true`.\n */\n withEffectiveDateField?: boolean\n}\n\n/**\n * Pre-bound field components exposed on `useCompensationForm().form.Fields`.\n *\n * @remarks\n * Each property is either the field component or `undefined`. A field is\n * `undefined` when conditions for rendering it aren't met — see each member\n * for its visibility rule. Always null-check conditional fields (e.g.\n * `{Fields.FlsaStatus && <Fields.FlsaStatus ... />}`) before rendering.\n *\n * @public\n */\nexport interface CompensationFormFields {\n /** Title text input. Always available. Optional in both modes unless `optionalFieldsToRequire` requires it. */\n Title: typeof TitleField\n /** FLSA classification select. `undefined` when the status is not user-editable (e.g. secondary jobs that must match the primary). */\n FlsaStatus: typeof FlsaStatusField | undefined\n /** Compensation amount input. `undefined` for commission-only FLSA statuses, which don't accept a partner-supplied rate. */\n Rate: typeof RateField | undefined\n /** Payment unit select. `undefined` for commission-only FLSA statuses (the hook forces `paymentUnit=Year`). */\n PaymentUnit: typeof PaymentUnitField | undefined\n /** Minimum-wage adjustment checkbox. `undefined` unless `flsaStatus === Nonexempt`, the employee's work location has minimum wages, and the state supports tip credits. */\n AdjustForMinimumWage: typeof AdjustForMinimumWageField | undefined\n /** Minimum-wage selection. `undefined` unless `Fields.AdjustForMinimumWage` is rendered and checked. */\n MinimumWageId: typeof MinimumWageIdField | undefined\n /** Effective-date picker. `undefined` when `withEffectiveDateField: false`; supply the value via `CompensationSubmitOptions.effectiveDate` in that mode. */\n EffectiveDate: typeof EffectiveDateField | undefined\n}\n\n/**\n * Ready-state shape returned by {@link useCompensationForm} once data has loaded.\n *\n * @remarks\n * Discriminated by `isLoading: false`. Extends {@link BaseFormHookReady} with\n * the compensation-specific `data`, `status`, `actions`, and `form.Fields`\n * shape. Static, entity-derived values live under `data.*`; reactive values\n * that flip with form input live under `status.*`.\n *\n * @public\n */\nexport interface UseCompensationFormReady extends BaseFormHookReady<\n FieldsMetadata,\n CompensationFormData,\n CompensationFormFields\n> {\n /** Compensation-specific data payload: the loaded compensation, the parent job, available minimum wages, and effective-date bounds. */\n data: {\n /** The compensation row loaded for update; `null` in create mode. */\n compensation: Compensation | null\n /** The parent job. In update mode it's derived from the loaded compensation; in create mode it's looked up by `jobId`. `null` if neither resolves. */\n currentJob: Job | null\n /** Minimum wages available at the employee's active work location. Empty when no location is set or no minimums are defined. */\n minimumWages: MinimumWage[]\n /** Lower bound for `effectiveDate` (typically the parent job's hire date). */\n minimumEffectiveDate: string | null\n /** Upper bound for `effectiveDate` — the next scheduled future compensation's effective date, when one exists. */\n maximumEffectiveDate: string | null\n /** True when at least one future-dated compensation already exists for this job. */\n hasPendingFutureCompensation: boolean\n }\n /** Submission state and reactive flags derived from current form input. `isPending` is `true` while a create/update mutation is in flight; `mode` reflects whether the next submit will create or update; the `show*Alert` flags drive FLSA-specific inline warnings. */\n status: {\n /** `true` while a create or update mutation is in flight. */\n isPending: boolean\n /** Reflects whether the next submit will POST a new compensation or PUT an existing one. */\n mode: 'create' | 'update'\n /**\n * True when submitting the form right now would delete the employee's\n * secondary jobs server-side (the \"carve-out\" branch). Reactive:\n * derived from the current `flsaStatus` form value, the loaded\n * compensation, and the other-jobs count, so this flips as you change\n * inputs.\n *\n * Conditions: update mode, the loaded compensation is Nonexempt, the\n * form's `flsaStatus` has been changed to a non-Nonexempt value, and\n * the employee has at least one secondary job.\n *\n * While this flag is true the hook also takes the `effectiveDate`\n * field over: it forces the form value to today (so submits route\n * through a PUT that immediately deletes secondaries) and exposes\n * `fieldsMetadata.effectiveDate.isDisabled = true` so `Fields.EffectiveDate`\n * renders as disabled. On revert (FLSA back to Nonexempt) the prior\n * `effectiveDate` is restored. Render an inline warning keyed off\n * this flag — no separate confirmation step is needed.\n */\n willDeleteSecondaryJobs: boolean\n /**\n * True when the current `flsaStatus` is `COMMISSION_ONLY_EXEMPT`\n * (Commission Only/No Overtime). Render the federal-minimum-pay\n * warning alert when this flag is true. While this flag is true,\n * `Fields.Rate` and `Fields.PaymentUnit` are also `undefined` (the\n * hook forces `rate=0`, `paymentUnit=YEAR` on the form values).\n */\n showCommissionFederalMinimumPayAlert: boolean\n /**\n * True when the current `flsaStatus` is `COMMISSION_ONLY_NONEXEMPT`\n * (Commission Only/Eligible for overtime). Render the local-minimum-wage\n * warning alert when this flag is true. While this flag is true,\n * `Fields.Rate` and `Fields.PaymentUnit` are also `undefined` (the\n * hook forces `rate=0`, `paymentUnit=YEAR` on the form values).\n */\n showCommissionMinimumWageAlert: boolean\n /**\n * True when the current `flsaStatus` is `OWNER` (Owner's draw). Render\n * an informational alert noting that the IRS requires S-corp owners to\n * pay themselves a reasonable salary for similar work before taking\n * distributions.\n */\n showOwnerSalaryAlert: boolean\n }\n /** Submit actions exposed by the hook. */\n actions: {\n /** Validates the form, runs the appropriate create/update mutation, and resolves to a {@link HookSubmitResult} containing the saved compensation. Resolves to `undefined` on validation failure or mutation error. Accepts {@link CompensationSubmitOptions} for threading IDs/version into the onboarding stub-fill chain. */\n onSubmit: (\n options?: CompensationSubmitOptions,\n ) => Promise<HookSubmitResult<Compensation> | undefined>\n }\n}\n\nfunction resolveCompAndJob(\n jobs: Job[] | undefined,\n compensationId: string | undefined,\n jobId: string | undefined,\n): { compensation: Compensation | null; job: Job | null } {\n if (!jobs) return { compensation: null, job: null }\n if (compensationId) {\n for (const job of jobs) {\n const compensation = job.compensations?.find(c => c.uuid === compensationId)\n if (compensation) return { compensation, job }\n }\n // If the comp isn't in any job's compensations list, still try to resolve\n // the job by jobId so callers can check job metadata (e.g. job.primary).\n const fallbackJob = jobId ? (jobs.find(j => j.uuid === jobId) ?? null) : null\n return { compensation: null, job: fallbackJob }\n }\n if (jobId) return { compensation: null, job: jobs.find(j => j.uuid === jobId) ?? null }\n return { compensation: null, job: null }\n}\n\nfunction findPrimaryFlsaStatus(jobs: Job[] | undefined): FlsaStatusType | null {\n if (!jobs) return null\n for (const job of jobs) {\n if (!job.primary) continue\n const compensation = job.compensations?.find(c => c.uuid === job.currentCompensationUuid)\n if (compensation?.flsaStatus) return compensation.flsaStatus\n }\n return null\n}\n\nfunction findFutureCompensations(job: Job | null): Compensation[] {\n if (!job?.compensations) return []\n const today = todayISO()\n return job.compensations.filter(c => c.effectiveDate !== undefined && c.effectiveDate > today)\n}\n\nfunction earliestEffectiveDate(comps: Compensation[]): string | null {\n if (comps.length === 0) return null\n return comps.reduce<string | null>((min, c) => {\n const d = c.effectiveDate\n if (!d) return min\n if (!min || d < min) return d\n return min\n }, null)\n}\n\nconst flsaStatusEntries: FlsaStatusType[] = [\n FlsaStatus.EXEMPT,\n FlsaStatus.SALARIED_NONEXEMPT,\n FlsaStatus.NONEXEMPT,\n FlsaStatus.OWNER,\n FlsaStatus.COMMISSION_ONLY_EXEMPT,\n FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n]\n\nconst flsaOptions = flsaStatusEntries.map(status => ({ value: status, label: status }))\n\nconst paymentUnitEntries: PaymentUnit[] = [\n PAY_PERIODS.HOUR,\n PAY_PERIODS.WEEK,\n PAY_PERIODS.MONTH,\n PAY_PERIODS.YEAR,\n PAY_PERIODS.PAYCHECK,\n]\n\nconst paymentUnitOptions = paymentUnitEntries.map(unit => ({ value: unit, label: unit }))\n\nfunction todayISO(): string {\n return new Date().toISOString().split('T')[0]!\n}\n\n/**\n * Headless hook for creating or updating a compensation row on a job — FLSA classification, pay rate, payment unit, effective date, and optional minimum-wage adjustment.\n *\n * @remarks\n * Companion hook to `useJobForm`. Jobs and their compensations are separate\n * entities in the Gusto API and this hook focuses exclusively on the\n * compensation side. Presence of `compensationId` selects the verb:\n *\n * | Hook config / submit options | Mode | API call |\n * | ---------------------------- | ---- | -------- |\n * | `{ jobId, compensationId }` | update | `PUT /v1/compensations/:compensationId` (with `version`) |\n * | `{ jobId }` (no `compensationId`) | create | `POST /v1/jobs/:jobId/compensations` |\n * | `{ employeeId }` + submit `{ jobId, compensationId, compensationVersion }` | update | `PUT /v1/compensations/:compensationId` (with the supplied `version`) |\n * | `{ employeeId }` + submit `{ jobId }` (no `compensationId`) | create | `POST /v1/jobs/:options.jobId/compensations` |\n *\n * Use the submit-options form for the **onboarding stub-fill** chain: after\n * `useJobForm.actions.onSubmit()` creates a job, capture the auto-created\n * compensation's UUID and version from the response, and pass them as\n * `{ jobId, compensationId, compensationVersion }` to this hook's `onSubmit`\n * to PUT the stub.\n *\n * The hook exposes several derived helpers for driving UX — static\n * entity-derived values under `data.*` (effective-date bounds, pending\n * future compensations) and reactive flags under `status.*` (the\n * `willDeleteSecondaryJobs` carve-out, plus FLSA-specific alerts for\n * commission-only and owner classifications). When\n * `willDeleteSecondaryJobs` is `true` in update mode, the hook also locks\n * the `effectiveDate` field (forces to today, renders disabled) until the\n * FLSA selection is reverted.\n *\n * @param input - {@link UseCompensationFormProps} — `employeeId`, `jobId`, `compensationId` (toggle create/update), required-field overrides, default values, and which fields the hook renders.\n * @returns A {@link HookLoadingResult} while data is loading, or a {@link UseCompensationFormReady} once ready.\n * @public\n *\n * @example\n * ```tsx\n * import { useCompensationForm, SDKFormProvider } from '@gusto/embedded-react-sdk'\n *\n * function CompensationForm({ employeeId, jobId }: { employeeId: string; jobId: string }) {\n * const comp = useCompensationForm({ employeeId, jobId })\n * if (comp.isLoading) return null\n *\n * const { Fields } = comp.form\n * return (\n * <form onSubmit={e => { e.preventDefault(); comp.actions.onSubmit() }}>\n * <SDKFormProvider formHookResult={comp}>\n * {Fields.FlsaStatus && <Fields.FlsaStatus label=\"Employee type\" />}\n * <Fields.Rate label=\"Compensation amount\" />\n * <Fields.PaymentUnit label=\"Payment unit\" />\n * {Fields.EffectiveDate && <Fields.EffectiveDate label=\"Effective date\" />}\n * </SDKFormProvider>\n * {comp.status.willDeleteSecondaryJobs && (\n * <p>Saving will remove this employee's secondary jobs.</p>\n * )}\n * <button type=\"submit\" disabled={comp.status.isPending}>Save</button>\n * </form>\n * )\n * }\n * ```\n */\nexport function useCompensationForm({\n employeeId,\n jobId,\n compensationId,\n optionalFieldsToRequire,\n defaultValues: partnerDefaults,\n validationMode = 'onSubmit',\n shouldFocusError = true,\n withEffectiveDateField = true,\n}: UseCompensationFormProps): HookLoadingResult | UseCompensationFormReady {\n const jobsQuery = useJobsAndCompensationsGetJobs(\n {\n employeeId: employeeId ?? '',\n // Fetch all effective-dated compensations when editing an existing one so\n // resolveCompAndJob can find the target comp (future-dated comps are\n // omitted from the default response, which only returns the current comp).\n include: compensationId\n ? GetV1EmployeesEmployeeIdJobsQueryParamInclude.AllCompensations\n : undefined,\n },\n { enabled: !!employeeId },\n )\n const addressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId: employeeId ?? '' },\n { enabled: !!employeeId },\n )\n const employeeQuery = useEmployeesGet({ employeeId: employeeId ?? '' }, { enabled: !!employeeId })\n\n const employeeJobs = jobsQuery.data?.jobs\n const workAddresses = addressesQuery.data?.employeeWorkAddressesList\n const currentWorkAddress = workAddresses?.find(address => address.active)\n const locationUuid = currentWorkAddress?.locationUuid\n const employee = employeeQuery.data?.employee\n\n const minWagesQuery = useLocationsGetMinimumWages(\n { locationUuid: locationUuid ?? '' },\n { enabled: !!locationUuid },\n )\n\n const minimumWages = minWagesQuery.data?.minimumWageList ?? []\n\n const { compensation: currentCompensation, job: currentJob } = resolveCompAndJob(\n employeeJobs,\n compensationId,\n jobId,\n )\n\n const otherJobsCount =\n employeeJobs && currentJob ? employeeJobs.filter(j => j.uuid !== currentJob.uuid).length : 0\n\n // Snapshot — written exactly once, on the first render where `employeeJobs`\n // is defined (i.e., the initial `getJobs` query has resolved) — capturing\n // whether the employee already had a primary job at that moment.\n //\n // Used to ignore the API-generated stub primary (FLSA Nonexempt, rate \"0.00\")\n // that briefly appears between the chained job POST and comp PUT during\n // onboarding: `getJobs` invalidates between the two mutations and\n // momentarily includes the stub, which would otherwise flip\n // `isAddingSecondaryJob` to true and hide `Fields.FlsaStatus` mid-submit.\n //\n // In steady-state flows (edit primary, edit secondary, add secondary), the\n // real primary already exists when the query first resolves, so the snapshot\n // is `true` and live `employeeJobs` continues to drive `primaryFlsaStatus`.\n // Recovery for the rare case where a partner mounts before any jobs exist\n // and a primary is created externally mid-form is to remount the hook\n // (e.g., via a `key` change).\n const hadPrimaryAtMountRef = useRef<boolean | null>(null)\n if (hadPrimaryAtMountRef.current === null && employeeJobs !== undefined) {\n hadPrimaryAtMountRef.current = employeeJobs.some(job => job.primary)\n }\n const hadPrimaryAtMount = hadPrimaryAtMountRef.current === true\n\n // FLSA status of the employee's primary job's current compensation, when one\n // exists. Used as a fallback default when adding a *secondary* job/comp so the\n // multi-job classification stays consistent with the primary by default — the\n // user can still override it (when allowed). Null when there was no primary\n // job at the moment the hook first observed `employeeJobs`, or when the\n // primary has no current compensation yet.\n const primaryFlsaStatus = hadPrimaryAtMount ? findPrimaryFlsaStatus(employeeJobs) : null\n\n const hireDate =\n currentJob?.hireDate ??\n // Secondary jobs being created (CompensationAddAnotherJobForm) have no hireDate until the\n // job POST completes. Fall back to the primary job's hireDate so the schema\n // can enforce EFFECTIVE_DATE_BEFORE_HIRE during that window.\n employeeJobs?.find(j => j.primary)?.hireDate ??\n null\n\n // In update mode, exclude the compensation being edited so it doesn't\n // bound `maximumEffectiveDate` to its own current date — that would prevent\n // the user from pushing the pending effective date further out.\n const futureCompensations = findFutureCompensations(currentJob).filter(\n c => c.uuid !== compensationId,\n )\n const hasPendingFutureCompensation = futureCompensations.length > 0\n const maximumEffectiveDate = earliestEffectiveDate(futureCompensations)\n\n const isCreateMode = !compensationId\n const mode = isCreateMode ? 'create' : 'update'\n // Adding a secondary job (the employee already has a primary). The Gusto API\n // only allows secondaries when the primary's current FLSA is Nonexempt, and\n // the secondary itself must match — so the FLSA field is not user-editable\n // in this branch. We force the form value to the primary's FLSA below and\n // hide `Fields.FlsaStatus`.\n // True when adding a brand-new secondary job (not when scheduling a future\n // comp for the primary). The distinction matters: for the primary's future\n // comp, FLSA should be editable; for a secondary, it must match the primary.\n const isAddingSecondaryJob =\n isCreateMode && primaryFlsaStatus === FlsaStatus.NONEXEMPT && currentJob?.primary !== true\n\n // Derive the effective-date floor internally so consumers don't need to wire\n // it up. Rules by mode and job type:\n // create (any job): tomorrow — new comp must be future-dated\n // update, primary: undefined — the carve-out (willDeleteSecondaryJobs) can\n // force effectiveDate to today on a disabled field; enforcing a floor here\n // would produce a spurious EFFECTIVE_DATE_BEFORE_MIN on submit.\n // update, secondary: tomorrow — must be in the future\n // The hire-date lower bound is handled separately in the schema via the\n // `hireDate` option (→ EFFECTIVE_DATE_BEFORE_HIRE), which fires alongside\n // this check so each violation gets its own error message.\n const internalMinEffectiveDate = useMemo(() => {\n if (!withEffectiveDateField) return undefined\n if (!isCreateMode && currentJob?.primary === true) return undefined\n\n return formatDateToStringDate(addDays(new Date(), 1)) ?? undefined\n }, [isCreateMode, currentJob?.primary, withEffectiveDateField])\n\n const [schema, metadataConfig] = useMemo(\n () =>\n createCompensationSchema({\n mode,\n optionalFieldsToRequire,\n hireDate,\n minEffectiveDate: internalMinEffectiveDate,\n withEffectiveDateField,\n }),\n [mode, optionalFieldsToRequire, hireDate, internalMinEffectiveDate, withEffectiveDateField],\n )\n\n const state = currentWorkAddress?.state\n\n // `flsaStatus` is intentionally allowed to be undefined so the field renders\n // an empty placeholder when nothing is provided — partners can choose to\n // seed it via `defaultValues.flsaStatus`. When a `compensation` is loaded we\n // seed from it; for a brand-new secondary job we inherit from the primary's\n // current compensation so multi-job classification stays consistent. The\n // schema enforces requiredness on submit in `create` mode (see\n // `requiredFieldsConfig` in compensationSchema.ts).\n //\n // `title` lives on compensation in the API — `job.title` is a denormalized\n // snapshot of the primary comp's title that can lag behind comp-level edits\n // on secondaries. Seed directly from the loaded compensation so editing in\n // place can't silently re-introduce a stale title from the job record.\n const resolvedDefaults: CompensationFormData = useMemo(\n () => ({\n title: currentCompensation?.title ?? partnerDefaults?.title ?? '',\n // When adding a secondary, the FLSA must match the primary's — force it\n // here (overriding any partner default) so the form submits the right\n // value even though `Fields.FlsaStatus` is hidden.\n flsaStatus: isAddingSecondaryJob\n ? primaryFlsaStatus\n : (currentCompensation?.flsaStatus ??\n partnerDefaults?.flsaStatus ??\n primaryFlsaStatus ??\n undefined),\n rate: Number(currentCompensation?.rate ?? partnerDefaults?.rate ?? 0),\n adjustForMinimumWage:\n currentCompensation?.adjustForMinimumWage ?? partnerDefaults?.adjustForMinimumWage ?? false,\n minimumWageId:\n currentCompensation?.minimumWages?.[0]?.uuid ?? partnerDefaults?.minimumWageId ?? '',\n paymentUnit:\n currentCompensation?.paymentUnit ?? partnerDefaults?.paymentUnit ?? PAY_PERIODS.HOUR,\n effectiveDate: currentCompensation?.effectiveDate ?? partnerDefaults?.effectiveDate ?? null,\n }),\n [currentCompensation, currentJob, partnerDefaults, primaryFlsaStatus, isAddingSecondaryJob],\n )\n\n const formMethods = useForm<CompensationFormData, unknown, CompensationFormOutputs>({\n resolver: zodResolver(schema),\n mode: validationMode,\n shouldFocusError,\n defaultValues: resolvedDefaults,\n values: resolvedDefaults,\n resetOptions: { keepDirtyValues: true },\n })\n\n const { control, getValues, setValue, clearErrors } = formMethods\n const watchedFlsaStatus = useWatch({ control, name: 'flsaStatus' })\n const watchedAdjustForMinimumWage = useWatch({\n control,\n name: 'adjustForMinimumWage',\n })\n\n // Validation rules for `paymentUnit` and `rate` are FLSA-driven, so any\n // prior error on those fields is stale once FLSA changes. RHF doesn't clear\n // them on its own (`setValue` without `shouldValidate` skips the resolver,\n // and reValidate is per-field) — clear eagerly and let the next blur/submit\n // re-establish the error if it still applies.\n useEffect(() => {\n clearErrors(['paymentUnit', 'rate'])\n if (watchedFlsaStatus === FlsaStatus.OWNER) {\n setValue('paymentUnit', PAY_PERIODS.PAYCHECK)\n } else if (\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n ) {\n setValue('paymentUnit', PAY_PERIODS.YEAR)\n setValue('rate', 0)\n } else {\n setValue('paymentUnit', resolvedDefaults.paymentUnit)\n }\n }, [watchedFlsaStatus, setValue, clearErrors, resolvedDefaults.paymentUnit])\n\n // The FLSA status that represents the employee's current classification.\n // In update mode this is the compensation being edited. In create mode\n // `currentCompensation` is null, so fall back to the job's active\n // compensation (identified by currentCompensationUuid) — this lets the\n // secondary-job warning fire even when scheduling a future-dated change.\n const currentJobActiveComp = currentJob\n ? currentJob.compensations?.find(c => c.uuid === currentJob.currentCompensationUuid)\n : undefined\n const effectiveBaseFlsaStatus =\n currentCompensation?.flsaStatus ?? currentJobActiveComp?.flsaStatus ?? null\n\n // True when the user is changing FLSA away from Nonexempt on a job that has\n // secondary jobs — those secondaries will be deleted by the API when the\n // new classification takes effect (immediately in update mode, at the chosen\n // effective date in create mode). Drives the warning and, in update mode\n // only, the effectiveDate-lock side effect below.\n const willDeleteSecondaryJobs =\n effectiveBaseFlsaStatus === FlsaStatus.NONEXEMPT &&\n watchedFlsaStatus !== undefined &&\n watchedFlsaStatus !== FlsaStatus.NONEXEMPT &&\n otherJobsCount > 0\n\n // Carve-out UX — update mode only: while willDeleteSecondaryJobs is active\n // the server deletes secondaries immediately on PUT. Mirror this by forcing\n // `effectiveDate` to today and disabling the field. In create mode the\n // deletion happens at the chosen future date, so we show the warning but\n // leave the date field editable.\n const carveOutActiveRef = useRef(false)\n const priorEffectiveDateRef = useRef<string | null>(null)\n useEffect(() => {\n if (!isCreateMode && willDeleteSecondaryJobs && !carveOutActiveRef.current) {\n priorEffectiveDateRef.current = getValues('effectiveDate') ?? null\n setValue('effectiveDate', todayISO(), { shouldDirty: true, shouldValidate: false })\n carveOutActiveRef.current = true\n } else if (!isCreateMode && !willDeleteSecondaryJobs && carveOutActiveRef.current) {\n setValue('effectiveDate', priorEffectiveDateRef.current ?? null, {\n shouldDirty: true,\n shouldValidate: false,\n })\n priorEffectiveDateRef.current = null\n carveOutActiveRef.current = false\n }\n }, [isCreateMode, willDeleteSecondaryJobs, getValues, setValue])\n\n const updateCompensationMutation = useJobsAndCompensationsUpdateCompensationMutation()\n const createCompensationMutation = useJobsAndCompensationsCreateCompensationMutation()\n\n const isPending = updateCompensationMutation.isPending || createCompensationMutation.isPending\n\n const {\n baseSubmitHandler,\n error: submitError,\n setError: setSubmitError,\n } = useBaseSubmit('CompensationForm')\n\n const queriesForErrors = employeeId\n ? [jobsQuery, addressesQuery, employeeQuery, minWagesQuery]\n : []\n const errorHandling = composeErrorHandler(queriesForErrors, { submitError, setSubmitError })\n\n const isCommissionOnly =\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n const isOwner = watchedFlsaStatus === FlsaStatus.OWNER\n\n // Hide `Fields.FlsaStatus` when the user has no meaningful choice:\n // - update mode editing a secondary whose comp is already Nonexempt\n // (must keep matching the primary), and\n // - create mode while adding a secondary (must inherit primary's FLSA).\n // The first job's create flow and primary-job edits keep the field exposed.\n const isFlsaSelectionEnabled =\n !isAddingSecondaryJob &&\n (watchedFlsaStatus !== FlsaStatus.NONEXEMPT || currentJob?.primary === true || isCreateMode)\n\n const isAdjustMinimumWageEnabled =\n watchedFlsaStatus === FlsaStatus.NONEXEMPT &&\n minimumWages.length > 0 &&\n state !== undefined &&\n !TIP_CREDITS_UNSUPPORTED_STATES.includes(state)\n\n // Min-wage adjustment is only valid for Nonexempt FLSA (and a state that\n // allows tip credit). When the gate flips off — typically because the user\n // changed FLSA away from Nonexempt — `Fields.AdjustForMinimumWage` and\n // `Fields.MinimumWageId` stop rendering, but the underlying form values\n // persist in react-hook-form state. That would leak an\n // `adjust_for_minimum_wage: true` + `minimum_wages: [...]` body on submit\n // (server rejects with \"Minimum wage adjustments only valid for\n // flsa_status: Nonexempt\"). Reset both values to safe defaults so the\n // submitted payload always matches what the user can actually see.\n useEffect(() => {\n if (isAdjustMinimumWageEnabled) return\n if (getValues('adjustForMinimumWage')) {\n setValue('adjustForMinimumWage', false, { shouldDirty: true, shouldValidate: false })\n }\n if (getValues('minimumWageId')) {\n setValue('minimumWageId', '', { shouldDirty: true, shouldValidate: false })\n }\n // Both fields stop rendering once the gate closes — clear errors so a\n // stale one doesn't silently fail the next submit with no visible UI to fix.\n clearErrors(['adjustForMinimumWage', 'minimumWageId'])\n }, [isAdjustMinimumWageEnabled, getValues, setValue, clearErrors])\n\n const minimumWageOptions = minimumWages.map(wage => ({\n value: wage.uuid,\n label: `${wage.wage} - ${wage.authority}: ${wage.notes ?? ''}`,\n }))\n\n const baseMetadata = useDeriveFieldsMetadata(metadataConfig, formMethods.control)\n const effectiveDateMinDate = useMemo(\n () =>\n [internalMinEffectiveDate, hireDate]\n .filter((d): d is string => !!d)\n .reduce<string | null>((max, d) => (!max || d > max ? d : max), null),\n [internalMinEffectiveDate, hireDate],\n )\n const fieldsMetadata = {\n title: baseMetadata.title,\n effectiveDate: {\n ...baseMetadata.effectiveDate,\n isDisabled: willDeleteSecondaryJobs && !isCreateMode,\n minDate: effectiveDateMinDate,\n maxDate: maximumEffectiveDate,\n },\n flsaStatus: withOptions<FlsaStatusType>(\n baseMetadata.flsaStatus,\n flsaOptions,\n flsaStatusEntries,\n ),\n rate: { ...baseMetadata.rate, isDisabled: isCommissionOnly },\n paymentUnit: withOptions<PaymentUnit>(\n { ...baseMetadata.paymentUnit, isDisabled: isOwner || isCommissionOnly },\n paymentUnitOptions,\n paymentUnitEntries,\n ),\n adjustForMinimumWage: {\n ...baseMetadata.adjustForMinimumWage,\n isDisabled: !isAdjustMinimumWageEnabled,\n },\n minimumWageId: withOptions<MinimumWage>(\n baseMetadata.minimumWageId,\n minimumWageOptions,\n minimumWages,\n ),\n }\n\n const onSubmit = async (\n options?: CompensationSubmitOptions,\n ): Promise<HookSubmitResult<Compensation> | undefined> => {\n let submitResult: HookSubmitResult<Compensation> | undefined\n\n await new Promise<void>(resolve => {\n void formMethods.handleSubmit(\n async (data: CompensationFormOutputs) => {\n await baseSubmitHandler(data, async payload => {\n const resolvedJobId = options?.jobId ?? jobId\n const resolvedCompensationId = options?.compensationId ?? compensationId\n const resolvedMode = resolvedCompensationId ? 'update' : 'create'\n\n // When the field is rendered, the validated payload value wins\n // unless an explicit submit-time override is supplied. When the\n // field is hidden (`withEffectiveDateField: false`) we are\n // strictly options-only — matching `useWorkAddressForm` and the\n // hidden-field behavior of `useHomeAddressForm` / `useJobForm`.\n // The carve-out's form-state side effect (force value to today)\n // is therefore inert in the hidden-field path; partners who\n // need a specific date there must supply it via\n // `CompensationSubmitOptions.effectiveDate`.\n const resolvedEffectiveDate = withEffectiveDateField\n ? (options?.effectiveDate ?? payload.effectiveDate ?? undefined)\n : (options?.effectiveDate ?? undefined)\n\n const requestBodyBase = {\n rate: String(payload.rate),\n paymentUnit: payload.paymentUnit,\n flsaStatus: payload.flsaStatus,\n effectiveDate: resolvedEffectiveDate,\n title: payload.title || undefined,\n adjustForMinimumWage: payload.adjustForMinimumWage,\n minimumWages: payload.adjustForMinimumWage ? [{ uuid: payload.minimumWageId }] : [],\n }\n\n let result: Compensation | undefined\n\n if (resolvedMode === 'create') {\n if (!resolvedJobId) {\n throw new SDKInternalError(\n 'jobId is required to create a compensation. Pass it as a hook prop or via submit options.',\n )\n }\n // Schema's `requiredFieldsConfig` guarantees `flsaStatus` is set\n // on create-mode submit; the runtime guard appeases the API\n // request-body type (which requires a non-undefined value on\n // POST, vs. the optional PUT body).\n if (!payload.flsaStatus) {\n throw new SDKInternalError('flsaStatus is required to create a compensation.')\n }\n const createResponse = await createCompensationMutation.mutateAsync({\n request: {\n jobId: resolvedJobId,\n compensationsRequestBody: { ...requestBodyBase, flsaStatus: payload.flsaStatus },\n },\n })\n result = createResponse.compensation\n if (!result) throw new SDKInternalError('Compensation creation failed')\n } else {\n if (!resolvedCompensationId) {\n throw new SDKInternalError(\n 'compensationId is required to update a compensation. Pass it as a hook prop or via submit options.',\n )\n }\n const resolvedVersion =\n options?.compensationVersion ?? (currentCompensation?.version as string | undefined)\n if (!resolvedVersion) {\n throw new SDKInternalError(\n 'compensation version is required to update a compensation. Pass it via submit options when threading post-create, or ensure the compensation is loaded.',\n )\n }\n const updateResponse = await updateCompensationMutation.mutateAsync({\n request: {\n compensationId: resolvedCompensationId,\n compensationsUpdateRequestBody: {\n version: resolvedVersion,\n ...requestBodyBase,\n },\n },\n })\n result = updateResponse.compensation\n if (!result) throw new SDKInternalError('Compensation update failed')\n }\n\n submitResult = { mode: resolvedMode, data: result }\n })\n resolve()\n },\n () => {\n resolve()\n },\n )()\n })\n\n return submitResult\n }\n\n const isDataLoading = employeeId\n ? jobsQuery.isLoading ||\n addressesQuery.isLoading ||\n employeeQuery.isLoading ||\n minWagesQuery.isLoading\n : false\n\n const hookFormInternals = useHookFormInternals(formMethods)\n\n if (isDataLoading || (employeeId && (!employeeJobs || !employee))) {\n return { isLoading: true as const, errorHandling }\n }\n\n return {\n isLoading: false as const,\n data: {\n compensation: currentCompensation,\n currentJob,\n minimumWages,\n minimumEffectiveDate: effectiveDateMinDate,\n maximumEffectiveDate,\n hasPendingFutureCompensation,\n },\n status: {\n isPending,\n mode,\n willDeleteSecondaryJobs,\n showCommissionFederalMinimumPayAlert: watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT,\n showCommissionMinimumWageAlert: watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n showOwnerSalaryAlert: watchedFlsaStatus === FlsaStatus.OWNER,\n },\n actions: { onSubmit },\n errorHandling,\n form: {\n Fields: {\n Title: TitleField,\n FlsaStatus: isFlsaSelectionEnabled ? FlsaStatusField : undefined,\n Rate: isCommissionOnly ? undefined : RateField,\n PaymentUnit: isCommissionOnly ? undefined : PaymentUnitField,\n AdjustForMinimumWage: isAdjustMinimumWageEnabled ? AdjustForMinimumWageField : undefined,\n MinimumWageId:\n isAdjustMinimumWageEnabled && watchedAdjustForMinimumWage\n ? MinimumWageIdField\n : undefined,\n EffectiveDate: withEffectiveDateField ? EffectiveDateField : undefined,\n },\n fieldsMetadata,\n hookFormInternals,\n getFormSubmissionValues: createGetFormSubmissionValues(formMethods, schema),\n },\n }\n}\n\n/**\n * Discriminated union returned by {@link useCompensationForm} — either the loading state or the ready state.\n *\n * @remarks\n * Use this type when threading the hook result through helpers (e.g.\n * presentational components). Discriminate on `isLoading` to narrow to\n * {@link UseCompensationFormReady}.\n *\n * @public\n */\nexport type UseCompensationFormResult = HookLoadingResult | UseCompensationFormReady\n\n/**\n * Metadata for each {@link useCompensationForm} field, exposed on `form.fieldsMetadata`.\n *\n * @remarks\n * Includes per-field `isDisabled`, `isRequired`, and the dynamic option list\n * for select fields (`flsaStatus`, `paymentUnit`, `minimumWageId`).\n * `effectiveDate` additionally carries `minDate` / `maxDate` derived from\n * the parent job's hire date and any pending future compensation.\n *\n * @public\n */\nexport type CompensationFieldsMetadata = UseCompensationFormReady['form']['fieldsMetadata']\n"],"names":["resolveCompAndJob","jobs","compensationId","jobId","job","compensation","c","j","findPrimaryFlsaStatus","findFutureCompensations","today","todayISO","earliestEffectiveDate","comps","min","d","flsaStatusEntries","FlsaStatus","flsaOptions","status","paymentUnitEntries","PAY_PERIODS","paymentUnitOptions","unit","useCompensationForm","employeeId","optionalFieldsToRequire","partnerDefaults","validationMode","shouldFocusError","withEffectiveDateField","jobsQuery","useJobsAndCompensationsGetJobs","GetV1EmployeesEmployeeIdJobsQueryParamInclude","addressesQuery","useEmployeeAddressesGetWorkAddresses","employeeQuery","useEmployeesGet","employeeJobs","currentWorkAddress","address","locationUuid","employee","minWagesQuery","useLocationsGetMinimumWages","minimumWages","currentCompensation","currentJob","otherJobsCount","hadPrimaryAtMountRef","useRef","primaryFlsaStatus","hireDate","futureCompensations","hasPendingFutureCompensation","maximumEffectiveDate","isCreateMode","mode","isAddingSecondaryJob","internalMinEffectiveDate","useMemo","formatDateToStringDate","addDays","schema","metadataConfig","createCompensationSchema","state","resolvedDefaults","formMethods","useForm","zodResolver","control","getValues","setValue","clearErrors","watchedFlsaStatus","useWatch","watchedAdjustForMinimumWage","useEffect","currentJobActiveComp","willDeleteSecondaryJobs","carveOutActiveRef","priorEffectiveDateRef","updateCompensationMutation","useJobsAndCompensationsUpdateCompensationMutation","createCompensationMutation","useJobsAndCompensationsCreateCompensationMutation","isPending","baseSubmitHandler","submitError","setSubmitError","useBaseSubmit","errorHandling","composeErrorHandler","isCommissionOnly","isOwner","isFlsaSelectionEnabled","isAdjustMinimumWageEnabled","TIP_CREDITS_UNSUPPORTED_STATES","minimumWageOptions","wage","baseMetadata","useDeriveFieldsMetadata","effectiveDateMinDate","max","fieldsMetadata","withOptions","onSubmit","options","submitResult","resolve","data","payload","resolvedJobId","resolvedCompensationId","resolvedMode","resolvedEffectiveDate","requestBodyBase","result","SDKInternalError","resolvedVersion","isDataLoading","hookFormInternals","useHookFormInternals","TitleField","FlsaStatusField","RateField","PaymentUnitField","AdjustForMinimumWageField","MinimumWageIdField","EffectiveDateField","createGetFormSubmissionValues"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoPA,SAAS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AsCL,MAAsB1D,EAAW;AAAA,MACvE,gCAAgC0D,MAAsB1D,EAAW;AAAA,MACjE,sBAAsB0D,MAAsB1D,EAAW;AAAA,IAAA;AAAA,IAEzD,SAAS,EAAE,UAAA0F,GAAA;AAAA,IACX,eAAAf;AAAA,IACA,MAAM;AAAA,MACJ,QAAQ;AAAA,QACN,OAAOgC;AAAA,QACP,YAAY5B,KAAyB6B,KAAkB;AAAA,QACvD,MAAM/B,IAAmB,SAAYgC;AAAA,QACrC,aAAahC,IAAmB,SAAYiC;AAAA,QAC5C,sBAAsB9B,IAA6B+B,KAA4B;AAAA,QAC/E,eACE/B,KAA8BpB,KAC1BoD,KACA;AAAA,QACN,eAAenG,IAAyBoG,KAAqB;AAAA,MAAA;AAAA,MAE/D,gBAAAzB;AAAA,MACA,mBAAAiB;AAAA,MACA,yBAAyBS,GAA8B/D,GAAaL,CAAM;AAAA,IAAA;AAAA,EAC5E;AAEJ;"}
@@ -1,3 +1,3 @@
1
1
  import "./types/i18next.d.ts"
2
2
  export { useCompensationManagement } from './useCompensationManagement';
3
- export type { UseCompensationManagementProps, UseCompensationManagementReady, UseCompensationManagementResult, } from './useCompensationManagement';
3
+ export type { UseCompensationManagementReady } from './useCompensationManagement';
@@ -1,9 +1,20 @@
1
1
  import { Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job';
2
2
  import { PendingCompensationChange } from '../getPendingCompensationChanges';
3
3
  import { BaseHookReady, HookLoadingResult, HookSubmitResult } from '../../../../../partner-hook-utils/types';
4
+ /**
5
+ * Props for {@link useCompensationManagement}.
6
+ *
7
+ * @public
8
+ */
4
9
  export interface UseCompensationManagementProps {
10
+ /** The associated employee identifier. */
5
11
  employeeId: string;
6
12
  }
13
+ /**
14
+ * Ready state of {@link useCompensationManagement}.
15
+ *
16
+ * @public
17
+ */
7
18
  export interface UseCompensationManagementReady extends BaseHookReady<{
8
19
  jobs: Job[];
9
20
  primaryJob?: Job;
@@ -18,14 +29,22 @@ export interface UseCompensationManagementReady extends BaseHookReady<{
18
29
  isPending: boolean;
19
30
  cancellingCompensationUuid: string | null;
20
31
  }> {
32
+ /** Actions available when the hook has loaded. */
21
33
  actions: {
22
34
  cancelPendingChange: (pendingChange: PendingCompensationChange) => Promise<HookSubmitResult<unknown> | undefined>;
23
35
  };
24
36
  }
37
+ /**
38
+ * Return type of {@link useCompensationManagement}.
39
+ *
40
+ * @public
41
+ */
25
42
  export type UseCompensationManagementResult = HookLoadingResult | UseCompensationManagementReady;
26
43
  /**
27
44
  * Non-Suspense queries powering the standalone Compensation management card.
28
45
  * Returns jobs + pending-changes + the employee's first name (for cosmetic
29
46
  * alert copy) along with a cancel-pending-change action.
47
+ *
48
+ * @public
30
49
  */
31
50
  export declare function useCompensationManagement({ employeeId, }: UseCompensationManagementProps): UseCompensationManagementResult;
@@ -1 +1 @@
1
- {"version":3,"file":"useCompensationManagement.js","sources":["../../../../../../src/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.tsx"],"sourcesContent":["import { useCallback, useMemo } from 'react'\nimport { useEmployeesGet } from '@gusto/embedded-api-v-2025-11-15/react-query/employeesGet'\nimport { useJobsAndCompensationsGetJobs } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsGetJobs'\nimport { GetV1EmployeesEmployeeIdJobsQueryParamInclude } from '@gusto/embedded-api-v-2025-11-15/models/operations/getv1employeesemployeeidjobs'\nimport { useJobsAndCompensationsDeleteCompensationMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsDeleteCompensation'\nimport type { Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job'\nimport {\n getPendingCompensationChanges,\n type PendingCompensationChange,\n} from '../getPendingCompensationChanges'\nimport { derivePrimaryFlsaStatus } from '@/components/Employee/Compensation/shared/derivePrimaryFlsaStatus'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type { BaseHookReady, HookLoadingResult, HookSubmitResult } from '@/partner-hook-utils/types'\n\nexport interface UseCompensationManagementProps {\n employeeId: string\n}\n\nexport interface UseCompensationManagementReady extends BaseHookReady<\n {\n jobs: Job[]\n primaryJob?: Job\n primaryFlsaStatus?: string\n hasMultipleJobs: boolean\n pendingChanges: PendingCompensationChange[]\n /** First name from the shared employee fetch; useful for cosmetic copy\n * in alerts (e.g. \"Heads up, Jane has pending changes\"). Optional\n * because the employee record can omit it. */\n employeeFirstName?: string\n },\n {\n isPending: boolean\n cancellingCompensationUuid: string | null\n }\n> {\n actions: {\n cancelPendingChange: (\n pendingChange: PendingCompensationChange,\n ) => Promise<HookSubmitResult<unknown> | undefined>\n }\n}\n\nexport type UseCompensationManagementResult = HookLoadingResult | UseCompensationManagementReady\n\n/**\n * Non-Suspense queries powering the standalone Compensation management card.\n * Returns jobs + pending-changes + the employee's first name (for cosmetic\n * alert copy) along with a cancel-pending-change action.\n */\nexport function useCompensationManagement({\n employeeId,\n}: UseCompensationManagementProps): UseCompensationManagementResult {\n // staleTime: Infinity on dashboard reads — the SDK QueryClient already\n // invalidates all queries on any mutation success, so post-write\n // freshness is preserved. Without this, every subscriber re-mount\n // (e.g. tab navigation) would fire a redundant background refetch.\n //\n // GET /v1/employees/:id/jobs?include=all_compensations returns all effective-\n // dated compensations (current + future) with compensation.title on each,\n // which is required for pending-change detection. Without the include param,\n // only the current compensation is returned.\n const jobsQuery = useJobsAndCompensationsGetJobs(\n { employeeId, include: GetV1EmployeesEmployeeIdJobsQueryParamInclude.AllCompensations },\n { staleTime: Infinity },\n )\n // Employee query is a lightweight secondary fetch for cosmetic data only\n // (first name used in alert copy). Jobs / compensation data comes from jobsQuery.\n const employeeQuery = useEmployeesGet({ employeeId }, { staleTime: Infinity })\n const cancelCompensationMutation = useJobsAndCompensationsDeleteCompensationMutation()\n const {\n baseSubmitHandler,\n error: submitError,\n setError: setSubmitError,\n } = useBaseSubmit('Employee.Management.Compensation')\n\n const employee = employeeQuery.data?.employee\n\n const jobs = useMemo(() => jobsQuery.data?.jobs ?? [], [jobsQuery.data?.jobs])\n const primaryJob = useMemo(() => jobs.find(job => job.primary === true), [jobs])\n const primaryFlsaStatus = useMemo(() => derivePrimaryFlsaStatus(jobs), [jobs])\n const hasMultipleJobs = jobs.length > 1\n\n const pendingChanges = useMemo(() => getPendingCompensationChanges(jobs), [jobs])\n\n const cancellingCompensationUuid = cancelCompensationMutation.isPending\n ? cancelCompensationMutation.variables.request.compensationId\n : null\n\n const cancelPendingChange = useCallback(\n async (\n pendingChange: PendingCompensationChange,\n ): Promise<HookSubmitResult<unknown> | undefined> => {\n let submitResult: HookSubmitResult<unknown> | undefined\n await baseSubmitHandler(pendingChange, async ({ compensationUuid }) => {\n const data = await cancelCompensationMutation.mutateAsync({\n request: { compensationId: compensationUuid },\n })\n submitResult = { mode: 'update', data }\n })\n return submitResult\n },\n [baseSubmitHandler, cancelCompensationMutation],\n )\n\n const isPending =\n jobsQuery.isFetching || employeeQuery.isFetching || cancelCompensationMutation.isPending\n\n const errorHandling = composeErrorHandler([jobsQuery, employeeQuery], {\n submitError,\n setSubmitError,\n })\n\n // The card depends on the jobs fetch (jobs, pending changes, FLSA status).\n // The employee fetch is cosmetic (first name for alert copy) and is not\n // gated on here so the card can render as soon as jobs resolve.\n if (jobsQuery.isLoading) {\n return { isLoading: true, errorHandling }\n }\n\n return {\n isLoading: false,\n data: {\n jobs,\n primaryJob,\n primaryFlsaStatus,\n hasMultipleJobs,\n pendingChanges,\n employeeFirstName: employee?.firstName ?? undefined,\n },\n status: {\n isPending,\n cancellingCompensationUuid,\n },\n actions: {\n cancelPendingChange,\n },\n errorHandling,\n }\n}\n"],"names":["useCompensationManagement","employeeId","jobsQuery","useJobsAndCompensationsGetJobs","GetV1EmployeesEmployeeIdJobsQueryParamInclude","employeeQuery","useEmployeesGet","cancelCompensationMutation","useJobsAndCompensationsDeleteCompensationMutation","baseSubmitHandler","submitError","setSubmitError","useBaseSubmit","employee","jobs","useMemo","primaryJob","job","primaryFlsaStatus","derivePrimaryFlsaStatus","hasMultipleJobs","pendingChanges","getPendingCompensationChanges","cancellingCompensationUuid","cancelPendingChange","useCallback","pendingChange","submitResult","compensationUuid","isPending","errorHandling","composeErrorHandler"],"mappings":";;;;;;;;;AAkDO,SAASA,EAA0B;AAAA,EACxC,YAAAC;AACF,GAAoE;AAUlE,QAAMC,IAAYC;AAAA,IAChB,EAAE,YAAAF,GAAY,SAASG,EAA8C,iBAAA;AAAA,IACrE,EAAE,WAAW,MAAA;AAAA,EAAS,GAIlBC,IAAgBC,EAAgB,EAAE,YAAAL,EAAA,GAAc,EAAE,WAAW,OAAU,GACvEM,IAA6BC,EAAA,GAC7B;AAAA,IACJ,mBAAAC;AAAA,IACA,OAAOC;AAAA,IACP,UAAUC;AAAA,EAAA,IACRC,EAAc,kCAAkC,GAE9CC,IAAWR,EAAc,MAAM,UAE/BS,IAAOC,EAAQ,MAAMb,EAAU,MAAM,QAAQ,CAAA,GAAI,CAACA,EAAU,MAAM,IAAI,CAAC,GACvEc,IAAaD,EAAQ,MAAMD,EAAK,KAAK,CAAAG,MAAOA,EAAI,YAAY,EAAI,GAAG,CAACH,CAAI,CAAC,GACzEI,IAAoBH,EAAQ,MAAMI,EAAwBL,CAAI,GAAG,CAACA,CAAI,CAAC,GACvEM,IAAkBN,EAAK,SAAS,GAEhCO,IAAiBN,EAAQ,MAAMO,EAA8BR,CAAI,GAAG,CAACA,CAAI,CAAC,GAE1ES,IAA6BhB,EAA2B,YAC1DA,EAA2B,UAAU,QAAQ,iBAC7C,MAEEiB,IAAsBC;AAAA,IAC1B,OACEC,MACmD;AACnD,UAAIC;AACJ,mBAAMlB,EAAkBiB,GAAe,OAAO,EAAE,kBAAAE,QAAuB;AAIrE,QAAAD,IAAe,EAAE,MAAM,UAAU,MAHpB,MAAMpB,EAA2B,YAAY;AAAA,UACxD,SAAS,EAAE,gBAAgBqB,EAAA;AAAA,QAAiB,CAC7C,EACgC;AAAA,MACnC,CAAC,GACMD;AAAA,IACT;AAAA,IACA,CAAClB,GAAmBF,CAA0B;AAAA,EAAA,GAG1CsB,IACJ3B,EAAU,cAAcG,EAAc,cAAcE,EAA2B,WAE3EuB,IAAgBC,EAAoB,CAAC7B,GAAWG,CAAa,GAAG;AAAA,IACpE,aAAAK;AAAA,IACA,gBAAAC;AAAA,EAAA,CACD;AAKD,SAAIT,EAAU,YACL,EAAE,WAAW,IAAM,eAAA4B,EAAA,IAGrB;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,MAAAhB;AAAA,MACA,YAAAE;AAAA,MACA,mBAAAE;AAAA,MACA,iBAAAE;AAAA,MACA,gBAAAC;AAAA,MACA,mBAAmBR,GAAU,aAAa;AAAA,IAAA;AAAA,IAE5C,QAAQ;AAAA,MACN,WAAAgB;AAAA,MACA,4BAAAN;AAAA,IAAA;AAAA,IAEF,SAAS;AAAA,MACP,qBAAAC;AAAA,IAAA;AAAA,IAEF,eAAAM;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"useCompensationManagement.js","sources":["../../../../../../src/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.tsx"],"sourcesContent":["import { useCallback, useMemo } from 'react'\nimport { useEmployeesGet } from '@gusto/embedded-api-v-2025-11-15/react-query/employeesGet'\nimport { useJobsAndCompensationsGetJobs } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsGetJobs'\nimport { GetV1EmployeesEmployeeIdJobsQueryParamInclude } from '@gusto/embedded-api-v-2025-11-15/models/operations/getv1employeesemployeeidjobs'\nimport { useJobsAndCompensationsDeleteCompensationMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsDeleteCompensation'\nimport type { Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job'\nimport {\n getPendingCompensationChanges,\n type PendingCompensationChange,\n} from '../getPendingCompensationChanges'\nimport { derivePrimaryFlsaStatus } from '@/components/Employee/Compensation/shared/derivePrimaryFlsaStatus'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type { BaseHookReady, HookLoadingResult, HookSubmitResult } from '@/partner-hook-utils/types'\n\n/**\n * Props for {@link useCompensationManagement}.\n *\n * @public\n */\nexport interface UseCompensationManagementProps {\n /** The associated employee identifier. */\n employeeId: string\n}\n\n/**\n * Ready state of {@link useCompensationManagement}.\n *\n * @public\n */\nexport interface UseCompensationManagementReady extends BaseHookReady<\n {\n jobs: Job[]\n primaryJob?: Job\n primaryFlsaStatus?: string\n hasMultipleJobs: boolean\n pendingChanges: PendingCompensationChange[]\n /** First name from the shared employee fetch; useful for cosmetic copy\n * in alerts (e.g. \"Heads up, Jane has pending changes\"). Optional\n * because the employee record can omit it. */\n employeeFirstName?: string\n },\n {\n isPending: boolean\n cancellingCompensationUuid: string | null\n }\n> {\n /** Actions available when the hook has loaded. */\n actions: {\n cancelPendingChange: (\n pendingChange: PendingCompensationChange,\n ) => Promise<HookSubmitResult<unknown> | undefined>\n }\n}\n\n/**\n * Return type of {@link useCompensationManagement}.\n *\n * @public\n */\nexport type UseCompensationManagementResult = HookLoadingResult | UseCompensationManagementReady\n\n/**\n * Non-Suspense queries powering the standalone Compensation management card.\n * Returns jobs + pending-changes + the employee's first name (for cosmetic\n * alert copy) along with a cancel-pending-change action.\n *\n * @public\n */\nexport function useCompensationManagement({\n employeeId,\n}: UseCompensationManagementProps): UseCompensationManagementResult {\n // staleTime: Infinity on dashboard reads — the SDK QueryClient already\n // invalidates all queries on any mutation success, so post-write\n // freshness is preserved. Without this, every subscriber re-mount\n // (e.g. tab navigation) would fire a redundant background refetch.\n //\n // GET /v1/employees/:id/jobs?include=all_compensations returns all effective-\n // dated compensations (current + future) with compensation.title on each,\n // which is required for pending-change detection. Without the include param,\n // only the current compensation is returned.\n const jobsQuery = useJobsAndCompensationsGetJobs(\n { employeeId, include: GetV1EmployeesEmployeeIdJobsQueryParamInclude.AllCompensations },\n { staleTime: Infinity },\n )\n // Employee query is a lightweight secondary fetch for cosmetic data only\n // (first name used in alert copy). Jobs / compensation data comes from jobsQuery.\n const employeeQuery = useEmployeesGet({ employeeId }, { staleTime: Infinity })\n const cancelCompensationMutation = useJobsAndCompensationsDeleteCompensationMutation()\n const {\n baseSubmitHandler,\n error: submitError,\n setError: setSubmitError,\n } = useBaseSubmit('Employee.Management.Compensation')\n\n const employee = employeeQuery.data?.employee\n\n const jobs = useMemo(() => jobsQuery.data?.jobs ?? [], [jobsQuery.data?.jobs])\n const primaryJob = useMemo(() => jobs.find(job => job.primary === true), [jobs])\n const primaryFlsaStatus = useMemo(() => derivePrimaryFlsaStatus(jobs), [jobs])\n const hasMultipleJobs = jobs.length > 1\n\n const pendingChanges = useMemo(() => getPendingCompensationChanges(jobs), [jobs])\n\n const cancellingCompensationUuid = cancelCompensationMutation.isPending\n ? cancelCompensationMutation.variables.request.compensationId\n : null\n\n const cancelPendingChange = useCallback(\n async (\n pendingChange: PendingCompensationChange,\n ): Promise<HookSubmitResult<unknown> | undefined> => {\n let submitResult: HookSubmitResult<unknown> | undefined\n await baseSubmitHandler(pendingChange, async ({ compensationUuid }) => {\n const data = await cancelCompensationMutation.mutateAsync({\n request: { compensationId: compensationUuid },\n })\n submitResult = { mode: 'update', data }\n })\n return submitResult\n },\n [baseSubmitHandler, cancelCompensationMutation],\n )\n\n const isPending =\n jobsQuery.isFetching || employeeQuery.isFetching || cancelCompensationMutation.isPending\n\n const errorHandling = composeErrorHandler([jobsQuery, employeeQuery], {\n submitError,\n setSubmitError,\n })\n\n // The card depends on the jobs fetch (jobs, pending changes, FLSA status).\n // The employee fetch is cosmetic (first name for alert copy) and is not\n // gated on here so the card can render as soon as jobs resolve.\n if (jobsQuery.isLoading) {\n return { isLoading: true, errorHandling }\n }\n\n return {\n isLoading: false,\n data: {\n jobs,\n primaryJob,\n primaryFlsaStatus,\n hasMultipleJobs,\n pendingChanges,\n employeeFirstName: employee?.firstName ?? undefined,\n },\n status: {\n isPending,\n cancellingCompensationUuid,\n },\n actions: {\n cancelPendingChange,\n },\n errorHandling,\n }\n}\n"],"names":["useCompensationManagement","employeeId","jobsQuery","useJobsAndCompensationsGetJobs","GetV1EmployeesEmployeeIdJobsQueryParamInclude","employeeQuery","useEmployeesGet","cancelCompensationMutation","useJobsAndCompensationsDeleteCompensationMutation","baseSubmitHandler","submitError","setSubmitError","useBaseSubmit","employee","jobs","useMemo","primaryJob","job","primaryFlsaStatus","derivePrimaryFlsaStatus","hasMultipleJobs","pendingChanges","getPendingCompensationChanges","cancellingCompensationUuid","cancelPendingChange","useCallback","pendingChange","submitResult","compensationUuid","isPending","errorHandling","composeErrorHandler"],"mappings":";;;;;;;;;AAqEO,SAASA,EAA0B;AAAA,EACxC,YAAAC;AACF,GAAoE;AAUlE,QAAMC,IAAYC;AAAA,IAChB,EAAE,YAAAF,GAAY,SAASG,EAA8C,iBAAA;AAAA,IACrE,EAAE,WAAW,MAAA;AAAA,EAAS,GAIlBC,IAAgBC,EAAgB,EAAE,YAAAL,EAAA,GAAc,EAAE,WAAW,OAAU,GACvEM,IAA6BC,EAAA,GAC7B;AAAA,IACJ,mBAAAC;AAAA,IACA,OAAOC;AAAA,IACP,UAAUC;AAAA,EAAA,IACRC,EAAc,kCAAkC,GAE9CC,IAAWR,EAAc,MAAM,UAE/BS,IAAOC,EAAQ,MAAMb,EAAU,MAAM,QAAQ,CAAA,GAAI,CAACA,EAAU,MAAM,IAAI,CAAC,GACvEc,IAAaD,EAAQ,MAAMD,EAAK,KAAK,CAAAG,MAAOA,EAAI,YAAY,EAAI,GAAG,CAACH,CAAI,CAAC,GACzEI,IAAoBH,EAAQ,MAAMI,EAAwBL,CAAI,GAAG,CAACA,CAAI,CAAC,GACvEM,IAAkBN,EAAK,SAAS,GAEhCO,IAAiBN,EAAQ,MAAMO,EAA8BR,CAAI,GAAG,CAACA,CAAI,CAAC,GAE1ES,IAA6BhB,EAA2B,YAC1DA,EAA2B,UAAU,QAAQ,iBAC7C,MAEEiB,IAAsBC;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