@gusto/embedded-react-sdk 0.8.1 → 0.9.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 (374) hide show
  1. package/CHANGELOG.md +20 -3
  2. package/dist/components/Base/Base.d.ts +6 -5
  3. package/dist/components/Base/Base.js +40 -39
  4. package/dist/components/Base/Base.js.map +1 -1
  5. package/dist/components/Base/index.d.ts +1 -0
  6. package/dist/components/Common/ActionsLayout/index.d.ts +1 -0
  7. package/dist/components/Common/DataView/DataCards/DataCards.js +21 -21
  8. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  9. package/dist/components/Common/DataView/DataCards/index.d.ts +1 -0
  10. package/dist/components/Common/DataView/index.d.ts +1 -0
  11. package/dist/components/Common/DocumentList/index.d.ts +1 -0
  12. package/dist/components/Common/DocumentViewer/index.d.ts +1 -0
  13. package/dist/components/Common/FieldCaption/index.d.ts +1 -0
  14. package/dist/components/Common/FieldDescription/index.d.ts +1 -0
  15. package/dist/components/Common/FieldErrorMessage/index.d.ts +1 -0
  16. package/dist/components/Common/FieldLayout/index.d.ts +1 -0
  17. package/dist/components/Common/Fields/CheckboxField/index.d.ts +1 -0
  18. package/dist/components/Common/Fields/CheckboxGroupField/index.d.ts +1 -0
  19. package/dist/components/Common/Fields/ComboBoxField/index.d.ts +1 -0
  20. package/dist/components/Common/Fields/DatePickerField/index.d.ts +1 -0
  21. package/dist/components/Common/Fields/NumberInputField/index.d.ts +1 -0
  22. package/dist/components/Common/Fields/RadioGroupField/index.d.ts +1 -0
  23. package/dist/components/Common/Fields/SelectField/index.d.ts +1 -0
  24. package/dist/components/Common/Fields/SwitchField/index.d.ts +1 -0
  25. package/dist/components/Common/Fields/TextInputField/index.d.ts +1 -0
  26. package/dist/components/Common/Fieldset/index.d.ts +1 -0
  27. package/dist/components/Common/Flex/index.d.ts +1 -0
  28. package/dist/components/Common/Form/index.d.ts +1 -0
  29. package/dist/components/Common/HamburgerMenu/index.d.ts +1 -0
  30. package/dist/components/Common/HorizontalFieldLayout/index.d.ts +1 -0
  31. package/dist/components/Common/PaginationControl/index.d.ts +1 -0
  32. package/dist/components/Common/ReorderableList/index.d.ts +1 -0
  33. package/dist/components/Common/SignatureForm/index.d.ts +1 -0
  34. package/dist/components/Common/TaxInputs/index.d.ts +1 -0
  35. package/dist/components/Common/UI/Alert/index.d.ts +1 -0
  36. package/dist/components/Common/UI/Button/index.d.ts +1 -0
  37. package/dist/components/Common/UI/CalendarPreview/index.d.ts +1 -0
  38. package/dist/components/Common/UI/Checkbox/index.d.ts +1 -0
  39. package/dist/components/Common/UI/CheckboxGroup/index.d.ts +1 -0
  40. package/dist/components/Common/UI/ComboBox/ComboBox.js +28 -27
  41. package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
  42. package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +6 -6
  43. package/dist/components/Common/UI/DatePicker/index.d.ts +1 -0
  44. package/dist/components/Common/UI/Heading/index.d.ts +1 -0
  45. package/dist/components/Common/UI/Input/index.d.ts +1 -0
  46. package/dist/components/Common/UI/Link/index.d.ts +1 -0
  47. package/dist/components/Common/UI/List/index.d.ts +1 -0
  48. package/dist/components/Common/UI/Menu/index.d.ts +1 -0
  49. package/dist/components/Common/UI/NumberInput/index.d.ts +1 -0
  50. package/dist/components/Common/UI/ProgressBar/index.d.ts +1 -0
  51. package/dist/components/Common/UI/Radio/index.d.ts +1 -0
  52. package/dist/components/Common/UI/RadioGroup/index.d.ts +1 -0
  53. package/dist/components/Common/UI/Select/index.d.ts +1 -0
  54. package/dist/components/Common/UI/Switch/index.d.ts +1 -0
  55. package/dist/components/Common/UI/Table/index.d.ts +1 -0
  56. package/dist/components/Common/UI/Text/index.d.ts +1 -0
  57. package/dist/components/Common/UI/TextInput/index.d.ts +1 -0
  58. package/dist/components/Common/VisuallyHidden/index.d.ts +1 -0
  59. package/dist/components/Common/index.d.ts +1 -0
  60. package/dist/components/Company/AssignSignatory/AssignSignatory.d.ts +3 -3
  61. package/dist/components/Company/AssignSignatory/AssignSignatory.js +20 -19
  62. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  63. package/dist/components/Company/AssignSignatory/CreateSignatory/index.d.ts +1 -0
  64. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
  65. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  66. package/dist/components/Company/AssignSignatory/InviteSignatory/index.d.ts +1 -0
  67. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
  68. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  69. package/dist/components/Company/AssignSignatory/index.d.ts +1 -0
  70. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
  71. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  72. package/dist/components/Company/BankAccount/BankAccount.d.ts +10 -0
  73. package/dist/components/Company/BankAccount/BankAccount.js +32 -0
  74. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -0
  75. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
  76. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  77. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -0
  78. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +13 -0
  79. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +63 -0
  80. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -0
  81. package/dist/components/Company/DocumentSigner/DocumentList/Head.js.map +1 -0
  82. package/dist/components/Company/DocumentSigner/DocumentList/List.js.map +1 -0
  83. package/dist/components/Company/DocumentSigner/DocumentList/ManageSignatories.js.map +1 -0
  84. package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/index.d.ts +1 -0
  85. package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/useDocumentList.js +4 -3
  86. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -0
  87. package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +12 -0
  88. package/dist/components/Company/DocumentSigner/DocumentSigner.js +41 -0
  89. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -0
  90. package/dist/components/Company/DocumentSigner/SignatureForm/Actions.js.map +1 -0
  91. package/dist/components/Company/DocumentSigner/SignatureForm/Form.js.map +1 -0
  92. package/dist/components/Company/DocumentSigner/SignatureForm/Head.js.map +1 -0
  93. package/dist/components/Company/DocumentSigner/SignatureForm/Preview.js.map +1 -0
  94. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +14 -0
  95. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +72 -0
  96. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -0
  97. package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/index.d.ts +1 -0
  98. package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/useSignatureForm.js +4 -3
  99. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -0
  100. package/dist/components/Company/DocumentSigner/assignSignatoryState.js.map +1 -0
  101. package/dist/components/Company/DocumentSigner/documentSignerStateMachine.js.map +1 -0
  102. package/dist/components/Company/DocumentSigner/index.d.ts +2 -0
  103. package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -0
  104. package/dist/components/Company/FederalTaxes/FederalTaxes.d.ts +1 -4
  105. package/dist/components/Company/FederalTaxes/FederalTaxes.js +27 -27
  106. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  107. package/dist/components/Company/FederalTaxes/index.d.ts +1 -0
  108. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
  109. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  110. package/dist/components/Company/Industry/Context.js +7 -6
  111. package/dist/components/Company/Industry/Context.js.map +1 -1
  112. package/dist/components/Company/Industry/Industry.d.ts +1 -1
  113. package/dist/components/Company/Industry/Industry.js +29 -28
  114. package/dist/components/Company/Industry/Industry.js.map +1 -1
  115. package/dist/components/Company/Industry/index.d.ts +1 -0
  116. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
  117. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  118. package/dist/components/Company/Locations/Locations.d.ts +9 -0
  119. package/dist/components/Company/Locations/Locations.js +27 -0
  120. package/dist/components/Company/Locations/Locations.js.map +1 -0
  121. package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +3 -3
  122. package/dist/components/Company/Locations/LocationsList/LocationsList.js +27 -32
  123. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  124. package/dist/components/Company/Locations/LocationsList/index.d.ts +1 -0
  125. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
  126. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  127. package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.d.ts +2 -2
  128. package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js +13 -13
  129. package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
  130. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js +3 -3
  131. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  132. package/dist/components/Company/OnboardingOverview/OnboardingOverview.d.ts +1 -1
  133. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +15 -15
  134. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  135. package/dist/components/Company/OnboardingOverview/context.js +4 -3
  136. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  137. package/dist/components/Company/PaySchedule/PaySchedule.d.ts +2 -2
  138. package/dist/components/Company/PaySchedule/PaySchedule.js +63 -62
  139. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  140. package/dist/components/Company/PaySchedule/_parts/index.d.ts +1 -0
  141. package/dist/components/Company/PaySchedule/index.d.ts +1 -0
  142. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
  143. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  144. package/dist/components/Company/StateTaxes/StateTaxes.d.ts +9 -0
  145. package/dist/components/Company/StateTaxes/StateTaxes.js +27 -0
  146. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -0
  147. package/dist/components/Company/StateTaxes/{StateTaxesFlowComponents.js → StateTaxesComponents.js} +1 -1
  148. package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -0
  149. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +10 -10
  150. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  151. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +1 -1
  152. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
  153. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +29 -29
  154. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  155. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
  156. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  157. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +3 -3
  158. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  159. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
  160. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  161. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +1 -1
  162. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
  163. package/dist/components/Company/index.d.ts +7 -6
  164. package/dist/components/Company/index.js +18 -18
  165. package/dist/components/Contractor/Address/Actions.d.ts +1 -0
  166. package/dist/components/Contractor/Address/Actions.js +13 -0
  167. package/dist/components/Contractor/Address/Actions.js.map +1 -0
  168. package/dist/components/Contractor/Address/Address.d.ts +16 -0
  169. package/dist/components/Contractor/Address/Address.js +74 -0
  170. package/dist/components/Contractor/Address/Address.js.map +1 -0
  171. package/dist/components/Contractor/Address/Form.d.ts +1 -0
  172. package/dist/components/Contractor/Address/Form.js +57 -0
  173. package/dist/components/Contractor/Address/Form.js.map +1 -0
  174. package/dist/components/Contractor/Address/Head.d.ts +1 -0
  175. package/dist/components/Contractor/Address/Head.js +15 -0
  176. package/dist/components/Contractor/Address/Head.js.map +1 -0
  177. package/dist/components/Contractor/Address/index.d.ts +2 -0
  178. package/dist/components/Contractor/Address/useAddress.d.ts +33 -0
  179. package/dist/components/Contractor/Address/useAddress.js +28 -0
  180. package/dist/components/Contractor/Address/useAddress.js.map +1 -0
  181. package/dist/components/Contractor/index.d.ts +2 -0
  182. package/dist/components/Contractor/index.js +5 -0
  183. package/dist/components/{Flow → Contractor}/index.js.map +1 -1
  184. package/dist/components/Employee/Compensation/Compensation.d.ts +1 -1
  185. package/dist/components/Employee/Compensation/Compensation.js +45 -44
  186. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  187. package/dist/components/Employee/Compensation/Edit.js +17 -16
  188. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  189. package/dist/components/Employee/Compensation/index.d.ts +1 -0
  190. package/dist/components/Employee/Compensation/useCompensation.d.ts +6 -46
  191. package/dist/components/Employee/Compensation/useCompensation.js +60 -45
  192. package/dist/components/Employee/Compensation/useCompensation.js.map +1 -1
  193. package/dist/components/Employee/Deductions/Deductions.d.ts +2 -2
  194. package/dist/components/Employee/Deductions/Deductions.js +73 -71
  195. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  196. package/dist/components/Employee/Deductions/index.d.ts +1 -0
  197. package/dist/components/Employee/Deductions/useDeductions.js +6 -5
  198. package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
  199. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  200. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  201. package/dist/components/Employee/DocumentSigner/DocumentSigner.d.ts +11 -0
  202. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +27 -0
  203. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -0
  204. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  205. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  206. package/dist/components/Employee/DocumentSigner/index.d.ts +2 -1
  207. package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +1 -1
  208. package/dist/components/Employee/EmployeeList/EmployeeList.js +38 -38
  209. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  210. package/dist/components/Employee/EmployeeList/List.js +9 -9
  211. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  212. package/dist/components/Employee/EmployeeList/useEmployeeList.d.ts +2 -1
  213. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
  214. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  215. package/dist/components/Employee/Landing/Landing.d.ts +1 -1
  216. package/dist/components/Employee/Landing/Landing.js +5 -5
  217. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  218. package/dist/components/Employee/Landing/index.d.ts +1 -0
  219. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +27 -0
  220. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js +29 -0
  221. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -0
  222. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +107 -0
  223. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -0
  224. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.d.ts +1 -1
  225. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +30 -30
  226. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
  227. package/dist/components/Employee/OnboardingSummary/index.d.ts +1 -0
  228. package/dist/components/Employee/PaymentMethod/PaymentMethod.d.ts +1 -1
  229. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +68 -68
  230. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  231. package/dist/components/Employee/PaymentMethod/index.d.ts +1 -0
  232. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +9 -8
  233. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  234. package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +1 -1
  235. package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +1 -1
  236. package/dist/components/Employee/Profile/Profile.d.ts +1 -1
  237. package/dist/components/Employee/Profile/Profile.js +117 -112
  238. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  239. package/dist/components/Employee/Profile/SelfPersonalDetails.d.ts +2 -2
  240. package/dist/components/Employee/Profile/index.d.ts +1 -0
  241. package/dist/components/Employee/Profile/useProfile.js +4 -3
  242. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  243. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +17 -0
  244. package/dist/components/{Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingComponents.js → Employee/SelfOnboardingFlow/SelfOnboardingComponents.js} +7 -7
  245. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -0
  246. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +2 -0
  247. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js +22 -0
  248. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -0
  249. package/dist/components/{Flow/StateMachines/employeeSelfOnboarding.js → Employee/SelfOnboardingFlow/selfOnboardingMachine.js} +4 -4
  250. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -0
  251. package/dist/components/Employee/Taxes/StateForm.d.ts +3 -3
  252. package/dist/components/Employee/Taxes/StateForm.js +2 -2
  253. package/dist/components/Employee/Taxes/StateForm.js.map +1 -1
  254. package/dist/components/Employee/Taxes/Taxes.d.ts +1 -1
  255. package/dist/components/Employee/Taxes/Taxes.js +93 -86
  256. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  257. package/dist/components/Employee/Taxes/index.d.ts +1 -0
  258. package/dist/components/Employee/Taxes/useTaxes.d.ts +2 -2
  259. package/dist/components/Employee/Taxes/useTaxes.js +4 -3
  260. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  261. package/dist/components/Employee/index.d.ts +4 -1
  262. package/dist/components/Employee/index.js +20 -16
  263. package/dist/components/Employee/index.js.map +1 -1
  264. package/dist/components/Flow/useFlow.d.ts +2 -1
  265. package/dist/components/Flow/useFlow.js.map +1 -1
  266. package/dist/components/index.d.ts +2 -1
  267. package/dist/contexts/ApiProvider/ApiProvider.d.ts +1 -1
  268. package/dist/contexts/ApiProvider/ApiProvider.js +17 -17
  269. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  270. package/dist/contexts/GustoApiProvider/index.d.ts +1 -0
  271. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +2 -7
  272. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +16 -14
  273. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  274. package/dist/contexts/GustoProvider/index.d.ts +2 -1
  275. package/dist/contexts/LocaleProvider/index.d.ts +1 -0
  276. package/dist/contexts/ThemeProvider/index.d.ts +1 -0
  277. package/dist/contexts/index.d.ts +1 -0
  278. package/dist/hooks/useForkRef/index.d.ts +1 -0
  279. package/dist/i18n/I18n.d.ts +2 -0
  280. package/dist/i18n/I18n.js +23 -17
  281. package/dist/i18n/I18n.js.map +1 -1
  282. package/dist/i18n/en/Contractor.Address.json.js +35 -0
  283. package/dist/i18n/en/Contractor.Address.json.js.map +1 -0
  284. package/dist/i18n/index.d.ts +1 -0
  285. package/dist/index.d.ts +1 -2
  286. package/dist/index.js +7 -11
  287. package/dist/index.js.map +1 -1
  288. package/dist/shared/constants.d.ts +7 -1
  289. package/dist/shared/constants.js +52 -46
  290. package/dist/shared/constants.js.map +1 -1
  291. package/dist/style.css +1 -1
  292. package/dist/types/Helpers.d.ts +14 -0
  293. package/dist/types/i18next.d.ts +80 -62
  294. package/package.json +5 -2
  295. package/dist/components/Company/BankAccount/BankAccountFlow.d.ts +0 -5
  296. package/dist/components/Company/BankAccount/BankAccountFlow.js +0 -24
  297. package/dist/components/Company/BankAccount/BankAccountFlow.js.map +0 -1
  298. package/dist/components/Company/DocumentSignerFlow/DocumentList/Actions.js.map +0 -1
  299. package/dist/components/Company/DocumentSignerFlow/DocumentList/DocumentList.d.ts +0 -13
  300. package/dist/components/Company/DocumentSignerFlow/DocumentList/DocumentList.js +0 -69
  301. package/dist/components/Company/DocumentSignerFlow/DocumentList/DocumentList.js.map +0 -1
  302. package/dist/components/Company/DocumentSignerFlow/DocumentList/Head.js.map +0 -1
  303. package/dist/components/Company/DocumentSignerFlow/DocumentList/List.js.map +0 -1
  304. package/dist/components/Company/DocumentSignerFlow/DocumentList/ManageSignatories.js.map +0 -1
  305. package/dist/components/Company/DocumentSignerFlow/DocumentList/useDocumentList.js.map +0 -1
  306. package/dist/components/Company/DocumentSignerFlow/DocumentSignerFlow.d.ts +0 -6
  307. package/dist/components/Company/DocumentSignerFlow/DocumentSignerFlow.js +0 -35
  308. package/dist/components/Company/DocumentSignerFlow/DocumentSignerFlow.js.map +0 -1
  309. package/dist/components/Company/DocumentSignerFlow/SignatureForm/Actions.js.map +0 -1
  310. package/dist/components/Company/DocumentSignerFlow/SignatureForm/Form.js.map +0 -1
  311. package/dist/components/Company/DocumentSignerFlow/SignatureForm/Head.js.map +0 -1
  312. package/dist/components/Company/DocumentSignerFlow/SignatureForm/Preview.js.map +0 -1
  313. package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.d.ts +0 -17
  314. package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.js +0 -78
  315. package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.js.map +0 -1
  316. package/dist/components/Company/DocumentSignerFlow/SignatureForm/useSignatureForm.js.map +0 -1
  317. package/dist/components/Company/DocumentSignerFlow/assignSignatoryState.js.map +0 -1
  318. package/dist/components/Company/DocumentSignerFlow/documentSignerStateMachine.js.map +0 -1
  319. package/dist/components/Company/DocumentSignerFlow/index.d.ts +0 -1
  320. package/dist/components/Company/DocumentSignerFlow/stateMachine.js.map +0 -1
  321. package/dist/components/Company/Locations/LocationsFlow.d.ts +0 -5
  322. package/dist/components/Company/Locations/LocationsFlow.js +0 -21
  323. package/dist/components/Company/Locations/LocationsFlow.js.map +0 -1
  324. package/dist/components/Company/StateTaxes/StateTaxesFlow.d.ts +0 -5
  325. package/dist/components/Company/StateTaxes/StateTaxesFlow.js +0 -21
  326. package/dist/components/Company/StateTaxes/StateTaxesFlow.js.map +0 -1
  327. package/dist/components/Company/StateTaxes/StateTaxesFlowComponents.js.map +0 -1
  328. package/dist/components/Employee/DocumentSigner/DocumentSignerFlow.d.ts +0 -5
  329. package/dist/components/Employee/DocumentSigner/DocumentSignerFlow.js +0 -21
  330. package/dist/components/Employee/DocumentSigner/DocumentSignerFlow.js.map +0 -1
  331. package/dist/components/Flow/EmployeeOnboardingFlow.d.ts +0 -27
  332. package/dist/components/Flow/EmployeeOnboardingFlow.js +0 -29
  333. package/dist/components/Flow/EmployeeOnboardingFlow.js.map +0 -1
  334. package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingComponents.d.ts +0 -5
  335. package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingComponents.js.map +0 -1
  336. package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingFlow.d.ts +0 -13
  337. package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingFlow.js +0 -26
  338. package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingFlow.js.map +0 -1
  339. package/dist/components/Flow/StateMachines/employeeOnboarding.js +0 -136
  340. package/dist/components/Flow/StateMachines/employeeOnboarding.js.map +0 -1
  341. package/dist/components/Flow/StateMachines/employeeSelfOnboarding.js.map +0 -1
  342. package/dist/components/Flow/StateMachines/index.d.ts +0 -2
  343. package/dist/components/Flow/index.d.ts +0 -2
  344. package/dist/components/Flow/index.js +0 -7
  345. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Actions.d.ts +0 -0
  346. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Actions.js +0 -0
  347. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Head.d.ts +0 -0
  348. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Head.js +0 -0
  349. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/List.d.ts +0 -0
  350. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/List.js +0 -0
  351. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.d.ts +0 -0
  352. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.js +0 -0
  353. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.module.scss.js +0 -0
  354. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.module.scss.js.map +0 -0
  355. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/useDocumentList.d.ts +0 -0
  356. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Actions.d.ts +0 -0
  357. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Actions.js +0 -0
  358. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Form.d.ts +0 -0
  359. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Form.js +0 -0
  360. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Head.d.ts +0 -0
  361. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Head.js +0 -0
  362. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Preview.d.ts +0 -0
  363. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Preview.js +0 -0
  364. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/useSignatureForm.d.ts +0 -0
  365. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/assignSignatoryState.d.ts +0 -0
  366. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/assignSignatoryState.js +0 -0
  367. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/documentSignerStateMachine.d.ts +0 -0
  368. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/documentSignerStateMachine.js +0 -0
  369. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/stateMachine.d.ts +0 -0
  370. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/stateMachine.js +0 -0
  371. /package/dist/components/Company/{DocumentSignerFlow/useDocumentSignerFlow.d.ts → DocumentSigner/useDocumentSigner.d.ts} +0 -0
  372. /package/dist/components/Company/StateTaxes/{StateTaxesFlowComponents.d.ts → StateTaxesComponents.d.ts} +0 -0
  373. /package/dist/components/{Flow/StateMachines/employeeOnboarding.d.ts → Employee/OnboardingFlow/onboardingStateMachine.d.ts} +0 -0
  374. /package/dist/components/{Flow/StateMachines/employeeSelfOnboarding.d.ts → Employee/SelfOnboardingFlow/selfOnboardingMachine.d.ts} +0 -0
@@ -1,49 +1,64 @@
1
- import { z as t } from "zod";
2
- import { createCompoundContext as n } from "../../Base/createCompoundContext.js";
3
- import { FlsaStatus as r, FLSA_OVERTIME_SALARY_LIMIT as o } from "../../../shared/constants.js";
4
- import { yearlyRate as i } from "../../../helpers/payRateCalculator.js";
5
- const l = t.object({
6
- jobTitle: t.string().min(1),
7
- // adjustForMinimumWage can be true or false
8
- adjustForMinimumWage: t.boolean(),
9
- // If adjustForMinimumWage is true, minimumWageId is required
10
- minimumWageId: t.string().optional(),
11
- // stateWcCovered can be true, false, or undefined
12
- stateWcCovered: t.boolean().optional(),
13
- // If stateWcCovered is true, stateWcClassCode is required
14
- stateWcClassCode: t.string().optional(),
15
- // twoPercentShareholder can be true, false, or undefined
16
- twoPercentShareholder: t.boolean().optional(),
17
- // FLSA status with different payment options
18
- flsaStatus: t.enum([
19
- r.EXEMPT,
20
- r.SALARIED_NONEXEMPT,
21
- r.NONEXEMPT,
22
- r.OWNER,
23
- r.COMMISSION_ONLY_EXEMPT,
24
- r.COMISSION_ONLY_NONEXEMPT
1
+ import { z as e } from "zod";
2
+ import { createCompoundContext as u } from "../../Base/createCompoundContext.js";
3
+ import { FlsaStatus as s, FLSA_OVERTIME_SALARY_LIMIT as d } from "../../../shared/constants.js";
4
+ import { yearlyRate as n } from "../../../helpers/payRateCalculator.js";
5
+ const C = e.object({
6
+ jobTitle: e.string().min(1),
7
+ adjustForMinimumWage: e.boolean(),
8
+ minimumWageId: e.string().optional(),
9
+ stateWcCovered: e.boolean().optional(),
10
+ stateWcClassCode: e.string().optional(),
11
+ twoPercentShareholder: e.boolean().optional(),
12
+ flsaStatus: e.enum([
13
+ s.EXEMPT,
14
+ s.SALARIED_NONEXEMPT,
15
+ s.NONEXEMPT,
16
+ s.OWNER,
17
+ s.COMMISSION_ONLY_EXEMPT,
18
+ s.COMMISSION_ONLY_NONEXEMPT
25
19
  ]),
26
- paymentUnit: t.enum(["Hour", "Week", "Month", "Year", "Paycheck"]),
27
- rate: t.number().min(1).transform(String)
28
- }).refine(
29
- (e) => !(e.flsaStatus === r.OWNER && e.paymentUnit !== "Paycheck" || (e.flsaStatus === r.COMMISSION_ONLY_EXEMPT || e.flsaStatus === r.COMISSION_ONLY_NONEXEMPT) && (e.paymentUnit !== "Year" || Number(e.rate) !== 0) || e.flsaStatus === r.EXEMPT && i(Number(e.rate), e.paymentUnit) < o),
30
- {
31
- path: ["flsaStatus"]
32
- }
33
- ).refine(
34
- (e) => e.adjustForMinimumWage ? e.minimumWageId !== void 0 && e.minimumWageId !== "" : !0,
35
- {
36
- path: ["minimumWageId"]
37
- }
38
- ).refine(
39
- (e) => e.stateWcCovered === !0 ? e.stateWcClassCode !== void 0 && e.stateWcClassCode !== "" : !0,
40
- {
41
- path: ["stateWcClassCode"]
42
- }
43
- ), [f, p] = n("CompensationContext");
20
+ paymentUnit: e.enum(["Hour", "Week", "Month", "Year", "Paycheck"]),
21
+ rate: e.number().optional()
22
+ }).superRefine((t, o) => {
23
+ t.adjustForMinimumWage && (!t.minimumWageId || t.minimumWageId.trim() === "") && o.addIssue({
24
+ code: e.ZodIssueCode.custom,
25
+ path: ["minimumWageId"],
26
+ message: "minimumWageId is required when adjustForMinimumWage is true"
27
+ }), t.stateWcCovered === !0 && (!t.stateWcClassCode || t.stateWcClassCode.trim() === "") && o.addIssue({
28
+ code: e.ZodIssueCode.custom,
29
+ path: ["stateWcClassCode"],
30
+ message: "stateWcClassCode is required when stateWcCovered is true"
31
+ });
32
+ const { flsaStatus: m, paymentUnit: i, rate: a } = t;
33
+ m === s.EXEMPT || m === s.SALARIED_NONEXEMPT || m === s.NONEXEMPT ? ((a === void 0 || a < 1) && o.addIssue({
34
+ code: e.ZodIssueCode.custom,
35
+ path: ["rate"],
36
+ message: "rate must be at least 1 for this FLSA status"
37
+ }), m === s.EXEMPT && a !== void 0 && n(Number(a), i) < d && o.addIssue({
38
+ code: e.ZodIssueCode.custom,
39
+ path: ["rate"],
40
+ message: "FLSA Exempt employees must meet salary threshold"
41
+ })) : m === s.OWNER ? (i !== "Paycheck" && o.addIssue({
42
+ code: e.ZodIssueCode.custom,
43
+ path: ["paymentUnit"],
44
+ message: "paymentUnit must be Paycheck for OWNER"
45
+ }), (a === void 0 || a < 1) && o.addIssue({
46
+ code: e.ZodIssueCode.custom,
47
+ path: ["rate"],
48
+ message: "rate must be at least 1 for OWNER"
49
+ })) : [s.COMMISSION_ONLY_EXEMPT, s.COMMISSION_ONLY_NONEXEMPT].includes(m) && (i !== "Year" && o.addIssue({
50
+ code: e.ZodIssueCode.custom,
51
+ path: ["paymentUnit"],
52
+ message: "paymentUnit must be Year for commission-only FLSA statuses"
53
+ }), a !== 0 && o.addIssue({
54
+ code: e.ZodIssueCode.custom,
55
+ path: ["rate"],
56
+ message: "rate must be exactly 0 for commission-only FLSA statuses"
57
+ }));
58
+ }), [E, l] = u("CompensationContext");
44
59
  export {
45
- p as CompensationProvider,
46
- l as CompensationSchema,
47
- f as useCompensation
60
+ l as CompensationProvider,
61
+ C as CompensationSchema,
62
+ E as useCompensation
48
63
  };
49
64
  //# sourceMappingURL=useCompensation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCompensation.js","sources":["../../../../src/components/Employee/Compensation/useCompensation.ts"],"sourcesContent":["import type { Job } from '@gusto/embedded-api/models/components/job'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base/createCompoundContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus } from '@/shared/constants'\nimport { yearlyRate } from '@/helpers/payRateCalculator'\n\nexport const CompensationSchema = z\n .object({\n jobTitle: z.string().min(1),\n // adjustForMinimumWage can be true or false\n adjustForMinimumWage: z.boolean(),\n // If adjustForMinimumWage is true, minimumWageId is required\n minimumWageId: z.string().optional(),\n // stateWcCovered can be true, false, or undefined\n stateWcCovered: z.boolean().optional(),\n // If stateWcCovered is true, stateWcClassCode is required\n stateWcClassCode: z.string().optional(),\n // twoPercentShareholder can be true, false, or undefined\n twoPercentShareholder: z.boolean().optional(),\n // FLSA status with different payment options\n flsaStatus: z.enum([\n FlsaStatus.EXEMPT,\n FlsaStatus.SALARIED_NONEXEMPT,\n FlsaStatus.NONEXEMPT,\n FlsaStatus.OWNER,\n FlsaStatus.COMMISSION_ONLY_EXEMPT,\n FlsaStatus.COMISSION_ONLY_NONEXEMPT,\n ]),\n paymentUnit: z.enum(['Hour', 'Week', 'Month', 'Year', 'Paycheck']),\n rate: z.number().min(1).transform(String),\n })\n .refine(\n data => {\n // For Owner, paymentUnit must be Paycheck\n if (data.flsaStatus === FlsaStatus.OWNER && data.paymentUnit !== 'Paycheck') {\n return false\n }\n // For Commission only, paymentUnit must be Year and rate must be 0\n if (\n (data.flsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT ||\n data.flsaStatus === FlsaStatus.COMISSION_ONLY_NONEXEMPT) &&\n (data.paymentUnit !== 'Year' || Number(data.rate) !== 0)\n ) {\n return false\n }\n // For Exempt status, validate salary threshold\n if (\n data.flsaStatus === FlsaStatus.EXEMPT &&\n yearlyRate(Number(data.rate), data.paymentUnit) < FLSA_OVERTIME_SALARY_LIMIT\n ) {\n return false\n }\n\n return true\n },\n {\n path: ['flsaStatus'],\n },\n )\n .refine(\n data => {\n if (data.adjustForMinimumWage) {\n return data.minimumWageId !== undefined && data.minimumWageId !== ''\n }\n return true\n },\n {\n path: ['minimumWageId'],\n },\n )\n .refine(\n data => {\n if (data.stateWcCovered === true) {\n return data.stateWcClassCode !== undefined && data.stateWcClassCode !== ''\n }\n return true\n },\n {\n path: ['stateWcClassCode'],\n },\n )\n\nexport type CompensationInputs = z.input<typeof CompensationSchema>\nexport type CompensationOutputs = z.output<typeof CompensationSchema>\n\nexport type MODE =\n | 'LIST'\n | 'ADD_ADDITIONAL_JOB'\n | 'ADD_INITIAL_JOB'\n | 'EDIT_ADDITIONAL_JOB'\n | 'EDIT_INITIAL_JOB'\n | 'PROCEED'\n\ntype CompensationContextType = {\n employeeJobs: Job[]\n currentJob?: Job | null\n primaryFlsaStatus?: string\n isPending: boolean\n mode: MODE\n showFlsaChangeWarning: boolean\n minimumWages: MinimumWage[]\n state?: string\n showTwoPercentStakeholder?: boolean\n submitWithEffect: (newMode: MODE) => void\n handleAdd: () => void\n handleEdit: (uuid: string) => void\n handleDelete: (uuid: string) => void\n handleFlsaChange: (status: string | number) => void\n handleCancelAddJob: () => void\n}\nconst [useCompensation, CompensationProvider] =\n createCompoundContext<CompensationContextType>('CompensationContext')\nexport { useCompensation, CompensationProvider }\n"],"names":["CompensationSchema","z","FlsaStatus","data","yearlyRate","FLSA_OVERTIME_SALARY_LIMIT","useCompensation","CompensationProvider","createCompoundContext"],"mappings":";;;;AAOa,MAAAA,IAAqBC,EAC/B,OAAO;AAAA,EACN,UAAUA,EAAE,SAAS,IAAI,CAAC;AAAA;AAAA,EAE1B,sBAAsBA,EAAE,QAAQ;AAAA;AAAA,EAEhC,eAAeA,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAEnC,gBAAgBA,EAAE,QAAQ,EAAE,SAAS;AAAA;AAAA,EAErC,kBAAkBA,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAEtC,uBAAuBA,EAAE,QAAQ,EAAE,SAAS;AAAA;AAAA,EAE5C,YAAYA,EAAE,KAAK;AAAA,IACjBC,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,EAAA,CACZ;AAAA,EACD,aAAaD,EAAE,KAAK,CAAC,QAAQ,QAAQ,SAAS,QAAQ,UAAU,CAAC;AAAA,EACjE,MAAMA,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,UAAU,MAAM;AAC1C,CAAC,EACA;AAAA,EACC,CAAQE,MAEF,EAAAA,EAAK,eAAeD,EAAW,SAASC,EAAK,gBAAgB,eAK9DA,EAAK,eAAeD,EAAW,0BAC9BC,EAAK,eAAeD,EAAW,8BAChCC,EAAK,gBAAgB,UAAU,OAAOA,EAAK,IAAI,MAAM,MAMtDA,EAAK,eAAeD,EAAW,UAC/BE,EAAW,OAAOD,EAAK,IAAI,GAAGA,EAAK,WAAW,IAAIE;AAAA,EAOtD;AAAA,IACE,MAAM,CAAC,YAAY;AAAA,EAAA;AAEvB,EACC;AAAA,EACC,CAAQF,MACFA,EAAK,uBACAA,EAAK,kBAAkB,UAAaA,EAAK,kBAAkB,KAE7D;AAAA,EAET;AAAA,IACE,MAAM,CAAC,eAAe;AAAA,EAAA;AAE1B,EACC;AAAA,EACC,CAAQA,MACFA,EAAK,mBAAmB,KACnBA,EAAK,qBAAqB,UAAaA,EAAK,qBAAqB,KAEnE;AAAA,EAET;AAAA,IACE,MAAM,CAAC,kBAAkB;AAAA,EAAA;AAE7B,GA8BI,CAACG,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
1
+ {"version":3,"file":"useCompensation.js","sources":["../../../../src/components/Employee/Compensation/useCompensation.ts"],"sourcesContent":["import type { Job } from '@gusto/embedded-api/models/components/job'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base/createCompoundContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus } from '@/shared/constants'\nimport { yearlyRate } from '@/helpers/payRateCalculator'\n\nexport const CompensationSchema = z\n .object({\n jobTitle: z.string().min(1),\n adjustForMinimumWage: z.boolean(),\n minimumWageId: z.string().optional(),\n stateWcCovered: z.boolean().optional(),\n stateWcClassCode: z.string().optional(),\n twoPercentShareholder: z.boolean().optional(),\n flsaStatus: z.enum([\n FlsaStatus.EXEMPT,\n FlsaStatus.SALARIED_NONEXEMPT,\n FlsaStatus.NONEXEMPT,\n FlsaStatus.OWNER,\n FlsaStatus.COMMISSION_ONLY_EXEMPT,\n FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n ]),\n paymentUnit: z.enum(['Hour', 'Week', 'Month', 'Year', 'Paycheck']),\n rate: z.number().optional(),\n })\n .superRefine((data, ctx) => {\n // adjustForMinimumWage\n if (data.adjustForMinimumWage && (!data.minimumWageId || data.minimumWageId.trim() === '')) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['minimumWageId'],\n message: 'minimumWageId is required when adjustForMinimumWage is true',\n })\n }\n\n // stateWcCovered\n if (\n data.stateWcCovered === true &&\n (!data.stateWcClassCode || data.stateWcClassCode.trim() === '')\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['stateWcClassCode'],\n message: 'stateWcClassCode is required when stateWcCovered is true',\n })\n }\n\n // FLSA logic\n const { flsaStatus, paymentUnit, rate } = data\n if (\n flsaStatus === FlsaStatus.EXEMPT ||\n flsaStatus === FlsaStatus.SALARIED_NONEXEMPT ||\n flsaStatus === FlsaStatus.NONEXEMPT\n ) {\n if (rate === undefined || rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: 'rate must be at least 1 for this FLSA status',\n })\n }\n // For EXEMPT, check salary threshold\n if (\n flsaStatus === FlsaStatus.EXEMPT &&\n rate !== undefined &&\n yearlyRate(Number(rate), paymentUnit) < FLSA_OVERTIME_SALARY_LIMIT\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: 'FLSA Exempt employees must meet salary threshold',\n })\n }\n } else if (flsaStatus === FlsaStatus.OWNER) {\n if (paymentUnit !== 'Paycheck') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: 'paymentUnit must be Paycheck for OWNER',\n })\n }\n if (rate === undefined || rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: 'rate must be at least 1 for OWNER',\n })\n }\n } else if (\n [FlsaStatus.COMMISSION_ONLY_EXEMPT, FlsaStatus.COMMISSION_ONLY_NONEXEMPT].includes(flsaStatus)\n ) {\n if (paymentUnit !== 'Year') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: 'paymentUnit must be Year for commission-only FLSA statuses',\n })\n }\n if (rate !== 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: 'rate must be exactly 0 for commission-only FLSA statuses',\n })\n }\n }\n })\n\nexport type CompensationInputs = z.input<typeof CompensationSchema>\nexport type CompensationOutputs = z.output<typeof CompensationSchema>\n\nexport type MODE =\n | 'LIST'\n | 'ADD_ADDITIONAL_JOB'\n | 'ADD_INITIAL_JOB'\n | 'EDIT_ADDITIONAL_JOB'\n | 'EDIT_INITIAL_JOB'\n | 'PROCEED'\n\ntype CompensationContextType = {\n employeeJobs: Job[]\n currentJob?: Job | null\n primaryFlsaStatus?: string\n isPending: boolean\n mode: MODE\n showFlsaChangeWarning: boolean\n minimumWages: MinimumWage[]\n state?: string\n showTwoPercentStakeholder?: boolean\n submitWithEffect: (newMode: MODE) => void\n handleAdd: () => void\n handleEdit: (uuid: string) => void\n handleDelete: (uuid: string) => void\n handleFlsaChange: (status: string | number) => void\n handleCancelAddJob: () => void\n}\nconst [useCompensation, CompensationProvider] =\n createCompoundContext<CompensationContextType>('CompensationContext')\nexport { useCompensation, CompensationProvider }\n"],"names":["CompensationSchema","z","FlsaStatus","data","ctx","flsaStatus","paymentUnit","rate","yearlyRate","FLSA_OVERTIME_SALARY_LIMIT","useCompensation","CompensationProvider","createCompoundContext"],"mappings":";;;;AAOa,MAAAA,IAAqBC,EAC/B,OAAO;AAAA,EACN,UAAUA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC1B,sBAAsBA,EAAE,QAAQ;AAAA,EAChC,eAAeA,EAAE,OAAO,EAAE,SAAS;AAAA,EACnC,gBAAgBA,EAAE,QAAQ,EAAE,SAAS;AAAA,EACrC,kBAAkBA,EAAE,OAAO,EAAE,SAAS;AAAA,EACtC,uBAAuBA,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC5C,YAAYA,EAAE,KAAK;AAAA,IACjBC,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AA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AAI,SAAS;AAAA,IACX,MAAMH,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,MAAM;AAAA,IACb,SAAS;AAAA,EAAA,CACV,KAGH,CAACC,EAAW,wBAAwBA,EAAW,yBAAyB,EAAE,SAASG,CAAU,MAEzFC,MAAgB,UAClBF,EAAI,SAAS;AAAA,IACX,MAAMH,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,aAAa;AAAA,IACpB,SAAS;AAAA,EAAA,CACV,GAECM,MAAS,KACXH,EAAI,SAAS;AAAA,IACX,MAAMH,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,MAAM;AAAA,IACb,SAAS;AAAA,EAAA,CACV;AAGP,CAAC,GA8BG,CAACS,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { BaseComponentInterface, CommonComponentInterface } from '../../Base';
3
- interface DeductionsProps extends CommonComponentInterface {
3
+ interface DeductionsProps extends CommonComponentInterface<'Employee.Deductions'> {
4
4
  employeeId: string;
5
5
  }
6
6
  declare const IncludeDeductionsSchema: z.ZodObject<{
@@ -12,6 +12,6 @@ declare const IncludeDeductionsSchema: z.ZodObject<{
12
12
  }>;
13
13
  export type IncludeDeductionsPayload = z.output<typeof IncludeDeductionsSchema>;
14
14
  export declare function Deductions(props: DeductionsProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
15
- export declare const Root: ({ employeeId, className }: DeductionsProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const Root: ({ employeeId, className, dictionary }: DeductionsProps) => import("react/jsx-runtime").JSX.Element;
16
16
  export declare const DeductionsContextual: () => import("react/jsx-runtime").JSX.Element;
17
17
  export {};
@@ -1,37 +1,39 @@
1
- import { jsx as t, jsxs as I } from "react/jsx-runtime";
2
- import { useTranslation as Y } from "react-i18next";
3
- import { useState as M, useMemo as q, useEffect as B } from "react";
1
+ import { jsx as t, jsxs as C } from "react/jsx-runtime";
2
+ import { useTranslation as q } from "react-i18next";
3
+ import { useState as M, useMemo as y, useEffect as B } from "react";
4
4
  import { z as A } from "zod";
5
- import { useForm as C, FormProvider as O } from "react-hook-form";
5
+ import { useForm as O, FormProvider as T } from "react-hook-form";
6
6
  import { zodResolver as R } from "@hookform/resolvers/zod";
7
- import { useGarnishmentsListSuspense as y, invalidateGarnishmentsList as T } from "@gusto/embedded-api/react-query/garnishmentsList";
8
- import { useGarnishmentsCreateMutation as G } from "@gusto/embedded-api/react-query/garnishmentsCreate";
9
- import { useGarnishmentsUpdateMutation as j } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
10
- import { useQueryClient as z } from "@tanstack/react-query";
11
- import { DeductionSchema as H, DeductionsProvider as V } from "./useDeductions.js";
12
- import { BaseComponent as Q } from "../../Base/Base.js";
13
- import { useBase as k } from "../../Base/useBase.js";
14
- import { Form as L } from "../../Common/Form/Form.js";
15
- import { useI18n as J } from "../../../i18n/I18n.js";
7
+ import { useGarnishmentsListSuspense as G, invalidateGarnishmentsList as L } from "@gusto/embedded-api/react-query/garnishmentsList";
8
+ import { useGarnishmentsCreateMutation as j } from "@gusto/embedded-api/react-query/garnishmentsCreate";
9
+ import { useGarnishmentsUpdateMutation as z } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
10
+ import { useQueryClient as H } from "@tanstack/react-query";
11
+ import { DeductionSchema as V, DeductionsProvider as Q } from "./useDeductions.js";
12
+ import { BaseComponent as k } from "../../Base/Base.js";
13
+ import { useBase as J } from "../../Base/useBase.js";
14
+ import { Form as S } from "../../Common/Form/Form.js";
15
+ import { useComponentDictionary as K, useI18n as W } from "../../../i18n/I18n.js";
16
16
  import { componentEvents as s } from "../../../shared/constants.js";
17
- import { Actions as S } from "./Actions.js";
18
- import { IncludeDeductionsForm as K } from "./IncludeDeductionsForm.js";
19
- import { Head as N } from "./Head.js";
20
- import { DeductionForm as W } from "./DeductionForm.js";
21
- import { DeductionsList as X } from "./DeductionsList.js";
22
- import { useFlow as Z } from "../../Flow/useFlow.js";
17
+ import { Actions as N } from "./Actions.js";
18
+ import { IncludeDeductionsForm as X } from "./IncludeDeductionsForm.js";
19
+ import { Head as _ } from "./Head.js";
20
+ import { DeductionForm as Z } from "./DeductionForm.js";
21
+ import { DeductionsList as $ } from "./DeductionsList.js";
22
+ import { useFlow as ee } from "../../Flow/useFlow.js";
23
23
  A.object({ includeDeductions: A.enum(["Yes", "No"]) });
24
- function $(n) {
25
- return /* @__PURE__ */ t(Q, { ...n, children: /* @__PURE__ */ t(ee, { ...n, children: n.children }) });
24
+ function te(n) {
25
+ return /* @__PURE__ */ t(k, { ...n, children: /* @__PURE__ */ t(ne, { ...n, children: n.children }) });
26
26
  }
27
- const ee = ({ employeeId: n, className: d }) => {
28
- const { onEvent: r, baseSubmitHandler: E } = k(), h = z(), { data: _ } = y({ employeeId: n }), f = _.garnishmentList, { mutateAsync: p, isPending: b } = j({
29
- onSettled: () => T(h, [n])
30
- }), { mutateAsync: x, isPending: w } = G({
31
- onSettled: () => T(h, [n])
32
- }), F = f.filter((i) => i.active), [u, m] = M(F.length < 1 ? "INITIAL" : "LIST"), [e, a] = M(null);
33
- J("Employee.Deductions");
34
- const l = q(() => ({
27
+ const ne = ({ employeeId: n, className: d, dictionary: a }) => {
28
+ const { onEvent: i, baseSubmitHandler: h } = J(), f = H();
29
+ K("Employee.Deductions", a);
30
+ const { data: b } = G({ employeeId: n }), p = b.garnishmentList, { mutateAsync: g, isPending: x } = z({
31
+ onSettled: () => L(f, [n])
32
+ }), { mutateAsync: w, isPending: F } = j({
33
+ onSettled: () => L(f, [n])
34
+ }), U = p.filter((r) => r.active), [u, m] = M(U.length < 1 ? "INITIAL" : "LIST"), [e, l] = M(null);
35
+ W("Employee.Deductions");
36
+ const D = y(() => ({
35
37
  amount: e?.amount ? Number(e.amount) : 0,
36
38
  description: e?.description ?? "",
37
39
  times: e?.times ?? null,
@@ -41,19 +43,19 @@ const ee = ({ employeeId: n, className: d }) => {
41
43
  deductAsPercentage: e?.deductAsPercentage?.toString() ?? "true",
42
44
  active: !0,
43
45
  courtOrdered: e?.courtOrdered ?? !1
44
- }), [e]), g = C({
46
+ }), [e]), P = O({
45
47
  // resolver: zodResolver(IncludeDeductionsSchema),
46
48
  defaultValues: { includeDeductions: "No" }
47
- }), D = C({
48
- resolver: R(H),
49
- defaultValues: l
50
- }), { reset: P } = D;
49
+ }), E = O({
50
+ resolver: R(V),
51
+ defaultValues: D
52
+ }), { reset: v } = E;
51
53
  B(() => {
52
- P(l);
53
- }, [e, l, P, u]);
54
- const U = async (i) => {
55
- await E(i, async (o) => {
56
- const { garnishment: c } = await p({
54
+ v(D);
55
+ }, [e, D, v, u]);
56
+ const Y = async (r) => {
57
+ await h(r, async (o) => {
58
+ const { garnishment: c } = await g({
57
59
  request: {
58
60
  garnishmentId: o.uuid,
59
61
  requestBody: {
@@ -64,28 +66,28 @@ const ee = ({ employeeId: n, className: d }) => {
64
66
  }
65
67
  }
66
68
  });
67
- r(s.EMPLOYEE_DEDUCTION_DELETED, c);
69
+ i(s.EMPLOYEE_DEDUCTION_DELETED, c);
68
70
  });
69
- }, v = async (i) => {
70
- await E(i, async (o) => {
71
+ }, I = async (r) => {
72
+ await h(r, async (o) => {
71
73
  if ("includeDeductions" in o)
72
74
  if (o.includeDeductions === "Yes")
73
- m("ADD"), r(s.EMPLOYEE_DEDUCTION_ADD);
75
+ m("ADD"), i(s.EMPLOYEE_DEDUCTION_ADD);
74
76
  else {
75
- r(s.EMPLOYEE_DEDUCTION_DONE);
77
+ i(s.EMPLOYEE_DEDUCTION_DONE);
76
78
  return;
77
79
  }
78
80
  if (!("includeDeductions" in o)) {
79
81
  if (u === "ADD") {
80
- const { garnishment: c } = await x({
82
+ const { garnishment: c } = await w({
81
83
  request: {
82
84
  employeeId: n,
83
85
  requestBody: { ...o, times: o.recurring ? null : 1 }
84
86
  }
85
87
  });
86
- r(s.EMPLOYEE_DEDUCTION_CREATED, c);
88
+ i(s.EMPLOYEE_DEDUCTION_CREATED, c);
87
89
  } else if (u === "EDIT") {
88
- const { garnishment: c } = await p({
90
+ const { garnishment: c } = await g({
89
91
  request: {
90
92
  garnishmentId: e?.uuid ?? "",
91
93
  requestBody: {
@@ -95,61 +97,61 @@ const ee = ({ employeeId: n, className: d }) => {
95
97
  }
96
98
  }
97
99
  });
98
- r(s.EMPLOYEE_DEDUCTION_UPDATED, c), a(null);
100
+ i(s.EMPLOYEE_DEDUCTION_UPDATED, c), l(null);
99
101
  }
100
102
  m("LIST");
101
103
  }
102
104
  });
103
105
  };
104
106
  return /* @__PURE__ */ t("section", { className: d, children: /* @__PURE__ */ t(
105
- V,
107
+ Q,
106
108
  {
107
109
  value: {
108
- isPending: w || b,
110
+ isPending: F || x,
109
111
  employeeId: n,
110
112
  mode: u,
111
- deductions: f,
113
+ deductions: p,
112
114
  handleAdd: () => {
113
115
  m("ADD");
114
116
  },
115
117
  handleCancel: () => {
116
- m("LIST"), a(null);
118
+ m("LIST"), l(null);
117
119
  },
118
- handleDelete: U,
119
- handleEdit: (i) => {
120
- m("EDIT"), a(i);
120
+ handleDelete: Y,
121
+ handleEdit: (r) => {
122
+ m("EDIT"), l(r);
121
123
  },
122
124
  handlePassthrough: () => {
123
- r(s.EMPLOYEE_DEDUCTION_DONE);
125
+ i(s.EMPLOYEE_DEDUCTION_DONE);
124
126
  }
125
127
  },
126
- children: u === "INITIAL" ? /* @__PURE__ */ t(O, { ...g, children: /* @__PURE__ */ I(L, { onSubmit: g.handleSubmit(v), children: [
127
- /* @__PURE__ */ t(N, {}),
128
- /* @__PURE__ */ t(K, {}),
129
- /* @__PURE__ */ t(S, {})
130
- ] }) }) : /* @__PURE__ */ t(O, { ...D, children: /* @__PURE__ */ I(L, { onSubmit: D.handleSubmit(v), children: [
131
- /* @__PURE__ */ t(N, {}),
128
+ children: u === "INITIAL" ? /* @__PURE__ */ t(T, { ...P, children: /* @__PURE__ */ C(S, { onSubmit: P.handleSubmit(I), children: [
129
+ /* @__PURE__ */ t(_, {}),
132
130
  /* @__PURE__ */ t(X, {}),
133
- /* @__PURE__ */ t(W, {}),
134
- /* @__PURE__ */ t(S, {})
131
+ /* @__PURE__ */ t(N, {})
132
+ ] }) }) : /* @__PURE__ */ t(T, { ...E, children: /* @__PURE__ */ C(S, { onSubmit: E.handleSubmit(I), children: [
133
+ /* @__PURE__ */ t(_, {}),
134
+ /* @__PURE__ */ t($, {}),
135
+ /* @__PURE__ */ t(Z, {}),
136
+ /* @__PURE__ */ t(N, {})
135
137
  ] }) })
136
138
  }
137
139
  ) });
138
- }, Le = () => {
139
- const { employeeId: n, onEvent: d } = Z(), { t: r } = Y("common");
140
+ }, Ne = () => {
141
+ const { employeeId: n, onEvent: d } = ee(), { t: a } = q("common");
140
142
  if (!n)
141
143
  throw new Error(
142
- r("errors.missingParamsOrContext", {
144
+ a("errors.missingParamsOrContext", {
143
145
  component: "Deductions",
144
146
  param: "employeeId",
145
147
  provider: "FlowProvider"
146
148
  })
147
149
  );
148
- return /* @__PURE__ */ t($, { employeeId: n, onEvent: d });
150
+ return /* @__PURE__ */ t(te, { employeeId: n, onEvent: d });
149
151
  };
150
152
  export {
151
- $ as Deductions,
152
- Le as DeductionsContextual,
153
- ee as Root
153
+ te as Deductions,
154
+ Ne as DeductionsContextual,
155
+ ne as Root
154
156
  };
155
157
  //# sourceMappingURL=Deductions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Deductions.js","sources":["../../../../src/components/Employee/Deductions/Deductions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEffect, useMemo, useState } from 'react'\nimport { z } from 'zod'\nimport { FormProvider, useForm, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n useGarnishmentsListSuspense,\n invalidateGarnishmentsList,\n} from '@gusto/embedded-api/react-query/garnishmentsList'\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 { useQueryClient } from '@tanstack/react-query'\nimport {\n type DeductionInputs,\n type DeductionPayload,\n DeductionSchema,\n DeductionsProvider,\n type MODE,\n} from './useDeductions'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Actions } from '@/components/Employee/Deductions/Actions'\nimport { IncludeDeductionsForm } from '@/components/Employee/Deductions/IncludeDeductionsForm'\nimport { Head } from '@/components/Employee/Deductions/Head'\nimport { DeductionForm } from '@/components/Employee/Deductions/DeductionForm'\nimport { DeductionsList } from '@/components/Employee/Deductions/DeductionsList'\nimport type { EmployeeOnboardingContextInterface } from '@/components/Flow/EmployeeOnboardingFlow'\nimport { useFlow } from '@/components/Flow/useFlow'\n\ninterface DeductionsProps extends CommonComponentInterface {\n employeeId: string\n}\n\nconst IncludeDeductionsSchema = z.object({ includeDeductions: z.enum(['Yes', 'No']) })\nexport type IncludeDeductionsPayload = z.output<typeof IncludeDeductionsSchema>\n\nexport function Deductions(props: DeductionsProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nexport const Root = ({ employeeId, className }: DeductionsProps) => {\n const { onEvent, baseSubmitHandler } = useBase()\n const queryClient = useQueryClient()\n\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n\n // Used for deletion or edit of deduction\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation({\n onSettled: () => invalidateGarnishmentsList(queryClient, [employeeId]),\n })\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation({\n onSettled: () => invalidateGarnishmentsList(queryClient, [employeeId]),\n })\n\n const activeDeductions = deductions.filter(deduction => deduction.active)\n const [mode, setMode] = useState<MODE>(activeDeductions.length < 1 ? 'INITIAL' : 'LIST')\n const [currentDeduction, setCurrentDeduction] = useState<Garnishment | null>(null)\n useI18n('Employee.Deductions')\n\n const defaultValues: DeductionInputs = useMemo(() => {\n return {\n amount: currentDeduction?.amount ? Number(currentDeduction.amount) : 0,\n description: currentDeduction?.description ?? '',\n times: currentDeduction?.times ?? null,\n recurring: currentDeduction?.recurring?.toString() ?? 'true',\n annualMaximum: currentDeduction?.annualMaximum\n ? Number(currentDeduction.annualMaximum)\n : null,\n payPeriodMaximum: currentDeduction?.payPeriodMaximum\n ? Number(currentDeduction.payPeriodMaximum)\n : null,\n deductAsPercentage: currentDeduction?.deductAsPercentage?.toString() ?? 'true',\n active: true,\n courtOrdered: currentDeduction?.courtOrdered ?? false,\n } as DeductionInputs\n }, [currentDeduction])\n\n const includeDeductionsFormMethods = useForm<IncludeDeductionsPayload>({\n // resolver: zodResolver(IncludeDeductionsSchema),\n defaultValues: { includeDeductions: 'No' },\n })\n\n const formMethods = useForm<DeductionInputs, unknown, DeductionPayload>({\n resolver: zodResolver(DeductionSchema),\n defaultValues,\n })\n\n const { reset: resetForm } = formMethods\n\n useEffect(() => {\n resetForm(defaultValues)\n }, [currentDeduction, defaultValues, resetForm, mode])\n\n const handleDelete = async (deduction: Garnishment) => {\n await baseSubmitHandler(deduction, async payload => {\n //Deletion of deduction is simply updating it with active: false\n const { garnishment } = await updateDeduction({\n request: {\n garnishmentId: payload.uuid,\n requestBody: {\n ...payload,\n totalAmount: payload.totalAmount ?? undefined,\n active: false,\n version: payload.version as string,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DELETED, garnishment)\n })\n }\n const onSubmit: SubmitHandler<DeductionPayload | IncludeDeductionsPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n if ('includeDeductions' in payload) {\n if (payload.includeDeductions === 'Yes') {\n setMode('ADD')\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_ADD)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n return\n }\n }\n if (!('includeDeductions' in payload)) {\n if (mode === 'ADD') {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId: employeeId,\n requestBody: { ...payload, times: payload.recurring ? null : 1 },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else if (mode === 'EDIT') {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: currentDeduction?.uuid ?? '',\n requestBody: {\n ...payload,\n version: currentDeduction?.version as string,\n times: payload.recurring ? null : 1,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n setCurrentDeduction(null)\n }\n setMode('LIST')\n }\n })\n }\n const handleAdd = () => {\n setMode('ADD')\n }\n const handleCancel = () => {\n setMode('LIST')\n setCurrentDeduction(null)\n }\n const handleEdit = (deduction: Garnishment) => {\n setMode('EDIT')\n setCurrentDeduction(deduction)\n }\n const handlePassthrough = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n }\n return (\n <section className={className}>\n <DeductionsProvider\n value={{\n isPending: isPendingCreate || isPendingUpdate,\n employeeId,\n mode,\n deductions,\n handleAdd,\n handleCancel,\n handleDelete,\n handleEdit,\n handlePassthrough,\n }}\n >\n {mode === 'INITIAL' ? (\n <FormProvider {...includeDeductionsFormMethods}>\n <Form onSubmit={includeDeductionsFormMethods.handleSubmit(onSubmit)}>\n <Head />\n <IncludeDeductionsForm />\n <Actions />\n </Form>\n </FormProvider>\n ) : (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Head />\n <DeductionsList />\n <DeductionForm />\n <Actions />\n </Form>\n </FormProvider>\n )}\n </DeductionsProvider>\n </section>\n )\n}\n\nexport const DeductionsContextual = () => {\n const { employeeId, onEvent } = useFlow<EmployeeOnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Deductions',\n param: 'employeeId',\n provider: 'FlowProvider',\n }),\n )\n }\n return <Deductions employeeId={employeeId} onEvent={onEvent} />\n}\n"],"names":["z","Deductions","props","jsx","BaseComponent","Root","employeeId","className","onEvent","baseSubmitHandler","useBase","queryClient","useQueryClient","data","useGarnishmentsListSuspense","deductions","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","invalidateGarnishmentsList","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","activeDeductions","deduction","mode","setMode","useState","currentDeduction","setCurrentDeduction","useI18n","defaultValues","useMemo","includeDeductionsFormMethods","useForm","formMethods","zodResolver","DeductionSchema","resetForm","useEffect","handleDelete","payload","garnishment","componentEvents","onSubmit","createDeductionResponse","updateDeductionResponse","DeductionsProvider","FormProvider","jsxs","Form","Head","IncludeDeductionsForm","Actions","DeductionsList","DeductionForm","DeductionsContextual","useFlow","t","useTranslation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyCgCA,EAAE,OAAO,EAAE,mBAAmBA,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC,EAAG,CAAA;AAG9E,SAASC,EAAWC,GAAiD;AAExE,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AACO,MAAMG,KAAO,CAAC,EAAE,YAAAC,GAAY,WAAAC,QAAiC;AAClE,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GACzCC,IAAcC,EAAe,GAE7B,EAAE,MAAAC,EAAK,IAAIC,EAA4B,EAAE,YAAAR,GAAY,GACrDS,IAAaF,EAAK,iBAGlB,EAAE,aAAaG,GAAiB,WAAWC,EAAA,IAC/CC,EAA8B;AAAA,IAC5B,WAAW,MAAMC,EAA2BR,GAAa,CAACL,CAAU,CAAC;AAAA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E,YAAAlD,GAAY,SAAAE,EAAQ,IAAIiD,EAA4C,GACtE,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ;AAErC,MAAI,CAACrD;AACH,UAAM,IAAI;AAAA,MACRoD,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAO;AAAA,QACP,UAAU;AAAA,MACX,CAAA;AAAA,IACH;AAEK,SAAA,gBAAAvD,EAACF,GAAW,EAAA,YAAAK,GAAwB,SAAAE,EAAkB,CAAA;AAC/D;"}
1
+ {"version":3,"file":"Deductions.js","sources":["../../../../src/components/Employee/Deductions/Deductions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEffect, useMemo, useState } from 'react'\nimport { z } from 'zod'\nimport { FormProvider, useForm, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n useGarnishmentsListSuspense,\n invalidateGarnishmentsList,\n} from '@gusto/embedded-api/react-query/garnishmentsList'\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 { useQueryClient } from '@tanstack/react-query'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport {\n type DeductionInputs,\n type DeductionPayload,\n DeductionSchema,\n DeductionsProvider,\n type MODE,\n} from './useDeductions'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Actions } from '@/components/Employee/Deductions/Actions'\nimport { IncludeDeductionsForm } from '@/components/Employee/Deductions/IncludeDeductionsForm'\nimport { Head } from '@/components/Employee/Deductions/Head'\nimport { DeductionForm } from '@/components/Employee/Deductions/DeductionForm'\nimport { DeductionsList } from '@/components/Employee/Deductions/DeductionsList'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface DeductionsProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nconst IncludeDeductionsSchema = z.object({ includeDeductions: z.enum(['Yes', 'No']) })\nexport type IncludeDeductionsPayload = z.output<typeof IncludeDeductionsSchema>\n\nexport function Deductions(props: DeductionsProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nexport const Root = ({ employeeId, className, dictionary }: DeductionsProps) => {\n const { onEvent, baseSubmitHandler } = useBase()\n const queryClient = useQueryClient()\n useComponentDictionary('Employee.Deductions', dictionary)\n\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n\n // Used for deletion or edit of deduction\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation({\n onSettled: () => invalidateGarnishmentsList(queryClient, [employeeId]),\n })\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation({\n onSettled: () => invalidateGarnishmentsList(queryClient, [employeeId]),\n })\n\n const activeDeductions = deductions.filter(deduction => deduction.active)\n const [mode, setMode] = useState<MODE>(activeDeductions.length < 1 ? 'INITIAL' : 'LIST')\n const [currentDeduction, setCurrentDeduction] = useState<Garnishment | null>(null)\n useI18n('Employee.Deductions')\n\n const defaultValues: DeductionInputs = useMemo(() => {\n return {\n amount: currentDeduction?.amount ? Number(currentDeduction.amount) : 0,\n description: currentDeduction?.description ?? '',\n times: currentDeduction?.times ?? null,\n recurring: currentDeduction?.recurring?.toString() ?? 'true',\n annualMaximum: currentDeduction?.annualMaximum\n ? Number(currentDeduction.annualMaximum)\n : null,\n payPeriodMaximum: currentDeduction?.payPeriodMaximum\n ? Number(currentDeduction.payPeriodMaximum)\n : null,\n deductAsPercentage: currentDeduction?.deductAsPercentage?.toString() ?? 'true',\n active: true,\n courtOrdered: currentDeduction?.courtOrdered ?? false,\n } as DeductionInputs\n }, [currentDeduction])\n\n const includeDeductionsFormMethods = useForm<IncludeDeductionsPayload>({\n // resolver: zodResolver(IncludeDeductionsSchema),\n defaultValues: { includeDeductions: 'No' },\n })\n\n const formMethods = useForm<DeductionInputs, unknown, DeductionPayload>({\n resolver: zodResolver(DeductionSchema),\n defaultValues,\n })\n\n const { reset: resetForm } = formMethods\n\n useEffect(() => {\n resetForm(defaultValues)\n }, [currentDeduction, defaultValues, resetForm, mode])\n\n const handleDelete = async (deduction: Garnishment) => {\n await baseSubmitHandler(deduction, async payload => {\n //Deletion of deduction is simply updating it with active: false\n const { garnishment } = await updateDeduction({\n request: {\n garnishmentId: payload.uuid,\n requestBody: {\n ...payload,\n totalAmount: payload.totalAmount ?? undefined,\n active: false,\n version: payload.version as string,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DELETED, garnishment)\n })\n }\n const onSubmit: SubmitHandler<DeductionPayload | IncludeDeductionsPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n if ('includeDeductions' in payload) {\n if (payload.includeDeductions === 'Yes') {\n setMode('ADD')\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_ADD)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n return\n }\n }\n if (!('includeDeductions' in payload)) {\n if (mode === 'ADD') {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId: employeeId,\n requestBody: { ...payload, times: payload.recurring ? null : 1 },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else if (mode === 'EDIT') {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: currentDeduction?.uuid ?? '',\n requestBody: {\n ...payload,\n version: currentDeduction?.version as string,\n times: payload.recurring ? null : 1,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n setCurrentDeduction(null)\n }\n setMode('LIST')\n }\n })\n }\n const handleAdd = () => {\n setMode('ADD')\n }\n const handleCancel = () => {\n setMode('LIST')\n setCurrentDeduction(null)\n }\n const handleEdit = (deduction: Garnishment) => {\n setMode('EDIT')\n setCurrentDeduction(deduction)\n }\n const handlePassthrough = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n }\n return (\n <section className={className}>\n <DeductionsProvider\n value={{\n isPending: isPendingCreate || isPendingUpdate,\n employeeId,\n mode,\n deductions,\n handleAdd,\n handleCancel,\n handleDelete,\n handleEdit,\n handlePassthrough,\n }}\n >\n {mode === 'INITIAL' ? (\n <FormProvider {...includeDeductionsFormMethods}>\n <Form onSubmit={includeDeductionsFormMethods.handleSubmit(onSubmit)}>\n <Head />\n <IncludeDeductionsForm />\n <Actions />\n </Form>\n </FormProvider>\n ) : (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Head />\n <DeductionsList />\n <DeductionForm />\n <Actions />\n </Form>\n </FormProvider>\n )}\n </DeductionsProvider>\n </section>\n )\n}\n\nexport const DeductionsContextual = () => {\n const { employeeId, onEvent } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Deductions',\n param: 'employeeId',\n provider: 'FlowProvider',\n }),\n )\n }\n return <Deductions employeeId={employeeId} onEvent={onEvent} />\n}\n"],"names":["z","Deductions","props","jsx","BaseComponent","Root","employeeId","className","dictionary","onEvent","baseSubmitHandler","useBase","queryClient","useQueryClient","useComponentDictionary","data","useGarnishmentsListSuspense","deductions","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","invalidateGarnishmentsList","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","activeDeductions","deduction","mode","setMode","useState","currentDeduction","setCurrentDeduction","useI18n","defaultValues","useMemo","includeDeductionsFormMethods","useForm","formMethods","zodResolver","DeductionSchema","resetForm","useEffect","handleDelete","payload","garnishment","componentEvents","onSubmit","createDeductionResponse","updateDeductionResponse","DeductionsProvider","FormProvider","jsxs","Form","Head","IncludeDeductionsForm","Actions","DeductionsList","DeductionForm","DeductionsContextual","useFlow","t","useTranslation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0CgCA,EAAE,OAAO,EAAE,mBAAmBA,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC,EAAG,CAAA;AAG9E,SAASC,GAAWC,GAAiD;AAExE,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AACO,MAAMG,KAAO,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,YAAAC,QAAkC;AAC9E,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GACzCC,IAAcC,EAAe;AACnC,EAAAC,EAAuB,uBAAuBN,CAAU;AAExD,QAAM,EAAE,MAAAO,EAAK,IAAIC,EAA4B,EAAE,YAAAV,GAAY,GACrDW,IAAaF,EAAK,iBAGlB,EAAE,aAAaG,GAAiB,WAAWC,EAAA,IAC/CC,EAA8B;AAAA,IAC5B,WAAW,MAAMC,EAA2BT,GAAa,CAACN,CAAU,CAAC;AAAA,EAAA,CACtE,GACG,EAAE,aAAagB,GAAiB,WAAWC,EAAA,IAC/CC,EAA8B;AAAA,IAC5B,WAAW,MAAMH,EAA2BT,GAAa,CAACN,CAAU,CAAC;AAAA,EAAA,CACtE,GAEGmB,IAAmBR,EAAW,OAAO,CAAAS,MAAaA,EAAU,MAAM,GAClE,CAACC,GAAMC,CAAO,IAAIC,EAAeJ,EAAiB,SAAS,IAAI,YAAY,MAAM,GACjF,CAACK,GAAkBC,CAAmB,IAAIF,EAA6B,IAAI;AACjF,EAAAG,EAAQ,qBAAqB;AAEvB,QAAAC,IAAiCC,EAAQ,OACtC;A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7,10 +7,11 @@ import "@gusto/embedded-api/models/errors/apierror";
7
7
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
8
8
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
9
9
  import "../../Base/useBase.js";
10
+ import "../../../shared/constants.js";
10
11
  import "dompurify";
11
12
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
12
13
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
13
- const g = r.object({
14
+ const f = r.object({
14
15
  active: r.boolean(),
15
16
  amount: r.number().min(0).transform(String),
16
17
  description: r.string().min(1),
@@ -21,10 +22,10 @@ const g = r.object({
21
22
  annualMaximum: r.number().min(0).transform((t) => t > 0 ? t.toString() : null).nullable(),
22
23
  payPeriodMaximum: r.number().min(0).transform((t) => t > 0 ? t.toString() : null).nullable(),
23
24
  deductAsPercentage: r.string().transform((t) => t === "true")
24
- }), [f, x] = o("DeductionsContext");
25
+ }), [x, D] = o("DeductionsContext");
25
26
  export {
26
- g as DeductionSchema,
27
- x as DeductionsProvider,
28
- f as useDeductions
27
+ f as DeductionSchema,
28
+ D as DeductionsProvider,
29
+ x as useDeductions
29
30
  };
30
31
  //# sourceMappingURL=useDeductions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDeductions.js","sources":["../../../../src/components/Employee/Deductions/useDeductions.ts"],"sourcesContent":["import type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE = 'ADD' | 'LIST' | 'INITIAL' | 'EDIT'\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(), //The number of times to apply the garnishment. Ignored if recurring is true.\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\ntype DeductionsContextType = {\n isPending: boolean\n deductions: Garnishment[]\n employeeId: string\n mode: MODE\n handleAdd: () => void\n handleCancel: () => void\n handleEdit: (deduction: Garnishment) => void\n handleDelete: (deduction: Garnishment) => void\n handlePassthrough: () => void\n}\nconst [useDeductions, DeductionsProvider] =\n createCompoundContext<DeductionsContextType>('DeductionsContext')\nexport { useDeductions, DeductionsProvider }\n"],"names":["DeductionSchema","z","val","useDeductions","DeductionsProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;AAMa,MAAAA,IAAkBC,EAAE,OAAO;AAAA,EACtC,QAAQA,EAAE,QAAQ;AAAA,EAClB,QAAQA,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,UAAU,MAAM;AAAA,EAC1C,aAAaA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC7B,cAAcA,EAAE,QAAQ;AAAA,EACxB,OAAOA,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAC3B,WAAWA,EAAE,SAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAAA,EACrD,eAAeD,EACZ,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAQC,MAAAA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAS;AAAA,EACZ,kBAAkBD,EACf,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAQC,MAAAA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAS;AAAA,EACZ,oBAAoBD,EAAE,SAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAChE,CAAC,GAgBK,CAACC,GAAeC,CAAkB,IACtCC,EAA6C,mBAAmB;"}
1
+ {"version":3,"file":"useDeductions.js","sources":["../../../../src/components/Employee/Deductions/useDeductions.ts"],"sourcesContent":["import type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE = 'ADD' | 'LIST' | 'INITIAL' | 'EDIT'\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(), //The number of times to apply the garnishment. Ignored if recurring is true.\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\ntype DeductionsContextType = {\n isPending: boolean\n deductions: Garnishment[]\n employeeId: string\n mode: MODE\n handleAdd: () => void\n handleCancel: () => void\n handleEdit: (deduction: Garnishment) => void\n handleDelete: (deduction: Garnishment) => void\n handlePassthrough: () => void\n}\nconst [useDeductions, DeductionsProvider] =\n createCompoundContext<DeductionsContextType>('DeductionsContext')\nexport { useDeductions, DeductionsProvider }\n"],"names":["DeductionSchema","z","val","useDeductions","DeductionsProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAMa,MAAAA,IAAkBC,EAAE,OAAO;AAAA,EACtC,QAAQA,EAAE,QAAQ;AAAA,EAClB,QAAQA,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,UAAU,MAAM;AAAA,EAC1C,aAAaA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC7B,cAAcA,EAAE,QAAQ;AAAA,EACxB,OAAOA,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAC3B,WAAWA,EAAE,SAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAAA,EACrD,eAAeD,EACZ,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAQC,MAAAA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAS;AAAA,EACZ,kBAAkBD,EACf,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAQC,MAAAA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAS;AAAA,EACZ,oBAAoBD,EAAE,SAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAChE,CAAC,GAgBK,CAACC,GAAeC,CAAkB,IACtCC,EAA6C,mBAAmB;"}
@@ -6,12 +6,13 @@ import "@gusto/embedded-api/models/errors/apierror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
8
  import "../../../Base/useBase.js";
9
+ import "../../../../shared/constants.js";
9
10
  import "dompurify";
10
11
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
11
12
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
12
- const [C, D] = t("DocumentListContext");
13
+ const [D, L] = t("DocumentListContext");
13
14
  export {
14
- D as DocumentListProvider,
15
- C as useDocumentList
15
+ L as DocumentListProvider,
16
+ D as useDocumentList
16
17
  };
17
18
  //# 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;"}
@@ -0,0 +1,11 @@
1
+ import { DocumentList } from './DocumentList/DocumentList';
2
+ import { SignatureForm } from './SignatureForm/SignatureForm';
3
+ import { BaseComponentInterface } from '../../Base';
4
+ export interface DocumentSignerProps extends BaseComponentInterface<'Employee.DocumentSigner'> {
5
+ employeeId: string;
6
+ }
7
+ export declare const DocumentSigner: {
8
+ ({ employeeId, onEvent, dictionary }: DocumentSignerProps): import("react/jsx-runtime").JSX.Element;
9
+ DocumentList: typeof DocumentList;
10
+ SignatureForm: typeof SignatureForm;
11
+ };
@@ -0,0 +1,27 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { createMachine as c } from "robot3";
3
+ import { DocumentListContextual as p } from "./documentSignerStateMachine.js";
4
+ import { documentSignerMachine as u } from "./stateMachine.js";
5
+ import { DocumentList as a } from "./DocumentList/DocumentList.js";
6
+ import { SignatureForm as f } from "./SignatureForm/SignatureForm.js";
7
+ import { Flow as s } from "../../Flow/Flow.js";
8
+ import { useComponentDictionary as g } from "../../../i18n/I18n.js";
9
+ const o = ({ employeeId: t, onEvent: m, dictionary: r }) => {
10
+ g("Employee.DocumentSigner", r);
11
+ const e = c(
12
+ "index",
13
+ u,
14
+ (n) => ({
15
+ ...n,
16
+ component: p,
17
+ employeeId: t
18
+ })
19
+ );
20
+ return /* @__PURE__ */ i(s, { machine: e, onEvent: m });
21
+ };
22
+ o.DocumentList = a;
23
+ o.SignatureForm = f;
24
+ export {
25
+ o as DocumentSigner
26
+ };
27
+ //# sourceMappingURL=DocumentSigner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentSigner.js","sources":["../../../../src/components/Employee/DocumentSigner/DocumentSigner.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport {\n DocumentListContextual,\n type DocumentSignerContextInterface,\n} from './documentSignerStateMachine'\nimport { documentSignerMachine } from './stateMachine'\nimport { DocumentList } from './DocumentList/DocumentList'\nimport { SignatureForm } from './SignatureForm/SignatureForm'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface DocumentSignerProps extends BaseComponentInterface<'Employee.DocumentSigner'> {\n employeeId: string\n}\n\nexport const DocumentSigner = ({ employeeId, onEvent, dictionary }: DocumentSignerProps) => {\n useComponentDictionary('Employee.DocumentSigner', dictionary)\n\n const documentSigner = createMachine(\n 'index',\n documentSignerMachine,\n (initialContext: DocumentSignerContextInterface) => ({\n ...initialContext,\n component: DocumentListContextual,\n employeeId,\n }),\n )\n return <Flow machine={documentSigner} onEvent={onEvent} />\n}\n\nDocumentSigner.DocumentList = DocumentList\nDocumentSigner.SignatureForm = SignatureForm\n"],"names":["DocumentSigner","employeeId","onEvent","dictionary","useComponentDictionary","documentSigner","createMachine","documentSignerMachine","initialContext","DocumentListContextual","jsx","Flow","DocumentList","SignatureForm"],"mappings":";;;;;;;;AAgBO,MAAMA,IAAiB,CAAC,EAAE,YAAAC,GAAY,SAAAC,GAAS,YAAAC,QAAsC;AAC1F,EAAAC,EAAuB,2BAA2BD,CAAU;AAE5D,QAAME,IAAiBC;AAAA,IACrB;AAAA,IACAC;AAAA,IACA,CAACC,OAAoD;AAAA,MACnD,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,YAAAR;AAAA,IACF;AAAA,EACF;AACA,SAAQ,gBAAAS,EAAAC,GAAA,EAAK,SAASN,GAAgB,SAAAH,EAAkB,CAAA;AAC1D;AAEAF,EAAe,eAAeY;AAC9BZ,EAAe,gBAAgBa;"}
@@ -6,12 +6,13 @@ import "@gusto/embedded-api/models/errors/apierror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
8
  import "../../../Base/useBase.js";
9
+ import "../../../../shared/constants.js";
9
10
  import "dompurify";
10
11
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
11
12
  import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
12
- const [C, F] = o("SignatureFormContext");
13
+ const [F, S] = o("SignatureFormContext");
13
14
  export {
14
- F as SignatureFormProvider,
15
- C as useSignatureForm
15
+ S as SignatureFormProvider,
16
+ F as useSignatureForm
16
17
  };
17
18
  //# 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;"}