@gusto/embedded-react-sdk 0.38.0-rc.1 → 0.38.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (485) hide show
  1. package/dist/UNSTABLE_Hooks.d.ts +1 -1
  2. package/dist/UNSTABLE_Hooks.js +64 -42
  3. package/dist/UNSTABLE_Hooks.js.map +1 -1
  4. package/dist/assets/icons/percent-circle.svg.js +10 -0
  5. package/dist/assets/icons/percent-circle.svg.js.map +1 -0
  6. package/dist/assets/icons/plus-circle.svg.js +1 -1
  7. package/dist/assets/icons/plus-circle.svg.js.map +1 -1
  8. package/dist/components/Common/DataView/DataCards/DataCards.d.ts +5 -3
  9. package/dist/components/Common/DataView/DataCards/DataCards.js +59 -46
  10. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  11. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +9 -7
  12. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
  13. package/dist/components/Common/DataView/DataTable/DataTable.d.ts +4 -3
  14. package/dist/components/Common/DataView/DataTable/DataTable.js +67 -57
  15. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  16. package/dist/components/Common/DataView/DataView.d.ts +4 -3
  17. package/dist/components/Common/DataView/DataView.js +24 -22
  18. package/dist/components/Common/DataView/DataView.js.map +1 -1
  19. package/dist/components/Common/DataView/useDataView.d.ts +33 -6
  20. package/dist/components/Common/DataView/useDataView.js +23 -20
  21. package/dist/components/Common/DataView/useDataView.js.map +1 -1
  22. package/dist/components/Common/DataView/useSelectionState.d.ts +5 -0
  23. package/dist/components/Common/DataView/useSelectionState.js +8 -0
  24. package/dist/components/Common/DataView/useSelectionState.js.map +1 -0
  25. package/dist/components/Common/DateRangeFilter/DateRangeFilter.d.ts +3 -1
  26. package/dist/components/Common/DateRangeFilter/DateRangeFilter.js +65 -71
  27. package/dist/components/Common/DateRangeFilter/DateRangeFilter.js.map +1 -1
  28. package/dist/components/Common/DateRangeFilter/DateRangeFilter.module.scss.js +10 -6
  29. package/dist/components/Common/DateRangeFilter/DateRangeFilter.module.scss.js.map +1 -1
  30. package/dist/components/Common/Fields/hooks/useStringifyGenericFieldValue.d.ts +2 -2
  31. package/dist/components/Common/Fields/hooks/useStringifyGenericFieldValue.js +2 -2
  32. package/dist/components/Common/Fields/hooks/useStringifyGenericFieldValue.js.map +1 -1
  33. package/dist/components/Common/SignatureForm/SignatureFormActions.js +8 -7
  34. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  35. package/dist/components/Common/SignatureForm/SignatureFormFields.js +5 -4
  36. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  37. package/dist/components/Common/UI/Box/Box.d.ts +1 -1
  38. package/dist/components/Common/UI/Box/Box.js +9 -8
  39. package/dist/components/Common/UI/Box/Box.js.map +1 -1
  40. package/dist/components/Common/UI/Box/Box.module.scss.js +12 -8
  41. package/dist/components/Common/UI/Box/Box.module.scss.js.map +1 -1
  42. package/dist/components/Common/UI/Box/BoxTypes.d.ts +2 -9
  43. package/dist/components/Common/UI/BoxHeader/BoxHeader.d.ts +2 -0
  44. package/dist/components/Common/UI/BoxHeader/BoxHeader.js +23 -0
  45. package/dist/components/Common/UI/BoxHeader/BoxHeader.js.map +1 -0
  46. package/dist/components/Common/UI/BoxHeader/BoxHeader.module.scss.js +8 -0
  47. package/dist/components/Common/UI/BoxHeader/BoxHeader.module.scss.js.map +1 -0
  48. package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.d.ts +10 -0
  49. package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.js +7 -0
  50. package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.js.map +1 -0
  51. package/dist/components/Common/UI/BoxHeader/index.d.ts +2 -0
  52. package/dist/components/Common/UI/Button/Button.module.scss.js +2 -2
  53. package/dist/components/Common/UI/Checkbox/Checkbox.js +60 -49
  54. package/dist/components/Common/UI/Checkbox/Checkbox.js.map +1 -1
  55. package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js +10 -6
  56. package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js.map +1 -1
  57. package/dist/components/Common/UI/ComboBox/ComboBox.js +1 -1
  58. package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
  59. package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +1 -1
  60. package/dist/components/Common/UI/DateRangePicker/DateRangePicker.js +34 -36
  61. package/dist/components/Common/UI/DateRangePicker/DateRangePicker.js.map +1 -1
  62. package/dist/components/Common/UI/DateRangePicker/DateRangePicker.module.scss.js +12 -12
  63. package/dist/components/Common/UI/DescriptionList/DescriptionList.js +19 -12
  64. package/dist/components/Common/UI/DescriptionList/DescriptionList.js.map +1 -1
  65. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +6 -4
  66. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js.map +1 -1
  67. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +6 -1
  68. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js +4 -1
  69. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -1
  70. package/dist/components/Common/UI/Heading/Heading.module.scss.js +15 -15
  71. package/dist/components/Common/UI/Input/Input.js.map +1 -1
  72. package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +1 -1
  73. package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
  74. package/dist/components/Common/UI/Select/Select.js +22 -22
  75. package/dist/components/Common/UI/Select/Select.js.map +1 -1
  76. package/dist/components/Common/UI/Select/SelectTypes.d.ts +1 -1
  77. package/dist/components/Common/UI/Table/Table.js +12 -12
  78. package/dist/components/Common/UI/Table/Table.js.map +1 -1
  79. package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
  80. package/dist/components/Common/UI/Table/TableTypes.d.ts +3 -3
  81. package/dist/components/Common/UI/Table/TableTypes.js +3 -3
  82. package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
  83. package/dist/components/Common/UI/TextArea/TextArea.js +1 -1
  84. package/dist/components/Common/UI/TextArea/TextArea.js.map +1 -1
  85. package/dist/components/Common/UI/TextInput/TextInput.js +13 -13
  86. package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
  87. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +7 -6
  88. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  89. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +9 -8
  90. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  91. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
  92. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  93. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +7 -6
  94. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  95. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
  96. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  97. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
  98. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  99. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
  100. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
  101. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  102. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +7 -6
  103. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  104. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
  105. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  106. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +6 -5
  107. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  108. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  109. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  110. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  111. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  112. package/dist/components/Company/FederalTaxes/Actions.js +7 -6
  113. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  114. package/dist/components/Company/FederalTaxes/FederalTaxes.js +13 -13
  115. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  116. package/dist/components/Company/FederalTaxes/Form.js +1 -1
  117. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  118. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +7 -6
  119. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  120. package/dist/components/Company/Industry/Actions.js +6 -5
  121. package/dist/components/Company/Industry/Actions.js.map +1 -1
  122. package/dist/components/Company/Industry/Context.js +7 -6
  123. package/dist/components/Company/Industry/Context.js.map +1 -1
  124. package/dist/components/Company/Industry/Edit.js +11 -10
  125. package/dist/components/Company/Industry/Edit.js.map +1 -1
  126. package/dist/components/Company/Locations/LocationForm/Actions.js +3 -2
  127. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  128. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
  129. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  130. package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
  131. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  132. package/dist/components/Company/Locations/LocationsList/List.js +7 -6
  133. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  134. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
  135. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  136. package/dist/components/Company/OnboardingOverview/context.js +4 -3
  137. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  138. package/dist/components/Company/PaySchedule/PaySchedule.js +88 -85
  139. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  140. package/dist/components/Company/PaySchedule/_parts/Actions.js +3 -2
  141. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  142. package/dist/components/Company/PaySchedule/_parts/Edit.js +21 -16
  143. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  144. package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +4 -5
  145. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
  146. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  147. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +6 -5
  148. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  149. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +33 -33
  150. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  151. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
  152. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  153. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +7 -6
  154. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  155. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +4 -3
  156. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  157. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +14 -14
  158. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  159. package/dist/components/Company/StateTaxes/StateTaxesList/context.d.ts +2 -2
  160. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
  161. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  162. package/dist/components/Contractor/Address/Form.js +4 -4
  163. package/dist/components/Contractor/Address/useAddress.js +6 -5
  164. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  165. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +3 -2
  166. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  167. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +65 -65
  168. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  169. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +80 -80
  170. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  171. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +10 -10
  172. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -1
  173. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +69 -79
  174. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  175. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +10 -12
  176. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js.map +1 -1
  177. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +45 -45
  178. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  179. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +63 -63
  180. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  181. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js +4 -4
  182. package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
  183. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  184. package/dist/components/Employee/Compensation/Actions.js +1 -1
  185. package/dist/components/Employee/Compensation/Compensation.js +79 -76
  186. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  187. package/dist/components/Employee/Compensation/List.js +6 -5
  188. package/dist/components/Employee/Compensation/List.js.map +1 -1
  189. package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +13 -0
  190. package/dist/components/Employee/Dashboard/BasicDetailsView.js +107 -0
  191. package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -0
  192. package/dist/components/Employee/Dashboard/Dashboard.d.ts +5 -0
  193. package/dist/components/Employee/Dashboard/Dashboard.js +146 -0
  194. package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -0
  195. package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +5 -0
  196. package/dist/components/Employee/Dashboard/DashboardComponents.js +12 -0
  197. package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -0
  198. package/dist/components/Employee/Dashboard/DashboardFlow.d.ts +5 -0
  199. package/dist/components/Employee/Dashboard/DashboardFlow.js +25 -0
  200. package/dist/components/Employee/Dashboard/DashboardFlow.js.map +1 -0
  201. package/dist/components/Employee/Dashboard/DocumentsView.d.ts +7 -0
  202. package/dist/components/Employee/Dashboard/DocumentsView.js +51 -0
  203. package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -0
  204. package/dist/components/Employee/Dashboard/JobAndPayView.d.ts +22 -0
  205. package/dist/components/Employee/Dashboard/JobAndPayView.js +211 -0
  206. package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -0
  207. package/dist/components/Employee/Dashboard/TaxesView.d.ts +13 -0
  208. package/dist/components/Employee/Dashboard/TaxesView.js +97 -0
  209. package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -0
  210. package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +3 -0
  211. package/dist/components/Employee/Dashboard/dashboardStateMachine.js +8 -0
  212. package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -0
  213. package/dist/components/Employee/Dashboard/hooks/index.d.ts +9 -0
  214. package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.d.ts +20 -0
  215. package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +29 -0
  216. package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -0
  217. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +30 -0
  218. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +52 -0
  219. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -0
  220. package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.d.ts +16 -0
  221. package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +22 -0
  222. package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -0
  223. package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.d.ts +20 -0
  224. package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js +24 -0
  225. package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js.map +1 -0
  226. package/dist/components/Employee/Dashboard/index.d.ts +14 -0
  227. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +3 -2
  228. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  229. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +3 -2
  230. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  231. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +3 -2
  232. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  233. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +5 -4
  234. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  235. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  236. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  237. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js +22 -22
  238. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
  239. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +8 -8
  240. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  241. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  242. package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +2 -3
  243. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  244. package/dist/components/Employee/FederalTaxes/Actions.js +3 -2
  245. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  246. package/dist/components/Employee/FederalTaxes/FederalForm.js +5 -4
  247. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  248. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
  249. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  250. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  251. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  252. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +4 -4
  253. package/dist/components/Employee/PaymentMethod/Split.js +1 -1
  254. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
  255. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  256. package/dist/components/Employee/Profile/Actions.js +7 -6
  257. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  258. package/dist/components/Employee/Profile/AdminPersonalDetails.js +5 -4
  259. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  260. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +9 -8
  261. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  262. package/dist/components/Employee/Profile/useProfile.js +4 -3
  263. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  264. package/dist/components/Employee/StateTaxes/Actions.js +7 -6
  265. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  266. package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
  267. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  268. package/dist/components/Employee/Taxes/Actions.js +8 -7
  269. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  270. package/dist/components/Employee/Taxes/FederalForm.js +5 -4
  271. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  272. package/dist/components/Employee/Taxes/useTaxes.js +4 -3
  273. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  274. package/dist/components/Employee/index.d.ts +2 -0
  275. package/dist/components/Employee/index.js +28 -26
  276. package/dist/components/Employee/index.js.map +1 -1
  277. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +3 -2
  278. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  279. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +11 -10
  280. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
  281. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +1 -0
  282. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
  283. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +3 -2
  284. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
  285. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +1 -1
  286. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  287. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +2 -2
  288. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +16 -16
  289. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  290. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +1 -1
  291. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  292. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +78 -77
  293. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  294. package/dist/components/Payroll/PayrollList/PayrollList.js +1 -1
  295. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  296. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -2
  297. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +72 -70
  298. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  299. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +7 -9
  300. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
  301. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +18 -18
  302. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  303. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +105 -115
  304. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  305. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +16 -18
  306. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js.map +1 -1
  307. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +7 -7
  308. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
  309. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +13 -13
  310. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
  311. package/dist/components/Payroll/helpers.d.ts +1 -1
  312. package/dist/components/Payroll/helpers.js.map +1 -1
  313. package/dist/components/Payroll/usePreparedPayrollData.d.ts +2 -2
  314. package/dist/components/Payroll/usePreparedPayrollData.js +8 -7
  315. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  316. package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +9 -8
  317. package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +1 -1
  318. package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +12 -11
  319. package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +1 -1
  320. package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js +3 -2
  321. package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +1 -1
  322. package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js +8 -7
  323. package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +1 -1
  324. package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +9 -8
  325. package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +1 -1
  326. package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +13 -12
  327. package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +1 -1
  328. package/dist/components/UNSTABLE_Hooks/form/index.d.ts +0 -3
  329. package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js +8 -7
  330. package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js.map +1 -1
  331. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +7 -7
  332. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -1
  333. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +4 -4
  334. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js +1 -1
  335. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +20 -20
  336. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -1
  337. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +1 -1
  338. package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.d.ts +5 -0
  339. package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.js +172 -0
  340. package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.js.map +1 -0
  341. package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.module.scss.js +14 -0
  342. package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.module.scss.js.map +1 -0
  343. package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/fields.d.ts +23 -0
  344. package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/fields.js +37 -0
  345. package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/fields.js.map +1 -0
  346. package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/index.d.ts +7 -0
  347. package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/payScheduleSchema.d.ts +55 -0
  348. package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/payScheduleSchema.js +54 -0
  349. package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/payScheduleSchema.js.map +1 -0
  350. package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/usePayScheduleForm.d.ts +69 -0
  351. package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/usePayScheduleForm.js +180 -0
  352. package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/usePayScheduleForm.js.map +1 -0
  353. package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/SignCompanyForm.d.ts +5 -0
  354. package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/SignCompanyForm.js +69 -0
  355. package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/SignCompanyForm.js.map +1 -0
  356. package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/fields.d.ts +9 -0
  357. package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/fields.js +14 -0
  358. package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/fields.js.map +1 -0
  359. package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/index.d.ts +7 -0
  360. package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/signCompanyFormSchema.d.ts +25 -0
  361. package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/signCompanyFormSchema.js +24 -0
  362. package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/signCompanyFormSchema.js.map +1 -0
  363. package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/useSignCompanyForm.d.ts +57 -0
  364. package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/useSignCompanyForm.js +101 -0
  365. package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/useSignCompanyForm.js.map +1 -0
  366. package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeForm.d.ts +5 -0
  367. package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeForm.js +71 -0
  368. package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeForm.js.map +1 -0
  369. package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeI9Form.d.ts +5 -0
  370. package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeI9Form.js +179 -0
  371. package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeI9Form.js.map +1 -0
  372. package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/fields.d.ts +53 -0
  373. package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/fields.js +164 -0
  374. package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/fields.js.map +1 -0
  375. package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/index.d.ts +9 -0
  376. package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/signEmployeeFormSchema.d.ts +150 -0
  377. package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/signEmployeeFormSchema.js +152 -0
  378. package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -0
  379. package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/useSignEmployeeForm.d.ts +151 -0
  380. package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/useSignEmployeeForm.js +172 -0
  381. package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -0
  382. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +1 -1
  383. package/dist/components/UNSTABLE_Hooks/index.d.ts +4 -1
  384. package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +40 -79
  385. package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
  386. package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.d.ts +2 -0
  387. package/dist/components/UNSTABLE_TimeOff/{TimeOffManagement/SelectHolidays/SelectHolidaysPresentation.js → HolidaySelectionForm/HolidaySelectionFormPresentation.js} +19 -19
  388. package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -0
  389. package/dist/components/UNSTABLE_TimeOff/{TimeOffManagement/SelectHolidays/SelectHolidaysTypes.d.ts → HolidaySelectionForm/HolidaySelectionFormTypes.d.ts} +4 -4
  390. package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.d.ts +3 -1
  391. package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.js +29 -0
  392. package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +1 -0
  393. package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.d.ts +2 -0
  394. package/dist/components/UNSTABLE_TimeOff/{TimeOffManagement/SelectPolicyType/SelectPolicyTypePresentation.js → PolicyTypeSelector/PolicyTypeSelectorPresentation.js} +8 -8
  395. package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -0
  396. package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorTypes.d.ts +6 -0
  397. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js +8 -8
  398. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
  399. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.d.ts +8 -0
  400. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +71 -0
  401. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -0
  402. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.module.scss.js +12 -0
  403. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.module.scss.js.map +1 -0
  404. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +2 -0
  405. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +206 -0
  406. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -0
  407. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +20 -0
  408. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/index.d.ts +6 -0
  409. package/dist/components/UNSTABLE_TimeOff/index.d.ts +4 -4
  410. package/dist/components/UNSTABLE_TimeOff/index.js +10 -10
  411. package/dist/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +2 -0
  412. package/dist/components/UNSTABLE_TimeOff/{TimeOffManagement/shared → shared}/EmployeeTable/EmployeeTableTypes.d.ts +3 -3
  413. package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.d.ts +30 -0
  414. package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.js +97 -0
  415. package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.js.map +1 -0
  416. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +52 -50
  417. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  418. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  419. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +10 -0
  420. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +28 -21
  421. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
  422. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  423. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  424. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
  425. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  426. package/dist/contexts/ThemeProvider/theme.d.ts +2 -0
  427. package/dist/contexts/ThemeProvider/theme.js +4 -2
  428. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  429. package/dist/helpers/buildQueryErrorHandling.d.ts +22 -0
  430. package/dist/helpers/buildQueryErrorHandling.js +11 -0
  431. package/dist/helpers/buildQueryErrorHandling.js.map +1 -0
  432. package/dist/helpers/dateFormatting.d.ts +2 -0
  433. package/dist/helpers/dateFormatting.js +38 -33
  434. package/dist/helpers/dateFormatting.js.map +1 -1
  435. package/dist/helpers/formattedStrings.js +40 -33
  436. package/dist/helpers/formattedStrings.js.map +1 -1
  437. package/dist/i18n/I18n.js +9 -9
  438. package/dist/i18n/I18n.js.map +1 -1
  439. package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +9 -9
  440. package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js +18 -16
  441. package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js.map +1 -1
  442. package/dist/i18n/en/Employee.Dashboard.json.js +26 -0
  443. package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -0
  444. package/dist/i18n/en/Payroll.PayrollHistory.json.js +2 -2
  445. package/dist/i18n/en/Payroll.PayrollList.json.js +15 -15
  446. package/dist/i18n/en/UNSTABLE.PayScheduleForm.json.js +24 -0
  447. package/dist/i18n/en/UNSTABLE.PayScheduleForm.json.js.map +1 -0
  448. package/dist/i18n/en/UNSTABLE.SignCompanyForm.json.js +20 -0
  449. package/dist/i18n/en/UNSTABLE.SignCompanyForm.json.js.map +1 -0
  450. package/dist/i18n/en/UNSTABLE.SignEmployeeForm.json.js +22 -0
  451. package/dist/i18n/en/UNSTABLE.SignEmployeeForm.json.js.map +1 -0
  452. package/dist/i18n/en/UNSTABLE.SignEmployeeI9Form.json.js +70 -0
  453. package/dist/i18n/en/UNSTABLE.SignEmployeeI9Form.json.js.map +1 -0
  454. package/dist/i18n/en/common.json.d.ts +3 -1
  455. package/dist/i18n/en/common.json.js +5 -5
  456. package/dist/shared/constants.d.ts +10 -0
  457. package/dist/shared/constants.js +15 -10
  458. package/dist/shared/constants.js.map +1 -1
  459. package/dist/style.css +1 -1
  460. package/dist/types/i18next.d.ts +319 -10
  461. package/dist/types/sdkHooks.d.ts +1 -3
  462. package/docs/reference/endpoint-inventory.json +80 -2
  463. package/package.json +14 -14
  464. package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.d.ts +0 -26
  465. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +0 -3
  466. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js +0 -14
  467. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js.map +0 -1
  468. package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.d.ts +0 -6
  469. package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.d.ts +0 -6
  470. package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.js +0 -50
  471. package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.js.map +0 -1
  472. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectHolidays/SelectHolidaysPresentation.d.ts +0 -2
  473. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectHolidays/SelectHolidaysPresentation.js.map +0 -1
  474. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectHolidays/index.d.ts +0 -3
  475. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectPolicyType/SelectPolicyType.d.ts +0 -7
  476. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectPolicyType/SelectPolicyType.js +0 -27
  477. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectPolicyType/SelectPolicyType.js.map +0 -1
  478. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectPolicyType/SelectPolicyTypePresentation.d.ts +0 -2
  479. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectPolicyType/SelectPolicyTypePresentation.js.map +0 -1
  480. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectPolicyType/SelectPolicyTypeTypes.d.ts +0 -6
  481. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectPolicyType/index.d.ts +0 -5
  482. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/shared/EmployeeTable/EmployeeTable.d.ts +0 -2
  483. package/dist/helpers/requiredIf.d.ts +0 -13
  484. /package/dist/components/UNSTABLE_TimeOff/{TimeOffManagement/shared → shared}/EmployeeTable/index.d.ts +0 -0
  485. /package/dist/components/{UNSTABLE_Hooks/form/deriveFieldsMetadata.test.d.ts → UNSTABLE_TimeOff/shared/holidayHelpers.test.d.ts} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { jsx as t, jsxs as m } from "react/jsx-runtime";
2
- import { useFormContext as C, useWatch as p } from "react-hook-form";
3
- import { useTranslation as g } from "react-i18next";
4
- import { useState as S, useEffect as T } from "react";
2
+ import { useFormContext as S, useWatch as p } from "react-hook-form";
3
+ import { useTranslation as q } from "react-i18next";
4
+ import { useState as C, useEffect as T } from "react";
5
5
  import { usePaySchedule as x } from "../usePaySchedule.js";
6
6
  import n from "./Edit.module.scss.js";
7
7
  import { Flex as y } from "../../../Common/Flex/Flex.js";
@@ -14,10 +14,10 @@ import { RadioGroupField as M } from "../../../Common/Fields/RadioGroupField/Rad
14
14
  import { NumberInputField as h } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
15
15
  import { DatePickerField as f } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
16
16
  const K = () => {
17
- const l = N(), { t: e } = g("Company.PaySchedule"), P = F(), { payPeriodPreview: r, mode: u, payPreviewLoading: D, paymentSpeedDays: v } = x(), { setValue: d } = C(), [a, b] = S(0), i = p({ name: "frequency" }), o = p({ name: "customTwicePerMonth" }), w = i === "Twice per month" && o === "custom" || i === "Monthly", q = i === "Twice per month" && o === "custom";
17
+ const o = N(), { t: e } = q("Company.PaySchedule"), P = F(), { payPeriodPreview: r, mode: u, payPreviewLoading: D, paymentSpeedDays: v } = x(), { setValue: d } = S(), [a, b] = C(0), i = p({ name: "frequency" }), l = p({ name: "customTwicePerMonth" }), w = i === "Twice per month" && l === "custom" || i === "Monthly", g = i === "Twice per month" && l === "custom";
18
18
  return T(() => {
19
- i === "Twice per month" && o === "1st15th" && (d("day1", 15), d("day2", 31));
20
- }, [i, o, d]), u !== "EDIT_PAY_SCHEDULE" && u !== "ADD_PAY_SCHEDULE" ? null : /* @__PURE__ */ t("div", { className: n.payScheduleContainer, children: /* @__PURE__ */ m(E, { gap: 32, gridTemplateColumns: { base: "1fr", small: "1fr 1fr" }, children: [
19
+ i === "Twice per month" && l === "1st15th" && (d("day1", 15), d("day2", 31));
20
+ }, [i, l, d]), u !== "EDIT_PAY_SCHEDULE" && u !== "ADD_PAY_SCHEDULE" ? null : /* @__PURE__ */ t("div", { className: n.payScheduleContainer, children: /* @__PURE__ */ m(E, { gap: 32, gridTemplateColumns: { base: "1fr", small: "1fr 1fr" }, children: [
21
21
  /* @__PURE__ */ t("div", { className: n.payScheduleForm, children: /* @__PURE__ */ m(y, { flexDirection: "column", children: [
22
22
  /* @__PURE__ */ t(R, { name: "customName", label: e("labels.name"), isRequired: !0 }),
23
23
  /* @__PURE__ */ t(
@@ -68,17 +68,20 @@ const K = () => {
68
68
  }
69
69
  ),
70
70
  /* @__PURE__ */ t("div", { className: w ? "" : n.visuallyHidden, children: /* @__PURE__ */ t(h, { name: "day1", label: e("labels.firstPayDayOfTheMonth"), isRequired: !0 }) }),
71
- /* @__PURE__ */ t("div", { className: q ? "" : n.visuallyHidden, children: /* @__PURE__ */ t(h, { name: "day2", label: e("labels.lastPayDayOfTheMonth"), isRequired: !0 }) })
71
+ /* @__PURE__ */ t("div", { className: g ? "" : n.visuallyHidden, children: /* @__PURE__ */ t(h, { name: "day2", label: e("labels.lastPayDayOfTheMonth"), isRequired: !0 }) })
72
72
  ] }) }),
73
73
  /* @__PURE__ */ t(y, { flexDirection: "column", gap: 4, justifyContent: "center", alignItems: "center", children: r && r[a] ? /* @__PURE__ */ m("div", { className: n.calendarContainer, children: [
74
74
  !D && /* @__PURE__ */ t(
75
- l.Select,
75
+ o.Select,
76
76
  {
77
77
  label: e("labels.preview"),
78
78
  isRequired: !0,
79
79
  options: r.map((s, c) => ({
80
80
  value: String(c),
81
- label: P.formatPayPeriodRange(s.startDate, s.endDate)
81
+ label: P.formatPayPeriodRange(
82
+ s.startDate.toString(),
83
+ s.endDate.toString()
84
+ )
82
85
  })),
83
86
  value: String(a),
84
87
  onChange: (s) => {
@@ -88,21 +91,23 @@ const K = () => {
88
91
  }
89
92
  ),
90
93
  /* @__PURE__ */ t(
91
- l.CalendarPreview,
94
+ o.CalendarPreview,
92
95
  {
93
96
  dateRange: {
94
- start: new Date(r[a].startDate),
95
- end: new Date(r[a].endDate),
97
+ start: new Date(r[a].startDate.toString()),
98
+ end: new Date(r[a].endDate.toString()),
96
99
  label: e("payPreview.payPeriod") || "Pay Period"
97
100
  },
98
101
  highlightDates: [
99
102
  {
100
- date: new Date(r[a].checkDate),
103
+ date: new Date(r[a].checkDate.toString()),
101
104
  highlightColor: "primary",
102
105
  label: e("payPreview.payday") || "Payday"
103
106
  },
104
107
  {
105
- date: new Date(r[a].runPayrollBy),
108
+ date: new Date(
109
+ r[a].runPayrollBy.toString()
110
+ ),
106
111
  highlightColor: "secondary",
107
112
  label: e("payPreview.payrollDeadline") || "Payroll Deadline"
108
113
  }
@@ -111,11 +116,11 @@ const K = () => {
111
116
  a
112
117
  )
113
118
  ] }) : /* @__PURE__ */ t("div", { className: n.calendarContainer, children: /* @__PURE__ */ t(
114
- l.Alert,
119
+ o.Alert,
115
120
  {
116
121
  status: "info",
117
122
  label: e("previewAlert.title", "Pay Schedule Preview"),
118
- children: /* @__PURE__ */ t(l.Text, { children: e(
123
+ children: /* @__PURE__ */ t(o.Text, { children: e(
119
124
  "previewAlert.description",
120
125
  "Complete all the required fields on the left to see a preview of your pay schedule."
121
126
  ) })
@@ -1 +1 @@
1
- {"version":3,"file":"Edit.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Edit.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useEffect, useState } from 'react'\nimport type { PayScheduleInputs } from '../usePaySchedule'\nimport { usePaySchedule } from '../usePaySchedule'\nimport style from './Edit.module.scss'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n Grid,\n TextInputField,\n NumberInputField,\n DatePickerField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\nexport const Edit = () => {\n const Components = useComponentContext()\n const { t } = useTranslation('Company.PaySchedule')\n const dateFormatter = useDateFormatter()\n const { payPeriodPreview, mode, payPreviewLoading, paymentSpeedDays } = usePaySchedule()\n const { setValue } = useFormContext<PayScheduleInputs>()\n const [selectedPayPeriodIndex, setSelectedPayPeriodIndex] = useState(0)\n\n const frequency = useWatch({ name: 'frequency' })\n const customTwicePerMonth = useWatch({ name: 'customTwicePerMonth' })\n\n const shouldShowDay1 =\n (frequency === 'Twice per month' && customTwicePerMonth === 'custom') || frequency === 'Monthly'\n const shouldShowDay2 = frequency === 'Twice per month' && customTwicePerMonth === 'custom'\n\n useEffect(() => {\n if (frequency === 'Twice per month' && customTwicePerMonth === '1st15th') {\n setValue('day1', 15)\n setValue('day2', 31)\n }\n }, [frequency, customTwicePerMonth, setValue])\n\n if (mode !== 'EDIT_PAY_SCHEDULE' && mode !== 'ADD_PAY_SCHEDULE') {\n return null\n }\n\n return (\n <div className={style.payScheduleContainer}>\n <Grid gap={32} gridTemplateColumns={{ base: '1fr', small: '1fr 1fr' }}>\n <div className={style.payScheduleForm}>\n <Flex flexDirection={'column'}>\n <TextInputField name=\"customName\" label={t('labels.name')} isRequired />\n <SelectField\n name=\"frequency\"\n label={t('labels.frequency')}\n options={[\n { value: 'Every week', label: t('frequencies.everyWeek') },\n { value: 'Every other week', label: t('frequencies.everyOtherWeek') },\n { value: 'Twice per month', label: t('frequencies.twicePerMonth') },\n { value: 'Monthly', label: t('frequencies.monthly') },\n ]}\n isRequired\n />\n {frequency === 'Twice per month' && (\n <RadioGroupField\n name=\"customTwicePerMonth\"\n label={t('labels.frequencyOptions')}\n description={t('descriptions.frequencyOptionsDescription')}\n options={[\n { value: '1st15th', label: t('frequencyOptions.15thAndLast') },\n { value: 'custom', label: t('frequencyOptions.custom') },\n ]}\n />\n )}\n <DatePickerField\n name=\"anchorPayDate\"\n label={t('labels.firstPayDate')}\n description={t('descriptions.anchorPayDateDescription', {\n count: paymentSpeedDays,\n })}\n isRequired\n minDate={new Date()}\n />\n <DatePickerField\n name=\"anchorEndOfPayPeriod\"\n label={t('labels.firstPayPeriodEndDate')}\n description={t('descriptions.anchorEndOfPayPeriodDescription')}\n isRequired\n />\n <div className={shouldShowDay1 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day1\" label={t('labels.firstPayDayOfTheMonth')} isRequired />\n </div>\n <div className={shouldShowDay2 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day2\" label={t('labels.lastPayDayOfTheMonth')} isRequired />\n </div>\n </Flex>\n </div>\n <Flex flexDirection=\"column\" gap={4} justifyContent=\"center\" alignItems=\"center\">\n {payPeriodPreview && payPeriodPreview[selectedPayPeriodIndex] ? (\n <div className={style.calendarContainer}>\n {!payPreviewLoading && (\n <Components.Select\n label={t('labels.preview')}\n isRequired\n options={payPeriodPreview.map((period, index) => {\n return {\n value: String(index),\n label: dateFormatter.formatPayPeriodRange(period.startDate, period.endDate),\n }\n })}\n value={String(selectedPayPeriodIndex)}\n onChange={(value: string) => {\n const numericValue = Number(value)\n if (!isNaN(numericValue)) {\n setSelectedPayPeriodIndex(numericValue)\n }\n }}\n />\n )}\n <Components.CalendarPreview\n key={selectedPayPeriodIndex}\n dateRange={{\n start: new Date(payPeriodPreview[selectedPayPeriodIndex].startDate as string),\n end: new Date(payPeriodPreview[selectedPayPeriodIndex].endDate as string),\n label: t('payPreview.payPeriod') || 'Pay Period',\n }}\n highlightDates={[\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].checkDate as string),\n highlightColor: 'primary',\n label: t('payPreview.payday') || 'Payday',\n },\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].runPayrollBy as string),\n highlightColor: 'secondary',\n label: t('payPreview.payrollDeadline') || 'Payroll Deadline',\n },\n ]}\n />\n </div>\n ) : (\n <div className={style.calendarContainer}>\n <Components.Alert\n status=\"info\"\n label={t('previewAlert.title', 'Pay Schedule Preview')}\n >\n <Components.Text>\n {t(\n 'previewAlert.description',\n 'Complete all the required fields on the left to see a preview of your pay schedule.',\n )}\n </Components.Text>\n </Components.Alert>\n </div>\n )}\n </Flex>\n </Grid>\n </div>\n )\n}\n"],"names":["Edit","Components","useComponentContext","t","useTranslation","dateFormatter","useDateFormatter","payPeriodPreview","mode","payPreviewLoading","paymentSpeedDays","usePaySchedule","setValue","useFormContext","selectedPayPeriodIndex","setSelectedPayPeriodIndex","useState","frequency","useWatch","customTwicePerMonth","shouldShowDay1","shouldShowDay2","useEffect","jsx","style","jsxs","Grid","Flex","TextInputField","SelectField","RadioGroupField","DatePickerField","NumberInputField","period","index","value","numericValue"],"mappings":";;;;;;;;;;;;;;;AAkBO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAgBC,EAAA,GAChB,EAAE,kBAAAC,GAAkB,MAAAC,GAAM,mBAAAC,GAAmB,kBAAAC,EAAA,IAAqBC,EAAA,GAClE,EAAE,UAAAC,EAAA,IAAaC,EAAA,GACf,CAACC,GAAwBC,CAAyB,IAAIC,EAAS,CAAC,GAEhEC,IAAYC,EAAS,EAAE,MAAM,aAAa,GAC1CC,IAAsBD,EAAS,EAAE,MAAM,uBAAuB,GAE9DE,IACHH,MAAc,qBAAqBE,MAAwB,YAAaF,MAAc,WACnFI,IAAiBJ,MAAc,qBAAqBE,MAAwB;AASlF,SAPAG,EAAU,MAAM;AACd,IAAIL,MAAc,qBAAqBE,MAAwB,cAC7DP,EAAS,QAAQ,EAAE,GACnBA,EAAS,QAAQ,EAAE;AAAA,EAEvB,GAAG,CAACK,GAAWE,GAAqBP,CAAQ,CAAC,GAEzCJ,MAAS,uBAAuBA,MAAS,qBACpC,OAIP,gBAAAe,EAAC,OAAA,EAAI,WAAWC,EAAM,sBACpB,UAAA,gBAAAC,EAACC,GAAA,EAAK,KAAK,IAAI,qBAAqB,EAAE,MAAM,OAAO,OAAO,aACxD,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AAsB,EAAE,OAAiB;AAAA,YACxE,OAAOX,EAAE,sBAAsB,KAAK;AAAA,UAAA;AAAA,UAEtC,gBAAgB;AAAA,YACd;AAAA,cACE,MAAM,IAAI,KAAKI,EAAiBO,CAAsB,EAAE,SAAmB;AAAA,cAC3E,gBAAgB;AAAA,cAChB,OAAOX,EAAE,mBAAmB,KAAK;AAAA,YAAA;AAAA,YAEnC;AAAA,cACE,MAAM,IAAI,KAAKI,EAAiBO,CAAsB,EAAE,YAAsB;AAAA,cAC9E,gBAAgB;AAAA,cAChB,OAAOX,EAAE,4BAA4B,KAAK;AAAA,YAAA;AAAA,UAC5C;AAAA,QACF;AAAA,QAjBKW;AAAA,MAAA;AAAA,IAkBP,GACF,IAEA,gBAAAS,EAAC,OAAA,EAAI,WAAWC,EAAM,mBACpB,UAAA,gBAAAD;AAAA,MAACtB,EAAW;AAAA,MAAX;AAAA,QACC,QAAO;AAAA,QACP,OAAOE,EAAE,sBAAsB,sBAAsB;AAAA,QAErD,UAAA,gBAAAoB,EAACtB,EAAW,MAAX,EACE,UAAAE;AAAA,UACC;AAAA,UACA;AAAA,QAAA,EACF,CACF;AAAA,MAAA;AAAA,IAAA,GAEJ,EAAA,CAEJ;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"Edit.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Edit.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useEffect, useState } from 'react'\nimport type { PayScheduleInputs } from '../usePaySchedule'\nimport { usePaySchedule } from '../usePaySchedule'\nimport style from './Edit.module.scss'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n Grid,\n TextInputField,\n NumberInputField,\n DatePickerField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\nexport const Edit = () => {\n const Components = useComponentContext()\n const { t } = useTranslation('Company.PaySchedule')\n const dateFormatter = useDateFormatter()\n const { payPeriodPreview, mode, payPreviewLoading, paymentSpeedDays } = usePaySchedule()\n const { setValue } = useFormContext<PayScheduleInputs>()\n const [selectedPayPeriodIndex, setSelectedPayPeriodIndex] = useState(0)\n\n const frequency = useWatch({ name: 'frequency' })\n const customTwicePerMonth = useWatch({ name: 'customTwicePerMonth' })\n\n const shouldShowDay1 =\n (frequency === 'Twice per month' && customTwicePerMonth === 'custom') || frequency === 'Monthly'\n const shouldShowDay2 = frequency === 'Twice per month' && customTwicePerMonth === 'custom'\n\n useEffect(() => {\n if (frequency === 'Twice per month' && customTwicePerMonth === '1st15th') {\n setValue('day1', 15)\n setValue('day2', 31)\n }\n }, [frequency, customTwicePerMonth, setValue])\n\n if (mode !== 'EDIT_PAY_SCHEDULE' && mode !== 'ADD_PAY_SCHEDULE') {\n return null\n }\n\n return (\n <div className={style.payScheduleContainer}>\n <Grid gap={32} gridTemplateColumns={{ base: '1fr', small: '1fr 1fr' }}>\n <div className={style.payScheduleForm}>\n <Flex flexDirection={'column'}>\n <TextInputField name=\"customName\" label={t('labels.name')} isRequired />\n <SelectField\n name=\"frequency\"\n label={t('labels.frequency')}\n options={[\n { value: 'Every week', label: t('frequencies.everyWeek') },\n { value: 'Every other week', label: t('frequencies.everyOtherWeek') },\n { value: 'Twice per month', label: t('frequencies.twicePerMonth') },\n { value: 'Monthly', label: t('frequencies.monthly') },\n ]}\n isRequired\n />\n {frequency === 'Twice per month' && (\n <RadioGroupField\n name=\"customTwicePerMonth\"\n label={t('labels.frequencyOptions')}\n description={t('descriptions.frequencyOptionsDescription')}\n options={[\n { value: '1st15th', label: t('frequencyOptions.15thAndLast') },\n { value: 'custom', label: t('frequencyOptions.custom') },\n ]}\n />\n )}\n <DatePickerField\n name=\"anchorPayDate\"\n label={t('labels.firstPayDate')}\n description={t('descriptions.anchorPayDateDescription', {\n count: paymentSpeedDays,\n })}\n isRequired\n minDate={new Date()}\n />\n <DatePickerField\n name=\"anchorEndOfPayPeriod\"\n label={t('labels.firstPayPeriodEndDate')}\n description={t('descriptions.anchorEndOfPayPeriodDescription')}\n isRequired\n />\n <div className={shouldShowDay1 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day1\" label={t('labels.firstPayDayOfTheMonth')} isRequired />\n </div>\n <div className={shouldShowDay2 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day2\" label={t('labels.lastPayDayOfTheMonth')} isRequired />\n </div>\n </Flex>\n </div>\n <Flex flexDirection=\"column\" gap={4} justifyContent=\"center\" alignItems=\"center\">\n {payPeriodPreview && payPeriodPreview[selectedPayPeriodIndex] ? (\n <div className={style.calendarContainer}>\n {!payPreviewLoading && (\n <Components.Select\n label={t('labels.preview')}\n isRequired\n options={payPeriodPreview.map((period, index) => {\n return {\n value: String(index),\n label: dateFormatter.formatPayPeriodRange(\n period.startDate.toString(),\n period.endDate.toString(),\n ),\n }\n })}\n value={String(selectedPayPeriodIndex)}\n onChange={(value: string) => {\n const numericValue = Number(value)\n if (!isNaN(numericValue)) {\n setSelectedPayPeriodIndex(numericValue)\n }\n }}\n />\n )}\n <Components.CalendarPreview\n key={selectedPayPeriodIndex}\n dateRange={{\n start: new Date(payPeriodPreview[selectedPayPeriodIndex].startDate.toString()),\n end: new Date(payPeriodPreview[selectedPayPeriodIndex].endDate.toString()),\n label: t('payPreview.payPeriod') || 'Pay Period',\n }}\n highlightDates={[\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].checkDate.toString()),\n highlightColor: 'primary',\n label: t('payPreview.payday') || 'Payday',\n },\n {\n date: new Date(\n payPeriodPreview[selectedPayPeriodIndex].runPayrollBy.toString(),\n ),\n highlightColor: 'secondary',\n label: t('payPreview.payrollDeadline') || 'Payroll Deadline',\n },\n ]}\n />\n </div>\n ) : (\n <div className={style.calendarContainer}>\n <Components.Alert\n status=\"info\"\n label={t('previewAlert.title', 'Pay Schedule Preview')}\n >\n <Components.Text>\n {t(\n 'previewAlert.description',\n 'Complete all the required fields on the left to see a preview of your pay schedule.',\n )}\n </Components.Text>\n </Components.Alert>\n </div>\n )}\n </Flex>\n </Grid>\n </div>\n )\n}\n"],"names":["Edit","Components","useComponentContext","t","useTranslation","dateFormatter","useDateFormatter","payPeriodPreview","mode","payPreviewLoading","paymentSpeedDays","usePaySchedule","setValue","useFormContext","selectedPayPeriodIndex","setSelectedPayPeriodIndex","useState","frequency","useWatch","customTwicePerMonth","shouldShowDay1","shouldShowDay2","useEffect","jsx","style","jsxs","Grid","Flex","TextInputField","SelectField","RadioGroupField","DatePickerField","NumberInputField","period","index","value","numericValue"],"mappings":";;;;;;;;;;;;;;;AAkBO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAgBC,EAAA,GAChB,EAAE,kBAAAC,GAAkB,MAAAC,GAAM,mBAAAC,GAAmB,kBAAAC,EAAA,IAAqBC,EAAA,GAClE,EAAE,UAAAC,EAAA,IAAaC,EAAA,GACf,CAACC,GAAwBC,CAAyB,IAAIC,EAAS,CAAC,GAEhEC,IAAYC,EAAS,EAAE,MAAM,aAAa,GAC1CC,IAAsBD,EAAS,EAAE,MAAM,uBAAuB,GAE9DE,IACHH,MAAc,qBAAqBE,MAAwB,YAAaF,MAAc,WACnFI,IAAiBJ,MAAc,qBAAqBE,MAAwB;AASlF,SAPAG,EAAU,MAAM;AACd,IAAIL,MAAc,qBAAqBE,MAAwB,cAC7DP,EAAS,QAAQ,EAAE,GACnBA,EAAS,QAAQ,EAAE;AAAA,EAEvB,GAAG,CAACK,GAAWE,GAAqBP,CAAQ,CAAC,GAEzCJ,MAAS,uBAAuBA,MAAS,qBACpC,OAIP,gBAAAe,EAAC,OAAA,EAAI,WAAWC,EAAM,sBACpB,UAAA,gBAAAC,EAACC,GAAA,EAAK,KAAK,IAAI,qBAAqB,EAAE,MAAM,OAAO,OAAO,aACxD,UAAA;AAAA,IAAA,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AAK,IAAI,KAAKP,EAAiBO,CAAsB,EAAE,QAAQ,UAAU;AAAA,YACzE,OAAOX,EAAE,sBAAsB,KAAK;AAAA,UAAA;AAAA,UAEtC,gBAAgB;AAAA,YACd;AAAA,cACE,MAAM,IAAI,KAAKI,EAAiBO,CAAsB,EAAE,UAAU,UAAU;AAAA,cAC5E,gBAAgB;AAAA,cAChB,OAAOX,EAAE,mBAAmB,KAAK;AAAA,YAAA;AAAA,YAEnC;AAAA,cACE,MAAM,IAAI;AAAA,gBACRI,EAAiBO,CAAsB,EAAE,aAAa,SAAA;AAAA,cAAS;AAAA,cAEjE,gBAAgB;AAAA,cAChB,OAAOX,EAAE,4BAA4B,KAAK;AAAA,YAAA;AAAA,UAC5C;AAAA,QACF;AAAA,QAnBKW;AAAA,MAAA;AAAA,IAoBP,GACF,IAEA,gBAAAS,EAAC,OAAA,EAAI,WAAWC,EAAM,mBACpB,UAAA,gBAAAD;AAAA,MAACtB,EAAW;AAAA,MAAX;AAAA,QACC,QAAO;AAAA,QACP,OAAOE,EAAE,sBAAsB,sBAAsB;AAAA,QAErD,UAAA,gBAAAoB,EAACtB,EAAW,MAAX,EACE,UAAAE;AAAA,UACC;AAAA,UACA;AAAA,QAAA,EACF,CACF;AAAA,MAAA;AAAA,IAAA,GAEJ,EAAA,CAEJ;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;"}
@@ -1,7 +1,6 @@
1
1
  import { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate';
2
- import { PayScheduleList } from '@gusto/embedded-api/models/components/payschedulelist';
3
- import { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject';
4
- import { PayPeriods } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayschedulespreview';
2
+ import { PaySchedule, PaySchedule as PayScheduleType } from '@gusto/embedded-api/models/components/payschedule';
3
+ import { PaySchedulePreviewPayPeriod } from '@gusto/embedded-api/models/components/payschedulepreviewpayperiod';
5
4
  import { z } from 'zod';
6
5
  import { RequireAtLeastOne } from '../../../types/Helpers';
7
6
  export type MODE = 'LIST_PAY_SCHEDULES' | 'ADD_PAY_SCHEDULE' | 'EDIT_PAY_SCHEDULE' | 'PREVIEW_PAY_SCHEDULE';
@@ -13,9 +12,9 @@ type PayScheduleContextType = {
13
12
  handleContinue: () => void;
14
13
  mode: MODE;
15
14
  isPending: boolean;
16
- paySchedules: PayScheduleList[] | undefined | null;
15
+ paySchedules: PaySchedule[] | undefined | null;
17
16
  currentPaySchedule: PayScheduleType | undefined | null;
18
- payPeriodPreview?: PayPeriods[];
17
+ payPeriodPreview?: PaySchedulePreviewPayPeriod[];
19
18
  payPreviewLoading?: boolean;
20
19
  paymentSpeedDays: number;
21
20
  };
@@ -12,8 +12,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
12
12
  import "@gusto/embedded-api/models/errors/httpclienterrors";
13
13
  import "../../../shared/constants.js";
14
14
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
15
+ import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
15
16
  import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
16
- const x = o.object({
17
+ const S = o.object({
17
18
  frequency: o.enum(["Every week", "Every other week", "Twice per month", "Monthly"]),
18
19
  anchorPayDate: o.date().optional(),
19
20
  anchorEndOfPayPeriod: o.date().optional(),
@@ -21,10 +22,10 @@ const x = o.object({
21
22
  day2: o.number().min(1).max(31).optional(),
22
23
  customName: o.string().optional(),
23
24
  customTwicePerMonth: o.string().optional()
24
- }), [S, f] = t("PayScheduleContext");
25
+ }), [f, w] = t("PayScheduleContext");
25
26
  export {
26
- f as PayScheduleProvider,
27
- x as PayScheduleSchema,
28
- S as usePaySchedule
27
+ w as PayScheduleProvider,
28
+ S as PayScheduleSchema,
29
+ f as usePaySchedule
29
30
  };
30
31
  //# sourceMappingURL=usePaySchedule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/usePaySchedule.ts"],"sourcesContent":["import type { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate'\nimport type { PayScheduleList } from '@gusto/embedded-api/models/components/payschedulelist'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayPeriods } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayschedulespreview'\nimport { z } from 'zod'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE =\n | 'LIST_PAY_SCHEDULES'\n | 'ADD_PAY_SCHEDULE'\n | 'EDIT_PAY_SCHEDULE'\n | 'PREVIEW_PAY_SCHEDULE'\n\ntype PayScheduleContextType = {\n companyId: string\n handleAdd: () => void\n handleEdit: (schedule: PayScheduleType) => void\n handleCancel: () => void\n handleContinue: () => void\n mode: MODE\n isPending: boolean\n paySchedules: PayScheduleList[] | undefined | null\n currentPaySchedule: PayScheduleType | undefined | null\n payPeriodPreview?: PayPeriods[]\n payPreviewLoading?: boolean\n paymentSpeedDays: number\n}\n\nexport const PayScheduleSchema = z.object({\n frequency: z.enum(['Every week', 'Every other week', 'Twice per month', 'Monthly']),\n anchorPayDate: z.date().optional(),\n anchorEndOfPayPeriod: z.date().optional(),\n day1: z.number().min(1).max(31).optional(),\n day2: z.number().min(1).max(31).optional(),\n customName: z.string().optional(),\n customTwicePerMonth: z.string().optional(),\n})\n\nexport type PayScheduleInputs = z.input<typeof PayScheduleSchema>\nexport type PayScheduleOutputs = z.output<typeof PayScheduleSchema>\n\nexport type PayScheduleDefaultValues = RequireAtLeastOne<\n Partial<\n Pick<\n PayScheduleCreateUpdate,\n 'anchorPayDate' | 'anchorEndOfPayPeriod' | 'day1' | 'day2' | 'customName' | 'frequency'\n >\n >\n>\n\nconst [usePaySchedule, PayScheduleProvider] =\n createCompoundContext<PayScheduleContextType>('PayScheduleContext')\nexport { usePaySchedule, PayScheduleProvider }\n"],"names":["PayScheduleSchema","z","usePaySchedule","PayScheduleProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AA6BO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACxC,WAAWA,EAAE,KAAK,CAAC,cAAc,oBAAoB,mBAAmB,SAAS,CAAC;AAAA,EAClF,eAAeA,EAAE,KAAA,EAAO,SAAA;AAAA,EACxB,sBAAsBA,EAAE,KAAA,EAAO,SAAA;AAAA,EAC/B,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,qBAAqBA,EAAE,OAAA,EAAS,SAAA;AAClC,CAAC,GAcK,CAACC,GAAgBC,CAAmB,IACxCC,EAA8C,oBAAoB;"}
1
+ {"version":3,"file":"usePaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/usePaySchedule.ts"],"sourcesContent":["import type { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate'\nimport type {\n PaySchedule,\n PaySchedule as PayScheduleType,\n} from '@gusto/embedded-api/models/components/payschedule'\nimport type { PaySchedulePreviewPayPeriod } from '@gusto/embedded-api/models/components/payschedulepreviewpayperiod'\nimport { z } from 'zod'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE =\n | 'LIST_PAY_SCHEDULES'\n | 'ADD_PAY_SCHEDULE'\n | 'EDIT_PAY_SCHEDULE'\n | 'PREVIEW_PAY_SCHEDULE'\n\ntype PayScheduleContextType = {\n companyId: string\n handleAdd: () => void\n handleEdit: (schedule: PayScheduleType) => void\n handleCancel: () => void\n handleContinue: () => void\n mode: MODE\n isPending: boolean\n paySchedules: PaySchedule[] | undefined | null\n currentPaySchedule: PayScheduleType | undefined | null\n payPeriodPreview?: PaySchedulePreviewPayPeriod[]\n payPreviewLoading?: boolean\n paymentSpeedDays: number\n}\n\nexport const PayScheduleSchema = z.object({\n frequency: z.enum(['Every week', 'Every other week', 'Twice per month', 'Monthly']),\n anchorPayDate: z.date().optional(),\n anchorEndOfPayPeriod: z.date().optional(),\n day1: z.number().min(1).max(31).optional(),\n day2: z.number().min(1).max(31).optional(),\n customName: z.string().optional(),\n customTwicePerMonth: z.string().optional(),\n})\n\nexport type PayScheduleInputs = z.input<typeof PayScheduleSchema>\nexport type PayScheduleOutputs = z.output<typeof PayScheduleSchema>\n\nexport type PayScheduleDefaultValues = RequireAtLeastOne<\n Partial<\n Pick<\n PayScheduleCreateUpdate,\n 'anchorPayDate' | 'anchorEndOfPayPeriod' | 'day1' | 'day2' | 'customName' | 'frequency'\n >\n >\n>\n\nconst [usePaySchedule, PayScheduleProvider] =\n createCompoundContext<PayScheduleContextType>('PayScheduleContext')\nexport { usePaySchedule, PayScheduleProvider }\n"],"names":["PayScheduleSchema","z","usePaySchedule","PayScheduleProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AA+BO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACxC,WAAWA,EAAE,KAAK,CAAC,cAAc,oBAAoB,mBAAmB,SAAS,CAAC;AAAA,EAClF,eAAeA,EAAE,KAAA,EAAO,SAAA;AAAA,EACxB,sBAAsBA,EAAE,KAAA,EAAO,SAAA;AAAA,EAC/B,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,qBAAqBA,EAAE,OAAA,EAAS,SAAA;AAClC,CAAC,GAcK,CAACC,GAAgBC,CAAmB,IACxCC,EAA8C,oBAAoB;"}
@@ -1,16 +1,17 @@
1
1
  import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
2
  import { useTranslation as a } from "react-i18next";
3
3
  import { useStateTaxesForm as s } from "./context.js";
4
+ import "../../../../shared/constants.js";
4
5
  import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
6
  import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- function d() {
7
- const { t } = a("Company.StateTaxes", { keyPrefix: "form" }), { handleCancel: e, isPending: r } = s(), o = c();
7
+ function x() {
8
+ const { t } = a("Company.StateTaxes", { keyPrefix: "form" }), { handleCancel: r, isPending: e } = s(), o = c();
8
9
  return /* @__PURE__ */ i(m, { children: [
9
- /* @__PURE__ */ n(o.Button, { variant: "secondary", onClick: e, children: t("cancelCta") }),
10
- /* @__PURE__ */ n(o.Button, { variant: "primary", type: "submit", isDisabled: r, children: t("saveCta") })
10
+ /* @__PURE__ */ n(o.Button, { variant: "secondary", onClick: r, children: t("cancelCta") }),
11
+ /* @__PURE__ */ n(o.Button, { variant: "primary", type: "submit", isDisabled: e, children: t("saveCta") })
11
12
  ] });
12
13
  }
13
14
  export {
14
- d as Actions
15
+ x as Actions
15
16
  };
16
17
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { handleCancel, isPending } = useStateTaxesForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleCancel","isPending","useStateTaxesForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GAC9BC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAA,EAAE,WAAW,EAAA,CAChB;AAAA,IACA,gBAAAM,EAACH,EAAW,QAAX,EAAkB,SAAQ,WAAU,MAAK,UAAS,YAAYF,GAC5D,UAAA,EAAE,SAAS,EAAA,CACd;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { handleCancel, isPending } = useStateTaxesForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleCancel","isPending","useStateTaxesForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GAC9BC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAA,EAAE,WAAW,EAAA,CAChB;AAAA,IACA,gBAAAM,EAACH,EAAW,QAAX,EAAkB,SAAQ,WAAU,MAAK,UAAS,YAAYF,GAC5D,UAAA,EAAE,SAAS,EAAA,CACd;AAAA,EAAA,GACF;AAEJ;"}
@@ -1,4 +1,4 @@
1
- import { jsx as o, jsxs as V, Fragment as q } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as q, Fragment as V } from "react/jsx-runtime";
2
2
  import { useForm as B, FormProvider as D } from "react-hook-form";
3
3
  import { zodResolver as K } from "@hookform/resolvers/zod";
4
4
  import { useTaxRequirementsUpdateStateMutation as M } from "@gusto/embedded-api/react-query/taxRequirementsUpdateState";
@@ -16,45 +16,45 @@ import { Flex as I } from "../../../Common/Flex/Flex.js";
16
16
  import { Form as J } from "../../../Common/Form/Form.js";
17
17
  import { componentEvents as g } from "../../../../shared/constants.js";
18
18
  import { useBase as Q } from "../../../Base/useBase.js";
19
- function he(a) {
20
- return /* @__PURE__ */ o(Y, { ...a, children: /* @__PURE__ */ o(W, { ...a, children: a.children }) });
19
+ function he(n) {
20
+ return /* @__PURE__ */ t(Y, { ...n, children: /* @__PURE__ */ t(W, { ...n, children: n.children }) });
21
21
  }
22
- function W({ companyId: a, state: f, className: k, children: y }) {
22
+ function W({ companyId: n, state: c, className: k, children: y }) {
23
23
  $("Company.StateTaxes");
24
- const { onEvent: S, baseSubmitHandler: b } = Q(), { t: h } = H("Company.StateTaxes", { keyPrefix: "form" }), { data: P } = w({ companyUuid: a, state: f }), c = P.taxRequirementsState, { mutateAsync: j, isPending: A } = M(), { dynamicSchema: C, defaultValues: E } = z(() => {
25
- const l = {}, n = {};
26
- return c.requirementSets?.forEach((t) => {
27
- if (!t.key) return;
28
- const r = t.key, i = {}, s = {};
29
- t.requirements?.forEach((e) => {
24
+ const { onEvent: S, baseSubmitHandler: b } = Q(), { t: h } = H("Company.StateTaxes", { keyPrefix: "form" }), { data: P } = w({ companyUuid: n, state: c }), l = P.taxRequirementsState, { mutateAsync: j, isPending: A } = M(), { dynamicSchema: C, defaultValues: E } = z(() => {
25
+ const f = {}, a = {};
26
+ return l.requirementSets?.forEach((o) => {
27
+ if (!o.key) return;
28
+ const r = o.key, i = {}, s = {};
29
+ o.requirements?.forEach((e) => {
30
30
  if (!e.key) return;
31
- const d = e.key, _ = e.metadata?.type === "tax_rate" || e.metadata?.type === "percent";
32
- e.metadata?.type === "radio" ? s[d] = e.value ?? void 0 : s[d] = e.value ? String(e.value) : "";
33
- let u = m.string().optional();
31
+ const u = e.key, _ = e.metadata?.type === "tax_rate" || e.metadata?.type === "percent";
32
+ e.metadata?.type === "radio" ? s[u] = e.value ?? void 0 : s[u] = e.value ? String(e.value) : "";
33
+ let d = m.string().optional();
34
34
  const p = e.metadata?.validation;
35
35
  if (p && _ && p.type === "one_of") {
36
36
  const T = p.rates;
37
- u = m.string().optional().refine((F) => !F || T.includes(F), {
37
+ d = m.string().optional().refine((F) => !F || T.includes(F), {
38
38
  message: h("validations.oneOf", { values: T.join(", ") })
39
39
  });
40
40
  }
41
- e.metadata?.type === "radio" && (u = m.boolean().optional()), i[d] = u;
42
- }), Object.keys(i).length > 0 && (l[r] = m.object(i), n[r] = s);
41
+ e.metadata?.type === "radio" && (d = m.boolean().optional()), i[u] = d;
42
+ }), Object.keys(i).length > 0 && (f[r] = m.object(i), a[r] = s);
43
43
  }), {
44
- dynamicSchema: m.object(l),
45
- defaultValues: n
44
+ dynamicSchema: m.object(f),
45
+ defaultValues: a
46
46
  };
47
- }, [c, h]), { control: R, ...v } = B({
47
+ }, [l, h]), { control: R, ...v } = B({
48
48
  resolver: K(C),
49
49
  defaultValues: E
50
- }), O = async (l) => {
51
- await b(l, async (n) => {
52
- const x = c.requirementSets?.filter((t) => t.key && n[t.key]).map((t) => {
53
- const r = t.key, i = n[r];
50
+ }), O = async (f) => {
51
+ await b(f, async (a) => {
52
+ const x = l.requirementSets?.filter((o) => o.key && a[o.key]).map((o) => {
53
+ const r = o.key, i = a[r];
54
54
  return {
55
- state: t.state,
55
+ state: c,
56
56
  key: r,
57
- effectiveFrom: t.effectiveFrom,
57
+ effectiveFrom: o.effectiveFrom,
58
58
  requirements: Object.entries(i).map(([s, e]) => ({
59
59
  key: s,
60
60
  value: String(e)
@@ -63,23 +63,23 @@ function W({ companyId: a, state: f, className: k, children: y }) {
63
63
  });
64
64
  await j({
65
65
  request: {
66
- companyUuid: a,
66
+ companyUuid: n,
67
67
  requestBody: { requirementSets: x },
68
- state: f
68
+ state: c
69
69
  }
70
70
  }), S(g.COMPANY_STATE_TAX_UPDATED);
71
71
  });
72
72
  }, U = () => {
73
73
  S(g.CANCEL);
74
74
  };
75
- return /* @__PURE__ */ o("section", { className: k, children: /* @__PURE__ */ o(D, { ...v, control: R, children: /* @__PURE__ */ o(J, { onSubmit: v.handleSubmit(O), children: /* @__PURE__ */ o(
75
+ return /* @__PURE__ */ t("section", { className: k, children: /* @__PURE__ */ t(D, { ...v, control: R, children: /* @__PURE__ */ t(J, { onSubmit: v.handleSubmit(O), children: /* @__PURE__ */ t(
76
76
  G,
77
77
  {
78
- value: { stateTaxRequirements: c, isPending: A, state: f, handleCancel: U },
79
- children: /* @__PURE__ */ o(I, { flexDirection: "column", gap: 32, children: y || /* @__PURE__ */ V(q, { children: [
80
- /* @__PURE__ */ o(N, {}),
81
- /* @__PURE__ */ o(L, {}),
82
- /* @__PURE__ */ o(X, {})
78
+ value: { stateTaxRequirements: l, isPending: A, state: c, handleCancel: U },
79
+ children: /* @__PURE__ */ t(I, { flexDirection: "column", gap: 32, children: y || /* @__PURE__ */ q(V, { children: [
80
+ /* @__PURE__ */ t(N, {}),
81
+ /* @__PURE__ */ t(L, {}),
82
+ /* @__PURE__ */ t(X, {})
83
83
  ] }) })
84
84
  }
85
85
  ) }) }) });
@@ -1 +1 @@
1
- {"version":3,"file":"StateTaxesForm.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useTaxRequirementsUpdateStateMutation } from '@gusto/embedded-api/react-query/taxRequirementsUpdateState'\nimport { useTaxRequirementsGetSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGet'\nimport { z } from 'zod'\nimport { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { Head } from './Head'\nimport { StateTaxesFormProvider } from './context'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\ninterface StateTaxesFormProps extends CommonComponentInterface {\n companyId: string\n state: string\n}\n\nexport function StateTaxesForm(props: StateTaxesFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, state, className, children }: StateTaxesFormProps) {\n useI18n('Company.StateTaxes')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { data } = useTaxRequirementsGetSuspense({ companyUuid: companyId, state })\n const stateTaxRequirements = data.taxRequirementsState!\n\n const { mutateAsync: updateStateTax, isPending: isPendingUpdate } =\n useTaxRequirementsUpdateStateMutation()\n\n // Schema and default value generation\n const { dynamicSchema, defaultValues } = useMemo(() => {\n const schemaShape: Record<string, z.ZodObject> = {}\n const values: Partial<Record<string, Record<string, string | boolean | number | undefined>>> =\n {}\n\n //Looping through each requirement set\n stateTaxRequirements.requirementSets?.forEach(requirementSet => {\n if (!requirementSet.key) return\n\n const requirementSetKey = requirementSet.key\n const requirementShape: Record<string, z.ZodType> = {}\n const requirementValues: Record<string, string | boolean | number | undefined> = {}\n\n requirementSet.requirements?.forEach(requirement => {\n if (!requirement.key) return\n\n const requirementKey = requirement.key\n\n const isPercentField =\n requirement.metadata?.type === 'tax_rate' || requirement.metadata?.type === 'percent'\n\n if (requirement.metadata?.type === 'radio') {\n requirementValues[requirementKey] = requirement.value ?? undefined\n } else {\n requirementValues[requirementKey] = requirement.value ? String(requirement.value) : ''\n }\n\n let fieldSchema: z.ZodType = z.string().optional()\n\n const validation = requirement.metadata?.validation\n\n if (validation) {\n if (isPercentField && validation.type === 'one_of') {\n const oneOfValues = validation.rates as string[]\n fieldSchema = z\n .string()\n .optional()\n .refine(val => !val || oneOfValues.includes(val), {\n message: t('validations.oneOf', { values: oneOfValues.join(', ') }),\n })\n }\n }\n\n if (requirement.metadata?.type === 'radio') {\n fieldSchema = z.boolean().optional()\n }\n requirementShape[requirementKey] = fieldSchema\n // --- End Schema Logic ---\n })\n\n if (Object.keys(requirementShape).length > 0) {\n schemaShape[requirementSetKey] = z.object(requirementShape)\n values[requirementSetKey] = requirementValues\n }\n })\n\n const finalSchema = z.object(schemaShape)\n\n // Return both the schema and the default values\n return {\n dynamicSchema: finalSchema,\n defaultValues: values as z.infer<typeof finalSchema>,\n }\n }, [stateTaxRequirements, t])\n\n // Infer the type from the schema\n type InferredFormInputs = z.infer<typeof dynamicSchema>\n\n const { control, ...methods } = useForm({\n resolver: zodResolver(dynamicSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InferredFormInputs) => {\n await baseSubmitHandler(formData, async payload => {\n const requirementSets = stateTaxRequirements.requirementSets\n ?.filter(rs => rs.key && payload[rs.key])\n .map(requirementSet => {\n const requirementSetKey = requirementSet.key as string\n const payloadSet = payload[requirementSetKey] as Record<string, unknown>\n\n return {\n state: requirementSet.state,\n key: requirementSetKey,\n effectiveFrom: requirementSet.effectiveFrom,\n requirements: Object.entries(payloadSet).map(([reqKey, value]) => ({\n key: reqKey,\n value: String(value),\n })),\n }\n })\n await updateStateTax({\n request: {\n companyUuid: companyId,\n requestBody: { requirementSets },\n state,\n },\n })\n onEvent(componentEvents.COMPANY_STATE_TAX_UPDATED)\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <StateTaxesFormProvider\n value={{ stateTaxRequirements, isPending: isPendingUpdate, state, handleCancel }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </StateTaxesFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n"],"names":["StateTaxesForm","props","jsx","BaseComponent","Root","companyId","state","className","children","useI18n","onEvent","baseSubmitHandler","useBase","t","useTranslation","data","useTaxRequirementsGetSuspense","stateTaxRequirements","updateStateTax","isPendingUpdate","useTaxRequirementsUpdateStateMutation","dynamicSchema","defaultValues","useMemo","schemaShape","values","requirementSet","requirementSetKey","requirementShape","requirementValues","requirement","requirementKey","isPercentField","fieldSchema","z","validation","oneOfValues","val","control","methods","useForm","zodResolver","onSubmit","formData","payload","requirementSets","rs","payloadSet","reqKey","value","componentEvents","handleCancel","FormProvider","HtmlForm","StateTaxesFormProvider","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;;;;;AAwBO,SAASA,GAAeC,GAAqD;AAClF,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,OAAAC,GAAO,WAAAC,GAAW,UAAAC,KAAiC;AAC5E,EAAAC,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,SAAAC,GAAS,mBAAA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AAA,EAAQ,WAAAK,GACP,UAAA,gBAAAL,EAACkD,KAAc,GAAGb,GAAS,SAAAD,GACzB,UAAA,gBAAApC,EAACmD,GAAA,EAAS,UAAUd,EAAQ,aAAaG,CAAQ,GAC/C,UAAA,gBAAAxC;AAAA,IAACoD;AAAA,IAAA;AAAA,MACC,OAAO,EAAE,sBAAArC,GAAsB,WAAWE,GAAiB,OAAAb,GAAO,cAAA6C,EAAA;AAAA,MAElE,UAAA,gBAAAjD,EAACqD,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAA/C,KAGC,gBAAAgD,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAvD,EAACwD,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,EACF,CACF,GACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"StateTaxesForm.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useTaxRequirementsUpdateStateMutation } from '@gusto/embedded-api/react-query/taxRequirementsUpdateState'\nimport { useTaxRequirementsGetSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGet'\nimport { z } from 'zod'\nimport { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { Head } from './Head'\nimport { StateTaxesFormProvider } from './context'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\ninterface StateTaxesFormProps extends CommonComponentInterface {\n companyId: string\n state: string\n}\n\nexport function StateTaxesForm(props: StateTaxesFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, state, className, children }: StateTaxesFormProps) {\n useI18n('Company.StateTaxes')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { data } = useTaxRequirementsGetSuspense({ companyUuid: companyId, state })\n const stateTaxRequirements = data.taxRequirementsState!\n\n const { mutateAsync: updateStateTax, isPending: isPendingUpdate } =\n useTaxRequirementsUpdateStateMutation()\n\n // Schema and default value generation\n const { dynamicSchema, defaultValues } = useMemo(() => {\n const schemaShape: Record<string, z.ZodObject> = {}\n const values: Partial<Record<string, Record<string, string | boolean | number | undefined>>> =\n {}\n\n //Looping through each requirement set\n stateTaxRequirements.requirementSets?.forEach(requirementSet => {\n if (!requirementSet.key) return\n\n const requirementSetKey = requirementSet.key\n const requirementShape: Record<string, z.ZodType> = {}\n const requirementValues: Record<string, string | boolean | number | undefined> = {}\n\n requirementSet.requirements?.forEach(requirement => {\n if (!requirement.key) return\n\n const requirementKey = requirement.key\n\n const isPercentField =\n requirement.metadata?.type === 'tax_rate' || requirement.metadata?.type === 'percent'\n\n if (requirement.metadata?.type === 'radio') {\n requirementValues[requirementKey] = requirement.value ?? undefined\n } else {\n requirementValues[requirementKey] = requirement.value ? String(requirement.value) : ''\n }\n\n let fieldSchema: z.ZodType = z.string().optional()\n\n const validation = requirement.metadata?.validation\n\n if (validation) {\n if (isPercentField && validation.type === 'one_of') {\n const oneOfValues = validation.rates as string[]\n fieldSchema = z\n .string()\n .optional()\n .refine(val => !val || oneOfValues.includes(val), {\n message: t('validations.oneOf', { values: oneOfValues.join(', ') }),\n })\n }\n }\n\n if (requirement.metadata?.type === 'radio') {\n fieldSchema = z.boolean().optional()\n }\n requirementShape[requirementKey] = fieldSchema\n // --- End Schema Logic ---\n })\n\n if (Object.keys(requirementShape).length > 0) {\n schemaShape[requirementSetKey] = z.object(requirementShape)\n values[requirementSetKey] = requirementValues\n }\n })\n\n const finalSchema = z.object(schemaShape)\n\n // Return both the schema and the default values\n return {\n dynamicSchema: finalSchema,\n defaultValues: values as z.infer<typeof finalSchema>,\n }\n }, [stateTaxRequirements, t])\n\n // Infer the type from the schema\n type InferredFormInputs = z.infer<typeof dynamicSchema>\n\n const { control, ...methods } = useForm({\n resolver: zodResolver(dynamicSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InferredFormInputs) => {\n await baseSubmitHandler(formData, async payload => {\n const requirementSets = stateTaxRequirements.requirementSets\n ?.filter(rs => rs.key && payload[rs.key])\n .map(requirementSet => {\n const requirementSetKey = requirementSet.key as string\n const payloadSet = payload[requirementSetKey] as Record<string, unknown>\n\n return {\n state,\n key: requirementSetKey,\n effectiveFrom: requirementSet.effectiveFrom,\n requirements: Object.entries(payloadSet).map(([reqKey, value]) => ({\n key: reqKey,\n value: String(value),\n })),\n }\n })\n await updateStateTax({\n request: {\n companyUuid: companyId,\n requestBody: { requirementSets },\n state,\n },\n })\n onEvent(componentEvents.COMPANY_STATE_TAX_UPDATED)\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <StateTaxesFormProvider\n value={{ stateTaxRequirements, isPending: isPendingUpdate, state, handleCancel }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </StateTaxesFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n"],"names":["StateTaxesForm","props","jsx","BaseComponent","Root","companyId","state","className","children","useI18n","onEvent","baseSubmitHandler","useBase","t","useTranslation","data","useTaxRequirementsGetSuspense","stateTaxRequirements","updateStateTax","isPendingUpdate","useTaxRequirementsUpdateStateMutation","dynamicSchema","defaultValues","useMemo","schemaShape","values","requirementSet","requirementSetKey","requirementShape","requirementValues","requirement","requirementKey","isPercentField","fieldSchema","z","validation","oneOfValues","val","control","methods","useForm","zodResolver","onSubmit","formData","payload","requirementSets","rs","payloadSet","reqKey","value","componentEvents","handleCancel","FormProvider","HtmlForm","StateTaxesFormProvider","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;;;;;AAwBO,SAASA,GAAeC,GAAqD;AAClF,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,OAAAC,GAAO,WAAAC,GAAW,UAAAC,KAAiC;AAC5E,EAAAC,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GACjC,EAAE,GAAAC,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,MAAAC,MAASC,EAA8B,EAAE,aAAaX,GAAW,OAAAC,GAAO,GAC1EW,IAAuBF,EAAK,sBAE5B,EAAE,aAAaG,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GAGI,EAAE,eAAAC,GAAe,eAAAC,EAAA,IAAkBC,EAAQ,MAAM;AACrD,UAAMC,IAA2C,CAAA,GAC3CC,IACJ,CAAA;AAGF,WAAAR,EAAqB,iBAAiB,QAAQ,CAAAS,MAAkB;AAC9D,UAAI,CAACA,EAAe,IAAK;AAEzB,YAAMC,IAAoBD,EAAe,KACnCE,IAA8C,CAAA,GAC9CC,IAA2E,CAAA;AAEjF,MAAAH,EAAe,cAAc,QAAQ,CAAAI,MAAe;AAClD,YAAI,CAACA,EAAY,IAAK;AAEtB,cAAMC,IAAiBD,EAAY,KAE7BE,IACJF,EAAY,UAAU,SAAS,cAAcA,EAAY,UAA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-api/models/errors/httpclienterrors";
12
12
  import "../../../../shared/constants.js";
13
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
+ import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
15
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
15
- const [c, d] = t("StateTaxesFormContext");
16
+ const [d, u] = t("StateTaxesFormContext");
16
17
  export {
17
- d as StateTaxesFormProvider,
18
- c as useStateTaxesForm
18
+ u as StateTaxesFormProvider,
19
+ d as useStateTaxesForm
19
20
  };
20
21
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
@@ -1,13 +1,14 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as i } from "react-i18next";
3
3
  import { useStateTaxesList as e } from "./context.js";
4
- import { ActionsLayout as s } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
- import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- function f() {
7
- const { t: o } = i("Company.StateTaxes"), n = m(), { handleContinue: r } = e();
8
- return /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(n.Button, { variant: "primary", onClick: r, children: o("list.continueCta") }) });
4
+ import "../../../../shared/constants.js";
5
+ import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
6
+ import { useComponentContext as s } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
+ function l() {
8
+ const { t: o } = i("Company.StateTaxes"), n = s(), { handleContinue: r } = e();
9
+ return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(n.Button, { variant: "primary", onClick: r, children: o("list.continueCta") }) });
9
10
  }
10
11
  export {
11
- f as Actions
12
+ l as Actions
12
13
  };
13
14
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes')\n const Components = useComponentContext()\n const { handleContinue } = useStateTaxesList()\n return (\n <ActionsLayout>\n <Components.Button variant=\"primary\" onClick={handleContinue}>\n {t('list.continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","Components","useComponentContext","handleContinue","useStateTaxesList","jsx","ActionsLayout"],"mappings":";;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CC,IAAaC,EAAA,GACb,EAAE,gBAAAC,EAAA,IAAmBC,EAAA;AAC3B,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACJ,EAAW,QAAX,EAAkB,SAAQ,WAAU,SAASE,GAC3C,UAAAJ,EAAE,kBAAkB,GACvB,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes')\n const Components = useComponentContext()\n const { handleContinue } = useStateTaxesList()\n return (\n <ActionsLayout>\n <Components.Button variant=\"primary\" onClick={handleContinue}>\n {t('list.continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","Components","useComponentContext","handleContinue","useStateTaxesList","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CC,IAAaC,EAAA,GACb,EAAE,gBAAAC,EAAA,IAAmBC,EAAA;AAC3B,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACJ,EAAW,QAAX,EAAkB,SAAQ,WAAU,SAASE,GAC3C,UAAAJ,EAAE,kBAAkB,GACvB,GACF;AAEJ;"}
@@ -1,11 +1,12 @@
1
1
  import { jsx as s, Fragment as p } from "react/jsx-runtime";
2
2
  import { useTranslation as o } from "react-i18next";
3
3
  import { useStateTaxesList as l } from "./context.js";
4
+ import "../../../../shared/constants.js";
4
5
  import { EmptyData as c } from "../../../Common/EmptyData/EmptyData.js";
5
6
  import { useComponentContext as u } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
7
  import { useDataView as d } from "../../../Common/DataView/useDataView.js";
7
8
  import { DataView as C } from "../../../Common/DataView/DataView.js";
8
- const S = () => {
9
+ const k = () => {
9
10
  const { stateTaxRequirements: n, handleChange: r } = l(), a = u(), { t } = o("Company.StateTaxes", { keyPrefix: "list" }), { t: i } = o("common", { keyPrefix: "statesHash" }), { ...m } = d({
10
11
  data: n,
11
12
  columns: [
@@ -25,7 +26,7 @@ const S = () => {
25
26
  {
26
27
  variant: "secondary",
27
28
  onClick: () => {
28
- r(e.state);
29
+ e.state && r(e.state);
29
30
  },
30
31
  children: e.setupComplete ? t("editStateTaxCta") : t("continueStateTaxSetupCta")
31
32
  }
@@ -35,6 +36,6 @@ const S = () => {
35
36
  return /* @__PURE__ */ s(C, { label: t("requirementsListLabel"), ...m });
36
37
  };
37
38
  export {
38
- S as List
39
+ k as List
39
40
  };
40
41
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { DataView, EmptyData, useDataView } from '@/components/Common'\nimport type { STATES_ABBR } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const List = () => {\n const { stateTaxRequirements, handleChange } = useStateTaxesList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'list' })\n const { t: statesHash } = useTranslation('common', { keyPrefix: 'statesHash' })\n\n const { ...dataViewProps } = useDataView({\n data: stateTaxRequirements,\n columns: [\n {\n key: 'state',\n title: t('requirementsListCol1'),\n render: requirement => {\n return <span>{statesHash(requirement.state as (typeof STATES_ABBR)[number])}</span>\n },\n },\n {\n key: 'status',\n title: t('requirementsListCol2'),\n render: requirement => {\n return (\n <>\n <Components.Badge status={requirement.setupComplete ? 'success' : 'warning'}>\n {requirement.setupComplete ? t('completeBadge') : t('incompleteBadge')}\n </Components.Badge>\n </>\n )\n },\n },\n ],\n itemMenu: requirement => {\n return (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleChange(requirement.state)\n }}\n >\n {requirement.setupComplete ? t('editStateTaxCta') : t('continueStateTaxSetupCta')}\n </Components.Button>\n )\n },\n\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n })\n return <DataView label={t('requirementsListLabel')} {...dataViewProps} />\n}\n"],"names":["List","stateTaxRequirements","handleChange","useStateTaxesList","Components","useComponentContext","useTranslation","statesHash","dataViewProps","useDataView","requirement","jsx","EmptyData","DataView"],"mappings":";;;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,sBAAAC,GAAsB,cAAAC,EAAA,IAAiBC,EAAA,GACzCC,IAAaC,EAAA,GAEb,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,GAAGC,MAAeD,EAAe,UAAU,EAAE,WAAW,cAAc,GAExE,EAAE,GAAGE,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMR;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAAS,MACC,gBAAAC,EAAC,QAAA,EAAM,UAAAJ,EAAWG,EAAY,KAAqC,GAAE;AAAA,MAC9E;AAAA,MAEF;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAAA,6BAGF,UAAA,gBAAAC,EAACP,EAAW,OAAX,EAAiB,QAAQM,EAAY,gBAAgB,YAAY,WAC/D,UAAAA,EAAY,gBAAgB,EAAE,eAAe,IAAI,EAAE,iBAAiB,GACvE,GACF;AAAA,MAEJ;AAAA,IACF;AAAA,IAEF,UAAU,CAAAA,MAEN,gBAAAC;AAAA,MAACP,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAF,EAAaQ,EAAY,KAAK;AAAA,QAChC;AAAA,QAEC,YAAY,gBAAgB,EAAE,iBAAiB,IAAI,EAAE,0BAA0B;AAAA,MAAA;AAAA,IAAA;AAAA,IAKtF,YAAY,MACV,gBAAAC,EAACC,GAAA,EAAU,OAAO,EAAE,iBAAiB,GAAG,aAAa,EAAE,uBAAuB,EAAA,CAAG;AAAA,EAAA,CAEpF;AACD,2BAAQC,GAAA,EAAS,OAAO,EAAE,uBAAuB,GAAI,GAAGL,GAAe;AACzE;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { DataView, EmptyData, useDataView } from '@/components/Common'\nimport type { STATES_ABBR } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const List = () => {\n const { stateTaxRequirements, handleChange } = useStateTaxesList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'list' })\n const { t: statesHash } = useTranslation('common', { keyPrefix: 'statesHash' })\n\n const { ...dataViewProps } = useDataView({\n data: stateTaxRequirements,\n columns: [\n {\n key: 'state',\n title: t('requirementsListCol1'),\n render: requirement => {\n return <span>{statesHash(requirement.state as (typeof STATES_ABBR)[number])}</span>\n },\n },\n {\n key: 'status',\n title: t('requirementsListCol2'),\n render: requirement => {\n return (\n <>\n <Components.Badge status={requirement.setupComplete ? 'success' : 'warning'}>\n {requirement.setupComplete ? t('completeBadge') : t('incompleteBadge')}\n </Components.Badge>\n </>\n )\n },\n },\n ],\n itemMenu: requirement => {\n return (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n if (requirement.state) handleChange(requirement.state)\n }}\n >\n {requirement.setupComplete ? t('editStateTaxCta') : t('continueStateTaxSetupCta')}\n </Components.Button>\n )\n },\n\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n })\n return <DataView label={t('requirementsListLabel')} {...dataViewProps} />\n}\n"],"names":["List","stateTaxRequirements","handleChange","useStateTaxesList","Components","useComponentContext","useTranslation","statesHash","dataViewProps","useDataView","requirement","jsx","EmptyData","DataView"],"mappings":";;;;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,sBAAAC,GAAsB,cAAAC,EAAA,IAAiBC,EAAA,GACzCC,IAAaC,EAAA,GAEb,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,GAAGC,MAAeD,EAAe,UAAU,EAAE,WAAW,cAAc,GAExE,EAAE,GAAGE,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMR;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAAS,MACC,gBAAAC,EAAC,QAAA,EAAM,UAAAJ,EAAWG,EAAY,KAAqC,GAAE;AAAA,MAC9E;AAAA,MAEF;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAAA,6BAGF,UAAA,gBAAAC,EAACP,EAAW,OAAX,EAAiB,QAAQM,EAAY,gBAAgB,YAAY,WAC/D,UAAAA,EAAY,gBAAgB,EAAE,eAAe,IAAI,EAAE,iBAAiB,GACvE,GACF;AAAA,MAEJ;AAAA,IACF;AAAA,IAEF,UAAU,CAAAA,MAEN,gBAAAC;AAAA,MAACP,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAIM,EAAY,SAAOR,EAAaQ,EAAY,KAAK;AAAA,QACvD;AAAA,QAEC,YAAY,gBAAgB,EAAE,iBAAiB,IAAI,EAAE,0BAA0B;AAAA,MAAA;AAAA,IAAA;AAAA,IAKtF,YAAY,MACV,gBAAAC,EAACC,GAAA,EAAU,OAAO,EAAE,iBAAiB,GAAG,aAAa,EAAE,uBAAuB,EAAA,CAAG;AAAA,EAAA,CAEpF;AACD,2BAAQC,GAAA,EAAS,OAAO,EAAE,uBAAuB,GAAI,GAAGL,GAAe;AACzE;"}
@@ -1,22 +1,22 @@
1
1
  import { jsx as e, jsxs as c, Fragment as l } from "react/jsx-runtime";
2
- import { useTaxRequirementsGetAllSuspense as d } from "@gusto/embedded-api/react-query/taxRequirementsGetAll";
3
- import { Head as f } from "./Head.js";
4
- import { StateTaxesListProvider as p } from "./context.js";
5
- import { Actions as u } from "./Actions.js";
2
+ import { useTaxRequirementsGetAllSuspense as u } from "@gusto/embedded-api/react-query/taxRequirementsGetAll";
3
+ import { Head as d } from "./Head.js";
4
+ import { StateTaxesListProvider as f } from "./context.js";
5
+ import { Actions as p } from "./Actions.js";
6
6
  import { List as h } from "./List.js";
7
7
  import { BaseComponent as T } from "../../../Base/Base.js";
8
8
  import { useI18n as x } from "../../../../i18n/I18n.js";
9
9
  import { Flex as A } from "../../../Common/Flex/Flex.js";
10
10
  import { componentEvents as r } from "../../../../shared/constants.js";
11
11
  import { useBase as C } from "../../../Base/useBase.js";
12
- function y(n) {
13
- return /* @__PURE__ */ e(T, { ...n, children: /* @__PURE__ */ e(E, { ...n, children: n.children }) });
12
+ function B(t) {
13
+ return /* @__PURE__ */ e(T, { ...t, children: /* @__PURE__ */ e(S, { ...t, children: t.children }) });
14
14
  }
15
- function E({ className: n, children: t, companyId: i }) {
15
+ function S({ className: t, children: n, companyId: i }) {
16
16
  x("Company.StateTaxes");
17
- const { onEvent: o } = C(), { data: m } = d({ companyUuid: i }), s = m.responseBodies;
18
- return /* @__PURE__ */ e("section", { className: n, children: /* @__PURE__ */ e(
19
- p,
17
+ const { onEvent: o } = C(), { data: m } = u({ companyUuid: i }), s = m.taxRequirementStatesList;
18
+ return /* @__PURE__ */ e("section", { className: t, children: /* @__PURE__ */ e(
19
+ f,
20
20
  {
21
21
  value: {
22
22
  isPending: !1,
@@ -28,15 +28,15 @@ function E({ className: n, children: t, companyId: i }) {
28
28
  o(r.COMPANY_STATE_TAX_EDIT, { state: a });
29
29
  }
30
30
  },
31
- children: /* @__PURE__ */ e(A, { flexDirection: "column", gap: 32, children: t || /* @__PURE__ */ c(l, { children: [
32
- /* @__PURE__ */ e(f, {}),
31
+ children: /* @__PURE__ */ e(A, { flexDirection: "column", gap: 32, children: n || /* @__PURE__ */ c(l, { children: [
32
+ /* @__PURE__ */ e(d, {}),
33
33
  /* @__PURE__ */ e(h, {}),
34
- /* @__PURE__ */ e(u, {})
34
+ /* @__PURE__ */ e(p, {})
35
35
  ] }) })
36
36
  }
37
37
  ) });
38
38
  }
39
39
  export {
40
- y as StateTaxesList
40
+ B as StateTaxesList
41
41
  };
42
42
  //# sourceMappingURL=StateTaxesList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StateTaxesList.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/StateTaxesList.tsx"],"sourcesContent":["import { useTaxRequirementsGetAllSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGetAll'\nimport { Head } from './Head'\nimport { StateTaxesListProvider } from './context'\nimport { Actions } from './Actions'\nimport { List } from './List'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\ninterface StateTaxesListProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function StateTaxesList(props: StateTaxesListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, companyId }: StateTaxesListProps) {\n useI18n('Company.StateTaxes')\n const { onEvent } = useBase()\n const { data } = useTaxRequirementsGetAllSuspense({ companyUuid: companyId })\n const stateTaxRequirements = data.responseBodies!\n\n const handleContinue = () => {\n onEvent(componentEvents.COMPANY_STATE_TAX_DONE)\n }\n\n const handleChange = (state: string) => {\n onEvent(componentEvents.COMPANY_STATE_TAX_EDIT, { state })\n }\n\n return (\n <section className={className}>\n <StateTaxesListProvider\n value={{\n isPending: false,\n stateTaxRequirements,\n handleContinue,\n handleChange,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </StateTaxesListProvider>\n </section>\n )\n}\n"],"names":["StateTaxesList","props","jsx","BaseComponent","Root","className","children","companyId","useI18n","onEvent","useBase","data","useTaxRequirementsGetAllSuspense","stateTaxRequirements","StateTaxesListProvider","componentEvents","state","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;AAgBO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,WAAAC,KAAkC;AACrE,EAAAC,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACd,EAAE,MAAAC,EAAA,IAASC,EAAiC,EAAE,aAAaL,GAAW,GACtEM,IAAuBF,EAAK;AAUlC,SACE,gBAAAT,EAAC,aAAQ,WAAAG,GACP,UAAA,gBAAAH;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAW;AAAA,QACX,sBAAAD;AAAA,QACA,gBAde,MAAM;AAC3B,UAAAJ,EAAQM,EAAgB,sBAAsB;AAAA,QAChD;AAAA,QAaQ,cAXa,CAACC,MAAkB;AACtC,UAAAP,EAAQM,EAAgB,wBAAwB,EAAE,OAAAC,EAAA,CAAO;AAAA,QAC3D;AAAA,MASQ;AAAA,MAGF,UAAA,gBAAAd,EAACe,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAX,KAGC,gBAAAY,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAjB,EAACkB,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"StateTaxesList.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/StateTaxesList.tsx"],"sourcesContent":["import { useTaxRequirementsGetAllSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGetAll'\nimport { Head } from './Head'\nimport { StateTaxesListProvider } from './context'\nimport { Actions } from './Actions'\nimport { List } from './List'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\ninterface StateTaxesListProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function StateTaxesList(props: StateTaxesListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, companyId }: StateTaxesListProps) {\n useI18n('Company.StateTaxes')\n const { onEvent } = useBase()\n const { data } = useTaxRequirementsGetAllSuspense({ companyUuid: companyId })\n const stateTaxRequirements = data.taxRequirementStatesList!\n\n const handleContinue = () => {\n onEvent(componentEvents.COMPANY_STATE_TAX_DONE)\n }\n\n const handleChange = (state: string) => {\n onEvent(componentEvents.COMPANY_STATE_TAX_EDIT, { state })\n }\n\n return (\n <section className={className}>\n <StateTaxesListProvider\n value={{\n isPending: false,\n stateTaxRequirements,\n handleContinue,\n handleChange,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </StateTaxesListProvider>\n </section>\n )\n}\n"],"names":["StateTaxesList","props","jsx","BaseComponent","Root","className","children","companyId","useI18n","onEvent","useBase","data","useTaxRequirementsGetAllSuspense","stateTaxRequirements","StateTaxesListProvider","componentEvents","state","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;AAgBO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,WAAAC,KAAkC;AACrE,EAAAC,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACd,EAAE,MAAAC,EAAA,IAASC,EAAiC,EAAE,aAAaL,GAAW,GACtEM,IAAuBF,EAAK;AAUlC,SACE,gBAAAT,EAAC,aAAQ,WAAAG,GACP,UAAA,gBAAAH;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAW;AAAA,QACX,sBAAAD;AAAA,QACA,gBAde,MAAM;AAC3B,UAAAJ,EAAQM,EAAgB,sBAAsB;AAAA,QAChD;AAAA,QAaQ,cAXa,CAACC,MAAkB;AACtC,UAAAP,EAAQM,EAAgB,wBAAwB,EAAE,OAAAC,EAAA,CAAO;AAAA,QAC3D;AAAA,MASQ;AAAA,MAGF,UAAA,gBAAAd,EAACe,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAX,KAGC,gBAAAY,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAjB,EAACkB,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}