@gusto/embedded-react-sdk 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/components/Base/Base.js +4 -4
  3. package/dist/components/Common/EmptyData/EmptyData.js +10 -10
  4. package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
  5. package/dist/components/Common/EmptyData/EmptyData.module.scss.js +5 -3
  6. package/dist/components/Common/EmptyData/EmptyData.module.scss.js.map +1 -1
  7. package/dist/components/Common/FieldDescription/FieldDescription.module.scss.js +1 -1
  8. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.d.ts +2 -0
  9. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +54 -0
  10. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -0
  11. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes.d.ts +44 -0
  12. package/dist/components/Common/FlowBreadcrumbs/index.d.ts +3 -0
  13. package/dist/components/Common/SignatureForm/SignatureForm.js +10 -12
  14. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  15. package/dist/components/Common/SignatureForm/SignatureFormActions.js +2 -3
  16. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  17. package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -8
  18. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  19. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.d.ts +2 -0
  20. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +52 -0
  21. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js.map +1 -0
  22. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.module.scss.js +16 -0
  23. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.module.scss.js.map +1 -0
  24. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +41 -0
  25. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js +8 -0
  26. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js.map +1 -0
  27. package/dist/components/Common/UI/Breadcrumbs/index.d.ts +3 -0
  28. package/dist/components/Common/UI/DescriptionList/DescriptionList.d.ts +2 -0
  29. package/dist/components/Common/UI/DescriptionList/DescriptionList.js +16 -0
  30. package/dist/components/Common/UI/DescriptionList/DescriptionList.js.map +1 -0
  31. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +10 -0
  32. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js.map +1 -0
  33. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +10 -0
  34. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js +5 -0
  35. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -0
  36. package/dist/components/Common/UI/DescriptionList/index.d.ts +3 -0
  37. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  38. package/dist/components/Company/AssignSignatory/AssignSignatory.js +5 -7
  39. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  40. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +2 -4
  41. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  42. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +2 -3
  43. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  44. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +6 -8
  45. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  46. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +15 -16
  47. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  48. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -5
  49. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  50. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +2 -3
  51. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  52. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +9 -11
  53. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  54. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
  55. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  56. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -5
  57. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  58. package/dist/components/Company/AssignSignatory/TitleSelect.js +3 -5
  59. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  60. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -7
  61. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  62. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
  63. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  64. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +4 -6
  65. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  66. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -5
  67. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  68. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js +22 -17
  69. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js.map +1 -1
  70. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +2 -3
  71. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  72. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +6 -7
  73. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  74. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -6
  75. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  76. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +2 -3
  77. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  78. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +8 -10
  79. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  80. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -5
  81. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  82. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +7 -9
  83. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  84. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -5
  85. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  86. package/dist/components/Company/FederalTaxes/Actions.js +6 -7
  87. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  88. package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -4
  89. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  90. package/dist/components/Company/FederalTaxes/Form.js +4 -4
  91. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -10
  92. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  93. package/dist/components/Company/Industry/Actions.js +7 -8
  94. package/dist/components/Company/Industry/Actions.js.map +1 -1
  95. package/dist/components/Company/Industry/Context.js +7 -8
  96. package/dist/components/Company/Industry/Context.js.map +1 -1
  97. package/dist/components/Company/Industry/Edit.js +2 -4
  98. package/dist/components/Company/Industry/Edit.js.map +1 -1
  99. package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
  100. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  101. package/dist/components/Company/Locations/LocationForm/Form.js +5 -7
  102. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  103. package/dist/components/Company/Locations/LocationForm/LocationForm.js +8 -10
  104. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  105. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -5
  106. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  107. package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
  108. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  109. package/dist/components/Company/Locations/LocationsList/List.js +9 -9
  110. package/dist/components/Company/Locations/LocationsList/LocationsList.js +2 -3
  111. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  112. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -5
  113. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  114. package/dist/components/Company/OnboardingFlow/OnboardingFlow.js +10 -10
  115. package/dist/components/Company/OnboardingFlow/OnboardingFlow.js.map +1 -1
  116. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js +16 -10
  117. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  118. package/dist/components/Company/OnboardingOverview/Completed.js +2 -3
  119. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  120. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -7
  121. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  122. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +6 -8
  123. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  124. package/dist/components/Company/OnboardingOverview/context.js +4 -5
  125. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  126. package/dist/components/Company/PaySchedule/PaySchedule.js +2 -3
  127. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  128. package/dist/components/Company/PaySchedule/_parts/Actions.js +2 -3
  129. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  130. package/dist/components/Company/PaySchedule/_parts/Edit.js +17 -17
  131. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  132. package/dist/components/Company/PaySchedule/_parts/Head.js +7 -8
  133. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  134. package/dist/components/Company/PaySchedule/_parts/List.js +8 -8
  135. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -7
  136. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  137. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
  138. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  139. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -5
  140. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  141. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +2 -3
  142. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  143. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +2 -3
  144. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  145. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -5
  146. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  147. package/dist/components/Contractor/Address/Address.js +3 -5
  148. package/dist/components/Contractor/Address/Address.js.map +1 -1
  149. package/dist/components/Contractor/Address/Form.js +7 -9
  150. package/dist/components/Contractor/Address/Form.js.map +1 -1
  151. package/dist/components/Contractor/Address/useAddress.js +6 -7
  152. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  153. package/dist/components/Contractor/ContractorList/index.js +4 -4
  154. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js +37 -37
  155. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  156. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +10 -12
  157. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  158. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -4
  159. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  160. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  161. package/dist/components/Contractor/Profile/useContractorProfile.js +3 -4
  162. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  163. package/dist/components/Contractor/Submit/Submit.js +19 -20
  164. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  165. package/dist/components/Employee/Compensation/Actions.js +12 -13
  166. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  167. package/dist/components/Employee/Compensation/Edit.js +14 -14
  168. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +9 -10
  169. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  170. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +31 -32
  171. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  172. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +8 -8
  173. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +10 -10
  174. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +22 -23
  175. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -1
  176. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +2 -3
  177. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  178. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +2 -4
  179. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  180. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -4
  181. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  182. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -5
  183. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  184. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +2 -4
  185. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  186. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -5
  187. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  188. package/dist/components/Employee/EmployeeList/Actions.js +6 -7
  189. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  190. package/dist/components/Employee/EmployeeList/EmployeeList.js +2 -4
  191. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  192. package/dist/components/Employee/EmployeeList/Head.js +2 -3
  193. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  194. package/dist/components/Employee/EmployeeList/List.js +10 -10
  195. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -5
  196. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  197. package/dist/components/Employee/FederalTaxes/Actions.js +5 -6
  198. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  199. package/dist/components/Employee/FederalTaxes/FederalForm.js +10 -11
  200. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  201. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -5
  202. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  203. package/dist/components/Employee/Landing/Landing.js +2 -3
  204. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  205. package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
  206. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  207. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +3 -5
  208. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  209. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +4 -4
  210. package/dist/components/Employee/PaymentMethod/PaymentMethod.d.ts +1 -0
  211. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +79 -78
  212. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  213. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +11 -13
  214. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  215. package/dist/components/Employee/PaymentMethod/Split.js +7 -7
  216. package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +1 -0
  217. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -7
  218. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  219. package/dist/components/Employee/Profile/Actions.js +5 -6
  220. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  221. package/dist/components/Employee/Profile/AdminPersonalDetails.js +6 -7
  222. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  223. package/dist/components/Employee/Profile/HomeAddress.js +5 -6
  224. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  225. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +23 -25
  226. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  227. package/dist/components/Employee/Profile/useProfile.js +4 -5
  228. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  229. package/dist/components/Employee/StateTaxes/Actions.js +5 -6
  230. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  231. package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -5
  232. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  233. package/dist/components/Employee/Taxes/Actions.js +6 -7
  234. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  235. package/dist/components/Employee/Taxes/FederalForm.js +10 -11
  236. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  237. package/dist/components/Employee/Taxes/useTaxes.js +4 -5
  238. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  239. package/dist/components/Flow/Flow.js +45 -24
  240. package/dist/components/Flow/Flow.js.map +1 -1
  241. package/dist/components/Flow/useFlow.d.ts +10 -1
  242. package/dist/components/Flow/useFlow.js.map +1 -1
  243. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.d.ts +1 -1
  244. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js +16 -16
  245. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js.map +1 -1
  246. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +20 -21
  247. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  248. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +15 -16
  249. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  250. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +97 -82
  251. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  252. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +5 -1
  253. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +88 -84
  254. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  255. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +39 -40
  256. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  257. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +27 -27
  258. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +6 -6
  259. package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +1 -1
  260. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +20 -19
  261. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
  262. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +5 -3
  263. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +65 -45
  264. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  265. package/dist/components/Payroll/PayrollFlow/index.d.ts +1 -1
  266. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
  267. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +233 -96
  268. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  269. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +10 -10
  270. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +8 -9
  271. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  272. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +12 -12
  273. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +1 -2
  274. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +41 -45
  275. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  276. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +1 -2
  277. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +93 -95
  278. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  279. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +1 -2
  280. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +12 -26
  281. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
  282. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +1 -2
  283. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +40 -44
  284. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  285. package/dist/components/Payroll/usePreparedPayrollData.js +3 -4
  286. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  287. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +46 -42
  288. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  289. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +2 -0
  290. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +4 -0
  291. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  292. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -3
  293. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  294. package/dist/helpers/breadcrumbHelpers.d.ts +33 -0
  295. package/dist/helpers/breadcrumbHelpers.js +46 -0
  296. package/dist/helpers/breadcrumbHelpers.js.map +1 -0
  297. package/dist/helpers/breadcrumbHelpers.test.d.ts +1 -0
  298. package/dist/helpers/dateFormatting.d.ts +4 -0
  299. package/dist/helpers/dateFormatting.js +30 -14
  300. package/dist/helpers/dateFormatting.js.map +1 -1
  301. package/dist/i18n/I18n.d.ts +1 -1
  302. package/dist/i18n/I18n.js +32 -23
  303. package/dist/i18n/I18n.js.map +1 -1
  304. package/dist/i18n/en/Company.PaySchedule.json.js +2 -2
  305. package/dist/i18n/en/Employee.PaymentMethod.json.js +70 -66
  306. package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
  307. package/dist/i18n/en/Payroll.PayrollBlocker.json.js +28 -0
  308. package/dist/i18n/en/Payroll.PayrollBlocker.json.js.map +1 -0
  309. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +28 -24
  310. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
  311. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +28 -26
  312. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
  313. package/dist/i18n/en/Payroll.PayrollFlow.json.js +8 -0
  314. package/dist/i18n/en/Payroll.PayrollFlow.json.js.map +1 -0
  315. package/dist/i18n/en/Payroll.PayrollLanding.json.js +2 -2
  316. package/dist/i18n/en/Payroll.PayrollOverview.json.js +60 -56
  317. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  318. package/dist/i18n/en/Payroll.PayrollReceipts.json.js +16 -12
  319. package/dist/i18n/en/Payroll.PayrollReceipts.json.js.map +1 -1
  320. package/dist/shared/constants.d.ts +3 -0
  321. package/dist/shared/constants.js +11 -9
  322. package/dist/shared/constants.js.map +1 -1
  323. package/dist/style.css +1 -1
  324. package/dist/types/i18next.d.ts +160 -149
  325. package/package.json +8 -8
  326. package/dist/i18n/en/Payroll.RunPayroll.json.js +0 -8
  327. package/dist/i18n/en/Payroll.RunPayroll.json.js.map +0 -1
  328. package/dist/i18n/en/PayrollBlocker.json.js +0 -24
  329. package/dist/i18n/en/PayrollBlocker.json.js.map +0 -1
@@ -1 +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\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,MAAK,WAAAR,GAAsB,eAAAC,GACzB,UAAAE,EAAM,SAAA,CACT,EAAA,CACF,IAIEK,KAAO,CAAC,EAAE,WAAAR,GAAW,UAAAS,GAAU,eAAAR,QAAsC;AACzE,QAAM,EAAE,mBAAAS,GAAmB,SAAAC,GAAS,aAAAC,GAAa,UAAUC,EAAA,IAAiBC,EAAA,GAEtE,EAAE,MAAMC,EAAA,IAAiBC,EAA8B;AAAA,IAC3D,WAAAhB;AAAA,EAAA,CACD,GAEK,CAACiB,GAAMC,CAAO,IAAIC;AAAA,IACtBJ,E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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
+ {"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,MAAK,WAAAR,GAAsB,eAAAC,GACzB,UAAAE,EAAM,SAAA,CACT,EAAA,CACF,IAIEK,KAAO,CAAC,EAAE,WAAAR,GAAW,UAAAS,GAAU,eAAAR,QAAsC;AACzE,QAAM,EAAE,mBAAAS,GAAmB,SAAAC,GAAS,aAAAC,GAAa,UAAUC,EAAA,IAAiBC,EAAA,GAEtE,EAAE,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cF,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;"}
@@ -5,8 +5,7 @@ import "classnames";
5
5
  import "../../../../shared/constants.js";
6
6
  import { ActionsLayout as r } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
7
  import { useComponentContext as u } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
- import "react";
9
- const B = () => {
8
+ const v = () => {
10
9
  const { t: n } = l("Company.PaySchedule"), { mode: i, handleAdd: a, handleCancel: c, handleContinue: s } = m(), t = u();
11
10
  return /* @__PURE__ */ e(d, { children: [
12
11
  i === "LIST_PAY_SCHEDULES" && /* @__PURE__ */ e(r, { children: [
@@ -60,6 +59,6 @@ const B = () => {
60
59
  ] });
61
60
  };
62
61
  export {
63
- B as Actions
62
+ v as Actions
64
63
  };
65
64
  //# sourceMappingURL=Actions.js.map
@@ -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,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
+ {"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;"}
@@ -2,28 +2,28 @@ import { jsx as t, jsxs as m } from "react/jsx-runtime";
2
2
  import { useFormContext as C, useWatch as y } from "react-hook-form";
3
3
  import { useTranslation as S } from "react-i18next";
4
4
  import { useState as g, useEffect as T } from "react";
5
- import { usePaySchedule as N } from "../usePaySchedule.js";
5
+ import { usePaySchedule as x } from "../usePaySchedule.js";
6
6
  import l from "./Edit.module.scss.js";
7
7
  import { Flex as h } from "../../../Common/Flex/Flex.js";
8
- import { Grid as x } from "../../../Common/Grid/Grid.js";
8
+ import { Grid as E } from "../../../Common/Grid/Grid.js";
9
9
  import "classnames";
10
- import { RadioGroupField as E } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
11
- import { TextInputField as O } from "../../../Common/Fields/TextInputField/TextInputField.js";
12
- import { DatePickerField as f } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
10
+ import { useComponentContext as N } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
11
+ import { useLocale as O } from "../../../../contexts/LocaleProvider/useLocale.js";
12
+ import { formatDateNamedWeekdayShortPlusDate as f } from "../../../../helpers/dateFormatting.js";
13
+ import { TextInputField as R } from "../../../Common/Fields/TextInputField/TextInputField.js";
14
+ import { SelectField as F } from "../../../Common/Fields/SelectField/SelectField.js";
15
+ import { RadioGroupField as M } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
13
16
  import { NumberInputField as P } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
14
- import { useComponentContext as R } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
15
- import { useLocale as F } from "../../../../contexts/LocaleProvider/useLocale.js";
16
- import { formatDateNamedWeekdayShortPlusDate as D } from "../../../../helpers/dateFormatting.js";
17
- import { SelectField as M } from "../../../Common/Fields/SelectField/SelectField.js";
17
+ import { DatePickerField as D } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
18
18
  const Q = () => {
19
- 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
+ const o = N(), { t: e } = S("Company.PaySchedule"), { locale: u } = O(), { payPeriodPreview: r, mode: p, payPreviewLoading: v } = x(), { 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";
20
20
  return T(() => {
21
21
  i === "Twice per month" && n === "1st15th" && (d("day1", 15), d("day2", 31));
22
- }, [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
+ }, [i, n, d]), p !== "EDIT_PAY_SCHEDULE" && p !== "ADD_PAY_SCHEDULE" ? null : /* @__PURE__ */ t("div", { className: l.payScheduleContainer, children: /* @__PURE__ */ m(E, { gap: 32, gridTemplateColumns: { base: "1fr", small: "1fr 1fr" }, children: [
23
23
  /* @__PURE__ */ t("div", { className: l.payScheduleForm, children: /* @__PURE__ */ m(h, { flexDirection: "column", children: [
24
- /* @__PURE__ */ t(O, { name: "customName", label: "Name", isRequired: !0 }),
24
+ /* @__PURE__ */ t(R, { name: "customName", label: e("labels.name"), isRequired: !0 }),
25
25
  /* @__PURE__ */ t(
26
- M,
26
+ F,
27
27
  {
28
28
  name: "frequency",
29
29
  label: e("labels.frequency"),
@@ -37,7 +37,7 @@ const Q = () => {
37
37
  }
38
38
  ),
39
39
  i === "Twice per month" && /* @__PURE__ */ t(
40
- E,
40
+ M,
41
41
  {
42
42
  name: "customTwicePerMonth",
43
43
  label: e("labels.frequencyOptions"),
@@ -49,7 +49,7 @@ const Q = () => {
49
49
  }
50
50
  ),
51
51
  /* @__PURE__ */ t(
52
- f,
52
+ D,
53
53
  {
54
54
  name: "anchorPayDate",
55
55
  label: e("labels.firstPayDate"),
@@ -58,7 +58,7 @@ const Q = () => {
58
58
  }
59
59
  ),
60
60
  /* @__PURE__ */ t(
61
- f,
61
+ D,
62
62
  {
63
63
  name: "anchorEndOfPayPeriod",
64
64
  label: e("labels.firstPayPeriodEndDate"),
@@ -77,7 +77,7 @@ const Q = () => {
77
77
  isRequired: !0,
78
78
  options: r.map((s, c) => ({
79
79
  value: String(c),
80
- label: `${D(s.startDate, u)} – ${D(s.endDate, u)}`
80
+ label: `${f(s.startDate, u)} – ${f(s.endDate, u)}`
81
81
  })),
82
82
  value: String(a),
83
83
  onChange: (s) => {
@@ -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 { 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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"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 { 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={t('labels.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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s as s, Fragment as o } from "react/jsx-runtime";
2
- import { useTranslation as c, Trans as r } from "react-i18next";
2
+ import { useTranslation as c, Trans as a } from "react-i18next";
3
3
  import { usePaySchedule as d } from "../usePaySchedule.js";
4
4
  import { Flex as h } from "../../../Common/Flex/Flex.js";
5
5
  import "classnames";
6
6
  import "../../../../shared/constants.js";
7
7
  import { useComponentContext as l } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
- import "react";
9
- const x = () => {
10
- const { t } = c("Company.PaySchedule"), n = l(), { mode: a } = d();
8
+ const S = () => {
9
+ const { t } = c("Company.PaySchedule"), n = l(), { mode: r } = d();
11
10
  let i = /* @__PURE__ */ e(o, {});
12
- switch (a) {
11
+ switch (r) {
13
12
  case "LIST_PAY_SCHEDULES":
14
13
  i = /* @__PURE__ */ s(o, { children: [
15
14
  /* @__PURE__ */ e(n.Heading, { as: "h2", children: t("headings.pageTitle") }),
16
15
  /* @__PURE__ */ e(n.Text, { children: /* @__PURE__ */ e(
17
- r,
16
+ a,
18
17
  {
19
18
  i18nKey: "listDescription",
20
19
  t,
@@ -24,7 +23,7 @@ const x = () => {
24
23
  }
25
24
  ) }),
26
25
  /* @__PURE__ */ e(n.Text, { children: /* @__PURE__ */ e(
27
- r,
26
+ a,
28
27
  {
29
28
  i18nKey: "listDescription2",
30
29
  t,
@@ -45,6 +44,6 @@ const x = () => {
45
44
  return /* @__PURE__ */ e(h, { justifyContent: "space-between", flexDirection: "column", gap: 4, children: /* @__PURE__ */ e("header", { children: i }) });
46
45
  };
47
46
  export {
48
- x as Head
47
+ S as Head
49
48
  };
50
49
  //# sourceMappingURL=Head.js.map
@@ -1 +1 @@
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;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,CAAA,CAAgB;AAAA,YAAA;AAAA,UACpC;AAAA,QAAA,EACF,CACF;AAAA,MAAA,GACF;AAEF;AAAA,IACF,KAAK;AACH,MAAAI,IACE,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,yBAAyB,GAAE;AAE5D;AAAA,IACF,KAAK;AACH,MAAAI,IACE,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,0BAA0B,GAAE;AAE7D;AAAA,EACF;AAGF,SACE,gBAAAK,EAACI,GAAA,EAAK,gBAAe,iBAAgB,eAAe,UAAU,KAAK,GACjE,UAAA,gBAAAJ,EAAC,UAAA,EAAQ,UAAAD,EAAA,CAAc,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;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,CAAA,CAAgB;AAAA,YAAA;AAAA,UACpC;AAAA,QAAA,EACF,CACF;AAAA,MAAA,GACF;AAEF;AAAA,IACF,KAAK;AACH,MAAAI,IACE,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,yBAAyB,GAAE;AAE5D;AAAA,IACF,KAAK;AACH,MAAAI,IACE,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,0BAA0B,GAAE;AAE7D;AAAA,EACF;AAGF,SACE,gBAAAK,EAACI,GAAA,EAAK,gBAAe,iBAAgB,eAAe,UAAU,KAAK,GACjE,UAAA,gBAAAJ,EAAC,UAAA,EAAQ,UAAAD,EAAA,CAAc,GACzB;AAEJ;"}
@@ -5,14 +5,14 @@ import o from "./List.module.scss.js";
5
5
  import { Flex as s } from "../../../Common/Flex/Flex.js";
6
6
  import "classnames";
7
7
  import "../../../../shared/constants.js";
8
- import { HamburgerMenu as f } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
9
- import S from "../../../../assets/icons/pencil.svg.js";
10
- import { useComponentContext as v } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
11
- import { VisuallyHidden as g } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
8
+ import f from "../../../../assets/icons/pencil.svg.js";
9
+ import { useComponentContext as S } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
10
+ import { VisuallyHidden as v } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
11
+ import { HamburgerMenu as g } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
12
12
  import { useDataView as L } from "../../../Common/DataView/useDataView.js";
13
13
  import { DataView as C } from "../../../Common/DataView/DataView.js";
14
14
  const F = () => {
15
- const { t: r } = h("Company.PaySchedule"), n = v(), { paySchedules: m, mode: c, handleEdit: l } = y(), { ...d } = L({
15
+ const { t: r } = h("Company.PaySchedule"), n = S(), { paySchedules: m, mode: c, handleEdit: l } = y(), { ...d } = L({
16
16
  data: m || [],
17
17
  columns: [
18
18
  {
@@ -30,13 +30,13 @@ const F = () => {
30
30
  }
31
31
  },
32
32
  {
33
- title: /* @__PURE__ */ e(g, { children: r("payScheduleList.active") }),
33
+ title: /* @__PURE__ */ e(v, { children: r("payScheduleList.active") }),
34
34
  key: "active",
35
35
  render: (t) => /* @__PURE__ */ e(s, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ e("div", { className: o.content, children: t.active ? /* @__PURE__ */ e(n.Badge, { status: "success", children: r("payScheduleList.active") }) : /* @__PURE__ */ e(n.Badge, { status: "info", children: r("payScheduleList.inactive") }) }) })
36
36
  }
37
37
  ],
38
38
  itemMenu: (t) => /* @__PURE__ */ e(
39
- f,
39
+ g,
40
40
  {
41
41
  triggerLabel: "Actions",
42
42
  items: [
@@ -45,7 +45,7 @@ const F = () => {
45
45
  onClick: () => {
46
46
  l(t);
47
47
  },
48
- icon: /* @__PURE__ */ e(S, { "aria-hidden": !0 })
48
+ icon: /* @__PURE__ */ e(f, { "aria-hidden": !0 })
49
49
  }
50
50
  ]
51
51
  }
@@ -10,12 +10,11 @@ import "@tanstack/react-query";
10
10
  import "../../Base/useBase.js";
11
11
  import "../../../shared/constants.js";
12
12
  import "classnames";
13
- import "../../../contexts/ComponentAdapter/useComponentContext.js";
14
13
  import "dompurify";
15
14
  import "../../../contexts/LocaleProvider/useLocale.js";
16
- import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
15
+ import "../../../contexts/ComponentAdapter/useComponentContext.js";
17
16
  import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
18
- const f = o.object({
17
+ const S = o.object({
19
18
  frequency: o.enum(["Every week", "Every other week", "Twice per month", "Monthly"]),
20
19
  anchorPayDate: o.date().optional(),
21
20
  anchorEndOfPayPeriod: o.date().optional(),
@@ -23,10 +22,10 @@ const f = o.object({
23
22
  day2: o.number().min(1).max(31).optional(),
24
23
  customName: o.string().optional(),
25
24
  customTwicePerMonth: o.string().optional()
26
- }), [w, b] = t("PayScheduleContext");
25
+ }), [f, w] = t("PayScheduleContext");
27
26
  export {
28
- b as PayScheduleProvider,
29
- f as PayScheduleSchema,
30
- w as usePaySchedule
27
+ w as PayScheduleProvider,
28
+ S as PayScheduleSchema,
29
+ f as usePaySchedule
31
30
  };
32
31
  //# sourceMappingURL=usePaySchedule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/usePaySchedule.ts"],"sourcesContent":["import type { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate'\nimport type { PayScheduleList } from '@gusto/embedded-api/models/components/payschedulelist'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayPeriods } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayschedulespreview'\nimport { z } from 'zod'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE =\n | 'LIST_PAY_SCHEDULES'\n | 'ADD_PAY_SCHEDULE'\n | 'EDIT_PAY_SCHEDULE'\n | 'PREVIEW_PAY_SCHEDULE'\n\ntype PayScheduleContextType = {\n companyId: string\n handleAdd: () => void\n handleEdit: (schedule: PayScheduleType) => void\n handleCancel: () => void\n handleContinue: () => void\n mode: MODE\n paySchedules: PayScheduleList[] | undefined | null\n currentPaySchedule: PayScheduleType | undefined | null\n payPeriodPreview?: PayPeriods[]\n payPreviewLoading?: boolean\n}\n\nexport const PayScheduleSchema = z.object({\n frequency: z.enum(['Every week', 'Every other week', 'Twice per month', 'Monthly']),\n anchorPayDate: z.date().optional(),\n anchorEndOfPayPeriod: z.date().optional(),\n day1: z.number().min(1).max(31).optional(),\n day2: z.number().min(1).max(31).optional(),\n customName: z.string().optional(),\n customTwicePerMonth: z.string().optional(),\n})\n\nexport type PayScheduleInputs = z.input<typeof PayScheduleSchema>\nexport type PayScheduleOutputs = z.output<typeof PayScheduleSchema>\n\nexport type PayScheduleDefaultValues = RequireAtLeastOne<\n Partial<\n Pick<\n PayScheduleCreateUpdate,\n 'anchorPayDate' | 'anchorEndOfPayPeriod' | 'day1' | 'day2' | 'customName' | 'frequency'\n >\n >\n>\n\nconst [usePaySchedule, PayScheduleProvider] =\n createCompoundContext<PayScheduleContextType>('PayScheduleContext')\nexport { usePaySchedule, PayScheduleProvider }\n"],"names":["PayScheduleSchema","z","usePaySchedule","PayScheduleProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AA2BO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACxC,WAAWA,EAAE,KAAK,CAAC,cAAc,oBAAoB,mBAAmB,SAAS,CAAC;AAAA,EAClF,eAAeA,EAAE,KAAA,EAAO,SAAA;AAAA,EACxB,sBAAsBA,EAAE,KAAA,EAAO,SAAA;AAAA,EAC/B,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,qBAAqBA,EAAE,OAAA,EAAS,SAAA;AAClC,CAAC,GAcK,CAACC,GAAgBC,CAAmB,IACxCC,EAA8C,oBAAoB;"}
1
+ {"version":3,"file":"usePaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/usePaySchedule.ts"],"sourcesContent":["import type { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate'\nimport type { PayScheduleList } from '@gusto/embedded-api/models/components/payschedulelist'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayPeriods } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayschedulespreview'\nimport { z } from 'zod'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE =\n | 'LIST_PAY_SCHEDULES'\n | 'ADD_PAY_SCHEDULE'\n | 'EDIT_PAY_SCHEDULE'\n | 'PREVIEW_PAY_SCHEDULE'\n\ntype PayScheduleContextType = {\n companyId: string\n handleAdd: () => void\n handleEdit: (schedule: PayScheduleType) => void\n handleCancel: () => void\n handleContinue: () => void\n mode: MODE\n paySchedules: PayScheduleList[] | undefined | null\n currentPaySchedule: PayScheduleType | undefined | null\n payPeriodPreview?: PayPeriods[]\n payPreviewLoading?: boolean\n}\n\nexport const PayScheduleSchema = z.object({\n frequency: z.enum(['Every week', 'Every other week', 'Twice per month', 'Monthly']),\n anchorPayDate: z.date().optional(),\n anchorEndOfPayPeriod: z.date().optional(),\n day1: z.number().min(1).max(31).optional(),\n day2: z.number().min(1).max(31).optional(),\n customName: z.string().optional(),\n customTwicePerMonth: z.string().optional(),\n})\n\nexport type PayScheduleInputs = z.input<typeof PayScheduleSchema>\nexport type PayScheduleOutputs = z.output<typeof PayScheduleSchema>\n\nexport type PayScheduleDefaultValues = RequireAtLeastOne<\n Partial<\n Pick<\n PayScheduleCreateUpdate,\n 'anchorPayDate' | 'anchorEndOfPayPeriod' | 'day1' | 'day2' | 'customName' | 'frequency'\n >\n >\n>\n\nconst [usePaySchedule, PayScheduleProvider] =\n createCompoundContext<PayScheduleContextType>('PayScheduleContext')\nexport { usePaySchedule, PayScheduleProvider }\n"],"names":["PayScheduleSchema","z","usePaySchedule","PayScheduleProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AA2BO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACxC,WAAWA,EAAE,KAAK,CAAC,cAAc,oBAAoB,mBAAmB,SAAS,CAAC;AAAA,EAClF,eAAeA,EAAE,KAAA,EAAO,SAAA;AAAA,EACxB,sBAAsBA,EAAE,KAAA,EAAO,SAAA;AAAA,EAC/B,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,qBAAqBA,EAAE,OAAA,EAAS,SAAA;AAClC,CAAC,GAcK,CAACC,GAAgBC,CAAmB,IACxCC,EAA8C,oBAAoB;"}
@@ -5,8 +5,7 @@ import "classnames";
5
5
  import "../../../../shared/constants.js";
6
6
  import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
7
  import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
- import "react";
9
- function h() {
8
+ function y() {
10
9
  const { t } = a("Company.StateTaxes", { keyPrefix: "form" }), { handleCancel: r, isPending: e } = s(), o = c();
11
10
  return /* @__PURE__ */ i(m, { children: [
12
11
  /* @__PURE__ */ n(o.Button, { variant: "secondary", onClick: r, children: t("cancelCta") }),
@@ -14,6 +13,6 @@ function h() {
14
13
  ] });
15
14
  }
16
15
  export {
17
- h as Actions
16
+ y as Actions
18
17
  };
19
18
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { handleCancel, isPending } = useStateTaxesForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleCancel","isPending","useStateTaxesForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GAC9BC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAA,EAAE,WAAW,EAAA,CAChB;AAAA,IACA,gBAAAM,EAACH,EAAW,QAAX,EAAkB,SAAQ,WAAU,MAAK,UAAS,YAAYF,GAC5D,UAAA,EAAE,SAAS,EAAA,CACd;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { handleCancel, isPending } = useStateTaxesForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleCancel","isPending","useStateTaxesForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GAC9BC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAA,EAAE,WAAW,EAAA,CAChB;AAAA,IACA,gBAAAM,EAACH,EAAW,QAAX,EAAkB,SAAQ,WAAU,MAAK,UAAS,YAAYF,GAC5D,UAAA,EAAE,SAAS,EAAA,CACd;AAAA,EAAA,GACF;AAEJ;"}
@@ -9,14 +9,13 @@ import "@tanstack/react-query";
9
9
  import "../../../Base/useBase.js";
10
10
  import "../../../../shared/constants.js";
11
11
  import "classnames";
12
- import "../../../../contexts/ComponentAdapter/useComponentContext.js";
13
12
  import "dompurify";
14
13
  import "../../../../contexts/LocaleProvider/useLocale.js";
15
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
+ import "../../../../contexts/ComponentAdapter/useComponentContext.js";
16
15
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
17
- const [u, f] = t("StateTaxesFormContext");
16
+ const [d, u] = t("StateTaxesFormContext");
18
17
  export {
19
- f as StateTaxesFormProvider,
20
- u as useStateTaxesForm
18
+ u as StateTaxesFormProvider,
19
+ d as useStateTaxesForm
21
20
  };
22
21
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
@@ -5,12 +5,11 @@ import "classnames";
5
5
  import "../../../../shared/constants.js";
6
6
  import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
7
  import { useComponentContext as s } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
- import "react";
9
- function d() {
8
+ function x() {
10
9
  const { t: o } = i("Company.StateTaxes"), n = s(), { handleContinue: r } = e();
11
10
  return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(n.Button, { variant: "primary", onClick: r, children: o("list.continueCta") }) });
12
11
  }
13
12
  export {
14
- d as Actions
13
+ x as Actions
15
14
  };
16
15
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes')\n const Components = useComponentContext()\n const { handleContinue } = useStateTaxesList()\n return (\n <ActionsLayout>\n <Components.Button variant=\"primary\" onClick={handleContinue}>\n {t('list.continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","Components","useComponentContext","handleContinue","useStateTaxesList","jsx","ActionsLayout"],"mappings":";;;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CC,IAAaC,EAAA,GACb,EAAE,gBAAAC,EAAA,IAAmBC,EAAA;AAC3B,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACJ,EAAW,QAAX,EAAkB,SAAQ,WAAU,SAASE,GAC3C,UAAAJ,EAAE,kBAAkB,GACvB,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes')\n const Components = useComponentContext()\n const { handleContinue } = useStateTaxesList()\n return (\n <ActionsLayout>\n <Components.Button variant=\"primary\" onClick={handleContinue}>\n {t('list.continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","Components","useComponentContext","handleContinue","useStateTaxesList","jsx","ActionsLayout"],"mappings":";;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CC,IAAaC,EAAA,GACb,EAAE,gBAAAC,EAAA,IAAmBC,EAAA;AAC3B,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACJ,EAAW,QAAX,EAAkB,SAAQ,WAAU,SAASE,GAC3C,UAAAJ,EAAE,kBAAkB,GACvB,GACF;AAEJ;"}
@@ -5,10 +5,9 @@ import "classnames";
5
5
  import "../../../../shared/constants.js";
6
6
  import { EmptyData as c } from "../../../Common/EmptyData/EmptyData.js";
7
7
  import { useComponentContext as u } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
- import "react";
9
8
  import { useDataView as d } from "../../../Common/DataView/useDataView.js";
10
9
  import { DataView as C } from "../../../Common/DataView/DataView.js";
11
- const w = () => {
10
+ const b = () => {
12
11
  const { stateTaxRequirements: r, handleChange: n } = l(), a = u(), { t } = o("Company.StateTaxes", { keyPrefix: "list" }), { t: i } = o("common", { keyPrefix: "statesHash" }), { ...m } = d({
13
12
  data: r,
14
13
  columns: [
@@ -38,6 +37,6 @@ const w = () => {
38
37
  return /* @__PURE__ */ s(C, { label: t("requirementsListLabel"), ...m });
39
38
  };
40
39
  export {
41
- w as List
40
+ b as List
42
41
  };
43
42
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { DataView, EmptyData, useDataView } from '@/components/Common'\nimport type { STATES_ABBR } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const List = () => {\n const { stateTaxRequirements, handleChange } = useStateTaxesList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'list' })\n const { t: statesHash } = useTranslation('common', { keyPrefix: 'statesHash' })\n\n const { ...dataViewProps } = useDataView({\n data: stateTaxRequirements,\n columns: [\n {\n key: 'state',\n title: t('requirementsListCol1'),\n render: requirement => {\n return <span>{statesHash(requirement.state as (typeof STATES_ABBR)[number])}</span>\n },\n },\n {\n key: 'status',\n title: t('requirementsListCol2'),\n render: requirement => {\n return (\n <>\n <Components.Badge status={requirement.setupComplete ? 'success' : 'warning'}>\n {requirement.setupComplete ? t('completeBadge') : t('incompleteBadge')}\n </Components.Badge>\n </>\n )\n },\n },\n ],\n itemMenu: requirement => {\n return (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleChange(requirement.state)\n }}\n >\n {requirement.setupComplete ? t('editStateTaxCta') : t('continueStateTaxSetupCta')}\n </Components.Button>\n )\n },\n\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n })\n return <DataView label={t('requirementsListLabel')} {...dataViewProps} />\n}\n"],"names":["List","stateTaxRequirements","handleChange","useStateTaxesList","Components","useComponentContext","useTranslation","statesHash","dataViewProps","useDataView","requirement","jsx","EmptyData","DataView"],"mappings":";;;;;;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,sBAAAC,GAAsB,cAAAC,EAAA,IAAiBC,EAAA,GACzCC,IAAaC,EAAA,GAEb,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,GAAGC,MAAeD,EAAe,UAAU,EAAE,WAAW,cAAc,GAExE,EAAE,GAAGE,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMR;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAAS,MACC,gBAAAC,EAAC,QAAA,EAAM,UAAAJ,EAAWG,EAAY,KAAqC,GAAE;AAAA,MAC9E;AAAA,MAEF;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAAA,6BAGF,UAAA,gBAAAC,EAACP,EAAW,OAAX,EAAiB,QAAQM,EAAY,gBAAgB,YAAY,WAC/D,UAAAA,EAAY,gBAAgB,EAAE,eAAe,IAAI,EAAE,iBAAiB,GACvE,GACF;AAAA,MAEJ;AAAA,IACF;AAAA,IAEF,UAAU,CAAAA,MAEN,gBAAAC;AAAA,MAACP,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAF,EAAaQ,EAAY,KAAK;AAAA,QAChC;AAAA,QAEC,YAAY,gBAAgB,EAAE,iBAAiB,IAAI,EAAE,0BAA0B;AAAA,MAAA;AAAA,IAAA;AAAA,IAKtF,YAAY,MACV,gBAAAC,EAACC,GAAA,EAAU,OAAO,EAAE,iBAAiB,GAAG,aAAa,EAAE,uBAAuB,EAAA,CAAG;AAAA,EAAA,CAEpF;AACD,2BAAQC,GAAA,EAAS,OAAO,EAAE,uBAAuB,GAAI,GAAGL,GAAe;AACzE;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { DataView, EmptyData, useDataView } from '@/components/Common'\nimport type { STATES_ABBR } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const List = () => {\n const { stateTaxRequirements, handleChange } = useStateTaxesList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'list' })\n const { t: statesHash } = useTranslation('common', { keyPrefix: 'statesHash' })\n\n const { ...dataViewProps } = useDataView({\n data: stateTaxRequirements,\n columns: [\n {\n key: 'state',\n title: t('requirementsListCol1'),\n render: requirement => {\n return <span>{statesHash(requirement.state as (typeof STATES_ABBR)[number])}</span>\n },\n },\n {\n key: 'status',\n title: t('requirementsListCol2'),\n render: requirement => {\n return (\n <>\n <Components.Badge status={requirement.setupComplete ? 'success' : 'warning'}>\n {requirement.setupComplete ? t('completeBadge') : t('incompleteBadge')}\n </Components.Badge>\n </>\n )\n },\n },\n ],\n itemMenu: requirement => {\n return (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleChange(requirement.state)\n }}\n >\n {requirement.setupComplete ? t('editStateTaxCta') : t('continueStateTaxSetupCta')}\n </Components.Button>\n )\n },\n\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n })\n return <DataView label={t('requirementsListLabel')} {...dataViewProps} />\n}\n"],"names":["List","stateTaxRequirements","handleChange","useStateTaxesList","Components","useComponentContext","useTranslation","statesHash","d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 import "@tanstack/react-query";
9
9
  import "../../../Base/useBase.js";
10
10
  import "../../../../shared/constants.js";
11
11
  import "classnames";
12
- import "../../../../contexts/ComponentAdapter/useComponentContext.js";
13
12
  import "dompurify";
14
13
  import "../../../../contexts/LocaleProvider/useLocale.js";
15
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
+ import "../../../../contexts/ComponentAdapter/useComponentContext.js";
16
15
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
17
- const [u, f] = t("StateTaxesListContext");
16
+ const [d, u] = t("StateTaxesListContext");
18
17
  export {
19
- f as StateTaxesListProvider,
20
- u as useStateTaxesList
18
+ u as StateTaxesListProvider,
19
+ d as useStateTaxesList
21
20
  };
22
21
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { ResponseBody } from '@gusto/embedded-api/models/operations/getv1companiescompanyuuidtaxrequirements'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: ResponseBody[]\n handleContinue: () => void\n handleChange: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAAiD,uBAAuB;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { ResponseBody } from '@gusto/embedded-api/models/operations/getv1companiescompanyuuidtaxrequirements'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: ResponseBody[]\n handleContinue: () => void\n handleChange: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAAiD,uBAAuB;"}
@@ -14,11 +14,9 @@ import { Flex as w } from "../../Common/Flex/Flex.js";
14
14
  import "classnames";
15
15
  import { contractorEvents as d } from "../../../shared/constants.js";
16
16
  import "react-i18next";
17
- import "../../../contexts/ComponentAdapter/useComponentContext.js";
18
- import "react";
19
17
  import { BaseComponent as G } from "../../Base/Base.js";
20
18
  import { useBase as H } from "../../Base/useBase.js";
21
- function mt(r) {
19
+ function it(r) {
22
20
  return /* @__PURE__ */ t(G, { ...r, children: /* @__PURE__ */ t(M, { ...r, children: r.children }) });
23
21
  }
24
22
  function M({ contractorId: r, defaultValues: e, children: n, className: a, dictionary: p }) {
@@ -68,7 +66,7 @@ function M({ contractorId: r, defaultValues: e, children: n, className: a, dicti
68
66
  ) });
69
67
  }
70
68
  export {
71
- mt as Address,
72
- mt as default
69
+ it as Address,
70
+ it as default
73
71
  };
74
72
  //# sourceMappingURL=Address.js.map