@gusto/embedded-react-sdk 0.15.0 → 0.17.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 (329) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/components/Base/Base.js +4 -4
  3. package/dist/components/Common/EmptyData/EmptyData.js +10 -10
  4. package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
  5. package/dist/components/Common/EmptyData/EmptyData.module.scss.js +5 -3
  6. package/dist/components/Common/EmptyData/EmptyData.module.scss.js.map +1 -1
  7. package/dist/components/Common/FieldDescription/FieldDescription.module.scss.js +1 -1
  8. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.d.ts +2 -0
  9. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +54 -0
  10. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -0
  11. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes.d.ts +44 -0
  12. package/dist/components/Common/FlowBreadcrumbs/index.d.ts +3 -0
  13. package/dist/components/Common/SignatureForm/SignatureForm.js +10 -12
  14. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  15. package/dist/components/Common/SignatureForm/SignatureFormActions.js +2 -3
  16. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  17. package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -8
  18. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  19. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.d.ts +2 -0
  20. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +52 -0
  21. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js.map +1 -0
  22. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.module.scss.js +16 -0
  23. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.module.scss.js.map +1 -0
  24. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +41 -0
  25. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js +8 -0
  26. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js.map +1 -0
  27. package/dist/components/Common/UI/Breadcrumbs/index.d.ts +3 -0
  28. package/dist/components/Common/UI/DescriptionList/DescriptionList.d.ts +2 -0
  29. package/dist/components/Common/UI/DescriptionList/DescriptionList.js +16 -0
  30. package/dist/components/Common/UI/DescriptionList/DescriptionList.js.map +1 -0
  31. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +10 -0
  32. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js.map +1 -0
  33. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +10 -0
  34. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js +5 -0
  35. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -0
  36. package/dist/components/Common/UI/DescriptionList/index.d.ts +3 -0
  37. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  38. package/dist/components/Company/AssignSignatory/AssignSignatory.js +5 -7
  39. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  40. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +2 -4
  41. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  42. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +2 -3
  43. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  44. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +6 -8
  45. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  46. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +15 -16
  47. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  48. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -5
  49. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  50. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +2 -3
  51. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  52. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +9 -11
  53. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  54. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
  55. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  56. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -5
  57. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  58. package/dist/components/Company/AssignSignatory/TitleSelect.js +3 -5
  59. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  60. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -7
  61. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  62. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
  63. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  64. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +4 -6
  65. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  66. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -5
  67. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  68. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js +22 -17
  69. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js.map +1 -1
  70. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +2 -3
  71. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  72. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +6 -7
  73. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  74. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -6
  75. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  76. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +2 -3
  77. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  78. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +8 -10
  79. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  80. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -5
  81. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  82. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +7 -9
  83. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  84. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -5
  85. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  86. package/dist/components/Company/FederalTaxes/Actions.js +6 -7
  87. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  88. package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -4
  89. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  90. package/dist/components/Company/FederalTaxes/Form.js +4 -4
  91. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -10
  92. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  93. package/dist/components/Company/Industry/Actions.js +7 -8
  94. package/dist/components/Company/Industry/Actions.js.map +1 -1
  95. package/dist/components/Company/Industry/Context.js +7 -8
  96. package/dist/components/Company/Industry/Context.js.map +1 -1
  97. package/dist/components/Company/Industry/Edit.js +2 -4
  98. package/dist/components/Company/Industry/Edit.js.map +1 -1
  99. package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
  100. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  101. package/dist/components/Company/Locations/LocationForm/Form.js +5 -7
  102. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  103. package/dist/components/Company/Locations/LocationForm/LocationForm.js +8 -10
  104. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  105. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -5
  106. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  107. package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
  108. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  109. package/dist/components/Company/Locations/LocationsList/List.js +9 -9
  110. package/dist/components/Company/Locations/LocationsList/LocationsList.js +2 -3
  111. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  112. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -5
  113. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  114. package/dist/components/Company/OnboardingFlow/OnboardingFlow.js +10 -10
  115. package/dist/components/Company/OnboardingFlow/OnboardingFlow.js.map +1 -1
  116. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js +16 -10
  117. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  118. package/dist/components/Company/OnboardingOverview/Completed.js +2 -3
  119. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  120. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -7
  121. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  122. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +6 -8
  123. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  124. package/dist/components/Company/OnboardingOverview/context.js +4 -5
  125. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  126. package/dist/components/Company/PaySchedule/PaySchedule.js +2 -3
  127. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  128. package/dist/components/Company/PaySchedule/_parts/Actions.js +2 -3
  129. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  130. package/dist/components/Company/PaySchedule/_parts/Edit.js +17 -17
  131. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  132. package/dist/components/Company/PaySchedule/_parts/Head.js +7 -8
  133. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  134. package/dist/components/Company/PaySchedule/_parts/List.js +8 -8
  135. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -7
  136. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  137. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
  138. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  139. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -5
  140. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  141. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +2 -3
  142. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  143. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +2 -3
  144. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  145. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -5
  146. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  147. package/dist/components/Contractor/Address/Address.js +3 -5
  148. package/dist/components/Contractor/Address/Address.js.map +1 -1
  149. package/dist/components/Contractor/Address/Form.js +7 -9
  150. package/dist/components/Contractor/Address/Form.js.map +1 -1
  151. package/dist/components/Contractor/Address/useAddress.js +6 -7
  152. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  153. package/dist/components/Contractor/ContractorList/index.js +4 -4
  154. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js +37 -37
  155. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  156. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +10 -12
  157. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  158. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -4
  159. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  160. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  161. package/dist/components/Contractor/Profile/useContractorProfile.js +3 -4
  162. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  163. package/dist/components/Contractor/Submit/Submit.js +19 -20
  164. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  165. package/dist/components/Employee/Compensation/Actions.js +12 -13
  166. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  167. package/dist/components/Employee/Compensation/Edit.js +14 -14
  168. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +9 -10
  169. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  170. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +31 -32
  171. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  172. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +8 -8
  173. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +10 -10
  174. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +22 -23
  175. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -1
  176. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +2 -3
  177. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  178. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +2 -4
  179. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  180. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -4
  181. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  182. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -5
  183. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  184. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +2 -4
  185. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  186. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -5
  187. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  188. package/dist/components/Employee/EmployeeList/Actions.js +6 -7
  189. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  190. package/dist/components/Employee/EmployeeList/EmployeeList.js +2 -4
  191. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  192. package/dist/components/Employee/EmployeeList/Head.js +2 -3
  193. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  194. package/dist/components/Employee/EmployeeList/List.js +10 -10
  195. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -5
  196. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  197. package/dist/components/Employee/FederalTaxes/Actions.js +5 -6
  198. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  199. package/dist/components/Employee/FederalTaxes/FederalForm.js +10 -11
  200. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  201. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -5
  202. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  203. package/dist/components/Employee/Landing/Landing.js +2 -3
  204. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  205. package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
  206. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  207. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +3 -5
  208. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  209. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +4 -4
  210. package/dist/components/Employee/PaymentMethod/PaymentMethod.d.ts +1 -0
  211. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +79 -78
  212. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  213. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +11 -13
  214. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  215. package/dist/components/Employee/PaymentMethod/Split.js +7 -7
  216. package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +1 -0
  217. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -7
  218. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  219. package/dist/components/Employee/Profile/Actions.js +5 -6
  220. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  221. package/dist/components/Employee/Profile/AdminPersonalDetails.js +6 -7
  222. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  223. package/dist/components/Employee/Profile/HomeAddress.js +5 -6
  224. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  225. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +23 -25
  226. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  227. package/dist/components/Employee/Profile/useProfile.js +4 -5
  228. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  229. package/dist/components/Employee/StateTaxes/Actions.js +5 -6
  230. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  231. package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -5
  232. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  233. package/dist/components/Employee/Taxes/Actions.js +6 -7
  234. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  235. package/dist/components/Employee/Taxes/FederalForm.js +10 -11
  236. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  237. package/dist/components/Employee/Taxes/useTaxes.js +4 -5
  238. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  239. package/dist/components/Flow/Flow.js +45 -24
  240. package/dist/components/Flow/Flow.js.map +1 -1
  241. package/dist/components/Flow/useFlow.d.ts +10 -1
  242. package/dist/components/Flow/useFlow.js.map +1 -1
  243. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.d.ts +1 -1
  244. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js +16 -16
  245. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js.map +1 -1
  246. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +20 -21
  247. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  248. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +15 -16
  249. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  250. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +97 -82
  251. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  252. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +5 -1
  253. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +88 -84
  254. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  255. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +39 -40
  256. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  257. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +27 -27
  258. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +6 -6
  259. package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +1 -1
  260. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +20 -19
  261. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
  262. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +5 -3
  263. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +65 -45
  264. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  265. package/dist/components/Payroll/PayrollFlow/index.d.ts +1 -1
  266. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
  267. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +233 -96
  268. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  269. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +10 -10
  270. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +8 -9
  271. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  272. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +12 -12
  273. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +1 -2
  274. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +41 -45
  275. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  276. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +1 -2
  277. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +93 -95
  278. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  279. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +1 -2
  280. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +12 -26
  281. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
  282. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +1 -2
  283. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +40 -44
  284. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  285. package/dist/components/Payroll/usePreparedPayrollData.js +3 -4
  286. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  287. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +46 -42
  288. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  289. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +2 -0
  290. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +4 -0
  291. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  292. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -3
  293. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  294. package/dist/helpers/breadcrumbHelpers.d.ts +33 -0
  295. package/dist/helpers/breadcrumbHelpers.js +46 -0
  296. package/dist/helpers/breadcrumbHelpers.js.map +1 -0
  297. package/dist/helpers/breadcrumbHelpers.test.d.ts +1 -0
  298. package/dist/helpers/dateFormatting.d.ts +4 -0
  299. package/dist/helpers/dateFormatting.js +30 -14
  300. package/dist/helpers/dateFormatting.js.map +1 -1
  301. package/dist/i18n/I18n.d.ts +1 -1
  302. package/dist/i18n/I18n.js +32 -23
  303. package/dist/i18n/I18n.js.map +1 -1
  304. package/dist/i18n/en/Company.PaySchedule.json.js +2 -2
  305. package/dist/i18n/en/Employee.PaymentMethod.json.js +70 -66
  306. package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
  307. package/dist/i18n/en/Payroll.PayrollBlocker.json.js +28 -0
  308. package/dist/i18n/en/Payroll.PayrollBlocker.json.js.map +1 -0
  309. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +28 -24
  310. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
  311. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +28 -26
  312. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
  313. package/dist/i18n/en/Payroll.PayrollFlow.json.js +8 -0
  314. package/dist/i18n/en/Payroll.PayrollFlow.json.js.map +1 -0
  315. package/dist/i18n/en/Payroll.PayrollLanding.json.js +2 -2
  316. package/dist/i18n/en/Payroll.PayrollOverview.json.js +60 -56
  317. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  318. package/dist/i18n/en/Payroll.PayrollReceipts.json.js +16 -12
  319. package/dist/i18n/en/Payroll.PayrollReceipts.json.js.map +1 -1
  320. package/dist/shared/constants.d.ts +3 -0
  321. package/dist/shared/constants.js +11 -9
  322. package/dist/shared/constants.js.map +1 -1
  323. package/dist/style.css +1 -1
  324. package/dist/types/i18next.d.ts +160 -149
  325. package/package.json +8 -8
  326. package/dist/i18n/en/Payroll.RunPayroll.json.js +0 -8
  327. package/dist/i18n/en/Payroll.RunPayroll.json.js.map +0 -1
  328. package/dist/i18n/en/PayrollBlocker.json.js +0 -24
  329. package/dist/i18n/en/PayrollBlocker.json.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import { jsx as t, jsxs as s, Fragment as b } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as s, Fragment as b } from "react/jsx-runtime";
2
2
  import { useTranslation as F } from "react-i18next";
3
3
  import { useForm as L, useWatch as q, FormProvider as R } from "react-hook-form";
4
4
  import { useMemo as T, useEffect as S } from "react";
5
- import { z as n } from "zod";
5
+ import { z as t } from "zod";
6
6
  import { zodResolver as N } from "@hookform/resolvers/zod";
7
7
  import { useGarnishmentsCreateMutation as I } from "@gusto/embedded-api/react-query/garnishmentsCreate";
8
8
  import { useGarnishmentsUpdateMutation as U } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
@@ -11,33 +11,32 @@ import { Form as B } from "../../../Common/Form/Form.js";
11
11
  import { Flex as w } from "../../../Common/Flex/Flex.js";
12
12
  import "classnames";
13
13
  import { componentEvents as l } from "../../../../shared/constants.js";
14
- import { RadioGroupField as f } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
15
- import { TextInputField as j } from "../../../Common/Fields/TextInputField/TextInputField.js";
16
- import { ActionsLayout as G } from "../../../Common/ActionsLayout/ActionsLayout.js";
17
- import { NumberInputField as c } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
14
+ import { ActionsLayout as j } from "../../../Common/ActionsLayout/ActionsLayout.js";
18
15
  import "react-error-boundary";
19
16
  import "@gusto/embedded-api/models/errors/apierror";
20
17
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
21
18
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
22
19
  import "@tanstack/react-query";
23
- import { useBase as Y } from "../../../Base/useBase.js";
20
+ import { useBase as G } from "../../../Base/useBase.js";
24
21
  import "dompurify";
25
22
  import "../../../../contexts/LocaleProvider/useLocale.js";
26
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
23
+ import { TextInputField as Y } from "../../../Common/Fields/TextInputField/TextInputField.js";
24
+ import { RadioGroupField as f } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
25
+ import { NumberInputField as c } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
27
26
  import { CheckboxField as k } from "../../../Common/Fields/CheckboxField/CheckboxField.js";
28
- const z = n.object({
29
- active: n.boolean(),
30
- amount: n.number().min(0).transform(String),
31
- description: n.string().min(1),
32
- courtOrdered: n.boolean(),
33
- times: n.number().nullable(),
34
- recurring: n.string().transform((e) => e === "true"),
35
- annualMaximum: n.number().min(0).transform((e) => e > 0 ? e.toString() : null).nullable(),
36
- payPeriodMaximum: n.number().min(0).transform((e) => e > 0 ? e.toString() : null).nullable(),
37
- deductAsPercentage: n.string().transform((e) => e === "true")
27
+ const z = t.object({
28
+ active: t.boolean(),
29
+ amount: t.number().min(0).transform(String),
30
+ description: t.string().min(1),
31
+ courtOrdered: t.boolean(),
32
+ times: t.number().nullable(),
33
+ recurring: t.string().transform((e) => e === "true"),
34
+ annualMaximum: t.number().min(0).transform((e) => e > 0 ? e.toString() : null).nullable(),
35
+ payPeriodMaximum: t.number().min(0).transform((e) => e > 0 ? e.toString() : null).nullable(),
36
+ deductAsPercentage: t.string().transform((e) => e === "true")
38
37
  });
39
- function Pe({ deduction: e, employeeId: g }) {
40
- const { onEvent: o, baseSubmitHandler: x } = Y(), { t: r } = F("Employee.Deductions"), p = _(), { mutateAsync: P, isPending: h } = I(), { mutateAsync: E, isPending: y } = U(), D = h || y, m = T(() => ({
38
+ function xe({ deduction: e, employeeId: g }) {
39
+ const { onEvent: o, baseSubmitHandler: x } = G(), { t: r } = F("Employee.Deductions"), p = _(), { mutateAsync: P, isPending: h } = I(), { mutateAsync: E, isPending: y } = U(), D = h || y, m = T(() => ({
41
40
  amount: e?.amount ? Number(e.amount) : 0,
42
41
  description: e?.description ?? "",
43
42
  times: e?.times ?? null,
@@ -81,9 +80,9 @@ function Pe({ deduction: e, employeeId: g }) {
81
80
  }, v = () => {
82
81
  o(l.EMPLOYEE_DEDUCTION_CANCEL);
83
82
  };
84
- return /* @__PURE__ */ t(R, { ...a, children: /* @__PURE__ */ t(B, { onSubmit: a.handleSubmit(O), children: /* @__PURE__ */ t(w, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ s(b, { children: [
85
- /* @__PURE__ */ t(j, { name: "description", label: r("descriptionLabel"), isRequired: !0 }),
86
- /* @__PURE__ */ t(
83
+ return /* @__PURE__ */ n(R, { ...a, children: /* @__PURE__ */ n(B, { onSubmit: a.handleSubmit(O), children: /* @__PURE__ */ n(w, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ s(b, { children: [
84
+ /* @__PURE__ */ n(Y, { name: "description", label: r("descriptionLabel"), isRequired: !0 }),
85
+ /* @__PURE__ */ n(
87
86
  f,
88
87
  {
89
88
  name: "deductAsPercentage",
@@ -95,8 +94,8 @@ function Pe({ deduction: e, employeeId: g }) {
95
94
  ]
96
95
  }
97
96
  ),
98
- /* @__PURE__ */ t(c, { name: "amount", label: r("deductionAmountLabel"), isRequired: !0, min: 0 }),
99
- /* @__PURE__ */ t(
97
+ /* @__PURE__ */ n(c, { name: "amount", label: r("deductionAmountLabel"), isRequired: !0, min: 0 }),
98
+ /* @__PURE__ */ n(
100
99
  f,
101
100
  {
102
101
  name: "recurring",
@@ -109,10 +108,10 @@ function Pe({ deduction: e, employeeId: g }) {
109
108
  }
110
109
  ),
111
110
  M === "true" && /* @__PURE__ */ s(b, { children: [
112
- /* @__PURE__ */ t(c, { name: "annualMaximum", label: r("annualMaxLabel"), min: 0 }),
113
- /* @__PURE__ */ t(c, { name: "payPeriodMaximum", label: "Pay period maximum", min: 0 })
111
+ /* @__PURE__ */ n(c, { name: "annualMaximum", label: r("annualMaxLabel"), min: 0 }),
112
+ /* @__PURE__ */ n(c, { name: "payPeriodMaximum", label: "Pay period maximum", min: 0 })
114
113
  ] }),
115
- /* @__PURE__ */ t(
114
+ /* @__PURE__ */ n(
116
115
  k,
117
116
  {
118
117
  name: "courtOrdered",
@@ -120,14 +119,14 @@ function Pe({ deduction: e, employeeId: g }) {
120
119
  isDisabled: !!e
121
120
  }
122
121
  ),
123
- /* @__PURE__ */ s(G, { children: [
124
- /* @__PURE__ */ t(p.Button, { variant: "secondary", onClick: v, children: r("cancelCta") }),
125
- /* @__PURE__ */ t(p.Button, { type: "submit", isLoading: D, children: r(e ? "continueCta" : "addDeductionCta") })
122
+ /* @__PURE__ */ s(j, { children: [
123
+ /* @__PURE__ */ n(p.Button, { variant: "secondary", onClick: v, children: r("cancelCta") }),
124
+ /* @__PURE__ */ n(p.Button, { type: "submit", isLoading: D, children: r(e ? "continueCta" : "addDeductionCta") })
126
125
  ] })
127
126
  ] }) }) }) });
128
127
  }
129
128
  export {
130
129
  z as DeductionSchema,
131
- Pe as default
130
+ xe as default
132
131
  };
133
132
  //# sourceMappingURL=CustomDeductionForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomDeductionForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { useEffect, useMemo } from 'react'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport {\n NumberInputField,\n TextInputField,\n RadioGroupField,\n CheckboxField,\n} from '@/components/Common'\nimport { type CommonComponentInterface, useBase } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\n\nexport const DeductionSchema = z.object({\n active: z.boolean(),\n amount: z.number().min(0).transform(String),\n description: z.string().min(1),\n courtOrdered: z.boolean(),\n times: z.number().nullable(),\n recurring: z.string().transform(val => val === 'true'),\n annualMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n payPeriodMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n deductAsPercentage: z.string().transform(val => val === 'true'),\n})\n\nexport type DeductionInputs = z.input<typeof DeductionSchema>\nexport type DeductionPayload = z.output<typeof DeductionSchema>\n\ninterface ChildSupportFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deduction?: Garnishment | null\n}\n\nfunction CustomDeductionForm({ deduction, employeeId }: ChildSupportFormProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation()\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n const isPending = isPendingCreate || isPendingUpdate\n\n const defaultValues: DeductionInputs = useMemo(() => {\n return {\n amount: deduction?.amount ? Number(deduction.amount) : 0,\n description: deduction?.description ?? '',\n times: deduction?.times ?? null,\n recurring: deduction?.recurring?.toString() ?? 'true',\n annualMaximum: deduction?.annualMaximum ? Number(deduction.annualMaximum) : null,\n payPeriodMaximum: deduction?.payPeriodMaximum ? Number(deduction.payPeriodMaximum) : null,\n deductAsPercentage: deduction?.deductAsPercentage?.toString() ?? 'true',\n active: true,\n courtOrdered: deduction?.courtOrdered ?? false,\n } as DeductionInputs\n }, [deduction])\n\n const formMethods = useForm<DeductionInputs, unknown, DeductionPayload>({\n resolver: zodResolver(DeductionSchema),\n defaultValues,\n })\n const { reset: resetForm, control } = formMethods\n\n useEffect(() => {\n resetForm(defaultValues)\n }, [deduction, defaultValues, resetForm])\n\n const watchedRecurring = useWatch({ control, name: 'recurring' })\n\n const onSubmit: SubmitHandler<DeductionPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n if (!deduction) {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId: employeeId,\n requestBody: { ...payload, times: payload.recurring ? null : 1 },\n },\n })\n\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: deduction.uuid,\n requestBody: {\n ...payload,\n version: deduction.version as string,\n times: payload.recurring ? null : 1,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n }\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CANCEL)\n }\n\n return (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <>\n <TextInputField name=\"description\" label={t('descriptionLabel')} isRequired />\n <RadioGroupField\n name=\"deductAsPercentage\"\n label={t('deductionTypeLabel')}\n isRequired\n options={[\n { value: 'true', label: t('deductionTypePercentageOption') },\n { value: 'false', label: t('deductionTypeFixedAmountOption') },\n ]}\n />\n <NumberInputField name=\"amount\" label={t('deductionAmountLabel')} isRequired min={0} />\n <RadioGroupField\n name=\"recurring\"\n label={t('frequencyLabel')}\n isRequired\n options={[\n { value: 'true', label: t('frequencyRecurringOption') },\n { value: 'false', label: t('frequencyOneTimeOption') },\n ]}\n />\n {watchedRecurring === 'true' && (\n <>\n <NumberInputField name=\"annualMaximum\" label={t('annualMaxLabel')} min={0} />\n <NumberInputField name=\"payPeriodMaximum\" label=\"Pay period maximum\" min={0} />\n </>\n )}\n <CheckboxField\n name=\"courtOrdered\"\n label={t('courtOrderedLabel')}\n isDisabled={!!deduction}\n />\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {!deduction ? t('addDeductionCta') : t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n </>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n\nexport default CustomDeductionForm\n"],"names":["DeductionSchema","z","val","CustomDeductionForm","deduction","employeeId","onEvent","baseSubmitHandler","useBase","t","useTranslation","Components","useComponentContext","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","isPending","defaultValues","useMemo","formMethods","useForm","zodResolver","resetForm","control","useEffect","watchedRecurring","useWatch","onSubmit","data","payload","updateDeductionResponse","componentEvents","createDeductionResponse","handleCancel","FormProvider","jsx","Form","Flex","jsxs","Fragment","TextInputField","RadioGroupField","NumberInputField","CheckboxField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAMA,IAAkBC,EAAE,OAAO;AAAA,EACtC,QAAQA,EAAE,QAAA;AAAA,EACV,QAAQA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,UAAU,MAAM;AAAA,EAC1C,aAAaA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC7B,cAAcA,EAAE,QAAA;AAAA,EAChB,OAAOA,EAAE,OAAA,EAAS,SAAA;AAAA,EAClB,WAAWA,EAAE,OAAA,EAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAAA,EACrD,eAAeD,EACZ,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAAC,MAAQA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAA;AAAA,EACH,kBAAkBD,EACf,OAAA,EACA,IAAI,CAAC,EACL,U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version":3,"file":"CustomDeductionForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { useEffect, useMemo } from 'react'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport {\n NumberInputField,\n TextInputField,\n RadioGroupField,\n CheckboxField,\n} from '@/components/Common'\nimport { type CommonComponentInterface, useBase } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\n\nexport const DeductionSchema = z.object({\n active: z.boolean(),\n amount: z.number().min(0).transform(String),\n description: z.string().min(1),\n courtOrdered: z.boolean(),\n times: z.number().nullable(),\n recurring: z.string().transform(val => val === 'true'),\n annualMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n payPeriodMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n deductAsPercentage: z.string().transform(val => val === 'true'),\n})\n\nexport type DeductionInputs = z.input<typeof DeductionSchema>\nexport type DeductionPayload = z.output<typeof DeductionSchema>\n\ninterface ChildSupportFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deduction?: Garnishment | null\n}\n\nfunction CustomDeductionForm({ deduction, employeeId }: ChildSupportFormProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation()\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n const isPending = isPendingCreate || isPendingUpdate\n\n const defaultValues: DeductionInputs = useMemo(() => {\n return {\n amount: deduction?.amount ? Number(deduction.amount) : 0,\n description: deduction?.description ?? '',\n times: deduction?.times ?? null,\n recurring: deduction?.recurring?.toString() ?? 'true',\n annualMaximum: deduction?.annualMaximum ? Number(deduction.annualMaximum) : null,\n payPeriodMaximum: deduction?.payPeriodMaximum ? Number(deduction.payPeriodMaximum) : null,\n deductAsPercentage: deduction?.deductAsPercentage?.toString() ?? 'true',\n active: true,\n courtOrdered: deduction?.courtOrdered ?? false,\n } as DeductionInputs\n }, [deduction])\n\n const formMethods = useForm<DeductionInputs, unknown, DeductionPayload>({\n resolver: zodResolver(DeductionSchema),\n defaultValues,\n })\n const { reset: resetForm, control } = formMethods\n\n useEffect(() => {\n resetForm(defaultValues)\n }, [deduction, defaultValues, resetForm])\n\n const watchedRecurring = useWatch({ control, name: 'recurring' })\n\n const onSubmit: SubmitHandler<DeductionPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n if (!deduction) {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId: employeeId,\n requestBody: { ...payload, times: payload.recurring ? null : 1 },\n },\n })\n\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: deduction.uuid,\n requestBody: {\n ...payload,\n version: deduction.version as string,\n times: payload.recurring ? null : 1,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n }\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CANCEL)\n }\n\n return (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <>\n <TextInputField name=\"description\" label={t('descriptionLabel')} isRequired />\n <RadioGroupField\n name=\"deductAsPercentage\"\n label={t('deductionTypeLabel')}\n isRequired\n options={[\n { value: 'true', label: t('deductionTypePercentageOption') },\n { value: 'false', label: t('deductionTypeFixedAmountOption') },\n ]}\n />\n <NumberInputField name=\"amount\" label={t('deductionAmountLabel')} isRequired min={0} />\n <RadioGroupField\n name=\"recurring\"\n label={t('frequencyLabel')}\n isRequired\n options={[\n { value: 'true', label: t('frequencyRecurringOption') },\n { value: 'false', label: t('frequencyOneTimeOption') },\n ]}\n />\n {watchedRecurring === 'true' && (\n <>\n <NumberInputField name=\"annualMaximum\" label={t('annualMaxLabel')} min={0} />\n <NumberInputField name=\"payPeriodMaximum\" label=\"Pay period maximum\" min={0} />\n </>\n )}\n <CheckboxField\n name=\"courtOrdered\"\n label={t('courtOrderedLabel')}\n isDisabled={!!deduction}\n />\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {!deduction ? t('addDeductionCta') : t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n </>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n\nexport default CustomDeductionForm\n"],"names":["DeductionSchema","z","val","CustomDeductionForm","deduction","employeeId","onEvent","baseSubmitHandler","useBase","t","useTranslation","Components","useComponentContext","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","isPending","defaultValues","useMemo","formMethods","useForm","zodResolver","resetForm","control","useEffect","watchedRecurring","useWatch","onSubmit","data","payload","updateDeductionResponse","componentEvents","createDeductionResponse","handleCancel","FormProvider","jsx","Form","Flex","jsxs","Fragment","TextInputField","RadioGroupField","NumberInputField","CheckboxField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAMA,IAAkBC,EAAE,OAAO;AAAA,EACtC,QA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AAA,QACC,MAAK;AAAA,QACL,OAAOrC,EAAE,mBAAmB;AAAA,QAC5B,YAAY,CAAC,CAACL;AAAA,MAAA;AAAA,IAAA;AAAA,sBAEf2C,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAT,EAAC3B,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASyB,GAC7C,UAAA3B,EAAE,WAAW,EAAA,CAChB;AAAA,MACA,gBAAA6B,EAAC3B,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWQ,GACzC,UAAoCV,EAAnCL,IAAqC,gBAAvB,iBAAoC,EAAA,CACtD;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
@@ -13,12 +13,12 @@ import { Form as V } from "../../../Common/Form/Form.js";
13
13
  import { Flex as W } from "../../../Common/Flex/Flex.js";
14
14
  import "classnames";
15
15
  import { componentEvents as p } from "../../../../shared/constants.js";
16
+ import { ActionsLayout as J } from "../../../Common/ActionsLayout/ActionsLayout.js";
17
+ import { useComponentDictionary as K, useI18n as Q } from "../../../../i18n/I18n.js";
18
+ import { useComponentContext as X } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
19
+ import { TextInputField as Z } from "../../../Common/Fields/TextInputField/TextInputField.js";
16
20
  import { RadioGroupField as x } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
17
- import { TextInputField as J } from "../../../Common/Fields/TextInputField/TextInputField.js";
18
- import { ActionsLayout as K } from "../../../Common/ActionsLayout/ActionsLayout.js";
19
21
  import { NumberInputField as f } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
20
- import { useComponentContext as Q } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
21
- import { useComponentDictionary as X, useI18n as Z } from "../../../../i18n/I18n.js";
22
22
  import { CheckboxField as $ } from "../../../Common/Fields/CheckboxField/CheckboxField.js";
23
23
  const ee = i.object({
24
24
  active: i.boolean(),
@@ -35,8 +35,8 @@ function Me(t) {
35
35
  return /* @__PURE__ */ n(z, { ...t, children: /* @__PURE__ */ n(ne, { ...t, children: t.children }) });
36
36
  }
37
37
  function ne({ className: t, children: b, employeeId: g, deductionId: h, dictionary: y }) {
38
- const { onEvent: u, baseSubmitHandler: P } = H(), { t: r } = N("Employee.Deductions"), m = Q();
39
- X("Employee.Deductions", y), Z("Employee.Deductions");
38
+ const { onEvent: u, baseSubmitHandler: P } = H(), { t: r } = N("Employee.Deductions"), m = X();
39
+ K("Employee.Deductions", y), Q("Employee.Deductions");
40
40
  const { data: C } = k({ employeeId: g }), e = h ? C.garnishmentList?.find((c) => c.uuid === h) ?? null : null, { mutateAsync: M, isPending: O } = j(), { mutateAsync: L, isPending: T } = Y(), a = B(() => ({
41
41
  amount: e?.amount ? Number(e.amount) : 0,
42
42
  description: e?.description ?? "",
@@ -83,7 +83,7 @@ function ne({ className: t, children: b, employeeId: g, deductionId: h, dictiona
83
83
  }, S = r(e ? "editDeductionTitle" : "addDeductionTitle");
84
84
  return /* @__PURE__ */ n("section", { className: t, children: /* @__PURE__ */ n(w, { ...s, children: /* @__PURE__ */ n(V, { onSubmit: s.handleSubmit(R), children: /* @__PURE__ */ n(W, { flexDirection: "column", gap: 32, children: b || /* @__PURE__ */ d(E, { children: [
85
85
  /* @__PURE__ */ n(m.Heading, { as: "h2", children: S }),
86
- /* @__PURE__ */ n(J, { name: "description", label: r("descriptionLabel"), isRequired: !0 }),
86
+ /* @__PURE__ */ n(Z, { name: "description", label: r("descriptionLabel"), isRequired: !0 }),
87
87
  /* @__PURE__ */ n(
88
88
  x,
89
89
  {
@@ -122,7 +122,7 @@ function ne({ className: t, children: b, employeeId: g, deductionId: h, dictiona
122
122
  /* @__PURE__ */ n(f, { name: "payPeriodMaximum", label: "Pay period maximum", min: 0 })
123
123
  ] }),
124
124
  /* @__PURE__ */ n($, { name: "courtOrdered", label: r("courtOrderedLabel") }),
125
- /* @__PURE__ */ d(K, { children: [
125
+ /* @__PURE__ */ d(J, { children: [
126
126
  /* @__PURE__ */ n(m.Button, { variant: "secondary", onClick: q, children: r("cancelCta") }),
127
127
  /* @__PURE__ */ n(m.Button, { type: "submit", isLoading: F, children: r(e ? "continueCta" : "addDeductionCta") })
128
128
  ] })
@@ -8,20 +8,20 @@ import { Flex as w } from "../../../Common/Flex/Flex.js";
8
8
  import "classnames";
9
9
  import { componentEvents as a } from "../../../../shared/constants.js";
10
10
  import { ActionsLayout as I } from "../../../Common/ActionsLayout/ActionsLayout.js";
11
- import { HamburgerMenu as M } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
12
11
  import u from "../../../Common/hooks/useNumberFormatter.js";
13
- import U from "../../../../assets/icons/pencil.svg.js";
14
- import B from "../../../../assets/icons/trashcan.svg.js";
15
- import { useComponentDictionary as S, useI18n as Y } from "../../../../i18n/I18n.js";
16
- import { useComponentContext as q } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
+ import M from "../../../../assets/icons/pencil.svg.js";
13
+ import U from "../../../../assets/icons/trashcan.svg.js";
14
+ import { useComponentDictionary as B, useI18n as S } from "../../../../i18n/I18n.js";
15
+ import { useComponentContext as Y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
16
+ import { HamburgerMenu as q } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
17
17
  import { useDataView as F } from "../../../Common/DataView/useDataView.js";
18
18
  import { DataView as H } from "../../../Common/DataView/DataView.js";
19
19
  function se(r) {
20
20
  return /* @__PURE__ */ n(_, { ...r, children: /* @__PURE__ */ n(V, { ...r, children: r.children }) });
21
21
  }
22
22
  function V({ className: r, children: s, employeeId: d, dictionary: l }) {
23
- const { onEvent: i, baseSubmitHandler: p } = k(), { t } = O("Employee.Deductions"), m = q(), E = u("currency"), f = u("percent");
24
- S("Employee.Deductions", l), Y("Employee.Deductions");
23
+ const { onEvent: i, baseSubmitHandler: p } = k(), { t } = O("Employee.Deductions"), m = Y(), E = u("currency"), f = u("percent");
24
+ B("Employee.Deductions", l), S("Employee.Deductions");
25
25
  const { data: D } = x({ employeeId: d }), h = D.garnishmentList.filter((e) => e.active), { mutateAsync: C, isPending: g } = N(), y = async (e) => {
26
26
  await p(e, async (o) => {
27
27
  const { garnishment: P } = await C({
@@ -62,7 +62,7 @@ function V({ className: r, children: s, employeeId: d, dictionary: l }) {
62
62
  }
63
63
  ],
64
64
  itemMenu: (e) => /* @__PURE__ */ n(
65
- M,
65
+ q,
66
66
  {
67
67
  isLoading: g,
68
68
  items: [
@@ -71,14 +71,14 @@ function V({ className: r, children: s, employeeId: d, dictionary: l }) {
71
71
  onClick: () => {
72
72
  v(e);
73
73
  },
74
- icon: /* @__PURE__ */ n(U, { "aria-hidden": !0 })
74
+ icon: /* @__PURE__ */ n(M, { "aria-hidden": !0 })
75
75
  },
76
76
  {
77
77
  label: t("deleteCta"),
78
78
  onClick: async () => {
79
79
  await y(e);
80
80
  },
81
- icon: /* @__PURE__ */ n(B, { "aria-hidden": !0 })
81
+ icon: /* @__PURE__ */ n(U, { "aria-hidden": !0 })
82
82
  }
83
83
  ]
84
84
  }
@@ -1,6 +1,6 @@
1
- import { jsx as o, jsxs as p, Fragment as a } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as p, Fragment as a } from "react/jsx-runtime";
2
2
  import { useTranslation as D } from "react-i18next";
3
- import { z as c } from "zod";
3
+ import { z as m } from "zod";
4
4
  import { useForm as f, FormProvider as E } from "react-hook-form";
5
5
  import { zodResolver as h } from "@hookform/resolvers/zod";
6
6
  import { BaseComponent as C } from "../../../Base/Base.js";
@@ -8,43 +8,42 @@ import { useBase as b } from "../../../Base/useBase.js";
8
8
  import { Form as N } from "../../../Common/Form/Form.js";
9
9
  import "classnames";
10
10
  import { componentEvents as s } from "../../../../shared/constants.js";
11
- import { RadioGroupField as v } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
12
- import { ActionsLayout as F } from "../../../Common/ActionsLayout/ActionsLayout.js";
13
- import { useComponentContext as I } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
- import "react";
15
- import { useComponentDictionary as Y, useI18n as y } from "../../../../i18n/I18n.js";
16
- const L = c.object({ includeDeductions: c.enum(["Yes", "No"]) });
17
- function H(n) {
18
- return /* @__PURE__ */ o(C, { ...n, children: /* @__PURE__ */ o(_, { ...n, children: n.children }) });
11
+ import { ActionsLayout as v } from "../../../Common/ActionsLayout/ActionsLayout.js";
12
+ import { useComponentDictionary as F, useI18n as I } from "../../../../i18n/I18n.js";
13
+ import { useComponentContext as Y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
+ import { RadioGroupField as y } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
15
+ const L = m.object({ includeDeductions: m.enum(["Yes", "No"]) });
16
+ function G(n) {
17
+ return /* @__PURE__ */ e(C, { ...n, children: /* @__PURE__ */ e(_, { ...n, children: n.children }) });
19
18
  }
20
19
  function _({ className: n, children: t, dictionary: u }) {
21
- const { onEvent: i } = b(), { t: e } = D("Employee.Deductions"), r = I();
22
- Y("Employee.Deductions", u), y("Employee.Deductions");
23
- const m = f({
20
+ const { onEvent: i } = b(), { t: o } = D("Employee.Deductions"), r = Y();
21
+ F("Employee.Deductions", u), I("Employee.Deductions");
22
+ const c = f({
24
23
  resolver: h(L),
25
24
  defaultValues: { includeDeductions: "No" }
26
25
  }), d = (l) => {
27
26
  l.includeDeductions === "Yes" ? i(s.EMPLOYEE_DEDUCTION_INCLUDE_YES) : i(s.EMPLOYEE_DEDUCTION_INCLUDE_NO);
28
27
  };
29
- return /* @__PURE__ */ o("section", { className: n, children: /* @__PURE__ */ o(E, { ...m, children: /* @__PURE__ */ o(N, { onSubmit: m.handleSubmit(d), children: t || /* @__PURE__ */ p(a, { children: [
30
- /* @__PURE__ */ o(r.Heading, { as: "h2", children: e("pageTitle") }),
31
- /* @__PURE__ */ o(
32
- v,
28
+ return /* @__PURE__ */ e("section", { className: n, children: /* @__PURE__ */ e(E, { ...c, children: /* @__PURE__ */ e(N, { onSubmit: c.handleSubmit(d), children: t || /* @__PURE__ */ p(a, { children: [
29
+ /* @__PURE__ */ e(r.Heading, { as: "h2", children: o("pageTitle") }),
30
+ /* @__PURE__ */ e(
31
+ y,
33
32
  {
34
33
  name: "includeDeductions",
35
34
  isRequired: !0,
36
- label: e("includeDeductionsFormLabel"),
37
- description: e("includeDeductionsDescription"),
35
+ label: o("includeDeductionsFormLabel"),
36
+ description: o("includeDeductionsDescription"),
38
37
  options: [
39
- { value: "Yes", label: e("includeDeductionsYes") },
40
- { value: "No", label: e("includeDeductionsNo") }
38
+ { value: "Yes", label: o("includeDeductionsYes") },
39
+ { value: "No", label: o("includeDeductionsNo") }
41
40
  ]
42
41
  }
43
42
  ),
44
- /* @__PURE__ */ o(F, { children: /* @__PURE__ */ o(r.Button, { type: "submit", children: e("continueCta") }) })
43
+ /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(r.Button, { type: "submit", children: o("continueCta") }) })
45
44
  ] }) }) }) });
46
45
  }
47
46
  export {
48
- H as IncludeDeductionsForm
47
+ G as IncludeDeductionsForm
49
48
  };
50
49
  //# sourceMappingURL=IncludeDeductionsForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IncludeDeductionsForm.js","sources":["../../../../../src/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { FormProvider, useForm, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { RadioGroupField } from '@/components/Common'\nimport { ActionsLayout } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nconst IncludeDeductionsSchema = z.object({ includeDeductions: z.enum(['Yes', 'No']) })\nexport type IncludeDeductionsPayload = z.output<typeof IncludeDeductionsSchema>\n\ninterface IncludeDeductionsFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nexport function IncludeDeductionsForm(props: IncludeDeductionsFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, dictionary }: IncludeDeductionsFormProps) {\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 formMethods = useForm<IncludeDeductionsPayload>({\n resolver: zodResolver(IncludeDeductionsSchema),\n defaultValues: { includeDeductions: 'No' },\n })\n\n const onSubmit: SubmitHandler<IncludeDeductionsPayload> = data => {\n if (data.includeDeductions === 'Yes') {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_YES)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_NO)\n }\n }\n\n return (\n <section className={className}>\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n <RadioGroupField\n name=\"includeDeductions\"\n isRequired\n label={t('includeDeductionsFormLabel')}\n description={t('includeDeductionsDescription')}\n options={[\n { value: 'Yes', label: t('includeDeductionsYes') },\n { value: 'No', label: t('includeDeductionsNo') },\n ]}\n />\n <ActionsLayout>\n <Components.Button type=\"submit\">{t('continueCta')}</Components.Button>\n </ActionsLayout>\n </>\n )}\n </Form>\n </FormProvider>\n </section>\n )\n}\n"],"names":["IncludeDeductionsSchema","z","IncludeDeductionsForm","props","jsx","BaseComponent","Root","className","children","dictionary","onEvent","useBase","t","useTranslation","Components","useComponentContext","useComponentDictionary","useI18n","formMethods","useForm","zodResolver","onSubmit","data","componentEvents","FormProvider","Form","jsxs","Fragment","RadioGroupField","Action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SAAS;AAAA,UACP,EAAE,OAAO,OAAO,OAAOA,EAAE,sBAAsB,EAAA;AAAA,UAC/C,EAAE,OAAO,MAAM,OAAOA,EAAE,qBAAqB,EAAA;AAAA,QAAE;AAAA,MACjD;AAAA,IAAA;AAAA,IAEF,gBAAAR,EAACyB,GAAA,EACC,UAAA,gBAAAzB,EAACU,EAAW,QAAX,EAAkB,MAAK,UAAU,UAAAF,EAAE,aAAa,EAAA,CAAE,EAAA,CACrD;AAAA,EAAA,GACF,EAAA,CAEJ,GACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"IncludeDeductionsForm.js","sources":["../../../../../src/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { FormProvider, useForm, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { RadioGroupField } from '@/components/Common'\nimport { ActionsLayout } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nconst IncludeDeductionsSchema = z.object({ includeDeductions: z.enum(['Yes', 'No']) })\nexport type IncludeDeductionsPayload = z.output<typeof IncludeDeductionsSchema>\n\ninterface IncludeDeductionsFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nexport function IncludeDeductionsForm(props: IncludeDeductionsFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, dictionary }: IncludeDeductionsFormProps) {\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 formMethods = useForm<IncludeDeductionsPayload>({\n resolver: zodResolver(IncludeDeductionsSchema),\n defaultValues: { includeDeductions: 'No' },\n })\n\n const onSubmit: SubmitHandler<IncludeDeductionsPayload> = data => {\n if (data.includeDeductions === 'Yes') {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_YES)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_NO)\n }\n }\n\n return (\n <section className={className}>\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n <RadioGroupField\n name=\"includeDeductions\"\n isRequired\n label={t('includeDeductionsFormLabel')}\n description={t('includeDeductionsDescription')}\n options={[\n { value: 'Yes', label: t('includeDeductionsYes') },\n { value: 'No', label: t('includeDeductionsNo') },\n ]}\n />\n <ActionsLayout>\n <Components.Button type=\"submit\">{t('continueCta')}</Components.Button>\n </ActionsLayout>\n </>\n )}\n </Form>\n </FormProvider>\n </section>\n )\n}\n"],"names":["IncludeDeductionsSchema","z","IncludeDeductionsForm","props","jsx","BaseComponent","Root","className","children","dictionary","onEvent","useBase","t","useTranslation","Components","useComponentContext","useComponentDictionary","useI18n","formMethods","useForm","zodResolver","onSubmit","data","componentEvents","FormProvider","Form","jsxs","Fragment","RadioGroupField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAMA,IAA0BC,EAAE,OAAO,EAAE,mBAAmBA,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC,GAAG;AAO9E,SAASC,EAAsBC,GAA4D;AAChG,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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AAEJ;"}
@@ -5,12 +5,11 @@ import "classnames";
5
5
  import "../../../../shared/constants.js";
6
6
  import { ActionsLayout as s } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
7
  import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
- import "react";
9
- function g() {
8
+ function h() {
10
9
  const { t } = r("Employee.DocumentSigner"), { handleContinue: n, hasSignedAllForms: i } = m(), e = c();
11
10
  return /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(e.Button, { onClick: n, isLoading: !1, isDisabled: !i, children: t("continueCta") }) });
12
11
  }
13
12
  export {
14
- g as Actions
13
+ h as Actions
15
14
  };
16
15
  //# 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, 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
+ {"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;"}
@@ -11,9 +11,7 @@ import { componentEvents as m } from "../../../../shared/constants.js";
11
11
  import { Flex as g } from "../../../Common/Flex/Flex.js";
12
12
  import "classnames";
13
13
  import "react-i18next";
14
- import "../../../../contexts/ComponentAdapter/useComponentContext.js";
15
- import "react";
16
- function G(e) {
14
+ function N(e) {
17
15
  return /* @__PURE__ */ o(F, { ...e, children: /* @__PURE__ */ o(O, { ...e }) });
18
16
  }
19
17
  function O({ employeeId: e, className: s, children: t }) {
@@ -42,6 +40,6 @@ function O({ employeeId: e, className: s, children: t }) {
42
40
  ) });
43
41
  }
44
42
  export {
45
- G as DocumentList
43
+ N as DocumentList
46
44
  };
47
45
  //# 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 hasSignedAllForms = employeeForms.every(employeeForm => !employeeForm.requiresSigning)\n\n const handleRequestFormToSign = (data: Form) => {\n onEvent(componentEvents.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: data.uuid })\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","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;AAU3F,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,yBAfwB,CAACP,MAAe;AAC9C,UAAAF,EAAQS,EAAgB,4BAA4B,EAAE,MAAMP,EAAK,MAAM;AAAA,QACzE;AAAA,QAcQ,mBAAAC;AAAA,MAAA;AAAA,MAGD,UAAAL,KAGC,gBAAAY,EAACC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAlB,EAACmB,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 onEvent(componentEvents.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: data.uuid })\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","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;AAU3F,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,yBAfwB,CAACP,MAAe;AAC9C,UAAAF,EAAQS,EAAgB,4BAA4B,EAAE,MAAMP,EAAK,MAAM;AAAA,QACzE;AAAA,QAcQ,mBAAAC;AAAA,MAAA;AAAA,MAGD,UAAAL,KAGC,gBAAAY,EAACC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAlB,EAACmB,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;"}
@@ -4,10 +4,8 @@ import { useDocumentList as s } from "./useDocumentList.js";
4
4
  import { Flex as l } from "../../../Common/Flex/Flex.js";
5
5
  import "classnames";
6
6
  import "../../../../shared/constants.js";
7
- import "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
- import "react";
9
7
  import { DocumentList as u } from "../../../Common/DocumentList/DocumentList.js";
10
- function D() {
8
+ function f() {
11
9
  const { employeeForms: i, handleRequestFormToSign: n, documentListError: r } = s(), { t: e } = m("Employee.DocumentSigner");
12
10
  return /* @__PURE__ */ o("section", { style: { width: "100%" }, children: /* @__PURE__ */ o(l, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(
13
11
  u,
@@ -36,6 +34,6 @@ function D() {
36
34
  ) }) });
37
35
  }
38
36
  export {
39
- D as List
37
+ f as List
40
38
  };
41
39
  //# 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;"}
@@ -9,14 +9,13 @@ import "@tanstack/react-query";
9
9
  import "../../../Base/useBase.js";
10
10
  import "../../../../shared/constants.js";
11
11
  import "classnames";
12
- import "../../../../contexts/ComponentAdapter/useComponentContext.js";
13
12
  import "dompurify";
14
13
  import "../../../../contexts/LocaleProvider/useLocale.js";
15
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
+ import "../../../../contexts/ComponentAdapter/useComponentContext.js";
16
15
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
17
- const [f, v] = t("DocumentListContext");
16
+ const [a, f] = t("DocumentListContext");
18
17
  export {
19
- v as DocumentListProvider,
20
- f as useDocumentList
18
+ f as DocumentListProvider,
19
+ a as useDocumentList
21
20
  };
22
21
  //# sourceMappingURL=useDocumentList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n hasSignedAllForms: boolean\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AAYA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
1
+ {"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n hasSignedAllForms: boolean\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAYA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
@@ -14,10 +14,8 @@ import { componentEvents as i } from "../../../../shared/constants.js";
14
14
  import { Flex as M } from "../../../Common/Flex/Flex.js";
15
15
  import "classnames";
16
16
  import "react-i18next";
17
- import "../../../../contexts/ComponentAdapter/useComponentContext.js";
18
- import "react";
19
17
  import { SignatureForm as R } from "../../../Common/SignatureForm/SignatureForm.js";
20
- function oo(r) {
18
+ function X(r) {
21
19
  return /* @__PURE__ */ o(A, { ...r, children: /* @__PURE__ */ o(j, { ...r }) });
22
20
  }
23
21
  function j({ employeeId: r, formId: s, className: u, children: n }) {
@@ -62,6 +60,6 @@ function j({ employeeId: r, formId: s, className: u, children: n }) {
62
60
  ) });
63
61
  }
64
62
  export {
65
- oo as SignatureForm
63
+ X as SignatureForm
66
64
  };
67
65
  //# sourceMappingURL=SignatureForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { useEmployeeFormsSignMutation } from '@gusto/embedded-api/react-query/employeeFormsSign'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport { Form as FormComponent } from './Form'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { Preview } from './Preview'\nimport { SignatureFormProvider } from './useSignatureForm'\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'\nimport type { SignatureFormInputs } from '@/components/Common/SignatureForm'\nimport { SignatureForm as SharedSignatureForm } from '@/components/Common/SignatureForm'\n\ninterface SignatureFormProps extends CommonComponentInterface {\n employeeId: string\n formId: string\n}\n\nexport function SignatureForm(props: SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, formId, className, children }: SignatureFormProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const form = data.form!\n\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId: form.uuid })\n const pdfUrl = formPdf!.documentUrl\n\n const { mutateAsync: signForm, isPending: isSignFormPending } = useEmployeeFormsSignMutation()\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const handleSubmit = async (data: SignatureFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n if (form.uuid) {\n const { form: signFormResult } = await signForm({\n request: {\n employeeId,\n formId: form.uuid,\n requestBody: {\n signatureText: payload.signature,\n agree: payload.confirmSignature,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_SIGN_FORM, signFormResult)\n }\n })\n }\n\n return (\n <section className={className}>\n <SignatureFormProvider\n value={{\n pdfUrl,\n handleBack,\n form,\n isPending: isSignFormPending,\n }}\n >\n <SharedSignatureForm onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\">\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Preview />\n <FormComponent />\n <Actions />\n </>\n )}\n </Flex>\n </SharedSignatureForm>\n </SignatureFormProvider>\n </section>\n )\n}\n"],"names":["SignatureForm","props","jsx","BaseComponent","Root","employeeId","formId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","data","useEmployeeFormsGetSuspense","form","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","signForm","isSignFormPending","useEmployeeFormsSignMutation","SignatureFormProvider","componentEvents","SharedSignatureForm","payload","signFormResult","Flex","jsxs","Fragment","Head","Preview","FormComponent","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBO,SAASA,GAAcC,GAAoD;AAChF,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BA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,UACjB,UAAAnB,KAGC,gBAAAoB,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAA3B,EAAC4B,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAQ;AAAA,0BACRC,GAAA,EAAc;AAAA,0BACdC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,GAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { useEmployeeFormsSignMutation } from '@gusto/embedded-api/react-query/employeeFormsSign'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport { Form as FormComponent } from './Form'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { Preview } from './Preview'\nimport { SignatureFormProvider } from './useSignatureForm'\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'\nimport type { SignatureFormInputs } from '@/components/Common/SignatureForm'\nimport { SignatureForm as SharedSignatureForm } from '@/components/Common/SignatureForm'\n\ninterface SignatureFormProps extends CommonComponentInterface {\n employeeId: string\n formId: string\n}\n\nexport function SignatureForm(props: SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, formId, className, children }: SignatureFormProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const form = data.form!\n\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId: form.uuid })\n const pdfUrl = formPdf!.documentUrl\n\n const { mutateAsync: signForm, isPending: isSignFormPending } = useEmployeeFormsSignMutation()\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const handleSubmit = async (data: SignatureFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n if (form.uuid) {\n const { form: signFormResult } = await signForm({\n request: {\n employeeId,\n formId: form.uuid,\n requestBody: {\n signatureText: payload.signature,\n agree: payload.confirmSignature,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_SIGN_FORM, signFormResult)\n }\n })\n }\n\n return (\n <section className={className}>\n <SignatureFormProvider\n value={{\n pdfUrl,\n handleBack,\n form,\n isPending: isSignFormPending,\n }}\n >\n <SharedSignatureForm onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\">\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Preview />\n <FormComponent />\n <Actions />\n </>\n )}\n </Flex>\n </SharedSignatureForm>\n </SignatureFormProvider>\n </section>\n )\n}\n"],"names":["SignatureForm","props","jsx","BaseComponent","Root","employeeId","formId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","data","useEmployeeFormsGetSuspense","form","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","signForm","isSignFormPending","useEmployeeFormsSignMutation","SignatureFormProvider","componentEvents","SharedSignatureForm","payload","signFormResult","Flex","jsxs","Fragment","Head","Preview","FormComponent","Actions"],"mappings":";;;;;;;;;;;;;;;;;AAyBO,SAASA,EAAcC,GAAoD;AAChF,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,QAAAC,GAAQ,WAAAC,GAAW,UAAAC,KAAgC;AAC7E,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC,EAAE,MAAAC,EAAA,IAASC,EAA4B,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J;"}
@@ -9,14 +9,13 @@ import "@tanstack/react-query";
9
9
  import "../../../Base/useBase.js";
10
10
  import "../../../../shared/constants.js";
11
11
  import "classnames";
12
- import "../../../../contexts/ComponentAdapter/useComponentContext.js";
13
12
  import "dompurify";
14
13
  import "../../../../contexts/LocaleProvider/useLocale.js";
15
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
+ import "../../../../contexts/ComponentAdapter/useComponentContext.js";
16
15
  import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
17
- const [s, f] = o("SignatureFormContext");
16
+ const [d, s] = o("SignatureFormContext");
18
17
  export {
19
- f as SignatureFormProvider,
20
- s as useSignatureForm
18
+ s as SignatureFormProvider,
19
+ d as useSignatureForm
21
20
  };
22
21
  //# sourceMappingURL=useSignatureForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: Form\n pdfUrl?: string | null\n handleBack: () => void\n isPending: boolean\n}\n\nconst [useSignatureForm, SignatureFormProvider] =\n createCompoundContext<SignatureFormContextType>('SignatureFormContext')\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAkBC,CAAqB,IAC5CC,EAAgD,sBAAsB;"}
1
+ {"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: Form\n pdfUrl?: string | null\n handleBack: () => void\n isPending: boolean\n}\n\nconst [useSignatureForm, SignatureFormProvider] =\n createCompoundContext<SignatureFormContextType>('SignatureFormContext')\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAkBC,CAAqB,IAC5CC,EAAgD,sBAAsB;"}