@gusto/embedded-react-sdk 0.31.1 → 0.33.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 (412) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/dist/assets/icons/icon-arrow-right.svg.js +10 -0
  3. package/dist/assets/icons/icon-arrow-right.svg.js.map +1 -0
  4. package/dist/components/Base/Base.js +46 -45
  5. package/dist/components/Base/Base.js.map +1 -1
  6. package/dist/components/Base/useBase.d.ts +2 -3
  7. package/dist/components/Base/useBase.js.map +1 -1
  8. package/dist/components/Base/useBaseSubmit.js +32 -19
  9. package/dist/components/Base/useBaseSubmit.js.map +1 -1
  10. package/dist/components/Common/DataView/DataView.js +1 -1
  11. package/dist/components/Common/DocumentList/DocumentList.js +1 -1
  12. package/dist/components/Common/DocumentViewer/DocumentViewer.js +1 -1
  13. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +1 -1
  14. package/dist/components/Common/MultiSelectComboBox/MultiSelectComboBox.d.ts +2 -0
  15. package/dist/components/Common/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +16 -0
  16. package/dist/components/Common/MultiSelectComboBox/index.d.ts +3 -0
  17. package/dist/components/Common/RequirementsList/RequirementsList.js +1 -1
  18. package/dist/components/Common/RequirementsList/RequirementsList.js.map +1 -1
  19. package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +1 -1
  20. package/dist/components/Common/SignatureForm/SignatureForm.js +3 -2
  21. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  22. package/dist/components/Common/SignatureForm/SignatureFormActions.js +4 -3
  23. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  24. package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -6
  25. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  26. package/dist/components/Common/UI/Badge/Badge.js +39 -8
  27. package/dist/components/Common/UI/Badge/Badge.js.map +1 -1
  28. package/dist/components/Common/UI/Badge/Badge.module.scss.js +8 -4
  29. package/dist/components/Common/UI/Badge/Badge.module.scss.js.map +1 -1
  30. package/dist/components/Common/UI/Badge/BadgeTypes.d.ts +12 -0
  31. package/dist/components/Common/UI/Badge/BadgeTypes.js.map +1 -1
  32. package/dist/components/Common/UI/Box/Box.d.ts +2 -0
  33. package/dist/components/Common/UI/Box/Box.js +13 -0
  34. package/dist/components/Common/UI/Box/Box.js.map +1 -0
  35. package/dist/components/Common/UI/Box/Box.module.scss.js +12 -0
  36. package/dist/components/Common/UI/Box/Box.module.scss.js.map +1 -0
  37. package/dist/components/Common/UI/Box/BoxTypes.d.ts +15 -0
  38. package/dist/components/Common/UI/Box/index.d.ts +2 -0
  39. package/dist/components/Common/UI/Dialog/Dialog.js +1 -1
  40. package/dist/components/Common/UI/Input/InputTypes.d.ts +1 -1
  41. package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
  42. package/dist/components/Common/UI/List/List.module.scss.js +1 -1
  43. package/dist/components/Common/UI/Modal/Modal.js +1 -1
  44. package/dist/components/Common/UI/Tabs/Tabs.js +1 -1
  45. package/dist/components/Common/UI/TextInput/TextInput.js +30 -28
  46. package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
  47. package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -1
  48. package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
  49. package/dist/components/Company/AssignSignatory/AssignSignatory.js +3 -2
  50. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  51. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +3 -2
  52. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  53. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
  54. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  55. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +6 -5
  56. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  57. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +2 -2
  58. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
  59. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  60. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +5 -4
  61. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  62. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +2 -2
  63. package/dist/components/Company/AssignSignatory/TitleSelect.js +5 -5
  64. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  65. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +2 -2
  66. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
  67. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  68. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -4
  69. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  70. package/dist/components/Company/BankAccount/BankAccountForm/context.js +2 -2
  71. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +3 -2
  72. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  73. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -6
  74. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  75. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
  76. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  77. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
  78. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  79. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
  80. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  81. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +2 -2
  82. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
  83. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  84. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +2 -2
  85. package/dist/components/Company/FederalTaxes/Actions.js +7 -6
  86. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  87. package/dist/components/Company/FederalTaxes/FederalTaxes.js +3 -2
  88. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  89. package/dist/components/Company/FederalTaxes/Form.js +3 -2
  90. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  91. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +2 -2
  92. package/dist/components/Company/Industry/Actions.js +8 -7
  93. package/dist/components/Company/Industry/Actions.js.map +1 -1
  94. package/dist/components/Company/Industry/Context.js +2 -2
  95. package/dist/components/Company/Industry/Edit.js +3 -2
  96. package/dist/components/Company/Industry/Edit.js.map +1 -1
  97. package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
  98. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  99. package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
  100. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  101. package/dist/components/Company/Locations/LocationForm/LocationForm.js +3 -2
  102. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  103. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +2 -2
  104. package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
  105. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  106. package/dist/components/Company/Locations/LocationsList/List.js +7 -6
  107. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  108. package/dist/components/Company/Locations/LocationsList/LocationsList.js +3 -2
  109. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  110. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +2 -2
  111. package/dist/components/Company/OnboardingOverview/Completed.js +11 -10
  112. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  113. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +38 -26
  114. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  115. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +7 -6
  116. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  117. package/dist/components/Company/OnboardingOverview/context.js +2 -2
  118. package/dist/components/Company/PaySchedule/PaySchedule.js +24 -21
  119. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  120. package/dist/components/Company/PaySchedule/_parts/Actions.js +3 -2
  121. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  122. package/dist/components/Company/PaySchedule/_parts/Edit.js +10 -9
  123. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  124. package/dist/components/Company/PaySchedule/_parts/Head.js +9 -8
  125. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  126. package/dist/components/Company/PaySchedule/_parts/List.js +6 -5
  127. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  128. package/dist/components/Company/PaySchedule/usePaySchedule.js +2 -2
  129. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
  130. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  131. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +40 -46
  132. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  133. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +2 -2
  134. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
  135. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  136. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
  137. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  138. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +2 -2
  139. package/dist/components/Company/index.js +20 -20
  140. package/dist/components/Contractor/Address/Address.js +6 -6
  141. package/dist/components/Contractor/Address/Address.js.map +1 -1
  142. package/dist/components/Contractor/Address/Form.js +7 -6
  143. package/dist/components/Contractor/Address/Form.js.map +1 -1
  144. package/dist/components/Contractor/Address/useAddress.js +2 -2
  145. package/dist/components/Contractor/ContractorList/index.js +16 -15
  146. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  147. package/dist/components/Contractor/NewHireReport/NewHireReport.js +14 -13
  148. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  149. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +11 -10
  150. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  151. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  152. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  153. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
  154. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  155. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +151 -116
  156. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  157. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +4 -1
  158. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +55 -50
  159. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  160. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +84 -0
  161. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js +23 -0
  162. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js.map +1 -0
  163. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.d.ts +3 -31
  164. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +61 -66
  165. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  166. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +2 -1
  167. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +21 -22
  168. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  169. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +2 -1
  170. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +32 -29
  171. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  172. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +0 -1
  173. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
  174. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +3 -2
  175. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  176. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +3 -2
  177. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  178. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +3 -2
  179. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  180. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +27 -27
  181. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  182. package/dist/components/Contractor/Profile/useContractorProfile.js +2 -2
  183. package/dist/components/Contractor/Submit/Submit.js +20 -19
  184. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  185. package/dist/components/Employee/Compensation/Actions.js +13 -12
  186. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  187. package/dist/components/Employee/Compensation/Edit.js +3 -2
  188. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  189. package/dist/components/Employee/Compensation/List.js +23 -22
  190. package/dist/components/Employee/Compensation/List.js.map +1 -1
  191. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +2 -2
  192. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +2 -2
  193. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +2 -2
  194. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +7 -6
  195. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  196. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +3 -2
  197. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
  198. package/dist/components/Employee/Deductions/stateMachine.js +1 -1
  199. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +9 -8
  200. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  201. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +24 -22
  202. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  203. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
  204. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  205. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.d.ts +1 -0
  206. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +2 -2
  207. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  208. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +9 -9
  209. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  210. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +46 -41
  211. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
  212. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +150 -111
  213. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
  214. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
  215. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  216. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +2 -2
  217. package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.d.ts +1 -0
  218. package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.js.map +1 -1
  219. package/dist/components/Employee/DocumentSigner/stateMachine.js +34 -22
  220. package/dist/components/Employee/DocumentSigner/stateMachine.js.map +1 -1
  221. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +3 -2
  222. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
  223. package/dist/components/Employee/EmployeeList/Actions.js +7 -6
  224. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  225. package/dist/components/Employee/EmployeeList/Head.js +6 -5
  226. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  227. package/dist/components/Employee/EmployeeList/List.js +3 -2
  228. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  229. package/dist/components/Employee/EmployeeList/useEmployeeList.js +2 -2
  230. package/dist/components/Employee/FederalTaxes/Actions.js +6 -5
  231. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  232. package/dist/components/Employee/FederalTaxes/FederalForm.js +5 -4
  233. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  234. package/dist/components/Employee/FederalTaxes/FederalTaxes.js +16 -15
  235. package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
  236. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +2 -2
  237. package/dist/components/Employee/Landing/Landing.js +50 -44
  238. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  239. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  240. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  241. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +3 -2
  242. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  243. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
  244. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  245. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +6 -5
  246. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  247. package/dist/components/Employee/PaymentMethod/Split.js +3 -2
  248. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  249. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +2 -2
  250. package/dist/components/Employee/Profile/Actions.js +6 -5
  251. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  252. package/dist/components/Employee/Profile/AdminPersonalDetails.js +8 -7
  253. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  254. package/dist/components/Employee/Profile/HomeAddress.js +9 -8
  255. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  256. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +9 -8
  257. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  258. package/dist/components/Employee/Profile/useProfile.js +2 -2
  259. package/dist/components/Employee/StateTaxes/Actions.js +6 -5
  260. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  261. package/dist/components/Employee/StateTaxes/StateTaxes.js +29 -29
  262. package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
  263. package/dist/components/Employee/StateTaxes/useStateTaxes.js +2 -2
  264. package/dist/components/Employee/Taxes/Actions.js +7 -6
  265. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  266. package/dist/components/Employee/Taxes/FederalForm.js +7 -6
  267. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  268. package/dist/components/Employee/Taxes/Taxes.js +19 -19
  269. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  270. package/dist/components/Employee/Taxes/useTaxes.js +2 -2
  271. package/dist/components/Employee/index.js +22 -22
  272. package/dist/components/Flow/Flow.js +8 -7
  273. package/dist/components/Flow/Flow.js.map +1 -1
  274. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +1 -0
  275. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  276. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +0 -1
  277. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +32 -37
  278. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  279. package/dist/components/InformationRequests/InformationRequests.d.ts +1 -2
  280. package/dist/components/InformationRequests/InformationRequests.js +36 -43
  281. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  282. package/dist/components/InformationRequests/index.js +4 -4
  283. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +1 -0
  284. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  285. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +23 -21
  286. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  287. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.d.ts +2 -0
  288. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +79 -0
  289. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -0
  290. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +2 -0
  291. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +46 -0
  292. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -0
  293. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +14 -0
  294. package/dist/components/Payroll/OffCycleCreation/index.d.ts +3 -0
  295. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +2 -0
  296. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js +44 -0
  297. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -0
  298. package/dist/components/Payroll/OffCycleDeductionsSetting/index.d.ts +3 -0
  299. package/dist/components/Payroll/OffCycleDeductionsSetting/types.d.ts +10 -0
  300. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +1 -2
  301. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +37 -0
  302. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -0
  303. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +12 -0
  304. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js.map +1 -0
  305. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.d.ts +0 -4
  306. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +48 -0
  307. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -0
  308. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +18 -0
  309. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -0
  310. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js +26 -27
  311. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -1
  312. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +3 -3
  313. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +17 -16
  314. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
  315. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.d.ts +2 -0
  316. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModalTypes.d.ts +8 -0
  317. package/dist/components/Payroll/OffCycleTaxWithholdingModal/index.d.ts +3 -0
  318. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.d.ts +2 -0
  319. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +17 -0
  320. package/dist/components/Payroll/OffCycleTaxWithholdingTable/index.d.ts +3 -0
  321. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.d.ts +3 -8
  322. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +37 -35
  323. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  324. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +16 -24
  325. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  326. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +2 -0
  327. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +30 -24
  328. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
  329. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.test.d.ts +1 -0
  330. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +12 -8
  331. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  332. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +42 -41
  333. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  334. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +4 -3
  335. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  336. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +6 -5
  337. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  338. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +38 -35
  339. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
  340. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
  341. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  342. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +16 -15
  343. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  344. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +32 -32
  345. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  346. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +19 -18
  347. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  348. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +70 -67
  349. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  350. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
  351. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +39 -36
  352. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  353. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -1
  354. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +18 -19
  355. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  356. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +1 -1
  357. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +3 -2
  358. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  359. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +7 -6
  360. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
  361. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +4 -3
  362. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
  363. package/dist/components/Payroll/index.d.ts +4 -0
  364. package/dist/components/Payroll/index.js +22 -18
  365. package/dist/components/Payroll/index.js.map +1 -1
  366. package/dist/components/Payroll/usePreparedPayrollData.js +2 -2
  367. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +48 -46
  368. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  369. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  370. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  371. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  372. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
  373. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  374. package/dist/contexts/ThemeProvider/theme.d.ts +1 -0
  375. package/dist/contexts/ThemeProvider/theme.js +1 -0
  376. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  377. package/dist/helpers/apiErrorToList.js +14 -8
  378. package/dist/helpers/apiErrorToList.js.map +1 -1
  379. package/dist/helpers/dateFormatting.js +61 -45
  380. package/dist/helpers/dateFormatting.js.map +1 -1
  381. package/dist/helpers/formattedStrings.d.ts +1 -0
  382. package/dist/helpers/formattedStrings.js +21 -20
  383. package/dist/helpers/formattedStrings.js.map +1 -1
  384. package/dist/hooks/useOverflowDetection/useOverflowDetection.js +5 -6
  385. package/dist/i18n/I18n.js +7 -7
  386. package/dist/i18n/I18n.js.map +1 -1
  387. package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +12 -12
  388. package/dist/i18n/en/Employee.EmployeeDocuments.json.js +1 -1
  389. package/dist/i18n/en/Employee.I9SignatureForm.json.js +83 -65
  390. package/dist/i18n/en/Employee.I9SignatureForm.json.js.map +1 -1
  391. package/dist/i18n/en/Employee.Landing.json.js +7 -9
  392. package/dist/i18n/en/Employee.Landing.json.js.map +1 -1
  393. package/dist/i18n/en/Payroll.OffCycleCreation.json.js +14 -0
  394. package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -0
  395. package/dist/i18n/en/Payroll.OffCycleDeductionsSetting.json.js +12 -0
  396. package/dist/i18n/en/Payroll.OffCycleDeductionsSetting.json.js.map +1 -0
  397. package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +18 -0
  398. package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js.map +1 -0
  399. package/dist/i18n/en/Payroll.PayrollBlocker.json.js +21 -19
  400. package/dist/i18n/en/Payroll.PayrollBlocker.json.js.map +1 -1
  401. package/dist/i18n/en/Payroll.PayrollOverview.json.js +1 -1
  402. package/dist/i18n/en/common.json.d.ts +4 -1
  403. package/dist/i18n/en/common.json.js +5 -5
  404. package/dist/shared/constants.d.ts +4 -0
  405. package/dist/shared/constants.js +6 -4
  406. package/dist/shared/constants.js.map +1 -1
  407. package/dist/style.css +1 -1
  408. package/dist/types/i18next.d.ts +79 -2
  409. package/docs/reference/endpoint-inventory.json +1706 -0
  410. package/package.json +29 -13
  411. package/dist/components/Employee/Landing/Landing.module.scss.js +0 -8
  412. package/dist/components/Employee/Landing/Landing.module.scss.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Edit.js","sources":["../../../../src/components/Employee/Compensation/Edit.tsx"],"sourcesContent":["import { useEffect, useMemo } from 'react'\nimport { useFormContext, useWatch } from 'react-hook-form'\nimport { Trans, useTranslation } from 'react-i18next'\nimport {\n type CompensationInputs,\n useCompensation,\n rateMinimumError,\n rateExemptThresholdError,\n} from './useCompensation'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus, PAY_PERIODS } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport {\n NumberInputField,\n SelectField,\n TextInputField,\n SwitchField,\n RadioGroupField,\n ComboBoxField,\n CheckboxField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { WA_RISK_CLASS_CODES } from '@/models/WA_RISK_CODES'\n\nexport interface SelectCategory {\n id: string\n name: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Employee.Compensation')\n const format = useNumberFormatter('currency')\n const Components = useComponentContext()\n\n const stateWcRiskOptions = useMemo(\n () =>\n WA_RISK_CLASS_CODES.map(({ code, description }) => ({\n value: code,\n label: `${code}: ${description}`,\n })),\n [],\n )\n\n const {\n control,\n register,\n setValue,\n formState: { errors, defaultValues },\n } = useFormContext<CompensationInputs>()\n\n const watchedFlsaStatus = useWatch({ control, name: 'flsaStatus' })\n const watchedStateWcCovered = useWatch({ control, name: 'stateWcCovered' })\n const { currentJob, mode, minimumWages, handleFlsaChange, state, showTwoPercentStakeholder } =\n useCompensation()\n\n /**Correctly set payment unit selected option and rate based on flsa status, falling back to default */\n useEffect(() => {\n if (watchedFlsaStatus === FlsaStatus.OWNER) {\n setValue('paymentUnit', 'Paycheck')\n } else if (\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n ) {\n setValue('paymentUnit', 'Year')\n setValue('rate', 0)\n } else if (defaultValues?.paymentUnit) {\n setValue('paymentUnit', defaultValues.paymentUnit)\n }\n }, [watchedFlsaStatus, setValue, defaultValues?.paymentUnit])\n\n if (\n !(\n mode === 'ADD_INITIAL_JOB' ||\n mode === 'ADD_ADDITIONAL_JOB' ||\n mode === 'EDIT_INITIAL_JOB' ||\n mode === 'EDIT_ADDITIONAL_JOB'\n )\n )\n return\n\n const classificationOptions = (Object.keys(FlsaStatus) as Array<keyof typeof FlsaStatus>).map(\n key => ({\n value: FlsaStatus[key],\n label: t(`flsaStatusLabels.${FlsaStatus[key]}`),\n }),\n )\n\n const paymentUnitOptions = [\n { value: PAY_PERIODS.HOUR, label: t('paymentUnitOptions.Hour') },\n { value: PAY_PERIODS.WEEK, label: t('paymentUnitOptions.Week') },\n { value: PAY_PERIODS.MONTH, label: t('paymentUnitOptions.Month') },\n { value: PAY_PERIODS.YEAR, label: t('paymentUnitOptions.Year') },\n { value: PAY_PERIODS.PAYCHECK, label: t('paymentUnitOptions.Paycheck') },\n ]\n\n const isFlsaSelectionEnabled =\n watchedFlsaStatus !== FlsaStatus.NONEXEMPT || currentJob?.primary || mode === 'ADD_INITIAL_JOB'\n\n const isAdjustMinimumWageEnabled =\n watchedFlsaStatus === FlsaStatus.NONEXEMPT && minimumWages.length > 0\n\n let rateErrorMessage = t('validations.rate')\n if (errors.rate?.message === rateMinimumError) {\n rateErrorMessage = t('validations.nonZeroRate')\n } else if (errors.rate?.message === rateExemptThresholdError) {\n rateErrorMessage = t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n })\n }\n\n return (\n <>\n <TextInputField\n name=\"jobTitle\"\n label={t('jobTitle')}\n isRequired\n errorMessage={t('validations.title')}\n />\n {/* hiding flsa selection for secondary jobs */}\n {!isFlsaSelectionEnabled && <input type=\"hidden\" {...register('flsaStatus')} />}\n {isFlsaSelectionEnabled && (\n <SelectField\n name=\"flsaStatus\"\n label={t('employeeClassification')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{\n ClassificationLink: <Components.Link />,\n }}\n />\n }\n errorMessage={t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n })}\n options={classificationOptions}\n isRequired\n isDisabled={!isFlsaSelectionEnabled}\n onChange={handleFlsaChange}\n />\n )}\n <NumberInputField\n name=\"rate\"\n label={t('amount')}\n format=\"currency\"\n min={0}\n errorMessage={rateErrorMessage}\n isRequired\n isDisabled={\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n }\n />\n {isAdjustMinimumWageEnabled && (\n <>\n <SwitchField\n name=\"adjustForMinimumWage\"\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n />\n <SelectField\n name=\"minimumWageId\"\n label={t('minimumWageLabel')}\n description={t('minimumWageDescription')}\n options={minimumWages.map(wage => ({\n value: wage.uuid,\n label: `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`,\n }))}\n errorMessage={t('validations.minimumWage')}\n />\n </>\n )}\n <SelectField\n name=\"paymentUnit\"\n label={t('paymentUnitLabel')}\n description={t('paymentUnitDescription')}\n options={paymentUnitOptions}\n errorMessage={t('validations.paymentUnit')}\n isRequired\n isDisabled={\n watchedFlsaStatus === FlsaStatus.OWNER ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n }\n />\n {showTwoPercentStakeholder && (\n <CheckboxField label={t('twoPercentStakeholderLabel')} name=\"twoPercentShareholder\" />\n )}\n {state === 'WA' && (\n <>\n <RadioGroupField\n name=\"stateWcCovered\"\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={[\n { label: t('stateWcCoveredOptions.yes'), value: true },\n { label: t('stateWcCoveredOptions.no'), value: false },\n ]}\n />\n {watchedStateWcCovered && (\n <ComboBoxField\n name=\"stateWcClassCode\"\n label={t('stateWcClassCodeLabel')}\n options={stateWcRiskOptions}\n errorMessage={t('validations.stateWcClassCode')}\n placeholder={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n />\n )}\n </>\n )}\n </>\n )\n}\n"],"names":["Edit","t","useTranslation","format","useNumberFormatter","Components","useComponentContext","stateWcRiskOptions","useMemo","WA_RISK_CLASS_CODES","code","description","control","register","setValue","errors","defaultValues","useFormContext","watchedFlsaStatus","useWatch","watchedStateWcCovered","currentJob","mode","minimumWages","handleFlsaChange","state","showTwoPercentStakeholder","useCompensation","useEffect","FlsaStatus","classificationOptions","key","paymentUnitOptions","PAY_PERIODS","isFlsaSelectionEnabled","isAdjustMinimumWageEnabled","rateErrorMessage","rateMinimumError","rateExemptThresholdError","FLSA_OVERTIME_SALARY_LIMIT","jsxs","Fragment","jsx","TextInputField","SelectField","Trans","NumberInputField","SwitchField","wage","CheckboxField","RadioGroupField","ComboBoxField"],"mappings":";;;;;;;;;;;;;;;;AA4BO,MAAMA,KAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAASC,EAAmB,UAAU,GACtCC,IAAaC,EAAA,GAEbC,IAAqBC;AAAA,IACzB,MACEC,EAAoB,IAAI,CAAC,EAAE,MAAAC,GAAM,aAAAC,SAAmB;AAAA,MAClD,OAAOD;AAAA,MACP,OAAO,GAAGA,CAAI,KAAKC,CAAW;AAAA,IAAA,EAC9B;AAAA,IACJ,CAAA;AAAA,EAAC,GAGG;AAAA,IACJ,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAW,EAAE,QAAAC,GAAQ,eAAAC,EAAA;AAAA,EAAc,IACjCC,EAAA,GAEEC,IAAoBC,EAAS,EAAE,SAAAP,GAAS,MAAM,cAAc,GAC5DQ,IAAwBD,EAAS,EAAE,SAAAP,GAAS,MAAM,kBAAkB,GACpE,EAAE,YAAAS,GAAY,MAAAC,GAAM,cAAAC,GAAc,kBAAAC,GAAkB,OAAAC,GAAO,2BAAAC,EAAA,IAC/DC,EAAA;AAiBF,MAdAC,E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GJ,SAAS;AAAA,YACP,EAAE,OAAOJ,EAAE,2BAA2B,GAAG,OAAO,GAAA;AAAA,YAChD,EAAE,OAAOA,EAAE,0BAA0B,GAAG,OAAO,GAAA;AAAA,UAAM;AAAA,QACvD;AAAA,MAAA;AAAA,MAEDmB,KACC,gBAAAsB;AAAA,QAACS;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOlD,EAAE,uBAAuB;AAAA,UAChC,SAASM;AAAA,UACT,cAAcN,EAAE,8BAA8B;AAAA,UAC9C,aAAaA,EAAE,uBAAuB;AAAA,UACtC,aAAaA,EAAE,6BAA6B;AAAA,QAAA;AAAA,MAAA;AAAA,IAC9C,EAAA,CAEJ;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"Edit.js","sources":["../../../../src/components/Employee/Compensation/Edit.tsx"],"sourcesContent":["import { useEffect, useMemo } from 'react'\nimport { useFormContext, useWatch } from 'react-hook-form'\nimport { Trans, useTranslation } from 'react-i18next'\nimport {\n type CompensationInputs,\n useCompensation,\n rateMinimumError,\n rateExemptThresholdError,\n} from './useCompensation'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus, PAY_PERIODS } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport {\n NumberInputField,\n SelectField,\n TextInputField,\n SwitchField,\n RadioGroupField,\n ComboBoxField,\n CheckboxField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { WA_RISK_CLASS_CODES } from '@/models/WA_RISK_CODES'\n\nexport interface SelectCategory {\n id: string\n name: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Employee.Compensation')\n const format = useNumberFormatter('currency')\n const Components = useComponentContext()\n\n const stateWcRiskOptions = useMemo(\n () =>\n WA_RISK_CLASS_CODES.map(({ code, description }) => ({\n value: code,\n label: `${code}: ${description}`,\n })),\n [],\n )\n\n const {\n control,\n register,\n setValue,\n formState: { errors, defaultValues },\n } = useFormContext<CompensationInputs>()\n\n const watchedFlsaStatus = useWatch({ control, name: 'flsaStatus' })\n const watchedStateWcCovered = useWatch({ control, name: 'stateWcCovered' })\n const { currentJob, mode, minimumWages, handleFlsaChange, state, showTwoPercentStakeholder } =\n useCompensation()\n\n /**Correctly set payment unit selected option and rate based on flsa status, falling back to default */\n useEffect(() => {\n if (watchedFlsaStatus === FlsaStatus.OWNER) {\n setValue('paymentUnit', 'Paycheck')\n } else if (\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n ) {\n setValue('paymentUnit', 'Year')\n setValue('rate', 0)\n } else if (defaultValues?.paymentUnit) {\n setValue('paymentUnit', defaultValues.paymentUnit)\n }\n }, [watchedFlsaStatus, setValue, defaultValues?.paymentUnit])\n\n if (\n !(\n mode === 'ADD_INITIAL_JOB' ||\n mode === 'ADD_ADDITIONAL_JOB' ||\n mode === 'EDIT_INITIAL_JOB' ||\n mode === 'EDIT_ADDITIONAL_JOB'\n )\n )\n return\n\n const classificationOptions = (Object.keys(FlsaStatus) as Array<keyof typeof FlsaStatus>).map(\n key => ({\n value: FlsaStatus[key],\n label: t(`flsaStatusLabels.${FlsaStatus[key]}`),\n }),\n )\n\n const paymentUnitOptions = [\n { value: PAY_PERIODS.HOUR, label: t('paymentUnitOptions.Hour') },\n { value: PAY_PERIODS.WEEK, label: t('paymentUnitOptions.Week') },\n { value: PAY_PERIODS.MONTH, label: t('paymentUnitOptions.Month') },\n { value: PAY_PERIODS.YEAR, label: t('paymentUnitOptions.Year') },\n { value: PAY_PERIODS.PAYCHECK, label: t('paymentUnitOptions.Paycheck') },\n ]\n\n const isFlsaSelectionEnabled =\n watchedFlsaStatus !== FlsaStatus.NONEXEMPT || currentJob?.primary || mode === 'ADD_INITIAL_JOB'\n\n const isAdjustMinimumWageEnabled =\n watchedFlsaStatus === FlsaStatus.NONEXEMPT && minimumWages.length > 0\n\n let rateErrorMessage = t('validations.rate')\n if (errors.rate?.message === rateMinimumError) {\n rateErrorMessage = t('validations.nonZeroRate')\n } else if (errors.rate?.message === rateExemptThresholdError) {\n rateErrorMessage = t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n })\n }\n\n return (\n <>\n <TextInputField\n name=\"jobTitle\"\n label={t('jobTitle')}\n isRequired\n errorMessage={t('validations.title')}\n />\n {/* hiding flsa selection for secondary jobs */}\n {!isFlsaSelectionEnabled && <input type=\"hidden\" {...register('flsaStatus')} />}\n {isFlsaSelectionEnabled && (\n <SelectField\n name=\"flsaStatus\"\n label={t('employeeClassification')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{\n ClassificationLink: <Components.Link />,\n }}\n />\n }\n errorMessage={t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n })}\n options={classificationOptions}\n isRequired\n isDisabled={!isFlsaSelectionEnabled}\n onChange={handleFlsaChange}\n />\n )}\n <NumberInputField\n name=\"rate\"\n label={t('amount')}\n format=\"currency\"\n min={0}\n errorMessage={rateErrorMessage}\n isRequired\n isDisabled={\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n }\n />\n {isAdjustMinimumWageEnabled && (\n <>\n <SwitchField\n name=\"adjustForMinimumWage\"\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n />\n <SelectField\n name=\"minimumWageId\"\n label={t('minimumWageLabel')}\n description={t('minimumWageDescription')}\n options={minimumWages.map(wage => ({\n value: wage.uuid,\n label: `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`,\n }))}\n errorMessage={t('validations.minimumWage')}\n />\n </>\n )}\n <SelectField\n name=\"paymentUnit\"\n label={t('paymentUnitLabel')}\n description={t('paymentUnitDescription')}\n options={paymentUnitOptions}\n errorMessage={t('validations.paymentUnit')}\n isRequired\n isDisabled={\n watchedFlsaStatus === FlsaStatus.OWNER ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n }\n />\n {showTwoPercentStakeholder && (\n <CheckboxField label={t('twoPercentStakeholderLabel')} name=\"twoPercentShareholder\" />\n )}\n {state === 'WA' && (\n <>\n <RadioGroupField\n name=\"stateWcCovered\"\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={[\n { label: t('stateWcCoveredOptions.yes'), value: true },\n { label: t('stateWcCoveredOptions.no'), value: false },\n ]}\n />\n {watchedStateWcCovered && (\n <ComboBoxField\n name=\"stateWcClassCode\"\n label={t('stateWcClassCodeLabel')}\n options={stateWcRiskOptions}\n errorMessage={t('validations.stateWcClassCode')}\n placeholder={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n />\n )}\n </>\n )}\n </>\n )\n}\n"],"names":["Edit","t","useTranslation","format","useNumberFormatter","Components","useComponentContext","stateWcRiskOptions","useMemo","WA_RISK_CLASS_CODES","code","description","control","register","setValue","errors","defaultValues","useFormContext","watchedFlsaStatus","useWatch","watchedStateWcCovered","currentJob","mode","minimumWages","handleFlsaChange","state","showTwoPercentStakeholder","useCompensation","useEffect","FlsaStatus","classificationOptions","key","paymentUnitOptions","PAY_PERIODS","isFlsaSelectionEnabled","isAdjustMinimumWageEnabled","rateErrorMessage","rateMinimumError","rateExemptThresholdError","FLSA_OVERTIME_SALARY_LIMIT","jsxs","Fragment","jsx","TextInputField","SelectField","Trans","NumberInputField","SwitchField","wage","CheckboxField","RadioGroupField","ComboBoxField"],"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js";
4
4
  import C from "../../../assets/icons/pencil.svg.js";
5
5
  import c from "../../../assets/icons/trashcan.svg.js";
6
6
  import "../../../shared/constants.js";
7
+ import "classnames";
7
8
  import { HamburgerMenu as f } from "../../Common/HamburgerMenu/HamburgerMenu.js";
8
9
  import { useDataView as y } from "../../Common/DataView/useDataView.js";
9
10
  import { DataView as g } from "../../Common/DataView/DataView.js";
10
- const P = () => {
11
- const { employeeJobs: i, mode: o, isPending: r, handleEdit: l, handleDelete: s } = d(), { t } = p("Employee.Compensation"), { ...m } = y({
11
+ const U = () => {
12
+ const { employeeJobs: i, mode: o, isPending: r, handleEdit: l, handleDelete: s } = d(), { t: e } = p("Employee.Compensation"), { ...m } = y({
12
13
  data: i,
13
14
  columns: [
14
15
  {
15
16
  key: "title",
16
- title: t("allCompensations.jobColumn"),
17
- render: (e) => e.title || ""
17
+ title: e("allCompensations.jobColumn"),
18
+ render: (t) => t.title || ""
18
19
  },
19
20
  {
20
21
  key: "flsaStatus",
21
- title: t("allCompensations.typeColumn"),
22
- render: (e) => {
23
- const n = e.compensations?.find(
24
- (u) => u.uuid === e.currentCompensationUuid
22
+ title: e("allCompensations.typeColumn"),
23
+ render: (t) => {
24
+ const n = t.compensations?.find(
25
+ (u) => u.uuid === t.currentCompensationUuid
25
26
  )?.flsaStatus;
26
- return n !== void 0 ? t(`flsaStatusLabels.${n}`) : null;
27
+ return n !== void 0 ? e(`flsaStatusLabels.${n}`) : null;
27
28
  }
28
29
  },
29
30
  {
30
31
  key: "rate",
31
- title: t("allCompensations.amountColumn"),
32
- render: (e) => e.rate?.toString() || ""
32
+ title: e("allCompensations.amountColumn"),
33
+ render: (t) => t.rate?.toString() || ""
33
34
  },
34
35
  {
35
36
  key: "paymentUnit",
36
- title: t("allCompensations.perColumn"),
37
- render: (e) => e.paymentUnit || ""
37
+ title: e("allCompensations.perColumn"),
38
+ render: (t) => t.paymentUnit || ""
38
39
  }
39
40
  ],
40
- itemMenu: (e) => /* @__PURE__ */ a(
41
+ itemMenu: (t) => /* @__PURE__ */ a(
41
42
  f,
42
43
  {
43
- triggerLabel: t("hamburgerTitle"),
44
+ triggerLabel: e("hamburgerTitle"),
44
45
  items: [
45
46
  {
46
- label: t("allCompensations.editCta"),
47
+ label: e("allCompensations.editCta"),
47
48
  icon: /* @__PURE__ */ a(C, { "aria-hidden": !0 }),
48
49
  onClick: () => {
49
- l(e.uuid);
50
+ l(t.uuid);
50
51
  }
51
52
  },
52
- ...e.primary ? [] : [
53
+ ...t.primary ? [] : [
53
54
  {
54
- label: t("allCompensations.deleteCta"),
55
+ label: e("allCompensations.deleteCta"),
55
56
  icon: /* @__PURE__ */ a(c, { "aria-hidden": !0 }),
56
57
  onClick: () => {
57
- s(e.uuid);
58
+ s(t.uuid);
58
59
  }
59
60
  }
60
61
  ]
@@ -64,9 +65,9 @@ const P = () => {
64
65
  )
65
66
  });
66
67
  if (o === "LIST")
67
- return /* @__PURE__ */ a(g, { "data-testid": "data-view", label: t("allCompensations.tableLabel"), ...m });
68
+ return /* @__PURE__ */ a(g, { "data-testid": "data-view", label: e("allCompensations.tableLabel"), ...m });
68
69
  };
69
70
  export {
70
- P as List
71
+ U as List
71
72
  };
72
73
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../src/components/Employee/Compensation/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type Job } from '@gusto/embedded-api/models/components/job'\nimport { useCompensation } from './useCompensation'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { employeeJobs, mode, isPending, handleEdit, handleDelete } = useCompensation()\n const { t } = useTranslation('Employee.Compensation')\n\n const { ...dataViewProps } = useDataView({\n data: employeeJobs,\n columns: [\n {\n key: 'title',\n title: t('allCompensations.jobColumn'),\n render: (job: Job) => job.title || '',\n },\n {\n key: 'flsaStatus',\n title: t('allCompensations.typeColumn'),\n render: (job: Job) => {\n const flsaStatus = job.compensations?.find(\n comp => comp.uuid === job.currentCompensationUuid,\n )?.flsaStatus\n return flsaStatus !== undefined ? t(`flsaStatusLabels.${flsaStatus}`) : null\n },\n },\n {\n key: 'rate',\n title: t('allCompensations.amountColumn'),\n render: (job: Job) => job.rate?.toString() || '',\n },\n {\n key: 'paymentUnit',\n title: t('allCompensations.perColumn'),\n render: (job: Job) => job.paymentUnit || '',\n },\n ],\n itemMenu: (job: Job) => (\n <HamburgerMenu\n triggerLabel={t('hamburgerTitle')}\n items={[\n {\n label: t('allCompensations.editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(job.uuid)\n },\n },\n ...(!job.primary\n ? [\n {\n label: t('allCompensations.deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n handleDelete(job.uuid)\n },\n },\n ]\n : []),\n ]}\n isLoading={isPending}\n />\n ),\n })\n\n if (mode !== 'LIST') {\n return\n }\n\n return (\n <DataView data-testid=\"data-view\" label={t('allCompensations.tableLabel')} {...dataViewProps} />\n )\n}\n"],"names":["List","employeeJobs","mode","isPending","handleEdit","handleDelete","useCompensation","useTranslation","dataViewProps","useDataView","job","flsaStatus","comp","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","DataView"],"mappings":";;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,cAAAC,GAAc,MAAAC,GAAM,WAAAC,GAAW,YAAAC,GAAY,cAAAC,EAAA,IAAiBC,EAAA,GAC9D,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAE9C,EAAE,GAAGC,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMR;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,4BAA4B;AAAA,QACrC,QAAQ,CAACS,MAAaA,EAAI,SAAS;AAAA,MAAA;A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AElG;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../src/components/Employee/Compensation/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type Job } from '@gusto/embedded-api/models/components/job'\nimport { useCompensation } from './useCompensation'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { employeeJobs, mode, isPending, handleEdit, handleDelete } = useCompensation()\n const { t } = useTranslation('Employee.Compensation')\n\n const { ...dataViewProps } = useDataView({\n data: employeeJobs,\n columns: [\n {\n key: 'title',\n title: t('allCompensations.jobColumn'),\n render: (job: Job) => job.title || '',\n },\n {\n key: 'flsaStatus',\n title: t('allCompensations.typeColumn'),\n render: (job: Job) => {\n const flsaStatus = job.compensations?.find(\n comp => comp.uuid === job.currentCompensationUuid,\n )?.flsaStatus\n return flsaStatus !== undefined ? t(`flsaStatusLabels.${flsaStatus}`) : null\n },\n },\n {\n key: 'rate',\n title: t('allCompensations.amountColumn'),\n render: (job: Job) => job.rate?.toString() || '',\n },\n {\n key: 'paymentUnit',\n title: t('allCompensations.perColumn'),\n render: (job: Job) => job.paymentUnit || '',\n },\n ],\n itemMenu: (job: Job) => (\n <HamburgerMenu\n triggerLabel={t('hamburgerTitle')}\n items={[\n {\n label: t('allCompensations.editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(job.uuid)\n },\n },\n ...(!job.primary\n ? [\n {\n label: t('allCompensations.deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n handleDelete(job.uuid)\n },\n },\n ]\n : []),\n ]}\n isLoading={isPending}\n />\n ),\n })\n\n if (mode !== 'LIST') {\n return\n }\n\n return (\n <DataView data-testid=\"data-view\" label={t('allCompensations.tableLabel')} {...dataViewProps} />\n )\n}\n"],"names":["List","employeeJobs","mode","isPending","handleEdit","handleDelete","useCompensation","t","useTranslation","dataViewProps","useDataView","job","flsaStatus","comp","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","DataView"],"mappings":";;;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,cAAAC,GAAc,MAAAC,GAAM,WAAAC,GAAW,YAAAC,GAAY,cAAAC,EAAA,IAAiBC,EAAA,GAC9D,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAE9C,EAAE,GAAGC,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMT;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAOM,EAAE,4BAA4B;AAAA,QACrC,QAAQ,CAACI,MAAaA,EAAI,SAAS;AAAA,MAAA;AAAA,MAErC;AAAA,QACE,KAAK;AAAA,QACL,OAAOJ,EAAE,6BAA6B;AAAA,QACtC,QAAQ,CAACI,MAAa;AACpB,gBAAMC,IAAaD,EAAI,eAAe;AAAA,YACpC,CAAAE,MAAQA,EAAK,SAASF,EAAI;AAAA,UAAA,GACzB;AACH,iBAAOC,MAAe,SAAYL,EAAE,oBAAoBK,CAAU,EAAE,IAAI;AAAA,QAC1E;AAAA,MAAA;AAAA,MAEF;AAAA,QACE,KAAK;AAAA,QACL,OAAOL,EAAE,+BAA+B;AAAA,QACxC,QAAQ,CAACI,MAAaA,EAAI,MAAM,cAAc;AAAA,MAAA;AAAA,MAEhD;AAAA,QACE,KAAK;AAAA,QACL,OAAOJ,EAAE,4BAA4B;AAAA,QACrC,QAAQ,CAACI,MAAaA,EAAI,eAAe;AAAA,MAAA;AAAA,IAC3C;AAAA,IAEF,UAAU,CAACA,MACT,gBAAAG;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,cAAcR,EAAE,gBAAgB;AAAA,QAChC,OAAO;AAAA,UACL;AAAA,YACE,OAAOA,EAAE,0BAA0B;AAAA,YACnC,MAAM,gBAAAO,EAACE,GAAA,EAAU,eAAW,GAAA,CAAC;AAAA,YAC7B,SAAS,MAAM;AACb,cAAAZ,EAAWO,EAAI,IAAI;AAAA,YACrB;AAAA,UAAA;AAAA,UAEF,GAAKA,EAAI,UAUL,CAAA,IATA;AAAA,YACE;AAAA,cACE,OAAOJ,EAAE,4BAA4B;AAAA,cACrC,MAAM,gBAAAO,EAACG,GAAA,EAAY,eAAW,GAAA,CAAC;AAAA,cAC/B,SAAS,MAAM;AACb,gBAAAZ,EAAaM,EAAI,IAAI;AAAA,cACvB;AAAA,YAAA;AAAA,UACF;AAAA,QAED;AAAA,QAEP,WAAWR;AAAA,MAAA;AAAA,IAAA;AAAA,EACb,CAEH;AAED,MAAID,MAAS;AAIb,WACE,gBAAAY,EAACI,KAAS,eAAY,aAAY,OAAOX,EAAE,6BAA6B,GAAI,GAAGE,GAAe;AAElG;"}
@@ -10,14 +10,14 @@ import { useGarnishmentsUpdateMutation as $ } from "@gusto/embedded-api/react-qu
10
10
  import { useComponentContext as J } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
11
11
  import { Form as Q } from "../../../Common/Form/Form.js";
12
12
  import { Flex as P } from "../../../Common/Flex/Flex.js";
13
+ import "classnames";
13
14
  import { ActionsLayout as Z } from "../../../Common/ActionsLayout/ActionsLayout.js";
14
15
  import "react-error-boundary";
15
- import "@gusto/embedded-api/models/errors/apierror";
16
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
16
17
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
17
18
  import "@tanstack/react-query";
18
19
  import { useBase as ee } from "../../../Base/useBase.js";
19
20
  import { componentEvents as M } from "../../../../shared/constants.js";
20
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
21
21
  import "dompurify";
22
22
  import "../../../../contexts/LocaleProvider/useLocale.js";
23
23
  import { SelectField as f } from "../../../Common/Fields/SelectField/SelectField.js";
@@ -9,14 +9,14 @@ import { useGarnishmentsUpdateMutation as B } from "@gusto/embedded-api/react-qu
9
9
  import { useComponentContext as I } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
10
10
  import { Form as U } from "../../../Common/Form/Form.js";
11
11
  import { Flex as m } from "../../../Common/Flex/Flex.js";
12
+ import "classnames";
12
13
  import { ActionsLayout as _ } from "../../../Common/ActionsLayout/ActionsLayout.js";
13
14
  import "react-error-boundary";
14
- import "@gusto/embedded-api/models/errors/apierror";
15
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
15
16
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
16
17
  import "@tanstack/react-query";
17
18
  import { useBase as j } from "../../../Base/useBase.js";
18
19
  import { componentEvents as b } from "../../../../shared/constants.js";
19
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
20
20
  import "dompurify";
21
21
  import "../../../../contexts/LocaleProvider/useLocale.js";
22
22
  import { TextInputField as G } from "../../../Common/Fields/TextInputField/TextInputField.js";
@@ -10,14 +10,14 @@ import { useGarnishmentsUpdateMutation as U } from "@gusto/embedded-api/react-qu
10
10
  import { useComponentContext as _ } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
11
11
  import { Form as j } from "../../../Common/Form/Form.js";
12
12
  import { Flex as m } from "../../../Common/Flex/Flex.js";
13
+ import "classnames";
13
14
  import { ActionsLayout as $ } from "../../../Common/ActionsLayout/ActionsLayout.js";
14
15
  import "react-error-boundary";
15
- import "@gusto/embedded-api/models/errors/apierror";
16
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
16
17
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
17
18
  import "@tanstack/react-query";
18
19
  import { useBase as z } from "../../../Base/useBase.js";
19
20
  import { componentEvents as b } from "../../../../shared/constants.js";
20
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
21
21
  import "dompurify";
22
22
  import "../../../../contexts/LocaleProvider/useLocale.js";
23
23
  import { TextInputField as H } from "../../../Common/Fields/TextInputField/TextInputField.js";
@@ -5,9 +5,10 @@ import { useGarnishmentsUpdateMutation as k } from "@gusto/embedded-api/react-qu
5
5
  import { BaseComponent as w } from "../../../Base/Base.js";
6
6
  import { useBase as U } from "../../../Base/useBase.js";
7
7
  import { Flex as E } from "../../../Common/Flex/Flex.js";
8
+ import "classnames";
8
9
  import { ActionsLayout as Y } from "../../../Common/ActionsLayout/ActionsLayout.js";
9
10
  import { HamburgerMenu as B } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
10
- import D from "../../../../hooks/useNumberFormatter.js";
11
+ import p from "../../../../hooks/useNumberFormatter.js";
11
12
  import S from "../../../../assets/icons/pencil.svg.js";
12
13
  import V from "../../../../assets/icons/trashcan.svg.js";
13
14
  import { useComponentDictionary as q, useI18n as F } from "../../../../i18n/I18n.js";
@@ -16,13 +17,13 @@ import { useComponentContext as H } from "../../../../contexts/ComponentAdapter/
16
17
  import j from "../../../../assets/icons/plus-circle.svg.js";
17
18
  import { useDataView as G } from "../../../Common/DataView/useDataView.js";
18
19
  import { DataView as R } from "../../../Common/DataView/DataView.js";
19
- function le(i) {
20
+ function de(i) {
20
21
  return /* @__PURE__ */ n(w, { ...i, children: /* @__PURE__ */ n(z, { ...i, children: i.children }) });
21
22
  }
22
- function z({ className: i, children: m, employeeId: p, dictionary: f }) {
23
- const { onEvent: o, baseSubmitHandler: h } = U(), { t } = N("Employee.Deductions"), a = H(), g = D("currency"), C = D("percent");
23
+ function z({ className: i, children: m, employeeId: D, dictionary: f }) {
24
+ const { onEvent: o, baseSubmitHandler: h } = U(), { t } = N("Employee.Deductions"), a = H(), g = p("currency"), C = p("percent");
24
25
  q("Employee.Deductions", f), F("Employee.Deductions");
25
- const { data: v } = I({ employeeId: p }), u = v.garnishmentList, T = u.filter((e) => e.active), { mutateAsync: y, isPending: L } = k(), P = async (e) => {
26
+ const { data: v } = I({ employeeId: D }), u = v.garnishmentList, T = u.filter((e) => e.active), { mutateAsync: y, isPending: L } = k(), P = async (e) => {
26
27
  await h(e, async (r) => {
27
28
  const { garnishment: l } = await y({
28
29
  request: {
@@ -103,6 +104,6 @@ function z({ className: i, children: m, employeeId: p, dictionary: f }) {
103
104
  ] }) }) });
104
105
  }
105
106
  export {
106
- le as DeductionsList
107
+ de as DeductionsList
107
108
  };
108
109
  //# sourceMappingURL=DeductionsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeductionsList.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsList/DeductionsList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { useDataView, DataView } from '@/components/Common'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\n\ninterface DeductionsListProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nexport function DeductionsList(props: DeductionsListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, employeeId, dictionary }: DeductionsListProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n const formatCurrency = useNumberFormatter('currency')\n const formatPercent = useNumberFormatter('percent')\n\n useComponentDictionary('Employee.Deductions', dictionary)\n useI18n('Employee.Deductions')\n\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n const activeDeductions = deductions.filter(deduction => deduction.active)\n\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n\n const handleDelete = async (deduction: Garnishment) => {\n await baseSubmitHandler(deduction, async payload => {\n const { garnishment } = await updateDeduction({\n request: {\n garnishmentId: payload.uuid,\n requestBody: {\n ...payload,\n totalAmount: payload.totalAmount ?? undefined,\n active: false,\n version: payload.version as string,\n },\n },\n })\n\n // if soft deleted deduction was the last active, then return to empty view\n // else if any other active deductions return to list view\n const remainingActiveDeductions = deductions.filter(d => d.active)\n\n if (\n remainingActiveDeductions.length === 1 &&\n remainingActiveDeductions[0]?.uuid === garnishment?.uuid\n ) {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DELETED_EMPTY)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DELETED, garnishment)\n }\n })\n }\n\n const handleEdit = (deduction: Garnishment) => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_EDIT, deduction)\n }\n\n const handleAdd = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_ADD)\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n }\n\n const { ...dataViewProps } = useDataView({\n data: activeDeductions,\n columns: [\n {\n key: 'description',\n title: t('nameColumn'),\n },\n {\n key: 'recurring',\n title: t('frequencyColumn'),\n render: deduction => {\n return deduction.recurring ? t('recurringText') : t('nonRecurringText')\n },\n },\n {\n key: 'amount',\n title: t('withheldColumn'),\n render: deduction => {\n const formattedAmount = deduction.deductAsPercentage\n ? formatPercent(Number(deduction.amount))\n : formatCurrency(Number(deduction.amount))\n return deduction.recurring\n ? t('recurringAmount', { value: formattedAmount })\n : formattedAmount\n },\n },\n ],\n itemMenu: deduction => {\n return (\n <HamburgerMenu\n isLoading={isPendingUpdate}\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEdit(deduction)\n },\n icon: <PencilSvg aria-hidden />,\n },\n {\n label: t('deleteCta'),\n onClick: async () => {\n await handleDelete(deduction)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n return (\n <section className={className}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Flex flexDirection=\"column\" gap={2}>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('includeDeductionsDescriptionV2')}\n </Components.Text>\n </Flex>\n\n <DataView label={t('deductionsTableLabel')} {...dataViewProps} />\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAdd}>\n <PlusCircleIcon />\n {t('addDeductionCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n </>\n )}\n </Flex>\n </section>\n )\n}\n"],"names":["DeductionsList","props","jsx","BaseComponent","Root","className","children","employeeId","dictionary","onEvent","baseSubmitHandler","useBase","useTranslation","Components","useComponentContext","formatCurrency","useNumberFormatter","formatPercent","useComponentDictionary","useI18n","data","useGarnishmentsListSuspense","deductions","activeDeductions","deduction","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","handleDelete","payload","garnishment","remainingActiveDeductions","d","componentEvents","handleEdit","handleAdd","handleContinue","dataViewProps","useDataView","formattedAmount","HamburgerMenu","PencilSvg","TrashCanSvg","Flex","jsxs","Fragment","DataView","ActionsLayout","PlusCircleIcon"],"mappings":";;;;;;;;;;;;;;;;;;AA2BO,SAASA,GAAeC,GAAqD;AAClF,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,YAAAC,GAAY,YAAAC,KAA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ACE,UAAA;AAAA,IAAA,gBAAAD,EAACD,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAzC,EAACW,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,WAAW,GAAE;AAAA,MAC5C,gBAAAX,EAACW,EAAW,MAAX,EAAgB,SAAQ,cACtB,UAAA,EAAE,gCAAgC,EAAA,CACrC;AAAA,IAAA,GACF;AAAA,sBAECiC,GAAA,EAAS,OAAO,EAAE,sBAAsB,GAAI,GAAGT,GAAe;AAAA,sBAC9DU,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAH,EAAC/B,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASsB,GAC9C,UAAA;AAAA,QAAA,gBAAAjC,EAAC8C,GAAA,EAAe;AAAA,QACf,EAAE,iBAAiB;AAAA,MAAA,GACtB;AAAA,MACA,gBAAA9C,EAACW,EAAW,QAAX,EAAkB,SAASuB,GAAiB,UAAA,EAAE,aAAa,EAAA,CAAE;AAAA,IAAA,EAAA,CAChE;AAAA,EAAA,EAAA,CACF,GAEJ,GACF;AAEJ;"}
1
+ {"version":3,"file":"DeductionsList.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsList/DeductionsList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { useDataView, DataView } from '@/components/Common'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\n\ninterface DeductionsListProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nexport function DeductionsList(props: DeductionsListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, employeeId, dictionary }: DeductionsListProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n const formatCurrency = useNumberFormatter('currency')\n const formatPercent = useNumberFormatter('percent')\n\n useComponentDictionary('Employee.Deductions', dictionary)\n useI18n('Employee.Deductions')\n\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n const activeDeductions = deductions.filter(deduction => deduction.active)\n\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n\n const handleDelete = async (deduction: Garnishment) => {\n await baseSubmitHandler(deduction, async payload => {\n const { garnishment } = await updateDeduction({\n request: {\n garnishmentId: payload.uuid,\n requestBody: {\n ...payload,\n totalAmount: payload.totalAmount ?? undefined,\n active: false,\n version: payload.version as string,\n },\n },\n })\n\n // if soft deleted deduction was the last active, then return to empty view\n // else if any other active deductions return to list view\n const remainingActiveDeductions = deductions.filter(d => d.active)\n\n if (\n remainingActiveDeductions.length === 1 &&\n remainingActiveDeductions[0]?.uuid === garnishment?.uuid\n ) {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DELETED_EMPTY)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DELETED, garnishment)\n }\n })\n }\n\n const handleEdit = (deduction: Garnishment) => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_EDIT, deduction)\n }\n\n const handleAdd = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_ADD)\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n }\n\n const { ...dataViewProps } = useDataView({\n data: activeDeductions,\n columns: [\n {\n key: 'description',\n title: t('nameColumn'),\n },\n {\n key: 'recurring',\n title: t('frequencyColumn'),\n render: deduction => {\n return deduction.recurring ? t('recurringText') : t('nonRecurringText')\n },\n },\n {\n key: 'amount',\n title: t('withheldColumn'),\n render: deduction => {\n const formattedAmount = deduction.deductAsPercentage\n ? formatPercent(Number(deduction.amount))\n : formatCurrency(Number(deduction.amount))\n return deduction.recurring\n ? t('recurringAmount', { value: formattedAmount })\n : formattedAmount\n },\n },\n ],\n itemMenu: deduction => {\n return (\n <HamburgerMenu\n isLoading={isPendingUpdate}\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEdit(deduction)\n },\n icon: <PencilSvg aria-hidden />,\n },\n {\n label: t('deleteCta'),\n onClick: async () => {\n await handleDelete(deduction)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n return (\n <section className={className}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Flex flexDirection=\"column\" gap={2}>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('includeDeductionsDescriptionV2')}\n </Components.Text>\n </Flex>\n\n <DataView label={t('deductionsTableLabel')} {...dataViewProps} />\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAdd}>\n <PlusCircleIcon />\n {t('addDeductionCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n </>\n )}\n </Flex>\n </section>\n )\n}\n"],"names":["DeductionsList","props","jsx","BaseComponent","Root","className","children","employeeId","dictionary","onEvent","baseSubmitHandler","useBase","useTranslation","Components","useComponentContext","formatCurrency","useNumberFormatter","formatPercent","useComponentDictionary","useI18n","data","useGarnishmentsListSuspense","deductions","activeDeductions","deduction","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","handleDelete","payload","garnishment","remainingActiveDeductions","d","componentEvents","handleEdit","handleAdd","handleContinue","dataViewProps","useDataView","formattedAmount","HamburgerMenu","PencilSvg","TrashCanSvg","Flex","jsxs","Fragment","DataView","ActionsLayout","PlusCircleIcon"],"mappings":";;;;;;;;;;;;;;;;;;;AA2BO,SAASA,GAAeC,GAAqD;AAClF,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,YAAAC,GAAY,YAAAC,KAAmC;AAClF,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GACjC,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA,GACbC,IAAiBC,EAAmB,UAAU,GAC9CC,IAAgBD,EAAmB,SAAS;AAElD,EAAAE,EAAuB,uBAAuBV,CAAU,GACxDW,EAAQ,qBAAqB;AAE7B,QAAM,EAAE,MAAAC,EAAA,IAASC,EAA4B,EAAE,YAAAd,GAAY,GACrDe,IAAaF,EAAK,iBAClBG,IAAmBD,EAAW,OAAO,CAAAE,MAAaA,EAAU,MAAM,GAElE,EAAE,aAAaC,GAAiB,WAAWC,EAAA,IAC/CC,EAAA,GAEIC,IAAe,OAAOJ,MAA2B;AACrD,UAAMd,EAAkBc,GAAW,OAAMK,MAAW;AAClD,YAAM,EAAE,aAAAC,MAAgB,MAAML,EAAgB;AAAA,QAC5C,SAAS;AAAA,UACP,eAAeI,EAAQ;AAAA,UACvB,aAAa;AAAA,YACX,GAAGA;AAAA,YACH,aAAaA,EAAQ,eAAe;AAAA,YACpC,Q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J,GACF;AAEJ;"}
@@ -5,6 +5,7 @@ import { BaseComponent as p } from "../../../Base/Base.js";
5
5
  import { useBase as h } from "../../../Base/useBase.js";
6
6
  import { Grid as C } from "../../../Common/Grid/Grid.js";
7
7
  import { Flex as m } from "../../../Common/Flex/Flex.js";
8
+ import "classnames";
8
9
  import { ActionsLayout as f } from "../../../Common/ActionsLayout/ActionsLayout.js";
9
10
  import { useComponentContext as D } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
10
11
  import "react";
@@ -12,7 +13,7 @@ import { useComponentDictionary as E, useI18n as y } from "../../../../i18n/I18n
12
13
  import { componentEvents as s } from "../../../../shared/constants.js";
13
14
  import g from "../../../../assets/icons/coins-hand.svg.js";
14
15
  import x from "../../../../assets/icons/plus-circle.svg.js";
15
- function k(t) {
16
+ function w(t) {
16
17
  return /* @__PURE__ */ n(p, { ...t, children: /* @__PURE__ */ n(I, { ...t, children: t.children }) });
17
18
  }
18
19
  function I({ className: t, dictionary: d }) {
@@ -49,6 +50,6 @@ function I({ className: t, dictionary: d }) {
49
50
  ] }) });
50
51
  }
51
52
  export {
52
- k as IncludeDeductions
53
+ w as IncludeDeductions
53
54
  };
54
55
  //# sourceMappingURL=IncludeDeductions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IncludeDeductions.js","sources":["../../../../../src/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport styles from './IncludeDeductions.module.scss'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { Grid } from '@/components/Common/Grid/Grid'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport CoinsHandsIcon from '@/assets/icons/coins-hand.svg?react'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\n\ninterface IncludeDeductionsProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nexport function IncludeDeductions(props: IncludeDeductionsProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, dictionary }: IncludeDeductionsProps) {\n const { onEvent } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n useComponentDictionary('Employee.Deductions', dictionary)\n useI18n('Employee.Deductions')\n\n const handleAdd = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_YES)\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_NO)\n }\n\n return (\n <section className={className}>\n <Grid gridTemplateColumns=\"1fr\">\n <Flex flexDirection=\"column\" gap={2}>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('includeDeductionsDescriptionV2')}\n </Components.Text>\n </Flex>\n\n {/* TODO: Replace with proper empty state component for DataViews */}\n <section className={styles.emptyStateContainer}>\n <Flex flexDirection=\"column\" gap={16} justifyContent=\"center\" alignItems=\"center\">\n <section className={styles.coinHandsIconContainer}>\n <CoinsHandsIcon width={24} height={24} />\n </section>\n <Components.Text weight=\"bold\">{t('includeDeductionsEmptyState')}</Components.Text>\n <Components.Button\n type=\"button\"\n variant=\"secondary\"\n onClick={handleAdd}\n className={styles.addDeductionButton}\n >\n <PlusCircleIcon />\n {t('addDeductionButtonCta')}\n </Components.Button>\n </Flex>\n </section>\n <ActionsLayout>\n <Components.Button type=\"button\" onClick={handleContinue}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n </Grid>\n </section>\n )\n}\n"],"names":["IncludeDeductions","props","jsx","BaseComponent","Root","className","dictionary","onEvent","useBase","t","useTranslation","Components","useComponentContext","useComponentDictionary","useI18n","handleAdd","componentEvents","hand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,GAAA,CAAI,EAAA,CACzC;AAAA,MACA,gBAAApB,EAACS,EAAW,MAAX,EAAgB,QAAO,QAAQ,UAAAF,EAAE,6BAA6B,GAAE;AAAA,MACjE,gBAAAS;AAAA,QAACP,EAAW;AAAA,QAAX;AAAA,UACC,MAAK;AAAA,UACL,SAAQ;AAAA,UACR,SAASI;AAAA,UACT,WAAWM,EAAO;AAAA,UAElB,UAAA;AAAA,YAAA,gBAAAnB,EAACqB,GAAA,EAAe;AAAA,YACfd,EAAE,uBAAuB;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC5B,EAAA,CACF,EAAA,CACF;AAAA,IACA,gBAAAP,EAACsB,GAAA,EACC,UAAA,gBAAAtB,EAACS,EAAW,QAAX,EAAkB,MAAK,UAAS,SAASM,GACvC,UAAAR,EAAE,aAAa,GAClB,EAAA,CACF;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"IncludeDeductions.js","sources":["../../../../../src/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport styles from './IncludeDeductions.module.scss'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { Grid } from '@/components/Common/Grid/Grid'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport CoinsHandsIcon from '@/assets/icons/coins-hand.svg?react'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\n\ninterface IncludeDeductionsProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nexport function IncludeDeductions(props: IncludeDeductionsProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, dictionary }: IncludeDeductionsProps) {\n const { onEvent } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n useComponentDictionary('Employee.Deductions', dictionary)\n useI18n('Employee.Deductions')\n\n const handleAdd = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_YES)\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_NO)\n }\n\n return (\n <section className={className}>\n <Grid gridTemplateColumns=\"1fr\">\n <Flex flexDirection=\"column\" gap={2}>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('includeDeductionsDescriptionV2')}\n </Components.Text>\n </Flex>\n\n {/* TODO: Replace with proper empty state component for DataViews */}\n <section className={styles.emptyStateContainer}>\n <Flex flexDirection=\"column\" gap={16} justifyContent=\"center\" alignItems=\"center\">\n <section className={styles.coinHandsIconContainer}>\n <CoinsHandsIcon width={24} height={24} />\n </section>\n <Components.Text weight=\"bold\">{t('includeDeductionsEmptyState')}</Components.Text>\n <Components.Button\n type=\"button\"\n variant=\"secondary\"\n onClick={handleAdd}\n className={styles.addDeductionButton}\n >\n <PlusCircleIcon />\n {t('addDeductionButtonCta')}\n </Components.Button>\n </Flex>\n </section>\n <ActionsLayout>\n <Components.Button type=\"button\" onClick={handleContinue}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n </Grid>\n </section>\n )\n}\n"],"names":["IncludeDeductions","props","jsx","BaseComponent","Root","className","dictionary","onEvent","useBase","t","useTranslation","Components","useComponentContext","useComponentDictionary","useI18n","handleAdd","componentEvents","handleContinue","jsxs","Grid","Flex","styles","CoinsHandsIcon","PlusCircleIcon","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;AAqBO,SAASA,EAAkBC,GAAwD;AACxF,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,G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AA,UACR,SAASI;AAAA,UACT,WAAWM,EAAO;AAAA,UAElB,UAAA;AAAA,YAAA,gBAAAnB,EAACqB,GAAA,EAAe;AAAA,YACfd,EAAE,uBAAuB;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC5B,EAAA,CACF,EAAA,CACF;AAAA,IACA,gBAAAP,EAACsB,GAAA,EACC,UAAA,gBAAAtB,EAACS,EAAW,QAAX,EAAkB,MAAK,UAAS,SAASM,GACvC,UAAAR,EAAE,aAAa,GAClB,EAAA,CACF;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;"}
@@ -1,5 +1,5 @@
1
1
  import { state as D, transition as e, reduce as E } from "robot3";
2
- import { DeductionsListContextual as c, IncludeDeductionsFormContextual as i, DeductionFormContextual as u } from "./DeductionsComponents.js";
2
+ import { DeductionFormContextual as u, DeductionsListContextual as c, IncludeDeductionsFormContextual as i } from "./DeductionsComponents.js";
3
3
  import { componentEvents as n } from "../../../shared/constants.js";
4
4
  const t = (o) => (d) => ({
5
5
  ...d,
@@ -1,15 +1,16 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { useTranslation as e } from "react-i18next";
3
- import { useDocumentList as r } from "./useDocumentList.js";
2
+ import { useTranslation as r } from "react-i18next";
3
+ import { useDocumentList as m } from "./useDocumentList.js";
4
4
  import "../../../../shared/constants.js";
5
- import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
6
- import { useComponentContext as s } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
5
+ import "classnames";
6
+ import { ActionsLayout as s } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
+ import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
8
  import "react";
8
- function d() {
9
- const { t } = e("Employee.DocumentSigner"), { handleContinue: n } = r(), i = s();
10
- return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(i.Button, { onClick: n, isLoading: !1, children: t("continueCta") }) });
9
+ function g() {
10
+ const { t } = r("Employee.DocumentSigner"), { handleContinue: n, hasSignedAllForms: i } = m(), e = c();
11
+ return /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(e.Button, { onClick: n, isLoading: !1, isDisabled: !i, children: t("continueCta") }) });
11
12
  }
12
13
  export {
13
- d as Actions
14
+ g as Actions
14
15
  };
15
16
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.DocumentSigner')\n const { handleContinue } = useDocumentList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button onClick={handleContinue} isLoading={false}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleContinue","useDocumentList","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,gBAAAC,EAAA,IAAmBC,EAAA,GACrBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,SAASF,GAAgB,WAAW,IACpD,UAAA,EAAE,aAAa,GAClB,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.DocumentSigner')\n const { handleContinue, hasSignedAllForms } = useDocumentList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button onClick={handleContinue} isLoading={false} isDisabled={!hasSignedAllForms}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleContinue","hasSignedAllForms","useDocumentList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,gBAAAC,GAAgB,mBAAAC,EAAA,IAAsBC,EAAA,GACxCC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAASH,GAAgB,WAAW,IAAO,YAAY,CAACC,GACxE,UAAA,EAAE,aAAa,GAClB,GACF;AAEJ;"}
@@ -1,46 +1,48 @@
1
- import { jsx as o, jsxs as l } from "react/jsx-runtime";
2
- import { useEmployeeFormsListSuspense as d } from "@gusto/embedded-api/react-query/employeeFormsList";
3
- import { Head as E } from "./Head.js";
4
- import { List as a } from "./List.js";
5
- import { Actions as F } from "./Actions.js";
1
+ import { jsx as o, jsxs as d } from "react/jsx-runtime";
2
+ import { useEmployeeFormsListSuspense as E } from "@gusto/embedded-api/react-query/employeeFormsList";
3
+ import { Head as a } from "./Head.js";
4
+ import { List as F } from "./List.js";
5
+ import { Actions as h } from "./Actions.js";
6
6
  import { DocumentListProvider as L } from "./useDocumentList.js";
7
- import { BaseComponent as h } from "../../../Base/Base.js";
8
- import { useBase as O } from "../../../Base/useBase.js";
9
- import { useI18n as S } from "../../../../i18n/I18n.js";
10
- import { componentEvents as i } from "../../../../shared/constants.js";
7
+ import { BaseComponent as S } from "../../../Base/Base.js";
8
+ import { useBase as g } from "../../../Base/useBase.js";
9
+ import { useI18n as O } from "../../../../i18n/I18n.js";
10
+ import { componentEvents as m } from "../../../../shared/constants.js";
11
11
  import { Flex as _ } from "../../../Common/Flex/Flex.js";
12
12
  import "react-i18next";
13
+ import "classnames";
13
14
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
15
  import "react";
15
- function G(e) {
16
- return /* @__PURE__ */ o(h, { ...e, children: /* @__PURE__ */ o(x, { ...e }) });
16
+ function V(e) {
17
+ return /* @__PURE__ */ o(S, { ...e, children: /* @__PURE__ */ o(v, { ...e }) });
17
18
  }
18
- function x({ employeeId: e, className: s, children: r }) {
19
- S("Employee.DocumentSigner");
20
- const { onEvent: t } = O(), { data: u, error: c } = d({ employeeId: e }), n = u.formList;
19
+ function v({ employeeId: e, className: s, children: t }) {
20
+ O("Employee.DocumentSigner");
21
+ const { onEvent: i } = g(), { data: u, error: c } = E({ employeeId: e }), n = u.formList, p = n.every((r) => !r.requiresSigning);
21
22
  return /* @__PURE__ */ o("section", { className: s, children: /* @__PURE__ */ o(
22
23
  L,
23
24
  {
24
25
  value: {
25
26
  employeeForms: n,
27
+ hasSignedAllForms: p,
26
28
  handleContinue: () => {
27
- t(i.EMPLOYEE_FORMS_DONE);
29
+ i(m.EMPLOYEE_FORMS_DONE);
28
30
  },
29
- handleRequestFormToSign: (m) => {
30
- const p = n.find((f) => f.uuid === m.uuid);
31
- t(i.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: m.uuid, name: p?.name });
31
+ handleRequestFormToSign: (r) => {
32
+ const l = n.find((f) => f.uuid === r.uuid);
33
+ i(m.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: r.uuid, name: l?.name });
32
34
  },
33
35
  documentListError: c
34
36
  },
35
- children: r || /* @__PURE__ */ l(_, { flexDirection: "column", children: [
36
- /* @__PURE__ */ o(E, {}),
37
+ children: t || /* @__PURE__ */ d(_, { flexDirection: "column", children: [
37
38
  /* @__PURE__ */ o(a, {}),
38
- /* @__PURE__ */ o(F, {})
39
+ /* @__PURE__ */ o(F, {}),
40
+ /* @__PURE__ */ o(h, {})
39
41
  ] })
40
42
  }
41
43
  ) });
42
44
  }
43
45
  export {
44
- G as DocumentList
46
+ V as DocumentList
45
47
  };
46
48
  //# sourceMappingURL=DocumentList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/DocumentList.tsx"],"sourcesContent":["import { useEmployeeFormsListSuspense } from '@gusto/embedded-api/react-query/employeeFormsList'\nimport { type Form } from '@gusto/embedded-api/models/components/form'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { DocumentListProvider } from './useDocumentList'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\n\ninterface DocumentListProps extends CommonComponentInterface {\n employeeId: string\n}\n\nexport function DocumentList(props: DocumentListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, className, children }: DocumentListProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent } = useBase()\n\n const { data, error: documentListError } = useEmployeeFormsListSuspense({ employeeId })\n const employeeForms = data.formList!\n\n const handleRequestFormToSign = (data: Form) => {\n const fullForm = employeeForms.find(f => f.uuid === data.uuid)\n onEvent(componentEvents.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: data.uuid, name: fullForm?.name })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_FORMS_DONE)\n }\n\n return (\n <section className={className}>\n <DocumentListProvider\n value={{\n employeeForms,\n handleContinue,\n handleRequestFormToSign,\n documentListError,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </DocumentListProvider>\n </section>\n )\n}\n"],"names":["DocumentList","props","jsx","BaseComponent","Root","employeeId","className","children","useI18n","onEvent","useBase","data","documentListError","useEmployeeFormsListSuspense","employeeForms","DocumentListProvider","componentEvents","fullForm","jsxs","Flex","Head","List","Actions"],"mappings":";;;;;;;;;;;;;;AAoBO,SAASA,EAAaC,GAAmD;AAC9E,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,WAAAC,GAAW,UAAAC,KAA+B;AACpE,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,EAAE,MAAAC,GAAM,OAAOC,EAAA,IAAsBC,EAA6B,EAAE,YAAAR,GAAY,GAChFS,IAAgBH,EAAK;AAW3B,SACE,gBAAAT,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACa;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,eAAAD;AAAA,QACA,gBATe,MAAM;AAC3B,UAAAL,EAAQO,EAAgB,mBAAmB;AAAA,QAC7C;AAAA,QAQQ,yBAfwB,CAACL,MAAe;AAC9C,gBAAMM,IAAWH,EAAc,KAAK,OAAK,EAAE,SAASH,EAAK,IAAI;AAC7D,UAAAF,EAAQO,EAAgB,4BAA4B,EAAE,MAAML,EAAK,MAAM,MAAMM,GAAU,MAAM;AAAA,QAC/F;AAAA,QAaQ,mBAAAL;AAAA,MAAA;AAAA,MAGD,UAAAL,KAGC,gBAAAW,EAACC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAjB,EAACkB,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;"}
1
+ {"version":3,"file":"DocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/DocumentList.tsx"],"sourcesContent":["import { useEmployeeFormsListSuspense } from '@gusto/embedded-api/react-query/employeeFormsList'\nimport { type Form } from '@gusto/embedded-api/models/components/form'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { DocumentListProvider } from './useDocumentList'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\n\ninterface DocumentListProps extends CommonComponentInterface {\n employeeId: string\n}\n\nexport function DocumentList(props: DocumentListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, className, children }: DocumentListProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent } = useBase()\n\n const { data, error: documentListError } = useEmployeeFormsListSuspense({ employeeId })\n const employeeForms = data.formList!\n\n const hasSignedAllForms = employeeForms.every(employeeForm => !employeeForm.requiresSigning)\n\n const handleRequestFormToSign = (data: Form) => {\n const fullForm = employeeForms.find(f => f.uuid === data.uuid)\n onEvent(componentEvents.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: data.uuid, name: fullForm?.name })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_FORMS_DONE)\n }\n\n return (\n <section className={className}>\n <DocumentListProvider\n value={{\n employeeForms,\n hasSignedAllForms,\n handleContinue,\n handleRequestFormToSign,\n documentListError,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </DocumentListProvider>\n </section>\n )\n}\n"],"names":["DocumentList","props","jsx","BaseComponent","Root","employeeId","className","children","useI18n","onEvent","useBase","data","documentListError","useEmployeeFormsListSuspense","employeeForms","hasSignedAllForms","employeeForm","DocumentListProvider","componentEvents","fullForm","jsxs","Flex","Head","List","Actions"],"mappings":";;;;;;;;;;;;;;;AAoBO,SAASA,EAAaC,GAAmD;AAC9E,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,WAAAC,GAAW,UAAAC,KAA+B;AACpE,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,EAAE,MAAAC,GAAM,OAAOC,EAAA,IAAsBC,EAA6B,EAAE,YAAAR,GAAY,GAChFS,IAAgBH,EAAK,UAErBI,IAAoBD,EAAc,MAAM,CAAAE,MAAgB,CAACA,EAAa,eAAe;AAW3F,SACE,gBAAAd,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACe;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,eAAAH;AAAA,QACA,mBAAAC;AAAA,QACA,gBAVe,MAAM;AAC3B,UAAAN,EAAQS,EAAgB,mBAAmB;AAAA,QAC7C;AAAA,QASQ,yBAhBwB,CAACP,MAAe;AAC9C,gBAAMQ,IAAWL,EAAc,KAAK,OAAK,EAAE,SAASH,EAAK,IAAI;AAC7D,UAAAF,EAAQS,EAAgB,4BAA4B,EAAE,MAAMP,EAAK,MAAM,MAAMQ,GAAU,MAAM;AAAA,QAC/F;AAAA,QAcQ,mBAAAP;AAAA,MAAA;AAAA,MAGD,UAAAL,KAGC,gBAAAa,EAACC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAnB,EAACoB,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;"}
@@ -2,10 +2,11 @@ import { jsx as o } from "react/jsx-runtime";
2
2
  import { useTranslation as m } from "react-i18next";
3
3
  import { useDocumentList as s } from "./useDocumentList.js";
4
4
  import { Flex as l } from "../../../Common/Flex/Flex.js";
5
+ import "classnames";
5
6
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
7
  import "react";
7
8
  import { DocumentList as u } from "../../../Common/DocumentList/DocumentList.js";
8
- function f() {
9
+ function S() {
9
10
  const { employeeForms: i, handleRequestFormToSign: n, documentListError: r } = s(), { t: e } = m("Employee.DocumentSigner");
10
11
  return /* @__PURE__ */ o("section", { style: { width: "100%" }, children: /* @__PURE__ */ o(l, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(
11
12
  u,
@@ -34,6 +35,6 @@ function f() {
34
35
  ) }) });
35
36
  }
36
37
  export {
37
- f as List
38
+ S as List
38
39
  };
39
40
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { Flex, DocumentList as SharedDocumentList } from '@/components/Common'\n\nexport function List() {\n const { employeeForms, handleRequestFormToSign, documentListError } = useDocumentList()\n const { t } = useTranslation('Employee.DocumentSigner')\n\n return (\n <section style={{ width: '100%' }}>\n <Flex flexDirection=\"column\" gap={32}>\n <SharedDocumentList\n forms={employeeForms.map(form => ({\n uuid: form.uuid,\n title: form.title,\n description: form.description,\n requires_signing: form.requiresSigning,\n }))}\n onRequestSign={handleRequestFormToSign}\n withError={!!documentListError}\n label={t('documentListLabel')}\n columnLabels={{\n form: t('formColumnLabel'),\n action: t('actionColumnLabel'),\n }}\n statusLabels={{\n signCta: t('signDocumentCta'),\n notSigned: t('notSigned'),\n complete: t('signDocumentComplete'),\n }}\n emptyStateLabel={t('emptyTableTitle')}\n errorLabel={t('documentListError')}\n />\n </Flex>\n </section>\n )\n}\n"],"names":["List","employeeForms","handleRequestFormToSign","documentListError","useDocumentList","t","useTranslation","jsx","Flex","SharedDocumentList","form"],"mappings":";;;;;;;AAIO,SAASA,IAAO;AACrB,QAAM,EAAE,eAAAC,GAAe,yBAAAC,GAAyB,mBAAAC,EAAA,IAAsBC,EAAA,GAChE,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB;AAEtD,SACE,gBAAAC,EAAC,WAAA,EAAQ,OAAO,EAAE,OAAO,UACvB,UAAA,gBAAAA,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAD;AAAA,IAACE;AAAAA,IAAA;AAAA,MACC,OAAOR,EAAc,IAAI,CAAAS,OAAS;AAAA,QAChC,MAAMA,EAAK;AAAA,QACX,OAAOA,EAAK;AAAA,QACZ,aAAaA,EAAK;AAAA,QAClB,kBAAkBA,EAAK;AAAA,MAAA,EACvB;AAAA,MACF,eAAeR;AAAA,MACf,WAAW,CAAC,CAACC;AAAA,MACb,OAAOE,EAAE,mBAAmB;AAAA,MAC5B,cAAc;AAAA,QACZ,MAAMA,EAAE,iBAAiB;AAAA,QACzB,QAAQA,EAAE,mBAAmB;AAAA,MAAA;AAAA,MAE/B,cAAc;AAAA,QACZ,SAASA,EAAE,iBAAiB;AAAA,QAC5B,WAAWA,EAAE,WAAW;AAAA,QACxB,UAAUA,EAAE,sBAAsB;AAAA,MAAA;AAAA,MAEpC,iBAAiBA,EAAE,iBAAiB;AAAA,MACpC,YAAYA,EAAE,mBAAmB;AAAA,IAAA;AAAA,EAAA,GAErC,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { Flex, DocumentList as SharedDocumentList } from '@/components/Common'\n\nexport function List() {\n const { employeeForms, handleRequestFormToSign, documentListError } = useDocumentList()\n const { t } = useTranslation('Employee.DocumentSigner')\n\n return (\n <section style={{ width: '100%' }}>\n <Flex flexDirection=\"column\" gap={32}>\n <SharedDocumentList\n forms={employeeForms.map(form => ({\n uuid: form.uuid,\n title: form.title,\n description: form.description,\n requires_signing: form.requiresSigning,\n }))}\n onRequestSign={handleRequestFormToSign}\n withError={!!documentListError}\n label={t('documentListLabel')}\n columnLabels={{\n form: t('formColumnLabel'),\n action: t('actionColumnLabel'),\n }}\n statusLabels={{\n signCta: t('signDocumentCta'),\n notSigned: t('notSigned'),\n complete: t('signDocumentComplete'),\n }}\n emptyStateLabel={t('emptyTableTitle')}\n errorLabel={t('documentListError')}\n />\n </Flex>\n </section>\n )\n}\n"],"names":["List","employeeForms","handleRequestFormToSign","documentListError","useDocumentList","t","useTranslation","jsx","Flex","SharedDocumentList","form"],"mappings":";;;;;;;;AAIO,SAASA,IAAO;AACrB,QAAM,EAAE,eAAAC,GAAe,yBAAAC,GAAyB,mBAAAC,EAAA,IAAsBC,EAAA,GAChE,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB;AAEtD,SACE,gBAAAC,EAAC,WAAA,EAAQ,OAAO,EAAE,OAAO,UACvB,UAAA,gBAAAA,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAD;AAAA,IAACE;AAAAA,IAAA;AAAA,MACC,OAAOR,EAAc,IAAI,CAAAS,OAAS;AAAA,QAChC,MAAMA,EAAK;AAAA,QACX,OAAOA,EAAK;AAAA,QACZ,aAAaA,EAAK;AAAA,QAClB,kBAAkBA,EAAK;AAAA,MAAA,EACvB;AAAA,MACF,eAAeR;AAAA,MACf,WAAW,CAAC,CAACC;AAAA,MACb,OAAOE,EAAE,mBAAmB;AAAA,MAC5B,cAAc;AAAA,QACZ,MAAMA,EAAE,iBAAiB;AAAA,QACzB,QAAQA,EAAE,mBAAmB;AAAA,MAAA;AAAA,MAE/B,cAAc;AAAA,QACZ,SAASA,EAAE,iBAAiB;AAAA,QAC5B,WAAWA,EAAE,WAAW;AAAA,QACxB,UAAUA,EAAE,sBAAsB;AAAA,MAAA;AAAA,MAEpC,iBAAiBA,EAAE,iBAAiB;AAAA,MACpC,YAAYA,EAAE,mBAAmB;AAAA,IAAA;AAAA,EAAA,GAErC,EAAA,CACF;AAEJ;"}
@@ -1,6 +1,7 @@
1
1
  import { Form } from '@gusto/embedded-api/models/components/form';
2
2
  type DocumentListContextType = {
3
3
  employeeForms: Form[];
4
+ hasSignedAllForms: boolean;
4
5
  handleContinue: () => void;
5
6
  handleRequestFormToSign: (form: Form) => void;
6
7
  documentListError: Error | null;
@@ -2,13 +2,13 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "react-error-boundary";
4
4
  import "react-i18next";
5
- import "@gusto/embedded-api/models/errors/apierror";
5
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@tanstack/react-query";
8
8
  import "../../../Base/useBase.js";
9
9
  import "../../../../shared/constants.js";
10
+ import "classnames";
10
11
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
11
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
12
12
  import "dompurify";
13
13
  import "../../../../contexts/LocaleProvider/useLocale.js";
14
14
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";