@gusto/embedded-react-sdk 0.11.0 → 0.11.2

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 (426) hide show
  1. package/CHANGELOG.md +20 -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.map +1 -1
  22. package/dist/components/Base/createCompoundContext.js.map +1 -1
  23. package/dist/components/Base/useBase.js.map +1 -1
  24. package/dist/components/Common/ActionsLayout/ActionsLayout.js.map +1 -1
  25. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  26. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  27. package/dist/components/Common/DataView/DataView.js +20 -20
  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.map +1 -1
  72. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  73. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  74. package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
  75. package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
  76. package/dist/components/Common/UI/Alert/Alert.module.scss.js +1 -1
  77. package/dist/components/Common/UI/Badge/Badge.js +4 -4
  78. package/dist/components/Common/UI/Badge/Badge.js.map +1 -1
  79. package/dist/components/Common/UI/Badge/Badge.module.scss.js +4 -4
  80. package/dist/components/Common/UI/Button/Button.d.ts +1 -1
  81. package/dist/components/Common/UI/Button/Button.js +22 -24
  82. package/dist/components/Common/UI/Button/Button.js.map +1 -1
  83. package/dist/components/Common/UI/Button/Button.module.scss.js +1 -1
  84. package/dist/components/Common/UI/Button/ButtonIcon.d.ts +1 -1
  85. package/dist/components/Common/UI/Button/ButtonIcon.js +7 -5
  86. package/dist/components/Common/UI/Button/ButtonIcon.js.map +1 -1
  87. package/dist/components/Common/UI/Button/ButtonIcon.module.scss.js +8 -0
  88. package/dist/components/Common/UI/Button/ButtonIcon.module.scss.js.map +1 -0
  89. package/dist/components/Common/UI/Button/ButtonTypes.d.ts +2 -6
  90. package/dist/components/Common/UI/CalendarPreview/CalendarLegend.js.map +1 -1
  91. package/dist/components/Common/UI/CalendarPreview/CalendarPreview.js.map +1 -1
  92. package/dist/components/Common/UI/Card/Card.js.map +1 -1
  93. package/dist/components/Common/UI/Checkbox/Checkbox.js.map +1 -1
  94. package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js +8 -8
  95. package/dist/components/Common/UI/CheckboxGroup/CheckboxGroup.js.map +1 -1
  96. package/dist/components/Common/UI/CheckboxGroup/CheckboxGroup.module.scss.js +1 -1
  97. package/dist/components/Common/UI/ComboBox/ComboBox.js +36 -36
  98. package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
  99. package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +1 -1
  100. package/dist/components/Common/UI/DatePicker/DatePicker.js.map +1 -1
  101. package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +8 -8
  102. package/dist/components/Common/UI/Heading/Heading.js.map +1 -1
  103. package/dist/components/Common/UI/Heading/Heading.module.scss.js +11 -11
  104. package/dist/components/Common/UI/Input/Input.js.map +1 -1
  105. package/dist/components/Common/UI/Input/Input.module.scss.js +10 -10
  106. package/dist/components/Common/UI/Link/Link.js.map +1 -1
  107. package/dist/components/Common/UI/List/OrderedList.js.map +1 -1
  108. package/dist/components/Common/UI/List/UnorderedList.js.map +1 -1
  109. package/dist/components/Common/UI/Menu/Menu.js.map +1 -1
  110. package/dist/components/Common/UI/NumberInput/NumberInput.js.map +1 -1
  111. package/dist/components/Common/UI/ProgressBar/ProgressBar.js.map +1 -1
  112. package/dist/components/Common/UI/Radio/Radio.js.map +1 -1
  113. package/dist/components/Common/UI/Radio/Radio.module.scss.js +1 -1
  114. package/dist/components/Common/UI/RadioGroup/RadioGroup.js.map +1 -1
  115. package/dist/components/Common/UI/RadioGroup/RadioGroup.module.scss.js +1 -1
  116. package/dist/components/Common/UI/Select/Select.js +13 -13
  117. package/dist/components/Common/UI/Select/Select.js.map +1 -1
  118. package/dist/components/Common/UI/Select/Select.module.scss.js +1 -1
  119. package/dist/components/Common/UI/Switch/Switch.js.map +1 -1
  120. package/dist/components/Common/UI/Table/Table.js.map +1 -1
  121. package/dist/components/Common/UI/Text/Text.js.map +1 -1
  122. package/dist/components/Common/UI/Text/Text.module.scss.js +16 -20
  123. package/dist/components/Common/UI/Text/Text.module.scss.js.map +1 -1
  124. package/dist/components/Common/UI/Text/TextTypes.d.ts +1 -1
  125. package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
  126. package/dist/components/Common/UI/hooks/useFieldIds.js.map +1 -1
  127. package/dist/components/Common/VisuallyHidden/VisuallyHidden.js.map +1 -1
  128. package/dist/components/Common/hooks/useAsyncError.js.map +1 -1
  129. package/dist/components/Common/hooks/useMenu.js.map +1 -1
  130. package/dist/components/Common/hooks/useNumberFormatter.js.map +1 -1
  131. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  132. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  133. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  134. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  135. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  136. package/dist/components/Company/AssignSignatory/CreateSignatory/Schema.js.map +1 -1
  137. package/dist/components/Company/AssignSignatory/Head.js.map +1 -1
  138. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  139. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  140. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  141. package/dist/components/Company/AssignSignatory/SignatoryForm.js.map +1 -1
  142. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  143. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  144. package/dist/components/Company/BankAccount/BankAccountComponents.js.map +1 -1
  145. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  146. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  147. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  148. package/dist/components/Company/BankAccount/BankAccountForm/Head.js.map +1 -1
  149. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js.map +1 -1
  150. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  151. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
  152. package/dist/components/Company/BankAccount/BankAccountList/Head.js.map +1 -1
  153. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  154. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
  155. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  156. package/dist/components/Company/BankAccount/BankAccountVerify/Head.js.map +1 -1
  157. package/dist/components/Company/BankAccount/stateMachine.js.map +1 -1
  158. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  159. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  160. package/dist/components/Company/DocumentSigner/DocumentList/Head.js.map +1 -1
  161. package/dist/components/Company/DocumentSigner/DocumentList/List.js.map +1 -1
  162. package/dist/components/Company/DocumentSigner/DocumentList/ManageSignatories.js.map +1 -1
  163. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  164. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  165. package/dist/components/Company/DocumentSigner/SignatureForm/Actions.js.map +1 -1
  166. package/dist/components/Company/DocumentSigner/SignatureForm/Form.js.map +1 -1
  167. package/dist/components/Company/DocumentSigner/SignatureForm/Head.js.map +1 -1
  168. package/dist/components/Company/DocumentSigner/SignatureForm/Preview.js.map +1 -1
  169. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  170. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  171. package/dist/components/Company/DocumentSigner/assignSignatoryState.js.map +1 -1
  172. package/dist/components/Company/DocumentSigner/documentSignerStateMachine.js.map +1 -1
  173. package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -1
  174. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  175. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  176. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  177. package/dist/components/Company/FederalTaxes/Head.js.map +1 -1
  178. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  179. package/dist/components/Company/Industry/Actions.js.map +1 -1
  180. package/dist/components/Company/Industry/Edit.js.map +1 -1
  181. package/dist/components/Company/Industry/Head.js.map +1 -1
  182. package/dist/components/Company/Industry/Industry.js.map +1 -1
  183. package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
  184. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  185. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  186. package/dist/components/Company/Locations/LocationForm/Head.js.map +1 -1
  187. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  188. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  189. package/dist/components/Company/Locations/Locations.js.map +1 -1
  190. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  191. package/dist/components/Company/Locations/LocationsList/Head.js.map +1 -1
  192. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  193. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  194. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  195. package/dist/components/Company/Locations/locationsStateMachine.js.map +1 -1
  196. package/dist/components/Company/Locations/stateMachine.js.map +1 -1
  197. package/dist/components/Company/OnboardingFlow/OnboardingFlow.js.map +1 -1
  198. package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
  199. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  200. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  201. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  202. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  203. package/dist/components/Company/PaySchedule/PaySchedule.js +29 -28
  204. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  205. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  206. package/dist/components/Company/PaySchedule/_parts/Edit.js +50 -51
  207. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  208. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  209. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  210. package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +0 -3
  211. package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -8
  212. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  213. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  214. package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -1
  215. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  216. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
  217. package/dist/components/Company/StateTaxes/StateTaxesForm/Head.js.map +1 -1
  218. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  219. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  220. package/dist/components/Company/StateTaxes/StateTaxesList/Head.js.map +1 -1
  221. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  222. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  223. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
  224. package/dist/components/Contractor/Address/Actions.js.map +1 -1
  225. package/dist/components/Contractor/Address/Address.js.map +1 -1
  226. package/dist/components/Contractor/Address/Form.js.map +1 -1
  227. package/dist/components/Contractor/Address/Head.js.map +1 -1
  228. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  229. package/dist/components/Contractor/List/index.js.map +1 -1
  230. package/dist/components/Contractor/List/useContractorList.js.map +1 -1
  231. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  232. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +1 -0
  233. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  234. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  235. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  236. package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -1
  237. package/dist/components/Contractor/Profile/ContractorProfileForm.js +10 -8
  238. package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -1
  239. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  240. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js.map +1 -1
  241. package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -1
  242. package/dist/components/Contractor/Submit/index.js.map +1 -1
  243. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  244. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  245. package/dist/components/Employee/Compensation/Edit.js +17 -16
  246. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  247. package/dist/components/Employee/Compensation/Head.js.map +1 -1
  248. package/dist/components/Employee/Compensation/List.js.map +1 -1
  249. package/dist/components/Employee/Compensation/useCompensation.js.map +1 -1
  250. package/dist/components/Employee/Deductions/Actions.js.map +1 -1
  251. package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
  252. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  253. package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
  254. package/dist/components/Employee/Deductions/Head.js.map +1 -1
  255. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +9 -8
  256. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
  257. package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
  258. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  259. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  260. package/dist/components/Employee/DocumentSigner/DocumentList/Head.js.map +1 -1
  261. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  262. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  263. package/dist/components/Employee/DocumentSigner/SignatureForm/Actions.js.map +1 -1
  264. package/dist/components/Employee/DocumentSigner/SignatureForm/Form.js.map +1 -1
  265. package/dist/components/Employee/DocumentSigner/SignatureForm/Head.js.map +1 -1
  266. package/dist/components/Employee/DocumentSigner/SignatureForm/Preview.js.map +1 -1
  267. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  268. package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.js.map +1 -1
  269. package/dist/components/Employee/DocumentSigner/stateMachine.js.map +1 -1
  270. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  271. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  272. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  273. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  274. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  275. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
  276. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  277. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
  278. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  279. package/dist/components/Employee/PaymentMethod/BankAccount.js.map +1 -1
  280. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -4
  281. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  282. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  283. package/dist/components/Employee/PaymentMethod/Head.js.map +1 -1
  284. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  285. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  286. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  287. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  288. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  289. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  290. package/dist/components/Employee/Profile/Head.js.map +1 -1
  291. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  292. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +51 -49
  293. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  294. package/dist/components/Employee/Profile/Profile.js +1 -1
  295. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  296. package/dist/components/Employee/Profile/SelfPersonalDetails.js.map +1 -1
  297. package/dist/components/Employee/Profile/WorkAddress.js.map +1 -1
  298. package/dist/components/Employee/Profile/getEmployeeAddressForProfile.js.map +1 -1
  299. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
  300. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -1
  301. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
  302. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  303. package/dist/components/Employee/Taxes/FederalForm.js +1 -0
  304. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  305. package/dist/components/Employee/Taxes/FederalHead.js.map +1 -1
  306. package/dist/components/Employee/Taxes/StateForm.js.map +1 -1
  307. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  308. package/dist/components/Flow/Flow.js.map +1 -1
  309. package/dist/components/Flow/useFlow.js.map +1 -1
  310. package/dist/contexts/ApiProvider/ApiProvider.d.ts +5 -2
  311. package/dist/contexts/ApiProvider/ApiProvider.js +34 -30
  312. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  313. package/dist/contexts/ComponentAdapter/ComponentsProvider.js.map +1 -1
  314. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  315. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  316. package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
  317. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +3 -1
  318. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +12 -12
  319. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  320. package/dist/contexts/GustoProvider/SDKI18next.js.map +1 -1
  321. package/dist/contexts/GustoProvider/index.d.ts +2 -0
  322. package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.js.map +1 -1
  323. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js.map +1 -1
  324. package/dist/contexts/LocaleProvider/LocaleProvider.js.map +1 -1
  325. package/dist/contexts/LocaleProvider/useLocale.js.map +1 -1
  326. package/dist/contexts/ThemeProvider/ThemeProvider.d.ts +4 -1
  327. package/dist/contexts/ThemeProvider/ThemeProvider.js +60 -22
  328. package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
  329. package/dist/contexts/ThemeProvider/createTheme.d.ts +0 -1
  330. package/dist/contexts/ThemeProvider/createTheme.js +14 -16
  331. package/dist/contexts/ThemeProvider/createTheme.js.map +1 -1
  332. package/dist/contexts/ThemeProvider/theme.d.ts +59 -0
  333. package/dist/contexts/ThemeProvider/theme.js +101 -0
  334. package/dist/contexts/ThemeProvider/theme.js.map +1 -0
  335. package/dist/contexts/ThemeProvider/useTheme.js.map +1 -1
  336. package/dist/contexts/index.d.ts +4 -0
  337. package/dist/helpers/LRUCache.js.map +1 -1
  338. package/dist/helpers/dateFormatting.d.ts +10 -2
  339. package/dist/helpers/dateFormatting.js +30 -7
  340. package/dist/helpers/dateFormatting.js.map +1 -1
  341. package/dist/helpers/dateFormatting.test.d.ts +1 -0
  342. package/dist/helpers/ensureRequired.js.map +1 -1
  343. package/dist/helpers/federalEin.js.map +1 -1
  344. package/dist/helpers/formattedStrings.js.map +1 -1
  345. package/dist/helpers/getDataProps.js.map +1 -1
  346. package/dist/helpers/mask.js.map +1 -1
  347. package/dist/helpers/payRateCalculator.js.map +1 -1
  348. package/dist/helpers/rem.js +2 -3
  349. package/dist/helpers/rem.js.map +1 -1
  350. package/dist/helpers/responsive.js.map +1 -1
  351. package/dist/helpers/ssn.js.map +1 -1
  352. package/dist/helpers/validations.js.map +1 -1
  353. package/dist/hooks/useContainerBreakpoints/useContainerBreakpoints.js +34 -23
  354. package/dist/hooks/useContainerBreakpoints/useContainerBreakpoints.js.map +1 -1
  355. package/dist/hooks/useForkRef/useForkRef.js.map +1 -1
  356. package/dist/i18n/I18n.js.map +1 -1
  357. package/dist/i18n/en/Company.AddBank.json.js +12 -12
  358. package/dist/i18n/en/Company.Addresses.json.js +12 -12
  359. package/dist/i18n/en/Company.AssignSignatory.json.js +5 -54
  360. package/dist/i18n/en/Company.AssignSignatory.json.js.map +1 -1
  361. package/dist/i18n/en/Company.BankAccount.json.js +19 -40
  362. package/dist/i18n/en/Company.BankAccount.json.js.map +1 -1
  363. package/dist/i18n/en/Company.DocumentList.json.js +15 -15
  364. package/dist/i18n/en/Company.FederalTaxes.json.js +16 -32
  365. package/dist/i18n/en/Company.FederalTaxes.json.js.map +1 -1
  366. package/dist/i18n/en/Company.Locations.json.js +43 -49
  367. package/dist/i18n/en/Company.Locations.json.js.map +1 -1
  368. package/dist/i18n/en/Company.OnboardingOverview.json.js +14 -36
  369. package/dist/i18n/en/Company.OnboardingOverview.json.js.map +1 -1
  370. package/dist/i18n/en/Company.PaySchedule.json.js +1 -44
  371. package/dist/i18n/en/Company.PaySchedule.json.js.map +1 -1
  372. package/dist/i18n/en/Company.SignatureForm.json.js +9 -9
  373. package/dist/i18n/en/Company.StateTaxes.json.js +1 -25
  374. package/dist/i18n/en/Company.StateTaxes.json.js.map +1 -1
  375. package/dist/i18n/en/Contractor.Address.json.js +19 -24
  376. package/dist/i18n/en/Contractor.Address.json.js.map +1 -1
  377. package/dist/i18n/en/Contractor.ContractorList.json.js +9 -12
  378. package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -1
  379. package/dist/i18n/en/Contractor.ContractorSubmit.json.js +10 -14
  380. package/dist/i18n/en/Contractor.ContractorSubmit.json.js.map +1 -1
  381. package/dist/i18n/en/Contractor.NewHireReport.json.js +5 -7
  382. package/dist/i18n/en/Contractor.NewHireReport.json.js.map +1 -1
  383. package/dist/i18n/en/Contractor.PaymentMethod.json.js +4 -17
  384. package/dist/i18n/en/Contractor.PaymentMethod.json.js.map +1 -1
  385. package/dist/i18n/en/Contractor.Profile.json.js +1 -58
  386. package/dist/i18n/en/Contractor.Profile.json.js.map +1 -1
  387. package/dist/i18n/en/Employee.BankAccount.json.js +17 -19
  388. package/dist/i18n/en/Employee.BankAccount.json.js.map +1 -1
  389. package/dist/i18n/en/Employee.Compensation.json.js +31 -65
  390. package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
  391. package/dist/i18n/en/Employee.Deductions.json.js +56 -59
  392. package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
  393. package/dist/i18n/en/Employee.DocumentSigner.json.js +23 -23
  394. package/dist/i18n/en/Employee.EmployeeList.json.js +29 -29
  395. package/dist/i18n/en/Employee.HomeAddress.json.js +23 -28
  396. package/dist/i18n/en/Employee.HomeAddress.json.js.map +1 -1
  397. package/dist/i18n/en/Employee.Landing.json.js +11 -15
  398. package/dist/i18n/en/Employee.Landing.json.js.map +1 -1
  399. package/dist/i18n/en/Employee.OnboardingSummary.json.js +6 -28
  400. package/dist/i18n/en/Employee.OnboardingSummary.json.js.map +1 -1
  401. package/dist/i18n/en/Employee.PaySchedules.json.js +1 -5
  402. package/dist/i18n/en/Employee.PaySchedules.json.js.map +1 -1
  403. package/dist/i18n/en/Employee.PaymentMethod.json.js +29 -36
  404. package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
  405. package/dist/i18n/en/Employee.Profile.json.js +16 -22
  406. package/dist/i18n/en/Employee.Profile.json.js.map +1 -1
  407. package/dist/i18n/en/Employee.SplitPaycheck.json.js +21 -25
  408. package/dist/i18n/en/Employee.SplitPaycheck.json.js.map +1 -1
  409. package/dist/i18n/en/Employee.StateTaxes.json.js +4 -4
  410. package/dist/i18n/en/Employee.Taxes.json.js +26 -29
  411. package/dist/i18n/en/Employee.Taxes.json.js.map +1 -1
  412. package/dist/i18n/en/Payroll.PayrollHistoryList.json.js +9 -9
  413. package/dist/i18n/en/common.json.d.ts +1 -1
  414. package/dist/i18n/en/common.json.js +1 -147
  415. package/dist/i18n/en/common.json.js.map +1 -1
  416. package/dist/index.d.ts +1 -0
  417. package/dist/index.js +11 -9
  418. package/dist/index.js.map +1 -1
  419. package/dist/models/NAICSValues.js.map +1 -1
  420. package/dist/models/WA_RISK_CODES.js.map +1 -1
  421. package/dist/style.css +1 -1
  422. package/dist/types/GTheme.d.ts +0 -1
  423. package/dist/types/hooks.d.ts +36 -0
  424. package/package.json +10 -10
  425. package/dist/hooks/useDebounce/useDebounce.js +0 -19
  426. package/dist/hooks/useDebounce/useDebounce.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"OnboardingFlowComponents.js","sources":["../../../../src/components/Company/OnboardingFlow/OnboardingFlowComponents.tsx"],"sourcesContent":["import { Industry } from '../Industry'\nimport { BankAccount } from '../BankAccount/BankAccount'\nimport { PaySchedule } from '../PaySchedule'\nimport { StateTaxes } from '../StateTaxes/StateTaxes'\nimport { DocumentSigner } from '../DocumentSigner'\nimport { OnboardingOverview } from '../OnboardingOverview/OnboardingOverview'\nimport { FederalTaxes } from '../FederalTaxes'\nimport type { FederalTaxesDefaultValues } from '../FederalTaxes/useFederalTaxes'\nimport type { PayScheduleDefaultValues } from '../PaySchedule/usePaySchedule'\nimport { Locations } from '@/components/Company/Locations/Locations'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { OnboardingFlow as EmployeeOnboardingFlow } from '@/components/Employee/OnboardingFlow/OnboardingFlow'\n\nexport type OnboardingFlowDefaultValues = RequireAtLeastOne<{\n federalTaxes?: FederalTaxesDefaultValues\n paySchedule?: PayScheduleDefaultValues\n}>\nexport interface OnboardingFlowProps extends BaseComponentInterface {\n companyId: string\n defaultValues?: RequireAtLeastOne<OnboardingFlowDefaultValues>\n}\nexport interface OnboardingFlowContextInterface extends FlowContextInterface {\n companyId: string\n defaultValues?: OnboardingFlowDefaultValues\n}\n\nexport function LocationsContextual() {\n const { companyId, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return <Locations onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\nexport function FederalTaxesContextual() {\n const { companyId, defaultValues, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return (\n <FederalTaxes\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n defaultValues={defaultValues?.federalTaxes}\n />\n )\n}\n\nexport function IndustryContextual() {\n const { companyId, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return <Industry onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n\nexport function BankAccountContextual() {\n const { companyId, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return <BankAccount onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\nexport function EmployeesContextual() {\n const { companyId, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return <EmployeeOnboardingFlow onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\nexport function PayScheduleContextual() {\n const { companyId, defaultValues, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return (\n <PaySchedule\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n defaultValues={defaultValues?.paySchedule}\n />\n )\n}\nexport function StateTaxesContextual() {\n const { companyId, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return <StateTaxes onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\nexport function DocumentSignerContextual() {\n const { companyId, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return <DocumentSigner onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\nexport function OnboardingOverviewContextual() {\n const { companyId, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return <OnboardingOverview companyId={ensureRequired(companyId)} onEvent={onEvent} />\n}\n"],"names":["LocationsContextual","companyId","onEvent","useFlow","Locations","ensureRequired","FederalTaxesContextual","defaultValues","jsx","FederalTaxes","IndustryContextual","Industry","BankAccountContextual","BankAccount","EmployeesContextual","EmployeeOnboardingFlow","PayScheduleContextual","PaySchedule","StateTaxesContextual","StateTaxes","DocumentSignerContextual","DocumentSigner","OnboardingOverviewContextual","OnboardingOverview"],"mappings":";;;;;;;;;;;;AA6BO,SAASA,IAAsB;AACpC,QAAM,EAAE,WAAAC,GAAW,SAAAC,EAAQ,IAAIC,EAAwC;AACvE,2BAAQC,GAAU,EAAA,SAAAF,GAAkB,WAAWG,EAAeJ,CAAS,GAAG;AAC5E;AACO,SAASK,IAAyB;AACvC,QAAM,EAAE,WAAAL,GAAW,eAAAM,GAAe,SAAAL,EAAA,IAAYC,EAAwC;AAEpF,SAAA,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAAP;AAAA,MACA,WAAWG,EAAeJ,CAAS;AAAA,MACnC,eAAeM,GAAe;AAAA,IAAA;AAAA,EAChC;AAEJ;AAEO,SAASG,IAAqB;AACnC,QAAM,EAAE,WAAAT,GAAW,SAAAC,EAAQ,IAAIC,EAAwC;AACvE,2BAAQQ,GAAS,EAAA,SAAAT,GAAkB,WAAWG,EAAeJ,CAAS,GAAG;AAC3E;AAEO,SAASW,IAAwB;AACtC,QAAM,EAAE,WAAAX,GAAW,SAAAC,EAAQ,IAAIC,EAAwC;AACvE,2BAAQU,GAAY,EAAA,SAAAX,GAAkB,WAAWG,EAAeJ,CAAS,GAAG;AAC9E;AACO,SAASa,IAAsB;AACpC,QAAM,EAAE,WAAAb,GAAW,SAAAC,EAAQ,IAAIC,EAAwC;AACvE,2BAAQY,GAAuB,EAAA,SAAAb,GAAkB,WAAWG,EAAeJ,CAAS,GAAG;AACzF;AACO,SAASe,IAAwB;AACtC,QAAM,EAAE,WAAAf,GAAW,eAAAM,GAAe,SAAAL,EAAA,IAAYC,EAAwC;AAEpF,SAAA,gBAAAK;AAAA,IAACS;AAAA,IAAA;AAAA,MACC,SAAAf;AAAA,MACA,WAAWG,EAAeJ,CAAS;AAAA,MACnC,eAAeM,GAAe;AAAA,IAAA;AAAA,EAChC;AAEJ;AACO,SAASW,IAAuB;AACrC,QAAM,EAAE,WAAAjB,GAAW,SAAAC,EAAQ,IAAIC,EAAwC;AACvE,2BAAQgB,GAAW,EAAA,SAAAjB,GAAkB,WAAWG,EAAeJ,CAAS,GAAG;AAC7E;AACO,SAASmB,IAA2B;AACzC,QAAM,EAAE,WAAAnB,GAAW,SAAAC,EAAQ,IAAIC,EAAwC;AACvE,2BAAQkB,GAAe,EAAA,SAAAnB,GAAkB,WAAWG,EAAeJ,CAAS,GAAG;AACjF;AACO,SAASqB,IAA+B;AAC7C,QAAM,EAAE,WAAArB,GAAW,SAAAC,EAAQ,IAAIC,EAAwC;AACvE,2BAAQoB,GAAmB,EAAA,WAAWlB,EAAeJ,CAAS,GAAG,SAAAC,GAAkB;AACrF;"}
1
+ {"version":3,"file":"OnboardingFlowComponents.js","sources":["../../../../src/components/Company/OnboardingFlow/OnboardingFlowComponents.tsx"],"sourcesContent":["import { Industry } from '../Industry'\nimport { BankAccount } from '../BankAccount/BankAccount'\nimport { PaySchedule } from '../PaySchedule'\nimport { StateTaxes } from '../StateTaxes/StateTaxes'\nimport { DocumentSigner } from '../DocumentSigner'\nimport { OnboardingOverview } from '../OnboardingOverview/OnboardingOverview'\nimport { FederalTaxes } from '../FederalTaxes'\nimport type { FederalTaxesDefaultValues } from '../FederalTaxes/useFederalTaxes'\nimport type { PayScheduleDefaultValues } from '../PaySchedule/usePaySchedule'\nimport { Locations } from '@/components/Company/Locations/Locations'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { OnboardingFlow as EmployeeOnboardingFlow } from '@/components/Employee/OnboardingFlow/OnboardingFlow'\n\nexport type OnboardingFlowDefaultValues = RequireAtLeastOne<{\n federalTaxes?: FederalTaxesDefaultValues\n paySchedule?: PayScheduleDefaultValues\n}>\nexport interface OnboardingFlowProps extends BaseComponentInterface {\n companyId: string\n defaultValues?: RequireAtLeastOne<OnboardingFlowDefaultValues>\n}\nexport interface OnboardingFlowContextInterface extends FlowContextInterface {\n companyId: string\n defaultValues?: OnboardingFlowDefaultValues\n}\n\nexport function LocationsContextual() {\n const { companyId, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return <Locations onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\nexport function FederalTaxesContextual() {\n const { companyId, defaultValues, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return (\n <FederalTaxes\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n defaultValues={defaultValues?.federalTaxes}\n />\n )\n}\n\nexport function IndustryContextual() {\n const { companyId, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return <Industry onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n\nexport function BankAccountContextual() {\n const { companyId, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return <BankAccount onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\nexport function EmployeesContextual() {\n const { companyId, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return <EmployeeOnboardingFlow onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\nexport function PayScheduleContextual() {\n const { companyId, defaultValues, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return (\n <PaySchedule\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n defaultValues={defaultValues?.paySchedule}\n />\n )\n}\nexport function StateTaxesContextual() {\n const { companyId, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return <StateTaxes onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\nexport function DocumentSignerContextual() {\n const { companyId, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return <DocumentSigner onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\nexport function OnboardingOverviewContextual() {\n const { companyId, onEvent } = useFlow<OnboardingFlowContextInterface>()\n return <OnboardingOverview companyId={ensureRequired(companyId)} onEvent={onEvent} />\n}\n"],"names":["LocationsContextual","companyId","onEvent","useFlow","Locations","ensureRequired","FederalTaxesContextual","defaultValues","jsx","FederalTaxes","IndustryContextual","Industry","BankAccountContextual","BankAccount","EmployeesContextual","EmployeeOnboardingFlow","PayScheduleContextual","PaySchedule","StateTaxesContextual","StateTaxes","DocumentSignerContextual","DocumentSigner","OnboardingOverviewContextual","OnboardingOverview"],"mappings":";;;;;;;;;;;;AA6BO,SAASA,IAAsB;AACpC,QAAM,EAAE,WAAAC,GAAW,SAAAC,EAAA,IAAYC,EAAA;AAC/B,2BAAQC,GAAA,EAAU,SAAAF,GAAkB,WAAWG,EAAeJ,CAAS,GAAG;AAC5E;AACO,SAASK,IAAyB;AACvC,QAAM,EAAE,WAAAL,GAAW,eAAAM,GAAe,SAAAL,EAAA,IAAYC,EAAA;AAC9C,SACE,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAAP;AAAA,MACA,WAAWG,EAAeJ,CAAS;AAAA,MACn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1 @@
1
- {"version":3,"file":"onboardingStateMachine.js","sources":["../../../../src/components/Company/OnboardingFlow/onboardingStateMachine.ts"],"sourcesContent":["import { transition, reduce, state } from 'robot3'\nimport {\n BankAccountContextual,\n DocumentSignerContextual,\n EmployeesContextual,\n FederalTaxesContextual,\n IndustryContextual,\n LocationsContextual,\n OnboardingOverviewContextual,\n PayScheduleContextual,\n StateTaxesContextual,\n type OnboardingFlowContextInterface,\n} from './OnboardingFlowComponents'\nimport { componentEvents } from '@/shared/constants'\n\nconst createReducer = (props: Partial<OnboardingFlowContextInterface>) => {\n return (ctx: OnboardingFlowContextInterface): OnboardingFlowContextInterface => ({\n ...ctx,\n ...props,\n })\n}\nexport const onboardingMachine = {\n overview: state(\n transition(\n componentEvents.COMPANY_OVERVIEW_CONTINUE,\n 'locations',\n reduce(createReducer({ component: LocationsContextual, currentStep: 1, showProgress: true })),\n ),\n transition(componentEvents.COMPANY_OVERVIEW_DONE, 'final'),\n ),\n locations: state(\n transition(\n componentEvents.COMPANY_LOCATION_DONE,\n 'federalTaxes',\n reduce(createReducer({ component: FederalTaxesContextual, currentStep: 2 })),\n ),\n ),\n federalTaxes: state(\n transition(\n componentEvents.COMPANY_FEDERAL_TAXES_DONE,\n 'industry',\n reduce(createReducer({ component: IndustryContextual, currentStep: 3 })),\n ),\n ),\n industry: state(\n transition(\n componentEvents.COMPANY_INDUSTRY_SELECTED,\n 'bankAccount',\n reduce(createReducer({ component: BankAccountContextual, currentStep: 4 })),\n ),\n ),\n bankAccount: state(\n transition(\n componentEvents.COMPANY_BANK_ACCOUNT_DONE,\n 'employees',\n reduce(createReducer({ component: EmployeesContextual, currentStep: 5 })),\n ),\n ),\n employees: state(\n transition(\n componentEvents.EMPLOYEE_ONBOARDING_DONE,\n 'payschedule',\n reduce(createReducer({ component: PayScheduleContextual, currentStep: 6 })),\n ),\n ),\n payschedule: state(\n transition(\n componentEvents.PAY_SCHEDULE_DONE,\n 'stateTaxes',\n reduce(createReducer({ component: StateTaxesContextual, currentStep: 7 })),\n ),\n ),\n stateTaxes: state(\n transition(\n componentEvents.COMPANY_STATE_TAX_DONE,\n 'documents',\n reduce(createReducer({ component: DocumentSignerContextual, currentStep: 8 })),\n ),\n ),\n documents: state(\n transition(\n componentEvents.COMPANY_FORMS_DONE,\n 'overview',\n reduce(\n createReducer({\n component: OnboardingOverviewContextual,\n currentStep: 1,\n showProgress: false,\n }),\n ),\n ),\n ),\n\n final: state(),\n}\n"],"names":["createReducer","props","ctx","onboardingMachine","state","transition","componentEvents","reduce","LocationsContextual","FederalTaxesContextual","IndustryContextual","BankAccountContextual","EmployeesContextual","PayScheduleContextual","StateTaxesContextual","DocumentSignerContextual","OnboardingOverviewContextual"],"mappings":";;;AAeA,MAAMA,IAAgB,CAACC,MACd,CAACC,OAAyE;AAAA,EAC/E,GAAGA;AAAA,EACH,GAAGD;AAAA,IAGME,IAAoB;AAAA,EAC/B,UAAUC;AAAA,IACRC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOP,EAAc,EAAE,WAAWQ,GAAqB,aAAa,GAAG,cAAc,IAAM,CAAC;AAAA,IAC9F;AAAA,IACAH,EAAWC,EAAgB,uBAAuB,OAAO;AAAA,EAC3D;AAAA,EACA,WAAWF;AAAA,IACTC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOP,EAAc,EAAE,WAAWS,GAAwB,aAAa,GAAG,CAAC;AAAA,IAAA;AAAA,EAE/E;AAAA,EACA,cAAcL;AAAA,IACZC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOP,EAAc,EAAE,WAAWU,GAAoB,aAAa,GAAG,CAAC;AAAA,IAAA;AAAA,EAE3E;AAAA,EACA,UAAUN;AAAA,IACRC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOP,EAAc,EAAE,WAAWW,GAAuB,aAAa,GAAG,CAAC;AAAA,IAAA;AAAA,EAE9E;AAAA,EACA,aAAaP;AAAA,IACXC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOP,EAAc,EAAE,WAAWY,GAAqB,aAAa,GAAG,CAAC;AAAA,IAAA;AAAA,EAE5E;AAAA,EACA,WAAWR;AAAA,IACTC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOP,EAAc,EAAE,WAAWa,GAAuB,aAAa,GAAG,CAAC;AAAA,IAAA;AAAA,EAE9E;AAAA,EACA,aAAaT;AAAA,IACXC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOP,EAAc,EAAE,WAAWc,GAAsB,aAAa,GAAG,CAAC;AAAA,IAAA;AAAA,EAE7E;AAAA,EACA,YAAYV;AAAA,IACVC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOP,EAAc,EAAE,WAAWe,GAA0B,aAAa,GAAG,CAAC;AAAA,IAAA;AAAA,EAEjF;AAAA,EACA,WAAWX;AAAA,IACTC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWgB;AAAA,UACX,aAAa;AAAA,UACb,cAAc;AAAA,QACf,CAAA;AAAA,MAAA;AAAA,IACH;AAAA,EAEJ;AAAA,EAEA,OAAOZ,EAAM;AACf;"}
1
+ {"version":3,"file":"onboardingStateMachine.js","sources":["../../../../src/components/Company/OnboardingFlow/onboardingStateMachine.ts"],"sourcesContent":["import { transition, reduce, state } from 'robot3'\nimport {\n BankAccountContextual,\n DocumentSignerContextual,\n EmployeesContextual,\n FederalTaxesContextual,\n IndustryContextual,\n LocationsContextual,\n OnboardingOverviewContextual,\n PayScheduleContextual,\n StateTaxesContextual,\n type OnboardingFlowContextInterface,\n} from './OnboardingFlowComponents'\nimport { componentEvents } from '@/shared/constants'\n\nconst createReducer = (props: Partial<OnboardingFlowContextInterface>) => {\n return (ctx: OnboardingFlowContextInterface): OnboardingFlowContextInterface => ({\n ...ctx,\n ...props,\n })\n}\nexport const onboardingMachine = {\n overview: state(\n transition(\n componentEvents.COMPANY_OVERVIEW_CONTINUE,\n 'locations',\n reduce(createReducer({ component: LocationsContextual, currentStep: 1, showProgress: true })),\n ),\n transition(componentEvents.COMPANY_OVERVIEW_DONE, 'final'),\n ),\n locations: state(\n transition(\n componentEvents.COMPANY_LOCATION_DONE,\n 'federalTaxes',\n reduce(createReducer({ component: FederalTaxesContextual, currentStep: 2 })),\n ),\n ),\n federalTaxes: state(\n transition(\n componentEvents.COMPANY_FEDERAL_TAXES_DONE,\n 'industry',\n reduce(createReducer({ component: IndustryContextual, currentStep: 3 })),\n ),\n ),\n industry: state(\n transition(\n componentEvents.COMPANY_INDUSTRY_SELECTED,\n 'bankAccount',\n reduce(createReducer({ component: BankAccountContextual, currentStep: 4 })),\n ),\n ),\n bankAccount: state(\n transition(\n componentEvents.COMPANY_BANK_ACCOUNT_DONE,\n 'employees',\n reduce(createReducer({ component: EmployeesContextual, currentStep: 5 })),\n ),\n ),\n employees: state(\n transition(\n componentEvents.EMPLOYEE_ONBOARDING_DONE,\n 'payschedule',\n reduce(createReducer({ component: PayScheduleContextual, currentStep: 6 })),\n ),\n ),\n payschedule: state(\n transition(\n componentEvents.PAY_SCHEDULE_DONE,\n 'stateTaxes',\n reduce(createReducer({ component: StateTaxesContextual, currentStep: 7 })),\n ),\n ),\n stateTaxes: state(\n transition(\n componentEvents.COMPANY_STATE_TAX_DONE,\n 'documents',\n reduce(createReducer({ component: DocumentSignerContextual, currentStep: 8 })),\n ),\n ),\n documents: state(\n transition(\n componentEvents.COMPANY_FORMS_DONE,\n 'overview',\n reduce(\n createReducer({\n component: OnboardingOverviewContextual,\n currentStep: 1,\n showProgress: false,\n }),\n ),\n ),\n ),\n\n final: state(),\n}\n"],"names":["createReducer","props","ctx","onboardingMachine","state","transition","componentEvents","reduce","LocationsContextual","FederalTaxesContextual","IndustryContextual","BankAccountContextual","EmployeesContextual","PayScheduleContextual","StateTaxesContextual","DocumentSignerContextual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A;AAAA,EAC3E;AAAA,EAEF,YAAYV;AAAA,IACVC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOP,EAAc,EAAE,WAAWe,GAA0B,aAAa,GAAG,CAAC;AAAA,IAAA;AAAA,EAC/E;AAAA,EAEF,WAAWX;AAAA,IACTC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWgB;AAAA,UACX,aAAa;AAAA,UACb,cAAc;AAAA,QAAA,CACf;AAAA,MAAA;AAAA,IACH;AAAA,EACF;AAAA,EAGF,OAAOZ,EAAA;AACT;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Completed.js","sources":["../../../../src/components/Company/OnboardingOverview/Completed.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Completed = () => {\n const Components = useComponentContext()\n const { onboardingCompleted, handleDone } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n if (!onboardingCompleted) {\n return null\n }\n return (\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardingCompletedTitle')}\n </Components.Heading>\n <p>{t('onboardingCompletedDescription')}</p>\n <Components.Button variant=\"secondary\" onClick={handleDone}>\n {t('onboardingCompletedCta')}\n </Components.Button>\n </Flex>\n )\n}\n"],"names":["Completed","Components","useComponentContext","onboardingCompleted","handleDone","useOnboardingOverview","t","useTranslation","Flex","jsx"],"mappings":";;;;;;;AAKO,MAAMA,IAAY,MAAM;AAC7B,QAAMC,IAAaC,EAAoB,GACjC,EAAE,qBAAAC,GAAqB,YAAAC,EAAW,IAAIC,EAAsB,GAC5D,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AACzD,SAAKJ,sBAIFK,GAAK,EAAA,YAAW,UAAS,eAAc,UAAS,KAAK,GACpD,UAAA;AAAA,IAAC,gBAAAC,EAAAR,EAAW,SAAX,EAAmB,IAAG,MAAK,WAAU,UACnC,UAAEK,EAAA,0BAA0B,EAC/B,CAAA;AAAA,IACC,gBAAAG,EAAA,KAAA,EAAG,UAAEH,EAAA,gCAAgC,EAAE,CAAA;AAAA,IACxC,gBAAAG,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASG,GAC7C,UAAEE,EAAA,wBAAwB,EAC7B,CAAA;AAAA,EAAA,GACF,IAXO;AAaX;"}
1
+ {"version":3,"file":"Completed.js","sources":["../../../../src/components/Company/OnboardingOverview/Completed.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Completed = () => {\n const Components = useComponentContext()\n const { onboardingCompleted, handleDone } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n if (!onboardingCompleted) {\n return null\n }\n return (\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardingCompletedTitle')}\n </Components.Heading>\n <p>{t('onboardingCompletedDescription')}</p>\n <Components.Button variant=\"secondary\" onClick={handleDone}>\n {t('onboardingCompletedCta')}\n </Components.Button>\n </Flex>\n )\n}\n"],"names":["Completed","Components","useComponentContext","onboardingCompleted","handleDone","useOnboardingOverview","t","useTranslation","Flex","jsx"],"mappings":";;;;;;;AAKO,MAAMA,IAAY,MAAM;AAC7B,QAAMC,IAAaC,EAAA,GACb,EAAE,qBAAAC,GAAqB,YAAAC,EAAA,IAAeC,EAAA,GACtC,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AACzD,SAAKJ,sBAIFK,GAAA,EAAK,YAAW,UAAS,eAAc,UAAS,KAAK,GACpD,UAAA;AAAA,IAAA,gBAAAC,EAACR,EAAW,SAAX,EAAmB,IAAG,MAAK,WAAU,UACnC,UAAAK,EAAE,0BAA0B,EAAA,CAC/B;AAAA,IACA,gBAAAG,EAAC,KAAA,EAAG,UAAAH,EAAE,gCAAgC,EAAA,CAAE;AAAA,IACxC,gBAAAG,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASG,GAC7C,UAAAE,EAAE,wBAAwB,EAAA,CAC7B;AAAA,EAAA,GACF,IAXO;AAaX;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MissingRequirements.js","sources":["../../../../src/components/Company/OnboardingOverview/MissingRequirements.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { RequirementsList } from '@/components/Common/RequirementsList/RequirementsList'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const MissingRequirements = () => {\n const Components = useComponentContext()\n const { onboardingSteps, onboardingCompleted, handleContinue } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n\n if (onboardingCompleted) {\n return null\n }\n\n const isInitialSetup = !onboardingSteps?.some(step => step.required && step.completed)\n\n return (\n <Flex flexDirection=\"column\" alignItems=\"flex-start\" gap={8}>\n <Components.Heading as=\"h2\">\n {t(isInitialSetup ? 'initialSetupTitle' : 'missingRequirementsTitle')}\n </Components.Heading>\n <p>{t(isInitialSetup ? 'initialSetupDescription' : 'missingRequirementsDescription')}</p>\n {onboardingSteps && (\n <RequirementsList\n requirements={onboardingSteps.map(step => ({\n completed: step.completed!,\n title: t(`stepTitles.${step.id!}`),\n description: t(`stepDescriptions.${step.id!}`),\n }))}\n />\n )}\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleContinue}>\n {t(isInitialSetup ? 'initialSetupCta' : 'missingRequirementsCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["MissingRequirements","Components","useComponentContext","onboardingSteps","onboardingCompleted","handleContinue","useOnboardingOverview","t","useTranslation","isInitialSetup","step","Flex","jsx","RequirementsList","ActionsLayout"],"mappings":";;;;;;;;;AAMO,MAAMA,IAAsB,MAAM;AACvC,QAAMC,IAAaC,EAAoB,GACjC,EAAE,iBAAAC,GAAiB,qBAAAC,GAAqB,gBAAAC,EAAA,IAAmBC,EAAsB,GACjF,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AAEzD,MAAIJ;AACK,WAAA;AAGH,QAAAK,IAAiB,CAACN,GAAiB,KAAK,OAAQO,EAAK,YAAYA,EAAK,SAAS;AAErF,2BACGC,GAAK,EAAA,eAAc,UAAS,YAAW,cAAa,KAAK,GACxD,UAAA;AAAA,IAAC,gBAAAC,EAAAX,EAAW,SAAX,EAAmB,IAAG,MACpB,UAAEM,EAAAE,IAAiB,sBAAsB,0BAA0B,EACtE,CAAA;AAAA,sBACC,KAAG,EAAA,UAAAF,EAAEE,IAAiB,4BAA4B,gCAAgC,GAAE;AAAA,IACpFN,KACC,gBAAAS;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,cAAcV,EAAgB,IAAI,CAASO,OAAA;AAAA,UACzC,WAAWA,EAAK;AAAA,UAChB,OAAOH,EAAE,cAAcG,EAAK,EAAG,EAAE;AAAA,UACjC,aAAaH,EAAE,oBAAoBG,EAAK,EAAG,EAAE;AAAA,QAAA,EAC7C;AAAA,MAAA;AAAA,IACJ;AAAA,IAED,gBAAAE,EAAAE,GAAA,EACC,UAAC,gBAAAF,EAAAX,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASI,GAC7C,UAAEE,EAAAE,IAAiB,oBAAoB,wBAAwB,GAClE,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"MissingRequirements.js","sources":["../../../../src/components/Company/OnboardingOverview/MissingRequirements.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { RequirementsList } from '@/components/Common/RequirementsList/RequirementsList'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const MissingRequirements = () => {\n const Components = useComponentContext()\n const { onboardingSteps, onboardingCompleted, handleContinue } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n\n if (onboardingCompleted) {\n return null\n }\n\n const isInitialSetup = !onboardingSteps?.some(step => step.required && step.completed)\n\n return (\n <Flex flexDirection=\"column\" alignItems=\"flex-start\" gap={8}>\n <Components.Heading as=\"h2\">\n {t(isInitialSetup ? 'initialSetupTitle' : 'missingRequirementsTitle')}\n </Components.Heading>\n <p>{t(isInitialSetup ? 'initialSetupDescription' : 'missingRequirementsDescription')}</p>\n {onboardingSteps && (\n <RequirementsList\n requirements={onboardingSteps.map(step => ({\n completed: step.completed!,\n title: t(`stepTitles.${step.id!}`),\n description: t(`stepDescriptions.${step.id!}`),\n }))}\n />\n )}\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleContinue}>\n {t(isInitialSetup ? 'initialSetupCta' : 'missingRequirementsCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["MissingRequirements","Components","useComponentContext","onboardingSteps","onboardingCompleted","handleContinue","useOnboardingOverview","t","useTranslation","isInitialSetup","step","Flex","jsx","RequirementsList","ActionsLayout"],"mappings":";;;;;;;;;AAMO,MAAMA,IAAsB,MAAM;AACvC,QAAMC,IAAaC,EAAA,GACb,EAAE,iBAAAC,GAAiB,qBAAAC,GAAqB,gBAAAC,EAAA,IAAmBC,EAAA,GAC3D,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AAEzD,MAAIJ;AACF,WAAO;AAGT,QAAMK,IAAiB,CAACN,GAAiB,KAAK,OAAQO,EAAK,YAAYA,EAAK,SAAS;AAErF,2BACGC,GAAA,EAAK,eAAc,UAAS,YAAW,cAAa,KAAK,GACxD,UAAA;AAAA,IAAA,gBAAAC,EAACX,EAAW,SAAX,EAAmB,IAAG,MACpB,UAAAM,EAAEE,IAAiB,sBAAsB,0BAA0B,EAAA,CACtE;AAAA,sBACC,KAAA,EAAG,UAAAF,EAAEE,IAAiB,4BAA4B,gCAAgC,GAAE;AAAA,IACpFN,KACC,gBAAAS;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,cAAcV,EAAgB,IAAI,CAAAO,OAAS;AAAA,UACzC,WAAWA,EAAK;AAAA,UAChB,OAAOH,EAAE,cAAcG,EAAK,EAAG,EAAE;AAAA,UACjC,aAAaH,EAAE,oBAAoBG,EAAK,EAAG,EAAE;AAAA,QAAA,EAC7C;AAAA,MAAA;AAAA,IAAA;AAAA,IAGN,gBAAAE,EAACE,GAAA,EACC,UAAA,gBAAAF,EAACX,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASI,GAC7C,UAAAE,EAAEE,IAAiB,oBAAoB,wBAAwB,GAClE,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"OnboardingOverview.js","sources":["../../../../src/components/Company/OnboardingOverview/OnboardingOverview.tsx"],"sourcesContent":["import { useCompaniesGetOnboardingStatusSuspense } from '@gusto/embedded-api/react-query/companiesGetOnboardingStatus'\nimport { OnboardingOverviewProvider } from './context'\nimport { MissingRequirements } from './MissingRequirements'\nimport { Completed } from './Completed'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { Flex } from '@/components/Common'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface OnboardingOverviewProps extends CommonComponentInterface<'Company.OnboardingOverview'> {\n companyId: string\n}\n\nexport function OnboardingOverview(props: OnboardingOverviewProps & BaseComponentInterface) {\n useI18n('Company.OnboardingOverview')\n useComponentDictionary('Company.OnboardingOverview', props.dictionary)\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, className, children }: OnboardingOverviewProps) => {\n const { onEvent } = useBase()\n\n const { data } = useCompaniesGetOnboardingStatusSuspense({ companyUuid: companyId })\n const { onboardingCompleted, onboardingSteps } = data.companyOnboardingStatus!\n\n const handleDone = () => {\n onEvent(componentEvents.COMPANY_OVERVIEW_DONE)\n }\n const handleContinue = () => {\n onEvent(componentEvents.COMPANY_OVERVIEW_CONTINUE)\n }\n\n return (\n <section className={className}>\n <OnboardingOverviewProvider\n value={{\n onboardingCompleted,\n onboardingSteps,\n handleDone,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Completed />\n <MissingRequirements />\n </>\n )}\n </Flex>\n </OnboardingOverviewProvider>\n </section>\n )\n}\n"],"names":["OnboardingOverview","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","companyId","className","children","onEvent","useBase","data","useCompaniesGetOnboardingStatusSuspense","onboardingCompleted","onboardingSteps","OnboardingOverviewProvider","componentEvents","Flex","jsxs","Fragment","Completed","MissingRequirements"],"mappings":";;;;;;;;;;;AAmBO,SAASA,EAAmBC,GAAyD;AAC1F,SAAAC,EAAQ,4BAA4B,GACbC,EAAA,8BAA8BF,EAAM,UAAU,GAEnE,gBAAAG,EAACC,GAAe,EAAA,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,KAAM,GAAGL,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,MAAMK,IAAO,CAAC,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,QAAwC;AACtE,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GAEtB,EAAE,MAAAC,EAAK,IAAIC,EAAwC,EAAE,aAAaN,GAAW,GAC7E,EAAE,qBAAAO,GAAqB,iBAAAC,EAAgB,IAAIH,EAAK;AAUpD,SAAA,gBAAAR,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,qBAAAF;AAAA,QACA,iBAAAC;AAAA,QACA,YAbW,MAAM;AACvB,UAAAL,EAAQO,EAAgB,qBAAqB;AAAA,QAC/C;AAAA,QAYQ,gBAXe,MAAM;AAC3B,UAAAP,EAAQO,EAAgB,yBAAyB;AAAA,QACnD;AAAA,MAUM;AAAA,MAEA,UAAA,gBAAAb,EAACc,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAT,KAIG,gBAAAU,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAhB,EAACiB,GAAU,EAAA;AAAA,0BACVC,GAAoB,CAAA,CAAA;AAAA,MAAA,EAAA,CACvB,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"OnboardingOverview.js","sources":["../../../../src/components/Company/OnboardingOverview/OnboardingOverview.tsx"],"sourcesContent":["import { useCompaniesGetOnboardingStatusSuspense } from '@gusto/embedded-api/react-query/companiesGetOnboardingStatus'\nimport { OnboardingOverviewProvider } from './context'\nimport { MissingRequirements } from './MissingRequirements'\nimport { Completed } from './Completed'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { Flex } from '@/components/Common'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface OnboardingOverviewProps extends CommonComponentInterface<'Company.OnboardingOverview'> {\n companyId: string\n}\n\nexport function OnboardingOverview(props: OnboardingOverviewProps & BaseComponentInterface) {\n useI18n('Company.OnboardingOverview')\n useComponentDictionary('Company.OnboardingOverview', props.dictionary)\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, className, children }: OnboardingOverviewProps) => {\n const { onEvent } = useBase()\n\n const { data } = useCompaniesGetOnboardingStatusSuspense({ companyUuid: companyId })\n const { onboardingCompleted, onboardingSteps } = data.companyOnboardingStatus!\n\n const handleDone = () => {\n onEvent(componentEvents.COMPANY_OVERVIEW_DONE)\n }\n const handleContinue = () => {\n onEvent(componentEvents.COMPANY_OVERVIEW_CONTINUE)\n }\n\n return (\n <section className={className}>\n <OnboardingOverviewProvider\n value={{\n onboardingCompleted,\n onboardingSteps,\n handleDone,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Completed />\n <MissingRequirements />\n </>\n )}\n </Flex>\n </OnboardingOverviewProvider>\n </section>\n )\n}\n"],"names":["OnboardingOverview","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","companyId","className","children","onEvent","useBase","data","useCompaniesGetOnboardingStatusSuspense","onboardingCompleted","onboardingSteps","OnboardingOverviewProvider","componentEvents","Flex","jsxs","Fragment","Completed","MissingRequirements"],"mappings":";;;;;;;;;;;AAmBO,SAASA,EAAmBC,GAAyD;AAC1F,SAAAC,EAAQ,4BAA4B,GACpCC,EAAuB,8BAA8BF,EAAM,UAAU,GAEnE,gBAAAG,EAACC,GAAA,EAAe,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,KAAM,GAAGL,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMK,IAAO,CAAC,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,QAAwC;AAC5E,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,EAAE,MAAAC,EAAA,IAASC,EAAwC,EAAE,aAAaN,GAAW,GAC7E,EAAE,qBAAAO,GAAqB,iBAAAC,EAAA,IAAoBH,EAAK;AAStD,SACE,gBAAAR,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,qBAAAF;AAAA,QACA,iBAAAC;AAAA,QACA,YAbW,MAAM;AACvB,UAAAL,EAAQO,EAAgB,qBAAqB;AAAA,QAC/C;AAAA,QAYQ,gBAXe,MAAM;AAC3B,UAAAP,EAAQO,EAAgB,yBAAyB;AAAA,QACnD;AAAA,MASQ;AAAA,MAGF,UAAA,gBAAAb,EAACc,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAT,KAGC,gBAAAU,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAhB,EAACiB,GAAA,EAAU;AAAA,0BACVC,GAAA,CAAA,CAAoB;AAAA,MAAA,EAAA,CACvB,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as t, jsxs as I } from "react/jsx-runtime";
2
2
  import { useForm as j, FormProvider as k } from "react-hook-form";
3
3
  import { zodResolver as G } from "@hookform/resolvers/zod";
4
- import { useState as v, useEffect as A } from "react";
4
+ import { useState as A, useEffect as _ } from "react";
5
5
  import { usePaySchedulesGetPreview as z } from "@gusto/embedded-api/react-query/paySchedulesGetPreview";
6
6
  import { usePaySchedulesUpdateMutation as J } from "@gusto/embedded-api/react-query/paySchedulesUpdate";
7
7
  import { usePaySchedulesGetAllSuspense as K } from "@gusto/embedded-api/react-query/paySchedulesGetAll";
@@ -23,34 +23,35 @@ const Oe = ({
23
23
  companyId: n,
24
24
  defaultValues: s,
25
25
  dictionary: a,
26
- ...P
27
- }) => (oe("Company.PaySchedule"), re("Company.PaySchedule", a), /* @__PURE__ */ t($, { ...P, children: /* @__PURE__ */ t(ie, { companyId: n, defaultValues: s, children: P.children }) })), ie = ({ companyId: n, children: s, defaultValues: a }) => {
28
- const { baseSubmitHandler: P, onEvent: u, fieldErrors: h, setError: _ } = V(), [i, y] = v("LIST_PAY_SCHEDULES"), [f, w] = v(null), C = {
26
+ ...y
27
+ }) => (oe("Company.PaySchedule"), re("Company.PaySchedule", a), /* @__PURE__ */ t($, { ...y, children: /* @__PURE__ */ t(ie, { companyId: n, defaultValues: s, children: y.children }) })), ie = ({ companyId: n, children: s, defaultValues: a }) => {
28
+ const { baseSubmitHandler: y, onEvent: u, fieldErrors: h, setError: C } = V(), { data: p } = K({
29
+ companyId: n
30
+ }), [i, P] = A(
31
+ p.payScheduleList?.length === 0 ? "ADD_PAY_SCHEDULE" : "LIST_PAY_SCHEDULES"
32
+ ), [f, w] = A(null), L = {
29
33
  frequency: a?.frequency ?? "Every week",
30
34
  anchorPayDate: a?.anchorPayDate ? new Date(a.anchorPayDate) : void 0,
31
35
  anchorEndOfPayPeriod: a?.anchorEndOfPayPeriod ? new Date(a.anchorEndOfPayPeriod) : void 0,
32
36
  day1: a?.day1 ?? void 0,
33
37
  day2: a?.day2 ?? void 0,
34
38
  customName: a?.customName ?? "",
35
- customTwicePerMonth: "false",
36
- payPeriodPreviewRange: 0
37
- }, { data: L } = K({
38
- companyId: n
39
- }), q = Q(), T = J(), E = j({
39
+ customTwicePerMonth: "false"
40
+ }, q = Q(), T = J(), E = j({
40
41
  resolver: G(W),
41
- defaultValues: C
42
- }), { watch: O, setValue: D, reset: d, clearErrors: H, setError: p } = E;
43
- A(() => {
42
+ defaultValues: L
43
+ }), { watch: O, setValue: D, reset: d, clearErrors: H, setError: v } = E;
44
+ _(() => {
44
45
  h && h.forEach((o) => {
45
- p(o.key, { message: o.message });
46
+ v(o.key, { message: o.message });
46
47
  });
47
- }, [p, h]);
48
- const e = O(), U = e.anchorPayDate && l(e.anchorPayDate) || "", M = e.anchorEndOfPayPeriod && l(e.anchorEndOfPayPeriod) || "", { data: Y, isLoading: N } = z(
48
+ }, [v, h]);
49
+ const e = O(), U = e.anchorPayDate && l(e.anchorPayDate) || "", Y = e.anchorEndOfPayPeriod && l(e.anchorEndOfPayPeriod) || "", { data: M, isLoading: N } = z(
49
50
  {
50
51
  companyId: n,
51
52
  frequency: e.frequency,
52
53
  anchorPayDate: U,
53
- anchorEndOfPayPeriod: M,
54
+ anchorEndOfPayPeriod: Y,
54
55
  day1: e.day1 ?? void 0,
55
56
  day2: e.day2 ?? void 0
56
57
  },
@@ -58,13 +59,13 @@ const Oe = ({
58
59
  enabled: !!(e.anchorPayDate && e.anchorEndOfPayPeriod && (i === "ADD_PAY_SCHEDULE" || i === "EDIT_PAY_SCHEDULE"))
59
60
  }
60
61
  );
61
- A(() => {
62
+ _(() => {
62
63
  e.frequency === "Twice per month" && e.day1 === 15 && e.day2 === 31 && e.customTwicePerMonth === void 0 ? D("customTwicePerMonth", "1st15th") : e.frequency === "Twice per month" && e.customTwicePerMonth === void 0 && D("customTwicePerMonth", "custom");
63
64
  }, [e.frequency, e.day1, e.day2, D, e.customTwicePerMonth]);
64
65
  const b = () => {
65
- y("ADD_PAY_SCHEDULE"), d({});
66
+ P("ADD_PAY_SCHEDULE"), d({});
66
67
  }, g = () => {
67
- y("LIST_PAY_SCHEDULES"), d({}), H(), _(null);
68
+ P("LIST_PAY_SCHEDULES"), d({}), H(), C(null);
68
69
  }, B = (o) => {
69
70
  d({
70
71
  frequency: o.frequency,
@@ -73,11 +74,11 @@ const Oe = ({
73
74
  day1: o.day1 ?? void 0,
74
75
  day2: o.day2 ?? void 0,
75
76
  customName: o.customName ?? ""
76
- }), w(o), y("EDIT_PAY_SCHEDULE");
77
- }, R = () => {
77
+ }), w(o), P("EDIT_PAY_SCHEDULE");
78
+ }, x = () => {
78
79
  u(S.PAY_SCHEDULE_DONE);
79
- }, x = async (o) => {
80
- await P(o, async (r) => {
80
+ }, R = async (o) => {
81
+ await y(o, async (r) => {
81
82
  const m = (c) => c && l(c) || "";
82
83
  if (i === "ADD_PAY_SCHEDULE") {
83
84
  const c = await q.mutateAsync({
@@ -112,7 +113,7 @@ const Oe = ({
112
113
  });
113
114
  u(S.PAY_SCHEDULE_UPDATED, F), d();
114
115
  }
115
- y("LIST_PAY_SCHEDULES");
116
+ P("LIST_PAY_SCHEDULES");
116
117
  });
117
118
  };
118
119
  return /* @__PURE__ */ t(
@@ -123,14 +124,14 @@ const Oe = ({
123
124
  handleAdd: b,
124
125
  handleEdit: B,
125
126
  handleCancel: g,
126
- handleContinue: R,
127
+ handleContinue: x,
127
128
  mode: i,
128
- paySchedules: L.payScheduleList,
129
- payPeriodPreview: Y?.object?.payPeriods,
129
+ paySchedules: p.payScheduleList,
130
+ payPeriodPreview: M?.object?.payPeriods,
130
131
  payPreviewLoading: N,
131
132
  currentPaySchedule: f
132
133
  },
133
- children: /* @__PURE__ */ t("span", { "data-testid": "pay-schedule-edit-form", children: /* @__PURE__ */ t(k, { ...E, children: /* @__PURE__ */ t(Z, { onSubmit: E.handleSubmit(x), children: s || /* @__PURE__ */ I(ee, { flexDirection: "column", children: [
134
+ children: /* @__PURE__ */ t("span", { "data-testid": "pay-schedule-edit-form", children: /* @__PURE__ */ t(k, { ...E, children: /* @__PURE__ */ t(Z, { onSubmit: E.handleSubmit(R), children: s || /* @__PURE__ */ I(ee, { flexDirection: "column", children: [
134
135
  /* @__PURE__ */ t(ae, {}),
135
136
  /* @__PURE__ */ t(te, {}),
136
137
  /* @__PURE__ */ t(ne, {}),
@@ -1 +1 @@
1
- {"version":3,"file":"PaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/PaySchedule.tsx"],"sourcesContent":["import type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useEffect, useState } from 'react'\nimport { usePaySchedulesGetPreview } from '@gusto/embedded-api/react-query/paySchedulesGetPreview'\nimport { usePaySchedulesUpdateMutation } from '@gusto/embedded-api/react-query/paySchedulesUpdate'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePaySchedulesCreateMutation } from '@gusto/embedded-api/react-query/paySchedulesCreate'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Frequency } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayschedules'\nimport type { MODE, PayScheduleInputs, PayScheduleOutputs } from './usePaySchedule'\nimport {\n PayScheduleProvider,\n PayScheduleSchema,\n type PayScheduleDefaultValues,\n} from './usePaySchedule'\nimport { Actions, Edit, Head, List } from './_parts'\nimport { Form } from '@/components/Common/Form'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface PayScheduleProps extends CommonComponentInterface<'Company.PaySchedule'> {\n companyId: string\n defaultValues?: PayScheduleDefaultValues\n}\n\nexport const PaySchedule = ({\n companyId,\n defaultValues,\n dictionary,\n ...props\n}: PayScheduleProps & BaseComponentInterface) => {\n useI18n('Company.PaySchedule')\n useComponentDictionary('Company.PaySchedule', dictionary)\n return (\n <BaseComponent {...props}>\n <Root companyId={companyId} defaultValues={defaultValues}>\n {props.children}\n </Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, children, defaultValues }: PayScheduleProps) => {\n const { baseSubmitHandler, onEvent, fieldErrors, setError: setBaseError } = useBase()\n const [mode, setMode] = useState<MODE>('LIST_PAY_SCHEDULES')\n const [currentPaySchedule, setCurrentPaySchedule] = useState<PayScheduleType | null>(null)\n const transformedDefaultValues: PayScheduleInputs = {\n frequency: defaultValues?.frequency ?? 'Every week',\n anchorPayDate: defaultValues?.anchorPayDate ? new Date(defaultValues.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: defaultValues?.anchorEndOfPayPeriod\n ? new Date(defaultValues.anchorEndOfPayPeriod)\n : undefined,\n day1: defaultValues?.day1 ?? undefined,\n day2: defaultValues?.day2 ?? undefined,\n customName: defaultValues?.customName ?? '',\n customTwicePerMonth: 'false',\n payPeriodPreviewRange: 0,\n }\n\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({\n companyId,\n })\n\n const createPayScheduleMutation = usePaySchedulesCreateMutation()\n const updatePayScheduleMutation = usePaySchedulesUpdateMutation()\n\n const formMethods = useForm<PayScheduleInputs, unknown, PayScheduleOutputs>({\n resolver: zodResolver(PayScheduleSchema),\n defaultValues: transformedDefaultValues,\n })\n const { watch, setValue, reset, clearErrors, setError } = formMethods\n\n useEffect(() => {\n if (fieldErrors) {\n // TODO: These error messages are not being localized correctly\n fieldErrors.forEach(error => {\n setError(error.key as keyof PayScheduleInputs, { message: error.message })\n })\n }\n }, [setError, fieldErrors])\n\n const allValues = watch()\n\n const formattedAnchorPayDate = allValues.anchorPayDate\n ? formatDateToStringDate(allValues.anchorPayDate) || ''\n : ''\n const formattedAnchorEndOfPayPeriod = allValues.anchorEndOfPayPeriod\n ? formatDateToStringDate(allValues.anchorEndOfPayPeriod) || ''\n : ''\n\n const { data: payPreviewData, isLoading } = usePaySchedulesGetPreview(\n {\n companyId,\n frequency: allValues.frequency,\n anchorPayDate: formattedAnchorPayDate,\n anchorEndOfPayPeriod: formattedAnchorEndOfPayPeriod,\n day1: allValues.day1 ?? undefined,\n day2: allValues.day2 ?? undefined,\n },\n {\n enabled: Boolean(\n allValues.anchorPayDate &&\n allValues.anchorEndOfPayPeriod &&\n (mode === 'ADD_PAY_SCHEDULE' || mode === 'EDIT_PAY_SCHEDULE'),\n ),\n },\n )\n\n // Set the custom_twice_per_month value based on the frequency and day_1 and day_2 values as it is not set by the API call\n useEffect(() => {\n if (\n allValues.frequency === 'Twice per month' &&\n allValues.day1 === 15 &&\n allValues.day2 === 31 &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `1st15th`)\n } else if (\n allValues.frequency === 'Twice per month' &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `custom`)\n }\n }, [allValues.frequency, allValues.day1, allValues.day2, setValue, allValues.customTwicePerMonth])\n\n const handleAdd = () => {\n setMode('ADD_PAY_SCHEDULE')\n reset({})\n }\n const handleCancel = () => {\n setMode('LIST_PAY_SCHEDULES')\n reset({})\n clearErrors()\n setBaseError(null)\n }\n const handleEdit = (schedule: PayScheduleType) => {\n reset({\n frequency: schedule.frequency as Frequency,\n anchorPayDate: schedule.anchorPayDate ? new Date(schedule.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: schedule.anchorEndOfPayPeriod\n ? new Date(schedule.anchorEndOfPayPeriod)\n : undefined,\n day1: schedule.day1 ?? undefined,\n day2: schedule.day2 ?? undefined,\n customName: schedule.customName ?? '',\n })\n setCurrentPaySchedule(schedule)\n setMode('EDIT_PAY_SCHEDULE')\n }\n const handleContinue = () => {\n onEvent(componentEvents.PAY_SCHEDULE_DONE)\n }\n const onSubmit: SubmitHandler<PayScheduleOutputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const formatPayloadDate = (date: Date | undefined): string => {\n return date ? formatDateToStringDate(date) || '' : ''\n }\n\n if (mode === 'ADD_PAY_SCHEDULE') {\n const createPayScheduleResponse = await createPayScheduleMutation.mutateAsync({\n request: {\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_CREATED, createPayScheduleResponse)\n reset()\n } else if (mode === 'EDIT_PAY_SCHEDULE') {\n const version = currentPaySchedule?.version\n const updatePayScheduleResponse = await updatePayScheduleMutation.mutateAsync({\n request: {\n payScheduleId: currentPaySchedule?.uuid as string,\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n version: version as string,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_UPDATED, updatePayScheduleResponse)\n reset()\n }\n setMode('LIST_PAY_SCHEDULES')\n })\n }\n\n return (\n <PayScheduleProvider\n value={{\n companyId,\n handleAdd,\n handleEdit,\n handleCancel,\n handleContinue,\n mode,\n paySchedules: paySchedules.payScheduleList,\n payPeriodPreview: payPreviewData?.object?.payPeriods,\n payPreviewLoading: isLoading,\n currentPaySchedule,\n }}\n >\n <span data-testid=\"pay-schedule-edit-form\">\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Edit />\n <Actions />\n </Flex>\n )}\n </Form>\n </FormProvider>\n </span>\n </PayScheduleProvider>\n )\n}\n"],"names":["PaySchedule","companyId","defaultValues","dictionary","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","children","baseSubmitHandler","onEvent","fieldErrors","setBaseError","useBase","mode","setMode","useState","currentPaySchedule","setCurrentPaySchedule","transformedDefaultValues","paySchedules","usePaySchedulesGetAllSuspense","createPayScheduleMutation","usePaySchedulesCreateMutation","updatePayScheduleMutation","usePaySchedulesUpdateMutation","formMethods","useForm","zodResolver","PayScheduleSchema","watch","setValue","reset","clearErrors","setError","useEffect","error","allValues","formattedAnchorPayDate","formatDateToStringDate","formattedAnchorEndOfPayPeriod","payPreviewData","isLoading","usePaySchedulesGetPreview","handleAdd","handleCancel","handleEdit","schedule","handleContinue","componentEvents","onSubmit","data","payload","formatPayloadDate","date","createPayScheduleResponse","version","updatePayScheduleResponse","PayScheduleProvider","FormProvider","Form","jsxs","Flex","Head","List","Edit","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+BO,MAAMA,KAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,OACEC,GAAQ,qBAAqB,GAC7BC,GAAuB,uBAAuBH,CAAU,GAEtD,gBAAAI,EAACC,GAAe,EAAA,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,MAAK,WAAAR,GAAsB,eAAAC,GACzB,UAAME,EAAA,SAAA,CACT,EACF,CAAA,IAIEK,KAAO,CAAC,EAAE,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L,WAAA3D;AAAA,QACA,WAAA6C;AAAA,QACA,YAAAE;AAAA,QACA,cAAAD;AAAA,QACA,gBAAAG;AAAA,QACA,MAAAlC;AAAA,QACA,cAAcM,EAAa;AAAA,QAC3B,kBAAkBqB,GAAgB,QAAQ;AAAA,QAC1C,mBAAmBC;AAAA,QACnB,oBAAAzB;AAAA,MACF;AAAA,MAEA,UAAA,gBAAAZ,EAAC,UAAK,eAAY,0BAChB,4BAACsD,GAAc,EAAA,GAAGjC,GAChB,UAAC,gBAAArB,EAAAuD,GAAA,EAAK,UAAUlC,EAAY,aAAawB,CAAQ,GAC9C,UAAA1C,KAGE,gBAAAqD,EAAAC,IAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAzD,EAAC0D,IAAK,EAAA;AAAA,0BACLC,IAAK,EAAA;AAAA,0BACLC,IAAK,EAAA;AAAA,0BACLC,IAAQ,CAAA,CAAA;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EACF,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"PaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/PaySchedule.tsx"],"sourcesContent":["import type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useEffect, useState } from 'react'\nimport { usePaySchedulesGetPreview } from '@gusto/embedded-api/react-query/paySchedulesGetPreview'\nimport { usePaySchedulesUpdateMutation } from '@gusto/embedded-api/react-query/paySchedulesUpdate'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePaySchedulesCreateMutation } from '@gusto/embedded-api/react-query/paySchedulesCreate'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Frequency } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayschedules'\nimport type { MODE, PayScheduleInputs, PayScheduleOutputs } from './usePaySchedule'\nimport {\n PayScheduleProvider,\n PayScheduleSchema,\n type PayScheduleDefaultValues,\n} from './usePaySchedule'\nimport { Actions, Edit, Head, List } from './_parts'\nimport { Form } from '@/components/Common/Form'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface PayScheduleProps extends CommonComponentInterface<'Company.PaySchedule'> {\n companyId: string\n defaultValues?: PayScheduleDefaultValues\n}\n\nexport const PaySchedule = ({\n companyId,\n defaultValues,\n dictionary,\n ...props\n}: PayScheduleProps & BaseComponentInterface) => {\n useI18n('Company.PaySchedule')\n useComponentDictionary('Company.PaySchedule', dictionary)\n return (\n <BaseComponent {...props}>\n <Root companyId={companyId} defaultValues={defaultValues}>\n {props.children}\n </Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, children, defaultValues }: PayScheduleProps) => {\n const { baseSubmitHandler, onEvent, fieldErrors, setError: setBaseError } = useBase()\n\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({\n companyId,\n })\n\n const [mode, setMode] = useState<MODE>(\n paySchedules.payScheduleList?.length === 0 ? 'ADD_PAY_SCHEDULE' : 'LIST_PAY_SCHEDULES',\n )\n const [currentPaySchedule, setCurrentPaySchedule] = useState<PayScheduleType | null>(null)\n const transformedDefaultValues: PayScheduleInputs = {\n frequency: defaultValues?.frequency ?? 'Every week',\n anchorPayDate: defaultValues?.anchorPayDate ? new Date(defaultValues.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: defaultValues?.anchorEndOfPayPeriod\n ? new Date(defaultValues.anchorEndOfPayPeriod)\n : undefined,\n day1: defaultValues?.day1 ?? undefined,\n day2: defaultValues?.day2 ?? undefined,\n customName: defaultValues?.customName ?? '',\n customTwicePerMonth: 'false',\n }\n\n const createPayScheduleMutation = usePaySchedulesCreateMutation()\n const updatePayScheduleMutation = usePaySchedulesUpdateMutation()\n\n const formMethods = useForm<PayScheduleInputs, unknown, PayScheduleOutputs>({\n resolver: zodResolver(PayScheduleSchema),\n defaultValues: transformedDefaultValues,\n })\n const { watch, setValue, reset, clearErrors, setError } = formMethods\n\n useEffect(() => {\n if (fieldErrors) {\n // TODO: These error messages are not being localized correctly\n fieldErrors.forEach(error => {\n setError(error.key as keyof PayScheduleInputs, { message: error.message })\n })\n }\n }, [setError, fieldErrors])\n\n const allValues = watch()\n\n const formattedAnchorPayDate = allValues.anchorPayDate\n ? formatDateToStringDate(allValues.anchorPayDate) || ''\n : ''\n const formattedAnchorEndOfPayPeriod = allValues.anchorEndOfPayPeriod\n ? formatDateToStringDate(allValues.anchorEndOfPayPeriod) || ''\n : ''\n\n const { data: payPreviewData, isLoading } = usePaySchedulesGetPreview(\n {\n companyId,\n frequency: allValues.frequency,\n anchorPayDate: formattedAnchorPayDate,\n anchorEndOfPayPeriod: formattedAnchorEndOfPayPeriod,\n day1: allValues.day1 ?? undefined,\n day2: allValues.day2 ?? undefined,\n },\n {\n enabled: Boolean(\n allValues.anchorPayDate &&\n allValues.anchorEndOfPayPeriod &&\n (mode === 'ADD_PAY_SCHEDULE' || mode === 'EDIT_PAY_SCHEDULE'),\n ),\n },\n )\n\n // Set the custom_twice_per_month value based on the frequency and day_1 and day_2 values as it is not set by the API call\n useEffect(() => {\n if (\n allValues.frequency === 'Twice per month' &&\n allValues.day1 === 15 &&\n allValues.day2 === 31 &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `1st15th`)\n } else if (\n allValues.frequency === 'Twice per month' &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `custom`)\n }\n }, [allValues.frequency, allValues.day1, allValues.day2, setValue, allValues.customTwicePerMonth])\n\n const handleAdd = () => {\n setMode('ADD_PAY_SCHEDULE')\n reset({})\n }\n const handleCancel = () => {\n setMode('LIST_PAY_SCHEDULES')\n reset({})\n clearErrors()\n setBaseError(null)\n }\n const handleEdit = (schedule: PayScheduleType) => {\n reset({\n frequency: schedule.frequency as Frequency,\n anchorPayDate: schedule.anchorPayDate ? new Date(schedule.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: schedule.anchorEndOfPayPeriod\n ? new Date(schedule.anchorEndOfPayPeriod)\n : undefined,\n day1: schedule.day1 ?? undefined,\n day2: schedule.day2 ?? undefined,\n customName: schedule.customName ?? '',\n })\n setCurrentPaySchedule(schedule)\n setMode('EDIT_PAY_SCHEDULE')\n }\n const handleContinue = () => {\n onEvent(componentEvents.PAY_SCHEDULE_DONE)\n }\n const onSubmit: SubmitHandler<PayScheduleOutputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const formatPayloadDate = (date: Date | undefined): string => {\n return date ? formatDateToStringDate(date) || '' : ''\n }\n\n if (mode === 'ADD_PAY_SCHEDULE') {\n const createPayScheduleResponse = await createPayScheduleMutation.mutateAsync({\n request: {\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_CREATED, createPayScheduleResponse)\n reset()\n } else if (mode === 'EDIT_PAY_SCHEDULE') {\n const version = currentPaySchedule?.version\n const updatePayScheduleResponse = await updatePayScheduleMutation.mutateAsync({\n request: {\n payScheduleId: currentPaySchedule?.uuid as string,\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n version: version as string,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_UPDATED, updatePayScheduleResponse)\n reset()\n }\n setMode('LIST_PAY_SCHEDULES')\n })\n }\n\n return (\n <PayScheduleProvider\n value={{\n companyId,\n handleAdd,\n handleEdit,\n handleCancel,\n handleContinue,\n mode,\n paySchedules: paySchedules.payScheduleList,\n payPeriodPreview: payPreviewData?.object?.payPeriods,\n payPreviewLoading: isLoading,\n currentPaySchedule,\n }}\n >\n <span data-testid=\"pay-schedule-edit-form\">\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Edit />\n <Actions />\n </Flex>\n )}\n </Form>\n </FormProvider>\n </span>\n </PayScheduleProvider>\n )\n}\n"],"names":["PaySchedule","companyId","defaultValues","dictionary","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","children","baseSubmitHandler","onEvent","fieldErrors","setBaseError","useBase","paySchedules","usePaySchedulesGetAllSuspense","mode","setMode","useState","currentPaySchedule","setCurrentPaySchedule","transformedDefaultValues","createPayScheduleMutation","usePaySchedulesCreateMutation","updatePayScheduleMutation","usePaySchedulesUpdateMutation","formMethods","useForm","zodResolver","PayScheduleSchema","watch","setValue","reset","clearErrors","setError","useEffect","error","allValues","formattedAnchorPayDate","formatDateToStringDate","formattedAnchorEndOfPayPeriod","payPreviewData","isLoading","usePaySchedulesGetPreview","handleAdd","handleCancel","handleEdit","schedule","handleContinue","componentEvents","onSubmit","data","payload","formatPayloadDate","date","createPayScheduleResponse","version","updatePayScheduleResponse","PayScheduleProvider","FormProvider","Form","jsxs","Flex","Head","List","Edit","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+BO,MAAMA,KAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,OACEC,GAAQ,qBAAqB,GAC7BC,GAAuB,uBAAuBH,CAAU,GAEtD,gBAAAI,EAACC,GAAA,EAAe,GAAGJ,GACjB,UAAA,gBAAAG,EAACE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,EAAQ,oBAAoB;AAAA,IAC9B,CAAC;AAAA,EACH;AAEA,SACE,gBAAAZ;AAAA,IAACqD;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAA3D;AAAA,QACA,WAAA6C;AAAA,QACA,YAAAE;AAAA,QACA,cAAAD;AAAA,QACA,gBAAAG;AAAA,QACA,MAAAhC;AAAA,QACA,cAAcF,EAAa;AAAA,QAC3B,kBAAkB2B,GAAgB,QAAQ;AAAA,QAC1C,mBAAmBC;AAAA,QACnB,oBAAAvB;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAd,EAAC,UAAK,eAAY,0BAChB,4BAACsD,GAAA,EAAc,GAAGjC,GAChB,UAAA,gBAAArB,EAACuD,GAAA,EAAK,UAAUlC,EAAY,aAAawB,CAAQ,GAC9C,UAAA1C,KAGC,gBAAAqD,EAACC,IAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAzD,EAAC0D,IAAA,EAAK;AAAA,0BACLC,IAAA,EAAK;AAAA,0BACLC,IAAA,EAAK;AAAA,0BACLC,IAAA,CAAA,CAAQ;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const { mode, handleAdd, handleCancel, handleContinue } = usePaySchedule()\n const Components = useComponentContext()\n\n return (\n <>\n {mode === 'LIST_PAY_SCHEDULES' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleAdd()\n }}\n >\n {t('addAnotherPayScheduleCta')}\n </Components.Button>\n <Components.Button\n variant=\"primary\"\n onClick={() => {\n handleContinue()\n }}\n >\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )}\n {mode === 'ADD_PAY_SCHEDULE' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleCancel()\n }}\n >\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\">{t('actions.save')}</Components.Button>\n </ActionsLayout>\n )}\n {mode === 'EDIT_PAY_SCHEDULE' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleCancel()\n }}\n >\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\">{t('actions.save')}</Components.Button>\n </ActionsLayout>\n )}\n </>\n )\n}\n"],"names":["Actions","t","useTranslation","mode","handleAdd","handleCancel","handleContinue","usePaySchedule","Components","useComponentContext","jsxs","Fragment","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,MAAAC,GAAM,WAAAC,GAAW,cAAAC,GAAc,gBAAAC,EAAA,IAAmBC,EAAe,GACnEC,IAAaC,EAAoB;AAEvC,SAEK,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAASR,MAAA,0CACPS,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACH,YAAAJ,EAAA;AAAA,UACZ;AAAA,UAEC,YAAE,0BAA0B;AAAA,QAAA;AAAA,MAC/B;AAAA,MACA,gBAAAS;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACE,YAAAF,EAAA;AAAA,UACjB;AAAA,UAEC,YAAE,aAAa;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB,GACF;AAAA,IAEDH,MAAS,sBACR,gBAAAO,EAACE,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACA,YAAAH,EAAA;AAAA,UACf;AAAA,UAEC,YAAE,gBAAgB;AAAA,QAAA;AAAA,MACrB;AAAA,MACA,gBAAAQ,EAACL,EAAW,QAAX,EAAkB,MAAK,UAAU,UAAAP,EAAE,cAAc,EAAE,CAAA;AAAA,IAAA,GACtD;AAAA,IAEDE,MAAS,uBACR,gBAAAO,EAACE,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACA,YAAAH,EAAA;AAAA,UACf;AAAA,UAEC,YAAE,gBAAgB;AAAA,QAAA;AAAA,MACrB;AAAA,MACA,gBAAAQ,EAACL,EAAW,QAAX,EAAkB,MAAK,UAAU,UAAAP,EAAE,cAAc,EAAE,CAAA;AAAA,IAAA,EACtD,CAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const { mode, handleAdd, handleCancel, handleContinue } = usePaySchedule()\n const Components = useComponentContext()\n\n return (\n <>\n {mode === 'LIST_PAY_SCHEDULES' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleAdd()\n }}\n >\n {t('addAnotherPayScheduleCta')}\n </Components.Button>\n <Components.Button\n variant=\"primary\"\n onClick={() => {\n handleContinue()\n }}\n >\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )}\n {mode === 'ADD_PAY_SCHEDULE' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleCancel()\n }}\n >\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\">{t('actions.save')}</Components.Button>\n </ActionsLayout>\n )}\n {mode === 'EDIT_PAY_SCHEDULE' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleCancel()\n }}\n >\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\">{t('actions.save')}</Components.Button>\n </ActionsLayout>\n )}\n </>\n )\n}\n"],"names":["Actions","t","useTranslation","mode","handleAdd","handleCancel","handleContinue","usePaySchedule","Components","useComponentContext","jsxs","Fragment","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,MAAAC,GAAM,WAAAC,GAAW,cAAAC,GAAc,gBAAAC,EAAA,IAAmBC,EAAA,GACpDC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAR,MAAS,0CACPS,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACb,YAAAJ,EAAA;AAAA,UACF;AAAA,UAEC,YAAE,0BAA0B;AAAA,QAAA;AAAA,MAAA;AAAA,MAE/B,gBAAAS;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACb,YAAAF,EAAA;AAAA,UACF;AAAA,UAEC,YAAE,aAAa;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB,GACF;AAAA,IAEDH,MAAS,sBACR,gBAAAO,EAACE,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACb,YAAAH,EAAA;AAAA,UACF;AAAA,UAEC,YAAE,gBAAgB;AAAA,QAAA;AAAA,MAAA;AAAA,MAErB,gBAAAQ,EAACL,EAAW,QAAX,EAAkB,MAAK,UAAU,UAAAP,EAAE,cAAc,EAAA,CAAE;AAAA,IAAA,GACtD;AAAA,IAEDE,MAAS,uBACR,gBAAAO,EAACE,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACb,YAAAH,EAAA;AAAA,UACF;AAAA,UAEC,YAAE,gBAAgB;AAAA,QAAA;AAAA,MAAA;AAAA,MAErB,gBAAAQ,EAACL,EAAW,QAAX,EAAkB,MAAK,UAAU,UAAAP,EAAE,cAAc,EAAA,CAAE;AAAA,IAAA,EAAA,CACtD;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -1,29 +1,28 @@
1
- import { jsx as a, jsxs as m } from "react/jsx-runtime";
2
- import { useFormContext as S, useWatch as u } from "react-hook-form";
3
- import { useTranslation as T } from "react-i18next";
4
- import { useState as N, useEffect as h } from "react";
5
- import { usePaySchedule as x } from "../usePaySchedule.js";
6
- import n from "./Edit.module.scss.js";
7
- import { Flex as f } from "../../../Common/Flex/Flex.js";
8
- import { Grid as E } from "../../../Common/Grid/Grid.js";
9
- import { RadioGroupField as R } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
1
+ import { jsx as t, jsxs as m } from "react/jsx-runtime";
2
+ import { useFormContext as C, useWatch as y } from "react-hook-form";
3
+ import { useTranslation as S } from "react-i18next";
4
+ import { useState as g, useEffect as T } from "react";
5
+ import { usePaySchedule as N } from "../usePaySchedule.js";
6
+ import l from "./Edit.module.scss.js";
7
+ import { Flex as h } from "../../../Common/Flex/Flex.js";
8
+ import { Grid as x } from "../../../Common/Grid/Grid.js";
9
+ import { RadioGroupField as E } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
10
10
  import { TextInputField as O } from "../../../Common/Fields/TextInputField/TextInputField.js";
11
- import { DatePickerField as P } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
12
- import { NumberInputField as v } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
13
- import { useComponentContext as F } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
11
+ import { DatePickerField as f } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
12
+ import { NumberInputField as P } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
13
+ import { useComponentContext as R } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
+ import { useLocale as F } from "../../../../contexts/LocaleProvider/useLocale.js";
14
15
  import { formatDateNamedWeekdayShortPlusDate as D } from "../../../../helpers/dateFormatting.js";
15
- import { SelectField as w } from "../../../Common/Fields/SelectField/SelectField.js";
16
- const z = () => {
17
- const d = F(), { t: e } = T("Company.PaySchedule"), { payPeriodPreview: t, mode: p, payPreviewLoading: b } = x(), { setValue: o } = S(), [r, g] = N(0), i = u({ name: "frequency" }), l = u({ name: "customTwicePerMonth" }), y = u({ name: "payPeriodPreviewRange" }), q = i === "Twice per month" && l === "custom" || i === "Monthly", C = i === "Twice per month" && l === "custom";
18
- return h(() => {
19
- i === "Twice per month" && l === "1st15th" && (o("day1", 15), o("day2", 31));
20
- }, [i, l, o]), h(() => {
21
- y === void 0 && o("payPeriodPreviewRange", r);
22
- }, [r, o, y]), p !== "EDIT_PAY_SCHEDULE" && p !== "ADD_PAY_SCHEDULE" ? null : /* @__PURE__ */ a("div", { className: n.payScheduleContainer, children: /* @__PURE__ */ m(E, { gap: 32, gridTemplateColumns: { base: "1fr", small: "1fr 1fr" }, children: [
23
- /* @__PURE__ */ a("div", { className: n.payScheduleForm, children: /* @__PURE__ */ m(f, { flexDirection: "column", children: [
24
- /* @__PURE__ */ a(O, { name: "customName", label: "Name", isRequired: !0 }),
25
- /* @__PURE__ */ a(
26
- w,
16
+ import { SelectField as M } from "../../../Common/Fields/SelectField/SelectField.js";
17
+ const K = () => {
18
+ const o = R(), { t: e } = S("Company.PaySchedule"), { locale: u } = F(), { payPeriodPreview: r, mode: p, payPreviewLoading: v } = N(), { setValue: d } = C(), [a, b] = g(0), i = y({ name: "frequency" }), n = y({ name: "customTwicePerMonth" }), w = i === "Twice per month" && n === "custom" || i === "Monthly", q = i === "Twice per month" && n === "custom";
19
+ return T(() => {
20
+ i === "Twice per month" && n === "1st15th" && (d("day1", 15), d("day2", 31));
21
+ }, [i, n, d]), p !== "EDIT_PAY_SCHEDULE" && p !== "ADD_PAY_SCHEDULE" ? null : /* @__PURE__ */ t("div", { className: l.payScheduleContainer, children: /* @__PURE__ */ m(x, { gap: 32, gridTemplateColumns: { base: "1fr", small: "1fr 1fr" }, children: [
22
+ /* @__PURE__ */ t("div", { className: l.payScheduleForm, children: /* @__PURE__ */ m(h, { flexDirection: "column", children: [
23
+ /* @__PURE__ */ t(O, { name: "customName", label: "Name", isRequired: !0 }),
24
+ /* @__PURE__ */ t(
25
+ M,
27
26
  {
28
27
  name: "frequency",
29
28
  label: e("labels.frequency"),
@@ -36,8 +35,8 @@ const z = () => {
36
35
  isRequired: !0
37
36
  }
38
37
  ),
39
- i === "Twice per month" && /* @__PURE__ */ a(
40
- R,
38
+ i === "Twice per month" && /* @__PURE__ */ t(
39
+ E,
41
40
  {
42
41
  name: "customTwicePerMonth",
43
42
  label: e("labels.frequencyOptions"),
@@ -48,8 +47,8 @@ const z = () => {
48
47
  ]
49
48
  }
50
49
  ),
51
- /* @__PURE__ */ a(
52
- P,
50
+ /* @__PURE__ */ t(
51
+ f,
53
52
  {
54
53
  name: "anchorPayDate",
55
54
  label: e("labels.firstPayDate"),
@@ -57,8 +56,8 @@ const z = () => {
57
56
  isRequired: !0
58
57
  }
59
58
  ),
60
- /* @__PURE__ */ a(
61
- P,
59
+ /* @__PURE__ */ t(
60
+ f,
62
61
  {
63
62
  name: "anchorEndOfPayPeriod",
64
63
  label: e("labels.firstPayPeriodEndDate"),
@@ -66,55 +65,55 @@ const z = () => {
66
65
  isRequired: !0
67
66
  }
68
67
  ),
69
- /* @__PURE__ */ a("div", { className: q ? "" : n.visuallyHidden, children: /* @__PURE__ */ a(v, { name: "day1", label: e("labels.firstPayDayOfTheMonth"), isRequired: !0 }) }),
70
- /* @__PURE__ */ a("div", { className: C ? "" : n.visuallyHidden, children: /* @__PURE__ */ a(v, { name: "day2", label: e("labels.lastPayDayOfTheMonth"), isRequired: !0 }) })
68
+ /* @__PURE__ */ t("div", { className: w ? "" : l.visuallyHidden, children: /* @__PURE__ */ t(P, { name: "day1", label: e("labels.firstPayDayOfTheMonth"), isRequired: !0 }) }),
69
+ /* @__PURE__ */ t("div", { className: q ? "" : l.visuallyHidden, children: /* @__PURE__ */ t(P, { name: "day2", label: e("labels.lastPayDayOfTheMonth"), isRequired: !0 }) })
71
70
  ] }) }),
72
- /* @__PURE__ */ a(f, { flexDirection: "column", gap: 4, justifyContent: "center", alignItems: "center", children: t && t[r] ? /* @__PURE__ */ m("div", { className: n.calendarContainer, children: [
73
- !b && /* @__PURE__ */ a(
74
- w,
71
+ /* @__PURE__ */ t(h, { flexDirection: "column", gap: 4, justifyContent: "center", alignItems: "center", children: r && r[a] ? /* @__PURE__ */ m("div", { className: l.calendarContainer, children: [
72
+ !v && /* @__PURE__ */ t(
73
+ o.Select,
75
74
  {
76
- name: "payPeriodPreviewRange",
77
75
  label: e("labels.preview"),
78
- options: t.map((s, c) => ({
76
+ isRequired: !0,
77
+ options: r.map((s, c) => ({
79
78
  value: String(c),
80
- label: `${D(s.startDate)} – ${D(s.endDate)}`
79
+ label: `${D(s.startDate, u)} – ${D(s.endDate, u)}`
81
80
  })),
82
- defaultValue: String(r),
81
+ value: String(a),
83
82
  onChange: (s) => {
84
83
  const c = Number(s);
85
- isNaN(c) || g(c);
84
+ isNaN(c) || b(c);
86
85
  }
87
86
  }
88
87
  ),
89
- /* @__PURE__ */ a(
90
- d.CalendarPreview,
88
+ /* @__PURE__ */ t(
89
+ o.CalendarPreview,
91
90
  {
92
91
  dateRange: {
93
- start: new Date(t[r].startDate),
94
- end: new Date(t[r].endDate),
92
+ start: new Date(r[a].startDate),
93
+ end: new Date(r[a].endDate),
95
94
  label: e("payPreview.payPeriod") || "Pay Period"
96
95
  },
97
96
  highlightDates: [
98
97
  {
99
- date: new Date(t[r].checkDate),
98
+ date: new Date(r[a].checkDate),
100
99
  highlightColor: "primary",
101
100
  label: e("payPreview.payday") || "Payday"
102
101
  },
103
102
  {
104
- date: new Date(t[r].runPayrollBy),
103
+ date: new Date(r[a].runPayrollBy),
105
104
  highlightColor: "secondary",
106
105
  label: e("payPreview.payrollDeadline") || "Payroll Deadline"
107
106
  }
108
107
  ]
109
108
  },
110
- r
109
+ a
111
110
  )
112
- ] }) : /* @__PURE__ */ a("div", { className: n.calendarContainer, children: /* @__PURE__ */ a(
113
- d.Alert,
111
+ ] }) : /* @__PURE__ */ t("div", { className: l.calendarContainer, children: /* @__PURE__ */ t(
112
+ o.Alert,
114
113
  {
115
114
  status: "info",
116
115
  label: e("previewAlert.title", "Pay Schedule Preview"),
117
- children: /* @__PURE__ */ a(d.Text, { children: e(
116
+ children: /* @__PURE__ */ t(o.Text, { children: e(
118
117
  "previewAlert.description",
119
118
  "Complete all the required fields on the left to see a preview of your pay schedule."
120
119
  ) })
@@ -123,6 +122,6 @@ const z = () => {
123
122
  ] }) });
124
123
  };
125
124
  export {
126
- z as Edit
125
+ K as Edit
127
126
  };
128
127
  //# sourceMappingURL=Edit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Edit.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Edit.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useEffect, useState } from 'react'\nimport type { PayScheduleInputs } from '../usePaySchedule'\nimport { usePaySchedule } from '../usePaySchedule'\nimport style from './Edit.module.scss'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n Grid,\n TextInputField,\n NumberInputField,\n DatePickerField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { formatDateNamedWeekdayShortPlusDate } from '@/helpers/dateFormatting'\n\nexport const Edit = () => {\n const Components = useComponentContext()\n const { t } = useTranslation('Company.PaySchedule')\n const { payPeriodPreview, mode, payPreviewLoading } = usePaySchedule()\n const { setValue } = useFormContext<PayScheduleInputs>()\n const [selectedPayPeriodIndex, setSelectedPayPeriodIndex] = useState<number>(0)\n\n const frequency = useWatch({ name: 'frequency' })\n const customTwicePerMonth = useWatch({ name: 'customTwicePerMonth' })\n const payPeriodPreviewRange = useWatch({ name: 'payPeriodPreviewRange' })\n\n const shouldShowDay1 =\n (frequency === 'Twice per month' && customTwicePerMonth === 'custom') || frequency === 'Monthly'\n const shouldShowDay2 = frequency === 'Twice per month' && customTwicePerMonth === 'custom'\n\n useEffect(() => {\n if (frequency === 'Twice per month' && customTwicePerMonth === '1st15th') {\n setValue('day1', 15)\n setValue('day2', 31)\n }\n }, [frequency, customTwicePerMonth, setValue])\n\n // This is a workaround to ensure that the pay period preview range is set when the selected pay period index changes\n // TODO: Once we have a RHF free select, that can be used and this effect can be removed\n useEffect(() => {\n if (payPeriodPreviewRange === undefined) {\n setValue('payPeriodPreviewRange', selectedPayPeriodIndex)\n }\n }, [selectedPayPeriodIndex, setValue, payPeriodPreviewRange])\n\n if (mode !== 'EDIT_PAY_SCHEDULE' && mode !== 'ADD_PAY_SCHEDULE') {\n return null\n }\n\n return (\n <div className={style.payScheduleContainer}>\n <Grid gap={32} gridTemplateColumns={{ base: '1fr', small: '1fr 1fr' }}>\n <div className={style.payScheduleForm}>\n <Flex flexDirection={'column'}>\n <TextInputField name=\"customName\" label=\"Name\" isRequired />\n <SelectField\n name=\"frequency\"\n label={t('labels.frequency')}\n options={[\n { value: 'Every week', label: t('frequencies.everyWeek') },\n { value: 'Every other week', label: t('frequencies.everyOtherWeek') },\n { value: 'Twice per month', label: t('frequencies.twicePerMonth') },\n { value: 'Monthly', label: t('frequencies.monthly') },\n ]}\n isRequired\n />\n {frequency === 'Twice per month' && (\n <RadioGroupField\n name=\"customTwicePerMonth\"\n label={t('labels.frequencyOptions')}\n description={t('descriptions.frequencyOptionsDescription')}\n options={[\n { value: '1st15th', label: t('frequencyOptions.15thAndLast') },\n { value: 'custom', label: t('frequencyOptions.custom') },\n ]}\n />\n )}\n <DatePickerField\n name=\"anchorPayDate\"\n label={t('labels.firstPayDate')}\n description={t('descriptions.anchorPayDateDescription')}\n isRequired\n />\n <DatePickerField\n name=\"anchorEndOfPayPeriod\"\n label={t('labels.firstPayPeriodEndDate')}\n description={t('descriptions.anchorEndOfPayPeriodDescription')}\n isRequired\n />\n <div className={shouldShowDay1 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day1\" label={t('labels.firstPayDayOfTheMonth')} isRequired />\n </div>\n <div className={shouldShowDay2 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day2\" label={t('labels.lastPayDayOfTheMonth')} isRequired />\n </div>\n </Flex>\n </div>\n <Flex flexDirection=\"column\" gap={4} justifyContent=\"center\" alignItems=\"center\">\n {payPeriodPreview && payPeriodPreview[selectedPayPeriodIndex] ? (\n <div className={style.calendarContainer}>\n {!payPreviewLoading && (\n <SelectField\n name=\"payPeriodPreviewRange\"\n label={t('labels.preview')}\n options={payPeriodPreview.map((period, index) => {\n return {\n value: String(index),\n label: `${formatDateNamedWeekdayShortPlusDate(period.startDate)} – ${formatDateNamedWeekdayShortPlusDate(period.endDate)}`,\n }\n })}\n defaultValue={String(selectedPayPeriodIndex)}\n onChange={(value: string) => {\n const numericValue = Number(value)\n if (!isNaN(numericValue)) {\n setSelectedPayPeriodIndex(numericValue)\n }\n }}\n />\n )}\n <Components.CalendarPreview\n key={selectedPayPeriodIndex}\n dateRange={{\n start: new Date(payPeriodPreview[selectedPayPeriodIndex].startDate as string),\n end: new Date(payPeriodPreview[selectedPayPeriodIndex].endDate as string),\n label: t('payPreview.payPeriod') || 'Pay Period',\n }}\n highlightDates={[\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].checkDate as string),\n highlightColor: 'primary',\n label: t('payPreview.payday') || 'Payday',\n },\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].runPayrollBy as string),\n highlightColor: 'secondary',\n label: t('payPreview.payrollDeadline') || 'Payroll Deadline',\n },\n ]}\n />\n </div>\n ) : (\n <div className={style.calendarContainer}>\n <Components.Alert\n status=\"info\"\n label={t('previewAlert.title', 'Pay Schedule Preview')}\n >\n <Components.Text>\n {t(\n 'previewAlert.description',\n 'Complete all the required fields on the left to see a preview of your pay schedule.',\n )}\n </Components.Text>\n </Components.Alert>\n </div>\n )}\n </Flex>\n </Grid>\n </div>\n )\n}\n"],"names":["Edit","Components","useComponentContext","t","useTranslation","payPeriodPreview","mode","payPreviewLoading","usePaySchedule","setValue","useFormContext","selectedPayPeriodIndex","setSelectedPayPeriodIndex","useState","frequency","useWatch","customTwicePerMonth","payPeriodPreviewRange","shouldShowDay1","shouldShowDay2","useEffect","jsx","style","jsxs","Grid","Flex","TextInputField","SelectField","RadioGroupField","DatePickerField","NumberInputField","period","index","formatDateNamedWeekdayShortPlusDate","value","numericValue"],"mappings":";;;;;;;;;;;;;;;AAkBO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAoB,GACjC,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,kBAAAC,GAAkB,MAAAC,GAAM,mBAAAC,EAAA,IAAsBC,EAAe,GAC/D,EAAE,UAAAC,EAAS,IAAIC,EAAkC,GACjD,CAACC,GAAwBC,CAAyB,IAAIC,EAAiB,CAAC,GAExEC,IAAYC,EAAS,EAAE,MAAM,aAAa,GAC1CC,IAAsBD,EAAS,EAAE,MAAM,uBAAuB,GAC9DE,IAAwBF,EAAS,EAAE,MAAM,yBAAyB,GAElEG,IACHJ,MAAc,qBAAqBE,MAAwB,YAAaF,MAAc,WACnFK,IAAiBL,MAAc,qBAAqBE,MA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../../../../src/components/Company/PaySchedule/_parts/Edit.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useEffect, useState } from 'react'\nimport type { PayScheduleInputs } from '../usePaySchedule'\nimport { usePaySchedule } from '../usePaySchedule'\nimport style from './Edit.module.scss'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n Grid,\n TextInputField,\n NumberInputField,\n DatePickerField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useLocale } from '@/contexts/LocaleProvider'\nimport { formatDateNamedWeekdayShortPlusDate } from '@/helpers/dateFormatting'\n\nexport const Edit = () => {\n const Components = useComponentContext()\n const { t } = useTranslation('Company.PaySchedule')\n const { locale } = useLocale()\n const { payPeriodPreview, mode, payPreviewLoading } = usePaySchedule()\n const { setValue } = useFormContext<PayScheduleInputs>()\n const [selectedPayPeriodIndex, setSelectedPayPeriodIndex] = useState<number>(0)\n\n const frequency = useWatch({ name: 'frequency' })\n const customTwicePerMonth = useWatch({ name: 'customTwicePerMonth' })\n\n const shouldShowDay1 =\n (frequency === 'Twice per month' && customTwicePerMonth === 'custom') || frequency === 'Monthly'\n const shouldShowDay2 = frequency === 'Twice per month' && customTwicePerMonth === 'custom'\n\n useEffect(() => {\n if (frequency === 'Twice per month' && customTwicePerMonth === '1st15th') {\n setValue('day1', 15)\n setValue('day2', 31)\n }\n }, [frequency, customTwicePerMonth, setValue])\n\n if (mode !== 'EDIT_PAY_SCHEDULE' && mode !== 'ADD_PAY_SCHEDULE') {\n return null\n }\n\n return (\n <div className={style.payScheduleContainer}>\n <Grid gap={32} gridTemplateColumns={{ base: '1fr', small: '1fr 1fr' }}>\n <div className={style.payScheduleForm}>\n <Flex flexDirection={'column'}>\n <TextInputField name=\"customName\" label=\"Name\" isRequired />\n <SelectField\n name=\"frequency\"\n label={t('labels.frequency')}\n options={[\n { value: 'Every week', label: t('frequencies.everyWeek') },\n { value: 'Every other week', label: t('frequencies.everyOtherWeek') },\n { value: 'Twice per month', label: t('frequencies.twicePerMonth') },\n { value: 'Monthly', label: t('frequencies.monthly') },\n ]}\n isRequired\n />\n {frequency === 'Twice per month' && (\n <RadioGroupField\n name=\"customTwicePerMonth\"\n label={t('labels.frequencyOptions')}\n description={t('descriptions.frequencyOptionsDescription')}\n options={[\n { value: '1st15th', label: t('frequencyOptions.15thAndLast') },\n { value: 'custom', label: t('frequencyOptions.custom') },\n ]}\n />\n )}\n <DatePickerField\n name=\"anchorPayDate\"\n label={t('labels.firstPayDate')}\n description={t('descriptions.anchorPayDateDescription')}\n isRequired\n />\n <DatePickerField\n name=\"anchorEndOfPayPeriod\"\n label={t('labels.firstPayPeriodEndDate')}\n description={t('descriptions.anchorEndOfPayPeriodDescription')}\n isRequired\n />\n <div className={shouldShowDay1 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day1\" label={t('labels.firstPayDayOfTheMonth')} isRequired />\n </div>\n <div className={shouldShowDay2 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day2\" label={t('labels.lastPayDayOfTheMonth')} isRequired />\n </div>\n </Flex>\n </div>\n <Flex flexDirection=\"column\" gap={4} justifyContent=\"center\" alignItems=\"center\">\n {payPeriodPreview && payPeriodPreview[selectedPayPeriodIndex] ? (\n <div className={style.calendarContainer}>\n {!payPreviewLoading && (\n <Components.Select\n label={t('labels.preview')}\n isRequired\n options={payPeriodPreview.map((period, index) => {\n return {\n value: String(index),\n label: `${formatDateNamedWeekdayShortPlusDate(period.startDate, locale)} – ${formatDateNamedWeekdayShortPlusDate(period.endDate, locale)}`,\n }\n })}\n value={String(selectedPayPeriodIndex)}\n onChange={(value: string) => {\n const numericValue = Number(value)\n if (!isNaN(numericValue)) {\n setSelectedPayPeriodIndex(numericValue)\n }\n }}\n />\n )}\n <Components.CalendarPreview\n key={selectedPayPeriodIndex}\n dateRange={{\n start: new Date(payPeriodPreview[selectedPayPeriodIndex].startDate as string),\n end: new Date(payPeriodPreview[selectedPayPeriodIndex].endDate as string),\n label: t('payPreview.payPeriod') || 'Pay Period',\n }}\n highlightDates={[\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].checkDate as string),\n highlightColor: 'primary',\n label: t('payPreview.payday') || 'Payday',\n },\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].runPayrollBy as string),\n highlightColor: 'secondary',\n label: t('payPreview.payrollDeadline') || 'Payroll Deadline',\n },\n ]}\n />\n </div>\n ) : (\n <div className={style.calendarContainer}>\n <Components.Alert\n status=\"info\"\n label={t('previewAlert.title', 'Pay Schedule Preview')}\n >\n <Components.Text>\n {t(\n 'previewAlert.description',\n 'Complete all the required fields on the left to see a preview of your pay schedule.',\n )}\n </Components.Text>\n </Components.Alert>\n </div>\n )}\n </Flex>\n </Grid>\n </div>\n )\n}\n"],"names":["Edit","Components","useComponentContext","t","useTranslation","locale","useLocale","payPeriodPreview","mode","payPreviewLoading","usePaySchedule","setValue","useFormContext","selectedPayPeriodIndex","setSelectedPayPeriodIndex","useState","frequency","useWatch","customTwicePerMonth","shouldShowDay1","shouldShowDay2","useEffect","jsx","style","jsxs","Grid","Flex","TextInputField","SelectField","RadioGroupField","DatePickerField","NumberInputField","period","index","formatDateNamedWeekdayShortPlusDate","value","numericValue"],"mappings":";;;;;;;;;;;;;;;;AAmBO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACb,EAAE,kBAAAC,GAAkB,MAAAC,GAAM,mBAAAC,EAAA,IAAsBC,EAAA,GAChD,EAAE,UAAAC,EAAA,IAAaC,EAAA,GACf,CAACC,GAAwBC,CAAyB,IAAIC,EAAiB,CAAC,GAExEC,IAAYC,EAAS,EAAE,MAAM,aAAa,GAC1CC,IAAsBD,EAAS,EAAE,MAAM,uBAAuB,GAE9DE,IACHH,MAAc,qBAAqBE,MAAwB,YAA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ourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for PaySchedule component\nexport const Head = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n\n const { mode } = usePaySchedule()\n let headingOutput: React.ReactElement = <></>\n\n switch (mode) {\n case 'LIST_PAY_SCHEDULES':\n headingOutput = (\n <>\n <Components.Heading as=\"h2\">{t('headings.pageTitle')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey={'listDescription'}\n t={t}\n components={{\n how_to_choose_schedule: <Components.Link />,\n }}\n />\n </Components.Text>\n <Components.Text>\n <Trans\n i18nKey={'listDescription2'}\n t={t}\n components={{\n payment_law_doc: <Components.Link />,\n }}\n />\n </Components.Text>\n </>\n )\n break\n case 'ADD_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.addPaySchedule')}</Components.Heading>\n )\n break\n case 'EDIT_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.editPaySchedule')}</Components.Heading>\n )\n break\n default:\n }\n\n return (\n <Flex justifyContent=\"space-between\" flexDirection={'column'} gap={4}>\n <header>{headingOutput}</header>\n </Flex>\n )\n}\n"],"names":["Head","useTranslation","Components","useComponentContext","mode","usePaySchedule","headingOutput","jsx","Fragment","jsxs","Trans","Flex"],"mappings":";;;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB,GAEjC,EAAE,MAAAC,EAAK,IAAIC,EAAe;AAChC,MAAIC,IAAsC,gBAAAC,EAAAC,GAAA,EAAA;AAE1C,UAAQJ,GAAM;AAAA,IACZ,KAAK;AACH,MAAAE,IAEI,gBAAAG,EAAAD,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAD,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,oBAAoB,GAAE;AAAA,QACrD,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT;AAAA,YACA,YAAY;AAAA,cACV,wBAAwB,gBAAAH,EAACL,EAAW,MAAX,CAAgB,CAAA;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA,GAEJ;AAAA,QACA,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT;AAAA,YACA,YAAY;AAAA,cACV,iBAAiB,gBAAAH,EAACL,EAAW,MAAX,CAAgB,CAAA;AAAA,YAAA;AAAA,UACpC;AAAA,QAAA,EAEJ,CAAA;AAAA,MAAA,GACF;AAEF;AAAA,IACF,KAAK;AAED,MAAAI,IAAA,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,yBAAyB,GAAE;AAE5D;AAAA,IACF,KAAK;AAED,MAAAI,IAAA,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,0BAA0B,GAAE;AAE7D;AAAA,EACF;AAIA,SAAA,gBAAAK,EAACI,GAAK,EAAA,gBAAe,iBAAgB,eAAe,UAAU,KAAK,GACjE,UAAA,gBAAAJ,EAAC,UAAQ,EAAA,UAAAD,EAAc,CAAA,GACzB;AAEJ;"}
1
+ {"version":3,"file":"Head.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Head.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for PaySchedule component\nexport const Head = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n\n const { mode } = usePaySchedule()\n let headingOutput: React.ReactElement = <></>\n\n switch (mode) {\n case 'LIST_PAY_SCHEDULES':\n headingOutput = (\n <>\n <Components.Heading as=\"h2\">{t('headings.pageTitle')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey={'listDescription'}\n t={t}\n components={{\n how_to_choose_schedule: <Components.Link />,\n }}\n />\n </Components.Text>\n <Components.Text>\n <Trans\n i18nKey={'listDescription2'}\n t={t}\n components={{\n payment_law_doc: <Components.Link />,\n }}\n />\n </Components.Text>\n </>\n )\n break\n case 'ADD_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.addPaySchedule')}</Components.Heading>\n )\n break\n case 'EDIT_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.editPaySchedule')}</Components.Heading>\n )\n break\n default:\n }\n\n return (\n <Flex justifyContent=\"space-between\" flexDirection={'column'} gap={4}>\n <header>{headingOutput}</header>\n </Flex>\n )\n}\n"],"names":["Head","useTranslation","Components","useComponentContext","mode","usePaySchedule","headingOutput","jsx","Fragment","jsxs","Trans","Flex"],"mappings":";;;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA,GAEb,EAAE,MAAAC,EAAA,IAASC,EAAA;AACjB,MAAIC,IAAoC,gBAAAC,EAAAC,GAAA,EAAE;AAE1C,UAAQJ,GAAA;AAAA,IACN,KAAK;AACH,MAAAE,IACE,gBAAAG,EAAAD,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAD,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,oBAAoB,GAAE;AAAA,QACrD,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT;AAAA,YACA,YAAY;AAAA,cACV,wBAAwB,gBAAAH,EAACL,EAAW,MAAX,CAAA,CAAgB;AAAA,YAAA;AAAA,UAC3C;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