@gusto/embedded-react-sdk 0.12.1 → 0.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/CHANGELOG.md +133 -0
  2. package/dist/_virtual/dynamic-import-helper.js +1 -8
  3. package/dist/_virtual/dynamic-import-helper.js.map +1 -1
  4. package/dist/components/Base/Base.js +23 -22
  5. package/dist/components/Base/Base.js.map +1 -1
  6. package/dist/components/Common/ReorderableList/DropZone.js +1 -1
  7. package/dist/components/Common/ReorderableList/DropZone.js.map +1 -1
  8. package/dist/components/Common/ReorderableList/ReorderableItem.js +1 -1
  9. package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureForm.js +7 -5
  11. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  12. package/dist/components/Common/SignatureForm/SignatureFormActions.js +12 -10
  13. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  14. package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -6
  15. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  16. package/dist/components/Common/UI/CalendarPreview/CalendarPreview.js +1 -1
  17. package/dist/components/Common/UI/DatePicker/DatePicker.js +1 -1
  18. package/dist/components/Common/hooks/useNumberFormatter.js +1 -1
  19. package/dist/components/Company/AssignSignatory/AssignSignatory.js +4 -3
  20. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  21. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +8 -6
  22. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  23. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +10 -8
  24. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  25. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +5 -5
  26. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
  27. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -8
  28. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  29. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +8 -6
  30. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  31. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +4 -4
  32. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  33. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -8
  34. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  35. package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
  36. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  37. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -10
  38. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  39. package/dist/components/Company/BankAccount/BankAccount.js +1 -1
  40. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
  41. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  42. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +2 -2
  43. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +11 -9
  44. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  45. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -8
  46. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  47. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +12 -10
  48. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  49. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +1 -1
  50. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +13 -11
  51. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  52. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +2 -2
  53. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -4
  54. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  55. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +7 -5
  56. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  57. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
  58. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  59. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -8
  60. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  61. package/dist/components/Company/DocumentSigner/DocumentSigner.js +1 -1
  62. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +6 -5
  63. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  64. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -8
  65. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  66. package/dist/components/Company/FederalTaxes/Actions.js +9 -7
  67. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  68. package/dist/components/Company/FederalTaxes/FederalTaxes.js +10 -9
  69. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  70. package/dist/components/Company/FederalTaxes/Form.js +6 -4
  71. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  72. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +12 -16
  73. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  74. package/dist/components/Company/Industry/Actions.js +7 -5
  75. package/dist/components/Company/Industry/Actions.js.map +1 -1
  76. package/dist/components/Company/Industry/Context.js +7 -11
  77. package/dist/components/Company/Industry/Context.js.map +1 -1
  78. package/dist/components/Company/Industry/Edit.js +12 -10
  79. package/dist/components/Company/Industry/Edit.js.map +1 -1
  80. package/dist/components/Company/Industry/Industry.js +2 -2
  81. package/dist/components/Company/Locations/LocationForm/Actions.js +8 -6
  82. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  83. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  84. package/dist/components/Company/Locations/LocationForm/LocationForm.js +8 -7
  85. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  86. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -8
  87. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  88. package/dist/components/Company/Locations/LocationsList/Actions.js +8 -6
  89. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  90. package/dist/components/Company/Locations/LocationsList/List.js +4 -2
  91. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  92. package/dist/components/Company/Locations/LocationsList/LocationsList.js +10 -9
  93. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  94. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -8
  95. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  96. package/dist/components/Company/OnboardingOverview/Completed.js +14 -12
  97. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  98. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +8 -6
  99. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  100. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +4 -3
  101. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  102. package/dist/components/Company/OnboardingOverview/context.js +4 -8
  103. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  104. package/dist/components/Company/PaySchedule/PaySchedule.js +9 -8
  105. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  106. package/dist/components/Company/PaySchedule/_parts/Actions.js +12 -10
  107. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  108. package/dist/components/Company/PaySchedule/_parts/Edit.js +14 -14
  109. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -6
  110. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  111. package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
  112. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  113. package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -11
  114. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  115. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +7 -5
  116. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  117. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +3 -3
  118. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -8
  119. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  120. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +8 -6
  121. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  122. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +7 -5
  123. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  124. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +1 -1
  125. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -8
  126. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  127. package/dist/components/Contractor/Address/Address.js +9 -8
  128. package/dist/components/Contractor/Address/Address.js.map +1 -1
  129. package/dist/components/Contractor/Address/Form.js +1 -1
  130. package/dist/components/Contractor/Address/useAddress.js +6 -10
  131. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  132. package/dist/components/Contractor/ContractorList/index.js +26 -25
  133. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  134. package/dist/components/Contractor/ContractorList/useContractorList.js +1 -1
  135. package/dist/components/Contractor/NewHireReport/NewHireReport.js +20 -19
  136. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  137. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +7 -5
  138. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  139. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +87 -85
  140. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  141. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
  142. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  143. package/dist/components/Contractor/Profile/ContractorProfile.js +1 -1
  144. package/dist/components/Contractor/Profile/ContractorProfileForm.js +13 -13
  145. package/dist/components/Contractor/Profile/useContractorProfile.js +36 -40
  146. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  147. package/dist/components/Contractor/Submit/Submit.js +7 -6
  148. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  149. package/dist/components/Employee/Compensation/Actions.js +6 -5
  150. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  151. package/dist/components/Employee/Compensation/Compensation.js +10 -10
  152. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  153. package/dist/components/Employee/Compensation/Edit.js +15 -14
  154. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  155. package/dist/components/Employee/Compensation/List.js +25 -23
  156. package/dist/components/Employee/Compensation/List.js.map +1 -1
  157. package/dist/components/Employee/Compensation/useCompensation.js +1 -1
  158. package/dist/components/Employee/Compensation/useCompensation.js.map +1 -1
  159. package/dist/components/Employee/Deductions/Deductions.js +1 -1
  160. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  161. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +15 -14
  162. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
  163. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +10 -9
  164. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  165. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +12 -11
  166. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -1
  167. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +8 -6
  168. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  169. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +8 -7
  170. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  171. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
  172. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  173. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -8
  174. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  175. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +11 -10
  176. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  177. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -8
  178. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  179. package/dist/components/Employee/EmployeeList/Actions.js +6 -4
  180. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  181. package/dist/components/Employee/EmployeeList/EmployeeList.js +7 -6
  182. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  183. package/dist/components/Employee/EmployeeList/Head.js +7 -5
  184. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  185. package/dist/components/Employee/EmployeeList/List.js +15 -14
  186. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  187. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -8
  188. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  189. package/dist/components/Employee/FederalTaxes/Actions.d.ts +1 -0
  190. package/dist/components/Employee/FederalTaxes/Actions.js +15 -0
  191. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -0
  192. package/dist/components/Employee/FederalTaxes/FederalForm.d.ts +29 -0
  193. package/dist/components/Employee/FederalTaxes/FederalForm.js +110 -0
  194. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -0
  195. package/dist/components/Employee/FederalTaxes/FederalTaxes.d.ts +6 -0
  196. package/dist/components/Employee/FederalTaxes/FederalTaxes.js +72 -0
  197. package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -0
  198. package/dist/components/Employee/FederalTaxes/Head.d.ts +1 -0
  199. package/dist/components/Employee/FederalTaxes/Head.js +24 -0
  200. package/dist/components/Employee/FederalTaxes/Head.js.map +1 -0
  201. package/dist/components/Employee/FederalTaxes/index.d.ts +2 -0
  202. package/dist/components/Employee/FederalTaxes/useFederalTaxes.d.ts +5 -0
  203. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +16 -0
  204. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -0
  205. package/dist/components/Employee/Landing/Landing.js +15 -14
  206. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  207. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +1 -19
  208. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
  209. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +22 -0
  210. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +18 -0
  211. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -0
  212. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.d.ts +2 -1
  213. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +72 -63
  214. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  215. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +9 -9
  216. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
  217. package/dist/components/Employee/PaymentMethod/Actions.js +9 -7
  218. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  219. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +6 -5
  220. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  221. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +10 -8
  222. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  223. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +8 -8
  224. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  225. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +3 -2
  226. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  227. package/dist/components/Employee/PaymentMethod/Split.js +12 -11
  228. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  229. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +10 -14
  230. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  231. package/dist/components/Employee/Profile/Actions.js +9 -7
  232. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  233. package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -9
  234. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  235. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  236. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  237. package/dist/components/Employee/Profile/Profile.js +13 -13
  238. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  239. package/dist/components/Employee/Profile/useProfile.js +4 -8
  240. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  241. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +2 -1
  242. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js +37 -24
  243. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
  244. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.d.ts +2 -1
  245. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js +31 -19
  246. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
  247. package/dist/components/Employee/StateTaxes/Actions.d.ts +1 -0
  248. package/dist/components/Employee/StateTaxes/Actions.js +15 -0
  249. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -0
  250. package/dist/components/Employee/StateTaxes/StateForm.d.ts +10 -0
  251. package/dist/components/Employee/StateTaxes/StateForm.js +34 -0
  252. package/dist/components/Employee/StateTaxes/StateForm.js.map +1 -0
  253. package/dist/components/Employee/StateTaxes/StateTaxes.d.ts +7 -0
  254. package/dist/components/Employee/StateTaxes/StateTaxes.js +90 -0
  255. package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -0
  256. package/dist/components/Employee/StateTaxes/index.d.ts +2 -0
  257. package/dist/components/Employee/StateTaxes/useStateTaxes.d.ts +8 -0
  258. package/dist/components/Employee/StateTaxes/useStateTaxes.js +16 -0
  259. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -0
  260. package/dist/components/Employee/Taxes/Actions.js +10 -8
  261. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  262. package/dist/components/Employee/Taxes/FederalForm.js +14 -12
  263. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  264. package/dist/components/Employee/Taxes/Taxes.d.ts +5 -0
  265. package/dist/components/Employee/Taxes/Taxes.js +73 -85
  266. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  267. package/dist/components/Employee/Taxes/useTaxes.js +4 -8
  268. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  269. package/dist/components/Employee/index.d.ts +3 -1
  270. package/dist/components/Employee/index.js +16 -12
  271. package/dist/components/Employee/index.js.map +1 -1
  272. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +8 -6
  273. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  274. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +12 -10
  275. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  276. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +10 -8
  277. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  278. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +1 -1
  279. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +11 -9
  280. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  281. package/dist/contexts/ApiProvider/ApiProvider.js +4 -4
  282. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +7 -5
  283. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  284. package/dist/contexts/ThemeProvider/ThemeProvider.js +7 -7
  285. package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
  286. package/dist/i18n/I18n.js +1 -1
  287. package/dist/i18n/I18n.js.map +1 -1
  288. package/dist/i18n/en/Employee.FederalTaxes.json.js +46 -0
  289. package/dist/i18n/en/Employee.FederalTaxes.json.js.map +1 -0
  290. package/dist/i18n/en/Employee.StateTaxes.json.js +6 -10
  291. package/dist/i18n/en/Employee.StateTaxes.json.js.map +1 -1
  292. package/dist/i18n/en/Employee.Taxes.json.js +7 -7
  293. package/dist/shared/constants.d.ts +4 -2
  294. package/dist/shared/constants.js +10 -9
  295. package/dist/shared/constants.js.map +1 -1
  296. package/dist/style.css +1 -1
  297. package/dist/types/i18next.d.ts +27 -4
  298. package/package.json +5 -6
@@ -1,17 +1,19 @@
1
- import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
- import { useTranslation as l } from "react-i18next";
3
- import { useOnboardingOverview as m } from "./context.js";
4
- import { Flex as a } from "../../Common/Flex/Flex.js";
5
- import { useComponentContext as d } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
- const u = () => {
7
- const e = d(), { onboardingCompleted: t, handleDone: r } = m(), { t: n } = l("Company.OnboardingOverview");
8
- return t ? /* @__PURE__ */ i(a, { alignItems: "center", flexDirection: "column", gap: 8, children: [
9
- /* @__PURE__ */ o(e.Heading, { as: "h2", textAlign: "center", children: n("onboardingCompletedTitle") }),
10
- /* @__PURE__ */ o("p", { children: n("onboardingCompletedDescription") }),
11
- /* @__PURE__ */ o(e.Button, { variant: "secondary", onClick: r, children: n("onboardingCompletedCta") })
1
+ import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
+ import { useTranslation as m } from "react-i18next";
3
+ import { useOnboardingOverview as l } from "./context.js";
4
+ import { Flex as p } from "../../Common/Flex/Flex.js";
5
+ import "classnames";
6
+ import "../../../shared/constants.js";
7
+ import { useComponentContext as a } from "../../../contexts/ComponentAdapter/useComponentContext.js";
8
+ const x = () => {
9
+ const e = a(), { onboardingCompleted: t, handleDone: r } = l(), { t: o } = m("Company.OnboardingOverview");
10
+ return t ? /* @__PURE__ */ i(p, { alignItems: "center", flexDirection: "column", gap: 8, children: [
11
+ /* @__PURE__ */ n(e.Heading, { as: "h2", textAlign: "center", children: o("onboardingCompletedTitle") }),
12
+ /* @__PURE__ */ n("p", { children: o("onboardingCompletedDescription") }),
13
+ /* @__PURE__ */ n(e.Button, { variant: "secondary", onClick: r, children: o("onboardingCompletedCta") })
12
14
  ] }) : null;
13
15
  };
14
16
  export {
15
- u as Completed
17
+ x as Completed
16
18
  };
17
19
  //# sourceMappingURL=Completed.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Completed.js","sources":["../../../../src/components/Company/OnboardingOverview/Completed.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Completed = () => {\n const Components = useComponentContext()\n const { onboardingCompleted, handleDone } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n if (!onboardingCompleted) {\n return null\n }\n return (\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardingCompletedTitle')}\n </Components.Heading>\n <p>{t('onboardingCompletedDescription')}</p>\n <Components.Button variant=\"secondary\" onClick={handleDone}>\n {t('onboardingCompletedCta')}\n </Components.Button>\n </Flex>\n )\n}\n"],"names":["Completed","Components","useComponentContext","onboardingCompleted","handleDone","useOnboardingOverview","t","useTranslation","Flex","jsx"],"mappings":";;;;;AAKO,MAAMA,IAAY,MAAM;AAC7B,QAAMC,IAAaC,EAAA,GACb,EAAE,qBAAAC,GAAqB,YAAAC,EAAA,IAAeC,EAAA,GACtC,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AACzD,SAAKJ,sBAIFK,GAAA,EAAK,YAAW,UAAS,eAAc,UAAS,KAAK,GACpD,UAAA;AAAA,IAAA,gBAAAC,EAACR,EAAW,SAAX,EAAmB,IAAG,MAAK,WAAU,UACnC,UAAAK,EAAE,0BAA0B,EAAA,CAC/B;AAAA,IACA,gBAAAG,EAAC,KAAA,EAAG,UAAAH,EAAE,gCAAgC,EAAA,CAAE;AAAA,IACxC,gBAAAG,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASG,GAC7C,UAAAE,EAAE,wBAAwB,EAAA,CAC7B;AAAA,EAAA,GACF,IAXO;AAaX;"}
1
+ {"version":3,"file":"Completed.js","sources":["../../../../src/components/Company/OnboardingOverview/Completed.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Completed = () => {\n const Components = useComponentContext()\n const { onboardingCompleted, handleDone } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n if (!onboardingCompleted) {\n return null\n }\n return (\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardingCompletedTitle')}\n </Components.Heading>\n <p>{t('onboardingCompletedDescription')}</p>\n <Components.Button variant=\"secondary\" onClick={handleDone}>\n {t('onboardingCompletedCta')}\n </Components.Button>\n </Flex>\n )\n}\n"],"names":["Completed","Components","useComponentContext","onboardingCompleted","handleDone","useOnboardingOverview","t","useTranslation","Flex","jsx"],"mappings":";;;;;;;AAKO,MAAMA,IAAY,MAAM;AAC7B,QAAMC,IAAaC,EAAA,GACb,EAAE,qBAAAC,GAAqB,YAAAC,EAAA,IAAeC,EAAA,GACtC,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AACzD,SAAKJ,sBAIFK,GAAA,EAAK,YAAW,UAAS,eAAc,UAAS,KAAK,GACpD,UAAA;AAAA,IAAA,gBAAAC,EAACR,EAAW,SAAX,EAAmB,IAAG,MAAK,WAAU,UACnC,UAAAK,EAAE,0BAA0B,EAAA,CAC/B;AAAA,IACA,gBAAAG,EAAC,KAAA,EAAG,UAAAH,EAAE,gCAAgC,EAAA,CAAE;AAAA,IACxC,gBAAAG,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASG,GAC7C,UAAAE,EAAE,wBAAwB,EAAA,CAC7B;AAAA,EAAA,GACF,IAXO;AAaX;"}
@@ -1,16 +1,18 @@
1
- import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
- import { useTranslation as p } from "react-i18next";
1
+ import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
+ import { useTranslation as l } from "react-i18next";
3
3
  import { useOnboardingOverview as a } from "./context.js";
4
4
  import { Flex as c } from "../../Common/Flex/Flex.js";
5
+ import "classnames";
6
+ import "../../../shared/constants.js";
5
7
  import { ActionsLayout as u } from "../../Common/ActionsLayout/ActionsLayout.js";
6
8
  import { RequirementsList as d } from "../../Common/RequirementsList/RequirementsList.js";
7
9
  import { useComponentContext as g } from "../../../contexts/ComponentAdapter/useComponentContext.js";
8
- const S = () => {
9
- const r = g(), { onboardingSteps: n, onboardingCompleted: s, handleContinue: m } = a(), { t: e } = p("Company.OnboardingOverview");
10
+ const D = () => {
11
+ const r = g(), { onboardingSteps: n, onboardingCompleted: s, handleContinue: m } = a(), { t: e } = l("Company.OnboardingOverview");
10
12
  if (s)
11
13
  return null;
12
14
  const o = !n?.some((i) => i.required && i.completed);
13
- return /* @__PURE__ */ l(c, { flexDirection: "column", alignItems: "flex-start", gap: 8, children: [
15
+ return /* @__PURE__ */ p(c, { flexDirection: "column", alignItems: "flex-start", gap: 8, children: [
14
16
  /* @__PURE__ */ t(r.Heading, { as: "h2", children: e(o ? "initialSetupTitle" : "missingRequirementsTitle") }),
15
17
  /* @__PURE__ */ t("p", { children: e(o ? "initialSetupDescription" : "missingRequirementsDescription") }),
16
18
  n && /* @__PURE__ */ t(
@@ -27,6 +29,6 @@ const S = () => {
27
29
  ] });
28
30
  };
29
31
  export {
30
- S as MissingRequirements
32
+ D as MissingRequirements
31
33
  };
32
34
  //# sourceMappingURL=MissingRequirements.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MissingRequirements.js","sources":["../../../../src/components/Company/OnboardingOverview/MissingRequirements.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { RequirementsList } from '@/components/Common/RequirementsList/RequirementsList'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const MissingRequirements = () => {\n const Components = useComponentContext()\n const { onboardingSteps, onboardingCompleted, handleContinue } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n\n if (onboardingCompleted) {\n return null\n }\n\n const isInitialSetup = !onboardingSteps?.some(step => step.required && step.completed)\n\n return (\n <Flex flexDirection=\"column\" alignItems=\"flex-start\" gap={8}>\n <Components.Heading as=\"h2\">\n {t(isInitialSetup ? 'initialSetupTitle' : 'missingRequirementsTitle')}\n </Components.Heading>\n <p>{t(isInitialSetup ? 'initialSetupDescription' : 'missingRequirementsDescription')}</p>\n {onboardingSteps && (\n <RequirementsList\n requirements={onboardingSteps.map(step => ({\n completed: step.completed!,\n title: t(`stepTitles.${step.id!}`),\n description: t(`stepDescriptions.${step.id!}`),\n }))}\n />\n )}\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleContinue}>\n {t(isInitialSetup ? 'initialSetupCta' : 'missingRequirementsCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["MissingRequirements","Components","useComponentContext","onboardingSteps","onboardingCompleted","handleContinue","useOnboardingOverview","t","useTranslation","isInitialSetup","step","Flex","jsx","RequirementsList","ActionsLayout"],"mappings":";;;;;;;AAMO,MAAMA,IAAsB,MAAM;AACvC,QAAMC,IAAaC,EAAA,GACb,EAAE,iBAAAC,GAAiB,qBAAAC,GAAqB,gBAAAC,EAAA,IAAmBC,EAAA,GAC3D,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AAEzD,MAAIJ;AACF,WAAO;AAGT,QAAMK,IAAiB,CAACN,GAAiB,KAAK,OAAQO,EAAK,YAAYA,EAAK,SAAS;AAErF,2BACGC,GAAA,EAAK,eAAc,UAAS,YAAW,cAAa,KAAK,GACxD,UAAA;AAAA,IAAA,gBAAAC,EAACX,EAAW,SAAX,EAAmB,IAAG,MACpB,UAAAM,EAAEE,IAAiB,sBAAsB,0BAA0B,EAAA,CACtE;AAAA,sBACC,KAAA,EAAG,UAAAF,EAAEE,IAAiB,4BAA4B,gCAAgC,GAAE;AAAA,IACpFN,KACC,gBAAAS;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,cAAcV,EAAgB,IAAI,CAAAO,OAAS;AAAA,UACzC,WAAWA,EAAK;AAAA,UAChB,OAAOH,EAAE,cAAcG,EAAK,EAAG,EAAE;AAAA,UACjC,aAAaH,EAAE,oBAAoBG,EAAK,EAAG,EAAE;AAAA,QAAA,EAC7C;AAAA,MAAA;AAAA,IAAA;AAAA,IAGN,gBAAAE,EAACE,GAAA,EACC,UAAA,gBAAAF,EAACX,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASI,GAC7C,UAAAE,EAAEE,IAAiB,oBAAoB,wBAAwB,GAClE,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"MissingRequirements.js","sources":["../../../../src/components/Company/OnboardingOverview/MissingRequirements.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { RequirementsList } from '@/components/Common/RequirementsList/RequirementsList'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const MissingRequirements = () => {\n const Components = useComponentContext()\n const { onboardingSteps, onboardingCompleted, handleContinue } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n\n if (onboardingCompleted) {\n return null\n }\n\n const isInitialSetup = !onboardingSteps?.some(step => step.required && step.completed)\n\n return (\n <Flex flexDirection=\"column\" alignItems=\"flex-start\" gap={8}>\n <Components.Heading as=\"h2\">\n {t(isInitialSetup ? 'initialSetupTitle' : 'missingRequirementsTitle')}\n </Components.Heading>\n <p>{t(isInitialSetup ? 'initialSetupDescription' : 'missingRequirementsDescription')}</p>\n {onboardingSteps && (\n <RequirementsList\n requirements={onboardingSteps.map(step => ({\n completed: step.completed!,\n title: t(`stepTitles.${step.id!}`),\n description: t(`stepDescriptions.${step.id!}`),\n }))}\n />\n )}\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleContinue}>\n {t(isInitialSetup ? 'initialSetupCta' : 'missingRequirementsCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["MissingRequirements","Components","useComponentContext","onboardingSteps","onboardingCompleted","handleContinue","useOnboardingOverview","t","useTranslation","isInitialSetup","step","Flex","jsx","RequirementsList","ActionsLayout"],"mappings":";;;;;;;;;AAMO,MAAMA,IAAsB,MAAM;AACvC,QAAMC,IAAaC,EAAA,GACb,EAAE,iBAAAC,GAAiB,qBAAAC,GAAqB,gBAAAC,EAAA,IAAmBC,EAAA,GAC3D,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AAEzD,MAAIJ;AACF,WAAO;AAGT,QAAMK,IAAiB,CAACN,GAAiB,KAAK,OAAQO,EAAK,YAAYA,EAAK,SAAS;AAErF,2BACGC,GAAA,EAAK,eAAc,UAAS,YAAW,cAAa,KAAK,GACxD,UAAA;AAAA,IAAA,gBAAAC,EAACX,EAAW,SAAX,EAAmB,IAAG,MACpB,UAAAM,EAAEE,IAAiB,sBAAsB,0BAA0B,EAAA,CACtE;AAAA,sBACC,KAAA,EAAG,UAAAF,EAAEE,IAAiB,4BAA4B,gCAAgC,GAAE;AAAA,IACpFN,KACC,gBAAAS;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,cAAcV,EAAgB,IAAI,CAAAO,OAAS;AAAA,UACzC,WAAWA,EAAK;AAAA,UAChB,OAAOH,EAAE,cAAcG,EAAK,EAAG,EAAE;AAAA,UACjC,aAAaH,EAAE,oBAAoBG,EAAK,EAAG,EAAE;AAAA,QAAA,EAC7C;AAAA,MAAA;AAAA,IAAA;AAAA,IAGN,gBAAAE,EAACE,GAAA,EACC,UAAA,gBAAAF,EAACX,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASI,GAC7C,UAAAE,EAAEE,IAAiB,oBAAoB,wBAAwB,GAClE,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as n, jsxs as s, Fragment as c } from "react/jsx-runtime";
2
- import { useCompaniesGetOnboardingStatusSuspense as p } from "@gusto/embedded-api/react-query/companiesGetOnboardingStatus";
2
+ import { useCompaniesGetOnboardingStatusSuspense as p } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/react-query/companiesGetOnboardingStatus.js";
3
3
  import { OnboardingOverviewProvider as l } from "./context.js";
4
4
  import { MissingRequirements as u } from "./MissingRequirements.js";
5
5
  import { Completed as O } from "./Completed.js";
@@ -7,8 +7,9 @@ import { BaseComponent as f } from "../../Base/Base.js";
7
7
  import { useBase as v } from "../../Base/useBase.js";
8
8
  import { useI18n as C, useComponentDictionary as g } from "../../../i18n/I18n.js";
9
9
  import { Flex as h } from "../../Common/Flex/Flex.js";
10
+ import "classnames";
10
11
  import { componentEvents as i } from "../../../shared/constants.js";
11
- function P(o) {
12
+ function j(o) {
12
13
  return C("Company.OnboardingOverview"), g("Company.OnboardingOverview", o.dictionary), /* @__PURE__ */ n(f, { ...o, children: /* @__PURE__ */ n(b, { ...o, children: o.children }) });
13
14
  }
14
15
  const b = ({ companyId: o, className: t, children: e }) => {
@@ -34,6 +35,6 @@ const b = ({ companyId: o, className: t, children: e }) => {
34
35
  ) });
35
36
  };
36
37
  export {
37
- P as OnboardingOverview
38
+ j as OnboardingOverview
38
39
  };
39
40
  //# sourceMappingURL=OnboardingOverview.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OnboardingOverview.js","sources":["../../../../src/components/Company/OnboardingOverview/OnboardingOverview.tsx"],"sourcesContent":["import { useCompaniesGetOnboardingStatusSuspense } from '@gusto/embedded-api/react-query/companiesGetOnboardingStatus'\nimport { OnboardingOverviewProvider } from './context'\nimport { MissingRequirements } from './MissingRequirements'\nimport { Completed } from './Completed'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { Flex } from '@/components/Common'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface OnboardingOverviewProps extends CommonComponentInterface<'Company.OnboardingOverview'> {\n companyId: string\n}\n\nexport function OnboardingOverview(props: OnboardingOverviewProps & BaseComponentInterface) {\n useI18n('Company.OnboardingOverview')\n useComponentDictionary('Company.OnboardingOverview', props.dictionary)\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, className, children }: OnboardingOverviewProps) => {\n const { onEvent } = useBase()\n\n const { data } = useCompaniesGetOnboardingStatusSuspense({ companyUuid: companyId })\n const { onboardingCompleted, onboardingSteps } = data.companyOnboardingStatus!\n\n const handleDone = () => {\n onEvent(componentEvents.COMPANY_OVERVIEW_DONE)\n }\n const handleContinue = () => {\n onEvent(componentEvents.COMPANY_OVERVIEW_CONTINUE)\n }\n\n return (\n <section className={className}>\n <OnboardingOverviewProvider\n value={{\n onboardingCompleted,\n onboardingSteps,\n handleDone,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Completed />\n <MissingRequirements />\n </>\n )}\n </Flex>\n </OnboardingOverviewProvider>\n </section>\n )\n}\n"],"names":["OnboardingOverview","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","companyId","className","children","onEvent","useBase","data","useCompaniesGetOnboardingStatusSuspense","onboardingCompleted","onboardingSteps","OnboardingOverviewProvider","componentEvents","Flex","jsxs","Fragment","Completed","MissingRequirements"],"mappings":";;;;;;;;;;AAmBO,SAASA,EAAmBC,GAAyD;AAC1F,SAAAC,EAAQ,4BAA4B,GACpCC,EAAuB,8BAA8BF,EAAM,UAAU,GAEnE,gBAAAG,EAACC,GAAA,EAAe,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,KAAM,GAAGL,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMK,IAAO,CAAC,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,QAAwC;AAC5E,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,EAAE,MAAAC,EAAA,IAASC,EAAwC,EAAE,aAAaN,GAAW,GAC7E,EAAE,qBAAAO,GAAqB,iBAAAC,EAAA,IAAoBH,EAAK;AAStD,SACE,gBAAAR,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,qBAAAF;AAAA,QACA,iBAAAC;AAAA,QACA,YAbW,MAAM;AACvB,UAAAL,EAAQO,EAAgB,qBAAqB;AAAA,QAC/C;AAAA,QAYQ,gBAXe,MAAM;AAC3B,UAAAP,EAAQO,EAAgB,yBAAyB;AAAA,QACnD;AAAA,MASQ;AAAA,MAGF,UAAA,gBAAAb,EAACc,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAT,KAGC,gBAAAU,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAhB,EAACiB,GAAA,EAAU;AAAA,0BACVC,GAAA,CAAA,CAAoB;AAAA,MAAA,EAAA,CACvB,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"OnboardingOverview.js","sources":["../../../../src/components/Company/OnboardingOverview/OnboardingOverview.tsx"],"sourcesContent":["import { useCompaniesGetOnboardingStatusSuspense } from '@gusto/embedded-api/react-query/companiesGetOnboardingStatus'\nimport { OnboardingOverviewProvider } from './context'\nimport { MissingRequirements } from './MissingRequirements'\nimport { Completed } from './Completed'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { Flex } from '@/components/Common'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface OnboardingOverviewProps extends CommonComponentInterface<'Company.OnboardingOverview'> {\n companyId: string\n}\n\nexport function OnboardingOverview(props: OnboardingOverviewProps & BaseComponentInterface) {\n useI18n('Company.OnboardingOverview')\n useComponentDictionary('Company.OnboardingOverview', props.dictionary)\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, className, children }: OnboardingOverviewProps) => {\n const { onEvent } = useBase()\n\n const { data } = useCompaniesGetOnboardingStatusSuspense({ companyUuid: companyId })\n const { onboardingCompleted, onboardingSteps } = data.companyOnboardingStatus!\n\n const handleDone = () => {\n onEvent(componentEvents.COMPANY_OVERVIEW_DONE)\n }\n const handleContinue = () => {\n onEvent(componentEvents.COMPANY_OVERVIEW_CONTINUE)\n }\n\n return (\n <section className={className}>\n <OnboardingOverviewProvider\n value={{\n onboardingCompleted,\n onboardingSteps,\n handleDone,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Completed />\n <MissingRequirements />\n </>\n )}\n </Flex>\n </OnboardingOverviewProvider>\n </section>\n )\n}\n"],"names":["OnboardingOverview","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","companyId","className","children","onEvent","useBase","data","useCompaniesGetOnboardingStatusSuspense","onboardingCompleted","onboardingSteps","OnboardingOverviewProvider","componentEvents","Flex","jsxs","Fragment","Completed","MissingRequirements"],"mappings":";;;;;;;;;;;AAmBO,SAASA,EAAmBC,GAAyD;AAC1F,SAAAC,EAAQ,4BAA4B,GACpCC,EAAuB,8BAA8BF,EAAM,UAAU,GAEnE,gBAAAG,EAACC,GAAA,EAAe,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,KAAM,GAAGL,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMK,IAAO,CAAC,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,QAAwC;AAC5E,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,EAAE,MAAAC,EAAA,IAASC,EAAwC,EAAE,aAAaN,GAAW,GAC7E,EAAE,qBAAAO,GAAqB,iBAAAC,EAAA,IAAoBH,EAAK;AAStD,SACE,gBAAAR,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,qBAAAF;AAAA,QACA,iBAAAC;AAAA,QACA,YAbW,MAAM;AACvB,UAAAL,EAAQO,EAAgB,qBAAqB;AAAA,QAC/C;AAAA,QAYQ,gBAXe,MAAM;AAC3B,UAAAP,EAAQO,EAAgB,yBAAyB;AAAA,QACnD;AAAA,MASQ;AAAA,MAGF,UAAA,gBAAAb,EAACc,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAT,KAGC,gBAAAU,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAhB,EAACiB,GAAA,EAAU;AAAA,0BACVC,GAAA,CAAA,CAAoB;AAAA,MAAA,EAAA,CACvB,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -2,19 +2,15 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "react-error-boundary";
4
4
  import "react-i18next";
5
- import "@gusto/embedded-api/models/errors/apierror";
6
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
- import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
- import "@tanstack/react-query";
9
5
  import "../../Base/useBase.js";
10
6
  import "../../../shared/constants.js";
7
+ import "classnames";
11
8
  import "dompurify";
12
9
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
13
- import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
10
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
15
- const [x, C] = o("OnboardingOverviewContext");
11
+ const [a, b] = o("OnboardingOverviewContext");
16
12
  export {
17
- C as OnboardingOverviewProvider,
18
- x as useOnboardingOverview
13
+ b as OnboardingOverviewProvider,
14
+ a as useOnboardingOverview
19
15
  };
20
16
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAuBC,CAA0B,IACtDC,EAAqD,2BAA2B;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":";;;;;;;;;;AAUA,MAAM,CAACA,GAAuBC,CAA0B,IACtDC,EAAqD,2BAA2B;"}
@@ -1,24 +1,25 @@
1
1
  import { jsx as t, jsxs as I } from "react/jsx-runtime";
2
2
  import { useForm as j, FormProvider as k } from "react-hook-form";
3
- import { zodResolver as G } from "@hookform/resolvers/zod";
3
+ import { zodResolver as G } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@hookform/resolvers/zod/dist/zod.mjs";
4
4
  import { useState as A, useEffect as _ } from "react";
5
- import { usePaySchedulesGetPreview as z } from "@gusto/embedded-api/react-query/paySchedulesGetPreview";
6
- import { usePaySchedulesUpdateMutation as J } from "@gusto/embedded-api/react-query/paySchedulesUpdate";
7
- import { usePaySchedulesGetAllSuspense as K } from "@gusto/embedded-api/react-query/paySchedulesGetAll";
8
- import { usePaySchedulesCreateMutation as Q } from "@gusto/embedded-api/react-query/paySchedulesCreate";
5
+ import { usePaySchedulesGetPreview as z } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/react-query/paySchedulesGetPreview.js";
6
+ import { usePaySchedulesUpdateMutation as J } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/react-query/paySchedulesUpdate.js";
7
+ import { usePaySchedulesGetAllSuspense as K } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/react-query/paySchedulesGetAll.js";
8
+ import { usePaySchedulesCreateMutation as Q } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/react-query/paySchedulesCreate.js";
9
9
  import { PayScheduleSchema as W, PayScheduleProvider as X } from "./usePaySchedule.js";
10
10
  import { Form as Z } from "../../Common/Form/Form.js";
11
11
  import { BaseComponent as $ } from "../../Base/Base.js";
12
12
  import { useBase as V } from "../../Base/useBase.js";
13
13
  import { Flex as ee } from "../../Common/Flex/Flex.js";
14
- import { useI18n as oe, useComponentDictionary as re } from "../../../i18n/I18n.js";
14
+ import "classnames";
15
15
  import { componentEvents as S } from "../../../shared/constants.js";
16
+ import { useI18n as oe, useComponentDictionary as re } from "../../../i18n/I18n.js";
16
17
  import { formatDateToStringDate as l } from "../../../helpers/dateFormatting.js";
17
18
  import { Head as ae } from "./_parts/Head.js";
18
19
  import { List as te } from "./_parts/List.js";
19
20
  import { Edit as ne } from "./_parts/Edit.js";
20
21
  import { Actions as ce } from "./_parts/Actions.js";
21
- const Te = ({
22
+ const Oe = ({
22
23
  companyId: n,
23
24
  defaultValues: s,
24
25
  dictionary: a,
@@ -140,6 +141,6 @@ const Te = ({
140
141
  );
141
142
  };
142
143
  export {
143
- Te as PaySchedule
144
+ Oe as PaySchedule
144
145
  };
145
146
  //# sourceMappingURL=PaySchedule.js.map
@@ -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,EAAa,iBAAiB,WAAW,IAAI,qBAAqB;AAAA,EAAA,GAE9D,CAACK,GAAoBC,CAAqB,IAAIF,EAAiC,IAAI,GACnFG,IAA8C;AAAA,IAClD,WAAWrB,GAAe,aAAa;AAAA,IACvC,eAAeA,GAAe,gBAAgB,IAAI,KAAKA,EAAc,aAAa,IAAI;AAAA,IACtF,sBAAsBA,GAAe,uBACjC,IAAI,KAAKA,EAAc,oBAAoB,IAC3C;AAAA,IACJ,MAAMA,GAAe,QAAQ;AAAA,IAC7B,MAAMA,GAAe,QAAQ;AAAA,IAC7B,YAAYA,GAAe,cAAc;AAAA,IACzC,qBAAqB;AAAA,EAAA,GAGjBsB,IAA4BC,EAAA,GAC5BC,IAA4BC,EAAA,GAE5BC,IAAcC,EAAwD;AAAA,IAC1E,UAAUC,EAAYC,CAAiB;AAAA,IACvC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WAAApB;AAAA,YACA,aAAa;AAAA,cACX,WAAWqD,EAAQ;AAAA,cACnB,eAAeC,EAAkBD,EAAQ,aAAa;AAAA,cACtD,sBAAsBC,EAAkBD,EAAQ,oBAAoB;AAAA,cACpE,YAAYA,EAAQ;AAAA,cACpB,MAAMA,EAAQ;AAAA,cACd,MAAMA,EAAQ;AAAA,cACd,SAAAI;AAAA,YAAA;AAAA,UACF;AAAA,QACF,CACD;AACD,QAAA9C,EAAQuC,EAAgB,sBAAsBQ,CAAyB,GACvEzB,EAAA;AAAA,MACF;AACA,MAAAf,EAAQ,oBAAoB;AAAA,IAC9B,CAAC;AAAA,EACH;AAEA,SACE,gBAAAZ;AAAA,IAACqD;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAA3D;AAAA,QACA,WAAA6C;AAAA,QACA,YAAAE;AAAA,QACA,cAAAD;AAAA,QACA,gBAAAG;AAAA,QACA,MAAAhC;AAAA,QACA,cAAcF,EAAa;AAAA,QAC3B,kBAAkB2B,GAAgB,QAAQ;AAAA,QAC1C,mBAAmBC;AAAA,QACnB,oBAAAvB;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAd,EAAC,UAAK,eAAY,0BAChB,4BAACsD,GAAA,EAAc,GAAGjC,GAChB,UAAA,gBAAArB,EAACuD,GAAA,EAAK,UAAUlC,EAAY,aAAawB,CAAQ,GAC9C,UAAA1C,KAGC,gBAAAqD,EAACC,IAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAzD,EAAC0D,IAAA,EAAK;AAAA,0BACLC,IAAA,EAAK;AAAA,0BACLC,IAAA,EAAK;AAAA,0BACLC,IAAA,CAAA,CAAQ;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"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,EAAa,iBAAiB,WAAW,IAAI,qBAAqB;AAAA,EAAA,GAE9D,CAACK,GAAoBC,CAAqB,IAAIF,EAAiC,IAAI,GACnFG,IAA8C;AAAA,IAClD,WAAWrB,GAAe,aAAa;AAAA,IACvC,eAAeA,GAAe,gBAAgB,IAAI,KAAKA,EAAc,aAAa,IAAI;AAAA,IACtF,sBAAsBA,GAAe,uBACjC,IAAI,KAAKA,EAAc,oBAAoB,IAC3C;AAAA,IACJ,MAAMA,GAAe,QAAQ;AAAA,IAC7B,MAAMA,GAAe,QAAQ;AAAA,IAC7B,YAAYA,GAAe,cAAc;AAAA,IACzC,qBAAqB;AAAA,EAAA,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
@@ -1,18 +1,20 @@
1
1
  import { jsxs as e, Fragment as d, jsx as o } from "react/jsx-runtime";
2
2
  import { useTranslation as l } from "react-i18next";
3
3
  import { usePaySchedule as m } from "../usePaySchedule.js";
4
- import { ActionsLayout as a } from "../../../Common/ActionsLayout/ActionsLayout.js";
4
+ import "classnames";
5
+ import "../../../../shared/constants.js";
6
+ import { ActionsLayout as r } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
7
  import { useComponentContext as u } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- const S = () => {
7
- const { t: n } = l("Company.PaySchedule"), { mode: c, handleAdd: r, handleCancel: i, handleContinue: s } = m(), t = u();
8
+ const v = () => {
9
+ const { t: n } = l("Company.PaySchedule"), { mode: i, handleAdd: a, handleCancel: c, handleContinue: s } = m(), t = u();
8
10
  return /* @__PURE__ */ e(d, { children: [
9
- c === "LIST_PAY_SCHEDULES" && /* @__PURE__ */ e(a, { children: [
11
+ i === "LIST_PAY_SCHEDULES" && /* @__PURE__ */ e(r, { children: [
10
12
  /* @__PURE__ */ o(
11
13
  t.Button,
12
14
  {
13
15
  variant: "secondary",
14
16
  onClick: () => {
15
- r();
17
+ a();
16
18
  },
17
19
  children: n("addAnotherPayScheduleCta")
18
20
  }
@@ -28,26 +30,26 @@ const S = () => {
28
30
  }
29
31
  )
30
32
  ] }),
31
- c === "ADD_PAY_SCHEDULE" && /* @__PURE__ */ e(a, { children: [
33
+ i === "ADD_PAY_SCHEDULE" && /* @__PURE__ */ e(r, { children: [
32
34
  /* @__PURE__ */ o(
33
35
  t.Button,
34
36
  {
35
37
  variant: "secondary",
36
38
  onClick: () => {
37
- i();
39
+ c();
38
40
  },
39
41
  children: n("actions.cancel")
40
42
  }
41
43
  ),
42
44
  /* @__PURE__ */ o(t.Button, { type: "submit", children: n("actions.save") })
43
45
  ] }),
44
- c === "EDIT_PAY_SCHEDULE" && /* @__PURE__ */ e(a, { children: [
46
+ i === "EDIT_PAY_SCHEDULE" && /* @__PURE__ */ e(r, { children: [
45
47
  /* @__PURE__ */ o(
46
48
  t.Button,
47
49
  {
48
50
  variant: "secondary",
49
51
  onClick: () => {
50
- i();
52
+ c();
51
53
  },
52
54
  children: n("actions.cancel")
53
55
  }
@@ -57,6 +59,6 @@ const S = () => {
57
59
  ] });
58
60
  };
59
61
  export {
60
- S as Actions
62
+ v as Actions
61
63
  };
62
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","handleContin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AAA,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,EA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A,CAAE;AAAA,IAAA,EAAA,CACtD;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -6,23 +6,23 @@ import { usePaySchedule as N } from "../usePaySchedule.js";
6
6
  import l from "./Edit.module.scss.js";
7
7
  import { Flex as h } from "../../../Common/Flex/Flex.js";
8
8
  import { Grid as x } from "../../../Common/Grid/Grid.js";
9
- import { useComponentContext as E } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
10
- import { useLocale as O } from "../../../../contexts/LocaleProvider/useLocale.js";
11
- import { formatDateNamedWeekdayShortPlusDate as f } from "../../../../helpers/dateFormatting.js";
12
- import { TextInputField as R } from "../../../Common/Fields/TextInputField/TextInputField.js";
13
- import { SelectField as F } from "../../../Common/Fields/SelectField/SelectField.js";
14
- import { RadioGroupField as M } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
9
+ import { RadioGroupField as E } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
10
+ import { TextInputField as O } from "../../../Common/Fields/TextInputField/TextInputField.js";
11
+ import { DatePickerField as f } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
15
12
  import { NumberInputField as P } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
16
- import { DatePickerField as D } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
13
+ import { useComponentContext as R } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
+ import { useLocale as F } from "../../../../contexts/LocaleProvider/useLocale.js";
15
+ import { formatDateNamedWeekdayShortPlusDate as D } from "../../../../helpers/dateFormatting.js";
16
+ import { SelectField as M } from "../../../Common/Fields/SelectField/SelectField.js";
17
17
  const K = () => {
18
- const o = E(), { t: e } = S("Company.PaySchedule"), { locale: u } = O(), { 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";
18
+ const o = R(), { t: e } = S("Company.PaySchedule"), { locale: u } = F(), { payPeriodPreview: r, mode: p, payPreviewLoading: v } = N(), { setValue: d } = C(), [a, b] = g(0), i = y({ name: "frequency" }), n = y({ name: "customTwicePerMonth" }), w = i === "Twice per month" && n === "custom" || i === "Monthly", q = i === "Twice per month" && n === "custom";
19
19
  return T(() => {
20
20
  i === "Twice per month" && n === "1st15th" && (d("day1", 15), d("day2", 31));
21
21
  }, [i, n, d]), p !== "EDIT_PAY_SCHEDULE" && p !== "ADD_PAY_SCHEDULE" ? null : /* @__PURE__ */ t("div", { className: l.payScheduleContainer, children: /* @__PURE__ */ m(x, { gap: 32, gridTemplateColumns: { base: "1fr", small: "1fr 1fr" }, children: [
22
22
  /* @__PURE__ */ t("div", { className: l.payScheduleForm, children: /* @__PURE__ */ m(h, { flexDirection: "column", children: [
23
- /* @__PURE__ */ t(R, { name: "customName", label: "Name", isRequired: !0 }),
23
+ /* @__PURE__ */ t(O, { name: "customName", label: "Name", isRequired: !0 }),
24
24
  /* @__PURE__ */ t(
25
- F,
25
+ M,
26
26
  {
27
27
  name: "frequency",
28
28
  label: e("labels.frequency"),
@@ -36,7 +36,7 @@ const K = () => {
36
36
  }
37
37
  ),
38
38
  i === "Twice per month" && /* @__PURE__ */ t(
39
- M,
39
+ E,
40
40
  {
41
41
  name: "customTwicePerMonth",
42
42
  label: e("labels.frequencyOptions"),
@@ -48,7 +48,7 @@ const K = () => {
48
48
  }
49
49
  ),
50
50
  /* @__PURE__ */ t(
51
- D,
51
+ f,
52
52
  {
53
53
  name: "anchorPayDate",
54
54
  label: e("labels.firstPayDate"),
@@ -57,7 +57,7 @@ const K = () => {
57
57
  }
58
58
  ),
59
59
  /* @__PURE__ */ t(
60
- D,
60
+ f,
61
61
  {
62
62
  name: "anchorEndOfPayPeriod",
63
63
  label: e("labels.firstPayPeriodEndDate"),
@@ -76,7 +76,7 @@ const K = () => {
76
76
  isRequired: !0,
77
77
  options: r.map((s, c) => ({
78
78
  value: String(c),
79
- label: `${f(s.startDate, u)} – ${f(s.endDate, u)}`
79
+ label: `${D(s.startDate, u)} – ${D(s.endDate, u)}`
80
80
  })),
81
81
  value: String(a),
82
82
  onChange: (s) => {
@@ -1,14 +1,16 @@
1
- import { jsx as e, jsxs as r, Fragment as o } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as s, Fragment as o } from "react/jsx-runtime";
2
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
+ import "classnames";
6
+ import "../../../../shared/constants.js";
5
7
  import { useComponentContext as l } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- const y = () => {
7
- const { t } = c("Company.PaySchedule"), n = l(), { mode: s } = d();
8
+ const S = () => {
9
+ const { t } = c("Company.PaySchedule"), n = l(), { mode: r } = d();
8
10
  let i = /* @__PURE__ */ e(o, {});
9
- switch (s) {
11
+ switch (r) {
10
12
  case "LIST_PAY_SCHEDULES":
11
- i = /* @__PURE__ */ r(o, { children: [
13
+ i = /* @__PURE__ */ s(o, { children: [
12
14
  /* @__PURE__ */ e(n.Heading, { as: "h2", children: t("headings.pageTitle") }),
13
15
  /* @__PURE__ */ e(n.Text, { children: /* @__PURE__ */ e(
14
16
  a,
@@ -42,6 +44,6 @@ const y = () => {
42
44
  return /* @__PURE__ */ e(h, { justifyContent: "space-between", flexDirection: "column", gap: 4, children: /* @__PURE__ */ e("header", { children: i }) });
43
45
  };
44
46
  export {
45
- y as Head
47
+ S as Head
46
48
  };
47
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;"}
@@ -1,36 +1,38 @@
1
- import { jsx as e, jsxs as p } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as u } from "react/jsx-runtime";
2
2
  import { useTranslation as h } from "react-i18next";
3
3
  import { usePaySchedule as y } from "../usePaySchedule.js";
4
4
  import o from "./List.module.scss.js";
5
5
  import { Flex as s } from "../../../Common/Flex/Flex.js";
6
+ import "classnames";
7
+ import "../../../../shared/constants.js";
6
8
  import f from "../../../../assets/icons/pencil.svg.js";
7
9
  import { useComponentContext as S } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
10
  import { HamburgerMenu as v } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
9
11
  import { VisuallyHidden as g } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
10
12
  import { useDataView as L } from "../../../Common/DataView/useDataView.js";
11
13
  import { DataView as C } from "../../../Common/DataView/DataView.js";
12
- const H = () => {
13
- const { t: n } = h("Company.PaySchedule"), r = S(), { paySchedules: c, mode: m, handleEdit: l } = y(), { ...d } = L({
14
- data: c || [],
14
+ const F = () => {
15
+ const { t: r } = h("Company.PaySchedule"), n = S(), { paySchedules: m, mode: c, handleEdit: l } = y(), { ...d } = L({
16
+ data: m || [],
15
17
  columns: [
16
18
  {
17
- title: n("payScheduleList.name"),
19
+ title: r("payScheduleList.name"),
18
20
  key: "customName",
19
21
  render: (t) => {
20
22
  const a = !!t.name;
21
23
  let i = a ? t.name : t.customName;
22
24
  i && i.length > 1 ? i = i.charAt(0).toUpperCase() + i.slice(1) : i = t.customName;
23
- const u = t.customName;
24
- return /* @__PURE__ */ e(s, { flexDirection: "column", gap: 0, children: /* @__PURE__ */ p("div", { className: o.content, children: [
25
+ const p = t.customName;
26
+ return /* @__PURE__ */ e(s, { flexDirection: "column", gap: 0, children: /* @__PURE__ */ u("div", { className: o.content, children: [
25
27
  /* @__PURE__ */ e("div", { children: i }),
26
- a && /* @__PURE__ */ e("div", { children: u })
28
+ a && /* @__PURE__ */ e("div", { children: p })
27
29
  ] }) });
28
30
  }
29
31
  },
30
32
  {
31
- title: /* @__PURE__ */ e(g, { children: n("payScheduleList.active") }),
33
+ title: /* @__PURE__ */ e(g, { children: r("payScheduleList.active") }),
32
34
  key: "active",
33
- render: (t) => /* @__PURE__ */ e(s, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ e("div", { className: o.content, children: t.active ? /* @__PURE__ */ e(r.Badge, { status: "success", children: n("payScheduleList.active") }) : /* @__PURE__ */ e(r.Badge, { status: "info", children: n("payScheduleList.inactive") }) }) })
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") }) }) })
34
36
  }
35
37
  ],
36
38
  itemMenu: (t) => /* @__PURE__ */ e(
@@ -39,7 +41,7 @@ const H = () => {
39
41
  triggerLabel: "Actions",
40
42
  items: [
41
43
  {
42
- label: n("payScheduleList.edit"),
44
+ label: r("payScheduleList.edit"),
43
45
  onClick: () => {
44
46
  l(t);
45
47
  },
@@ -49,9 +51,9 @@ const H = () => {
49
51
  }
50
52
  )
51
53
  });
52
- return m !== "LIST_PAY_SCHEDULES" ? null : /* @__PURE__ */ e(C, { label: "test", ...d });
54
+ return c !== "LIST_PAY_SCHEDULES" ? null : /* @__PURE__ */ e(C, { label: "test", ...d });
53
55
  };
54
56
  export {
55
- H as List
57
+ F as List
56
58
  };
57
59
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport styles from './List.module.scss'\nimport { useDataView, DataView, Flex, VisuallyHidden } from '@/components/Common'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n const { paySchedules, mode, handleEdit } = usePaySchedule()\n\n const { ...dataViewProps } = useDataView({\n data: paySchedules || [],\n columns: [\n {\n title: t('payScheduleList.name'),\n key: 'customName',\n render: schedule => {\n const hasName = !!schedule.name\n let displayName = hasName ? schedule.name : schedule.customName\n if (displayName && displayName.length > 1) {\n displayName = displayName.charAt(0).toUpperCase() + displayName.slice(1)\n } else {\n displayName = schedule.customName\n }\n const displayFrequency = schedule.customName\n return (\n <Flex flexDirection={'column'} gap={0}>\n <div className={styles.content}>\n <div>{displayName}</div>\n {hasName && <div>{displayFrequency}</div>}\n </div>\n </Flex>\n )\n },\n },\n {\n title: <VisuallyHidden>{t('payScheduleList.active')}</VisuallyHidden>,\n key: 'active',\n render: schedule => (\n <Flex alignItems={'center'} justifyContent={'center'}>\n <div className={styles.content}>\n {schedule.active ? (\n <Components.Badge status=\"success\">{t('payScheduleList.active')}</Components.Badge>\n ) : (\n <Components.Badge status=\"info\">{t('payScheduleList.inactive')}</Components.Badge>\n )}\n </div>\n </Flex>\n ),\n },\n ],\n itemMenu: schedule => {\n return (\n <HamburgerMenu\n triggerLabel=\"Actions\"\n items={[\n {\n label: t('payScheduleList.edit'),\n onClick: () => {\n handleEdit(schedule)\n },\n icon: <PencilSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST_PAY_SCHEDULES') {\n return null\n }\n\n return <DataView label=\"test\" {...dataViewProps} />\n}\n"],"names":["List","t","useTranslation","Components","useComponentContext","paySchedules","mode","handleEdit","usePaySchedule","dataViewProps","useDataView","schedule","hasName","displayName","displayFrequency","jsx","Flex","jsxs","styles","VisuallyHidden","HamburgerMenu","PencilSvg","DataView"],"mappings":";;;;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA,GACb,EAAE,cAAAC,GAAc,MAAAC,GAAM,YAAAC,EAAA,IAAeC,EAAA,GAErC,EAAE,GAAGC,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAML,KAAgB,CAAA;AAAA,IACtB,SAAS;AAAA,MACP;AAAA,QACE,OAAOJ,EAAE,sBAAsB;AAAA,QAC/B,KAAK;AAAA,QACL,QAAQ,CAAAU,MAAY;AAClB,gBAAMC,IAAU,CAAC,CAACD,EAAS;AAC3B,cAAIE,IAAcD,IAAUD,EAAS,OAAOA,EAAS;AACrD,UAAIE,KAAeA,EAAY,SAAS,IACtCA,IAAcA,EAAY,OAAO,CAAC,EAAE,gBAAgBA,EAAY,MAAM,CAAC,IAEvEA,IAAcF,EAAS;AAEzB,gBAAMG,IAAmBH,EAAS;AAClC,iBACE,gBAAAI,EAACC,GAAA,EAAK,eAAe,UAAU,KAAK,GAClC,UAAA,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAO,SACrB,UAAA;AAAA,YAAA,gBAAAH,EAAC,SAAK,UAAAF,EAAA,CAAY;AAAA,YACjBD,KAAW,gBAAAG,EAAC,OAAA,EAAK,UAAAD,EAAA,CAAiB;AAAA,UAAA,EAAA,CACrC,EAAA,CACF;AAAA,QAEJ;AAAA,MAAA;AAAA,MAEF;AAAA,QACE,OAAO,gBAAAC,EAACI,GAAA,EAAgB,UAAAlB,EAAE,wBAAwB,GAAE;AAAA,QACpD,KAAK;AAAA,QACL,QAAQ,CAAAU,MACN,gBAAAI,EAACC,GAAA,EAAK,YAAY,UAAU,gBAAgB,UAC1C,UAAA,gBAAAD,EAAC,SAAI,WAAWG,EAAO,SACpB,UAAAP,EAAS,SACR,gBAAAI,EAACZ,EAAW,OAAX,EAAiB,QAAO,WAAW,UAAAF,EAAE,wBAAwB,EAAA,CAAE,IAEhE,gBAAAc,EAACZ,EAAW,OAAX,EAAiB,QAAO,QAAQ,UAAAF,EAAE,0BAA0B,GAAE,GAEnE,EAAA,CACF;AAAA,MAAA;AAAA,IAEJ;AAAA,IAEF,UAAU,CAAAU,MAEN,gBAAAI;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,cAAa;AAAA,QACb,OAAO;AAAA,UACL;AAAA,YACE,OAAOnB,EAAE,sBAAsB;AAAA,YAC/B,SAAS,MAAM;AACb,cAAAM,EAAWI,CAAQ;AAAA,YACrB;AAAA,YACA,MAAM,gBAAAI,EAACM,GAAA,EAAU,eAAW,GAAA,CAAC;AAAA,UAAA;AAAA,QAC/B;AAAA,MACF;AAAA,IAAA;AAAA,EAGN,CACD;AAED,SAAIf,MAAS,uBACJ,OAGF,gBAAAS,EAACO,GAAA,EAAS,OAAM,QAAQ,GAAGb,GAAe;AACnD;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport styles from './List.module.scss'\nimport { useDataView, DataView, Flex, VisuallyHidden } from '@/components/Common'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n const { paySchedules, mode, handleEdit } = usePaySchedule()\n\n const { ...dataViewProps } = useDataView({\n data: paySchedules || [],\n columns: [\n {\n title: t('payScheduleList.name'),\n key: 'customName',\n render: schedule => {\n const hasName = !!schedule.name\n let displayName = hasName ? schedule.name : schedule.customName\n if (displayName && displayName.length > 1) {\n displayName = displayName.charAt(0).toUpperCase() + displayName.slice(1)\n } else {\n displayName = schedule.customName\n }\n const displayFrequency = schedule.customName\n return (\n <Flex flexDirection={'column'} gap={0}>\n <div className={styles.content}>\n <div>{displayName}</div>\n {hasName && <div>{displayFrequency}</div>}\n </div>\n </Flex>\n )\n },\n },\n {\n title: <VisuallyHidden>{t('payScheduleList.active')}</VisuallyHidden>,\n key: 'active',\n render: schedule => (\n <Flex alignItems={'center'} justifyContent={'center'}>\n <div className={styles.content}>\n {schedule.active ? (\n <Components.Badge status=\"success\">{t('payScheduleList.active')}</Components.Badge>\n ) : (\n <Components.Badge status=\"info\">{t('payScheduleList.inactive')}</Components.Badge>\n )}\n </div>\n </Flex>\n ),\n },\n ],\n itemMenu: schedule => {\n return (\n <HamburgerMenu\n triggerLabel=\"Actions\"\n items={[\n {\n label: t('payScheduleList.edit'),\n onClick: () => {\n handleEdit(schedule)\n },\n icon: <PencilSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST_PAY_SCHEDULES') {\n return null\n }\n\n return <DataView label=\"test\" {...dataViewProps} />\n}\n"],"names":["List","t","useTranslation","Components","useComponentContext","paySchedules","mode","handleEdit","usePaySchedule","dataViewProps","useDataView","schedule","hasName","displayName","displayFrequency","jsx","Flex","jsxs","styles","VisuallyHidden","HamburgerMenu","PencilSvg","DataView"],"mappings":";;;;;;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC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