@gusto/embedded-react-sdk 0.11.1 → 0.11.3

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 (511) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/assets/icons/alert-circle.svg.js.map +1 -1
  3. package/dist/assets/icons/caret-down.svg.js +1 -1
  4. package/dist/assets/icons/caret-down.svg.js.map +1 -1
  5. package/dist/assets/icons/caret-left.svg.js.map +1 -1
  6. package/dist/assets/icons/caret-right.svg.js.map +1 -1
  7. package/dist/assets/icons/checkbox.svg.js.map +1 -1
  8. package/dist/assets/icons/error.svg.js.map +1 -1
  9. package/dist/assets/icons/hamburger.svg.js.map +1 -1
  10. package/dist/assets/icons/info.svg.js.map +1 -1
  11. package/dist/assets/icons/list.svg.js.map +1 -1
  12. package/dist/assets/icons/magnifyingGlass.png.js.map +1 -1
  13. package/dist/assets/icons/pagination_next.svg.js.map +1 -1
  14. package/dist/assets/icons/pagination_previous.svg.js.map +1 -1
  15. package/dist/assets/icons/pencil.svg.js.map +1 -1
  16. package/dist/assets/icons/success_check.svg.js.map +1 -1
  17. package/dist/assets/icons/trashcan.svg.js.map +1 -1
  18. package/dist/assets/icons/unchecked_circular.svg.js.map +1 -1
  19. package/dist/assets/icons/verification_pending.svg.js.map +1 -1
  20. package/dist/assets/icons/warning.svg.js.map +1 -1
  21. package/dist/components/Base/Base.js +19 -18
  22. package/dist/components/Base/Base.js.map +1 -1
  23. package/dist/components/Base/createCompoundContext.js.map +1 -1
  24. package/dist/components/Base/useBase.js.map +1 -1
  25. package/dist/components/Common/ActionsLayout/ActionsLayout.js.map +1 -1
  26. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  27. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  28. package/dist/components/Common/DataView/DataView.js.map +1 -1
  29. package/dist/components/Common/DataView/useDataView.js.map +1 -1
  30. package/dist/components/Common/DocumentList/DocumentList.js.map +1 -1
  31. package/dist/components/Common/DocumentViewer/DocumentViewer.js.map +1 -1
  32. package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
  33. package/dist/components/Common/FadeIn/FadeIn.js.map +1 -1
  34. package/dist/components/Common/FieldCaption/FieldCaption.js +7 -4
  35. package/dist/components/Common/FieldCaption/FieldCaption.js.map +1 -1
  36. package/dist/components/Common/FieldCaption/FieldCaption.module.scss.js +1 -1
  37. package/dist/components/Common/FieldDescription/FieldDescription.js.map +1 -1
  38. package/dist/components/Common/FieldDescription/FieldDescription.module.scss.js +1 -1
  39. package/dist/components/Common/FieldErrorMessage/FieldErrorMessage.js.map +1 -1
  40. package/dist/components/Common/FieldErrorMessage/FieldErrorMessage.module.scss.js +1 -1
  41. package/dist/components/Common/FieldLayout/FieldLayout.js.map +1 -1
  42. package/dist/components/Common/FieldLayout/FieldLayout.module.scss.js +11 -11
  43. package/dist/components/Common/Fields/CheckboxField/CheckboxField.js.map +1 -1
  44. package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.js.map +1 -1
  45. package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js.map +1 -1
  46. package/dist/components/Common/Fields/DatePickerField/DatePickerField.d.ts +1 -0
  47. package/dist/components/Common/Fields/DatePickerField/DatePickerField.js +35 -20
  48. package/dist/components/Common/Fields/DatePickerField/DatePickerField.js.map +1 -1
  49. package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
  50. package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js.map +1 -1
  51. package/dist/components/Common/Fields/SelectField/SelectField.js.map +1 -1
  52. package/dist/components/Common/Fields/SwitchField/SwitchField.js.map +1 -1
  53. package/dist/components/Common/Fields/TextInputField/TextInputField.js.map +1 -1
  54. package/dist/components/Common/Fields/hooks/useField.js.map +1 -1
  55. package/dist/components/Common/Fields/hooks/useStringifyGenericFieldValue.js.map +1 -1
  56. package/dist/components/Common/Fieldset/Fieldset.js.map +1 -1
  57. package/dist/components/Common/Flex/Flex.js.map +1 -1
  58. package/dist/components/Common/Form/Form.js.map +1 -1
  59. package/dist/components/Common/Grid/Grid.js.map +1 -1
  60. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
  61. package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.js.map +1 -1
  62. package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.module.scss.js +1 -1
  63. package/dist/components/Common/InternalError/InternalError.js.map +1 -1
  64. package/dist/components/Common/Loading/Loading.js.map +1 -1
  65. package/dist/components/Common/OnboardingStatusBadge/index.js.map +1 -1
  66. package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
  67. package/dist/components/Common/ReorderableList/DropZone.js.map +1 -1
  68. package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
  69. package/dist/components/Common/ReorderableList/ReorderableList.js.map +1 -1
  70. package/dist/components/Common/RequirementsList/RequirementsList.js.map +1 -1
  71. package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
  72. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  73. package/dist/components/Common/SignatureForm/SignatureFormActions.js +12 -10
  74. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  75. package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -6
  76. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  77. package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
  78. package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
  79. package/dist/components/Common/UI/Alert/Alert.module.scss.js +1 -1
  80. package/dist/components/Common/UI/Badge/Badge.js +4 -4
  81. package/dist/components/Common/UI/Badge/Badge.js.map +1 -1
  82. package/dist/components/Common/UI/Badge/Badge.module.scss.js +4 -4
  83. package/dist/components/Common/UI/Button/Button.d.ts +1 -1
  84. package/dist/components/Common/UI/Button/Button.js +22 -24
  85. package/dist/components/Common/UI/Button/Button.js.map +1 -1
  86. package/dist/components/Common/UI/Button/Button.module.scss.js +1 -1
  87. package/dist/components/Common/UI/Button/ButtonIcon.d.ts +1 -1
  88. package/dist/components/Common/UI/Button/ButtonIcon.js +7 -5
  89. package/dist/components/Common/UI/Button/ButtonIcon.js.map +1 -1
  90. package/dist/components/Common/UI/Button/ButtonIcon.module.scss.js +8 -0
  91. package/dist/components/Common/UI/Button/ButtonIcon.module.scss.js.map +1 -0
  92. package/dist/components/Common/UI/Button/ButtonTypes.d.ts +2 -6
  93. package/dist/components/Common/UI/CalendarPreview/CalendarLegend.js.map +1 -1
  94. package/dist/components/Common/UI/CalendarPreview/CalendarPreview.js.map +1 -1
  95. package/dist/components/Common/UI/Card/Card.js.map +1 -1
  96. package/dist/components/Common/UI/Checkbox/Checkbox.js.map +1 -1
  97. package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js +8 -8
  98. package/dist/components/Common/UI/CheckboxGroup/CheckboxGroup.js.map +1 -1
  99. package/dist/components/Common/UI/CheckboxGroup/CheckboxGroup.module.scss.js +1 -1
  100. package/dist/components/Common/UI/ComboBox/ComboBox.js +36 -36
  101. package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
  102. package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +1 -1
  103. package/dist/components/Common/UI/DatePicker/DatePicker.js.map +1 -1
  104. package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +8 -8
  105. package/dist/components/Common/UI/Heading/Heading.js.map +1 -1
  106. package/dist/components/Common/UI/Heading/Heading.module.scss.js +11 -11
  107. package/dist/components/Common/UI/Input/Input.js.map +1 -1
  108. package/dist/components/Common/UI/Input/Input.module.scss.js +10 -10
  109. package/dist/components/Common/UI/Link/Link.js.map +1 -1
  110. package/dist/components/Common/UI/List/OrderedList.js.map +1 -1
  111. package/dist/components/Common/UI/List/UnorderedList.js.map +1 -1
  112. package/dist/components/Common/UI/Menu/Menu.js.map +1 -1
  113. package/dist/components/Common/UI/NumberInput/NumberInput.js.map +1 -1
  114. package/dist/components/Common/UI/ProgressBar/ProgressBar.js.map +1 -1
  115. package/dist/components/Common/UI/Radio/Radio.js.map +1 -1
  116. package/dist/components/Common/UI/Radio/Radio.module.scss.js +1 -1
  117. package/dist/components/Common/UI/RadioGroup/RadioGroup.js.map +1 -1
  118. package/dist/components/Common/UI/RadioGroup/RadioGroup.module.scss.js +1 -1
  119. package/dist/components/Common/UI/Select/Select.js +13 -13
  120. package/dist/components/Common/UI/Select/Select.js.map +1 -1
  121. package/dist/components/Common/UI/Select/Select.module.scss.js +1 -1
  122. package/dist/components/Common/UI/Switch/Switch.js.map +1 -1
  123. package/dist/components/Common/UI/Table/Table.js.map +1 -1
  124. package/dist/components/Common/UI/Text/Text.js.map +1 -1
  125. package/dist/components/Common/UI/Text/Text.module.scss.js +16 -20
  126. package/dist/components/Common/UI/Text/Text.module.scss.js.map +1 -1
  127. package/dist/components/Common/UI/Text/TextTypes.d.ts +1 -1
  128. package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
  129. package/dist/components/Common/UI/hooks/useFieldIds.js.map +1 -1
  130. package/dist/components/Common/VisuallyHidden/VisuallyHidden.js.map +1 -1
  131. package/dist/components/Common/hooks/useAsyncError.js.map +1 -1
  132. package/dist/components/Common/hooks/useMenu.js.map +1 -1
  133. package/dist/components/Common/hooks/useNumberFormatter.js.map +1 -1
  134. package/dist/components/Company/AssignSignatory/AssignSignatory.js +3 -2
  135. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  136. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +8 -6
  137. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  138. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +10 -8
  139. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  140. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  141. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
  142. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  143. package/dist/components/Company/AssignSignatory/CreateSignatory/Schema.js.map +1 -1
  144. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +1 -1
  145. package/dist/components/Company/AssignSignatory/Head.js.map +1 -1
  146. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +8 -6
  147. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  148. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  149. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  150. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  151. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +1 -1
  152. package/dist/components/Company/AssignSignatory/SignatoryForm.js.map +1 -1
  153. package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
  154. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  155. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +1 -1
  156. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  157. package/dist/components/Company/BankAccount/BankAccountComponents.js.map +1 -1
  158. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
  159. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  160. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  161. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +11 -9
  162. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  163. package/dist/components/Company/BankAccount/BankAccountForm/Head.js.map +1 -1
  164. package/dist/components/Company/BankAccount/BankAccountForm/context.js +1 -1
  165. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js.map +1 -1
  166. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +12 -10
  167. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  168. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
  169. package/dist/components/Company/BankAccount/BankAccountList/Head.js.map +1 -1
  170. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +13 -11
  171. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  172. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
  173. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -4
  174. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  175. package/dist/components/Company/BankAccount/BankAccountVerify/Head.js.map +1 -1
  176. package/dist/components/Company/BankAccount/stateMachine.js.map +1 -1
  177. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +7 -5
  178. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  179. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +7 -6
  180. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  181. package/dist/components/Company/DocumentSigner/DocumentList/Head.js.map +1 -1
  182. package/dist/components/Company/DocumentSigner/DocumentList/List.js.map +1 -1
  183. package/dist/components/Company/DocumentSigner/DocumentList/ManageSignatories.js.map +1 -1
  184. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  185. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  186. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  187. package/dist/components/Company/DocumentSigner/SignatureForm/Actions.js.map +1 -1
  188. package/dist/components/Company/DocumentSigner/SignatureForm/Form.js.map +1 -1
  189. package/dist/components/Company/DocumentSigner/SignatureForm/Head.js.map +1 -1
  190. package/dist/components/Company/DocumentSigner/SignatureForm/Preview.js.map +1 -1
  191. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
  192. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  193. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  194. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  195. package/dist/components/Company/DocumentSigner/assignSignatoryState.js.map +1 -1
  196. package/dist/components/Company/DocumentSigner/documentSignerStateMachine.js.map +1 -1
  197. package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -1
  198. package/dist/components/Company/FederalTaxes/Actions.js +9 -7
  199. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  200. package/dist/components/Company/FederalTaxes/FederalTaxes.js +7 -6
  201. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  202. package/dist/components/Company/FederalTaxes/Form.js +5 -3
  203. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  204. package/dist/components/Company/FederalTaxes/Head.js.map +1 -1
  205. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +1 -1
  206. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  207. package/dist/components/Company/Industry/Actions.js +7 -5
  208. package/dist/components/Company/Industry/Actions.js.map +1 -1
  209. package/dist/components/Company/Industry/Context.js +1 -1
  210. package/dist/components/Company/Industry/Edit.js +12 -10
  211. package/dist/components/Company/Industry/Edit.js.map +1 -1
  212. package/dist/components/Company/Industry/Head.js.map +1 -1
  213. package/dist/components/Company/Industry/Industry.js.map +1 -1
  214. package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
  215. package/dist/components/Company/Locations/LocationForm/Actions.js +8 -6
  216. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  217. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  218. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  219. package/dist/components/Company/Locations/LocationForm/Head.js.map +1 -1
  220. package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -3
  221. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  222. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +1 -1
  223. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  224. package/dist/components/Company/Locations/Locations.js.map +1 -1
  225. package/dist/components/Company/Locations/LocationsList/Actions.js +8 -6
  226. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  227. package/dist/components/Company/Locations/LocationsList/Head.js.map +1 -1
  228. package/dist/components/Company/Locations/LocationsList/List.js +4 -2
  229. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  230. package/dist/components/Company/Locations/LocationsList/LocationsList.js +9 -8
  231. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  232. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +1 -1
  233. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  234. package/dist/components/Company/Locations/locationsStateMachine.js.map +1 -1
  235. package/dist/components/Company/Locations/stateMachine.js.map +1 -1
  236. package/dist/components/Company/OnboardingFlow/OnboardingFlow.js.map +1 -1
  237. package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
  238. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  239. package/dist/components/Company/OnboardingOverview/Completed.js +14 -12
  240. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  241. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +8 -6
  242. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  243. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +3 -2
  244. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  245. package/dist/components/Company/OnboardingOverview/context.js +1 -1
  246. package/dist/components/Company/PaySchedule/PaySchedule.js +33 -31
  247. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  248. package/dist/components/Company/PaySchedule/_parts/Actions.js +12 -10
  249. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  250. package/dist/components/Company/PaySchedule/_parts/Edit.js +51 -52
  251. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  252. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -6
  253. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  254. package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
  255. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  256. package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +0 -3
  257. package/dist/components/Company/PaySchedule/usePaySchedule.js +8 -9
  258. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  259. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  260. package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -1
  261. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +7 -5
  262. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  263. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
  264. package/dist/components/Company/StateTaxes/StateTaxesForm/Head.js.map +1 -1
  265. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  266. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +1 -1
  267. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +8 -6
  268. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  269. package/dist/components/Company/StateTaxes/StateTaxesList/Head.js.map +1 -1
  270. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +7 -5
  271. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  272. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  273. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +1 -1
  274. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
  275. package/dist/components/Contractor/Address/Actions.js.map +1 -1
  276. package/dist/components/Contractor/Address/Address.js +5 -4
  277. package/dist/components/Contractor/Address/Address.js.map +1 -1
  278. package/dist/components/Contractor/Address/Form.js +1 -1
  279. package/dist/components/Contractor/Address/Form.js.map +1 -1
  280. package/dist/components/Contractor/Address/Head.js.map +1 -1
  281. package/dist/components/Contractor/Address/useAddress.js +1 -1
  282. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  283. package/dist/components/Contractor/List/index.js.map +1 -1
  284. package/dist/components/Contractor/List/useContractorList.js.map +1 -1
  285. package/dist/components/Contractor/NewHireReport/NewHireReport.js +17 -16
  286. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  287. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +7 -5
  288. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  289. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  290. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  291. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
  292. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  293. package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -1
  294. package/dist/components/Contractor/Profile/ContractorProfileForm.js +10 -10
  295. package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -1
  296. package/dist/components/Contractor/Profile/useContractorProfile.js +1 -1
  297. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  298. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js.map +1 -1
  299. package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -1
  300. package/dist/components/Contractor/Submit/index.js +11 -9
  301. package/dist/components/Contractor/Submit/index.js.map +1 -1
  302. package/dist/components/Employee/Compensation/Actions.js +6 -5
  303. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  304. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  305. package/dist/components/Employee/Compensation/Edit.js +15 -14
  306. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  307. package/dist/components/Employee/Compensation/Head.js.map +1 -1
  308. package/dist/components/Employee/Compensation/List.js +25 -23
  309. package/dist/components/Employee/Compensation/List.js.map +1 -1
  310. package/dist/components/Employee/Compensation/useCompensation.js.map +1 -1
  311. package/dist/components/Employee/Deductions/Actions.js +12 -10
  312. package/dist/components/Employee/Deductions/Actions.js.map +1 -1
  313. package/dist/components/Employee/Deductions/DeductionForm.js +12 -10
  314. package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
  315. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  316. package/dist/components/Employee/Deductions/DeductionsList.js +7 -5
  317. package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
  318. package/dist/components/Employee/Deductions/Head.js.map +1 -1
  319. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +9 -7
  320. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
  321. package/dist/components/Employee/Deductions/useDeductions.js +1 -1
  322. package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
  323. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +8 -6
  324. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  325. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +7 -6
  326. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  327. package/dist/components/Employee/DocumentSigner/DocumentList/Head.js.map +1 -1
  328. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
  329. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  330. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  331. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  332. package/dist/components/Employee/DocumentSigner/SignatureForm/Actions.js.map +1 -1
  333. package/dist/components/Employee/DocumentSigner/SignatureForm/Form.js.map +1 -1
  334. package/dist/components/Employee/DocumentSigner/SignatureForm/Head.js.map +1 -1
  335. package/dist/components/Employee/DocumentSigner/SignatureForm/Preview.js.map +1 -1
  336. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +8 -7
  337. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  338. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  339. package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.js.map +1 -1
  340. package/dist/components/Employee/DocumentSigner/stateMachine.js.map +1 -1
  341. package/dist/components/Employee/EmployeeList/Actions.js +6 -4
  342. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  343. package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
  344. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  345. package/dist/components/Employee/EmployeeList/Head.js +7 -5
  346. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  347. package/dist/components/Employee/EmployeeList/List.js +15 -14
  348. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  349. package/dist/components/Employee/EmployeeList/useEmployeeList.js +1 -1
  350. package/dist/components/Employee/Landing/Landing.js +13 -12
  351. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  352. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
  353. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  354. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  355. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
  356. package/dist/components/Employee/PaymentMethod/Actions.js +9 -7
  357. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  358. package/dist/components/Employee/PaymentMethod/BankAccount.js.map +1 -1
  359. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +6 -5
  360. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  361. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +10 -8
  362. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  363. package/dist/components/Employee/PaymentMethod/Head.js.map +1 -1
  364. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  365. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +3 -2
  366. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  367. package/dist/components/Employee/PaymentMethod/Split.js +11 -10
  368. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  369. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +1 -1
  370. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  371. package/dist/components/Employee/Profile/Actions.js +9 -7
  372. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  373. package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -9
  374. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  375. package/dist/components/Employee/Profile/Head.js.map +1 -1
  376. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  377. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  378. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  379. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  380. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  381. package/dist/components/Employee/Profile/SelfPersonalDetails.js.map +1 -1
  382. package/dist/components/Employee/Profile/WorkAddress.js.map +1 -1
  383. package/dist/components/Employee/Profile/getEmployeeAddressForProfile.js.map +1 -1
  384. package/dist/components/Employee/Profile/useProfile.js +1 -1
  385. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
  386. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -1
  387. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
  388. package/dist/components/Employee/Taxes/Actions.js +10 -8
  389. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  390. package/dist/components/Employee/Taxes/FederalForm.js +14 -12
  391. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  392. package/dist/components/Employee/Taxes/FederalHead.js.map +1 -1
  393. package/dist/components/Employee/Taxes/StateForm.js.map +1 -1
  394. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  395. package/dist/components/Employee/Taxes/useTaxes.js +1 -1
  396. package/dist/components/Flow/Flow.js.map +1 -1
  397. package/dist/components/Flow/useFlow.js.map +1 -1
  398. package/dist/contexts/ApiProvider/ApiProvider.d.ts +5 -2
  399. package/dist/contexts/ApiProvider/ApiProvider.js +34 -30
  400. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  401. package/dist/contexts/ComponentAdapter/ComponentsProvider.js.map +1 -1
  402. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  403. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  404. package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
  405. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +3 -1
  406. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +16 -14
  407. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  408. package/dist/contexts/GustoProvider/SDKI18next.js.map +1 -1
  409. package/dist/contexts/GustoProvider/index.d.ts +2 -0
  410. package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.js.map +1 -1
  411. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js.map +1 -1
  412. package/dist/contexts/LocaleProvider/LocaleProvider.js.map +1 -1
  413. package/dist/contexts/LocaleProvider/useLocale.js.map +1 -1
  414. package/dist/contexts/ThemeProvider/ThemeProvider.d.ts +4 -1
  415. package/dist/contexts/ThemeProvider/ThemeProvider.js +60 -22
  416. package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
  417. package/dist/contexts/ThemeProvider/createTheme.d.ts +0 -1
  418. package/dist/contexts/ThemeProvider/createTheme.js +14 -16
  419. package/dist/contexts/ThemeProvider/createTheme.js.map +1 -1
  420. package/dist/contexts/ThemeProvider/theme.d.ts +59 -0
  421. package/dist/contexts/ThemeProvider/theme.js +101 -0
  422. package/dist/contexts/ThemeProvider/theme.js.map +1 -0
  423. package/dist/contexts/ThemeProvider/useTheme.js.map +1 -1
  424. package/dist/contexts/index.d.ts +4 -0
  425. package/dist/helpers/LRUCache.js.map +1 -1
  426. package/dist/helpers/dateFormatting.d.ts +10 -2
  427. package/dist/helpers/dateFormatting.js +30 -7
  428. package/dist/helpers/dateFormatting.js.map +1 -1
  429. package/dist/helpers/dateFormatting.test.d.ts +1 -0
  430. package/dist/helpers/ensureRequired.js.map +1 -1
  431. package/dist/helpers/federalEin.js.map +1 -1
  432. package/dist/helpers/formattedStrings.js.map +1 -1
  433. package/dist/helpers/getDataProps.js.map +1 -1
  434. package/dist/helpers/mask.js.map +1 -1
  435. package/dist/helpers/payRateCalculator.js.map +1 -1
  436. package/dist/helpers/rem.js +2 -3
  437. package/dist/helpers/rem.js.map +1 -1
  438. package/dist/helpers/responsive.js.map +1 -1
  439. package/dist/helpers/ssn.js.map +1 -1
  440. package/dist/helpers/validations.js.map +1 -1
  441. package/dist/hooks/useContainerBreakpoints/useContainerBreakpoints.js.map +1 -1
  442. package/dist/hooks/useForkRef/useForkRef.js.map +1 -1
  443. package/dist/i18n/I18n.js.map +1 -1
  444. package/dist/i18n/en/Company.AddBank.json.js +12 -12
  445. package/dist/i18n/en/Company.Addresses.json.js +12 -12
  446. package/dist/i18n/en/Company.AssignSignatory.json.js +5 -54
  447. package/dist/i18n/en/Company.AssignSignatory.json.js.map +1 -1
  448. package/dist/i18n/en/Company.BankAccount.json.js +19 -40
  449. package/dist/i18n/en/Company.BankAccount.json.js.map +1 -1
  450. package/dist/i18n/en/Company.DocumentList.json.js +15 -15
  451. package/dist/i18n/en/Company.FederalTaxes.json.js +16 -32
  452. package/dist/i18n/en/Company.FederalTaxes.json.js.map +1 -1
  453. package/dist/i18n/en/Company.Locations.json.js +43 -49
  454. package/dist/i18n/en/Company.Locations.json.js.map +1 -1
  455. package/dist/i18n/en/Company.OnboardingOverview.json.js +14 -36
  456. package/dist/i18n/en/Company.OnboardingOverview.json.js.map +1 -1
  457. package/dist/i18n/en/Company.PaySchedule.json.js +1 -44
  458. package/dist/i18n/en/Company.PaySchedule.json.js.map +1 -1
  459. package/dist/i18n/en/Company.SignatureForm.json.js +9 -9
  460. package/dist/i18n/en/Company.StateTaxes.json.js +1 -25
  461. package/dist/i18n/en/Company.StateTaxes.json.js.map +1 -1
  462. package/dist/i18n/en/Contractor.Address.json.js +19 -24
  463. package/dist/i18n/en/Contractor.Address.json.js.map +1 -1
  464. package/dist/i18n/en/Contractor.ContractorList.json.js +9 -12
  465. package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -1
  466. package/dist/i18n/en/Contractor.ContractorSubmit.json.js +10 -14
  467. package/dist/i18n/en/Contractor.ContractorSubmit.json.js.map +1 -1
  468. package/dist/i18n/en/Contractor.NewHireReport.json.js +5 -7
  469. package/dist/i18n/en/Contractor.NewHireReport.json.js.map +1 -1
  470. package/dist/i18n/en/Contractor.PaymentMethod.json.js +4 -17
  471. package/dist/i18n/en/Contractor.PaymentMethod.json.js.map +1 -1
  472. package/dist/i18n/en/Contractor.Profile.json.js +1 -58
  473. package/dist/i18n/en/Contractor.Profile.json.js.map +1 -1
  474. package/dist/i18n/en/Employee.BankAccount.json.js +17 -19
  475. package/dist/i18n/en/Employee.BankAccount.json.js.map +1 -1
  476. package/dist/i18n/en/Employee.Compensation.json.js +31 -65
  477. package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
  478. package/dist/i18n/en/Employee.Deductions.json.js +56 -59
  479. package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
  480. package/dist/i18n/en/Employee.DocumentSigner.json.js +23 -23
  481. package/dist/i18n/en/Employee.EmployeeList.json.js +29 -29
  482. package/dist/i18n/en/Employee.HomeAddress.json.js +23 -28
  483. package/dist/i18n/en/Employee.HomeAddress.json.js.map +1 -1
  484. package/dist/i18n/en/Employee.Landing.json.js +11 -15
  485. package/dist/i18n/en/Employee.Landing.json.js.map +1 -1
  486. package/dist/i18n/en/Employee.OnboardingSummary.json.js +6 -28
  487. package/dist/i18n/en/Employee.OnboardingSummary.json.js.map +1 -1
  488. package/dist/i18n/en/Employee.PaySchedules.json.js +1 -5
  489. package/dist/i18n/en/Employee.PaySchedules.json.js.map +1 -1
  490. package/dist/i18n/en/Employee.PaymentMethod.json.js +29 -36
  491. package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
  492. package/dist/i18n/en/Employee.Profile.json.js +16 -22
  493. package/dist/i18n/en/Employee.Profile.json.js.map +1 -1
  494. package/dist/i18n/en/Employee.SplitPaycheck.json.js +21 -25
  495. package/dist/i18n/en/Employee.SplitPaycheck.json.js.map +1 -1
  496. package/dist/i18n/en/Employee.StateTaxes.json.js +4 -4
  497. package/dist/i18n/en/Employee.Taxes.json.js +26 -29
  498. package/dist/i18n/en/Employee.Taxes.json.js.map +1 -1
  499. package/dist/i18n/en/Payroll.PayrollHistoryList.json.js +9 -9
  500. package/dist/i18n/en/common.json.d.ts +1 -1
  501. package/dist/i18n/en/common.json.js +1 -147
  502. package/dist/i18n/en/common.json.js.map +1 -1
  503. package/dist/index.d.ts +1 -0
  504. package/dist/index.js +11 -9
  505. package/dist/index.js.map +1 -1
  506. package/dist/models/NAICSValues.js.map +1 -1
  507. package/dist/models/WA_RISK_CODES.js.map +1 -1
  508. package/dist/style.css +1 -1
  509. package/dist/types/GTheme.d.ts +0 -1
  510. package/dist/types/hooks.d.ts +36 -0
  511. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../src/components/Employee/Compensation/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type Job } from '@gusto/embedded-api/models/components/job'\nimport { useCompensation } from './useCompensation'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { employeeJobs, mode, isPending, handleEdit, handleDelete } = useCompensation()\n const { t } = useTranslation('Employee.Compensation')\n\n const { ...dataViewProps } = useDataView({\n data: employeeJobs,\n columns: [\n {\n key: 'title',\n title: t('allCompensations.jobColumn'),\n render: (job: Job) => job.title || '',\n },\n {\n key: 'flsaStatus',\n title: t('allCompensations.typeColumn'),\n render: (job: Job) => {\n const flsaStatus = job.compensations?.find(\n comp => comp.uuid === job.currentCompensationUuid,\n )?.flsaStatus\n return flsaStatus !== undefined ? t(`flsaStatusLabels.${flsaStatus}`) : null\n },\n },\n {\n key: 'rate',\n title: t('allCompensations.amountColumn'),\n render: (job: Job) => job.rate?.toString() || '',\n },\n {\n key: 'paymentUnit',\n title: t('allCompensations.perColumn'),\n render: (job: Job) => job.paymentUnit || '',\n },\n ],\n itemMenu: (job: Job) => (\n <HamburgerMenu\n triggerLabel={t('hamburgerTitle')}\n items={[\n {\n label: t('allCompensations.editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(job.uuid)\n },\n },\n ...(!job.primary\n ? [\n {\n label: t('allCompensations.deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n handleDelete(job.uuid)\n },\n },\n ]\n : []),\n ]}\n isLoading={isPending}\n />\n ),\n })\n\n if (mode !== 'LIST') {\n return\n }\n\n return (\n <DataView data-testid=\"data-view\" label={t('allCompensations.tableLabel')} {...dataViewProps} />\n )\n}\n"],"names":["List","employeeJobs","mode","isPending","handleEdit","handleDelete","useCompensation","useTranslation","dataViewProps","useDataView","job","flsaStatus","comp","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","DataView"],"mappings":";;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,cAAAC,GAAc,MAAAC,GAAM,WAAAC,GAAW,YAAAC,GAAY,cAAAC,MAAiBC,EAAgB,GAC9E,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAE9C,EAAE,GAAGC,EAAc,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AAA,QACA,WAAWP;AAAA,MAAA;AAAA,IAAA;AAAA,EACb,CAEH;AAED,MAAID,MAAS;AAKX,WAAA,gBAAAW,EAACI,KAAS,eAAY,aAAY,OAAO,EAAE,6BAA6B,GAAI,GAAGT,GAAe;AAElG;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../src/components/Employee/Compensation/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type Job } from '@gusto/embedded-api/models/components/job'\nimport { useCompensation } from './useCompensation'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { employeeJobs, mode, isPending, handleEdit, handleDelete } = useCompensation()\n const { t } = useTranslation('Employee.Compensation')\n\n const { ...dataViewProps } = useDataView({\n data: employeeJobs,\n columns: [\n {\n key: 'title',\n title: t('allCompensations.jobColumn'),\n render: (job: Job) => job.title || '',\n },\n {\n key: 'flsaStatus',\n title: t('allCompensations.typeColumn'),\n render: (job: Job) => {\n const flsaStatus = job.compensations?.find(\n comp => comp.uuid === job.currentCompensationUuid,\n )?.flsaStatus\n return flsaStatus !== undefined ? t(`flsaStatusLabels.${flsaStatus}`) : null\n },\n },\n {\n key: 'rate',\n title: t('allCompensations.amountColumn'),\n render: (job: Job) => job.rate?.toString() || '',\n },\n {\n key: 'paymentUnit',\n title: t('allCompensations.perColumn'),\n render: (job: Job) => job.paymentUnit || '',\n },\n ],\n itemMenu: (job: Job) => (\n <HamburgerMenu\n triggerLabel={t('hamburgerTitle')}\n items={[\n {\n label: t('allCompensations.editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(job.uuid)\n },\n },\n ...(!job.primary\n ? [\n {\n label: t('allCompensations.deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n handleDelete(job.uuid)\n },\n },\n ]\n : []),\n ]}\n isLoading={isPending}\n />\n ),\n })\n\n if (mode !== 'LIST') {\n return\n }\n\n return (\n <DataView data-testid=\"data-view\" label={t('allCompensations.tableLabel')} {...dataViewProps} />\n )\n}\n"],"names":["List","employeeJobs","mode","isPending","handleEdit","handleDelete","useCompensation","t","useTranslation","dataViewProps","useDataView","job","flsaStatus","comp","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","DataView"],"mappings":";;;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,cAAAC,GAAc,MAAAC,GAAM,WAAAC,GAAW,YAAAC,GAAY,cAAAC,EAAA,IAAiBC,EAAA,GAC9D,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAE9C,EAAE,GAAGC,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMT;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAOM,EAAE,4BAA4B;AAAA,QACrC,QAAQ,CAACI,MAAaA,EAAI,SAAS;AAAA,MAAA;AAAA,MAErC;AAAA,QACE,KAAK;AAAA,QACL,OAAOJ,EAAE,6BAA6B;AAAA,QACtC,QAAQ,CAACI,MAAa;AACpB,gBAAMC,IAAaD,EAAI,eAAe;AAAA,YACpC,CAAAE,MAAQA,EAAK,SAASF,EAAI;AAAA,UAAA,GACzB;AACH,iBAAOC,MAAe,SAAYL,EAAE,oBAAoBK,CAAU,EAAE,IAAI;AAAA,QAC1E;AAAA,MAAA;AAAA,MAEF;AAAA,QACE,KAAK;AAAA,QACL,OAAOL,EAAE,+BAA+B;AAAA,QACxC,QAAQ,CAACI,MAAaA,EAAI,MAAM,cAAc;AAAA,MAAA;AAAA,MAEhD;AAAA,QACE,KAAK;AAAA,QACL,OAAOJ,EAAE,4BAA4B;AAAA,QACrC,QAAQ,CAACI,MAAaA,EAAI,eAAe;AAAA,MAAA;AAAA,IAC3C;AAAA,IAEF,UAAU,CAACA,MACT,gBAAAG;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,cAAcR,EAAE,gBAAgB;AAAA,QAChC,OAAO;AAAA,UACL;AAAA,YACE,OAAOA,EAAE,0BAA0B;AAAA,YACnC,MAAM,gBAAAO,EAACE,GAAA,EAAU,eAAW,GAAA,CAAC;AAAA,YAC7B,SAAS,MAAM;AACb,cAAAZ,EAAWO,EAAI,IAAI;AAAA,YACrB;AAAA,UAAA;AAAA,UAEF,GAAKA,EAAI,UAUL,CAAA,IATA;AAAA,YACE;AAAA,cACE,OAAOJ,EAAE,4BAA4B;AAAA,cACrC,MAAM,gBAAAO,EAACG,GAAA,EAAY,eAAW,GAAA,CAAC;AAAA,cAC/B,SAAS,MAAM;AACb,gBAAAZ,EAAaM,EAAI,IAAI;AAAA,cACvB;AAAA,YAAA;AAAA,UACF;AAAA,QAED;AAAA,QAEP,WAAWR;AAAA,MAAA;AAAA,IAAA;AAAA,EACb,CAEH;AAED,MAAID,MAAS;AAIb,WACE,gBAAAY,EAACI,KAAS,eAAY,aAAY,OAAOX,EAAE,6BAA6B,GAAI,GAAGE,GAAe;AAElG;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCompensation.js","sources":["../../../../src/components/Employee/Compensation/useCompensation.ts"],"sourcesContent":["import type { Job } from '@gusto/embedded-api/models/components/job'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base/createCompoundContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus } from '@/shared/constants'\nimport { yearlyRate } from '@/helpers/payRateCalculator'\n\nexport const rateMinimumError = 'rate_minimum_error'\nexport const rateExemptThresholdError = 'rate_exempt_threshold_error'\n\nexport const CompensationSchema = z\n .object({\n jobTitle: z.string().min(1),\n adjustForMinimumWage: z.boolean(),\n minimumWageId: z.string().optional(),\n stateWcCovered: z.boolean().optional(),\n stateWcClassCode: z.string().optional(),\n twoPercentShareholder: z.boolean().optional(),\n flsaStatus: z.enum([\n FlsaStatus.EXEMPT,\n FlsaStatus.SALARIED_NONEXEMPT,\n FlsaStatus.NONEXEMPT,\n FlsaStatus.OWNER,\n FlsaStatus.COMMISSION_ONLY_EXEMPT,\n FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n ]),\n paymentUnit: z.enum(['Hour', 'Week', 'Month', 'Year', 'Paycheck']),\n rate: z.number().optional(),\n })\n .superRefine((data, ctx) => {\n // adjustForMinimumWage\n if (data.adjustForMinimumWage && (!data.minimumWageId || data.minimumWageId.trim() === '')) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['minimumWageId'],\n message: 'minimumWageId is required when adjustForMinimumWage is true',\n })\n }\n\n // stateWcCovered\n if (\n data.stateWcCovered === true &&\n (!data.stateWcClassCode || data.stateWcClassCode.trim() === '')\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['stateWcClassCode'],\n message: 'stateWcClassCode is required when stateWcCovered is true',\n })\n }\n\n // FLSA logic\n const { flsaStatus, paymentUnit, rate } = data\n if (\n flsaStatus === FlsaStatus.EXEMPT ||\n flsaStatus === FlsaStatus.SALARIED_NONEXEMPT ||\n flsaStatus === FlsaStatus.NONEXEMPT\n ) {\n // For EXEMPT, check salary threshold\n if (\n flsaStatus === FlsaStatus.EXEMPT &&\n rate !== undefined &&\n yearlyRate(Number(rate), paymentUnit) < FLSA_OVERTIME_SALARY_LIMIT\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: rateExemptThresholdError,\n })\n }\n\n if (rate === undefined || rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: rateMinimumError,\n })\n }\n } else if (flsaStatus === FlsaStatus.OWNER) {\n if (paymentUnit !== 'Paycheck') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: 'paymentUnit must be Paycheck for OWNER',\n })\n }\n if (rate === undefined || rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: rateMinimumError,\n })\n }\n } else if (\n [FlsaStatus.COMMISSION_ONLY_EXEMPT, FlsaStatus.COMMISSION_ONLY_NONEXEMPT].includes(flsaStatus)\n ) {\n if (paymentUnit !== 'Year') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: 'paymentUnit must be Year for commission-only FLSA statuses',\n })\n }\n if (rate !== 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: rateMinimumError,\n })\n }\n }\n })\n\nexport type CompensationInputs = z.input<typeof CompensationSchema>\nexport type CompensationOutputs = z.output<typeof CompensationSchema>\n\nexport type MODE =\n | 'LIST'\n | 'ADD_ADDITIONAL_JOB'\n | 'ADD_INITIAL_JOB'\n | 'EDIT_ADDITIONAL_JOB'\n | 'EDIT_INITIAL_JOB'\n | 'PROCEED'\n\ntype CompensationContextType = {\n employeeJobs: Job[]\n currentJob?: Job | null\n primaryFlsaStatus?: string\n isPending: boolean\n mode: MODE\n showFlsaChangeWarning: boolean\n minimumWages: MinimumWage[]\n state?: string\n showTwoPercentStakeholder?: boolean\n submitWithEffect: (newMode: MODE) => void\n handleAdd: () => void\n handleEdit: (uuid: string) => void\n handleDelete: (uuid: string) => void\n handleFlsaChange: (status: string | number) => void\n handleCancelAddJob: () => void\n}\nconst [useCompensation, CompensationProvider] =\n createCompoundContext<CompensationContextType>('CompensationContext')\nexport { useCompensation, CompensationProvider }\n"],"names":["rateMinimumError","rateExemptThresholdError","CompensationSchema","z","FlsaStatus","data","ctx","flsaStatus","paymentUnit","rate","yearlyRate","FLSA_OVERTIME_SALARY_LIMIT","useCompensation","CompensationProvider","createCompoundContext"],"mappings":";;;;AAOO,MAAMA,IAAmB,sBACnBC,IAA2B,+BAE3BC,IAAqBC,EAC/B,OAAO;AAAA,EACN,UAAUA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC1B,sBAAsBA,EAAE,QAAQ;AAAA,EAChC,eAAeA,EAAE,OAAO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;AAAA,IACX,MAAMH,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,MAAM;AAAA,IACb,SAASH;AAAA,EAAA,CACV,KAEMO,MAAeH,EAAW,SAC/BI,MAAgB,cAClBF,EAAI,SAAS;AAAA,IACX,MAAMH,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,aAAa;AAAA,IACpB,SAAS;AAAA,EAAA,CACV,IAECM,MAAS,UAAaA,IAAO,MAC/BH,EAAI,SAAS;AAAA,IACX,MAAMH,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,MAAM;AAAA,IACb,SAASH;AAAA,EAAA,CACV,KAGH,CAACI,EAAW,wBAAwBA,EAAW,yBAAyB,EAAE,SAASG,CAAU,MAEzFC,MAAgB,UAClBF,EAAI,SAAS;AAAA,IACX,MAAMH,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,aAAa;AAAA,IACpB,SAAS;AAAA,EAAA,CACV,GAECM,MAAS,KACXH,EAAI,SAAS;AAAA,IACX,MAAMH,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,MAAM;AAAA,IACb,SAASH;AAAA,EAAA,CACV;AAGP,CAAC,GA8BG,CAACY,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
1
+ {"version":3,"file":"useCompensation.js","sources":["../../../../src/components/Employee/Compensation/useCompensation.ts"],"sourcesContent":["import type { Job } from '@gusto/embedded-api/models/components/job'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base/createCompoundContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus } from '@/shared/constants'\nimport { yearlyRate } from '@/helpers/payRateCalculator'\n\nexport const rateMinimumError = 'rate_minimum_error'\nexport const rateExemptThresholdError = 'rate_exempt_threshold_error'\n\nexport const CompensationSchema = z\n .object({\n jobTitle: z.string().min(1),\n adjustForMinimumWage: z.boolean(),\n minimumWageId: z.string().optional(),\n stateWcCovered: z.boolean().optional(),\n stateWcClassCode: z.string().optional(),\n twoPercentShareholder: z.boolean().optional(),\n flsaStatus: z.enum([\n FlsaStatus.EXEMPT,\n FlsaStatus.SALARIED_NONEXEMPT,\n FlsaStatus.NONEXEMPT,\n FlsaStatus.OWNER,\n FlsaStatus.COMMISSION_ONLY_EXEMPT,\n FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n ]),\n paymentUnit: z.enum(['Hour', 'Week', 'Month', 'Year', 'Paycheck']),\n rate: z.number().optional(),\n })\n .superRefine((data, ctx) => {\n // adjustForMinimumWage\n if (data.adjustForMinimumWage && (!data.minimumWageId || data.minimumWageId.trim() === '')) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['minimumWageId'],\n message: 'minimumWageId is required when adjustForMinimumWage is true',\n })\n }\n\n // stateWcCovered\n if (\n data.stateWcCovered === true &&\n (!data.stateWcClassCode || data.stateWcClassCode.trim() === '')\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['stateWcClassCode'],\n message: 'stateWcClassCode is required when stateWcCovered is true',\n })\n }\n\n // FLSA logic\n const { flsaStatus, paymentUnit, rate } = data\n if (\n flsaStatus === FlsaStatus.EXEMPT ||\n flsaStatus === FlsaStatus.SALARIED_NONEXEMPT ||\n flsaStatus === FlsaStatus.NONEXEMPT\n ) {\n // For EXEMPT, check salary threshold\n if (\n flsaStatus === FlsaStatus.EXEMPT &&\n rate !== undefined &&\n yearlyRate(Number(rate), paymentUnit) < FLSA_OVERTIME_SALARY_LIMIT\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: rateExemptThresholdError,\n })\n }\n\n if (rate === undefined || rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: rateMinimumError,\n })\n }\n } else if (flsaStatus === FlsaStatus.OWNER) {\n if (paymentUnit !== 'Paycheck') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: 'paymentUnit must be Paycheck for OWNER',\n })\n }\n if (rate === undefined || rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: rateMinimumError,\n })\n }\n } else if (\n [FlsaStatus.COMMISSION_ONLY_EXEMPT, FlsaStatus.COMMISSION_ONLY_NONEXEMPT].includes(flsaStatus)\n ) {\n if (paymentUnit !== 'Year') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: 'paymentUnit must be Year for commission-only FLSA statuses',\n })\n }\n if (rate !== 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: rateMinimumError,\n })\n }\n }\n })\n\nexport type CompensationInputs = z.input<typeof CompensationSchema>\nexport type CompensationOutputs = z.output<typeof CompensationSchema>\n\nexport type MODE =\n | 'LIST'\n | 'ADD_ADDITIONAL_JOB'\n | 'ADD_INITIAL_JOB'\n | 'EDIT_ADDITIONAL_JOB'\n | 'EDIT_INITIAL_JOB'\n | 'PROCEED'\n\ntype CompensationContextType = {\n employeeJobs: Job[]\n currentJob?: Job | null\n primaryFlsaStatus?: string\n isPending: boolean\n mode: MODE\n showFlsaChangeWarning: boolean\n minimumWages: MinimumWage[]\n state?: string\n showTwoPercentStakeholder?: boolean\n submitWithEffect: (newMode: MODE) => void\n handleAdd: () => void\n handleEdit: (uuid: string) => void\n handleDelete: (uuid: string) => void\n handleFlsaChange: (status: string | number) => void\n handleCancelAddJob: () => void\n}\nconst [useCompensation, CompensationProvider] =\n createCompoundContext<CompensationContextType>('CompensationContext')\nexport { useCompensation, CompensationProvider }\n"],"names":["rateMinimumError","rateExemptThresholdError","CompensationSchema","z","FlsaStatus","data","ctx","flsaStatus","paymentUnit","rate","yearlyRate","FLSA_OVERTIME_SALARY_LIMIT","useCompensation","CompensationProvider","createCompoundContext"],"mappings":";;;;AAOO,MAAMA,IAAmB,sBACnBC,IAA2B,+BAE3BC,IAAqBC,EAC/B,OAAO;AAAA,EACN,UAAUA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MAAM;AAAA,IACb,SAASF;AAAA,EAAA,CACV,IAGCQ,MAAS,UAAaA,IAAO,MAC/BH,EAAI,SAAS;AAAA,IACX,MAAMH,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,MAAM;AAAA,IACb,SAASH;AAAA,EAAA,CACV,KAEMO,MAAeH,EAAW,SAC/BI,MAAgB,cAClBF,EAAI,SAAS;AAAA,IACX,MAAMH,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,aAAa;AAAA,IACpB,SAAS;AAAA,EAAA,CACV,IAECM,MAAS,UAAaA,IAAO,MAC/BH,EAAI,SAAS;AAAA,IACX,MAAMH,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,MAAM;AAAA,IACb,SAASH;AAAA,EAAA,CACV,KAGH,CAACI,EAAW,wBAAwBA,EAAW,yBAAyB,EAAE,SAASG,CAAU,MAEzFC,MAAgB,UAClBF,EAAI,SAAS;AAAA,IACX,MAAMH,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,aAAa;AAAA,IACpB,SAAS;AAAA,EAAA,CACV,GAECM,MAAS,KACXH,EAAI,SAAS;AAAA,IACX,MAAMH,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,MAAM;AAAA,IACb,SAASH;AAAA,EAAA,CACV;AAGP,CAAC,GA8BG,CAACY,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
@@ -1,25 +1,27 @@
1
- import { jsxs as a, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as a, jsx as i } from "react/jsx-runtime";
2
2
  import { useTranslation as d } from "react-i18next";
3
3
  import { useDeductions as m } from "./useDeductions.js";
4
+ import "classnames";
5
+ import "../../../shared/constants.js";
4
6
  import { ActionsLayout as u } from "../../Common/ActionsLayout/ActionsLayout.js";
5
7
  import { useComponentContext as l } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
- const y = () => {
7
- const { mode: n, handleAdd: i, handleCancel: r, handlePassthrough: s, isPending: c } = m(), { t: o } = d("Employee.Deductions"), t = l();
8
+ const T = () => {
9
+ const { mode: o, handleAdd: e, handleCancel: r, handlePassthrough: s, isPending: c } = m(), { t: n } = d("Employee.Deductions"), t = l();
8
10
  return /* @__PURE__ */ a(u, { children: [
9
- (n === "ADD" || n === "EDIT") && /* @__PURE__ */ e(t.Button, { variant: "secondary", onClick: r, children: o("cancelCta") }),
10
- n === "LIST" && /* @__PURE__ */ e(t.Button, { variant: "secondary", onClick: i, children: o("addDeductionCta") }),
11
- /* @__PURE__ */ e(
11
+ (o === "ADD" || o === "EDIT") && /* @__PURE__ */ i(t.Button, { variant: "secondary", onClick: r, children: n("cancelCta") }),
12
+ o === "LIST" && /* @__PURE__ */ i(t.Button, { variant: "secondary", onClick: e, children: n("addDeductionCta") }),
13
+ /* @__PURE__ */ i(
12
14
  t.Button,
13
15
  {
14
- type: n === "LIST" ? "button" : "submit",
16
+ type: o === "LIST" ? "button" : "submit",
15
17
  isLoading: c,
16
- onClick: n === "LIST" ? s : void 0,
17
- children: o("continueCta")
18
+ onClick: o === "LIST" ? s : void 0,
19
+ children: n("continueCta")
18
20
  }
19
21
  )
20
22
  ] });
21
23
  };
22
24
  export {
23
- y as Actions
25
+ T as Actions
24
26
  };
25
27
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Deductions/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { mode, handleAdd, handleCancel, handlePassthrough, isPending } = useDeductions()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {(mode === 'ADD' || mode === 'EDIT') && (\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && (\n <Components.Button variant=\"secondary\" onClick={handleAdd}>\n {t('addDeductionCta')}\n </Components.Button>\n )}\n <Components.Button\n type={mode === 'LIST' ? 'button' : 'submit'}\n isLoading={isPending}\n onClick={mode === 'LIST' ? handlePassthrough : undefined}\n >\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","mode","handleAdd","handleCancel","handlePassthrough","isPending","useDeductions","t","useTranslation","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,MAAAC,GAAM,WAAAC,GAAW,cAAAC,GAAc,mBAAAC,GAAmB,WAAAC,MAAcC,EAAc,GAChF,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB;AAEvC,2BACGC,GACG,EAAA,UAAA;AAAA,KAAAV,MAAS,SAASA,MAAS,WAC3B,gBAAAW,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASN,GAC7C,UAAAI,EAAE,WAAW,GAChB;AAAA,IAEDN,MAAS,UACP,gBAAAW,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASP,GAC7C,UAAEK,EAAA,iBAAiB,EACtB,CAAA;AAAA,IAEF,gBAAAK;AAAA,MAACH,EAAW;AAAA,MAAX;AAAA,QACC,MAAMR,MAAS,SAAS,WAAW;AAAA,QACnC,WAAWI;AAAA,QACX,SAASJ,MAAS,SAASG,IAAoB;AAAA,QAE9C,YAAE,aAAa;AAAA,MAAA;AAAA,IAAA;AAAA,EAClB,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Deductions/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { mode, handleAdd, handleCancel, handlePassthrough, isPending } = useDeductions()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {(mode === 'ADD' || mode === 'EDIT') && (\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && (\n <Components.Button variant=\"secondary\" onClick={handleAdd}>\n {t('addDeductionCta')}\n </Components.Button>\n )}\n <Components.Button\n type={mode === 'LIST' ? 'button' : 'submit'}\n isLoading={isPending}\n onClick={mode === 'LIST' ? handlePassthrough : undefined}\n >\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","mode","handleAdd","handleCancel","handlePassthrough","isPending","useDeductions","t","useTranslation","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,MAAAC,GAAM,WAAAC,GAAW,cAAAC,GAAc,mBAAAC,GAAmB,WAAAC,EAAA,IAAcC,EAAA,GAClE,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACG,UAAA;AAAA,KAAAV,MAAS,SAASA,MAAS,WAC3B,gBAAAW,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASN,GAC7C,UAAAI,EAAE,WAAW,GAChB;AAAA,IAEDN,MAAS,UACR,gBAAAW,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASP,GAC7C,UAAAK,EAAE,iBAAiB,EAAA,CACtB;AAAA,IAEF,gBAAAK;AAAA,MAACH,EAAW;AAAA,MAAX;AAAA,QACC,MAAMR,MAAS,SAAS,WAAW;AAAA,QACnC,WAAWI;AAAA,QACX,SAASJ,MAAS,SAASG,IAAoB;AAAA,QAE9C,YAAE,aAAa;AAAA,MAAA;AAAA,IAAA;AAAA,EAClB,GACF;AAEJ;"}
@@ -1,23 +1,25 @@
1
- import { jsxs as l, Fragment as m, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as m, Fragment as l, jsx as t } from "react/jsx-runtime";
2
2
  import { useFormContext as s, useWatch as i } from "react-hook-form";
3
3
  import { useTranslation as p } from "react-i18next";
4
4
  import { useDeductions as b } from "./useDeductions.js";
5
- import { useI18n as f } from "../../../i18n/I18n.js";
6
- import { useComponentContext as D } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
- import { TextInputField as g } from "../../Common/Fields/TextInputField/TextInputField.js";
5
+ import "classnames";
6
+ import "../../../shared/constants.js";
8
7
  import { RadioGroupField as a } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
8
+ import { TextInputField as f } from "../../Common/Fields/TextInputField/TextInputField.js";
9
9
  import { NumberInputField as u } from "../../Common/Fields/NumberInputField/NumberInputField.js";
10
+ import { useI18n as D } from "../../../i18n/I18n.js";
11
+ import { useComponentContext as g } from "../../../contexts/ComponentAdapter/useComponentContext.js";
10
12
  import { CheckboxField as x } from "../../Common/Fields/CheckboxField/CheckboxField.js";
11
- const I = () => {
13
+ const E = () => {
12
14
  const { mode: n } = b(), { control: r } = s();
13
- f("Employee.Deductions");
14
- const { t: e } = p("Employee.Deductions"), o = D(), c = i({ control: r, name: "recurring" }), d = i({ control: r, name: "deductAsPercentage" });
15
+ D("Employee.Deductions");
16
+ const { t: e } = p("Employee.Deductions"), o = g(), c = i({ control: r, name: "recurring" }), d = i({ control: r, name: "deductAsPercentage" });
15
17
  if (!(n !== "ADD" && n !== "EDIT"))
16
- return /* @__PURE__ */ l(m, { children: [
18
+ return /* @__PURE__ */ m(l, { children: [
17
19
  /* @__PURE__ */ t(o.Heading, { as: "h2", children: e(n === "EDIT" ? "editDeductionTitle" : "addDeductionTitle") }),
18
20
  /* @__PURE__ */ t(o.Text, { children: e("addDeuctionDescription") }),
19
21
  /* @__PURE__ */ t(
20
- g,
22
+ f,
21
23
  {
22
24
  name: "description",
23
25
  label: e("descriptionLabel"),
@@ -71,6 +73,6 @@ const I = () => {
71
73
  ] });
72
74
  };
73
75
  export {
74
- I as DeductionForm
76
+ E as DeductionForm
75
77
  };
76
78
  //# sourceMappingURL=DeductionForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeductionForm.js","sources":["../../../../src/components/Employee/Deductions/DeductionForm.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useDeductions, type DeductionInputs } from './useDeductions'\nimport {\n CheckboxField,\n NumberInputField,\n RadioGroupField,\n TextInputField,\n} from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const DeductionForm = () => {\n const { mode } = useDeductions()\n const { control } = useFormContext<DeductionInputs>()\n useI18n('Employee.Deductions')\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const watchedRecurring = useWatch({ control, name: 'recurring' })\n const watchedDeductAsPercentage = useWatch({ control, name: 'deductAsPercentage' })\n\n if (mode !== 'ADD' && mode !== 'EDIT') return\n\n return (\n <>\n <Components.Heading as=\"h2\">\n {mode === 'EDIT' ? t('editDeductionTitle') : t('addDeductionTitle')}\n </Components.Heading>\n <Components.Text>{t('addDeuctionDescription')}</Components.Text>\n <TextInputField\n name=\"description\"\n label={t('descriptionLabel')}\n isRequired\n errorMessage={t('validations.description')}\n />\n <RadioGroupField\n name=\"recurring\"\n label={t('frequencyLabel')}\n options={[\n { value: 'true', label: t('frequencyRecurringOption') },\n { value: 'false', label: t('frequencyOneTimeOption') },\n ]}\n />\n <RadioGroupField\n name=\"deductAsPercentage\"\n label={t('deductionTypeLabel')}\n options={[\n { value: 'true', label: t('deductionTypePercentageOption') },\n { value: 'false', label: t('deductionTypeFixedAmountOption') },\n ]}\n />\n <div className=\"deduction-amount-section\">\n <NumberInputField\n name=\"amount\"\n isRequired\n label={t('deductionAmountLabel')}\n format={watchedDeductAsPercentage === 'true' ? 'percent' : 'currency'}\n min={0}\n errorMessage={t('validations.amount')}\n />\n </div>\n {watchedRecurring === 'true' && (\n <NumberInputField\n name=\"annualMaximum\"\n label={t('annualMaxLabel')}\n format=\"currency\"\n min={0}\n />\n )}\n <CheckboxField name=\"courtOrdered\" label={t('courtOrderedLabel')} />\n </>\n )\n}\n"],"names":["DeductionForm","mode","useDeductions","control","useFormContext","useI18n","t","useTranslation","Components","useComponentContext","watchedRecurring","useWatch","watchedDeductAsPercentage","jsxs","Fragment","jsx","TextInputField","RadioGroupField","NumberInputField","CheckboxField"],"mappings":";;;;;;;;;;AAYO,MAAMA,IAAgB,MAAM;AAC3B,QAAA,EAAE,MAAAC,EAAK,IAAIC,EAAc,GACzB,EAAE,SAAAC,EAAQ,IAAIC,EAAgC;AACpD,EAAAC,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB,GAEjCC,IAAmBC,EAAS,EAAE,SAAAR,GAAS,MAAM,aAAa,GAC1DS,IAA4BD,EAAS,EAAE,SAAAR,GAAS,MAAM,sBAAsB;AAE9E,MAAA,EAAAF,MAAS,SAASA,MAAS;AAE/B,WAEI,gBAAAY,EAAAC,GAAA,EAAA,UAAA;AAAA,MAAA,gBAAAC,EAACP,EAAW,SAAX,EAAmB,IAAG,MACpB,UAAkBF,EAAlBL,MAAS,SAAW,uBAA0B,mBAAN,EAC3C,CAAA;AAAA,wBACCO,EAAW,MAAX,EAAiB,UAAAF,EAAE,wBAAwB,GAAE;AAAA,MAC9C,gBAAAS;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOV,EAAE,kBAAkB;AAAA,UAC3B,YAAU;AAAA,UACV,cAAcA,EAAE,yBAAyB;AAAA,QAAA;AAAA,MAC3C;AAAA,MACA,gBAAAS;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOX,EAAE,gBAAgB;AAAA,UACzB,SAAS;AAAA,YACP,EAAE,OAAO,QAAQ,OAAOA,EAAE,0BAA0B,EAAE;AAAA,YACtD,EAAE,OAAO,SAAS,OAAOA,EAAE,wBAAwB,EAAE;AAAA,UAAA;AAAA,QACvD;AAAA,MACF;AAAA,MACA,gBAAAS;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOX,EAAE,oBAAoB;AAAA,UAC7B,SAAS;AAAA,YACP,EAAE,OAAO,QAAQ,OAAOA,EAAE,+BAA+B,EAAE;AAAA,YAC3D,EAAE,OAAO,SAAS,OAAOA,EAAE,gCAAgC,EAAE;AAAA,UAAA;AAAA,QAC/D;AAAA,MACF;AAAA,MACA,gBAAAS,EAAC,OAAI,EAAA,WAAU,4BACb,UAAA,gBAAAA;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,YAAU;AAAA,UACV,OAAOZ,EAAE,sBAAsB;AAAA,UAC/B,QAAQM,MAA8B,SAAS,YAAY;AAAA,UAC3D,KAAK;AAAA,UACL,cAAcN,EAAE,oBAAoB;AAAA,QAAA;AAAA,MAAA,GAExC;AAAA,MACCI,MAAqB,UACpB,gBAAAK;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOZ,EAAE,gBAAgB;AAAA,UACzB,QAAO;AAAA,UACP,KAAK;AAAA,QAAA;AAAA,MACP;AAAA,wBAEDa,GAAc,EAAA,MAAK,gBAAe,OAAOb,EAAE,mBAAmB,EAAG,CAAA;AAAA,IAAA,GACpE;AAEJ;"}
1
+ {"version":3,"file":"DeductionForm.js","sources":["../../../../src/components/Employee/Deductions/DeductionForm.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useDeductions, type DeductionInputs } from './useDeductions'\nimport {\n CheckboxField,\n NumberInputField,\n RadioGroupField,\n TextInputField,\n} from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const DeductionForm = () => {\n const { mode } = useDeductions()\n const { control } = useFormContext<DeductionInputs>()\n useI18n('Employee.Deductions')\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const watchedRecurring = useWatch({ control, name: 'recurring' })\n const watchedDeductAsPercentage = useWatch({ control, name: 'deductAsPercentage' })\n\n if (mode !== 'ADD' && mode !== 'EDIT') return\n\n return (\n <>\n <Components.Heading as=\"h2\">\n {mode === 'EDIT' ? t('editDeductionTitle') : t('addDeductionTitle')}\n </Components.Heading>\n <Components.Text>{t('addDeuctionDescription')}</Components.Text>\n <TextInputField\n name=\"description\"\n label={t('descriptionLabel')}\n isRequired\n errorMessage={t('validations.description')}\n />\n <RadioGroupField\n name=\"recurring\"\n label={t('frequencyLabel')}\n options={[\n { value: 'true', label: t('frequencyRecurringOption') },\n { value: 'false', label: t('frequencyOneTimeOption') },\n ]}\n />\n <RadioGroupField\n name=\"deductAsPercentage\"\n label={t('deductionTypeLabel')}\n options={[\n { value: 'true', label: t('deductionTypePercentageOption') },\n { value: 'false', label: t('deductionTypeFixedAmountOption') },\n ]}\n />\n <div className=\"deduction-amount-section\">\n <NumberInputField\n name=\"amount\"\n isRequired\n label={t('deductionAmountLabel')}\n format={watchedDeductAsPercentage === 'true' ? 'percent' : 'currency'}\n min={0}\n errorMessage={t('validations.amount')}\n />\n </div>\n {watchedRecurring === 'true' && (\n <NumberInputField\n name=\"annualMaximum\"\n label={t('annualMaxLabel')}\n format=\"currency\"\n min={0}\n />\n )}\n <CheckboxField name=\"courtOrdered\" label={t('courtOrderedLabel')} />\n </>\n )\n}\n"],"names":["DeductionForm","mode","useDeductions","control","useFormContext","useI18n","t","useTranslation","Components","useComponentContext","watchedRecurring","useWatch","watchedDeductAsPercentage","jsxs","Fragment","jsx","TextInputField","RadioGroupField","NumberInputField","CheckboxField"],"mappings":";;;;;;;;;;;;AAYO,MAAMA,IAAgB,MAAM;AACjC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAA,GACX,EAAE,SAAAC,EAAA,IAAYC,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AA,gBAAAA;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,YAAU;AAAA,UACV,OAAOZ,EAAE,sBAAsB;AAAA,UAC/B,QAAQM,MAA8B,SAAS,YAAY;AAAA,UAC3D,KAAK;AAAA,UACL,cAAcN,EAAE,oBAAoB;AAAA,QAAA;AAAA,MAAA,GAExC;AAAA,MACCI,MAAqB,UACpB,gBAAAK;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOZ,EAAE,gBAAgB;AAAA,UACzB,QAAO;AAAA,UACP,KAAK;AAAA,QAAA;AAAA,MAAA;AAAA,wBAGRa,GAAA,EAAc,MAAK,gBAAe,OAAOb,EAAE,mBAAmB,EAAA,CAAG;AAAA,IAAA,GACpE;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Deductions.js","sources":["../../../../src/components/Employee/Deductions/Deductions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEffect, useMemo, useState } from 'react'\nimport { z } from 'zod'\nimport { FormProvider, useForm, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport {\n type DeductionInputs,\n type DeductionPayload,\n DeductionSchema,\n DeductionsProvider,\n type MODE,\n} from './useDeductions'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Actions } from '@/components/Employee/Deductions/Actions'\nimport { IncludeDeductionsForm } from '@/components/Employee/Deductions/IncludeDeductionsForm'\nimport { Head } from '@/components/Employee/Deductions/Head'\nimport { DeductionForm } from '@/components/Employee/Deductions/DeductionForm'\nimport { DeductionsList } from '@/components/Employee/Deductions/DeductionsList'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface DeductionsProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nconst IncludeDeductionsSchema = z.object({ includeDeductions: z.enum(['Yes', 'No']) })\nexport type IncludeDeductionsPayload = z.output<typeof IncludeDeductionsSchema>\n\nexport function Deductions(props: DeductionsProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nexport const Root = ({ employeeId, className, dictionary }: DeductionsProps) => {\n const { onEvent, baseSubmitHandler } = useBase()\n useComponentDictionary('Employee.Deductions', dictionary)\n\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n\n // Used for deletion or edit of deduction\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation()\n\n const activeDeductions = deductions.filter(deduction => deduction.active)\n const [mode, setMode] = useState<MODE>(activeDeductions.length < 1 ? 'INITIAL' : 'LIST')\n const [currentDeduction, setCurrentDeduction] = useState<Garnishment | null>(null)\n useI18n('Employee.Deductions')\n\n const defaultValues: DeductionInputs = useMemo(() => {\n return {\n amount: currentDeduction?.amount ? Number(currentDeduction.amount) : 0,\n description: currentDeduction?.description ?? '',\n times: currentDeduction?.times ?? null,\n recurring: currentDeduction?.recurring?.toString() ?? 'true',\n annualMaximum: currentDeduction?.annualMaximum\n ? Number(currentDeduction.annualMaximum)\n : null,\n payPeriodMaximum: currentDeduction?.payPeriodMaximum\n ? Number(currentDeduction.payPeriodMaximum)\n : null,\n deductAsPercentage: currentDeduction?.deductAsPercentage?.toString() ?? 'true',\n active: true,\n courtOrdered: currentDeduction?.courtOrdered ?? false,\n } as DeductionInputs\n }, [currentDeduction])\n\n const includeDeductionsFormMethods = useForm<IncludeDeductionsPayload>({\n // resolver: zodResolver(IncludeDeductionsSchema),\n defaultValues: { includeDeductions: 'No' },\n })\n\n const formMethods = useForm<DeductionInputs, unknown, DeductionPayload>({\n resolver: zodResolver(DeductionSchema),\n defaultValues,\n })\n\n const { reset: resetForm } = formMethods\n\n useEffect(() => {\n resetForm(defaultValues)\n }, [currentDeduction, defaultValues, resetForm, mode])\n\n const handleDelete = async (deduction: Garnishment) => {\n await baseSubmitHandler(deduction, async payload => {\n //Deletion of deduction is simply updating it with active: false\n const { garnishment } = await updateDeduction({\n request: {\n garnishmentId: payload.uuid,\n requestBody: {\n ...payload,\n totalAmount: payload.totalAmount ?? undefined,\n active: false,\n version: payload.version as string,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DELETED, garnishment)\n })\n }\n const onSubmit: SubmitHandler<DeductionPayload | IncludeDeductionsPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n if ('includeDeductions' in payload) {\n if (payload.includeDeductions === 'Yes') {\n setMode('ADD')\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_ADD)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n return\n }\n }\n if (!('includeDeductions' in payload)) {\n if (mode === 'ADD') {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId: employeeId,\n requestBody: { ...payload, times: payload.recurring ? null : 1 },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else if (mode === 'EDIT') {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: currentDeduction?.uuid ?? '',\n requestBody: {\n ...payload,\n version: currentDeduction?.version as string,\n times: payload.recurring ? null : 1,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n setCurrentDeduction(null)\n }\n setMode('LIST')\n }\n })\n }\n const handleAdd = () => {\n setMode('ADD')\n }\n const handleCancel = () => {\n setMode(activeDeductions.length < 1 ? 'INITIAL' : 'LIST')\n setCurrentDeduction(null)\n }\n const handleEdit = (deduction: Garnishment) => {\n setMode('EDIT')\n setCurrentDeduction(deduction)\n }\n const handlePassthrough = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n }\n return (\n <section className={className}>\n <DeductionsProvider\n value={{\n isPending: isPendingCreate || isPendingUpdate,\n employeeId,\n mode,\n deductions,\n handleAdd,\n handleCancel,\n handleDelete,\n handleEdit,\n handlePassthrough,\n }}\n >\n {mode === 'INITIAL' ? (\n <FormProvider {...includeDeductionsFormMethods}>\n <Form onSubmit={includeDeductionsFormMethods.handleSubmit(onSubmit)}>\n <Head />\n <IncludeDeductionsForm />\n <Actions />\n </Form>\n </FormProvider>\n ) : (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Head />\n <DeductionsList />\n <DeductionForm />\n <Actions />\n </Form>\n </FormProvider>\n )}\n </DeductionsProvider>\n </section>\n )\n}\n\nexport const DeductionsContextual = () => {\n const { employeeId, onEvent } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Deductions',\n param: 'employeeId',\n provider: 'FlowProvider',\n }),\n )\n }\n return <Deductions employeeId={employeeId} onEvent={onEvent} />\n}\n"],"names":["z","Deductions","props","jsx","BaseComponent","Root","employeeId","className","dictionary","onEvent","baseSubmitHandler","useBase","useComponentDictionary","data","useGarnishmentsListSuspense","deductions","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","activeDeductions","deduction","mode","setMode","useState","currentDeduction","setCurrentDeduction","useI18n","defaultValues","useMemo","includeDeductionsFormMethods","useForm","formMethods","zodResolver","DeductionSchema","resetForm","useEffect","handleDelete","payload","garnishment","componentEvents","onSubmit","createDeductionResponse","updateDeductionResponse","DeductionsProvider","FormProvider","jsxs","Form","Head","IncludeDeductionsForm","Actions","DeductionsList","DeductionForm","DeductionsContextual","useFlow","t","useTranslation"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsCgCA,EAAE,OAAO,EAAE,mBAAmBA,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC,EAAG,CAAA;AAG9E,SAASC,EAAWC,GAAiD;AAExE,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AACO,MAAMG,IAAO,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,YAAAC,QAAkC;AAC9E,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ;AAC/C,EAAAC,EAAuB,uBAAuBJ,CAAU;AAExD,QAAM,EAAE,MAAAK,EAAK,IAAIC,EAA4B,EAAE,YAAAR,GAAY,GACrDS,IAAaF,EAAK,iBAGlB,EAAE,aAAaG,GAAiB,WAAWC,EAAA,IAC/CC,EAA8B,GAC1B,EAAE,aAAaC,GAAiB,WAAWC,EAAA,IAC/CC,EAA8B,GAE1BC,IAAmBP,EAAW,OAAO,CAAAQ,MAAaA,EAAU,MAAM,GAClE,CAACC,GAAMC,CAAO,IAAIC,EAAeJ,EAAiB,SAAS,IAAI,YAAY,MAAM,GACjF,CAACK,GAAkBC,CAAmB,IAAIF,EAA6B,IAAI;AACjF,EAAAG,EAAQ,qBAAqB;AAEvB,QAAAC,IAAiCC,EAAQ,OACtC;AAAA,IACL,QAAQJ,GAAkB,SAAS,OAAOA,EAAiB,MAAM,IAAI;AAAA,IACrE,aAAaA,GAAkB,eAAe;AAAA,IAC9C,OAAOA,GAAkB,SAAS;AAAA,IAClC,WAAWA,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,QAgBQ,mBAfkB,MAAM;AAC9B,UAAAd,EAAQiC,EAAgB,uBAAuB;AAAA,QACjD;AAAA,MAcM;AAAA,MAEC,UAASlB,MAAA,YACP,gBAAArB,EAAA4C,GAAA,EAAc,GAAGf,GAChB,UAAC,gBAAAgB,EAAAC,GAAA,EAAK,UAAUjB,EAA6B,aAAaW,CAAQ,GAChE,UAAA;AAAA,QAAA,gBAAAxC,EAAC+C,GAAK,EAAA;AAAA,0BACLC,GAAsB,EAAA;AAAA,0BACtBC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA,EACF,CAAA,IAEC,gBAAAjD,EAAA4C,GAAA,EAAc,GAAGb,GAChB,UAAC,gBAAAc,EAAAC,GAAA,EAAK,UAAUf,EAAY,aAAaS,CAAQ,GAC/C,UAAA;AAAA,QAAA,gBAAAxC,EAAC+C,GAAK,EAAA;AAAA,0BACLG,GAAe,EAAA;AAAA,0BACfC,GAAc,EAAA;AAAA,0BACdF,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ,GAEaG,KAAuB,MAAM;AACxC,QAAM,EAAE,YAAAjD,GAAY,SAAAG,EAAQ,IAAI+C,EAAoC,GAC9D,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ;AAErC,MAAI,CAACpD;AACH,UAAM,IAAI;AAAA,MACRmD,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAO;AAAA,QACP,UAAU;AAAA,MACX,CAAA;AAAA,IACH;AAEK,SAAA,gBAAAtD,EAACF,GAAW,EAAA,YAAAK,GAAwB,SAAAG,EAAkB,CAAA;AAC/D;"}
1
+ {"version":3,"file":"Deductions.js","sources":["../../../../src/components/Employee/Deductions/Deductions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEffect, useMemo, useState } from 'react'\nimport { z } from 'zod'\nimport { FormProvider, useForm, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport {\n type DeductionInputs,\n type DeductionPayload,\n DeductionSchema,\n DeductionsProvider,\n type MODE,\n} from './useDeductions'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Actions } from '@/components/Employee/Deductions/Actions'\nimport { IncludeDeductionsForm } from '@/components/Employee/Deductions/IncludeDeductionsForm'\nimport { Head } from '@/components/Employee/Deductions/Head'\nimport { DeductionForm } from '@/components/Employee/Deductions/DeductionForm'\nimport { DeductionsList } from '@/components/Employee/Deductions/DeductionsList'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface DeductionsProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nconst IncludeDeductionsSchema = z.object({ includeDeductions: z.enum(['Yes', 'No']) })\nexport type IncludeDeductionsPayload = z.output<typeof IncludeDeductionsSchema>\n\nexport function Deductions(props: DeductionsProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nexport const Root = ({ employeeId, className, dictionary }: DeductionsProps) => {\n const { onEvent, baseSubmitHandler } = useBase()\n useComponentDictionary('Employee.Deductions', dictionary)\n\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n\n // Used for deletion or edit of deduction\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation()\n\n const activeDeductions = deductions.filter(deduction => deduction.active)\n const [mode, setMode] = useState<MODE>(activeDeductions.length < 1 ? 'INITIAL' : 'LIST')\n const [currentDeduction, setCurrentDeduction] = useState<Garnishment | null>(null)\n useI18n('Employee.Deductions')\n\n const defaultValues: DeductionInputs = useMemo(() => {\n return {\n amount: currentDeduction?.amount ? Number(currentDeduction.amount) : 0,\n description: currentDeduction?.description ?? '',\n times: currentDeduction?.times ?? null,\n recurring: currentDeduction?.recurring?.toString() ?? 'true',\n annualMaximum: currentDeduction?.annualMaximum\n ? Number(currentDeduction.annualMaximum)\n : null,\n payPeriodMaximum: currentDeduction?.payPeriodMaximum\n ? Number(currentDeduction.payPeriodMaximum)\n : null,\n deductAsPercentage: currentDeduction?.deductAsPercentage?.toString() ?? 'true',\n active: true,\n courtOrdered: currentDeduction?.courtOrdered ?? false,\n } as DeductionInputs\n }, [currentDeduction])\n\n const includeDeductionsFormMethods = useForm<IncludeDeductionsPayload>({\n // resolver: zodResolver(IncludeDeductionsSchema),\n defaultValues: { includeDeductions: 'No' },\n })\n\n const formMethods = useForm<DeductionInputs, unknown, DeductionPayload>({\n resolver: zodResolver(DeductionSchema),\n defaultValues,\n })\n\n const { reset: resetForm } = formMethods\n\n useEffect(() => {\n resetForm(defaultValues)\n }, [currentDeduction, defaultValues, resetForm, mode])\n\n const handleDelete = async (deduction: Garnishment) => {\n await baseSubmitHandler(deduction, async payload => {\n //Deletion of deduction is simply updating it with active: false\n const { garnishment } = await updateDeduction({\n request: {\n garnishmentId: payload.uuid,\n requestBody: {\n ...payload,\n totalAmount: payload.totalAmount ?? undefined,\n active: false,\n version: payload.version as string,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DELETED, garnishment)\n })\n }\n const onSubmit: SubmitHandler<DeductionPayload | IncludeDeductionsPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n if ('includeDeductions' in payload) {\n if (payload.includeDeductions === 'Yes') {\n setMode('ADD')\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_ADD)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n return\n }\n }\n if (!('includeDeductions' in payload)) {\n if (mode === 'ADD') {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId: employeeId,\n requestBody: { ...payload, times: payload.recurring ? null : 1 },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else if (mode === 'EDIT') {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: currentDeduction?.uuid ?? '',\n requestBody: {\n ...payload,\n version: currentDeduction?.version as string,\n times: payload.recurring ? null : 1,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n setCurrentDeduction(null)\n }\n setMode('LIST')\n }\n })\n }\n const handleAdd = () => {\n setMode('ADD')\n }\n const handleCancel = () => {\n setMode(activeDeductions.length < 1 ? 'INITIAL' : 'LIST')\n setCurrentDeduction(null)\n }\n const handleEdit = (deduction: Garnishment) => {\n setMode('EDIT')\n setCurrentDeduction(deduction)\n }\n const handlePassthrough = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n }\n return (\n <section className={className}>\n <DeductionsProvider\n value={{\n isPending: isPendingCreate || isPendingUpdate,\n employeeId,\n mode,\n deductions,\n handleAdd,\n handleCancel,\n handleDelete,\n handleEdit,\n handlePassthrough,\n }}\n >\n {mode === 'INITIAL' ? (\n <FormProvider {...includeDeductionsFormMethods}>\n <Form onSubmit={includeDeductionsFormMethods.handleSubmit(onSubmit)}>\n <Head />\n <IncludeDeductionsForm />\n <Actions />\n </Form>\n </FormProvider>\n ) : (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Head />\n <DeductionsList />\n <DeductionForm />\n <Actions />\n </Form>\n </FormProvider>\n )}\n </DeductionsProvider>\n </section>\n )\n}\n\nexport const DeductionsContextual = () => {\n const { employeeId, onEvent } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Deductions',\n param: 'employeeId',\n provider: 'FlowProvider',\n }),\n )\n }\n return <Deductions employeeId={employeeId} onEvent={onEvent} />\n}\n"],"names":["z","Deductions","props","jsx","BaseComponent","Root","employeeId","className","dictionary","onEvent","baseSubmitHandler","useBase","useComponentDictionary","data","useGarnishmentsListSuspense","deductions","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","activeDeductions","deduction","mode","setMode","useState","currentDeduction","setCurrentDeduction","useI18n","defaultValues","useMemo","includeDeductionsFormMethods","useForm","formMethods","zodResolver","DeductionSchema","resetForm","useEffect","handleDelete","payload","garnishment","componentEvents","onSubmit","createDeductionResponse","updateDeductionResponse","DeductionsProvider","FormProvider","jsxs","Form","Head","IncludeDeductionsForm","Actions","DeductionsList","DeductionForm","DeductionsContextual","useFlow","t","useTranslation"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsCgCA,EAAE,OAAO,EAAE,mBAAmBA,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC,EAAA,CAAG;AAG9E,SAASC,EAAWC,GAAiD;AAC1E,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AACO,MAAMG,IAAO,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,YAAAC,QAAkC;AAC9E,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA;AACvC,EAAAC,EAAuB,uBAAuBJ,CAAU;AAExD,QAAM,EAAE,MAAAK,EAAA,IAASC,EAA4B,E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G,KAAuB,MAAM;AACxC,QAAM,EAAE,YAAAjD,GAAY,SAAAG,EAAA,IAAY+C,EAAA,GAC1B,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ;AAErC,MAAI,CAACpD;AACH,UAAM,IAAI;AAAA,MACRmD,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAO;AAAA,QACP,UAAU;AAAA,MAAA,CACX;AAAA,IAAA;AAGL,SAAO,gBAAAtD,EAACF,GAAA,EAAW,YAAAK,GAAwB,SAAAG,EAAA,CAAkB;AAC/D;"}
@@ -1,14 +1,16 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { useTranslation as p } from "react-i18next";
2
+ import { useTranslation as f } from "react-i18next";
3
3
  import { useDeductions as g } from "./useDeductions.js";
4
+ import "classnames";
5
+ import "../../../shared/constants.js";
4
6
  import o from "../../Common/hooks/useNumberFormatter.js";
5
7
  import b from "../../../assets/icons/pencil.svg.js";
6
8
  import C from "../../../assets/icons/trashcan.svg.js";
7
9
  import { HamburgerMenu as h } from "../../Common/HamburgerMenu/HamburgerMenu.js";
8
10
  import { useDataView as y } from "../../Common/DataView/useDataView.js";
9
11
  import { DataView as D } from "../../Common/DataView/DataView.js";
10
- const S = () => {
11
- const { mode: i, deductions: m, handleDelete: a, handleEdit: u, isPending: c } = g(), { t: r } = p("Employee.Deductions"), s = o("currency"), l = o("percent"), d = m.filter((e) => e.active), { ...f } = y({
12
+ const E = () => {
13
+ const { mode: i, deductions: m, handleDelete: a, handleEdit: u, isPending: c } = g(), { t: r } = f("Employee.Deductions"), s = o("currency"), l = o("percent"), d = m.filter((e) => e.active), { ...p } = y({
12
14
  data: d,
13
15
  columns: [
14
16
  { key: "description", title: r("nameColumn") },
@@ -50,9 +52,9 @@ const S = () => {
50
52
  )
51
53
  });
52
54
  if (i === "LIST")
53
- return /* @__PURE__ */ t(D, { label: r("deductionsTableLabel"), ...f });
55
+ return /* @__PURE__ */ t(D, { label: r("deductionsTableLabel"), ...p });
54
56
  };
55
57
  export {
56
- S as DeductionsList
58
+ E as DeductionsList
57
59
  };
58
60
  //# sourceMappingURL=DeductionsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeductionsList.js","sources":["../../../../src/components/Employee/Deductions/DeductionsList.tsx"],"sourcesContent":["import type React from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { useDataView, DataView } from '@/components/Common'\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'\n\nexport const DeductionsList: React.FC = () => {\n const { mode, deductions, handleDelete, handleEdit, isPending } = useDeductions()\n const { t } = useTranslation('Employee.Deductions')\n const formatCurrency = useNumberFormatter('currency')\n const formatPercent = useNumberFormatter('percent')\n\n const activeDeductions = deductions.filter(deduction => deduction.active)\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={isPending}\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: () => {\n handleDelete(deduction)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST') return\n return <DataView label={t('deductionsTableLabel')} {...dataViewProps} />\n}\n"],"names":["DeductionsList","mode","deductions","handleDelete","handleEdit","isPending","useDeductions","t","useTranslation","formatCurrency","useNumberFormatter","formatPercent","activeDeductions","deduction","dataViewProps","useDataView","formattedAmount","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","DataView"],"mappings":";;;;;;;;;AASO,MAAMA,IAA2B,MAAM;AAC5C,QAAM,EAAE,MAAAC,GAAM,YAAAC,GAAY,cAAAC,GAAc,YAAAC,GAAY,WAAAC,MAAcC,EAAc,GAC1E,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAiBC,EAAmB,UAAU,GAC9CC,IAAgBD,EAAmB,SAAS,GAE5CE,IAAmBV,EAAW,OAAO,CAAAW,MAAaA,EAAU,MAAM,GAElE,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMH;AAAA,IACN,SAAS;AAAA,MACP,EAAE,KAAK,eAAe,OAAOL,EAAE,YAAY,EAAE;AAAA,MAC7C;AAAA,QACE,KAAK;AAAA,QACL,OAAOA,EAAE,iBAAiB;AAAA,QAC1B,QAAQ,CAAaM,MACZA,EAAU,YAAYN,EAAE,eAAe,IAAIA,EAAE,kBAAkB;AAAA,MAE1E;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAOA,EAAE,gBAAgB;AAAA,QACzB,QAAQ,CAAaM,MAAA;AACnB,gBAAMG,IAAkBH,EAAU,qBAC9BF,EAAc,OAAOE,EAAU,MAAM,CAAC,IACtCJ,EAAe,OAAOI,EAAU,MAAM,CAAC;AACpC,iBAAAA,EAAU,YACbN,EAAE,mBAAmB,EAAE,OAAOS,EAAiB,CAAA,IAC/CA;AAAA,QAAA;AAAA,MACN;AAAA,IAEJ;AAAA,IACA,UAAU,CAAaH,MAEnB,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,WAAWb;AAAA,QACX,OAAO;AAAA,UACL;AAAA,YACE,OAAOE,EAAE,SAAS;AAAA,YAClB,SAAS,MAAM;AACb,cAAAH,EAAWS,CAAS;AAAA,YACtB;AAAA,YACA,MAAM,gBAAAI,EAACE,GAAU,EAAA,eAAW,GAAC,CAAA;AAAA,UAC/B;AAAA,UACA;AAAA,YACE,OAAOZ,EAAE,WAAW;AAAA,YACpB,SAAS,MAAM;AACb,cAAAJ,EAAaU,CAAS;AAAA,YACxB;AAAA,YACA,MAAM,gBAAAI,EAACG,GAAY,EAAA,eAAW,GAAC,CAAA;AAAA,UAAA;AAAA,QACjC;AAAA,MACF;AAAA,IACF;AAAA,EAEJ,CACD;AAED,MAAInB,MAAS;AACb,6BAAQoB,GAAS,EAAA,OAAOd,EAAE,sBAAsB,GAAI,GAAGO,GAAe;AACxE;"}
1
+ {"version":3,"file":"DeductionsList.js","sources":["../../../../src/components/Employee/Deductions/DeductionsList.tsx"],"sourcesContent":["import type React from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { useDataView, DataView } from '@/components/Common'\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'\n\nexport const DeductionsList: React.FC = () => {\n const { mode, deductions, handleDelete, handleEdit, isPending } = useDeductions()\n const { t } = useTranslation('Employee.Deductions')\n const formatCurrency = useNumberFormatter('currency')\n const formatPercent = useNumberFormatter('percent')\n\n const activeDeductions = deductions.filter(deduction => deduction.active)\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={isPending}\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: () => {\n handleDelete(deduction)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST') return\n return <DataView label={t('deductionsTableLabel')} {...dataViewProps} />\n}\n"],"names":["DeductionsList","mode","deductions","handleDelete","handleEdit","isPending","useDeductions","t","useTranslation","formatCurrency","useNumberFormatter","formatPercent","activeDeductions","deduction","dataViewProps","useDataView","formattedAmount","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","DataView"],"mappings":";;;;;;;;;;;AASO,MAAMA,IAA2B,MAAM;AAC5C,QAAM,EAAE,MAAAC,GAAM,YAAAC,GAAY,cAAAC,GAAc,YAAAC,GAAY,WAAAC,EAAA,IAAcC,EAAA,GAC5D,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAiBC,EAAmB,UAAU,GAC9CC,IAAgBD,EAAmB,SAAS,GAE5CE,IAAmBV,EAAW,OAAO,CAAAW,MAAaA,EAAU,MAAM,GAElE,EAAE,GAAGC,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMH;AAAA,IACN,SAAS;AAAA,MACP,EAAE,KAAK,eAAe,OAAOL,EAAE,YAAY,EAAA;AAAA,MAC3C;AAAA,QACE,KAAK;AAAA,QACL,OAAOA,EAAE,iBAAiB;AAAA,QAC1B,QAAQ,CAAAM,MACCA,EAAU,YAAYN,EAAE,eAAe,IAAIA,EAAE,kBAAkB;AAAA,MACxE;AAAA,MAEF;AAAA,QACE,KAAK;AAAA,QACL,OAAOA,EAAE,gBAAgB;AAAA,QACzB,QAAQ,CAAAM,MAAa;AACnB,gBAAMG,IAAkBH,EAAU,qBAC9BF,EAAc,OAAOE,EAAU,MAAM,CAAC,IACtCJ,EAAe,OAAOI,EAAU,MAAM,CAAC;AAC3C,iBAAOA,EAAU,YACbN,EAAE,mBAAmB,EAAE,OAAOS,EAAA,CAAiB,IAC/CA;AAAA,QACN;AAAA,MAAA;AAAA,IACF;AAAA,IAEF,UAAU,CAAAH,MAEN,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,WAAWb;AAAA,QACX,OAAO;AAAA,UACL;AAAA,YACE,OAAOE,EAAE,SAAS;AAAA,YAClB,SAAS,MAAM;AACb,cAAAH,EAAWS,CAAS;AAAA,YACtB;AAAA,YACA,MAAM,gBAAAI,EAACE,GAAA,EAAU,eAAW,GAAA,CAAC;AAAA,UAAA;AAAA,UAE/B;AAAA,YACE,OAAOZ,EAAE,WAAW;AAAA,YACpB,SAAS,MAAM;AACb,cAAAJ,EAAaU,CAAS;AAAA,YACxB;AAAA,YACA,MAAM,gBAAAI,EAACG,GAAA,EAAY,eAAW,GAAA,CAAC;AAAA,UAAA;AAAA,QACjC;AAAA,MACF;AAAA,IAAA;AAAA,EAGN,CACD;AAED,MAAInB,MAAS;AACb,6BAAQoB,GAAA,EAAS,OAAOd,EAAE,sBAAsB,GAAI,GAAGO,GAAe;AACxE;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Head.js","sources":["../../../../src/components/Employee/Deductions/Head.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Head() {\n const { t } = useTranslation('Employee.Deductions')\n const { mode } = useDeductions()\n const Components = useComponentContext()\n\n if (mode !== 'INITIAL' && mode !== 'LIST') return\n return (\n <>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n </>\n )\n}\n"],"names":["Head","useTranslation","mode","useDeductions","Components","useComponentContext","jsx","Fragment"],"mappings":";;;;AAIO,SAASA,IAAO;AACrB,QAAM,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,MAAAC,EAAK,IAAIC,EAAc,GACzBC,IAAaC,EAAoB;AAEnC,MAAA,EAAAH,MAAS,aAAaA,MAAS;AAEjC,WAAA,gBAAAI,EAAAC,GAAA,EACE,UAAC,gBAAAD,EAAAF,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,WAAW,EAAA,CAAE,EAC9C,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Head.js","sources":["../../../../src/components/Employee/Deductions/Head.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Head() {\n const { t } = useTranslation('Employee.Deductions')\n const { mode } = useDeductions()\n const Components = useComponentContext()\n\n if (mode !== 'INITIAL' && mode !== 'LIST') return\n return (\n <>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n </>\n )\n}\n"],"names":["Head","useTranslation","mode","useDeductions","Components","useComponentContext","jsx","Fragment"],"mappings":";;;;AAIO,SAASA,IAAO;AACrB,QAAM,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,MAAAC,EAAA,IAASC,EAAA,GACXC,IAAaC,EAAA;AAEnB,MAAI,EAAAH,MAAS,aAAaA,MAAS;AACnC,WACE,gBAAAI,EAAAC,GAAA,EACE,UAAA,gBAAAD,EAACF,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,WAAW,EAAA,CAAE,EAAA,CAC9C;AAEJ;"}
@@ -1,12 +1,14 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { useTranslation as n } from "react-i18next";
3
- import { useDeductions as t } from "./useDeductions.js";
4
- import { RadioGroupField as u } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
5
- const l = () => {
6
- const { mode: o } = t(), { t: e } = n("Employee.Deductions");
2
+ import { useTranslation as t } from "react-i18next";
3
+ import { useDeductions as n } from "./useDeductions.js";
4
+ import "classnames";
5
+ import "../../../shared/constants.js";
6
+ import { RadioGroupField as r } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
7
+ const p = () => {
8
+ const { mode: o } = n(), { t: e } = t("Employee.Deductions");
7
9
  if (o === "INITIAL")
8
10
  return /* @__PURE__ */ i(
9
- u,
11
+ r,
10
12
  {
11
13
  name: "includeDeductions",
12
14
  isRequired: !0,
@@ -20,6 +22,6 @@ const l = () => {
20
22
  );
21
23
  };
22
24
  export {
23
- l as IncludeDeductionsForm
25
+ p as IncludeDeductionsForm
24
26
  };
25
27
  //# sourceMappingURL=IncludeDeductionsForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IncludeDeductionsForm.js","sources":["../../../../src/components/Employee/Deductions/IncludeDeductionsForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { RadioGroupField } from '@/components/Common'\n\nexport const IncludeDeductionsForm = () => {\n const { mode } = useDeductions()\n const { t } = useTranslation('Employee.Deductions')\n if (mode !== 'INITIAL') return\n return (\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 )\n}\n"],"names":["IncludeDeductionsForm","mode","useDeductions","t","useTranslation","jsx","RadioGroupField"],"mappings":";;;;AAIO,MAAMA,IAAwB,MAAM;AACnC,QAAA,EAAE,MAAAC,EAAK,IAAIC,EAAc,GACzB,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB;AAClD,MAAIH,MAAS;AAEX,WAAA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAOH,EAAE,4BAA4B;AAAA,QACrC,aAAaA,EAAE,8BAA8B;AAAA,QAC7C,SAAS;AAAA,UACP,EAAE,OAAO,OAAO,OAAOA,EAAE,sBAAsB,EAAE;AAAA,UACjD,EAAE,OAAO,MAAM,OAAOA,EAAE,qBAAqB,EAAE;AAAA,QAAA;AAAA,MACjD;AAAA,IACF;AAEJ;"}
1
+ {"version":3,"file":"IncludeDeductionsForm.js","sources":["../../../../src/components/Employee/Deductions/IncludeDeductionsForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { RadioGroupField } from '@/components/Common'\n\nexport const IncludeDeductionsForm = () => {\n const { mode } = useDeductions()\n const { t } = useTranslation('Employee.Deductions')\n if (mode !== 'INITIAL') return\n return (\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 )\n}\n"],"names":["IncludeDeductionsForm","mode","useDeductions","t","useTranslation","jsx","RadioGroupField"],"mappings":";;;;;;AAIO,MAAMA,IAAwB,MAAM;AACzC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAA,GACX,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB;AAClD,MAAIH,MAAS;AACb,WACE,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAOH,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;AAGN;"}
@@ -9,9 +9,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
9
9
  import "@tanstack/react-query";
10
10
  import "../../Base/useBase.js";
11
11
  import "../../../shared/constants.js";
12
+ import "classnames";
12
13
  import "dompurify";
13
14
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
14
- import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
15
15
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
16
16
  const D = r.object({
17
17
  active: r.boolean(),
@@ -1 +1 @@
1
- {"version":3,"file":"useDeductions.js","sources":["../../../../src/components/Employee/Deductions/useDeductions.ts"],"sourcesContent":["import type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE = 'ADD' | 'LIST' | 'INITIAL' | 'EDIT'\n\nexport const DeductionSchema = z.object({\n active: z.boolean(),\n amount: z.number().min(0).transform(String),\n description: z.string().min(1),\n courtOrdered: z.boolean(),\n times: z.number().nullable(), //The number of times to apply the garnishment. Ignored if recurring is true.\n recurring: z.string().transform(val => val === 'true'),\n annualMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n payPeriodMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n deductAsPercentage: z.string().transform(val => val === 'true'),\n})\n\nexport type DeductionInputs = z.input<typeof DeductionSchema>\nexport type DeductionPayload = z.output<typeof DeductionSchema>\n\ntype DeductionsContextType = {\n isPending: boolean\n deductions: Garnishment[]\n employeeId: string\n mode: MODE\n handleAdd: () => void\n handleCancel: () => void\n handleEdit: (deduction: Garnishment) => void\n handleDelete: (deduction: Garnishment) => void\n handlePassthrough: () => void\n}\nconst [useDeductions, DeductionsProvider] =\n createCompoundContext<DeductionsContextType>('DeductionsContext')\nexport { useDeductions, DeductionsProvider }\n"],"names":["DeductionSchema","z","val","useDeductions","DeductionsProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAMa,MAAAA,IAAkBC,EAAE,OAAO;AAAA,EACtC,QAAQA,EAAE,QAAQ;AAAA,EAClB,QAAQA,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,UAAU,MAAM;AAAA,EAC1C,aAAaA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC7B,cAAcA,EAAE,QAAQ;AAAA,EACxB,OAAOA,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAC3B,WAAWA,EAAE,SAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAAA,EACrD,eAAeD,EACZ,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAQC,MAAAA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAS;AAAA,EACZ,kBAAkBD,EACf,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAQC,MAAAA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAS;AAAA,EACZ,oBAAoBD,EAAE,SAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAChE,CAAC,GAgBK,CAACC,GAAeC,CAAkB,IACtCC,EAA6C,mBAAmB;"}
1
+ {"version":3,"file":"useDeductions.js","sources":["../../../../src/components/Employee/Deductions/useDeductions.ts"],"sourcesContent":["import type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE = 'ADD' | 'LIST' | 'INITIAL' | 'EDIT'\n\nexport const DeductionSchema = z.object({\n active: z.boolean(),\n amount: z.number().min(0).transform(String),\n description: z.string().min(1),\n courtOrdered: z.boolean(),\n times: z.number().nullable(), //The number of times to apply the garnishment. Ignored if recurring is true.\n recurring: z.string().transform(val => val === 'true'),\n annualMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n payPeriodMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n deductAsPercentage: z.string().transform(val => val === 'true'),\n})\n\nexport type DeductionInputs = z.input<typeof DeductionSchema>\nexport type DeductionPayload = z.output<typeof DeductionSchema>\n\ntype DeductionsContextType = {\n isPending: boolean\n deductions: Garnishment[]\n employeeId: string\n mode: MODE\n handleAdd: () => void\n handleCancel: () => void\n handleEdit: (deduction: Garnishment) => void\n handleDelete: (deduction: Garnishment) => void\n handlePassthrough: () => void\n}\nconst [useDeductions, DeductionsProvider] =\n createCompoundContext<DeductionsContextType>('DeductionsContext')\nexport { useDeductions, DeductionsProvider }\n"],"names":["DeductionSchema","z","val","useDeductions","DeductionsProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAMO,MAAMA,IAAkBC,EAAE,OAAO;AAAA,EACtC,QAAQA,EAAE,QAAA;AAAA,EACV,QAAQA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,UAAU,MAAM;AAAA,EAC1C,aAAaA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC7B,cAAcA,EAAE,QAAA;AAAA,EAChB,OAAOA,EAAE,OAAA,EAAS,SAAA;AAAA;AAAA,EAClB,WAAWA,EAAE,OAAA,EAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAAA,EACrD,eAAeD,EACZ,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAAC,MAAQA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAA;AAAA,EACH,kBAAkBD,EACf,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAAC,MAAQA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAA;AAAA,EACH,oBAAoBD,EAAE,OAAA,EAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAChE,CAAC,GAgBK,CAACC,GAAeC,CAAkB,IACtCC,EAA6C,mBAAmB;"}
@@ -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,EAAkB,IAAIC,EAAgB,GACxDC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAASH,GAAgB,WAAW,IAAO,YAAY,CAACC,GACxE,UAAEH,EAAA,aAAa,EAClB,CAAA,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;AAE5E,SAAA,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAM,EAAA,GAAGH,GAAO,EACnB,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,WAAAC,GAAW,UAAAC,KAA+B;AACpE,EAAAC,EAAQ,yBAAyB;AAC3B,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GAEtB,EAAE,MAAAC,GAAM,OAAOC,MAAsBC,EAA6B,EAAE,YAAAR,GAAY,GAChFS,IAAgBH,EAAK,UAErBI,IAAoBD,EAAc,MAAM,CAAgBE,MAAA,CAACA,EAAa,eAAe;AAWzF,SAAA,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,MACF;AAAA,MAEC,UACCL,KAEC,gBAAAY,EAAAC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAlB,EAACmB,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA;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;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Head.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/Head.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nfunction Head() {\n const { t } = useTranslation('Employee.DocumentSigner')\n const Components = useComponentContext()\n\n return <Components.Heading as=\"h2\">{t('documentListTitle')}</Components.Heading>\n}\n\nexport { Head }\n"],"names":["Head","t","useTranslation","Components","useComponentContext","jsx"],"mappings":";;;AAGA,SAASA,IAAO;AACd,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChDC,IAAaC,EAAoB;AAEhC,SAAA,gBAAAC,EAACF,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,mBAAmB,GAAE;AAC7D;"}
1
+ {"version":3,"file":"Head.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/Head.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nfunction Head() {\n const { t } = useTranslation('Employee.DocumentSigner')\n const Components = useComponentContext()\n\n return <Components.Heading as=\"h2\">{t('documentListTitle')}</Components.Heading>\n}\n\nexport { Head }\n"],"names":["Head","t","useTranslation","Components","useComponentContext","jsx"],"mappings":";;;AAGA,SAASA,IAAO;AACd,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChDC,IAAaC,EAAA;AAEnB,SAAO,gBAAAC,EAACF,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,mBAAmB,GAAE;AAC7D;"}
@@ -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,EAAgB,GAChF,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB;AAEtD,SACG,gBAAAC,EAAA,WAAA,EAAQ,OAAO,EAAE,OAAO,UACvB,UAAA,gBAAAA,EAACC,GAAK,EAAA,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAD;AAAA,IAACE;AAAAA,IAAA;AAAA,MACC,OAAOR,EAAc,IAAI,CAASS,OAAA;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,MAC/B;AAAA,MACA,cAAc;AAAA,QACZ,SAASA,EAAE,iBAAiB;AAAA,QAC5B,WAAWA,EAAE,WAAW;AAAA,QACxB,UAAUA,EAAE,sBAAsB;AAAA,MACpC;AAAA,MACA,iBAAiBA,EAAE,iBAAiB;AAAA,MACpC,YAAYA,EAAE,mBAAmB;AAAA,IAAA;AAAA,KAErC,EACF,CAAA;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,9 +8,9 @@ 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";
12
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
13
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
14
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
15
15
  const [d, a] = t("DocumentListContext");
16
16
  export {
@@ -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,IACF;AAAA,EACF;AACA,SAAQ,gBAAAS,EAAAC,GAAA,EAAK,SAASN,GAAgB,SAAAH,EAAkB,CAAA;AAC1D;"}
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;"}