@gusto/embedded-react-sdk 0.38.0 → 0.40.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 (877) hide show
  1. package/CHANGELOG.md +233 -0
  2. package/dist/assets/icons/percent-circle.svg.js +10 -0
  3. package/dist/assets/icons/percent-circle.svg.js.map +1 -0
  4. package/dist/assets/icons/plus-circle.svg.js +1 -1
  5. package/dist/assets/icons/plus-circle.svg.js.map +1 -1
  6. package/dist/components/Base/Base.js +2 -3
  7. package/dist/components/Base/Base.js.map +1 -1
  8. package/dist/components/Common/DataView/DataCards/DataCards.d.ts +5 -3
  9. package/dist/components/Common/DataView/DataCards/DataCards.js +59 -46
  10. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  11. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +9 -7
  12. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
  13. package/dist/components/Common/DataView/DataTable/DataTable.d.ts +4 -2
  14. package/dist/components/Common/DataView/DataTable/DataTable.js +95 -76
  15. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  16. package/dist/components/Common/DataView/DataView.d.ts +4 -3
  17. package/dist/components/Common/DataView/DataView.js +24 -22
  18. package/dist/components/Common/DataView/DataView.js.map +1 -1
  19. package/dist/components/Common/DataView/useDataView.d.ts +33 -6
  20. package/dist/components/Common/DataView/useDataView.js +23 -20
  21. package/dist/components/Common/DataView/useDataView.js.map +1 -1
  22. package/dist/components/Common/DataView/useSelectionState.d.ts +5 -0
  23. package/dist/components/Common/DataView/useSelectionState.js +8 -0
  24. package/dist/components/Common/DataView/useSelectionState.js.map +1 -0
  25. package/dist/components/Common/DateRangeFilter/DateRangeFilter.d.ts +3 -1
  26. package/dist/components/Common/DateRangeFilter/DateRangeFilter.js +65 -71
  27. package/dist/components/Common/DateRangeFilter/DateRangeFilter.js.map +1 -1
  28. package/dist/components/Common/DateRangeFilter/DateRangeFilter.module.scss.js +10 -6
  29. package/dist/components/Common/DateRangeFilter/DateRangeFilter.module.scss.js.map +1 -1
  30. package/dist/components/Common/EmptyData/EmptyData.d.ts +2 -1
  31. package/dist/components/Common/EmptyData/EmptyData.js +15 -13
  32. package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
  33. package/dist/components/Common/EmptyData/EmptyData.module.scss.js +6 -4
  34. package/dist/components/Common/EmptyData/EmptyData.module.scss.js.map +1 -1
  35. package/dist/components/Common/Fields/hooks/useField.js.map +1 -1
  36. package/dist/components/Common/Fields/hooks/useStringifyGenericFieldValue.d.ts +2 -2
  37. package/dist/components/Common/Fields/hooks/useStringifyGenericFieldValue.js +2 -2
  38. package/dist/components/Common/Fields/hooks/useStringifyGenericFieldValue.js.map +1 -1
  39. package/dist/components/Common/SignatureForm/SignatureForm.js +4 -6
  40. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  41. package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -12
  42. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  43. package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -8
  44. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  45. package/dist/components/Common/UI/Alert/Alert.module.scss.js +12 -12
  46. package/dist/components/Common/UI/Box/Box.d.ts +1 -1
  47. package/dist/components/Common/UI/Box/Box.js +9 -8
  48. package/dist/components/Common/UI/Box/Box.js.map +1 -1
  49. package/dist/components/Common/UI/Box/Box.module.scss.js +12 -8
  50. package/dist/components/Common/UI/Box/Box.module.scss.js.map +1 -1
  51. package/dist/components/Common/UI/Box/BoxTypes.d.ts +2 -9
  52. package/dist/components/Common/UI/BoxHeader/BoxHeader.d.ts +2 -0
  53. package/dist/components/Common/UI/BoxHeader/BoxHeader.js +23 -0
  54. package/dist/components/Common/UI/BoxHeader/BoxHeader.js.map +1 -0
  55. package/dist/components/Common/UI/BoxHeader/BoxHeader.module.scss.js +8 -0
  56. package/dist/components/Common/UI/BoxHeader/BoxHeader.module.scss.js.map +1 -0
  57. package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.d.ts +10 -0
  58. package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.js +7 -0
  59. package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.js.map +1 -0
  60. package/dist/components/Common/UI/BoxHeader/index.d.ts +2 -0
  61. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  62. package/dist/components/Common/UI/Button/Button.module.scss.js +2 -2
  63. package/dist/components/Common/UI/Checkbox/Checkbox.js +60 -49
  64. package/dist/components/Common/UI/Checkbox/Checkbox.js.map +1 -1
  65. package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js +10 -6
  66. package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js.map +1 -1
  67. package/dist/components/Common/UI/ComboBox/ComboBox.js +1 -1
  68. package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
  69. package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +1 -1
  70. package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +6 -6
  71. package/dist/components/Common/UI/DateRangePicker/DateRangePicker.js +34 -36
  72. package/dist/components/Common/UI/DateRangePicker/DateRangePicker.js.map +1 -1
  73. package/dist/components/Common/UI/DateRangePicker/DateRangePicker.module.scss.js +12 -12
  74. package/dist/components/Common/UI/DescriptionList/DescriptionList.js +19 -12
  75. package/dist/components/Common/UI/DescriptionList/DescriptionList.js.map +1 -1
  76. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +6 -4
  77. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js.map +1 -1
  78. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +6 -1
  79. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js +4 -1
  80. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -1
  81. package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
  82. package/dist/components/Common/UI/Heading/Heading.module.scss.js +15 -15
  83. package/dist/components/Common/UI/Input/Input.js.map +1 -1
  84. package/dist/components/Common/UI/Menu/Menu.module.scss.js +5 -5
  85. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  86. package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +1 -1
  87. package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
  88. package/dist/components/Common/UI/Select/Select.js +22 -22
  89. package/dist/components/Common/UI/Select/Select.js.map +1 -1
  90. package/dist/components/Common/UI/Select/SelectTypes.d.ts +1 -1
  91. package/dist/components/Common/UI/Table/Table.js +12 -12
  92. package/dist/components/Common/UI/Table/Table.js.map +1 -1
  93. package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
  94. package/dist/components/Common/UI/Table/TableTypes.d.ts +3 -3
  95. package/dist/components/Common/UI/Table/TableTypes.js +3 -3
  96. package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
  97. package/dist/components/Common/UI/TextArea/TextArea.js +1 -1
  98. package/dist/components/Common/UI/TextArea/TextArea.js.map +1 -1
  99. package/dist/components/Common/UI/TextInput/TextInput.js +13 -13
  100. package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
  101. package/dist/components/Company/AssignSignatory/AssignSignatory.js +2 -3
  102. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  103. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -8
  104. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  105. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -10
  106. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  107. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
  108. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -5
  109. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  110. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -8
  111. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  112. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  113. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -5
  114. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  115. package/dist/components/Company/AssignSignatory/TitleSelect.js +2 -3
  116. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  117. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -7
  118. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  119. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
  120. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  121. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -11
  122. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  123. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -5
  124. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  125. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -12
  126. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  127. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +11 -13
  128. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  129. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -6
  130. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  131. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -7
  132. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  133. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +8 -9
  134. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  135. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -5
  136. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  137. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -3
  138. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  139. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -5
  140. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  141. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.d.ts +9 -0
  142. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +14 -0
  143. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js.map +1 -0
  144. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/index.d.ts +5 -0
  145. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.d.ts +25 -0
  146. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.js +24 -0
  147. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.js.map +1 -0
  148. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.d.ts +32 -0
  149. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js +106 -0
  150. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js.map +1 -0
  151. package/dist/components/Company/FederalTaxes/Actions.js +7 -9
  152. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  153. package/dist/components/Company/FederalTaxes/FederalTaxes.js +17 -18
  154. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  155. package/dist/components/Company/FederalTaxes/Form.js +4 -6
  156. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  157. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -10
  158. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  159. package/dist/components/Company/Industry/Actions.js +5 -7
  160. package/dist/components/Company/Industry/Actions.js.map +1 -1
  161. package/dist/components/Company/Industry/Context.js +6 -8
  162. package/dist/components/Company/Industry/Context.js.map +1 -1
  163. package/dist/components/Company/Industry/Edit.js +10 -12
  164. package/dist/components/Company/Industry/Edit.js.map +1 -1
  165. package/dist/components/Company/Locations/LocationForm/Actions.js +6 -8
  166. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  167. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  168. package/dist/components/Company/Locations/LocationForm/LocationForm.js +3 -4
  169. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  170. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -5
  171. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  172. package/dist/components/Company/Locations/LocationsList/Actions.js +6 -8
  173. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  174. package/dist/components/Company/Locations/LocationsList/List.js +8 -10
  175. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  176. package/dist/components/Company/Locations/LocationsList/LocationsList.js +2 -3
  177. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  178. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -5
  179. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  180. package/dist/components/Company/OnboardingOverview/Completed.js +12 -14
  181. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  182. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +5 -7
  183. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  184. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -3
  185. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  186. package/dist/components/Company/OnboardingOverview/context.js +3 -5
  187. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  188. package/dist/components/Company/PaySchedule/PaySchedule.js +70 -68
  189. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  190. package/dist/components/Company/PaySchedule/_parts/Actions.js +7 -9
  191. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  192. package/dist/components/Company/PaySchedule/_parts/Edit.js +37 -32
  193. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  194. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -10
  195. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  196. package/dist/components/Company/PaySchedule/_parts/List.js +13 -15
  197. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  198. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.d.ts +23 -0
  199. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +37 -0
  200. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js.map +1 -0
  201. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/index.d.ts +5 -0
  202. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.d.ts +55 -0
  203. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.js +54 -0
  204. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.js.map +1 -0
  205. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +33 -0
  206. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js +184 -0
  207. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js.map +1 -0
  208. package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +5 -6
  209. package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -7
  210. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  211. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -7
  212. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  213. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +33 -33
  214. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  215. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -5
  216. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  217. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -8
  218. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  219. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -7
  220. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  221. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +14 -14
  222. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  223. package/dist/components/Company/StateTaxes/StateTaxesList/context.d.ts +2 -2
  224. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -5
  225. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  226. package/dist/components/Company/exports/companyOnboarding.d.ts +14 -0
  227. package/dist/components/Company/exports/companyOnboarding.js +31 -0
  228. package/dist/components/Company/exports/companyOnboarding.js.map +1 -0
  229. package/dist/components/Contractor/Address/Address.js +3 -4
  230. package/dist/components/Contractor/Address/Address.js.map +1 -1
  231. package/dist/components/Contractor/Address/Form.js +4 -4
  232. package/dist/components/Contractor/Address/useAddress.js +5 -7
  233. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  234. package/dist/components/Contractor/ContractorList/index.js +19 -20
  235. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  236. package/dist/components/Contractor/NewHireReport/NewHireReport.js +2 -3
  237. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  238. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +5 -7
  239. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  240. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
  241. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  242. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
  243. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  244. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +135 -126
  245. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  246. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +2 -1
  247. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +77 -76
  248. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  249. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
  250. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +2 -1
  251. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +5 -7
  252. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  253. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +2 -1
  254. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +83 -84
  255. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  256. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +2 -4
  257. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  258. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +10 -10
  259. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -1
  260. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +67 -79
  261. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  262. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +10 -12
  263. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js.map +1 -1
  264. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +47 -49
  265. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  266. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +63 -65
  267. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  268. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js +4 -4
  269. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  270. package/dist/components/Contractor/Profile/useContractorProfile.js +33 -35
  271. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  272. package/dist/components/Contractor/Submit/Submit.js +73 -51
  273. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  274. package/dist/components/Contractor/exports/contractorOnboarding.d.ts +7 -0
  275. package/dist/components/Contractor/exports/contractorOnboarding.js +17 -0
  276. package/dist/components/Contractor/exports/contractorOnboarding.js.map +1 -0
  277. package/dist/components/Employee/Compensation/Actions.js +5 -6
  278. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  279. package/dist/components/Employee/Compensation/Compensation.js +80 -77
  280. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  281. package/dist/components/Employee/Compensation/Edit.js +27 -28
  282. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  283. package/dist/components/Employee/Compensation/List.js +23 -25
  284. package/dist/components/Employee/Compensation/List.js.map +1 -1
  285. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +103 -0
  286. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js +90 -0
  287. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -0
  288. package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/fields.d.ts +9 -9
  289. package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/fields.js +6 -6
  290. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -0
  291. package/dist/components/Employee/Compensation/shared/useCompensationForm/index.d.ts +5 -0
  292. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts +43 -0
  293. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +262 -0
  294. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -0
  295. package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +13 -0
  296. package/dist/components/Employee/Dashboard/BasicDetailsView.js +107 -0
  297. package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -0
  298. package/dist/components/Employee/Dashboard/Dashboard.d.ts +5 -0
  299. package/dist/components/Employee/Dashboard/Dashboard.js +146 -0
  300. package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -0
  301. package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +5 -0
  302. package/dist/components/Employee/Dashboard/DashboardComponents.js +12 -0
  303. package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -0
  304. package/dist/components/Employee/Dashboard/DashboardFlow.d.ts +5 -0
  305. package/dist/components/Employee/Dashboard/DashboardFlow.js +25 -0
  306. package/dist/components/Employee/Dashboard/DashboardFlow.js.map +1 -0
  307. package/dist/components/Employee/Dashboard/DocumentsView.d.ts +7 -0
  308. package/dist/components/Employee/Dashboard/DocumentsView.js +48 -0
  309. package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -0
  310. package/dist/components/Employee/Dashboard/JobAndPayView.d.ts +22 -0
  311. package/dist/components/Employee/Dashboard/JobAndPayView.js +211 -0
  312. package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -0
  313. package/dist/components/Employee/Dashboard/TaxesView.d.ts +13 -0
  314. package/dist/components/Employee/Dashboard/TaxesView.js +97 -0
  315. package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -0
  316. package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +3 -0
  317. package/dist/components/Employee/Dashboard/dashboardStateMachine.js +8 -0
  318. package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -0
  319. package/dist/components/Employee/Dashboard/hooks/index.d.ts +9 -0
  320. package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.d.ts +17 -0
  321. package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +29 -0
  322. package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -0
  323. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +28 -0
  324. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +52 -0
  325. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -0
  326. package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.d.ts +13 -0
  327. package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +22 -0
  328. package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -0
  329. package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.d.ts +17 -0
  330. package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js +24 -0
  331. package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js.map +1 -0
  332. package/dist/components/Employee/Dashboard/index.d.ts +14 -0
  333. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +10 -12
  334. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  335. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +17 -19
  336. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  337. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +11 -13
  338. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  339. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +7 -8
  340. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  341. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -8
  342. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  343. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +5 -6
  344. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  345. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -4
  346. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  347. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -5
  348. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  349. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js +22 -22
  350. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
  351. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +24 -26
  352. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
  353. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +9 -10
  354. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
  355. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +7 -8
  356. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  357. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -5
  358. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  359. package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.d.ts +53 -0
  360. package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.js +164 -0
  361. package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.js.map +1 -0
  362. package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/index.d.ts +5 -0
  363. package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +150 -0
  364. package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.js +152 -0
  365. package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -0
  366. package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +47 -0
  367. package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.js +179 -0
  368. package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -0
  369. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +2 -4
  370. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
  371. package/dist/components/Employee/FederalTaxes/Actions.js +6 -8
  372. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  373. package/dist/components/Employee/FederalTaxes/FederalForm.js +10 -12
  374. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  375. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -5
  376. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  377. package/dist/components/Employee/Landing/Landing.js +14 -15
  378. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  379. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +1 -1
  380. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
  381. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  382. package/dist/components/Employee/PaymentMethod/Actions.js +7 -9
  383. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  384. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -6
  385. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  386. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +6 -7
  387. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  388. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +6 -7
  389. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  390. package/dist/components/Employee/PaymentMethod/Split.js +10 -11
  391. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  392. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -7
  393. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  394. package/dist/components/Employee/Profile/AdminProfile.d.ts +2 -0
  395. package/dist/components/Employee/Profile/AdminProfile.js +360 -0
  396. package/dist/components/Employee/Profile/AdminProfile.js.map +1 -0
  397. package/dist/components/Employee/Profile/AdminProfile.module.scss.js +10 -0
  398. package/dist/components/Employee/Profile/AdminProfile.module.scss.js.map +1 -0
  399. package/dist/components/Employee/Profile/EmployeeProfile.d.ts +2 -0
  400. package/dist/components/Employee/Profile/EmployeeProfile.js +211 -0
  401. package/dist/components/Employee/Profile/EmployeeProfile.js.map +1 -0
  402. package/dist/components/Employee/Profile/EmployeeProfile.module.scss.js +10 -0
  403. package/dist/components/Employee/Profile/EmployeeProfile.module.scss.js.map +1 -0
  404. package/dist/components/Employee/Profile/Profile.d.ts +3 -3
  405. package/dist/components/Employee/Profile/Profile.js +25 -261
  406. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  407. package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +13 -4
  408. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js +51 -0
  409. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -0
  410. package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/fields.d.ts +8 -7
  411. package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/fields.js +5 -5
  412. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js.map +1 -0
  413. package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/index.d.ts +1 -3
  414. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +45 -0
  415. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js +154 -0
  416. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -0
  417. package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.d.ts +22 -0
  418. package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +36 -0
  419. package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js.map +1 -0
  420. package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.d.ts +41 -0
  421. package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js +32 -0
  422. package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js.map +1 -0
  423. package/dist/components/Employee/Profile/shared/useHomeAddressForm/index.d.ts +5 -0
  424. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +44 -0
  425. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js +161 -0
  426. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -0
  427. package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/fields.d.ts +3 -3
  428. package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/fields.js +2 -2
  429. package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js.map +1 -0
  430. package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/index.d.ts +1 -3
  431. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.d.ts +46 -0
  432. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js +135 -0
  433. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -0
  434. package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/workAddressSchema.d.ts +6 -4
  435. package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.js +23 -0
  436. package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.js.map +1 -0
  437. package/dist/components/Employee/StateTaxes/Actions.js +8 -10
  438. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  439. package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -5
  440. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  441. package/dist/components/Employee/Taxes/Actions.js +8 -10
  442. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  443. package/dist/components/Employee/Taxes/FederalForm.js +10 -12
  444. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  445. package/dist/components/Employee/Taxes/useTaxes.js +3 -5
  446. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  447. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +5 -5
  448. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
  449. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +14 -16
  450. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
  451. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +12 -13
  452. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
  453. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +2 -4
  454. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
  455. package/dist/components/Employee/{EmployeeList → employee-list/management}/ManagementEmployeeList.d.ts +1 -1
  456. package/dist/components/Employee/{EmployeeList → employee-list/management}/ManagementEmployeeList.js +7 -7
  457. package/dist/components/Employee/employee-list/management/ManagementEmployeeList.js.map +1 -0
  458. package/dist/components/Employee/{EmployeeList → employee-list/management}/ManagementEmployeeListView.d.ts +1 -1
  459. package/dist/components/Employee/{EmployeeList → employee-list/management}/ManagementEmployeeListView.js +18 -20
  460. package/dist/components/Employee/employee-list/management/ManagementEmployeeListView.js.map +1 -0
  461. package/dist/components/Employee/employee-list/onboarding/EmployeeList.d.ts +6 -0
  462. package/dist/components/Employee/{EmployeeList → employee-list/onboarding}/EmployeeList.js +7 -7
  463. package/dist/components/Employee/employee-list/onboarding/EmployeeList.js.map +1 -0
  464. package/dist/components/Employee/{EmployeeList → employee-list/onboarding}/EmployeeListView.d.ts +1 -1
  465. package/dist/components/Employee/employee-list/onboarding/EmployeeListView.js +130 -0
  466. package/dist/components/Employee/employee-list/onboarding/EmployeeListView.js.map +1 -0
  467. package/dist/components/Employee/employee-list/shared/index.d.ts +2 -0
  468. package/dist/components/Employee/{EmployeeList → employee-list/shared}/useEmployeeList.d.ts +8 -10
  469. package/dist/components/Employee/{EmployeeList → employee-list/shared}/useEmployeeList.js +32 -28
  470. package/dist/components/Employee/employee-list/shared/useEmployeeList.js.map +1 -0
  471. package/dist/components/Employee/exports/employeeManagement.d.ts +6 -0
  472. package/dist/components/Employee/exports/employeeManagement.js +15 -0
  473. package/dist/components/Employee/exports/employeeManagement.js.map +1 -0
  474. package/dist/components/Employee/exports/employeeOnboarding.d.ts +14 -0
  475. package/dist/components/Employee/exports/employeeOnboarding.js +31 -0
  476. package/dist/components/Employee/exports/employeeOnboarding.js.map +1 -0
  477. package/dist/components/Employee/index.d.ts +3 -2
  478. package/dist/components/Employee/index.js +24 -24
  479. package/dist/components/Flow/Flow.js +16 -18
  480. package/dist/components/Flow/Flow.js.map +1 -1
  481. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +28 -29
  482. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  483. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +14 -14
  484. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +11 -12
  485. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  486. package/dist/components/InformationRequests/InformationRequests.js +3 -4
  487. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  488. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +8 -9
  489. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  490. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +8 -10
  491. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
  492. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +12 -14
  493. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  494. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +74 -69
  495. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
  496. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +30 -32
  497. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
  498. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +11 -13
  499. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
  500. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.d.ts +1 -1
  501. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +19 -19
  502. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
  503. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts +3 -3
  504. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +13 -13
  505. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -1
  506. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +6 -8
  507. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
  508. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +12 -14
  509. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
  510. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +11 -13
  511. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  512. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +12 -12
  513. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +17 -17
  514. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
  515. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +1 -1
  516. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  517. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +2 -2
  518. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +16 -16
  519. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  520. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +1 -1
  521. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +28 -28
  522. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  523. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +22 -24
  524. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  525. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +78 -79
  526. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  527. package/dist/components/Payroll/PayrollList/PayrollList.js +1 -1
  528. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  529. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -2
  530. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +224 -201
  531. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  532. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +8 -8
  533. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +79 -80
  534. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  535. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
  536. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +18 -18
  537. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  538. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -1
  539. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -4
  540. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  541. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +104 -117
  542. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  543. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +16 -18
  544. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js.map +1 -1
  545. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +2 -3
  546. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  547. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +6 -7
  548. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
  549. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +2 -4
  550. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
  551. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +67 -63
  552. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
  553. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +12 -14
  554. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -1
  555. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +1 -1
  556. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js +5 -5
  557. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +1 -1
  558. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +13 -13
  559. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
  560. package/dist/components/Payroll/helpers.d.ts +1 -1
  561. package/dist/components/Payroll/helpers.js.map +1 -1
  562. package/dist/components/Payroll/usePreparedPayrollData.d.ts +2 -2
  563. package/dist/components/Payroll/usePreparedPayrollData.js +10 -12
  564. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  565. package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +45 -42
  566. package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
  567. package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.d.ts +2 -0
  568. package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js +55 -0
  569. package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -0
  570. package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormTypes.d.ts +25 -0
  571. package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.d.ts +2 -2
  572. package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.js +100 -43
  573. package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.js.map +1 -1
  574. package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.d.ts +2 -0
  575. package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js +124 -0
  576. package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js.map +1 -0
  577. package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.module.scss.js +8 -0
  578. package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.module.scss.js.map +1 -0
  579. package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListTypes.d.ts +19 -0
  580. package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.module.scss.js +18 -0
  581. package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.module.scss.js.map +1 -0
  582. package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsPresentation.d.ts +2 -0
  583. package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsPresentation.js +166 -0
  584. package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -0
  585. package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsTypes.d.ts +18 -0
  586. package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.d.ts +3 -1
  587. package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.js +25 -55
  588. package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +1 -1
  589. package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.d.ts +2 -0
  590. package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +66 -0
  591. package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -0
  592. package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorTypes.d.ts +6 -0
  593. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +1 -1
  594. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js +71 -66
  595. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
  596. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.js +5 -5
  597. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
  598. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.d.ts +8 -0
  599. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +71 -0
  600. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -0
  601. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.module.scss.js +12 -0
  602. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.module.scss.js.map +1 -0
  603. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +2 -0
  604. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +206 -0
  605. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -0
  606. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +20 -0
  607. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/index.d.ts +6 -0
  608. package/dist/components/UNSTABLE_TimeOff/index.d.ts +4 -2
  609. package/dist/components/UNSTABLE_TimeOff/index.js +18 -16
  610. package/dist/components/UNSTABLE_TimeOff/index.js.map +1 -1
  611. package/dist/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +2 -0
  612. package/dist/components/UNSTABLE_TimeOff/{TimeOffManagement/shared → shared}/EmployeeTable/EmployeeTableTypes.d.ts +3 -3
  613. package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.d.ts +30 -0
  614. package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.js +97 -0
  615. package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.js.map +1 -0
  616. package/dist/components/index.d.ts +7 -0
  617. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +52 -50
  618. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  619. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  620. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +10 -0
  621. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +28 -21
  622. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
  623. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  624. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  625. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +10 -12
  626. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  627. package/dist/contexts/ObservabilityProvider/useObservability.js +6 -6
  628. package/dist/contexts/ObservabilityProvider/useObservability.js.map +1 -1
  629. package/dist/contexts/ThemeProvider/theme.d.ts +2 -0
  630. package/dist/contexts/ThemeProvider/theme.js +4 -2
  631. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  632. package/dist/helpers/dateFormatting.d.ts +2 -0
  633. package/dist/helpers/dateFormatting.js +38 -33
  634. package/dist/helpers/dateFormatting.js.map +1 -1
  635. package/dist/helpers/formattedStrings.js +40 -33
  636. package/dist/helpers/formattedStrings.js.map +1 -1
  637. package/dist/hooks/useCompanyPaymentSpeed.d.ts +6 -0
  638. package/dist/hooks/useCompanyPaymentSpeed.js +19 -0
  639. package/dist/hooks/useCompanyPaymentSpeed.js.map +1 -0
  640. package/dist/i18n/I18n.js +1 -1
  641. package/dist/i18n/I18n.js.map +1 -1
  642. package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +9 -9
  643. package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js +18 -12
  644. package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js.map +1 -1
  645. package/dist/i18n/en/Company.TimeOff.SelectPolicyType.json.js +28 -0
  646. package/dist/i18n/en/Company.TimeOff.SelectPolicyType.json.js.map +1 -0
  647. package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js +32 -26
  648. package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js.map +1 -1
  649. package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +36 -34
  650. package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js.map +1 -1
  651. package/dist/i18n/en/Contractor.Submit.json.js +16 -12
  652. package/dist/i18n/en/Contractor.Submit.json.js.map +1 -1
  653. package/dist/i18n/en/Employee.Dashboard.json.js +26 -0
  654. package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -0
  655. package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js +5 -5
  656. package/dist/i18n/en/Payroll.PayrollHistory.json.js +2 -2
  657. package/dist/i18n/en/Payroll.PayrollList.json.js +15 -15
  658. package/dist/i18n/en/Payroll.TransitionCreation.json.js +9 -9
  659. package/dist/i18n/en/common.json.d.ts +4 -1
  660. package/dist/i18n/en/common.json.js +5 -5
  661. package/dist/index.d.ts +16 -0
  662. package/dist/index.js +102 -26
  663. package/dist/index.js.map +1 -1
  664. package/dist/partner-hook-utils/collectErrors.js.map +1 -0
  665. package/dist/partner-hook-utils/composeErrorHandler.d.ts +24 -0
  666. package/dist/partner-hook-utils/composeErrorHandler.js +30 -0
  667. package/dist/partner-hook-utils/composeErrorHandler.js.map +1 -0
  668. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/FormFieldsMetadataContext.d.ts +2 -2
  669. package/dist/partner-hook-utils/form/FormFieldsMetadataContext.js.map +1 -0
  670. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/FormFieldsMetadataProvider.d.ts +2 -2
  671. package/dist/partner-hook-utils/form/FormFieldsMetadataProvider.js.map +1 -0
  672. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/SDKFormProvider.d.ts +2 -2
  673. package/dist/partner-hook-utils/form/SDKFormProvider.js.map +1 -0
  674. package/dist/partner-hook-utils/form/buildFormSchema.d.ts +48 -0
  675. package/dist/partner-hook-utils/form/buildFormSchema.js +94 -0
  676. package/dist/partner-hook-utils/form/buildFormSchema.js.map +1 -0
  677. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/composeSubmitHandler.d.ts +29 -3
  678. package/dist/partner-hook-utils/form/composeSubmitHandler.js +40 -0
  679. package/dist/partner-hook-utils/form/composeSubmitHandler.js.map +1 -0
  680. package/dist/partner-hook-utils/form/composeSubmitHandler.test.d.ts +1 -0
  681. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/CheckboxHookField.d.ts +3 -3
  682. package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +34 -0
  683. package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -0
  684. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/DatePickerHookField.d.ts +3 -3
  685. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/DatePickerHookField.js +1 -1
  686. package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -0
  687. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/NumberInputHookField.d.ts +3 -3
  688. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +40 -0
  689. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -0
  690. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/RadioGroupHookField.d.ts +3 -3
  691. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/RadioGroupHookField.js +10 -12
  692. package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -0
  693. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/SelectHookField.d.ts +3 -3
  694. package/dist/partner-hook-utils/form/fields/SelectHookField.js +40 -0
  695. package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -0
  696. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/SwitchHookField.d.ts +3 -3
  697. package/dist/partner-hook-utils/form/fields/SwitchHookField.js +34 -0
  698. package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -0
  699. package/dist/partner-hook-utils/form/fields/TextInputHookField.d.ts +12 -0
  700. package/dist/partner-hook-utils/form/fields/TextInputHookField.js +38 -0
  701. package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -0
  702. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/index.d.ts +7 -7
  703. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFieldWithOptions.d.ts +1 -1
  704. package/dist/partner-hook-utils/form/getFieldWithOptions.js.map +1 -0
  705. package/dist/partner-hook-utils/form/getFormSubmissionValues.js.map +1 -0
  706. package/dist/partner-hook-utils/form/getFormSubmissionValues.test.d.ts +1 -0
  707. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/index.d.ts +4 -6
  708. package/dist/partner-hook-utils/form/preprocessors.d.ts +3 -0
  709. package/dist/partner-hook-utils/form/preprocessors.js +15 -0
  710. package/dist/partner-hook-utils/form/preprocessors.js.map +1 -0
  711. package/dist/partner-hook-utils/form/resolveFieldError.d.ts +4 -0
  712. package/dist/partner-hook-utils/form/resolveFieldError.js +14 -0
  713. package/dist/partner-hook-utils/form/resolveFieldError.js.map +1 -0
  714. package/dist/partner-hook-utils/form/useDeriveFieldsMetadata.d.ts +17 -0
  715. package/dist/partner-hook-utils/form/useDeriveFieldsMetadata.js +21 -0
  716. package/dist/partner-hook-utils/form/useDeriveFieldsMetadata.js.map +1 -0
  717. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useFieldErrorMessage.d.ts +1 -1
  718. package/dist/partner-hook-utils/form/useFieldErrorMessage.js +17 -0
  719. package/dist/partner-hook-utils/form/useFieldErrorMessage.js.map +1 -0
  720. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useHookFieldResolution.d.ts +2 -2
  721. package/dist/partner-hook-utils/form/useHookFieldResolution.js.map +1 -0
  722. package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/withOptions.d.ts +1 -1
  723. package/dist/partner-hook-utils/form/withOptions.js.map +1 -0
  724. package/dist/partner-hook-utils/index.d.ts +5 -0
  725. package/dist/{types/sdkHooks.d.ts → partner-hook-utils/types.d.ts} +38 -12
  726. package/dist/shared/constants.d.ts +11 -1
  727. package/dist/shared/constants.js +30 -26
  728. package/dist/shared/constants.js.map +1 -1
  729. package/dist/style.css +1 -1
  730. package/dist/types/i18next.d.ts +228 -146
  731. package/dist/types/sdkError.js.map +1 -1
  732. package/docs/reference/endpoint-inventory.json +635 -165
  733. package/package.json +27 -31
  734. package/dist/UNSTABLE_Hooks.d.ts +0 -1
  735. package/dist/UNSTABLE_Hooks.js +0 -53
  736. package/dist/UNSTABLE_Hooks.js.map +0 -1
  737. package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +0 -7
  738. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +0 -1
  739. package/dist/components/Employee/EmployeeList/EmployeeListView.js +0 -132
  740. package/dist/components/Employee/EmployeeList/EmployeeListView.js.map +0 -1
  741. package/dist/components/Employee/EmployeeList/ManagementEmployeeList.js.map +0 -1
  742. package/dist/components/Employee/EmployeeList/ManagementEmployeeListView.js.map +0 -1
  743. package/dist/components/Employee/EmployeeList/index.d.ts +0 -3
  744. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +0 -1
  745. package/dist/components/Employee/Profile/Actions.d.ts +0 -1
  746. package/dist/components/Employee/Profile/Actions.js +0 -15
  747. package/dist/components/Employee/Profile/Actions.js.map +0 -1
  748. package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +0 -33
  749. package/dist/components/Employee/Profile/AdminPersonalDetails.js +0 -60
  750. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +0 -1
  751. package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js +0 -8
  752. package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js.map +0 -1
  753. package/dist/components/Employee/Profile/Head.d.ts +0 -1
  754. package/dist/components/Employee/Profile/Head.js +0 -14
  755. package/dist/components/Employee/Profile/Head.js.map +0 -1
  756. package/dist/components/Employee/Profile/HomeAddress.d.ts +0 -31
  757. package/dist/components/Employee/Profile/HomeAddress.js +0 -128
  758. package/dist/components/Employee/Profile/HomeAddress.js.map +0 -1
  759. package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +0 -49
  760. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +0 -146
  761. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +0 -1
  762. package/dist/components/Employee/Profile/SelfPersonalDetails.d.ts +0 -16
  763. package/dist/components/Employee/Profile/SelfPersonalDetails.js +0 -29
  764. package/dist/components/Employee/Profile/SelfPersonalDetails.js.map +0 -1
  765. package/dist/components/Employee/Profile/WorkAddress.d.ts +0 -1
  766. package/dist/components/Employee/Profile/WorkAddress.js +0 -21
  767. package/dist/components/Employee/Profile/WorkAddress.js.map +0 -1
  768. package/dist/components/Employee/Profile/WorkAddress.module.scss.js +0 -8
  769. package/dist/components/Employee/Profile/WorkAddress.module.scss.js.map +0 -1
  770. package/dist/components/Employee/Profile/getEmployeeAddressForProfile.d.ts +0 -2
  771. package/dist/components/Employee/Profile/getEmployeeAddressForProfile.js +0 -8
  772. package/dist/components/Employee/Profile/getEmployeeAddressForProfile.js.map +0 -1
  773. package/dist/components/Employee/Profile/useProfile.d.ts +0 -16
  774. package/dist/components/Employee/Profile/useProfile.js +0 -22
  775. package/dist/components/Employee/Profile/useProfile.js.map +0 -1
  776. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +0 -1
  777. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js.map +0 -1
  778. package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js.map +0 -1
  779. package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.d.ts +0 -26
  780. package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js +0 -24
  781. package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js.map +0 -1
  782. package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js +0 -34
  783. package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js.map +0 -1
  784. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +0 -3
  785. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js +0 -14
  786. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js.map +0 -1
  787. package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +0 -36
  788. package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +0 -1
  789. package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js.map +0 -1
  790. package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +0 -42
  791. package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +0 -1
  792. package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +0 -1
  793. package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js +0 -42
  794. package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +0 -1
  795. package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +0 -36
  796. package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +0 -1
  797. package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.d.ts +0 -12
  798. package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +0 -40
  799. package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +0 -1
  800. package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js.map +0 -1
  801. package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js.map +0 -1
  802. package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.d.ts +0 -4
  803. package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js +0 -13
  804. package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js.map +0 -1
  805. package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.d.ts +0 -6
  806. package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js +0 -14
  807. package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js.map +0 -1
  808. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +0 -17
  809. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +0 -1
  810. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +0 -4
  811. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js +0 -8
  812. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +0 -1
  813. package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.js.map +0 -1
  814. package/dist/components/UNSTABLE_Hooks/form/withOptions.js.map +0 -1
  815. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.d.ts +0 -5
  816. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +0 -150
  817. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js.map +0 -1
  818. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.d.ts +0 -97
  819. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js +0 -118
  820. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js.map +0 -1
  821. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js.map +0 -1
  822. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/index.d.ts +0 -7
  823. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +0 -104
  824. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +0 -259
  825. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +0 -1
  826. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.d.ts +0 -5
  827. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +0 -113
  828. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js.map +0 -1
  829. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js +0 -45
  830. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js.map +0 -1
  831. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js.map +0 -1
  832. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +0 -77
  833. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js +0 -153
  834. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +0 -1
  835. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.d.ts +0 -5
  836. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +0 -70
  837. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js.map +0 -1
  838. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js.map +0 -1
  839. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.d.ts +0 -68
  840. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js +0 -129
  841. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js.map +0 -1
  842. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js +0 -24
  843. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js.map +0 -1
  844. package/dist/components/UNSTABLE_Hooks/index.d.ts +0 -9
  845. package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.d.ts +0 -6
  846. package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.js +0 -50
  847. package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.js.map +0 -1
  848. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/shared/EmployeeTable/EmployeeTable.d.ts +0 -2
  849. package/dist/helpers/collectErrors.js.map +0 -1
  850. package/dist/helpers/requiredIf.d.ts +0 -13
  851. package/dist/helpers/requiredIf.js +0 -8
  852. package/dist/helpers/requiredIf.js.map +0 -1
  853. package/dist/hooks/useErrorHandling.d.ts +0 -9
  854. package/dist/hooks/useErrorHandling.js +0 -12
  855. package/dist/hooks/useErrorHandling.js.map +0 -1
  856. package/dist/i18n/en/UNSTABLE.CompensationForm.json.js +0 -58
  857. package/dist/i18n/en/UNSTABLE.CompensationForm.json.js.map +0 -1
  858. package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js +0 -34
  859. package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js.map +0 -1
  860. package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js +0 -24
  861. package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js.map +0 -1
  862. /package/dist/components/Employee/{Profile/getEmployeeAddressForProfile.test.d.ts → Compensation/shared/useCompensationForm/compensationSchemaParity.test.d.ts} +0 -0
  863. /package/dist/components/UNSTABLE_TimeOff/{TimeOffManagement/shared → shared}/EmployeeTable/index.d.ts +0 -0
  864. /package/dist/components/{UNSTABLE_Hooks/form/composeSubmitHandler.test.d.ts → UNSTABLE_TimeOff/shared/holidayHelpers.test.d.ts} +0 -0
  865. /package/dist/{components/UNSTABLE_Hooks/form/deriveFieldsMetadata.test.d.ts → hooks/useCompanyPaymentSpeed.test.d.ts} +0 -0
  866. /package/dist/{helpers → partner-hook-utils}/collectErrors.d.ts +0 -0
  867. /package/dist/{helpers → partner-hook-utils}/collectErrors.js +0 -0
  868. /package/dist/{components/UNSTABLE_Hooks/form/getFormSubmissionValues.test.d.ts → partner-hook-utils/composeErrorHandler.test.d.ts} +0 -0
  869. /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/FormFieldsMetadataContext.js +0 -0
  870. /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/FormFieldsMetadataProvider.js +0 -0
  871. /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/SDKFormProvider.js +0 -0
  872. /package/dist/{hooks/useErrorHandling.test.d.ts → partner-hook-utils/form/buildFormSchema.test.d.ts} +0 -0
  873. /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFieldWithOptions.js +0 -0
  874. /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFormSubmissionValues.d.ts +0 -0
  875. /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFormSubmissionValues.js +0 -0
  876. /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useHookFieldResolution.js +0 -0
  877. /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/withOptions.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sources":["../../../src/components/Payroll/helpers.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport {\n type PayrollShowFixedCompensations,\n OffCycleReasonType,\n} from '@gusto/embedded-api/models/components/payroll'\nimport type { PayrollEmployeeCompensationsTypeFixedCompensations as FixedCompensations } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollFixedCompensationTypesType } from '@gusto/embedded-api/models/components/payrollfixedcompensationtypestype'\nimport { useCallback } from 'react'\nimport type { TFunction } from 'i18next'\nimport { useTranslation } from 'react-i18next'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Compensation, MinimumWages } from '@gusto/embedded-api/models/components/compensation'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport type { PayrollType } from './PayrollList/types'\nimport { PayrollCategory, isOffCyclePayroll } from './payrollTypes'\nimport { formatPayRate } from '@/helpers/formattedStrings'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { COMPENSATION_NAME_REIMBURSEMENT, FlsaStatus } from '@/shared/constants'\nimport { MS_PER_HOUR } from '@/helpers/dateFormatting'\nconst REGULAR_HOURS_NAME = 'regular hours'\n\n// Utility to get the primary job from an employee\nexport const getPrimaryJob = (employee: Employee) => {\n return employee.jobs?.find(job => job.primary) || employee.jobs?.[0] || null\n}\n\nconst roundToSixDecimals = (value: number): number => {\n return Math.round(value * 1_000_000) / 1_000_000\n}\n\nconst roundToTwoDecimals = (value: number): number => {\n return Math.round(value * 100) / 100\n}\n\nconst isRegularHours = (compensationName: string): boolean => {\n return compensationName.toLowerCase() === REGULAR_HOURS_NAME\n}\n\nconst PAY_PERIOD_HOURS_MAPPINGS: Record<string, number> = {\n Daily: 8.0,\n 'Every week': 40.0,\n 'Every other week': 80.0,\n 'Twice per month': 86.666667,\n Monthly: 173.333333,\n Quarterly: 520.0,\n Semiannually: 1040.0,\n Annually: 2080.0,\n}\n\nexport const formatEmployeePayRate = ({\n employee,\n t,\n locale = 'en-US',\n}: {\n employee?: Employee\n t: TFunction\n locale?: string\n}) => {\n if (!employee?.jobs) {\n return null\n }\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return null\n }\n\n const jobCompensation = primaryJob.compensations[0]\n if (!jobCompensation) {\n return null\n }\n if (!jobCompensation.rate || parseFloat(jobCompensation.rate) === 0) {\n return null\n }\n\n const rate = parseFloat(jobCompensation.rate)\n const paymentUnit = jobCompensation.paymentUnit || 'Hour'\n\n return formatPayRate({ rate, paymentUnit, t, locale })\n}\n\nexport const useFormatEmployeePayRate = () => {\n const { t } = useTranslation('common')\n const { locale } = useLocale()\n\n return useCallback(\n (employee?: Employee) => {\n return formatEmployeePayRate({ employee, t, locale })\n },\n [t, locale],\n )\n}\n\nexport const getEmployeePayRateInfo = (employee: Employee | undefined) => {\n if (!employee?.jobs) {\n return null\n }\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return null\n }\n\n const jobCompensation = primaryJob.compensations[0]\n if (!jobCompensation) {\n return null\n }\n if (!jobCompensation.rate || parseFloat(jobCompensation.rate) === 0) {\n return null\n }\n\n const rate = parseFloat(jobCompensation.rate)\n const paymentUnit = jobCompensation.paymentUnit || 'Hour'\n\n return { rate, paymentUnit }\n}\n\nexport const getRegularHours = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.hourlyCompensations) return 0\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => hourlyCompensation.name?.toLowerCase() === 'regular hours')\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\nexport function getOvertimeHours(compensation: PayrollEmployeeCompensationsType) {\n if (!compensation.hourlyCompensations || compensation.excluded) {\n return 0\n }\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => Number(hourlyCompensation.compensationMultiplier) > 1)\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\nexport const getTotalPtoHours = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n return compensation.paidTimeOff.reduce((sum, pto) => sum + parseFloat(pto.hours || '0'), 0)\n}\n\nexport const getAdditionalEarnings = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n return compensation.fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase() || ''\n const amount = parseFloat(fixedCompensation.amount || '0')\n return name !== 'reimbursement' && name !== 'minimum wage adjustment' && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\nexport const getReimbursements = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n const reimbursementComp = compensation.fixedCompensations.find(\n fixedCompensation => fixedCompensation.name?.toLowerCase() === 'reimbursement',\n )\n return reimbursementComp ? parseFloat(reimbursementComp.amount || '0') : 0\n}\n\nexport const formatHoursDisplay = (hours: number): string => {\n const rounded = roundToTwoDecimals(hours)\n\n if (rounded % 1 === 0) {\n return `${rounded}.0`\n }\n\n return rounded.toString()\n}\n\nconst getHoursInPayPeriod = (paySchedule: PayScheduleObject): number => {\n if (!paySchedule.frequency) {\n return 0\n }\n\n return PAY_PERIOD_HOURS_MAPPINGS[paySchedule.frequency] || 0\n}\n\nconst getEffectiveCompensation = (\n compensations: Compensation[],\n effectiveDate: Date,\n): Compensation | null => {\n if (!compensations.length) return null\n\n const sorted = [...compensations].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst getEffectiveMinimumWage = (\n minimumWages: MinimumWages[],\n effectiveDate: Date,\n): MinimumWages | null => {\n if (!minimumWages.length) return null\n\n const sorted = [...minimumWages].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst isSalaried = (compensation: Compensation): boolean => {\n return compensation.flsaStatus === 'Exempt' || compensation.flsaStatus === 'Salaried Nonexempt'\n}\n\nconst getTotalTipCompensations = (fixedCompensations: PayrollShowFixedCompensations[]): number => {\n if (!fixedCompensations.length) return 0\n\n return fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase()\n const amount = parseFloat(fixedCompensation.amount || '0')\n return (name === 'paycheck tips' || name === 'cash tips') && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\nconst calculateHourlyRate = (compensation: Compensation): number => {\n const rate = parseFloat(compensation.rate || '0')\n const paymentUnit = compensation.paymentUnit || 'Hour'\n\n switch (paymentUnit) {\n case 'Hour':\n return rate\n case 'Year':\n return rate / 2080 // 52 weeks * 40 hours\n case 'Month':\n return rate / 173.333333\n case 'Week':\n return rate / 40\n case 'Paycheck':\n return 0 // Paycheck rate is 0 for hourly calculation\n default:\n return rate\n }\n}\n\nconst getHourlyRateForJob = (employee: Employee, jobUuid: string, effectiveDate: Date): number => {\n const job = employee.jobs?.find(j => j.uuid === jobUuid)\n if (!job?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(job.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getPrimaryHourlyRate = (employee: Employee, effectiveDate: Date): number => {\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(primaryJob.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getTotalOutstandingPtoHours = (compensation: PayrollEmployeeCompensationsType): number => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n\n return compensation.paidTimeOff.reduce(\n (sum, paidTimeOff) => sum + parseFloat(paidTimeOff.finalPayoutUnusedHoursInput || '0'),\n 0,\n )\n}\n\nconst getPtoHours = (\n compensation: PayrollEmployeeCompensationsType,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const regularPtoHours = getTotalPtoHours(compensation)\n\n if (offCycle) {\n const outstandingPtoHours = getTotalOutstandingPtoHours(compensation)\n return regularPtoHours + outstandingPtoHours\n }\n\n if (isSalariedWithExpectedHours) {\n return Math.min(hoursInPayPeriod, regularPtoHours)\n }\n\n return regularPtoHours\n}\n\nconst calculateMinimumWageAdjustment = (\n primaryCompensation: Compensation,\n compensation: PayrollEmployeeCompensationsType,\n effectiveDate: Date,\n): number => {\n if (!primaryCompensation.adjustForMinimumWage) return 0\n\n const effectiveMinWage = getEffectiveMinimumWage(\n primaryCompensation.minimumWages || [],\n effectiveDate,\n )\n if (!effectiveMinWage) {\n return 0\n }\n\n const totalHours =\n compensation.hourlyCompensations?.reduce(\n (sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'),\n 0,\n ) || 0\n\n const hourlyRate = calculateHourlyRate(primaryCompensation)\n\n const totalTipCredit = (parseFloat(effectiveMinWage.wage || '0') - hourlyRate) * totalHours\n const totalTips = getTotalTipCompensations(compensation.fixedCompensations || [])\n\n return Math.max(0, totalTipCredit - totalTips)\n}\n\nconst calculateRegularPlusOvertimePay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n ptoHours: number,\n isOffCycle: boolean,\n): number => {\n if (!isOffCycle && isSalariedWithExpectedHours) {\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return primaryHourlyRate * (hoursInPayPeriod - ptoHours)\n }\n\n if (!compensation.hourlyCompensations || !employee.jobs) {\n return 0\n }\n\n const regularRatePay = compensation.hourlyCompensations.reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const hourlyRate = getHourlyRateForJob(employee, hc.jobUuid || '', effectiveDate)\n return sum + hours * hourlyRate\n }, 0)\n\n const totalHours = compensation.hourlyCompensations.reduce((sum, hc) => {\n return sum + parseFloat(hc.hours || '0')\n }, 0)\n\n if (totalHours === 0) return regularRatePay\n\n const overtimeWeightedRate = roundToSixDecimals(regularRatePay / totalHours)\n\n // Calculate overtime pay for non-regular hours\n const overtimePay = compensation.hourlyCompensations\n .filter(hc => !isRegularHours(hc.name || ''))\n .reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const multiplier = hc.compensationMultiplier || 1\n return sum + hours * overtimeWeightedRate * (multiplier - 1)\n }, 0)\n\n return regularRatePay + overtimePay\n}\n\nconst calculatePtoPay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return ptoHours * primaryHourlyRate\n}\n\nconst isSalariedWithPayPeriodExpectedHours = (\n compensation: PayrollEmployeeCompensationsType,\n isSalaried: boolean,\n hoursInPayPeriod: number,\n): boolean => {\n if (!isSalaried) return false\n\n const regularHourlyCompensation = compensation.hourlyCompensations?.find(hourlyCompensation =>\n isRegularHours(hourlyCompensation.name || ''),\n )\n\n if (!regularHourlyCompensation) return false\n\n const regularHours = parseFloat(regularHourlyCompensation.hours || '0')\n return regularHours === hoursInPayPeriod\n}\n\nexport const calculateGrossPay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n compensationEffectiveDateString?: string,\n paySchedule?: PayScheduleObject,\n payrollCategory: PayrollCategory = PayrollCategory.Regular,\n): number => {\n if (compensation.excluded) {\n return 0\n }\n\n const compensationEffectiveDate = compensationEffectiveDateString\n ? new Date(compensationEffectiveDateString)\n : new Date()\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const primaryCompensation = getEffectiveCompensation(\n primaryJob.compensations,\n compensationEffectiveDate,\n )\n\n if (!primaryCompensation) {\n return 0\n }\n\n const salaried = isSalaried(primaryCompensation)\n const hoursInPayPeriod = paySchedule ? getHoursInPayPeriod(paySchedule) : 0\n\n const isSalariedWithExpectedHours = isSalariedWithPayPeriodExpectedHours(\n compensation,\n salaried,\n hoursInPayPeriod,\n )\n\n const offCycle = isOffCyclePayroll(payrollCategory)\n\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n\n const regularPlusOvertimePay = calculateRegularPlusOvertimePay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n ptoHours,\n offCycle,\n )\n\n const fixedPay = getAdditionalEarnings(compensation)\n const ptoPay = calculatePtoPay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n const minimumWageAdjustment = calculateMinimumWageAdjustment(\n primaryCompensation,\n compensation,\n compensationEffectiveDate,\n )\n\n const total = regularPlusOvertimePay + fixedPay + ptoPay + minimumWageAdjustment\n return roundToTwoDecimals(total)\n}\n\n// Payroll type and status utilities\nexport const getPayrollType = (payroll: {\n external?: boolean\n offCycle?: boolean\n}): PayrollType => {\n if (payroll.external) return 'External'\n if (payroll.offCycle) return 'Off-Cycle'\n return 'Regular'\n}\n\nexport const isDismissalPayroll = (offCycleReason?: string | null): boolean =>\n offCycleReason === OffCycleReasonType.DismissedEmployee\n\nconst OFF_CYCLE_REASON_LABELS: Record<string, string> = {\n Bonus: 'Bonus',\n Correction: 'Correction',\n 'Transition from old pay schedule': 'Transition',\n 'Dismissed employee': 'Dismissal',\n 'Hired employee': 'New Hire',\n 'Benefit reversal': 'Benefit Reversal',\n 'Wage correction': 'Wage Correction',\n 'Tax reconciliation': 'Tax Reconciliation',\n Reversal: 'Reversal',\n 'Disability insurance distribution': 'Disability Insurance',\n}\n\nexport const getPayrollTypeLabel = (payroll: {\n external?: boolean\n offCycle?: boolean\n offCycleReason?: string | null\n}): string => {\n if (payroll.external) return 'External'\n if (payroll.offCycle && payroll.offCycleReason) {\n return OFF_CYCLE_REASON_LABELS[payroll.offCycleReason] ?? payroll.offCycleReason\n }\n if (payroll.offCycle) return 'Off-Cycle'\n return 'Regular'\n}\n\nexport const getAdditionalEarningsCompensations = ({\n flsaStatus,\n existingFixedCompensations = [],\n primaryJobUuid,\n fixedCompensationTypes = [],\n excludedTypes = [],\n}: {\n flsaStatus: string | undefined\n existingFixedCompensations?: FixedCompensations[]\n primaryJobUuid?: string\n fixedCompensationTypes?: PayrollFixedCompensationTypesType[]\n excludedTypes?: string[]\n}): FixedCompensations[] => {\n const allFixedCompensations = [...existingFixedCompensations]\n\n if (flsaStatus !== FlsaStatus.OWNER && primaryJobUuid && fixedCompensationTypes.length > 0) {\n const compensationTypeNames = fixedCompensationTypes\n .map(type => type.name)\n .filter(Boolean) as string[]\n\n compensationTypeNames.forEach(compensationName => {\n const exists = allFixedCompensations.some(\n comp => comp.name?.toLowerCase() === compensationName.toLowerCase(),\n )\n\n if (!exists) {\n allFixedCompensations.push({\n name: compensationName,\n amount: '0.00',\n jobUuid: primaryJobUuid,\n })\n }\n })\n }\n\n // Filter and sort additional earnings (exclude specified types)\n return allFixedCompensations\n .filter(comp => comp.name && !excludedTypes.includes(comp.name))\n .sort((a, b) => (a.name || '').localeCompare(b.name || ''))\n}\n\nexport const getReimbursementCompensation = (\n fixedCompensations: FixedCompensations[],\n fixedCompensationTypes: PayrollFixedCompensationTypesType[],\n primaryJobUuid?: string,\n) => {\n const reimbursementCompensation = fixedCompensations.find(\n comp => comp.name?.toLowerCase() === COMPENSATION_NAME_REIMBURSEMENT.toLowerCase(),\n )\n\n if (reimbursementCompensation) {\n return reimbursementCompensation\n }\n\n if (\n primaryJobUuid &&\n fixedCompensationTypes.some(\n type => type.name?.toLowerCase() === COMPENSATION_NAME_REIMBURSEMENT.toLowerCase(),\n )\n ) {\n return {\n name: COMPENSATION_NAME_REIMBURSEMENT,\n amount: '0.00',\n jobUuid: primaryJobUuid,\n }\n }\n\n return null\n}\n\nexport const hasDirectDepositEmployees = (\n employeeCompensations?: Array<{ paymentMethod?: string | null; excluded?: boolean }>,\n): boolean => {\n if (!employeeCompensations || employeeCompensations.length === 0) return true\n const activeCompensations = employeeCompensations.filter(comp => !comp.excluded)\n if (activeCompensations.length === 0) return true\n return activeCompensations.some(comp => comp.paymentMethod === 'Direct Deposit')\n}\n\n// Total Payroll = Gross Pay + Employer Taxes + Reimbursements + Benefits\nexport const calculateTotalPayroll = (payrollData: Payroll) => {\n const totalPayroll = payrollData.totals\n ? Number(payrollData.totals.grossPay ?? 0) +\n Number(payrollData.totals.employerTaxes ?? 0) +\n Number(payrollData.totals.reimbursements ?? 0) +\n Number(payrollData.totals.benefits ?? 0)\n : 0\n\n return totalPayroll\n}\n\n/**\n * Converts a Date to Pacific Time considering Daylight Saving Time.\n * Returns the UTC offset in hours (e.g., -7 for PDT, -8 for PST).\n *\n * DST rules for Pacific Time:\n * - Starts: Second Sunday in March at 2:00 AM\n * - Ends: First Sunday in November at 2:00 AM\n */\nconst getPacificTimeOffset = (date: Date): number => {\n const year = date.getFullYear()\n\n const secondSundayMarch = new Date(year, 2, 1)\n secondSundayMarch.setDate(1 + (7 - secondSundayMarch.getDay()) + 7)\n\n const firstSundayNovember = new Date(year, 10, 1)\n firstSundayNovember.setDate(1 + ((7 - firstSundayNovember.getDay()) % 7))\n\n const isDST = date >= secondSundayMarch && date < firstSundayNovember\n return isDST ? -7 : -8\n}\n\n/**\n * Determines if a payroll can be cancelled based on business rules.\n *\n * A payroll can be cancelled if all of the following conditions are met:\n * - The payroll has been processed (processed === true)\n * - Current time is before 4:00 PM PT on the payroll deadline\n * - The payrollStatusMeta.cancellable flag is not explicitly false\n *\n * This check enforces the business rule that payrolls can only be cancelled\n * before the 4:00 PM PT cutoff time on their deadline date.\n */\nexport const canCancelPayroll = (payroll: Payroll): boolean => {\n if (payroll.payrollStatusMeta?.cancellable === false) {\n return false\n }\n\n if (!payroll.processed) {\n return false\n }\n\n if (!payroll.payrollDeadline) {\n return false\n }\n\n const now = new Date()\n const deadline = new Date(payroll.payrollDeadline)\n\n const nowInPT = new Date(now.getTime() + getPacificTimeOffset(now) * MS_PER_HOUR)\n const deadlineInPT = new Date(deadline.getTime() + getPacificTimeOffset(deadline) * MS_PER_HOUR)\n\n const cutoffTime = new Date(deadlineInPT)\n cutoffTime.setUTCHours(16, 0, 0, 0)\n\n if (nowInPT >= cutoffTime) {\n return false\n }\n\n return true\n}\n"],"names":["REGULAR_HOURS_NAME","getPrimaryJob","employee","job","roundToSixDecimals","value","roundToTwoDecimals","isRegularHours","compensationName","PAY_PERIOD_HOURS_MAPPINGS","formatEmployeePayRate","locale","primaryJob","jobCompensation","rate","paymentUnit","formatPayRate","useFormatEmployeePayRate","t","useTranslation","useLocale","useCallback","getRegularHours","compensation","hourlyCompensation","sum","getOvertimeHours","getTotalPtoHours","pto","getAdditionalEarnings","fixedCompensation","name","amount","getReimbursements","reimbursementComp","formatHoursDisplay","hours","rounded","getHoursInPayPeriod","paySchedule","getEffectiveCompensation","compensations","effectiveDate","sorted","a","b","i","currentDateString","currentDate","getEffectiveMinimumWage","minimumWages","isSalaried","getTotalTipCompensations","fixedCompensations","calculateHourlyRate","getHourlyRateForJob","jobUuid","j","getPrimaryHourlyRate","getTotalOutstandingPtoHours","paidTimeOff","getPtoHours","isSalariedWithExpectedHours","hoursInPayPeriod","offCycle","regularPtoHours","outstandingPtoHours","calculateMinimumWageAdjustment","primaryCompensation","effectiveMinWage","totalHours","hourlyRate","totalTipCredit","totalTips","calculateRegularPlusOvertimePay","ptoHours","isOffCycle","regularRatePay","hc","overtimeWeightedRate","overtimePay","multiplier","calculatePtoPay","primaryHourlyRate","isSalariedWithPayPeriodExpectedHours","regularHourlyCompensation","calculateGrossPay","compensationEffectiveDateString","payrollCategory","PayrollCategory","compensationEffectiveDate","salaried","isOffCyclePayroll","regularPlusOvertimePay","fixedPay","ptoPay","minimumWageAdjustment","total","isDismissalPayroll","offCycleReason","OffCycleReasonType","OFF_CYCLE_REASON_LABELS","getPayrollTypeLabel","payroll","getAdditionalEarningsCompensations","flsaStatus","existingFixedCompensations","primaryJobUuid","fixedCompensationTypes","excludedTypes","allFixedCompensations","FlsaStatus","type","comp","getReimbursementCompensation","reimbursementCompensation","COMPENSATION_NAME_REIMBURSEMENT","hasDirectDepositEmployees","employeeCompensations","activeCompensations","calculateTotalPayroll","payrollData","getPacificTimeOffset","date","year","secondSundayMarch","firstSundayNovember","canCancelPayroll","now","deadline","nowInPT","MS_PER_HOUR","deadlineInPT","cutoffTime"],"mappings":";;;;;;;;AAoBA,MAAMA,IAAqB,iBAGdC,IAAgB,CAACC,MACrBA,EAAS,MAAM,KAAK,CAAAC,MAAOA,EAAI,OAAO,KAAKD,EAAS,OAAO,CAAC,KAAK,MAGpEE,IAAqB,CAACC,MACnB,KAAK,MAAMA,IAAQ,GAAS,IAAI,KAGnCC,IAAqB,CAACD,MACnB,KAAK,MAAMA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C,EAAkB,QAAQ,KAAK,IAAIA,EAAkB,OAAA,KAAY,CAAC;AAElE,QAAMC,IAAsB,IAAI,KAAKF,GAAM,IAAI,CAAC;AAChD,SAAAE,EAAoB,QAAQ,KAAM,IAAIA,EAAoB,OAAA,KAAY,CAAE,GAE1DH,KAAQE,KAAqBF,IAAOG,IACnC,KAAK;AACtB,GAaaC,KAAmB,CAACxB,MAA8B;AAS7D,MARIA,EAAQ,mBAAmB,gBAAgB,MAI3C,CAACA,EAAQ,aAIT,CAACA,EAAQ;AACX,WAAO;AAGT,QAAMyB,wBAAU,KAAA,GACVC,IAAW,IAAI,KAAK1B,EAAQ,eAAe,GAE3C2B,IAAU,IAAI,KAAKF,EAAI,YAAYN,EAAqBM,CAAG,IAAIG,CAAW,GAC1EC,IAAe,IAAI,KAAKH,EAAS,YAAYP,EAAqBO,CAAQ,IAAIE,CAAW,GAEzFE,IAAa,IAAI,KAAKD,CAAY;AAGxC,SAFAC,EAAW,YAAY,IAAI,GAAG,GAAG,CAAC,GAE9B,EAAAH,KAAWG;AAKjB;"}
1
+ {"version":3,"file":"helpers.js","sources":["../../../src/components/Payroll/helpers.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport {\n type PayrollShowFixedCompensations,\n OffCycleReasonType,\n} from '@gusto/embedded-api/models/components/payroll'\nimport type { PayrollEmployeeCompensationsTypeFixedCompensations as FixedCompensations } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollFixedCompensationTypesType } from '@gusto/embedded-api/models/components/payrollfixedcompensationtypestype'\nimport { useCallback } from 'react'\nimport type { TFunction } from 'i18next'\nimport { useTranslation } from 'react-i18next'\nimport type { PaySchedule as PayScheduleObject } from '@gusto/embedded-api/models/components/payschedule'\nimport type { Compensation, MinimumWages } from '@gusto/embedded-api/models/components/compensation'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport type { PayrollType } from './PayrollList/types'\nimport { PayrollCategory, isOffCyclePayroll } from './payrollTypes'\nimport { formatPayRate } from '@/helpers/formattedStrings'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { COMPENSATION_NAME_REIMBURSEMENT, FlsaStatus } from '@/shared/constants'\nimport { MS_PER_HOUR } from '@/helpers/dateFormatting'\nconst REGULAR_HOURS_NAME = 'regular hours'\n\n// Utility to get the primary job from an employee\nexport const getPrimaryJob = (employee: Employee) => {\n return employee.jobs?.find(job => job.primary) || employee.jobs?.[0] || null\n}\n\nconst roundToSixDecimals = (value: number): number => {\n return Math.round(value * 1_000_000) / 1_000_000\n}\n\nconst roundToTwoDecimals = (value: number): number => {\n return Math.round(value * 100) / 100\n}\n\nconst isRegularHours = (compensationName: string): boolean => {\n return compensationName.toLowerCase() === REGULAR_HOURS_NAME\n}\n\nconst PAY_PERIOD_HOURS_MAPPINGS: Record<string, number> = {\n Daily: 8.0,\n 'Every week': 40.0,\n 'Every other week': 80.0,\n 'Twice per month': 86.666667,\n Monthly: 173.333333,\n Quarterly: 520.0,\n Semiannually: 1040.0,\n Annually: 2080.0,\n}\n\nexport const formatEmployeePayRate = ({\n employee,\n t,\n locale = 'en-US',\n}: {\n employee?: Employee\n t: TFunction\n locale?: string\n}) => {\n if (!employee?.jobs) {\n return null\n }\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return null\n }\n\n const jobCompensation = primaryJob.compensations[0]\n if (!jobCompensation) {\n return null\n }\n if (!jobCompensation.rate || parseFloat(jobCompensation.rate) === 0) {\n return null\n }\n\n const rate = parseFloat(jobCompensation.rate)\n const paymentUnit = jobCompensation.paymentUnit || 'Hour'\n\n return formatPayRate({ rate, paymentUnit, t, locale })\n}\n\nexport const useFormatEmployeePayRate = () => {\n const { t } = useTranslation('common')\n const { locale } = useLocale()\n\n return useCallback(\n (employee?: Employee) => {\n return formatEmployeePayRate({ employee, t, locale })\n },\n [t, locale],\n )\n}\n\nexport const getEmployeePayRateInfo = (employee: Employee | undefined) => {\n if (!employee?.jobs) {\n return null\n }\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return null\n }\n\n const jobCompensation = primaryJob.compensations[0]\n if (!jobCompensation) {\n return null\n }\n if (!jobCompensation.rate || parseFloat(jobCompensation.rate) === 0) {\n return null\n }\n\n const rate = parseFloat(jobCompensation.rate)\n const paymentUnit = jobCompensation.paymentUnit || 'Hour'\n\n return { rate, paymentUnit }\n}\n\nexport const getRegularHours = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.hourlyCompensations) return 0\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => hourlyCompensation.name?.toLowerCase() === 'regular hours')\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\nexport function getOvertimeHours(compensation: PayrollEmployeeCompensationsType) {\n if (!compensation.hourlyCompensations || compensation.excluded) {\n return 0\n }\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => Number(hourlyCompensation.compensationMultiplier) > 1)\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\nexport const getTotalPtoHours = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n return compensation.paidTimeOff.reduce((sum, pto) => sum + parseFloat(pto.hours || '0'), 0)\n}\n\nexport const getAdditionalEarnings = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n return compensation.fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase() || ''\n const amount = parseFloat(fixedCompensation.amount || '0')\n return name !== 'reimbursement' && name !== 'minimum wage adjustment' && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\nexport const getReimbursements = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n const reimbursementComp = compensation.fixedCompensations.find(\n fixedCompensation => fixedCompensation.name?.toLowerCase() === 'reimbursement',\n )\n return reimbursementComp ? parseFloat(reimbursementComp.amount || '0') : 0\n}\n\nexport const formatHoursDisplay = (hours: number): string => {\n const rounded = roundToTwoDecimals(hours)\n\n if (rounded % 1 === 0) {\n return `${rounded}.0`\n }\n\n return rounded.toString()\n}\n\nconst getHoursInPayPeriod = (paySchedule: PayScheduleObject): number => {\n if (!paySchedule.frequency) {\n return 0\n }\n\n return PAY_PERIOD_HOURS_MAPPINGS[paySchedule.frequency] || 0\n}\n\nconst getEffectiveCompensation = (\n compensations: Compensation[],\n effectiveDate: Date,\n): Compensation | null => {\n if (!compensations.length) return null\n\n const sorted = [...compensations].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst getEffectiveMinimumWage = (\n minimumWages: MinimumWages[],\n effectiveDate: Date,\n): MinimumWages | null => {\n if (!minimumWages.length) return null\n\n const sorted = [...minimumWages].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst isSalaried = (compensation: Compensation): boolean => {\n return compensation.flsaStatus === 'Exempt' || compensation.flsaStatus === 'Salaried Nonexempt'\n}\n\nconst getTotalTipCompensations = (fixedCompensations: PayrollShowFixedCompensations[]): number => {\n if (!fixedCompensations.length) return 0\n\n return fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase()\n const amount = parseFloat(fixedCompensation.amount || '0')\n return (name === 'paycheck tips' || name === 'cash tips') && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\nconst calculateHourlyRate = (compensation: Compensation): number => {\n const rate = parseFloat(compensation.rate || '0')\n const paymentUnit = compensation.paymentUnit || 'Hour'\n\n switch (paymentUnit) {\n case 'Hour':\n return rate\n case 'Year':\n return rate / 2080 // 52 weeks * 40 hours\n case 'Month':\n return rate / 173.333333\n case 'Week':\n return rate / 40\n case 'Paycheck':\n return 0 // Paycheck rate is 0 for hourly calculation\n default:\n return rate\n }\n}\n\nconst getHourlyRateForJob = (employee: Employee, jobUuid: string, effectiveDate: Date): number => {\n const job = employee.jobs?.find(j => j.uuid === jobUuid)\n if (!job?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(job.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getPrimaryHourlyRate = (employee: Employee, effectiveDate: Date): number => {\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(primaryJob.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getTotalOutstandingPtoHours = (compensation: PayrollEmployeeCompensationsType): number => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n\n return compensation.paidTimeOff.reduce(\n (sum, paidTimeOff) => sum + parseFloat(paidTimeOff.finalPayoutUnusedHoursInput || '0'),\n 0,\n )\n}\n\nconst getPtoHours = (\n compensation: PayrollEmployeeCompensationsType,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const regularPtoHours = getTotalPtoHours(compensation)\n\n if (offCycle) {\n const outstandingPtoHours = getTotalOutstandingPtoHours(compensation)\n return regularPtoHours + outstandingPtoHours\n }\n\n if (isSalariedWithExpectedHours) {\n return Math.min(hoursInPayPeriod, regularPtoHours)\n }\n\n return regularPtoHours\n}\n\nconst calculateMinimumWageAdjustment = (\n primaryCompensation: Compensation,\n compensation: PayrollEmployeeCompensationsType,\n effectiveDate: Date,\n): number => {\n if (!primaryCompensation.adjustForMinimumWage) return 0\n\n const effectiveMinWage = getEffectiveMinimumWage(\n primaryCompensation.minimumWages || [],\n effectiveDate,\n )\n if (!effectiveMinWage) {\n return 0\n }\n\n const totalHours =\n compensation.hourlyCompensations?.reduce(\n (sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'),\n 0,\n ) || 0\n\n const hourlyRate = calculateHourlyRate(primaryCompensation)\n\n const totalTipCredit = (parseFloat(effectiveMinWage.wage || '0') - hourlyRate) * totalHours\n const totalTips = getTotalTipCompensations(compensation.fixedCompensations || [])\n\n return Math.max(0, totalTipCredit - totalTips)\n}\n\nconst calculateRegularPlusOvertimePay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n ptoHours: number,\n isOffCycle: boolean,\n): number => {\n if (!isOffCycle && isSalariedWithExpectedHours) {\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return primaryHourlyRate * (hoursInPayPeriod - ptoHours)\n }\n\n if (!compensation.hourlyCompensations || !employee.jobs) {\n return 0\n }\n\n const regularRatePay = compensation.hourlyCompensations.reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const hourlyRate = getHourlyRateForJob(employee, hc.jobUuid || '', effectiveDate)\n return sum + hours * hourlyRate\n }, 0)\n\n const totalHours = compensation.hourlyCompensations.reduce((sum, hc) => {\n return sum + parseFloat(hc.hours || '0')\n }, 0)\n\n if (totalHours === 0) return regularRatePay\n\n const overtimeWeightedRate = roundToSixDecimals(regularRatePay / totalHours)\n\n // Calculate overtime pay for non-regular hours\n const overtimePay = compensation.hourlyCompensations\n .filter(hc => !isRegularHours(hc.name || ''))\n .reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const multiplier = hc.compensationMultiplier || 1\n return sum + hours * overtimeWeightedRate * (multiplier - 1)\n }, 0)\n\n return regularRatePay + overtimePay\n}\n\nconst calculatePtoPay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return ptoHours * primaryHourlyRate\n}\n\nconst isSalariedWithPayPeriodExpectedHours = (\n compensation: PayrollEmployeeCompensationsType,\n isSalaried: boolean,\n hoursInPayPeriod: number,\n): boolean => {\n if (!isSalaried) return false\n\n const regularHourlyCompensation = compensation.hourlyCompensations?.find(hourlyCompensation =>\n isRegularHours(hourlyCompensation.name || ''),\n )\n\n if (!regularHourlyCompensation) return false\n\n const regularHours = parseFloat(regularHourlyCompensation.hours || '0')\n return regularHours === hoursInPayPeriod\n}\n\nexport const calculateGrossPay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n compensationEffectiveDateString?: string,\n paySchedule?: PayScheduleObject,\n payrollCategory: PayrollCategory = PayrollCategory.Regular,\n): number => {\n if (compensation.excluded) {\n return 0\n }\n\n const compensationEffectiveDate = compensationEffectiveDateString\n ? new Date(compensationEffectiveDateString)\n : new Date()\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const primaryCompensation = getEffectiveCompensation(\n primaryJob.compensations,\n compensationEffectiveDate,\n )\n\n if (!primaryCompensation) {\n return 0\n }\n\n const salaried = isSalaried(primaryCompensation)\n const hoursInPayPeriod = paySchedule ? getHoursInPayPeriod(paySchedule) : 0\n\n const isSalariedWithExpectedHours = isSalariedWithPayPeriodExpectedHours(\n compensation,\n salaried,\n hoursInPayPeriod,\n )\n\n const offCycle = isOffCyclePayroll(payrollCategory)\n\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n\n const regularPlusOvertimePay = calculateRegularPlusOvertimePay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n ptoHours,\n offCycle,\n )\n\n const fixedPay = getAdditionalEarnings(compensation)\n const ptoPay = calculatePtoPay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n const minimumWageAdjustment = calculateMinimumWageAdjustment(\n primaryCompensation,\n compensation,\n compensationEffectiveDate,\n )\n\n const total = regularPlusOvertimePay + fixedPay + ptoPay + minimumWageAdjustment\n return roundToTwoDecimals(total)\n}\n\n// Payroll type and status utilities\nexport const getPayrollType = (payroll: {\n external?: boolean\n offCycle?: boolean\n}): PayrollType => {\n if (payroll.external) return 'External'\n if (payroll.offCycle) return 'Off-Cycle'\n return 'Regular'\n}\n\nexport const isDismissalPayroll = (offCycleReason?: string | null): boolean =>\n offCycleReason === OffCycleReasonType.DismissedEmployee\n\nconst OFF_CYCLE_REASON_LABELS: Record<string, string> = {\n Bonus: 'Bonus',\n Correction: 'Correction',\n 'Transition from old pay schedule': 'Transition',\n 'Dismissed employee': 'Dismissal',\n 'Hired employee': 'New Hire',\n 'Benefit reversal': 'Benefit Reversal',\n 'Wage correction': 'Wage Correction',\n 'Tax reconciliation': 'Tax Reconciliation',\n Reversal: 'Reversal',\n 'Disability insurance distribution': 'Disability Insurance',\n}\n\nexport const getPayrollTypeLabel = (payroll: {\n external?: boolean\n offCycle?: boolean\n offCycleReason?: string | null\n}): string => {\n if (payroll.external) return 'External'\n if (payroll.offCycle && payroll.offCycleReason) {\n return OFF_CYCLE_REASON_LABELS[payroll.offCycleReason] ?? payroll.offCycleReason\n }\n if (payroll.offCycle) return 'Off-Cycle'\n return 'Regular'\n}\n\nexport const getAdditionalEarningsCompensations = ({\n flsaStatus,\n existingFixedCompensations = [],\n primaryJobUuid,\n fixedCompensationTypes = [],\n excludedTypes = [],\n}: {\n flsaStatus: string | undefined\n existingFixedCompensations?: FixedCompensations[]\n primaryJobUuid?: string\n fixedCompensationTypes?: PayrollFixedCompensationTypesType[]\n excludedTypes?: string[]\n}): FixedCompensations[] => {\n const allFixedCompensations = [...existingFixedCompensations]\n\n if (flsaStatus !== FlsaStatus.OWNER && primaryJobUuid && fixedCompensationTypes.length > 0) {\n const compensationTypeNames = fixedCompensationTypes\n .map(type => type.name)\n .filter(Boolean) as string[]\n\n compensationTypeNames.forEach(compensationName => {\n const exists = allFixedCompensations.some(\n comp => comp.name?.toLowerCase() === compensationName.toLowerCase(),\n )\n\n if (!exists) {\n allFixedCompensations.push({\n name: compensationName,\n amount: '0.00',\n jobUuid: primaryJobUuid,\n })\n }\n })\n }\n\n // Filter and sort additional earnings (exclude specified types)\n return allFixedCompensations\n .filter(comp => comp.name && !excludedTypes.includes(comp.name))\n .sort((a, b) => (a.name || '').localeCompare(b.name || ''))\n}\n\nexport const getReimbursementCompensation = (\n fixedCompensations: FixedCompensations[],\n fixedCompensationTypes: PayrollFixedCompensationTypesType[],\n primaryJobUuid?: string,\n) => {\n const reimbursementCompensation = fixedCompensations.find(\n comp => comp.name?.toLowerCase() === COMPENSATION_NAME_REIMBURSEMENT.toLowerCase(),\n )\n\n if (reimbursementCompensation) {\n return reimbursementCompensation\n }\n\n if (\n primaryJobUuid &&\n fixedCompensationTypes.some(\n type => type.name?.toLowerCase() === COMPENSATION_NAME_REIMBURSEMENT.toLowerCase(),\n )\n ) {\n return {\n name: COMPENSATION_NAME_REIMBURSEMENT,\n amount: '0.00',\n jobUuid: primaryJobUuid,\n }\n }\n\n return null\n}\n\nexport const hasDirectDepositEmployees = (\n employeeCompensations?: Array<{ paymentMethod?: string | null; excluded?: boolean }>,\n): boolean => {\n if (!employeeCompensations || employeeCompensations.length === 0) return true\n const activeCompensations = employeeCompensations.filter(comp => !comp.excluded)\n if (activeCompensations.length === 0) return true\n return activeCompensations.some(comp => comp.paymentMethod === 'Direct Deposit')\n}\n\n// Total Payroll = Gross Pay + Employer Taxes + Reimbursements + Benefits\nexport const calculateTotalPayroll = (payrollData: Payroll) => {\n const totalPayroll = payrollData.totals\n ? Number(payrollData.totals.grossPay ?? 0) +\n Number(payrollData.totals.employerTaxes ?? 0) +\n Number(payrollData.totals.reimbursements ?? 0) +\n Number(payrollData.totals.benefits ?? 0)\n : 0\n\n return totalPayroll\n}\n\n/**\n * Converts a Date to Pacific Time considering Daylight Saving Time.\n * Returns the UTC offset in hours (e.g., -7 for PDT, -8 for PST).\n *\n * DST rules for Pacific Time:\n * - Starts: Second Sunday in March at 2:00 AM\n * - Ends: First Sunday in November at 2:00 AM\n */\nconst getPacificTimeOffset = (date: Date): number => {\n const year = date.getFullYear()\n\n const secondSundayMarch = new Date(year, 2, 1)\n secondSundayMarch.setDate(1 + (7 - secondSundayMarch.getDay()) + 7)\n\n const firstSundayNovember = new Date(year, 10, 1)\n firstSundayNovember.setDate(1 + ((7 - firstSundayNovember.getDay()) % 7))\n\n const isDST = date >= secondSundayMarch && date < firstSundayNovember\n return isDST ? -7 : -8\n}\n\n/**\n * Determines if a payroll can be cancelled based on business rules.\n *\n * A payroll can be cancelled if all of the following conditions are met:\n * - The payroll has been processed (processed === true)\n * - Current time is before 4:00 PM PT on the payroll deadline\n * - The payrollStatusMeta.cancellable flag is not explicitly false\n *\n * This check enforces the business rule that payrolls can only be cancelled\n * before the 4:00 PM PT cutoff time on their deadline date.\n */\nexport const canCancelPayroll = (payroll: Payroll): boolean => {\n if (payroll.payrollStatusMeta?.cancellable === false) {\n return false\n }\n\n if (!payroll.processed) {\n return false\n }\n\n if (!payroll.payrollDeadline) {\n return false\n }\n\n const now = new Date()\n const deadline = new Date(payroll.payrollDeadline)\n\n const nowInPT = new Date(now.getTime() + getPacificTimeOffset(now) * MS_PER_HOUR)\n const deadlineInPT = new Date(deadline.getTime() + getPacificTimeOffset(deadline) * MS_PER_HOUR)\n\n const cutoffTime = new Date(deadlineInPT)\n cutoffTime.setUTCHours(16, 0, 0, 0)\n\n if (nowInPT >= cutoffTime) {\n return false\n }\n\n return true\n}\n"],"names":["REGULAR_HOURS_NAME","getPrimaryJob","employee","job","roundToSixDecimals","value","roundToTwoDecimals","isRegularHours","compensationName","PAY_PERIOD_HOURS_MAPPINGS","formatEmployeePayRate","locale","primaryJob","jobCompensation","rate","paymentUnit","formatPayRate","useFormatEmployeePayRate","t","useTranslation","useLocale","useCallback","getRegularHours","compensation","hourlyCompensation","sum","getOvertimeHours","getTotalPtoHours","pto","getAdditionalEarnings","fixedCompensation","name","amount","getReimbursements","reimbursementComp","formatHoursDisplay","hours","rounded","getHoursInPayPeriod","paySchedule","getEffectiveCompensation","compensations","effectiveDate","sorted","a","b","i","currentDateString","currentDate","getEffectiveMinimumWage","minimumWages","isSalaried","getTotalTipCompensations","fixedCompensations","calculateHourlyRate","getHourlyRateForJob","jobUuid","j","getPrimaryHourlyRate","getTotalOutstandingPtoHours","paidTimeOff","getPtoHours","isSalariedWithExpectedHours","hoursInPayPeriod","offCycle","regularPtoHours","outstandingPtoHours","calculateMinimumWageAdjustment","primaryCompensation","effectiveMinWage","totalHours","hourlyRate","totalTipCredit","totalTips","calculateRegularPlusOvertimePay","ptoHours","isOffCycle","regularRatePay","hc","overtimeWeightedRate","overtimePay","multiplier","calculatePtoPay","primaryHourlyRate","isSalariedWithPayPeriodExpectedHours","regularHourlyCompensation","calculateGrossPay","compensationEffectiveDateString","payrollCategory","PayrollCategory","compensationEffectiveDate","salaried","isOffCyclePayroll","regularPlusOvertimePay","fixedPay","ptoPay","minimumWageAdjustment","total","isDismissalPayroll","offCycleReason","OffCycleReasonType","OFF_CYCLE_REASON_LABELS","getPayrollTypeLabel","payroll","getAdditionalEarningsCompensations","flsaStatus","existingFixedCompensations","primaryJobUuid","fixedCompensationTypes","excludedTypes","allFixedCompensations","FlsaStatus","type","comp","getReimbursementCompensation","reimbursementCompensation","COMPENSATION_NAME_REIMBURSEMENT","hasDirectDepositEmployees","employeeCompensations","activeCompensations","calculateTotalPayroll","payrollData","getPacificTimeOffset","date","year","secondSundayMarch","firstSundayNovember","canCancelPayroll","now","deadline","nowInPT","MS_PER_HOUR","deadlineInPT","cutoffTime"],"mappings":";;;;;;;;AAoBA,MAAMA,IAAqB,iBAGdC,IAAgB,CAACC,MACrBA,EAAS,MAAM,KAAK,CAAAC,MAAOA,EAAI,OAAO,KAAKD,EAAS,OAAO,CAAC,KAAK,MAGpEE,IAAqB,CAACC,MACnB,KAAK,MAAMA,IAAQ,GAAS,IAAI,KAGnCC,IAAqB,CAACD,MACnB,KAAK,MAAMA,IAAQ,GAAG,IAAI,KAG7BE,IAAiB,CAACC,MACfA,EAAiB,kBAAkBR,GAGtCS,IAAoD;AAAA,EACxD,OAAO;AAAA,EACP,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,cAAc;AAAA,EACd,UAAU;AACZ,GAEaC,IAAwB,CAAC;AAAA,EACpC,UAAAR;AAAA,EACA;AAAA,EACA,QAAAS,IAAS;AACX,MAIM;AACJ,MAAI,CAACT,GAAU;AACb,WAAO;AAGT,QAAMU,IAAaX,EAAcC,CAAQ;AACzC,MAAI,CAACU,GAAY;AACf,WAAO;AAGT,QAAMC,IAAkBD,EAAW,cAAc,CAAC;AAIlD,MAHI,CAACC,KAGD,CAACA,EAAgB,QAAQ,WAAWA,EAAgB,IAAI,MAAM;AAChE,WAAO;AAGT,QAAMC,IAAO,WAAWD,EAAgB,IAAI,GACtCE,IAAcF,EAAgB,eAAe;AAEnD,SAAOG,EAAc,EAAE,MAAAF,GAAM,aAAAC,GAAa,GAAG,QAAAJ,GAAQ;AACv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{ PayrollPrepared } from '@gusto/embedded-api/models/components/payroll';
2
- import { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject';
2
+ import { PaySchedule } from '@gusto/embedded-api/models/components/payschedule';
3
3
  import { QueryParamSortBy } from '@gusto/embedded-api/models/operations/putv1companiescompanyidpayrollspayrollidprepare';
4
4
  interface UsePreparedPayrollDataParams {
5
5
  companyId: string;
@@ -11,7 +11,7 @@ interface UsePreparedPayrollDataParams {
11
11
  interface UsePreparedPayrollDataReturn {
12
12
  handlePreparePayroll: () => Promise<void>;
13
13
  preparedPayroll: PayrollPrepared | undefined;
14
- paySchedule: PayScheduleObject | undefined;
14
+ paySchedule: PaySchedule | undefined;
15
15
  isLoading: boolean;
16
16
  isPaginating: boolean;
17
17
  hasInitialData: boolean;
@@ -6,24 +6,22 @@ import "react/jsx-runtime";
6
6
  import "react-error-boundary";
7
7
  import "react-i18next";
8
8
  import "@tanstack/react-query";
9
- import { useBase as j } from "../Base/useBase.js";
9
+ import { useBase as x } from "../Base/useBase.js";
10
10
  import "@gusto/embedded-api/models/errors/apierror";
11
11
  import "@gusto/embedded-api/models/errors/gustoembeddederror";
12
12
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
13
13
  import "@gusto/embedded-api/models/errors/httpclienterrors";
14
14
  import "../../shared/constants.js";
15
- import "classnames";
16
15
  import "../../contexts/ComponentAdapter/useComponentContext.js";
17
- import "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
18
- import { retryAsync as x } from "../../helpers/retryAsync.js";
19
- const q = 4, v = 1500, w = (e) => e instanceof T ? Array.isArray(e.errors) && e.errors.some((r) => r.category === "invalid_operation") : !1, Z = ({
16
+ import { retryAsync as j } from "../../helpers/retryAsync.js";
17
+ const q = 4, v = 1500, w = (e) => e instanceof T ? e.errors.some((r) => r.category === "invalid_operation") : !1, V = ({
20
18
  companyId: e,
21
19
  payrollId: r,
22
20
  employeeUuids: a,
23
21
  sortBy: n,
24
22
  onDataReady: l
25
23
  }) => {
26
- const { mutateAsync: c, isPending: p } = L(), [o, f] = b(), t = y(!1), u = y(!1), { baseSubmitHandler: d } = j(), h = M(() => a?.join(",") ?? "", [a]), { data: S, isLoading: E } = D(
24
+ const { mutateAsync: c, isPending: p } = L(), [o, f] = b(), t = y(!1), u = y(!1), { baseSubmitHandler: d } = x(), h = M(() => a?.join(",") ?? "", [a]), { data: S, isLoading: E } = D(
27
25
  {
28
26
  companyId: e,
29
27
  payScheduleId: o?.payPeriod?.payScheduleUuid || ""
@@ -46,7 +44,7 @@ const q = 4, v = 1500, w = (e) => e instanceof T ? Array.isArray(e.errors) && e.
46
44
  }, [e, r, c, h, n, l]), s = m(async () => {
47
45
  await d(
48
46
  null,
49
- () => x(P, {
47
+ () => j(P, {
50
48
  maxAttempts: q,
51
49
  delayMs: v,
52
50
  shouldRetry: w
@@ -56,17 +54,17 @@ const q = 4, v = 1500, w = (e) => e instanceof T ? Array.isArray(e.errors) && e.
56
54
  _(() => {
57
55
  u.current || (u.current = !0, s());
58
56
  }, [s]);
59
- const g = p && !t.current, A = p && t.current, R = g || E;
57
+ const g = p && !t.current, R = p && t.current, A = g || E;
60
58
  return {
61
59
  handlePreparePayroll: s,
62
60
  preparedPayroll: o,
63
- paySchedule: S?.payScheduleObject,
64
- isLoading: R,
65
- isPaginating: A,
61
+ paySchedule: S?.paySchedule,
62
+ isLoading: A,
63
+ isPaginating: R,
66
64
  hasInitialData: t.current
67
65
  };
68
66
  };
69
67
  export {
70
- Z as usePreparedPayrollData
68
+ V as usePreparedPayrollData
71
69
  };
72
70
  //# sourceMappingURL=usePreparedPayrollData.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payroll'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { QueryParamSortBy } from '@gusto/embedded-api/models/operations/putv1companiescompanyidpayrollspayrollidprepare'\nimport { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject'\nimport { useBase } from '../Base'\nimport { retryAsync } from '@/helpers/retryAsync'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: QueryParamSortBy\n onDataReady?: (preparedPayroll: PayrollPrepared) => void\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleObject | undefined\n isLoading: boolean\n isPaginating: boolean\n hasInitialData: boolean\n}\n\nconst PREPARE_MAX_ATTEMPTS = 4\nconst PREPARE_RETRY_DELAY_MS = 1500\n\nconst isPayrollBeingProcessedError = (error: unknown): boolean => {\n if (!(error instanceof UnprocessableEntityErrorObject)) return false\n return Array.isArray(error.errors) && error.errors.some(e => e.category === 'invalid_operation')\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n onDataReady,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const hasInitialDataRef = useRef(false)\n const hasFiredRef = useRef(false)\n const { baseSubmitHandler } = useBase()\n\n const employeeUuidsKey = useMemo(() => employeeUuids?.join(',') ?? '', [employeeUuids])\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const executePrepare = useCallback(async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n if (result.payrollPrepared) {\n hasInitialDataRef.current = true\n onDataReady?.(result.payrollPrepared)\n }\n }, [companyId, payrollId, preparePayroll, employeeUuidsKey, sortBy, onDataReady])\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, () =>\n retryAsync(executePrepare, {\n maxAttempts: PREPARE_MAX_ATTEMPTS,\n delayMs: PREPARE_RETRY_DELAY_MS,\n shouldRetry: isPayrollBeingProcessedError,\n }),\n )\n }, [baseSubmitHandler, executePrepare])\n\n useEffect(() => {\n if (hasFiredRef.current) return\n hasFiredRef.current = true\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isInitialLoading = isPreparePayrollPending && !hasInitialDataRef.current\n const isPaginating = isPreparePayrollPending && hasInitialDataRef.current\n const isLoading = isInitialLoading || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleObject,\n isLoading,\n isPaginating,\n hasInitialData: hasInitialDataRef.current,\n }\n}\n"],"names":["PREPARE_MAX_ATTEMPTS","PREPARE_RETRY_DELAY_MS","isPayrollBeingProcessedError","error","UnprocessableEntityErrorObject","e","usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","onDataReady","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","hasInitialDataRef","useRef","hasFiredRef","baseSubmitHandler","useBase","employeeUuidsKey","useMemo","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","executePrepare","useCallback","result","handlePreparePayroll","retryAsync","useEffect","isInitialLoading","isPaginating","isLoading"],"mappings":";;;;;;;;;;;;;;;;;;AA2BA,MAAMA,IAAuB,GACvBC,IAAyB,MAEzBC,IAA+B,CAACC,MAC9BA,aAAiBC,IAChB,MAAM,QAAQD,EAAM,MAA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AAAA,EAEL,GAAG,CAACmB,GAAmBO,CAAc,CAAC;AAEtC,EAAAK,EAAU,MAAM;AACd,IAAIb,EAAY,YAChBA,EAAY,UAAU,IACjBW,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMG,IAAmBrB,KAA2B,CAACK,EAAkB,SACjEiB,IAAetB,KAA2BK,EAAkB,SAC5DkB,IAAYF,KAAoBR;AAEtC,SAAO;AAAA,IACL,sBAAAK;AAAA,IACA,iBAAAhB;AAAA,IACA,aAAaU,GAAiB;AAAA,IAC9B,WAAAW;AAAA,IACA,cAAAD;AAAA,IACA,gBAAgBjB,EAAkB;AAAA,EAAA;AAEtC;"}
1
+ {"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payroll'\nimport type { PaySchedule } from '@gusto/embedded-api/models/components/payschedule'\nimport type { QueryParamSortBy } from '@gusto/embedded-api/models/operations/putv1companiescompanyidpayrollspayrollidprepare'\nimport { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject'\nimport { useBase } from '../Base'\nimport { retryAsync } from '@/helpers/retryAsync'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: QueryParamSortBy\n onDataReady?: (preparedPayroll: PayrollPrepared) => void\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PaySchedule | undefined\n isLoading: boolean\n isPaginating: boolean\n hasInitialData: boolean\n}\n\nconst PREPARE_MAX_ATTEMPTS = 4\nconst PREPARE_RETRY_DELAY_MS = 1500\n\nconst isPayrollBeingProcessedError = (error: unknown): boolean => {\n if (!(error instanceof UnprocessableEntityErrorObject)) return false\n return error.errors.some(e => e.category === 'invalid_operation')\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n onDataReady,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const hasInitialDataRef = useRef(false)\n const hasFiredRef = useRef(false)\n const { baseSubmitHandler } = useBase()\n\n const employeeUuidsKey = useMemo(() => employeeUuids?.join(',') ?? '', [employeeUuids])\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const executePrepare = useCallback(async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n if (result.payrollPrepared) {\n hasInitialDataRef.current = true\n onDataReady?.(result.payrollPrepared)\n }\n }, [companyId, payrollId, preparePayroll, employeeUuidsKey, sortBy, onDataReady])\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, () =>\n retryAsync(executePrepare, {\n maxAttempts: PREPARE_MAX_ATTEMPTS,\n delayMs: PREPARE_RETRY_DELAY_MS,\n shouldRetry: isPayrollBeingProcessedError,\n }),\n )\n }, [baseSubmitHandler, executePrepare])\n\n useEffect(() => {\n if (hasFiredRef.current) return\n hasFiredRef.current = true\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isInitialLoading = isPreparePayrollPending && !hasInitialDataRef.current\n const isPaginating = isPreparePayrollPending && hasInitialDataRef.current\n const isLoading = isInitialLoading || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.paySchedule,\n isLoading,\n isPaginating,\n hasInitialData: hasInitialDataRef.current,\n }\n}\n"],"names":["PREPARE_MAX_ATTEMPTS","PREPARE_RETRY_DELAY_MS","isPayrollBeingProcessedError","error","UnprocessableEntityErrorObject","e","usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","onDataReady","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","hasInitialDataRef","useRef","hasFiredRef","baseSubmitHandler","useBase","employeeUuidsKey","useMemo","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","executePrepare","useCallback","result","handlePreparePayroll","retryAsync","useEffect","isInitialLoading","isPaginating","isLoading"],"mappings":";;;;;;;;;;;;;;;;AA2BA,MAAMA,IAAuB,GACvBC,IAAyB,MAEzBC,IAA+B,CAACC,MAC9BA,aAAiBC,IAChBD,EAAM,OAAO,KAAK,CAAAE,MAAKA,EAAE,aAAa,mBAAmB,IADD,IAIpDC,IAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AACF,MAAkE;AAChE,QAAM,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GACI,CAACC,GAAiBC,CAAkB,IAAIC,EAAA,GACxCC,IAAoBC,EAAO,EAAK,GAChCC,IAAcD,EAAO,EAAK,GAC1B,EAAE,mBAAAE,EAAA,IAAsBC,EAAA,GAExBC,IAAmBC,EAAQ,MAAMf,GAAe,KAAK,GAAG,KAAK,IAAI,CAACA,CAAa,CAAC,GAEhF,EAAE,MAAMgB,GAAiB,WAAWC,MAAyBC;AAAA,IACjE;AAAA,MACE,WAAApB;AAAA,MACA,eAAeQ,GAAiB,WAAW,mBAAmB;AAAA,IAAA;AAAA,IAEhE;AAAA,MACE,SAAS,CAAC,CAACA,GAAiB,WAAW;AAAA,IAAA;AAAA,EACzC,GAGIa,IAAiBC,EAAY,YAAY;AAC7C,UAAMC,IAAS,MAAMlB,EAAe;AAAA,MAClC,SAAS;AAAA,QACP,WAAAL;AAAA,QACA,WAAAC;AAAA,QACA,QAAAE;AAAA,QACA,aAAa;AAAA,UACX,eAAAD;AAAA,QAAA;AAAA,MACF;AAAA,IACF,CACD;AACD,IAAAO,EAAmBc,EAAO,eAAe,GACrCA,EAAO,oBACTZ,EAAkB,UAAU,IAC5BP,IAAcmB,EAAO,eAAe;AAAA,EAExC,GAAG,CAACvB,GAAWC,GAAWI,GAAgBW,GAAkBb,GAAQC,CAAW,CAAC,GAE1EoB,IAAuBF,EAAY,YAAY;AACnD,UAAMR;AAAA,MAAkB;AAAA,MAAM,MAC5BW,EAAWJ,GAAgB;AAAA,QACzB,aAAa5B;AAAA,QACb,SAASC;AAAA,QACT,aAAaC;AAAA,MAAA,CACd;AAAA,IAAA;AAAA,EAEL,GAAG,CAACmB,GAAmBO,CAAc,CAAC;AAEtC,EAAAK,EAAU,MAAM;AACd,IAAIb,EAAY,YAChBA,EAAY,UAAU,IACjBW,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMG,IAAmBrB,KAA2B,CAACK,EAAkB,SACjEiB,IAAetB,KAA2BK,EAAkB,SAC5DkB,IAAYF,KAAoBR;AAEtC,SAAO;AAAA,IACL,sBAAAK;AAAA,IACA,iBAAAhB;AAAA,IACA,aAAaU,GAAiB;AAAA,IAC9B,WAAAW;AAAA,IACA,cAAAD;AAAA,IACA,gBAAgBjB,EAAkB;AAAA,EAAA;AAEtC;"}
@@ -1,46 +1,49 @@
1
- import { jsx as o, jsxs as t } from "react/jsx-runtime";
2
- import { BaseComponent as i } from "../../Base/Base.js";
3
- import "../../Base/useBase.js";
4
- import { componentEvents as e } from "../../../shared/constants.js";
5
- function E(n) {
6
- return /* @__PURE__ */ o(i, { ...n, children: /* @__PURE__ */ t("div", { children: [
7
- /* @__PURE__ */ t("p", { children: [
8
- "Holiday Selection Form (companyId: ",
9
- n.companyId,
10
- ")"
11
- ] }),
12
- /* @__PURE__ */ o(
13
- "button",
14
- {
15
- onClick: () => {
16
- n.onEvent(e.TIME_OFF_HOLIDAY_SELECTION_DONE);
17
- },
18
- children: "Done"
19
- }
20
- ),
21
- /* @__PURE__ */ o(
22
- "button",
23
- {
24
- onClick: () => {
25
- n.onEvent(e.TIME_OFF_HOLIDAY_CREATE_ERROR, {
26
- alert: { type: "error", title: "Failed to create holiday policy" }
27
- });
28
- },
29
- children: "Simulate Error"
30
- }
31
- ),
32
- /* @__PURE__ */ o(
33
- "button",
34
- {
35
- onClick: () => {
36
- n.onEvent(e.CANCEL);
37
- },
38
- children: "Cancel"
39
- }
40
- )
41
- ] }) });
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { useMemo as d, useState as P, useCallback as a } from "react";
3
+ import { useTranslation as h } from "react-i18next";
4
+ import { useHolidayPayPoliciesCreateMutation as I } from "@gusto/embedded-api/react-query/holidayPayPoliciesCreate";
5
+ import { getDefaultHolidayItems as O, FEDERAL_HOLIDAY_KEYS as F, buildFederalHolidaysPayload as _ } from "../shared/holidayHelpers.js";
6
+ import { HolidaySelectionFormPresentation as A } from "./HolidaySelectionFormPresentation.js";
7
+ import { BaseComponent as D } from "../../Base/Base.js";
8
+ import { useBase as L } from "../../Base/useBase.js";
9
+ import { componentEvents as m } from "../../../shared/constants.js";
10
+ import { useI18n as T } from "../../../i18n/I18n.js";
11
+ function q(e) {
12
+ return /* @__PURE__ */ i(D, { ...e, children: /* @__PURE__ */ i(b, { companyId: e.companyId }) });
13
+ }
14
+ function b({ companyId: e }) {
15
+ T("Company.TimeOff.HolidayPolicy");
16
+ const { t: s } = h("Company.TimeOff.HolidayPolicy"), { onEvent: o, baseSubmitHandler: l } = L(), u = d(() => O(s), [s]), y = d(() => new Set(F), []), [t, f] = P(y), { mutateAsync: r } = I(), p = a((c, S) => {
17
+ f((E) => {
18
+ const n = new Set(E);
19
+ return S ? n.add(c.uuid) : n.delete(c.uuid), n;
20
+ });
21
+ }, []), C = a(async () => {
22
+ await l({}, async () => {
23
+ await r({
24
+ request: {
25
+ companyUuid: e,
26
+ holidayPayPolicyRequest: {
27
+ federalHolidays: _(t)
28
+ }
29
+ }
30
+ }), o(m.TIME_OFF_HOLIDAY_SELECTION_DONE);
31
+ });
32
+ }, [l, r, e, t, o]), H = a(() => {
33
+ o(m.CANCEL);
34
+ }, [o]);
35
+ return /* @__PURE__ */ i(
36
+ A,
37
+ {
38
+ holidays: u,
39
+ selectedHolidayUuids: t,
40
+ onSelectionChange: p,
41
+ onContinue: C,
42
+ onBack: H
43
+ }
44
+ );
42
45
  }
43
46
  export {
44
- E as HolidaySelectionForm
47
+ q as HolidaySelectionForm
45
48
  };
46
49
  //# sourceMappingURL=HolidaySelectionForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HolidaySelectionForm.js","sources":["../../../../src/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.tsx"],"sourcesContent":["import { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\n\nexport interface HolidaySelectionFormProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function HolidaySelectionForm(props: HolidaySelectionFormProps) {\n return (\n <BaseComponent {...props}>\n <div>\n <p>Holiday Selection Form (companyId: {props.companyId})</p>\n <button\n onClick={() => {\n props.onEvent(componentEvents.TIME_OFF_HOLIDAY_SELECTION_DONE)\n }}\n >\n Done\n </button>\n <button\n onClick={() => {\n props.onEvent(componentEvents.TIME_OFF_HOLIDAY_CREATE_ERROR, {\n alert: { type: 'error', title: 'Failed to create holiday policy' },\n })\n }}\n >\n Simulate Error\n </button>\n <button\n onClick={() => {\n props.onEvent(componentEvents.CANCEL)\n }}\n >\n Cancel\n </button>\n </div>\n </BaseComponent>\n )\n}\n"],"names":["HolidaySelectionForm","props","jsx","BaseComponent","jsxs","componentEvents"],"mappings":";;;;AAOO,SAASA,EAAqBC,GAAkC;AACrE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,4BAAC,OAAA,EACC,UAAA;AAAA,IAAA,gBAAAG,EAAC,KAAA,EAAE,UAAA;AAAA,MAAA;AAAA,MAAoCH,EAAM;AAAA,MAAU;AAAA,IAAA,GAAC;AAAA,IACxD,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAAS,MAAM;AACb,UAAAD,EAAM,QAAQI,EAAgB,+BAA+B;AAAA,QAC/D;AAAA,QACD,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAGD,gBAAAH;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAAS,MAAM;AACb,UAAAD,EAAM,QAAQI,EAAgB,+BAA+B;AAAA,YAC3D,OAAO,EAAE,MAAM,SAAS,OAAO,kCAAA;AAAA,UAAkC,CAClE;AAAA,QACH;AAAA,QACD,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAGD,gBAAAH;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAAS,MAAM;AACb,UAAAD,EAAM,QAAQI,EAAgB,MAAM;AAAA,QACtC;AAAA,QACD,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAED,EAAA,CACF,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"HolidaySelectionForm.js","sources":["../../../../src/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.tsx"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useHolidayPayPoliciesCreateMutation } from '@gusto/embedded-api/react-query/holidayPayPoliciesCreate'\nimport {\n getDefaultHolidayItems,\n buildFederalHolidaysPayload,\n FEDERAL_HOLIDAY_KEYS,\n} from '../shared/holidayHelpers'\nimport { HolidaySelectionFormPresentation } from './HolidaySelectionFormPresentation'\nimport type { HolidayItem } from './HolidaySelectionFormTypes'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { useI18n } from '@/i18n'\n\nexport interface HolidaySelectionFormProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function HolidaySelectionForm(props: HolidaySelectionFormProps) {\n return (\n <BaseComponent {...props}>\n <Root companyId={props.companyId} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId }: { companyId: string }) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const holidays = useMemo(() => getDefaultHolidayItems(t), [t])\n const allKeys = useMemo(() => new Set(FEDERAL_HOLIDAY_KEYS), [])\n const [selectedUuids, setSelectedUuids] = useState(allKeys)\n\n const { mutateAsync: createPolicy } = useHolidayPayPoliciesCreateMutation()\n\n const handleSelectionChange = useCallback((item: HolidayItem, selected: boolean) => {\n setSelectedUuids(prev => {\n const next = new Set(prev)\n if (selected) {\n next.add(item.uuid)\n } else {\n next.delete(item.uuid)\n }\n return next\n })\n }, [])\n\n const handleContinue = useCallback(async () => {\n await baseSubmitHandler({}, async () => {\n await createPolicy({\n request: {\n companyUuid: companyId,\n holidayPayPolicyRequest: {\n federalHolidays: buildFederalHolidaysPayload(selectedUuids),\n },\n },\n })\n onEvent(componentEvents.TIME_OFF_HOLIDAY_SELECTION_DONE)\n })\n }, [baseSubmitHandler, createPolicy, companyId, selectedUuids, onEvent])\n\n const handleBack = useCallback(() => {\n onEvent(componentEvents.CANCEL)\n }, [onEvent])\n\n return (\n <HolidaySelectionFormPresentation\n holidays={holidays}\n selectedHolidayUuids={selectedUuids}\n onSelectionChange={handleSelectionChange}\n onContinue={handleContinue}\n onBack={handleBack}\n />\n )\n}\n"],"names":["HolidaySelectionForm","props","jsx","BaseComponent","Root","companyId","useI18n","t","useTranslation","onEvent","baseSubmitHandler","useBase","holidays","useMemo","getDefaultHolidayItems","allKeys","FEDERAL_HOLIDAY_KEYS","selectedUuids","setSelectedUuids","useState","createPolicy","useHolidayPayPoliciesCreateMutation","handleSelectionChange","useCallback","item","selected","prev","next","handleContinue","buildFederalHolidaysPayload","componentEvents","handleBack","HolidaySelectionFormPresentation"],"mappings":";;;;;;;;;;AAmBO,SAASA,EAAqBC,GAAkC;AACrE,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAK,WAAWH,EAAM,UAAA,CAAW,EAAA,CACpC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,KAAoC;AAClD,EAAAC,EAAQ,+BAA+B;AACvC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,+BAA+B,GACtD,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjCC,IAAWC,EAAQ,MAAMC,EAAuBP,CAAC,GAAG,CAACA,CAAC,CAAC,GACvDQ,IAAUF,EAAQ,MAAM,IAAI,IAAIG,CAAoB,GAAG,EAAE,GACzD,CAACC,GAAeC,CAAgB,IAAIC,EAASJ,CAAO,GAEpD,EAAE,aAAaK,EAAA,IAAiBC,EAAA,GAEhCC,IAAwBC,EAAY,CAACC,GAAmBC,MAAsB;AAClF,IAAAP,EAAiB,CAAAQ,MAAQ;AACvB,YAAMC,IAAO,IAAI,IAAID,CAAI;AACzB,aAAID,IACFE,EAAK,IAAIH,EAAK,IAAI,IAElBG,EAAK,OAAOH,EAAK,IAAI,GAEhBG;AAAA,IACT,CAAC;AAAA,EACH,GAAG,CAAA,CAAE,GAECC,IAAiBL,EAAY,YAAY;AAC7C,UAAMb,EAAkB,CAAA,GAAI,YAAY;AACtC,YAAMU,EAAa;AAAA,QACjB,SAAS;AAAA,UACP,aAAaf;AAAA,UACb,yBAAyB;AAAA,YACvB,iBAAiBwB,EAA4BZ,CAAa;AAAA,UAAA;AAAA,QAC5D;AAAA,MACF,CACD,GACDR,EAAQqB,EAAgB,+BAA+B;AAAA,IACzD,CAAC;AAAA,EACH,GAAG,CAACpB,GAAmBU,GAAcf,GAAWY,GAAeR,CAAO,CAAC,GAEjEsB,IAAaR,EAAY,MAAM;AACnC,IAAAd,EAAQqB,EAAgB,MAAM;AAAA,EAChC,GAAG,CAACrB,CAAO,CAAC;AAEZ,SACE,gBAAAP;AAAA,IAAC8B;AAAA,IAAA;AAAA,MACC,UAAApB;AAAA,MACA,sBAAsBK;AAAA,MACtB,mBAAmBK;AAAA,MACnB,YAAYM;AAAA,MACZ,QAAQG;AAAA,IAAA;AAAA,EAAA;AAGd;"}
@@ -0,0 +1,2 @@
1
+ import { HolidaySelectionFormPresentationProps } from './HolidaySelectionFormTypes';
2
+ export declare function HolidaySelectionFormPresentation(props: HolidaySelectionFormPresentationProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,55 @@
1
+ import { jsx as t, jsxs as r } from "react/jsx-runtime";
2
+ import { useMemo as h } from "react";
3
+ import { useTranslation as p } from "react-i18next";
4
+ import { Flex as c } from "../../Common/Flex/Flex.js";
5
+ import { ActionsLayout as y } from "../../Common/ActionsLayout/ActionsLayout.js";
6
+ import { useComponentContext as b } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
+ import { useI18n as v } from "../../../i18n/I18n.js";
8
+ import { useDataView as x } from "../../Common/DataView/useDataView.js";
9
+ import { DataView as C } from "../../Common/DataView/DataView.js";
10
+ function V(o) {
11
+ v("Company.TimeOff.HolidayPolicy");
12
+ const { t: e } = p("Company.TimeOff.HolidayPolicy"), { Heading: s, Text: n, Button: l } = b(), { holidays: d } = o, a = o.mode === "view", m = h(
13
+ () => [
14
+ {
15
+ key: "name",
16
+ title: e("tableHeaders.holidayName"),
17
+ render: (i) => /* @__PURE__ */ t(n, { weight: "medium", children: i.name })
18
+ },
19
+ {
20
+ key: "observedDate",
21
+ title: e("tableHeaders.observedDate"),
22
+ render: (i) => /* @__PURE__ */ t(n, { variant: "supporting", children: i.observedDate })
23
+ },
24
+ {
25
+ key: "nextObservation",
26
+ title: e("tableHeaders.nextObservation"),
27
+ render: (i) => /* @__PURE__ */ t(n, { variant: "supporting", children: i.nextObservation })
28
+ }
29
+ ],
30
+ [e, n]
31
+ ), u = a ? {} : {
32
+ selectionMode: "multiple",
33
+ onSelect: o.onSelectionChange,
34
+ getIsItemSelected: (i) => o.selectedHolidayUuids.has(i.uuid)
35
+ }, f = x({
36
+ data: d,
37
+ columns: m,
38
+ ...u
39
+ });
40
+ return /* @__PURE__ */ r(c, { flexDirection: "column", gap: 32, children: [
41
+ !a && /* @__PURE__ */ r(c, { flexDirection: "column", gap: 4, children: [
42
+ /* @__PURE__ */ t(s, { as: "h2", children: e("title") }),
43
+ /* @__PURE__ */ t(n, { variant: "supporting", children: e("description") })
44
+ ] }),
45
+ /* @__PURE__ */ t(C, { label: e("tableLabel"), ...f }),
46
+ !a && /* @__PURE__ */ r(y, { children: [
47
+ /* @__PURE__ */ t(l, { variant: "secondary", onClick: o.onBack, children: e("backCta") }),
48
+ /* @__PURE__ */ t(l, { variant: "primary", onClick: o.onContinue, children: e("continueCta") })
49
+ ] })
50
+ ] });
51
+ }
52
+ export {
53
+ V as HolidaySelectionFormPresentation
54
+ };
55
+ //# sourceMappingURL=HolidaySelectionFormPresentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HolidaySelectionFormPresentation.js","sources":["../../../../src/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type {\n HolidayItem,\n HolidaySelectionFormPresentationProps,\n} from './HolidaySelectionFormTypes'\nimport { DataView, Flex, ActionsLayout, useDataView } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport function HolidaySelectionFormPresentation(props: HolidaySelectionFormPresentationProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { Heading, Text, Button } = useComponentContext()\n\n const { holidays } = props\n const isViewMode = props.mode === 'view'\n\n const columns = useMemo(\n () => [\n {\n key: 'name' as keyof HolidayItem,\n title: t('tableHeaders.holidayName'),\n render: (item: HolidayItem) => <Text weight=\"medium\">{item.name}</Text>,\n },\n {\n key: 'observedDate' as keyof HolidayItem,\n title: t('tableHeaders.observedDate'),\n render: (item: HolidayItem) => <Text variant=\"supporting\">{item.observedDate}</Text>,\n },\n {\n key: 'nextObservation' as keyof HolidayItem,\n title: t('tableHeaders.nextObservation'),\n render: (item: HolidayItem) => <Text variant=\"supporting\">{item.nextObservation}</Text>,\n },\n ],\n [t, Text],\n )\n\n const selectionProps = !isViewMode\n ? {\n selectionMode: 'multiple' as const,\n onSelect: props.onSelectionChange,\n getIsItemSelected: (item: HolidayItem) => props.selectedHolidayUuids.has(item.uuid),\n }\n : {}\n\n const dataViewProps = useDataView<HolidayItem>({\n data: holidays,\n columns,\n ...selectionProps,\n })\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n {!isViewMode && (\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text variant=\"supporting\">{t('description')}</Text>\n </Flex>\n )}\n\n <DataView label={t('tableLabel')} {...dataViewProps} />\n\n {!isViewMode && (\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={props.onBack}>\n {t('backCta')}\n </Button>\n <Button variant=\"primary\" onClick={props.onContinue}>\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n )}\n </Flex>\n )\n}\n"],"names":["HolidaySelectionFormPresentation","props","useI18n","t","useTranslation","Heading","Text","Button","useComponentContext","holidays","isViewMode","columns","useMemo","item","jsx","selectionProps","dataViewProps","useDataView","jsxs","Flex","DataView","ActionsLayout"],"mappings":";;;;;;;;;AAUO,SAASA,EAAiCC,GAA8C;AAC7F,EAAAC,EAAQ,+BAA+B;AACvC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,+BAA+B,GACtD,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,EA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OAAOjB,EAAE,YAAY,GAAI,GAAGa,GAAe;AAAA,IAEpD,CAACN,KACA,gBAAAQ,EAACG,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAP,EAACP,GAAA,EAAO,SAAQ,aAAY,SAASN,EAAM,QACxC,UAAAE,EAAE,SAAS,EAAA,CACd;AAAA,MACA,gBAAAW,EAACP,KAAO,SAAQ,WAAU,SAASN,EAAM,YACtC,UAAAE,EAAE,aAAa,EAAA,CAClB;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -0,0 +1,25 @@
1
+ export interface HolidayItem {
2
+ uuid: string;
3
+ name: string;
4
+ observedDate: string;
5
+ nextObservation: string;
6
+ }
7
+ interface HolidaySelectionFormBaseProps {
8
+ holidays: HolidayItem[];
9
+ }
10
+ interface HolidaySelectionFormSelectModeProps extends HolidaySelectionFormBaseProps {
11
+ mode?: 'select';
12
+ selectedHolidayUuids: Set<string>;
13
+ onSelectionChange: (item: HolidayItem, selected: boolean) => void;
14
+ onContinue: () => void;
15
+ onBack: () => void;
16
+ }
17
+ interface HolidaySelectionFormViewModeProps extends HolidaySelectionFormBaseProps {
18
+ mode: 'view';
19
+ selectedHolidayUuids?: never;
20
+ onSelectionChange?: never;
21
+ onContinue?: never;
22
+ onBack?: never;
23
+ }
24
+ export type HolidaySelectionFormPresentationProps = HolidaySelectionFormSelectModeProps | HolidaySelectionFormViewModeProps;
25
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { BaseComponentInterface } from '../../Base';
2
- export interface PolicyListProps extends BaseComponentInterface {
2
+ export interface PolicyListProps extends BaseComponentInterface<'Company.TimeOff.TimeOffPolicies'> {
3
3
  companyId: string;
4
4
  }
5
- export declare function PolicyList(props: PolicyListProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function PolicyList({ FallbackComponent, ...props }: PolicyListProps): import("react/jsx-runtime").JSX.Element;