@gusto/embedded-react-sdk 0.13.2 → 0.13.4

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 (484) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/assets/icons/close.svg.js +5 -5
  3. package/dist/assets/icons/close.svg.js.map +1 -1
  4. package/dist/assets/icons/download-cloud.svg.js +10 -0
  5. package/dist/assets/icons/download-cloud.svg.js.map +1 -0
  6. package/dist/assets/icons/hamburger.svg.js +5 -5
  7. package/dist/assets/icons/hamburger.svg.js.map +1 -1
  8. package/dist/assets/icons/receipt-check.svg.js +10 -0
  9. package/dist/assets/icons/receipt-check.svg.js.map +1 -0
  10. package/dist/components/Base/Base.js +3 -2
  11. package/dist/components/Base/Base.js.map +1 -1
  12. package/dist/components/Common/DataView/DataCards/DataCards.js +24 -24
  13. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  14. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +6 -4
  15. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
  16. package/dist/components/Common/DataView/DataTable/DataTable.d.ts +3 -1
  17. package/dist/components/Common/DataView/DataTable/DataTable.js +38 -35
  18. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  19. package/dist/components/Common/DataView/DataView.d.ts +6 -3
  20. package/dist/components/Common/DataView/DataView.js +19 -16
  21. package/dist/components/Common/DataView/DataView.js.map +1 -1
  22. package/dist/components/Common/DocumentViewer/DocumentViewer.d.ts +1 -1
  23. package/dist/components/Common/DocumentViewer/DocumentViewer.js +9 -9
  24. package/dist/components/Common/DocumentViewer/DocumentViewer.js.map +1 -1
  25. package/dist/components/Common/Fields/CheckboxField/CheckboxField.d.ts +1 -1
  26. package/dist/components/Common/Fields/CheckboxField/CheckboxField.js +15 -9
  27. package/dist/components/Common/Fields/CheckboxField/CheckboxField.js.map +1 -1
  28. package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.d.ts +2 -2
  29. package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.js +21 -15
  30. package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.js.map +1 -1
  31. package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.d.ts +2 -2
  32. package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js +19 -13
  33. package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js.map +1 -1
  34. package/dist/components/Common/Fields/DatePickerField/DatePickerField.d.ts +1 -1
  35. package/dist/components/Common/Fields/DatePickerField/DatePickerField.js +24 -18
  36. package/dist/components/Common/Fields/DatePickerField/DatePickerField.js.map +1 -1
  37. package/dist/components/Common/Fields/NumberInputField/NumberInputField.d.ts +1 -1
  38. package/dist/components/Common/Fields/NumberInputField/NumberInputField.js +18 -12
  39. package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
  40. package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.d.ts +2 -2
  41. package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js +19 -13
  42. package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js.map +1 -1
  43. package/dist/components/Common/Fields/SelectField/SelectField.d.ts +2 -2
  44. package/dist/components/Common/Fields/SelectField/SelectField.js +19 -13
  45. package/dist/components/Common/Fields/SelectField/SelectField.js.map +1 -1
  46. package/dist/components/Common/Fields/SwitchField/SwitchField.d.ts +1 -1
  47. package/dist/components/Common/Fields/SwitchField/SwitchField.js +15 -9
  48. package/dist/components/Common/Fields/SwitchField/SwitchField.js.map +1 -1
  49. package/dist/components/Common/Fields/TextInputField/TextInputField.d.ts +1 -1
  50. package/dist/components/Common/Fields/TextInputField/TextInputField.js +15 -9
  51. package/dist/components/Common/Fields/TextInputField/TextInputField.js.map +1 -1
  52. package/dist/components/Common/Fields/hooks/useField.d.ts +8 -7
  53. package/dist/components/Common/Fields/hooks/useField.js +33 -27
  54. package/dist/components/Common/Fields/hooks/useField.js.map +1 -1
  55. package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
  56. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  57. package/dist/components/Common/SignatureForm/SignatureFormActions.js +12 -10
  58. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  59. package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -6
  60. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  61. package/dist/components/Common/UI/Alert/Alert.js +15 -15
  62. package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
  63. package/dist/components/Common/UI/Alert/Alert.module.scss.js +14 -12
  64. package/dist/components/Common/UI/Alert/Alert.module.scss.js.map +1 -1
  65. package/dist/components/Common/UI/Card/Card.module.scss.js +1 -1
  66. package/dist/components/Common/UI/Checkbox/CheckboxTypes.d.ts +5 -1
  67. package/dist/components/Common/UI/Checkbox/CheckboxTypes.js.map +1 -1
  68. package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +2 -2
  69. package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +2 -2
  70. package/dist/components/Common/UI/Dialog/Dialog.d.ts +2 -0
  71. package/dist/components/Common/UI/Dialog/Dialog.js +84 -0
  72. package/dist/components/Common/UI/Dialog/Dialog.js.map +1 -0
  73. package/dist/components/Common/UI/Dialog/Dialog.module.scss.js +18 -0
  74. package/dist/components/Common/UI/Dialog/Dialog.module.scss.js.map +1 -0
  75. package/dist/components/Common/UI/Dialog/DialogTypes.d.ts +52 -0
  76. package/dist/components/Common/UI/Dialog/DialogTypes.js +10 -0
  77. package/dist/components/Common/UI/Dialog/DialogTypes.js.map +1 -0
  78. package/dist/components/Common/UI/Dialog/index.d.ts +4 -0
  79. package/dist/components/Common/UI/Menu/Menu.module.scss.js +1 -1
  80. package/dist/components/Common/UI/NumberInput/NumberInputTypes.d.ts +2 -2
  81. package/dist/components/Common/UI/RadioGroup/RadioGroup.js +33 -31
  82. package/dist/components/Common/UI/RadioGroup/RadioGroup.js.map +1 -1
  83. package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +4 -0
  84. package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
  85. package/dist/components/Common/UI/Select/SelectTypes.d.ts +2 -2
  86. package/dist/components/Common/UI/Switch/SwitchTypes.d.ts +2 -2
  87. package/dist/components/Common/UI/Switch/SwitchTypes.js.map +1 -1
  88. package/dist/components/Common/UI/Table/Table.d.ts +1 -1
  89. package/dist/components/Common/UI/Table/Table.js +23 -11
  90. package/dist/components/Common/UI/Table/Table.js.map +1 -1
  91. package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
  92. package/dist/components/Common/UI/Table/TableTypes.d.ts +15 -0
  93. package/dist/components/Common/UI/Table/TableTypes.js +8 -0
  94. package/dist/components/Common/UI/Table/TableTypes.js.map +1 -0
  95. package/dist/components/Common/UI/Text/Text.js +9 -8
  96. package/dist/components/Common/UI/Text/Text.js.map +1 -1
  97. package/dist/components/Common/UI/Text/Text.module.scss.js +15 -14
  98. package/dist/components/Common/UI/Text/Text.module.scss.js.map +1 -1
  99. package/dist/components/Common/UI/Text/TextTypes.d.ts +2 -2
  100. package/dist/components/Common/UI/Text/TextTypes.js.map +1 -1
  101. package/dist/components/Common/UI/TextInput/TextInput.js +35 -33
  102. package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
  103. package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +5 -1
  104. package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
  105. package/dist/components/Common/UI/hooks/useFieldIds.d.ts +2 -1
  106. package/dist/components/Common/UI/hooks/useFieldIds.js +11 -6
  107. package/dist/components/Common/UI/hooks/useFieldIds.js.map +1 -1
  108. package/dist/components/Company/AssignSignatory/AssignSignatory.js +3 -2
  109. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  110. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +8 -6
  111. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  112. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +10 -8
  113. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  114. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
  115. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -3
  116. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  117. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +8 -6
  118. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  119. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  120. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -3
  121. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  122. package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
  123. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  124. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -5
  125. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  126. package/dist/components/Company/BankAccount/BankAccount.js +25 -21
  127. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  128. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
  129. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  130. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +11 -9
  131. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  132. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -3
  133. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  134. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +12 -10
  135. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  136. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +13 -11
  137. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  138. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -4
  139. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  140. package/dist/components/Company/BankAccount/stateMachine.d.ts +4 -4
  141. package/dist/components/Company/BankAccount/stateMachine.js.map +1 -1
  142. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +7 -5
  143. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  144. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +33 -32
  145. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  146. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -3
  147. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  148. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
  149. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  150. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -3
  151. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  152. package/dist/components/Company/DocumentSigner/assignSignatoryState.d.ts +1 -1
  153. package/dist/components/Company/DocumentSigner/assignSignatoryState.js.map +1 -1
  154. package/dist/components/Company/DocumentSigner/stateMachine.d.ts +5 -5
  155. package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -1
  156. package/dist/components/Company/FederalTaxes/Actions.js +9 -7
  157. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  158. package/dist/components/Company/FederalTaxes/FederalTaxes.js +7 -6
  159. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  160. package/dist/components/Company/FederalTaxes/Form.js +5 -3
  161. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  162. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -8
  163. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  164. package/dist/components/Company/Industry/Actions.js +7 -5
  165. package/dist/components/Company/Industry/Actions.js.map +1 -1
  166. package/dist/components/Company/Industry/Context.js +8 -6
  167. package/dist/components/Company/Industry/Context.js.map +1 -1
  168. package/dist/components/Company/Industry/Edit.js +12 -10
  169. package/dist/components/Company/Industry/Edit.js.map +1 -1
  170. package/dist/components/Company/Locations/LocationForm/Actions.js +8 -6
  171. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  172. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  173. package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -3
  174. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  175. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -3
  176. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  177. package/dist/components/Company/Locations/Locations.js +21 -17
  178. package/dist/components/Company/Locations/Locations.js.map +1 -1
  179. package/dist/components/Company/Locations/LocationsList/Actions.js +8 -6
  180. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  181. package/dist/components/Company/Locations/LocationsList/List.js +17 -16
  182. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  183. package/dist/components/Company/Locations/LocationsList/LocationsList.js +9 -8
  184. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  185. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -3
  186. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  187. package/dist/components/Company/Locations/stateMachine.d.ts +3 -3
  188. package/dist/components/Company/Locations/stateMachine.js.map +1 -1
  189. package/dist/components/Company/OnboardingFlow/OnboardingFlow.js +21 -17
  190. package/dist/components/Company/OnboardingFlow/OnboardingFlow.js.map +1 -1
  191. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.d.ts +10 -10
  192. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  193. package/dist/components/Company/OnboardingOverview/Completed.js +14 -12
  194. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  195. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +8 -6
  196. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  197. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +3 -2
  198. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  199. package/dist/components/Company/OnboardingOverview/context.js +5 -3
  200. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  201. package/dist/components/Company/PaySchedule/PaySchedule.js +4 -3
  202. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  203. package/dist/components/Company/PaySchedule/_parts/Actions.js +12 -10
  204. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  205. package/dist/components/Company/PaySchedule/_parts/Edit.js +14 -14
  206. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -6
  207. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  208. package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
  209. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  210. package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -5
  211. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  212. package/dist/components/Company/StateTaxes/StateTaxes.js +20 -16
  213. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  214. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +7 -5
  215. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  216. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -3
  217. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  218. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +8 -6
  219. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  220. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +7 -5
  221. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  222. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -3
  223. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  224. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +3 -3
  225. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
  226. package/dist/components/Contractor/Address/Address.js +5 -4
  227. package/dist/components/Contractor/Address/Address.js.map +1 -1
  228. package/dist/components/Contractor/Address/Form.js +1 -1
  229. package/dist/components/Contractor/Address/useAddress.js +7 -5
  230. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  231. package/dist/components/Contractor/ContractorList/index.js +25 -24
  232. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  233. package/dist/components/Contractor/NewHireReport/NewHireReport.js +14 -13
  234. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  235. package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js +25 -21
  236. package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js.map +1 -1
  237. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.d.ts +7 -7
  238. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  239. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +7 -5
  240. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  241. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  242. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  243. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
  244. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  245. package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +1 -1
  246. package/dist/components/Contractor/Profile/ContractorProfileForm.js +58 -55
  247. package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -1
  248. package/dist/components/Contractor/Profile/ContractorProfileForm.module.scss.js +8 -0
  249. package/dist/components/Contractor/Profile/ContractorProfileForm.module.scss.js.map +1 -0
  250. package/dist/components/Contractor/Profile/useContractorProfile.d.ts +2 -0
  251. package/dist/components/Contractor/Profile/useContractorProfile.js +97 -94
  252. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  253. package/dist/components/Contractor/Submit/Submit.js +4 -3
  254. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  255. package/dist/components/Employee/Compensation/Actions.js +6 -5
  256. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  257. package/dist/components/Employee/Compensation/Edit.js +15 -14
  258. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  259. package/dist/components/Employee/Compensation/List.js +25 -23
  260. package/dist/components/Employee/Compensation/List.js.map +1 -1
  261. package/dist/components/Employee/Deductions/DeductionsComponents.js +1 -1
  262. package/dist/components/Employee/Deductions/DeductionsComponents.js.map +1 -1
  263. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.d.ts +55 -0
  264. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +221 -0
  265. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -0
  266. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +8 -0
  267. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +1 -0
  268. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +42 -0
  269. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +132 -0
  270. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -0
  271. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +11 -10
  272. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
  273. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +14 -0
  274. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +1 -0
  275. package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.d.ts +7 -0
  276. package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.js +98 -0
  277. package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.js.map +1 -0
  278. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +8 -7
  279. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  280. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +11 -10
  281. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -1
  282. package/dist/components/Employee/Deductions/stateMachine.d.ts +5 -5
  283. package/dist/components/Employee/Deductions/stateMachine.js.map +1 -1
  284. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +8 -6
  285. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  286. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +7 -6
  287. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  288. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
  289. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  290. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -3
  291. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  292. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +19 -15
  293. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  294. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +8 -7
  295. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  296. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -3
  297. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  298. package/dist/components/Employee/DocumentSigner/stateMachine.d.ts +3 -3
  299. package/dist/components/Employee/DocumentSigner/stateMachine.js.map +1 -1
  300. package/dist/components/Employee/EmployeeList/Actions.js +6 -4
  301. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  302. package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
  303. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  304. package/dist/components/Employee/EmployeeList/Head.js +7 -5
  305. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  306. package/dist/components/Employee/EmployeeList/List.js +15 -14
  307. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  308. package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -3
  309. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  310. package/dist/components/Employee/FederalTaxes/Actions.js +8 -6
  311. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  312. package/dist/components/Employee/FederalTaxes/FederalForm.js +13 -11
  313. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  314. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +5 -3
  315. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  316. package/dist/components/Employee/Landing/Landing.js +13 -12
  317. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  318. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js +24 -20
  319. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
  320. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.d.ts +9 -9
  321. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  322. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  323. package/dist/components/Employee/PaymentMethod/Actions.js +9 -7
  324. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  325. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +6 -5
  326. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  327. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +10 -8
  328. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  329. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +3 -2
  330. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  331. package/dist/components/Employee/PaymentMethod/Split.js +11 -10
  332. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  333. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -5
  334. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  335. package/dist/components/Employee/Profile/Actions.js +9 -7
  336. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  337. package/dist/components/Employee/Profile/AdminPersonalDetails.js +32 -29
  338. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  339. package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js +8 -0
  340. package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js.map +1 -0
  341. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  342. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  343. package/dist/components/Employee/Profile/Profile.d.ts +1 -0
  344. package/dist/components/Employee/Profile/Profile.js +78 -75
  345. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  346. package/dist/components/Employee/Profile/useProfile.js +5 -3
  347. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  348. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js +17 -13
  349. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -1
  350. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.d.ts +5 -5
  351. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
  352. package/dist/components/Employee/StateTaxes/Actions.js +10 -8
  353. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  354. package/dist/components/Employee/StateTaxes/useStateTaxes.js +5 -3
  355. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  356. package/dist/components/Employee/Taxes/Actions.js +10 -8
  357. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  358. package/dist/components/Employee/Taxes/FederalForm.js +14 -12
  359. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  360. package/dist/components/Employee/Taxes/useTaxes.js +5 -3
  361. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  362. package/dist/components/Payroll/PayrollBlocker/PayrollBlockerAlerts.d.ts +7 -0
  363. package/dist/components/Payroll/PayrollBlocker/PayrollBlockerList.d.ts +6 -0
  364. package/dist/components/Payroll/PayrollBlocker/PayrollBlockerTypes.d.ts +101 -0
  365. package/dist/components/Payroll/PayrollBlocker/index.d.ts +4 -0
  366. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +64 -56
  367. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  368. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +36 -36
  369. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  370. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +41 -45
  371. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  372. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +20 -2
  373. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +308 -101
  374. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  375. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js +16 -0
  376. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js.map +1 -0
  377. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.d.ts +7 -0
  378. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +59 -0
  379. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -0
  380. package/dist/components/Payroll/PayrollEditEmployee/index.d.ts +4 -0
  381. package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +2 -0
  382. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +26 -0
  383. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -0
  384. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +25 -0
  385. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +59 -0
  386. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -0
  387. package/dist/components/Payroll/PayrollFlow/index.d.ts +3 -0
  388. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +7 -0
  389. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +116 -0
  390. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -0
  391. package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +19 -0
  392. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +114 -0
  393. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -0
  394. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +8 -11
  395. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +194 -0
  396. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -0
  397. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.module.scss.js +8 -0
  398. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.module.scss.js.map +1 -0
  399. package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +7 -0
  400. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +41 -0
  401. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -0
  402. package/dist/components/Payroll/PayrollList/PayrollList.js +19 -21
  403. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  404. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +87 -79
  405. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  406. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +3 -1
  407. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +102 -42
  408. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  409. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +12 -1
  410. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +274 -133
  411. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  412. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +7 -0
  413. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +21 -0
  414. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -0
  415. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +6 -0
  416. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +220 -0
  417. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -0
  418. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +28 -0
  419. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js.map +1 -0
  420. package/dist/components/Payroll/RunPayrollFlow/RunPayroll.d.ts +2 -2
  421. package/dist/components/Payroll/RunPayrollFlow/RunPayroll.js +58 -43
  422. package/dist/components/Payroll/RunPayrollFlow/RunPayroll.js.map +1 -1
  423. package/dist/components/Payroll/RunPayrollFlow/RunPayrollFlow.js +11 -11
  424. package/dist/components/Payroll/RunPayrollFlow/RunPayrollFlow.js.map +1 -1
  425. package/dist/components/Payroll/helpers.d.ts +21 -1
  426. package/dist/components/Payroll/helpers.js +166 -123
  427. package/dist/components/Payroll/helpers.js.map +1 -1
  428. package/dist/components/Payroll/index.d.ts +4 -0
  429. package/dist/components/Payroll/index.js +14 -6
  430. package/dist/components/Payroll/index.js.map +1 -1
  431. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +21 -19
  432. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  433. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  434. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +10 -0
  435. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +35 -31
  436. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
  437. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  438. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  439. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +8 -5
  440. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  441. package/dist/contexts/ThemeProvider/theme.d.ts +3 -0
  442. package/dist/contexts/ThemeProvider/theme.js +12 -9
  443. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  444. package/dist/helpers/formattedStrings.js +12 -11
  445. package/dist/helpers/formattedStrings.js.map +1 -1
  446. package/dist/helpers/readableStreamToBlob.d.ts +1 -0
  447. package/dist/helpers/readableStreamToBlob.js +17 -0
  448. package/dist/helpers/readableStreamToBlob.js.map +1 -0
  449. package/dist/hooks/useContainerBreakpoints/useContainerBreakpoints.d.ts +2 -4
  450. package/dist/hooks/useContainerBreakpoints/useContainerBreakpoints.js.map +1 -1
  451. package/dist/i18n/I18n.js +9 -9
  452. package/dist/i18n/I18n.js.map +1 -1
  453. package/dist/i18n/en/Employee.Deductions.json.js +126 -66
  454. package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
  455. package/dist/i18n/en/Employee.Profile.json.js +32 -30
  456. package/dist/i18n/en/Employee.Profile.json.js.map +1 -1
  457. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +15 -15
  458. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +34 -14
  459. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
  460. package/dist/i18n/en/Payroll.PayrollHistory.json.js +22 -0
  461. package/dist/i18n/en/Payroll.PayrollHistory.json.js.map +1 -0
  462. package/dist/i18n/en/Payroll.PayrollLanding.json.js +12 -0
  463. package/dist/i18n/en/Payroll.PayrollLanding.json.js.map +1 -0
  464. package/dist/i18n/en/Payroll.PayrollList.json.js +16 -12
  465. package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
  466. package/dist/i18n/en/Payroll.PayrollOverview.json.js +50 -22
  467. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  468. package/dist/i18n/en/Payroll.PayrollReceipts.json.js +16 -0
  469. package/dist/i18n/en/Payroll.PayrollReceipts.json.js.map +1 -0
  470. package/dist/i18n/en/PayrollBlocker.json.js +18 -0
  471. package/dist/i18n/en/PayrollBlocker.json.js.map +1 -0
  472. package/dist/node_modules/redux/es/redux.js +2 -2
  473. package/dist/node_modules/redux/es/redux.js.map +1 -1
  474. package/dist/shared/constants.d.ts +41 -4
  475. package/dist/shared/constants.js +85 -57
  476. package/dist/shared/constants.js.map +1 -1
  477. package/dist/style.css +1 -1
  478. package/dist/types/Helpers.d.ts +7 -0
  479. package/dist/types/i18next.d.ts +187 -44
  480. package/package.json +18 -18
  481. package/dist/i18n/en/Payroll.PayrollHistoryList.json.js +0 -16
  482. package/dist/i18n/en/Payroll.PayrollHistoryList.json.js.map +0 -1
  483. package/dist/i18n/en/payroll.payrollhistory.json.js +0 -20
  484. package/dist/i18n/en/payroll.payrollhistory.json.js.map +0 -1
@@ -0,0 +1,98 @@
1
+ import { jsx as n, jsxs as a } from "react/jsx-runtime";
2
+ import { useTranslation as N } from "react-i18next";
3
+ import { useState as h } from "react";
4
+ import { useGarnishmentsListSuspense as A } from "@gusto/embedded-api/react-query/garnishmentsList";
5
+ import { useGarnishmentsGetChildSupportDataSuspense as R } from "@gusto/embedded-api/react-query/garnishmentsGetChildSupportData";
6
+ import c from "./DeductionsForm.module.scss.js";
7
+ import P from "./ChildSupportForm.js";
8
+ import O from "./CustomDeductionForm.js";
9
+ import { BaseComponent as _ } from "../../../Base/Base.js";
10
+ import { useBase as B } from "../../../Base/useBase.js";
11
+ import { Grid as H } from "../../../Common/Grid/Grid.js";
12
+ import { useComponentDictionary as F, useI18n as U } from "../../../../i18n/I18n.js";
13
+ import { componentEvents as j } from "../../../../shared/constants.js";
14
+ import { useComponentContext as k } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
15
+ import w from "../../../../assets/icons/caret-left.svg.js";
16
+ function ie(s) {
17
+ return /* @__PURE__ */ n(_, { ...s, children: /* @__PURE__ */ n(M, { ...s, children: s.children }) });
18
+ }
19
+ const I = ["child_support"];
20
+ function M({ className: s, employeeId: r, deductionId: u, dictionary: g }) {
21
+ const { onEvent: D } = B(), { t } = N("Employee.Deductions"), i = k();
22
+ F("Employee.Deductions", g), U("Employee.Deductions");
23
+ const { data: f } = A({ employeeId: r }), { data: l } = R({}), o = u ? f.garnishmentList?.find((e) => e.uuid === u) ?? null : null, T = t(o ? "editDeductionTitle" : "addDeductionTitle"), d = o?.garnishmentType, S = l.childSupportData?.agencies?.map((e) => ({
24
+ label: e.name,
25
+ value: e.state
26
+ })) || [], [m, y] = h(
27
+ d && I.includes(d) || !o
28
+ ), C = o ? d ? "garnishment" : "custom" : "garnishment", [p, b] = h(o?.childSupport?.state || ""), E = (e) => {
29
+ b(e);
30
+ }, x = l.childSupportData?.agencies?.find((e) => e.state === p)?.fipsCodes?.map((e) => ({
31
+ label: e.county?.length ? e.county : t("allCounties"),
32
+ value: e.code
33
+ })) || [], L = l.childSupportData?.agencies?.find(
34
+ (e) => e.state === p
35
+ ), v = () => {
36
+ D(j.EMPLOYEE_DEDUCTION_CANCEL);
37
+ }, G = (e) => {
38
+ y(e === "garnishment");
39
+ };
40
+ return /* @__PURE__ */ a("section", { className: s, children: [
41
+ /* @__PURE__ */ a(i.Button, { variant: "secondary", onClick: v, children: [
42
+ /* @__PURE__ */ n(w, { className: c.leftCaretIcon }),
43
+ t("backToDeductionsCta")
44
+ ] }),
45
+ /* @__PURE__ */ a(H, { gap: 16, className: c.formHeadingContainer, children: [
46
+ /* @__PURE__ */ n(i.Heading, { as: "h2", children: T }),
47
+ /* @__PURE__ */ a("section", { children: [
48
+ /* @__PURE__ */ n(i.Text, { weight: "bold", children: t("externalPostTaxDeductions") }),
49
+ /* @__PURE__ */ n(i.Text, { variant: "supporting", children: t("externalPostTaxDeductionsDescription") })
50
+ ] }),
51
+ /* @__PURE__ */ n(
52
+ i.RadioGroup,
53
+ {
54
+ label: t("deductionTypeLabel"),
55
+ description: t("deductionTypeRadioLabel"),
56
+ options: [
57
+ { value: "garnishment", label: t("garnishmentOption") },
58
+ { value: "custom", label: t("customDeductionOption") }
59
+ ],
60
+ defaultValue: C,
61
+ onChange: G,
62
+ isRequired: !0,
63
+ isDisabled: !!o,
64
+ className: c.deductionTypeRadioGroup
65
+ }
66
+ ),
67
+ m && /* @__PURE__ */ a("section", { children: [
68
+ /* @__PURE__ */ n(i.Text, { weight: "bold", className: c.garnishmentTypeLabel, children: t("garnishmentType") }),
69
+ /* @__PURE__ */ n(
70
+ i.Select,
71
+ {
72
+ label: t("garnishmentType"),
73
+ options: [],
74
+ placeholder: t("childSupport"),
75
+ shouldVisuallyHideLabel: !0,
76
+ isDisabled: !0
77
+ }
78
+ )
79
+ ] }),
80
+ /* @__PURE__ */ n("hr", {})
81
+ ] }),
82
+ m ? /* @__PURE__ */ n(
83
+ P,
84
+ {
85
+ deduction: o,
86
+ employeeId: r,
87
+ handleStateAgencySelect: E,
88
+ stateAgencies: S,
89
+ counties: x,
90
+ selectedAgency: L
91
+ }
92
+ ) : /* @__PURE__ */ n(O, { deduction: o, employeeId: r })
93
+ ] });
94
+ }
95
+ export {
96
+ ie as UNSTABLEDeductionsForm
97
+ };
98
+ //# sourceMappingURL=UNSTABLE_DeductionsForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UNSTABLE_DeductionsForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useState } from 'react'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useGarnishmentsGetChildSupportDataSuspense } from '@gusto/embedded-api/react-query/garnishmentsGetChildSupportData'\nimport styles from './DeductionsForm.module.scss'\nimport ChildSupportForm from './ChildSupportForm'\nimport CustomDeductionForm from './CustomDeductionForm'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { Grid } from '@/components/Common/Grid/Grid'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport CaretLeft from '@/assets/icons/caret-left.svg?react'\ninterface DeductionsFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deductionId?: string | null\n}\n\nexport function UNSTABLEDeductionsForm(props: DeductionsFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\n// deductions can be either custom or a garnishment\n// we currently only support child support garnishment type\nconst SUPPORTED_GARNISHMENT_TYPES = ['child_support']\n\nfunction Root({ className, employeeId, deductionId, dictionary }: DeductionsFormProps) {\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 // Fetch all garnishments to find the specific one by ID\n const { data } = useGarnishmentsListSuspense({ employeeId })\n\n // Fetch child support garnishment metadata\n const { data: childSupportData } = useGarnishmentsGetChildSupportDataSuspense({})\n\n // find existing deduction to determine if in ADD or EDIT mode\n // if deduction exists we are editing, else we are adding\n // edit deductions cannot change the record type, it can only update the existing entries of the record\n const deduction = deductionId\n ? (data.garnishmentList?.find(g => g.uuid === deductionId) ?? null)\n : null\n const title = !deduction ? t('addDeductionTitle') : t('editDeductionTitle')\n const deductionType = deduction?.garnishmentType\n const stateAgencies =\n childSupportData.childSupportData?.agencies?.map(a => ({\n label: a.name as string,\n value: a.state as string,\n })) || []\n\n // if deduction exists check if it has a type, else if does not exist default to garnishment\n const [isGarnishment, setIsGarnishment] = useState<boolean>(\n (deductionType && SUPPORTED_GARNISHMENT_TYPES.includes(deductionType)) || !deduction,\n )\n const defaultDeductionTypeSelection = deduction\n ? deductionType\n ? 'garnishment'\n : 'custom'\n : 'garnishment'\n\n // filter out specific fipsCodes/counties as mapped to selected state agency\n // some states only have 1 fips code/county to cover the entire state,\n // but the API will return a null label so we need to provide a default label\n const [stateAgency, setStateAgency] = useState<string>(deduction?.childSupport?.state || '')\n const handleStateAgencySelect = (stateAgency: string) => {\n setStateAgency(stateAgency)\n }\n const counties =\n childSupportData.childSupportData?.agencies\n ?.find(agency => agency.state === stateAgency)\n ?.fipsCodes?.map(fipsCode => ({\n label: fipsCode.county?.length ? fipsCode.county : t('allCounties'),\n value: fipsCode.code as string,\n })) || []\n\n // get a reference to the currently selected agency to determine which required fields to display/include in submission\n const selectedAgency = childSupportData.childSupportData?.agencies?.find(\n agency => agency.state === stateAgency,\n )\n\n const handleCancel = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CANCEL)\n }\n\n const handleSelectDeductionType = (selection: string) => {\n setIsGarnishment(selection === 'garnishment')\n }\n\n return (\n <section className={className}>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n <CaretLeft className={styles.leftCaretIcon} />\n {t('backToDeductionsCta')}\n </Components.Button>\n <Grid gap={16} className={styles.formHeadingContainer}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n <section>\n <Components.Text weight=\"bold\">{t('externalPostTaxDeductions')}</Components.Text>\n <Components.Text variant=\"supporting\">\n {t('externalPostTaxDeductionsDescription')}\n </Components.Text>\n </section>\n <Components.RadioGroup\n label={t('deductionTypeLabel')}\n description={t('deductionTypeRadioLabel')}\n options={[\n { value: 'garnishment', label: t('garnishmentOption') },\n { value: 'custom', label: t('customDeductionOption') },\n ]}\n defaultValue={defaultDeductionTypeSelection}\n onChange={handleSelectDeductionType}\n isRequired\n isDisabled={!!deduction}\n className={styles.deductionTypeRadioGroup}\n />\n {isGarnishment && (\n <section>\n <Components.Text weight=\"bold\" className={styles.garnishmentTypeLabel}>\n {t('garnishmentType')}\n </Components.Text>\n {/* we currently only support child support garnishment type */}\n <Components.Select\n label={t('garnishmentType')}\n options={[]}\n placeholder={t('childSupport')}\n shouldVisuallyHideLabel\n isDisabled\n />\n </section>\n )}\n <hr />\n </Grid>\n\n {isGarnishment ? (\n <ChildSupportForm\n deduction={deduction}\n employeeId={employeeId}\n handleStateAgencySelect={handleStateAgencySelect}\n stateAgencies={stateAgencies}\n counties={counties}\n selectedAgency={selectedAgency}\n />\n ) : (\n <CustomDeductionForm deduction={deduction} employeeId={employeeId} />\n )}\n </section>\n )\n}\n"],"names":["UNSTABLEDeductionsForm","props","jsx","BaseComponent","Root","SUPPORTED_GARNISHMENT_TYPES","className","employeeId","deductionId","dictionary","onEvent","useBase","useTranslation","Components","useComponentContext","useComponentDictionary","useI18n","data","useGarnishmentsListSuspense","childSupportData","useGarnishmentsGetChildSupportDataSuspense","deduction","g","title","deductionType","stateAgencies","a","isGarnishment","setIsGarnishment","useState","defaultDeductionTypeSelection","stateAgency","setStateAgency","handleStateAgencySelect","counties","agency","fipsCode","selectedAgency","handleCancel","componentEvents","handleSelectDeductionType","selection","jsxs","CaretLeft","styles","Grid","ChildSupportForm","CustomDeductionForm"],"mappings":";;;;;;;;;;;;;;;AAwBO,SAASA,GAAuBC,GAAqD;AAC1F,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAIA,MAAMI,IAA8B,CAAC,eAAe;AAEpD,SAASD,EAAK,EAAE,WAAAE,GAAW,YAAAC,GAAY,aAAAC,GAAa,YAAAC,KAAmC;AACrF,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACd,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA;AAEnB,EAAAC,EAAuB,uBAAuBN,CAAU,GACxDO,EAAQ,qBAAqB;AAG7B,QAAM,EAAE,MAAAC,EAAA,IAASC,EAA4B,EAAE,YAAAX,GAAY,GAGrD,EAAE,MAAMY,MAAqBC,EAA2C,CAAA,CAAE,GAK1EC,IAAYb,IACbS,EAAK,iBAAiB,KAAK,OAAKK,EAAE,SAASd,CAAW,KAAK,OAC5D,MACEe,IAA8C,EAArCF,IAAuC,uBAAzB,mBAA6C,GACpEG,IAAgBH,GAAW,iBAC3BI,IACJN,EAAiB,kBAAkB,UAAU,IAAI,CAAAO,OAAM;AAAA,IACrD,OAAOA,EAAE;AAAA,IACT,OAAOA,EAAE;AAAA,EAAA,EACT,KAAK,CAAA,GAGH,CAACC,GAAeC,CAAgB,IAAIC;AAAA,IACvCL,KAAiBnB,EAA4B,SAASmB,CAAa,KAAM,CAACH;AAAA,EAAA,GAEvES,IAAgCT,IAClCG,IACE,gBACA,WACF,eAKE,CAACO,GAAaC,CAAc,IAAIH,EAAiBR,GAAW,cAAc,SAAS,EAAE,GACrFY,IAA0B,CAACF,MAAwB;AACvD,IAAAC,EAAeD,CAAW;AAAA,EAC5B,GACMG,IACJf,EAAiB,kBAAkB,UAC/B,KAAK,CAAAgB,MAAUA,EAAO,UAAUJ,CAAW,GAC3C,WAAW,IAAI,CAAAK,OAAa;AAAA,IAC5B,OAAOA,EAAS,QAAQ,SAASA,EAAS,SAAS,EAAE,aAAa;AAAA,IAClE,OAAOA,EAAS;AAAA,EAAA,EAChB,KAAK,CAAA,GAGLC,IAAiBlB,EAAiB,kBAAkB,UAAU;AAAA,IAClE,CAAAgB,MAAUA,EAAO,UAAUJ;AAAA,EAAA,GAGvBO,IAAe,MAAM;AACzB,IAAA5B,EAAQ6B,EAAgB,yBAAyB;AAAA,EACnD,GAEMC,IAA4B,CAACC,MAAsB;AACvD,IAAAb,EAAiBa,MAAc,aAAa;AAAA,EAC9C;AAEA,SACE,gBAAAC,EAAC,aAAQ,WAAApC,GACP,UAAA;AAAA,IAAA,gBAAAoC,EAAC7B,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASyB,GAC9C,UAAA;AAAA,MAAA,gBAAApC,EAACyC,GAAA,EAAU,WAAWC,EAAO,cAAA,CAAe;AAAA,MAC3C,EAAE,qBAAqB;AAAA,IAAA,GAC1B;AAAA,sBACCC,GAAA,EAAK,KAAK,IAAI,WAAWD,EAAO,sBAC/B,UAAA;AAAA,MAAA,gBAAA1C,EAACW,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAU,GAAM;AAAA,wBAClC,WAAA,EACC,UAAA;AAAA,QAAA,gBAAArB,EAACW,EAAW,MAAX,EAAgB,QAAO,QAAQ,UAAA,EAAE,2BAA2B,GAAE;AAAA,QAC/D,gBAAAX,EAACW,EAAW,MAAX,EAAgB,SAAQ,cACtB,UAAA,EAAE,sCAAsC,EAAA,CAC3C;AAAA,MAAA,GACF;AAAA,MACA,gBAAAX;AAAA,QAACW,EAAW;AAAA,QAAX;AAAA,UACC,OAAO,EAAE,oBAAoB;AAAA,UAC7B,aAAa,EAAE,yBAAyB;AAAA,UACxC,SAAS;AAAA,YACP,EAAE,OAAO,eAAe,OAAO,EAAE,mBAAmB,EAAA;AAAA,YACpD,EAAE,OAAO,UAAU,OAAO,EAAE,uBAAuB,EAAA;AAAA,UAAE;AAAA,UAEvD,cAAciB;AAAA,UACd,UAAUU;AAAA,UACV,YAAU;AAAA,UACV,YAAY,CAAC,CAACnB;AAAA,UACd,WAAWuB,EAAO;AAAA,QAAA;AAAA,MAAA;AAAA,MAEnBjB,uBACE,WAAA,EACC,UAAA;AAAA,QAAA,gBAAAzB,EAACW,EAAW,MAAX,EAAgB,QAAO,QAAO,WAAW+B,EAAO,sBAC9C,UAAA,EAAE,iBAAiB,EAAA,CACtB;AAAA,QAEA,gBAAA1C;AAAA,UAACW,EAAW;AAAA,UAAX;AAAA,YACC,OAAO,EAAE,iBAAiB;AAAA,YAC1B,SAAS,CAAA;AAAA,YACT,aAAa,EAAE,cAAc;AAAA,YAC7B,yBAAuB;AAAA,YACvB,YAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MACZ,GACF;AAAA,wBAED,MAAA,CAAA,CAAG;AAAA,IAAA,GACN;AAAA,IAECc,IACC,gBAAAzB;AAAA,MAAC4C;AAAA,MAAA;AAAA,QACC,WAAAzB;AAAA,QACA,YAAAd;AAAA,QACA,yBAAA0B;AAAA,QACA,eAAAR;AAAA,QACA,UAAAS;AAAA,QACA,gBAAAG;AAAA,MAAA;AAAA,IAAA,IAGF,gBAAAnC,EAAC6C,GAAA,EAAoB,WAAA1B,GAAsB,YAAAd,EAAA,CAAwB;AAAA,EAAA,GAEvE;AAEJ;"}
@@ -5,21 +5,22 @@ import { useGarnishmentsUpdateMutation as N } from "@gusto/embedded-api/react-qu
5
5
  import { BaseComponent as _ } from "../../../Base/Base.js";
6
6
  import { useBase as k } from "../../../Base/useBase.js";
7
7
  import { Flex as w } from "../../../Common/Flex/Flex.js";
8
+ import "classnames";
9
+ import { componentEvents as a } from "../../../../shared/constants.js";
8
10
  import { ActionsLayout as I } from "../../../Common/ActionsLayout/ActionsLayout.js";
9
11
  import u from "../../../Common/hooks/useNumberFormatter.js";
10
12
  import M from "../../../../assets/icons/pencil.svg.js";
11
13
  import U from "../../../../assets/icons/trashcan.svg.js";
12
14
  import { HamburgerMenu as B } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
13
15
  import { useComponentDictionary as S, useI18n as Y } from "../../../../i18n/I18n.js";
14
- import { componentEvents as a } from "../../../../shared/constants.js";
15
16
  import { useComponentContext as q } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
16
17
  import { useDataView as F } from "../../../Common/DataView/useDataView.js";
17
18
  import { DataView as H } from "../../../Common/DataView/DataView.js";
18
19
  function se(r) {
19
20
  return /* @__PURE__ */ n(_, { ...r, children: /* @__PURE__ */ n(V, { ...r, children: r.children }) });
20
21
  }
21
- function V({ className: r, children: m, employeeId: d, dictionary: l }) {
22
- const { onEvent: i, baseSubmitHandler: p } = k(), { t } = O("Employee.Deductions"), s = q(), E = u("currency"), f = u("percent");
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");
23
24
  S("Employee.Deductions", l), Y("Employee.Deductions");
24
25
  const { data: D } = x({ employeeId: d }), h = D.garnishmentList.filter((e) => e.active), { mutateAsync: C, isPending: g } = N(), y = async (e) => {
25
26
  await p(e, async (o) => {
@@ -83,12 +84,12 @@ function V({ className: r, children: m, employeeId: d, dictionary: l }) {
83
84
  }
84
85
  )
85
86
  });
86
- return /* @__PURE__ */ n("section", { className: r, children: /* @__PURE__ */ n(w, { flexDirection: "column", gap: 32, children: m || /* @__PURE__ */ c(A, { children: [
87
- /* @__PURE__ */ n(s.Heading, { as: "h2", children: t("pageTitle") }),
87
+ return /* @__PURE__ */ n("section", { className: r, children: /* @__PURE__ */ n(w, { flexDirection: "column", gap: 32, children: s || /* @__PURE__ */ c(A, { children: [
88
+ /* @__PURE__ */ n(m.Heading, { as: "h2", children: t("pageTitle") }),
88
89
  /* @__PURE__ */ n(H, { label: t("deductionsTableLabel"), ...L }),
89
90
  /* @__PURE__ */ c(I, { children: [
90
- /* @__PURE__ */ n(s.Button, { variant: "secondary", onClick: T, children: t("addDeductionCta") }),
91
- /* @__PURE__ */ n(s.Button, { onClick: b, children: t("continueCta") })
91
+ /* @__PURE__ */ n(m.Button, { variant: "secondary", onClick: T, children: t("addDeductionCta") }),
92
+ /* @__PURE__ */ n(m.Button, { onClick: b, children: t("continueCta") })
92
93
  ] })
93
94
  ] }) }) });
94
95
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DeductionsList.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsList/DeductionsList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { useDataView, DataView } from '@/components/Common'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport useNumberFormatter from '@/components/Common/hooks/useNumberFormatter'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface DeductionsListProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nexport function DeductionsList(props: DeductionsListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, employeeId, dictionary }: DeductionsListProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n const formatCurrency = useNumberFormatter('currency')\n const formatPercent = useNumberFormatter('percent')\n\n useComponentDictionary('Employee.Deductions', dictionary)\n useI18n('Employee.Deductions')\n\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n const activeDeductions = deductions.filter(deduction => deduction.active)\n\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n\n const handleDelete = async (deduction: Garnishment) => {\n await baseSubmitHandler(deduction, async payload => {\n const { garnishment } = await updateDeduction({\n request: {\n garnishmentId: payload.uuid,\n requestBody: {\n ...payload,\n totalAmount: payload.totalAmount ?? undefined,\n active: false,\n version: payload.version as string,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DELETED, garnishment)\n })\n }\n\n const handleEdit = (deduction: Garnishment) => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_EDIT, deduction)\n }\n\n const handleAdd = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_ADD)\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n }\n\n const { ...dataViewProps } = useDataView({\n data: activeDeductions,\n columns: [\n { key: 'description', title: t('nameColumn') },\n {\n key: 'recurring',\n title: t('frequencyColumn'),\n render: deduction => {\n return deduction.recurring ? t('recurringText') : t('nonRecurringText')\n },\n },\n {\n key: 'amount',\n title: t('withheldColumn'),\n render: deduction => {\n const formattedAmount = deduction.deductAsPercentage\n ? formatPercent(Number(deduction.amount))\n : formatCurrency(Number(deduction.amount))\n return deduction.recurring\n ? t('recurringAmount', { value: formattedAmount })\n : formattedAmount\n },\n },\n ],\n itemMenu: deduction => {\n return (\n <HamburgerMenu\n isLoading={isPendingUpdate}\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEdit(deduction)\n },\n icon: <PencilSvg aria-hidden />,\n },\n {\n label: t('deleteCta'),\n onClick: async () => {\n await handleDelete(deduction)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n return (\n <section className={className}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n <DataView label={t('deductionsTableLabel')} {...dataViewProps} />\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAdd}>\n {t('addDeductionCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n </>\n )}\n </Flex>\n </section>\n )\n}\n"],"names":["DeductionsList","props","jsx","BaseComponent","Root","className","children","employeeId","dictionary","onEvent","baseSubmitHandler","useBase","useTranslation","Components","useComponentContext","formatCurrency","useNumberFormatter","formatPercent","useComponentDictionary","useI18n","data","useGarnishmentsListSuspense","activeDeductions","deduction","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","handleDelete","payload","garnishment","componentEvents","handleEdit","handleAdd","handleContinue","dataViewProps","useDataView","formattedAmount","HamburgerMenu","PencilSvg","TrashCanSvg","Flex","jsxs","Fragment","DataView","ActionsLayout"],"mappings":"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"}
1
+ {"version":3,"file":"DeductionsList.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsList/DeductionsList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { useDataView, DataView } from '@/components/Common'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport useNumberFormatter from '@/components/Common/hooks/useNumberFormatter'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface DeductionsListProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nexport function DeductionsList(props: DeductionsListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, employeeId, dictionary }: DeductionsListProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n const formatCurrency = useNumberFormatter('currency')\n const formatPercent = useNumberFormatter('percent')\n\n useComponentDictionary('Employee.Deductions', dictionary)\n useI18n('Employee.Deductions')\n\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n const activeDeductions = deductions.filter(deduction => deduction.active)\n\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n\n const handleDelete = async (deduction: Garnishment) => {\n await baseSubmitHandler(deduction, async payload => {\n const { garnishment } = await updateDeduction({\n request: {\n garnishmentId: payload.uuid,\n requestBody: {\n ...payload,\n totalAmount: payload.totalAmount ?? undefined,\n active: false,\n version: payload.version as string,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DELETED, garnishment)\n })\n }\n\n const handleEdit = (deduction: Garnishment) => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_EDIT, deduction)\n }\n\n const handleAdd = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_ADD)\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n }\n\n const { ...dataViewProps } = useDataView({\n data: activeDeductions,\n columns: [\n { key: 'description', title: t('nameColumn') },\n {\n key: 'recurring',\n title: t('frequencyColumn'),\n render: deduction => {\n return deduction.recurring ? t('recurringText') : t('nonRecurringText')\n },\n },\n {\n key: 'amount',\n title: t('withheldColumn'),\n render: deduction => {\n const formattedAmount = deduction.deductAsPercentage\n ? formatPercent(Number(deduction.amount))\n : formatCurrency(Number(deduction.amount))\n return deduction.recurring\n ? t('recurringAmount', { value: formattedAmount })\n : formattedAmount\n },\n },\n ],\n itemMenu: deduction => {\n return (\n <HamburgerMenu\n isLoading={isPendingUpdate}\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEdit(deduction)\n },\n icon: <PencilSvg aria-hidden />,\n },\n {\n label: t('deleteCta'),\n onClick: async () => {\n await handleDelete(deduction)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n return (\n <section className={className}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n <DataView label={t('deductionsTableLabel')} {...dataViewProps} />\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAdd}>\n {t('addDeductionCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n </>\n )}\n </Flex>\n </section>\n )\n}\n"],"names":["DeductionsList","props","jsx","BaseComponent","Root","className","children","employeeId","dictionary","onEvent","baseSubmitHandler","useBase","useTranslation","Components","useComponentContext","formatCurrency","useNumberFormatter","formatPercent","useComponentDictionary","useI18n","data","useGarnishmentsListSuspense","activeDeductions","deduction","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","handleDelete","payload","garnishment","componentEvents","handleEdit","handleAdd","handleContinue","dataViewProps","useDataView","formattedAmount","HamburgerMenu","PencilSvg","TrashCanSvg","Flex","jsxs","Fragment","DataView","ActionsLayout"],"mappings":"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"}
@@ -6,18 +6,19 @@ import { zodResolver as h } from "@hookform/resolvers/zod";
6
6
  import { BaseComponent as C } from "../../../Base/Base.js";
7
7
  import { useBase as b } from "../../../Base/useBase.js";
8
8
  import { Form as N } from "../../../Common/Form/Form.js";
9
- import { ActionsLayout as v } from "../../../Common/ActionsLayout/ActionsLayout.js";
10
- import { useComponentDictionary as F, useI18n as I } from "../../../../i18n/I18n.js";
9
+ import "classnames";
11
10
  import { componentEvents as s } from "../../../../shared/constants.js";
12
- import { useComponentContext as Y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
13
- import { RadioGroupField as y } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
11
+ import { RadioGroupField as v } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
12
+ import { ActionsLayout as F } from "../../../Common/ActionsLayout/ActionsLayout.js";
13
+ import { useComponentDictionary as I, useI18n as Y } from "../../../../i18n/I18n.js";
14
+ import { useComponentContext as y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
15
  const L = m.object({ includeDeductions: m.enum(["Yes", "No"]) });
15
- function A(n) {
16
+ function G(n) {
16
17
  return /* @__PURE__ */ e(C, { ...n, children: /* @__PURE__ */ e(_, { ...n, children: n.children }) });
17
18
  }
18
19
  function _({ className: n, children: t, dictionary: u }) {
19
- const { onEvent: i } = b(), { t: o } = D("Employee.Deductions"), r = Y();
20
- F("Employee.Deductions", u), I("Employee.Deductions");
20
+ const { onEvent: i } = b(), { t: o } = D("Employee.Deductions"), r = y();
21
+ I("Employee.Deductions", u), Y("Employee.Deductions");
21
22
  const c = f({
22
23
  resolver: h(L),
23
24
  defaultValues: { includeDeductions: "No" }
@@ -27,7 +28,7 @@ function _({ className: n, children: t, dictionary: u }) {
27
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: [
28
29
  /* @__PURE__ */ e(r.Heading, { as: "h2", children: o("pageTitle") }),
29
30
  /* @__PURE__ */ e(
30
- y,
31
+ v,
31
32
  {
32
33
  name: "includeDeductions",
33
34
  isRequired: !0,
@@ -39,10 +40,10 @@ function _({ className: n, children: t, dictionary: u }) {
39
40
  ]
40
41
  }
41
42
  ),
42
- /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(r.Button, { type: "submit", children: o("continueCta") }) })
43
+ /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(r.Button, { type: "submit", children: o("continueCta") }) })
43
44
  ] }) }) }) });
44
45
  }
45
46
  export {
46
- A as IncludeDeductionsForm
47
+ G as IncludeDeductionsForm
47
48
  };
48
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","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,GAAU,YAAAC,KAA0C;AAC7E,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACd,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA;AAEnB,EAAAC,EAAuB,uBAAuBP,CAAU,GACxDQ,EAAQ,qBAAqB;AAE7B,QAAMC,IAAcC,EAAkC;AAAA,IACpD,UAAUC,EAAYpB,CAAuB;AAAA,IAC7C,eAAe,EAAE,mBAAmB,KAAA;AAAA,EAAK,CAC1C,GAEKqB,IAAoD,CAAAC,MAAQ;AAChE,IAAIA,EAAK,sBAAsB,QAC7BZ,EAAQa,EAAgB,8BAA8B,IAEtDb,EAAQa,EAAgB,6BAA6B;AAAA,EAEzD;AAEA,2BACG,WAAA,EAAQ,WAAAhB,GACP,UAAA,gBAAAH,EAACoB,GAAA,EAAc,GAAGN,GAChB,UAAA,gBAAAd,EAACqB,GAAA,EAAK,UAAUP,EAAY,aAAaG,CAAQ,GAC9C,UAAAb,KAGC,gBAAAkB,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAvB,EAACU,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,WAAW,GAAE;AAAA,IAC5C,gBAAAR;AAAA,MAACwB;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAOhB,EAAE,4BAA4B;AAAA,QACrC,aAAaA,EAAE,8BAA8B;AAAA,QAC7C,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,GAAU,YAAAC,KAA0C;AAC7E,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACd,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA;AAEnB,EAAAC,EAAuB,uBAAuBP,CAAU,GACxDQ,EAAQ,qBAAqB;AAE7B,QAAMC,IAAcC,EAAkC;AAAA,IACpD,UAAUC,EAAYpB,CAAuB;AAAA,IAC7C,eAAe,EAAE,mBAAmB,KAAA;AAAA,EAAK,CAC1C,GAEKqB,IAAoD,CAAAC,MAAQ;AAChE,IAAIA,EAAK,sBAAsB,QAC7BZ,EAAQa,EAAgB,8BAA8B,IAEtDb,EAAQa,EAAgB,6BAA6B;AAAA,EAEzD;AAEA,2BACG,WAAA,EAAQ,WAAAhB,GACP,UAAA,gBAAAH,EAACoB,GAAA,EAAc,GAAGN,GAChB,UAAA,gBAAAd,EAACqB,GAAA,EAAK,UAAUP,EAAY,aAAaG,CAAQ,GAC9C,UAAAb,KAGC,gBAAAkB,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAvB,EAACU,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,WAAW,GAAE;AAAA,IAC5C,gBAAAR;AAAA,MAACwB;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAOhB,EAAE,4BAA4B;AAAA,QACrC,aAAaA,EAAE,8BAA8B;AAAA,QAC7C,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,7 +1,7 @@
1
1
  export declare const deductionsStateMachine: {
2
- includeDeductions: import('robot3').MachineState<"employee/deductions/include/yes" | "employee/deductions/include/no">;
3
- viewDeductions: import('robot3').MachineState<"employee/deductions/add" | "employee/deductions/deleted" | "employee/deductions/done" | "employee/deductions/edit">;
4
- addDeduction: import('robot3').MachineState<"employee/deductions/created" | "employee/deductions/cancel">;
5
- editDeduction: import('robot3').MachineState<"employee/deductions/updated" | "employee/deductions/cancel">;
6
- done: import('robot3').MachineState<string>;
2
+ includeDeductions: import('robot3').MachineState<any>;
3
+ viewDeductions: import('robot3').MachineState<any>;
4
+ addDeduction: import('robot3').MachineState<any>;
5
+ editDeduction: import('robot3').MachineState<any>;
6
+ done: import('robot3').MachineState<any>;
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"stateMachine.js","sources":["../../../../src/components/Employee/Deductions/stateMachine.ts"],"sourcesContent":["import { state, transition, reduce, state as final } from 'robot3'\nimport type { DeductionsContextInterface, EventPayloads } from './DeductionsComponents'\nimport { DeductionsListContextual, DeductionFormContextual } from './DeductionsComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType } from '@/types/Helpers'\n\n// Helper function to create consistent reducers\nconst createReducer =\n (props: Partial<DeductionsContextInterface>) => (ctx: DeductionsContextInterface) => ({\n ...ctx,\n ...props,\n })\n\nexport const deductionsStateMachine = {\n includeDeductions: state(\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_YES,\n 'addDeduction',\n reduce(\n createReducer({\n component: DeductionFormContextual,\n currentDeductionId: null,\n }),\n ),\n ),\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_NO,\n 'done',\n reduce((ctx: DeductionsContextInterface) => {\n // Emit the completion event to notify parent onboarding flow\n ctx.onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n return ctx\n }),\n ),\n ),\n viewDeductions: state(\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_ADD,\n 'addDeduction',\n reduce(\n createReducer({\n component: DeductionFormContextual,\n currentDeductionId: null,\n }),\n ),\n ),\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_EDIT,\n 'editDeduction',\n reduce(\n (\n ctx: DeductionsContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.EMPLOYEE_DEDUCTION_EDIT>,\n ) => ({\n ...ctx,\n component: DeductionFormContextual,\n currentDeductionId: ev.payload.uuid,\n }),\n ),\n ),\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_DELETED,\n 'viewDeductions',\n reduce(\n createReducer({\n component: DeductionsListContextual,\n }),\n ),\n ),\n transition(componentEvents.EMPLOYEE_DEDUCTION_DONE, 'done'),\n ),\n addDeduction: state(\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_CREATED,\n 'viewDeductions',\n reduce(\n createReducer({\n component: DeductionsListContextual,\n currentDeductionId: null,\n }),\n ),\n ),\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_CANCEL,\n 'viewDeductions',\n reduce(\n createReducer({\n component: DeductionsListContextual,\n currentDeductionId: null,\n }),\n ),\n ),\n ),\n editDeduction: state(\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_UPDATED,\n 'viewDeductions',\n reduce(\n createReducer({\n component: DeductionsListContextual,\n currentDeductionId: null,\n }),\n ),\n ),\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_CANCEL,\n 'viewDeductions',\n reduce(\n createReducer({\n component: DeductionsListContextual,\n currentDeductionId: null,\n }),\n ),\n ),\n ),\n done: final(),\n}\n"],"names":["createReducer","props","ctx","deductionsStateMachine","state","transition","componentEvents","reduce","DeductionFormContextual","ev","DeductionsListContextual","final"],"mappings":";;;AAOA,MAAMA,IACJ,CAACC,MAA+C,CAACC,OAAqC;AAAA,EACpF,GAAGA;AAAA,EACH,GAAGD;AACL,IAEWE,IAAyB;AAAA,EACpC,mBAAmBC;AAAA,IACjBC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWQ;AAAA,UACX,oBAAoB;AAAA,QAAA,CACrB;AAAA,MAAA;AAAA,IACH;AAAA,IAEFH;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACL,OAENA,EAAI,QAAQI,EAAgB,uBAAuB,GAC5CJ,EACR;AAAA,IAAA;AAAA,EACH;AAAA,EAEF,gBAAgBE;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWQ;AAAA,UACX,oBAAoB;AAAA,QAAA,CACrB;AAAA,MAAA;AAAA,IACH;AAAA,IAEFH;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEL,GACAO,OACI;AAAA,UACJ,GAAGP;AAAA,UACH,WAAWM;AAAA,UACX,oBAAoBC,EAAG,QAAQ;AAAA,QAAA;AAAA,MACjC;AAAA,IACF;AAAA,IAEFJ;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWU;AAAA,QAAA,CACZ;AAAA,MAAA;AAAA,IACH;AAAA,IAEFL,EAAWC,EAAgB,yBAAyB,MAAM;AAAA,EAAA;AAAA,EAE5D,cAAcF;AAAA,IACZC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWU;AAAA,UACX,oBAAoB;AAAA,QAAA,CACrB;AAAA,MAAA;AAAA,IACH;AAAA,IAEFL;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWU;AAAA,UACX,oBAAoB;AAAA,QAAA,CACrB;AAAA,MAAA;AAAA,IACH;AAAA,EACF;AAAA,EAEF,eAAeN;AAAA,IACbC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWU;AAAA,UACX,oBAAoB;AAAA,QAAA,CACrB;AAAA,MAAA;AAAA,IACH;AAAA,IAEFL;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWU;AAAA,UACX,oBAAoB;AAAA,QAAA,CACrB;AAAA,MAAA;AAAA,IACH;AAAA,EACF;AAAA,EAEF,MAAMC,EAAA;AACR;"}
1
+ {"version":3,"file":"stateMachine.js","sources":["../../../../src/components/Employee/Deductions/stateMachine.ts"],"sourcesContent":["import { state, transition, reduce, state as final } from 'robot3'\nimport type { DeductionsContextInterface, EventPayloads } from './DeductionsComponents'\nimport { DeductionsListContextual, DeductionFormContextual } from './DeductionsComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\n// Helper function to create consistent reducers\nconst createReducer =\n (props: Partial<DeductionsContextInterface>) => (ctx: DeductionsContextInterface) => ({\n ...ctx,\n ...props,\n })\n\nexport const deductionsStateMachine = {\n includeDeductions: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_YES,\n 'addDeduction',\n reduce(\n createReducer({\n component: DeductionFormContextual,\n currentDeductionId: null,\n }),\n ),\n ),\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_NO,\n 'done',\n reduce((ctx: DeductionsContextInterface) => {\n // Emit the completion event to notify parent onboarding flow\n ctx.onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n return ctx\n }),\n ),\n ),\n viewDeductions: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_ADD,\n 'addDeduction',\n reduce(\n createReducer({\n component: DeductionFormContextual,\n currentDeductionId: null,\n }),\n ),\n ),\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_EDIT,\n 'editDeduction',\n reduce(\n (\n ctx: DeductionsContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.EMPLOYEE_DEDUCTION_EDIT>,\n ) => ({\n ...ctx,\n component: DeductionFormContextual,\n currentDeductionId: ev.payload.uuid,\n }),\n ),\n ),\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_DELETED,\n 'viewDeductions',\n reduce(\n createReducer({\n component: DeductionsListContextual,\n }),\n ),\n ),\n transition(componentEvents.EMPLOYEE_DEDUCTION_DONE, 'done'),\n ),\n addDeduction: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_CREATED,\n 'viewDeductions',\n reduce(\n createReducer({\n component: DeductionsListContextual,\n currentDeductionId: null,\n }),\n ),\n ),\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_CANCEL,\n 'viewDeductions',\n reduce(\n createReducer({\n component: DeductionsListContextual,\n currentDeductionId: null,\n }),\n ),\n ),\n ),\n editDeduction: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_UPDATED,\n 'viewDeductions',\n reduce(\n createReducer({\n component: DeductionsListContextual,\n currentDeductionId: null,\n }),\n ),\n ),\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_CANCEL,\n 'viewDeductions',\n reduce(\n createReducer({\n component: DeductionsListContextual,\n currentDeductionId: null,\n }),\n ),\n ),\n ),\n done: final(),\n}\n"],"names":["createReducer","props","ctx","deductionsStateMachine","state","transition","componentEvents","reduce","DeductionFormContextual","ev","DeductionsListContextual","final"],"mappings":";;;AAOA,MAAMA,IACJ,CAACC,MAA+C,CAACC,OAAqC;AAAA,EACpF,GAAGA;AAAA,EACH,GAAGD;AACL,IAEWE,IAAyB;AAAA,EACpC,mBAAmBC;AAAA,IACjBC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWQ;AAAA,UACX,oBAAoB;AAAA,QAAA,CACrB;AAAA,MAAA;AAAA,IACH;AAAA,IAEFH;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACL,OAENA,EAAI,QAAQI,EAAgB,uBAAuB,GAC5CJ,EACR;AAAA,IAAA;AAAA,EACH;AAAA,EAEF,gBAAgBE;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWQ;AAAA,UACX,oBAAoB;AAAA,QAAA,CACrB;AAAA,MAAA;AAAA,IACH;AAAA,IAEFH;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEL,GACAO,OACI;AAAA,UACJ,GAAGP;AAAA,UACH,WAAWM;AAAA,UACX,oBAAoBC,EAAG,QAAQ;AAAA,QAAA;AAAA,MACjC;AAAA,IACF;AAAA,IAEFJ;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWU;AAAA,QAAA,CACZ;AAAA,MAAA;AAAA,IACH;AAAA,IAEFL,EAAWC,EAAgB,yBAAyB,MAAM;AAAA,EAAA;AAAA,EAE5D,cAAcF;AAAA,IACZC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWU;AAAA,UACX,oBAAoB;AAAA,QAAA,CACrB;AAAA,MAAA;AAAA,IACH;AAAA,IAEFL;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWU;AAAA,UACX,oBAAoB;AAAA,QAAA,CACrB;AAAA,MAAA;AAAA,IACH;AAAA,EACF;AAAA,EAEF,eAAeN;AAAA,IACbC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWU;AAAA,UACX,oBAAoB;AAAA,QAAA,CACrB;AAAA,MAAA;AAAA,IACH;AAAA,IAEFL;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWU;AAAA,UACX,oBAAoB;AAAA,QAAA,CACrB;AAAA,MAAA;AAAA,IACH;AAAA,EACF;AAAA,EAEF,MAAMC,EAAA;AACR;"}
@@ -1,13 +1,15 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { useTranslation as r } from "react-i18next";
3
- import { useDocumentList as s } from "./useDocumentList.js";
4
- import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
3
+ import { useDocumentList as m } from "./useDocumentList.js";
4
+ import "classnames";
5
+ import "../../../../shared/constants.js";
6
+ import { ActionsLayout as s } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
7
  import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- function d() {
7
- const { t: n } = r("Employee.DocumentSigner"), { handleContinue: t, hasSignedAllForms: e } = s(), i = c();
8
- return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(i.Button, { onClick: t, isLoading: !1, isDisabled: !e, children: n("continueCta") }) });
8
+ function h() {
9
+ const { t } = r("Employee.DocumentSigner"), { handleContinue: n, hasSignedAllForms: i } = m(), e = c();
10
+ return /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(e.Button, { onClick: n, isLoading: !1, isDisabled: !i, children: t("continueCta") }) });
9
11
  }
10
12
  export {
11
- d as Actions
13
+ h as Actions
12
14
  };
13
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","t","useTranslation","handleContinue","hasSignedAllForms","useDocumentList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,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,UAAAH,EAAE,aAAa,GAClB,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.DocumentSigner')\n const { handleContinue, hasSignedAllForms } = useDocumentList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button onClick={handleContinue} isLoading={false} isDisabled={!hasSignedAllForms}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleContinue","hasSignedAllForms","useDocumentList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,gBAAAC,GAAgB,mBAAAC,EAAA,IAAsBC,EAAA,GACxCC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAASH,GAAgB,WAAW,IAAO,YAAY,CAACC,GACxE,UAAA,EAAE,aAAa,GAClB,GACF;AAEJ;"}
@@ -1,4 +1,4 @@
1
- import { jsx as o, jsxs as p } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as l } from "react/jsx-runtime";
2
2
  import { useEmployeeFormsListSuspense as f } from "@gusto/embedded-api/react-query/employeeFormsList";
3
3
  import { Head as d } from "./Head.js";
4
4
  import { List as E } from "./List.js";
@@ -9,18 +9,19 @@ import { useBase as L } from "../../../Base/useBase.js";
9
9
  import { useI18n as S } from "../../../../i18n/I18n.js";
10
10
  import { componentEvents as m } from "../../../../shared/constants.js";
11
11
  import { Flex as g } from "../../../Common/Flex/Flex.js";
12
- function A(e) {
12
+ import "classnames";
13
+ function B(e) {
13
14
  return /* @__PURE__ */ o(F, { ...e, children: /* @__PURE__ */ o(O, { ...e }) });
14
15
  }
15
16
  function O({ employeeId: e, className: s, children: n }) {
16
17
  S("Employee.DocumentSigner");
17
- const { onEvent: t } = L(), { data: u, error: c } = f({ employeeId: e }), i = u.formList, l = i.every((r) => !r.requiresSigning);
18
+ const { onEvent: t } = L(), { data: u, error: c } = f({ employeeId: e }), i = u.formList, p = i.every((r) => !r.requiresSigning);
18
19
  return /* @__PURE__ */ o("section", { className: s, children: /* @__PURE__ */ o(
19
20
  h,
20
21
  {
21
22
  value: {
22
23
  employeeForms: i,
23
- hasSignedAllForms: l,
24
+ hasSignedAllForms: p,
24
25
  handleContinue: () => {
25
26
  t(m.EMPLOYEE_FORMS_DONE);
26
27
  },
@@ -29,7 +30,7 @@ function O({ employeeId: e, className: s, children: n }) {
29
30
  },
30
31
  documentListError: c
31
32
  },
32
- children: n || /* @__PURE__ */ p(g, { flexDirection: "column", children: [
33
+ children: n || /* @__PURE__ */ l(g, { flexDirection: "column", children: [
33
34
  /* @__PURE__ */ o(d, {}),
34
35
  /* @__PURE__ */ o(E, {}),
35
36
  /* @__PURE__ */ o(a, {})
@@ -38,6 +39,6 @@ function O({ employeeId: e, className: s, children: n }) {
38
39
  ) });
39
40
  }
40
41
  export {
41
- A as DocumentList
42
+ B as DocumentList
42
43
  };
43
44
  //# 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;"}
@@ -2,8 +2,10 @@ import { jsx as o } from "react/jsx-runtime";
2
2
  import { useTranslation as m } from "react-i18next";
3
3
  import { useDocumentList as s } from "./useDocumentList.js";
4
4
  import { Flex as l } from "../../../Common/Flex/Flex.js";
5
+ import "classnames";
6
+ import "../../../../shared/constants.js";
5
7
  import { DocumentList as u } from "../../../Common/DocumentList/DocumentList.js";
6
- function L() {
8
+ function f() {
7
9
  const { employeeForms: i, handleRequestFormToSign: n, documentListError: r } = s(), { t: e } = m("Employee.DocumentSigner");
8
10
  return /* @__PURE__ */ o("section", { style: { width: "100%" }, children: /* @__PURE__ */ o(l, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(
9
11
  u,
@@ -32,6 +34,6 @@ function L() {
32
34
  ) }) });
33
35
  }
34
36
  export {
35
- L as List
37
+ f as List
36
38
  };
37
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;"}
@@ -8,12 +8,14 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
8
  import "@tanstack/react-query";
9
9
  import "../../../Base/useBase.js";
10
10
  import "../../../../shared/constants.js";
11
+ import "classnames";
11
12
  import "dompurify";
13
+ import "../../../../contexts/LocaleProvider/useLocale.js";
12
14
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
13
15
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
14
- const [L, d] = t("DocumentListContext");
16
+ const [a, f] = t("DocumentListContext");
15
17
  export {
16
- d as DocumentListProvider,
17
- L as useDocumentList
18
+ f as DocumentListProvider,
19
+ a as useDocumentList
18
20
  };
19
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;"}
@@ -1,21 +1,25 @@
1
- import { jsx as r } from "react/jsx-runtime";
1
+ import { jsx as n } from "react/jsx-runtime";
2
2
  import { createMachine as i } from "robot3";
3
- import { DocumentListContextual as c } from "./documentSignerStateMachine.js";
4
- import { documentSignerMachine as p } from "./stateMachine.js";
5
- import { Flow as u } from "../../Flow/Flow.js";
3
+ import { useMemo as c } from "react";
4
+ import { DocumentListContextual as p } from "./documentSignerStateMachine.js";
5
+ import { documentSignerMachine as u } from "./stateMachine.js";
6
+ import { Flow as f } from "../../Flow/Flow.js";
6
7
  import { useComponentDictionary as a } from "../../../i18n/I18n.js";
7
- const d = ({ employeeId: o, onEvent: e, dictionary: n }) => {
8
- a("Employee.DocumentSigner", n);
9
- const t = i(
10
- "index",
11
- p,
12
- (m) => ({
13
- ...m,
14
- component: c,
15
- employeeId: o
16
- })
8
+ const d = ({ employeeId: o, onEvent: m, dictionary: r }) => {
9
+ a("Employee.DocumentSigner", r);
10
+ const t = c(
11
+ () => i(
12
+ "index",
13
+ u,
14
+ (e) => ({
15
+ ...e,
16
+ component: p,
17
+ employeeId: o
18
+ })
19
+ ),
20
+ [o]
17
21
  );
18
- return /* @__PURE__ */ r(u, { machine: t, onEvent: e });
22
+ return /* @__PURE__ */ n(f, { machine: t, onEvent: m });
19
23
  };
20
24
  export {
21
25
  d as DocumentSigner
@@ -1 +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 { 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"],"names":["DocumentSigner","employeeId","onEvent","dictionary","useComponentDictionary","documentSigner","createMachine","documentSignerMachine","initialContext","DocumentListContextual","jsx","Flow"],"mappings":";;;;;;AAcO,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,IAAA;AAAA,EACF;AAEF,SAAO,gBAAAS,EAACC,GAAA,EAAK,SAASN,GAAgB,SAAAH,EAAA,CAAkB;AAC1D;"}
1
+ {"version":3,"file":"DocumentSigner.js","sources":["../../../../src/components/Employee/DocumentSigner/DocumentSigner.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport {\n DocumentListContextual,\n type DocumentSignerContextInterface,\n} from './documentSignerStateMachine'\nimport { documentSignerMachine } from './stateMachine'\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 = useMemo(\n () =>\n createMachine(\n 'index',\n documentSignerMachine,\n (initialContext: DocumentSignerContextInterface) => ({\n ...initialContext,\n component: DocumentListContextual,\n employeeId,\n }),\n ),\n [employeeId],\n )\n return <Flow machine={documentSigner} onEvent={onEvent} />\n}\n"],"names":["DocumentSigner","employeeId","onEvent","dictionary","useComponentDictionary","documentSigner","useMemo","createMachine","documentSignerMachine","initialContext","DocumentListContextual","jsx","Flow"],"mappings":";;;;;;;AAeO,MAAMA,IAAiB,CAAC,EAAE,YAAAC,GAAY,SAAAC,GAAS,YAAAC,QAAsC;AAC1F,EAAAC,EAAuB,2BAA2BD,CAAU;AAE5D,QAAME,IAAiBC;AAAA,IACrB,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,CAACC,OAAoD;AAAA,QACnD,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,YAAAT;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACA,CAAU;AAAA,EAAA;AAEb,SAAO,gBAAAU,EAACC,GAAA,EAAK,SAASP,GAAgB,SAAAH,EAAA,CAAkB;AAC1D;"}