@gusto/embedded-react-sdk 0.52.1 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (471) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/components/Base/Base.d.ts +2 -2
  3. package/dist/components/Base/Base.js.map +1 -1
  4. package/dist/components/Common/DateRangeFilter/DateRangeFilter.d.ts +1 -2
  5. package/dist/components/Common/DateRangeFilter/DateRangeFilter.js +42 -43
  6. package/dist/components/Common/DateRangeFilter/DateRangeFilter.js.map +1 -1
  7. package/dist/components/Common/Fields/PercentageField/PercentageField.js +44 -42
  8. package/dist/components/Common/Fields/PercentageField/PercentageField.js.map +1 -1
  9. package/dist/components/Common/UI/Box/Box.js +6 -6
  10. package/dist/components/Common/UI/Box/Box.js.map +1 -1
  11. package/dist/components/Common/UI/Box/Box.module.scss.js +8 -8
  12. package/dist/components/Common/UI/Box/BoxTypes.d.ts +1 -1
  13. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  14. package/dist/components/Common/UI/CalendarPreview/CalendarPreview.js +16 -14
  15. package/dist/components/Common/UI/CalendarPreview/CalendarPreview.js.map +1 -1
  16. package/dist/components/Common/UI/Dialog/Dialog.js +29 -28
  17. package/dist/components/Common/UI/Dialog/Dialog.js.map +1 -1
  18. package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
  19. package/dist/components/Common/UI/FormBox/FormBox.d.ts +1 -1
  20. package/dist/components/Common/UI/FormBox/FormBox.js +9 -8
  21. package/dist/components/Common/UI/FormBox/FormBox.js.map +1 -1
  22. package/dist/components/Common/UI/FormBox/FormBox.module.scss.js +8 -6
  23. package/dist/components/Common/UI/FormBox/FormBox.module.scss.js.map +1 -1
  24. package/dist/components/Common/UI/FormBox/FormBoxTypes.d.ts +5 -1
  25. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  26. package/dist/components/Company/AssignSignatory/AssignSignatory.js +7 -10
  27. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  28. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -8
  29. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -9
  31. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  32. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +18 -21
  33. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  34. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -12
  35. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  36. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
  37. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  38. package/dist/components/Company/AssignSignatory/Head.js +8 -9
  39. package/dist/components/Company/AssignSignatory/Head.js.map +1 -1
  40. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -7
  41. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  42. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -8
  43. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  44. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +20 -21
  45. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  46. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
  47. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  48. package/dist/components/Company/AssignSignatory/TitleSelect.js +10 -12
  49. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  50. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
  51. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  52. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +2 -3
  53. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  54. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -11
  55. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  56. package/dist/components/Company/BankAccount/BankAccountForm/Head.js +2 -3
  57. package/dist/components/Company/BankAccount/BankAccountForm/Head.js.map +1 -1
  58. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
  59. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  60. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +6 -7
  61. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  62. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
  63. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  64. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -6
  65. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  66. package/dist/components/Company/BankAccount/stateMachine.d.ts +0 -1
  67. package/dist/components/Company/BankAccount/stateMachine.js +33 -35
  68. package/dist/components/Company/BankAccount/stateMachine.js.map +1 -1
  69. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -6
  70. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  71. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -14
  72. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  73. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  74. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  75. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +7 -8
  76. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  77. package/dist/components/Company/DocumentSigner/stateMachine.d.ts +0 -1
  78. package/dist/components/Company/DocumentSigner/stateMachine.js +27 -29
  79. package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -1
  80. package/dist/components/Company/FederalTaxes/Actions.js +6 -7
  81. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  82. package/dist/components/Company/FederalTaxes/FederalTaxes.js +7 -10
  83. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  84. package/dist/components/Company/FederalTaxes/Form.js +4 -4
  85. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
  86. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  87. package/dist/components/Company/Industry/Actions.js +5 -6
  88. package/dist/components/Company/Industry/Actions.js.map +1 -1
  89. package/dist/components/Company/Industry/Context.js +6 -7
  90. package/dist/components/Company/Industry/Context.js.map +1 -1
  91. package/dist/components/Company/Industry/Edit.js +10 -12
  92. package/dist/components/Company/Industry/Edit.js.map +1 -1
  93. package/dist/components/Company/Industry/IndustrySelect.js +6 -8
  94. package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
  95. package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
  96. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  97. package/dist/components/Company/Locations/LocationForm/Form.js +4 -6
  98. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  99. package/dist/components/Company/Locations/LocationForm/LocationForm.js +11 -14
  100. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  101. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
  102. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  103. package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
  104. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  105. package/dist/components/Company/Locations/LocationsList/LocationsList.js +9 -12
  106. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  107. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
  108. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  109. package/dist/components/Company/OnboardingOverview/Completed.js +5 -6
  110. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  111. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +9 -10
  112. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  113. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -5
  114. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  115. package/dist/components/Company/OnboardingOverview/context.js +3 -4
  116. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  117. package/dist/components/Company/PaySchedule/PayScheduleForm.js +47 -51
  118. package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
  119. package/dist/components/Company/PaySchedule/payScheduleStateMachine.d.ts +0 -1
  120. package/dist/components/Company/PaySchedule/payScheduleStateMachine.js +26 -28
  121. package/dist/components/Company/PaySchedule/payScheduleStateMachine.js.map +1 -1
  122. package/dist/components/Company/StateTaxes/StateTaxes.d.ts +2 -1
  123. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  124. package/dist/components/Company/StateTaxes/StateTaxesComponents.d.ts +2 -0
  125. package/dist/components/Company/StateTaxes/StateTaxesComponents.js +29 -16
  126. package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -1
  127. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
  128. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  129. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +1 -1
  130. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +21 -32
  131. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
  132. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +67 -75
  133. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  134. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
  135. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  136. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -7
  137. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  138. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +62 -47
  139. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  140. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +1 -0
  141. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +26 -23
  142. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  143. package/dist/components/Company/StateTaxes/StateTaxesList/context.d.ts +1 -0
  144. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
  145. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  146. package/dist/components/Company/StateTaxes/TaxRateManagement/AddRateAction.d.ts +12 -0
  147. package/dist/components/Company/StateTaxes/TaxRateManagement/AddRateAction.js +36 -0
  148. package/dist/components/Company/StateTaxes/TaxRateManagement/AddRateAction.js.map +1 -0
  149. package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.d.ts +10 -0
  150. package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js +110 -0
  151. package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js.map +1 -0
  152. package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.d.ts +18 -0
  153. package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.js +55 -0
  154. package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.js.map +1 -0
  155. package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateManagement.d.ts +47 -0
  156. package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateManagement.js +108 -0
  157. package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateManagement.js.map +1 -0
  158. package/dist/components/Company/StateTaxes/TaxRateManagement/context.d.ts +25 -0
  159. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +22 -0
  160. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -0
  161. package/dist/components/Company/StateTaxes/TaxRateManagement/index.d.ts +1 -0
  162. package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.d.ts +29 -0
  163. package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js +34 -0
  164. package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js.map +1 -0
  165. package/dist/components/Company/StateTaxes/shared/RequirementFields.d.ts +17 -0
  166. package/dist/components/Company/StateTaxes/shared/RequirementFields.js +24 -0
  167. package/dist/components/Company/StateTaxes/shared/RequirementFields.js.map +1 -0
  168. package/dist/components/Company/StateTaxes/{StateTaxesForm → shared}/applicableIf.d.ts +1 -1
  169. package/dist/components/Company/StateTaxes/shared/applicableIf.js.map +1 -0
  170. package/dist/components/Company/StateTaxes/shared/applicableIf.test.d.ts +1 -0
  171. package/dist/components/Company/StateTaxes/shared/buildRequirementSchema.d.ts +19 -0
  172. package/dist/components/Company/StateTaxes/shared/buildRequirementSchema.js +38 -0
  173. package/dist/components/Company/StateTaxes/shared/buildRequirementSchema.js.map +1 -0
  174. package/dist/components/Company/StateTaxes/shared/requirementValue.d.ts +2 -0
  175. package/dist/components/Company/StateTaxes/shared/requirementValue.js +7 -0
  176. package/dist/components/Company/StateTaxes/shared/requirementValue.js.map +1 -0
  177. package/dist/components/Company/StateTaxes/shared/rhfKey.d.ts +23 -0
  178. package/dist/components/Company/StateTaxes/shared/rhfKey.js +13 -0
  179. package/dist/components/Company/StateTaxes/shared/rhfKey.js.map +1 -0
  180. package/dist/components/Company/StateTaxes/shared/rhfKey.test.d.ts +1 -0
  181. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +1 -1
  182. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +40 -20
  183. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
  184. package/dist/components/Company/exports/companyOnboarding.d.ts +1 -0
  185. package/dist/components/Company/exports/companyOnboarding.js +12 -10
  186. package/dist/components/Company/exports/companyOnboarding.js.map +1 -1
  187. package/dist/components/Contractor/Address/Address.js +83 -76
  188. package/dist/components/Contractor/Address/Address.js.map +1 -1
  189. package/dist/components/Contractor/ContractorList/management/ManagementContractorList.d.ts +39 -0
  190. package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js +90 -0
  191. package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js.map +1 -0
  192. package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.d.ts +22 -0
  193. package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js +247 -0
  194. package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js.map +1 -0
  195. package/dist/components/Contractor/ContractorList/{index.d.ts → onboarding/ContractorList.d.ts} +3 -3
  196. package/dist/components/Contractor/ContractorList/onboarding/ContractorList.js +51 -0
  197. package/dist/components/Contractor/ContractorList/onboarding/ContractorList.js.map +1 -0
  198. package/dist/components/Contractor/ContractorList/onboarding/ContractorListView.d.ts +16 -0
  199. package/dist/components/Contractor/ContractorList/onboarding/ContractorListView.js +113 -0
  200. package/dist/components/Contractor/ContractorList/onboarding/ContractorListView.js.map +1 -0
  201. package/dist/components/Contractor/ContractorList/shared/index.d.ts +1 -0
  202. package/dist/components/Contractor/ContractorList/shared/useContractorList.d.ts +87 -0
  203. package/dist/components/Contractor/ContractorList/shared/useContractorList.js +110 -0
  204. package/dist/components/Contractor/ContractorList/shared/useContractorList.js.map +1 -0
  205. package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.d.ts +0 -1
  206. package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.js +18 -20
  207. package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.js.map +1 -1
  208. package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js +2 -3
  209. package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js.map +1 -1
  210. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js +170 -123
  211. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js.map +1 -1
  212. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.module.scss.js +12 -0
  213. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.module.scss.js.map +1 -0
  214. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/fields.js +40 -39
  215. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/fields.js.map +1 -1
  216. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js +91 -88
  217. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js.map +1 -1
  218. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.d.ts +0 -33
  219. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js +77 -86
  220. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js.map +1 -1
  221. package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js +1 -1
  222. package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
  223. package/dist/components/Contractor/OnboardingSummary/OnboardingSummary.js +9 -10
  224. package/dist/components/Contractor/OnboardingSummary/OnboardingSummary.js.map +1 -1
  225. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
  226. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  227. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +162 -251
  228. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  229. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +2 -1
  230. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js +2 -2
  231. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js.map +1 -1
  232. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +45 -44
  233. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  234. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +2 -3
  235. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  236. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -3
  237. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  238. package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.d.ts +32 -0
  239. package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.js +107 -0
  240. package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.js.map +1 -0
  241. package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.test.d.ts +1 -0
  242. package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js +6 -7
  243. package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js.map +1 -1
  244. package/dist/components/Contractor/Profile/ContractorProfile.js +63 -57
  245. package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -1
  246. package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js +18 -19
  247. package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js.map +1 -1
  248. package/dist/components/Contractor/Submit/Submit.js +118 -102
  249. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  250. package/dist/components/Contractor/exports/contractorManagement.d.ts +1 -0
  251. package/dist/components/Contractor/exports/contractorManagement.js +12 -10
  252. package/dist/components/Contractor/exports/contractorManagement.js.map +1 -1
  253. package/dist/components/Contractor/exports/contractorOnboarding.d.ts +1 -1
  254. package/dist/components/Contractor/exports/contractorOnboarding.js +1 -1
  255. package/dist/components/Contractor/shared/useContractorHasSignedW9.d.ts +8 -0
  256. package/dist/components/Contractor/shared/useContractorHasSignedW9.js +10 -0
  257. package/dist/components/Contractor/shared/useContractorHasSignedW9.js.map +1 -0
  258. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +32 -33
  259. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -1
  260. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +2 -3
  261. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -1
  262. package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js +6 -7
  263. package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js.map +1 -1
  264. package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js +14 -15
  265. package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js.map +1 -1
  266. package/dist/components/Employee/Documents/management/DocumentManager.js +6 -7
  267. package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -1
  268. package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js +6 -7
  269. package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -1
  270. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js +4 -5
  271. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js.map +1 -1
  272. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js +10 -13
  273. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  274. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js +5 -6
  275. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js.map +1 -1
  276. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.module.scss.js +8 -0
  277. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.module.scss.js.map +1 -0
  278. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  279. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  280. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js +22 -21
  281. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
  282. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +6 -6
  283. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js +5 -4
  284. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -1
  285. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js +3 -4
  286. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
  287. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js +6 -7
  288. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
  289. package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js +11 -12
  290. package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -1
  291. package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js +15 -16
  292. package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js.map +1 -1
  293. package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +6 -7
  294. package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
  295. package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +11 -12
  296. package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
  297. package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +1 -1
  298. package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js +7 -8
  299. package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js.map +1 -1
  300. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +4 -4
  301. package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js +29 -23
  302. package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js.map +1 -1
  303. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +26 -20
  304. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js.map +1 -1
  305. package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +133 -99
  306. package/dist/components/Employee/PaymentMethod/onboarding/ListView.js.map +1 -1
  307. package/dist/components/Employee/PaymentMethod/onboarding/ListView.module.scss.js +8 -0
  308. package/dist/components/Employee/PaymentMethod/onboarding/ListView.module.scss.js.map +1 -0
  309. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.d.ts +1 -1
  310. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js +19 -20
  311. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js.map +1 -1
  312. package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js +92 -86
  313. package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js.map +1 -1
  314. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +65 -64
  315. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
  316. package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js +7 -8
  317. package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js.map +1 -1
  318. package/dist/components/Employee/Profile/management/ProfileEditForm.js +7 -7
  319. package/dist/components/Employee/Profile/onboarding/AdminProfile.js +6 -6
  320. package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +6 -6
  321. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.d.ts +1 -0
  322. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js.map +1 -1
  323. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.d.ts +1 -0
  324. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js.map +1 -1
  325. package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js +11 -12
  326. package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js.map +1 -1
  327. package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +9 -10
  328. package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js.map +1 -1
  329. package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +6 -7
  330. package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js.map +1 -1
  331. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js +44 -45
  332. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js.map +1 -1
  333. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +23 -22
  334. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
  335. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +27 -27
  336. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
  337. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +9 -10
  338. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
  339. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +2 -3
  340. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
  341. package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js +16 -17
  342. package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js.map +1 -1
  343. package/dist/components/Flow/Flow.js +1 -1
  344. package/dist/components/Flow/FlowHeader.js +3 -4
  345. package/dist/components/Flow/FlowHeader.js.map +1 -1
  346. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +8 -9
  347. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  348. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +7 -8
  349. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  350. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +37 -37
  351. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  352. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +8 -9
  353. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
  354. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +7 -8
  355. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  356. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +10 -12
  357. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
  358. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +0 -1
  359. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
  360. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +7 -8
  361. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  362. package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +3 -3
  363. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +54 -50
  364. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  365. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +80 -69
  366. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  367. package/dist/components/Payroll/PayrollList/PayrollList.js +20 -18
  368. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  369. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +138 -136
  370. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  371. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +10 -12
  372. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
  373. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +4 -4
  374. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
  375. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  376. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +2 -3
  377. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  378. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +1 -2
  379. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
  380. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +2 -3
  381. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
  382. package/dist/components/Payroll/usePreparedPayrollData.js +8 -9
  383. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  384. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +2 -3
  385. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
  386. package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +4 -4
  387. package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +4 -4
  388. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js +34 -36
  389. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
  390. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +4 -4
  391. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +24 -25
  392. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
  393. package/dist/components/index.d.ts +40 -0
  394. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +6 -0
  395. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +29 -28
  396. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  397. package/dist/contexts/LocaleProvider/useLocale.d.ts +1 -9
  398. package/dist/contexts/LocaleProvider/useLocale.js +5 -15
  399. package/dist/contexts/LocaleProvider/useLocale.js.map +1 -1
  400. package/dist/contexts/NonceProvider/index.d.ts +1 -0
  401. package/dist/contexts/NonceProvider/useNonce.d.ts +37 -0
  402. package/dist/contexts/NonceProvider/useNonce.js +7 -0
  403. package/dist/contexts/NonceProvider/useNonce.js.map +1 -0
  404. package/dist/contexts/ThemeProvider/ThemeProvider.js +25 -24
  405. package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
  406. package/dist/contexts/index.d.ts +1 -0
  407. package/dist/hooks/useDateRangeFilter/useDateRangeFilter.d.ts +12 -7
  408. package/dist/hooks/useDateRangeFilter/useDateRangeFilter.js +25 -21
  409. package/dist/hooks/useDateRangeFilter/useDateRangeFilter.js.map +1 -1
  410. package/dist/i18n/I18n.js +1 -0
  411. package/dist/i18n/I18n.js.map +1 -1
  412. package/dist/i18n/en/Company.StateTaxes.json.js +6 -4
  413. package/dist/i18n/en/Company.StateTaxes.json.js.map +1 -1
  414. package/dist/i18n/en/Contractor.Address.json.js +22 -20
  415. package/dist/i18n/en/Contractor.Address.json.js.map +1 -1
  416. package/dist/i18n/en/Contractor.ContractorList.json.js +14 -12
  417. package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -1
  418. package/dist/i18n/en/Contractor.ManagementContractorList.json.js +60 -0
  419. package/dist/i18n/en/Contractor.ManagementContractorList.json.js.map +1 -0
  420. package/dist/i18n/en/Contractor.Profile.json.js +13 -11
  421. package/dist/i18n/en/Contractor.Profile.json.js.map +1 -1
  422. package/dist/i18n/en/Contractor.SignatureForm.json.js +5 -5
  423. package/dist/i18n/en/Employee.Management.PaymentMethodBankForm.json.js +18 -16
  424. package/dist/i18n/en/Employee.Management.PaymentMethodBankForm.json.js.map +1 -1
  425. package/dist/i18n/en/Employee.Management.PaymentMethodSplitForm.json.js +2 -2
  426. package/dist/i18n/en/Employee.PaymentMethod.json.js +74 -72
  427. package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
  428. package/dist/i18n/en/Employee.SplitPaymentsFormBody.json.js +2 -2
  429. package/dist/i18n/en/Payroll.PayrollHistory.json.js +8 -8
  430. package/dist/i18n/en/Payroll.PayrollList.json.js +23 -23
  431. package/dist/i18n/types.d.ts +215 -17
  432. package/dist/index.d.ts +6 -3
  433. package/dist/index.js +15 -13
  434. package/dist/index.js.map +1 -1
  435. package/dist/models/external.d.ts +4 -0
  436. package/dist/partner-hook-utils/form/SDKFormProvider.js +39 -24
  437. package/dist/partner-hook-utils/form/SDKFormProvider.js.map +1 -1
  438. package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +12 -15
  439. package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
  440. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +16 -19
  441. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
  442. package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +13 -16
  443. package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
  444. package/dist/partner-hook-utils/form/fields/SelectHookField.js +12 -15
  445. package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
  446. package/dist/partner-hook-utils/form/fields/SwitchHookField.js +18 -21
  447. package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
  448. package/dist/partner-hook-utils/form/fields/TextInputHookField.js +9 -12
  449. package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
  450. package/dist/partner-hook-utils/form/preprocessors.d.ts +2 -2
  451. package/dist/partner-hook-utils/form/preprocessors.js +8 -7
  452. package/dist/partner-hook-utils/form/preprocessors.js.map +1 -1
  453. package/dist/partner-hook-utils/form/preprocessors.test.d.ts +1 -0
  454. package/dist/shared/constants.d.ts +12 -0
  455. package/dist/shared/constants.js +23 -17
  456. package/dist/shared/constants.js.map +1 -1
  457. package/dist/style.css +1 -1
  458. package/dist/types/Helpers.d.ts +1 -1
  459. package/docs/guides/endpoint-inventory.json +61 -27
  460. package/package.json +19 -17
  461. package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.js.map +0 -1
  462. package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.d.ts +0 -4
  463. package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.js +0 -5
  464. package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.js.map +0 -1
  465. package/dist/components/Contractor/ContractorList/index.js +0 -150
  466. package/dist/components/Contractor/ContractorList/index.js.map +0 -1
  467. package/dist/components/Contractor/ContractorList/useContractorList.d.ts +0 -18
  468. package/dist/components/Contractor/ContractorList/useContractorList.js +0 -15
  469. package/dist/components/Contractor/ContractorList/useContractorList.js.map +0 -1
  470. /package/dist/components/Company/StateTaxes/{StateTaxesForm/applicableIf.test.d.ts → TaxRateManagement/toHistoryRows.test.d.ts} +0 -0
  471. /package/dist/components/Company/StateTaxes/{StateTaxesForm → shared}/applicableIf.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ManagementCompensationFormBody.js","sources":["../../../../../src/components/Employee/Compensation/management/ManagementCompensationFormBody.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport type { UseJobFormReady } from '../shared/useJobForm'\nimport type { UseCompensationFormReady } from '../shared/useCompensationForm'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\n/** @internal */\nexport interface ManagementCompensationFormBodyProps {\n jobForm: UseJobFormReady\n compensationForm: UseCompensationFormReady\n title: string\n submitCtaLabel: string\n isPending: boolean\n onCancel?: () => void\n}\n\n/**\n * Renders the shared field layout used by both `EditCompensation` (schedule a future comp\n * change for a present job) and `EditPendingCompensation` (update an existing future comp).\n * Field visibility is driven entirely by hook configuration — the hooks expose `undefined`\n * for fields that should not render — so this component renders the correct subset for each\n * use case without extra conditional props.\n *\n * @internal\n */\nexport function ManagementCompensationFormBody({\n jobForm,\n compensationForm,\n title,\n submitCtaLabel,\n isPending,\n onCancel,\n}: ManagementCompensationFormBodyProps) {\n const { t } = useTranslation('Employee.Management.Compensation')\n const Components = useComponentContext()\n const format = useNumberFormatter('currency')\n\n const JobFields = jobForm.form.Fields\n const CompFields = compensationForm.form.Fields\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n <CompFields.Title\n label={t('jobTitleLabel')}\n validationMessages={{ REQUIRED: t('validations.jobTitleSentence') }}\n formHookResult={compensationForm}\n />\n\n {JobFields.HireDate && (\n <JobFields.HireDate\n label={t('hireDateLabel')}\n validationMessages={{\n REQUIRED: t('validations.hireDate'),\n }}\n formHookResult={jobForm}\n />\n )}\n\n {CompFields.FlsaStatus && (\n <>\n <CompFields.FlsaStatus\n label={t('employeeClassification')}\n placeholder={t('flsaStatusPlaceholder')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{ ClassificationLink: <Components.Link /> }}\n />\n }\n validationMessages={{\n REQUIRED: t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n getOptionLabel={(status: FlsaStatusType) => t(`flsaStatusLabels.${status}`)}\n formHookResult={compensationForm}\n />\n {(compensationForm.status.showCommissionFederalMinimumPayAlert ||\n compensationForm.status.showCommissionMinimumWageAlert ||\n compensationForm.status.showOwnerSalaryAlert ||\n compensationForm.status.willDeleteSecondaryJobs) && (\n <Flex flexDirection=\"column\" gap={0}>\n {compensationForm.status.willDeleteSecondaryJobs && (\n <Components.Alert\n label={t('validations.classificationChangeNotification')}\n status=\"warning\"\n >\n {t('validations.classificationChangeRemovesSecondaryJobs')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionFederalMinimumPayAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.federalMinimumPay.label')}\n disableScrollIntoView\n >\n {t('commissionAlerts.federalMinimumPay.body')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionMinimumWageAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.minimumWage.label')}\n disableScrollIntoView\n >\n <Trans\n t={t}\n i18nKey=\"commissionAlerts.minimumWage.body\"\n components={{\n minimumWageLink: (\n <Components.Link\n href=\"https://support.gusto.com/article/112472520100000/manage-tip-wages-distributed-service-charges-and-tip-credits-in-gusto-for-admins\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n </Components.Alert>\n )}\n {compensationForm.status.showOwnerSalaryAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.ownerSalary.label')}\n disableScrollIntoView\n />\n )}\n </Flex>\n )}\n </>\n )}\n\n {CompFields.Rate && (\n <CompFields.Rate\n label={t('wageLabel')}\n validationMessages={{\n REQUIRED: t('validations.rate'),\n RATE_MINIMUM: t('validations.nonZeroRate'),\n RATE_EXEMPT_THRESHOLD: t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.PaymentUnit && (\n <CompFields.PaymentUnit\n label={t('wageFrequencyLabel')}\n placeholder={t('paymentUnitPlaceholder')}\n description={t('paymentUnitDescription')}\n validationMessages={{ REQUIRED: t('validations.paymentUnit') }}\n getOptionLabel={(unit: PaymentUnit) => t(`paymentUnitOptions.${unit}` as const)}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.EffectiveDate && (\n <CompFields.EffectiveDate\n label={t('effectiveDateLabel')}\n validationMessages={{\n REQUIRED: t('validations.effectiveDate'),\n EFFECTIVE_DATE_BEFORE_HIRE: t('validations.effectiveDateBeforeHire'),\n EFFECTIVE_DATE_BEFORE_MIN: t('validations.effectiveDateBeforeMin'),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.AdjustForMinimumWage && (\n <CompFields.AdjustForMinimumWage\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.MinimumWageId && (\n <CompFields.MinimumWageId\n label={t('minimumWageLabel')}\n placeholder={t('minimumWagePlaceholder')}\n description={t('minimumWageDescription')}\n validationMessages={{ REQUIRED: t('validations.minimumWage') }}\n getOptionLabel={(wage: MinimumWage) =>\n `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`\n }\n formHookResult={compensationForm}\n />\n )}\n\n {JobFields.TwoPercentShareholder && (\n <JobFields.TwoPercentShareholder\n label={t('twoPercentShareholderLabel')}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcCovered && (\n <JobFields.StateWcCovered\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n getOptionLabel={(covered: boolean) =>\n covered ? t('stateWcCoveredOptions.yes') : t('stateWcCoveredOptions.no')\n }\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcClassCode && (\n <JobFields.StateWcClassCode\n label={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n placeholder={t('stateWcClassCodeLabel')}\n validationMessages={{ REQUIRED: t('validations.stateWcClassCode') }}\n formHookResult={jobForm}\n />\n )}\n </Flex>\n\n <ActionsLayout>\n {onCancel && (\n <Components.Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {submitCtaLabel}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["ManagementCompensationFormBody","jobForm","compensationForm","title","submitCtaLabel","isPending","onCancel","t","useTranslation","Components","useComponentContext","format","useNumberFormatter","JobFields","CompFields","jsxs","Flex","jsx","Fragment","Trans","FLSA_OVERTIME_SALARY_LIMIT","status","unit","wage","covered","ActionsLayout"],"mappings":";;;;;;;;AA8BO,SAASA,EAA+B;AAAA,EAC7C,SAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AACF,GAAwC;AACtC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kCAAkC,GACzDC,IAAaC,EAAA,GACbC,IAASC,EAAmB,UAAU,GAEtCC,IAAYZ,EAAQ,KAAK,QACzBa,IAAaZ,EAAiB,KAAK;AAEzC,SACE,gBAAAa,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA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,WAAWJ,GACzC,UAAAD,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"ManagementCompensationFormBody.js","sources":["../../../../../src/components/Employee/Compensation/management/ManagementCompensationFormBody.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport type { UseJobFormReady } from '../shared/useJobForm'\nimport type { UseCompensationFormReady } from '../shared/useCompensationForm'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\n/** @internal */\nexport interface ManagementCompensationFormBodyProps {\n jobForm: UseJobFormReady\n compensationForm: UseCompensationFormReady\n title: string\n submitCtaLabel: string\n isPending: boolean\n onCancel?: () => void\n}\n\n/**\n * Renders the shared field layout used by both `EditCompensation` (schedule a future comp\n * change for a present job) and `EditPendingCompensation` (update an existing future comp).\n * Field visibility is driven entirely by hook configuration — the hooks expose `undefined`\n * for fields that should not render — so this component renders the correct subset for each\n * use case without extra conditional props.\n *\n * @internal\n */\nexport function ManagementCompensationFormBody({\n jobForm,\n compensationForm,\n title,\n submitCtaLabel,\n isPending,\n onCancel,\n}: ManagementCompensationFormBodyProps) {\n const { t } = useTranslation('Employee.Management.Compensation')\n const Components = useComponentContext()\n const format = useNumberFormatter('currency')\n\n const JobFields = jobForm.form.Fields\n const CompFields = compensationForm.form.Fields\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n <CompFields.Title\n label={t('jobTitleLabel')}\n validationMessages={{ REQUIRED: t('validations.jobTitleSentence') }}\n formHookResult={compensationForm}\n />\n\n {JobFields.HireDate && (\n <JobFields.HireDate\n label={t('hireDateLabel')}\n validationMessages={{\n REQUIRED: t('validations.hireDate'),\n }}\n formHookResult={jobForm}\n />\n )}\n\n {CompFields.FlsaStatus && (\n <>\n <CompFields.FlsaStatus\n label={t('employeeClassification')}\n placeholder={t('flsaStatusPlaceholder')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{ ClassificationLink: <Components.Link /> }}\n />\n }\n validationMessages={{\n REQUIRED: t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n getOptionLabel={(status: FlsaStatusType) => t(`flsaStatusLabels.${status}`)}\n formHookResult={compensationForm}\n />\n {(compensationForm.status.showCommissionFederalMinimumPayAlert ||\n compensationForm.status.showCommissionMinimumWageAlert ||\n compensationForm.status.showOwnerSalaryAlert ||\n compensationForm.status.willDeleteSecondaryJobs) && (\n <Flex flexDirection=\"column\" gap={0}>\n {compensationForm.status.willDeleteSecondaryJobs && (\n <Components.Alert\n label={t('validations.classificationChangeNotification')}\n status=\"warning\"\n >\n {t('validations.classificationChangeRemovesSecondaryJobs')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionFederalMinimumPayAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.federalMinimumPay.label')}\n disableScrollIntoView\n >\n {t('commissionAlerts.federalMinimumPay.body')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionMinimumWageAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.minimumWage.label')}\n disableScrollIntoView\n >\n <Trans\n t={t}\n i18nKey=\"commissionAlerts.minimumWage.body\"\n components={{\n minimumWageLink: (\n <Components.Link\n href=\"https://support.gusto.com/article/112472520100000/manage-tip-wages-distributed-service-charges-and-tip-credits-in-gusto-for-admins\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n </Components.Alert>\n )}\n {compensationForm.status.showOwnerSalaryAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.ownerSalary.label')}\n disableScrollIntoView\n />\n )}\n </Flex>\n )}\n </>\n )}\n\n {CompFields.Rate && (\n <CompFields.Rate\n label={t('wageLabel')}\n validationMessages={{\n REQUIRED: t('validations.rate'),\n RATE_MINIMUM: t('validations.nonZeroRate'),\n RATE_EXEMPT_THRESHOLD: t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.PaymentUnit && (\n <CompFields.PaymentUnit\n label={t('wageFrequencyLabel')}\n placeholder={t('paymentUnitPlaceholder')}\n description={t('paymentUnitDescription')}\n validationMessages={{ REQUIRED: t('validations.paymentUnit') }}\n getOptionLabel={(unit: PaymentUnit) => t(`paymentUnitOptions.${unit}` as const)}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.EffectiveDate && (\n <CompFields.EffectiveDate\n label={t('effectiveDateLabel')}\n validationMessages={{\n REQUIRED: t('validations.effectiveDate'),\n EFFECTIVE_DATE_BEFORE_HIRE: t('validations.effectiveDateBeforeHire'),\n EFFECTIVE_DATE_BEFORE_MIN: t('validations.effectiveDateBeforeMin'),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.AdjustForMinimumWage && (\n <CompFields.AdjustForMinimumWage\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.MinimumWageId && (\n <CompFields.MinimumWageId\n label={t('minimumWageLabel')}\n placeholder={t('minimumWagePlaceholder')}\n description={t('minimumWageDescription')}\n validationMessages={{ REQUIRED: t('validations.minimumWage') }}\n getOptionLabel={(wage: MinimumWage) =>\n `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`\n }\n formHookResult={compensationForm}\n />\n )}\n\n {JobFields.TwoPercentShareholder && (\n <JobFields.TwoPercentShareholder\n label={t('twoPercentShareholderLabel')}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcCovered && (\n <JobFields.StateWcCovered\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n getOptionLabel={(covered: boolean) =>\n covered ? t('stateWcCoveredOptions.yes') : t('stateWcCoveredOptions.no')\n }\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcClassCode && (\n <JobFields.StateWcClassCode\n label={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n placeholder={t('stateWcClassCodeLabel')}\n validationMessages={{ REQUIRED: t('validations.stateWcClassCode') }}\n formHookResult={jobForm}\n />\n )}\n </Flex>\n\n <ActionsLayout>\n {onCancel && (\n <Components.Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {submitCtaLabel}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["ManagementCompensationFormBody","jobForm","compensationForm","title","submitCtaLabel","isPending","onCancel","t","useTranslation","Components","useComponentContext","format","useNumberFormatter","JobFields","CompFields","jsxs","Flex","jsx","Fragment","Trans","FLSA_OVERTIME_SALARY_LIMIT","status","unit","wage","covered","ActionsLayout"],"mappings":";;;;;;;AA8BO,SAASA,EAA+B;AAAA,EAC7C,SAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AACF,GAAwC;AACtC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kCAAkC,GACzDC,IAAaC,EAAA,GACbC,IAASC,EAAmB,UAA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,EAAkB,SAAQ,aAAY,SAASH,GAAU,YAAYD,GACnE,UAAAE,EAAE,WAAW,EAAA,CAChB;AAAA,MAEF,gBAAAU,EAACR,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWJ,GACzC,UAAAD,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
@@ -3,11 +3,10 @@ import { useTranslation as R, Trans as d } from "react-i18next";
3
3
  import { Flex as c } from "../../../Common/Flex/Flex.js";
4
4
  import { ActionsLayout as v } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
5
  import { useComponentContext as C } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- import "react";
7
6
  import { FLSA_OVERTIME_SALARY_LIMIT as p } from "../../../../shared/constants.js";
8
7
  import y from "../../../../hooks/useNumberFormatter.js";
9
8
  import { useI18n as D, useComponentDictionary as M } from "../../../../i18n/I18n.js";
10
- function U({
9
+ function H({
11
10
  jobForm: n,
12
11
  compensationForm: i,
13
12
  title: g,
@@ -219,6 +218,6 @@ function U({
219
218
  ] });
220
219
  }
221
220
  export {
222
- U as AddCompensationFormBody
221
+ H as AddCompensationFormBody
223
222
  };
224
223
  //# sourceMappingURL=AddCompensationFormBody.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AddCompensationFormBody.js","sources":["../../../../../src/components/Employee/Compensation/shared/AddCompensationFormBody.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport type { UseJobFormReady } from './useJobForm'\nimport type { UseCompensationFormReady } from './useCompensationForm'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\n\n/**\n * Translation overrides for the shared add-compensation form body. The body\n * reads its copy from the onboarding `Employee.Compensation` namespace by\n * default; management surfaces resolve this dictionary from\n * `Employee.Management.Compensation` and pass it in so management copy renders\n * while the two surfaces stay isolated.\n *\n * @internal\n */\nexport type AddCompensationFormDictionary = ResourceDictionary<'Employee.Compensation'>\n\n/** @internal */\nexport interface AddCompensationFormBodyProps {\n jobForm: UseJobFormReady\n compensationForm: UseCompensationFormReady\n title: string\n submitCtaLabel: string\n isPending: boolean\n onCancel?: () => void\n /** Per-surface translation overrides resolved against the consumer's namespace. */\n dictionary?: AddCompensationFormDictionary\n}\n\n/**\n * Renders the shared field layout used by both `EditCompensation` (onboarding) and\n * `CompensationAddAnotherJobForm` (management). Field visibility is driven entirely by the hook\n * configuration — `JobFields.HireDate` is only defined when `withHireDateField: true`,\n * and `CompFields.EffectiveDate` is only defined when `withEffectiveDateField: true` —\n * so this component renders the correct subset for each use case with no extra props.\n *\n * Copy resolves from the onboarding `Employee.Compensation` namespace by default; management\n * consumers inject a `dictionary` mapped from `Employee.Management.Compensation` to keep\n * onboarding and management strings independently overridable.\n *\n * @internal\n */\nexport function AddCompensationFormBody({\n jobForm,\n compensationForm,\n title,\n submitCtaLabel,\n isPending,\n onCancel,\n dictionary,\n}: AddCompensationFormBodyProps) {\n useI18n('Employee.Compensation')\n useComponentDictionary('Employee.Compensation', dictionary)\n const { t } = useTranslation('Employee.Compensation')\n const Components = useComponentContext()\n const format = useNumberFormatter('currency')\n\n const JobFields = jobForm.form.Fields\n const CompFields = compensationForm.form.Fields\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n {JobFields.Title && (\n <JobFields.Title\n label={t('jobTitle')}\n validationMessages={{ REQUIRED: t('validations.title') }}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.HireDate && (\n <JobFields.HireDate\n label={t('hireDate')}\n validationMessages={{ REQUIRED: t('validations.hireDate') }}\n formHookResult={jobForm}\n />\n )}\n\n {CompFields.FlsaStatus && (\n <>\n <CompFields.FlsaStatus\n label={t('employeeClassification')}\n placeholder={t('flsaStatusPlaceholder')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{ ClassificationLink: <Components.Link /> }}\n />\n }\n validationMessages={{\n REQUIRED: t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n getOptionLabel={(status: FlsaStatusType) => t(`flsaStatusLabels.${status}`)}\n formHookResult={compensationForm}\n />\n {(compensationForm.status.showCommissionFederalMinimumPayAlert ||\n compensationForm.status.showCommissionMinimumWageAlert ||\n compensationForm.status.showOwnerSalaryAlert ||\n compensationForm.status.willDeleteSecondaryJobs) && (\n <Flex flexDirection=\"column\" gap={0}>\n {compensationForm.status.willDeleteSecondaryJobs && (\n <Components.Alert\n label={t('validations.classificationChangeNotification')}\n status=\"warning\"\n >\n {t('validations.classificationChangeRemovesSecondaryJobs')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionFederalMinimumPayAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.federalMinimumPay.label')}\n disableScrollIntoView\n >\n {t('commissionAlerts.federalMinimumPay.body')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionMinimumWageAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.minimumWage.label')}\n disableScrollIntoView\n >\n <Trans\n t={t}\n i18nKey=\"commissionAlerts.minimumWage.body\"\n components={{\n minimumWageLink: (\n <Components.Link\n href=\"https://support.gusto.com/article/112472520100000/manage-tip-wages-distributed-service-charges-and-tip-credits-in-gusto-for-admins\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n </Components.Alert>\n )}\n {compensationForm.status.showOwnerSalaryAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.ownerSalary.label')}\n disableScrollIntoView\n />\n )}\n </Flex>\n )}\n </>\n )}\n\n {CompFields.Rate && (\n <CompFields.Rate\n label={t('wageLabel')}\n validationMessages={{\n REQUIRED: t('validations.rate'),\n RATE_MINIMUM: t('validations.nonZeroRate'),\n RATE_EXEMPT_THRESHOLD: t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.PaymentUnit && (\n <CompFields.PaymentUnit\n label={t('wageFrequencyLabel')}\n placeholder={t('paymentUnitPlaceholder')}\n description={t('paymentUnitDescription')}\n validationMessages={{ REQUIRED: t('validations.paymentUnit') }}\n getOptionLabel={(unit: PaymentUnit) => t(`paymentUnitOptions.${unit}`)}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.AdjustForMinimumWage && (\n <CompFields.AdjustForMinimumWage\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.MinimumWageId && (\n <CompFields.MinimumWageId\n label={t('minimumWageLabel')}\n placeholder={t('minimumWagePlaceholder')}\n description={t('minimumWageDescription')}\n validationMessages={{ REQUIRED: t('validations.minimumWage') }}\n getOptionLabel={(wage: MinimumWage) =>\n `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`\n }\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.EffectiveDate && (\n <CompFields.EffectiveDate\n label={t('effectiveDate')}\n validationMessages={{\n REQUIRED: t('validations.effectiveDate'),\n EFFECTIVE_DATE_BEFORE_HIRE: t('validations.effectiveDateBeforeHire'),\n EFFECTIVE_DATE_BEFORE_MIN: t('validations.effectiveDateBeforeMin'),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {JobFields.TwoPercentShareholder && (\n <JobFields.TwoPercentShareholder\n label={t('twoPercentStakeholderLabel')}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcCovered && (\n <JobFields.StateWcCovered\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n getOptionLabel={(covered: boolean) =>\n covered ? t('stateWcCoveredOptions.yes') : t('stateWcCoveredOptions.no')\n }\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcClassCode && (\n <JobFields.StateWcClassCode\n label={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n placeholder={t('stateWcClassCodeLabel')}\n validationMessages={{ REQUIRED: t('validations.stateWcClassCode') }}\n formHookResult={jobForm}\n />\n )}\n </Flex>\n\n <ActionsLayout>\n {onCancel && (\n <Components.Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelNewJobCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {submitCtaLabel}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["AddCompensationFormBody","jobForm","compensationForm","title","submitCtaLabel","isPending","onCancel","dictionary","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","format","useNumberFormatter","JobFields","CompFields","jsxs","Flex","jsx","Fragment","Trans","FLSA_OVERTIME_SALARY_LIMIT","status","unit","wage","covered","ActionsLayout"],"mappings":";;;;;;;;;AAiDO,SAASA,EAAwB;AAAA,EACtC,SAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,GAAiC;AAC/B,EAAAC,EAAQ,uBAAuB,GAC/BC,EAAuB,yBAAyBF,CAAU;AAC1D,QAAM,EAAE,GAAAG,EAAA,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BAEC2B,GAAA,EACE,UAAA;AAAA,MAAAtB,KACC,gBAAAc,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASN,GAAU,YAAYD,GACnE,UAAAK,EAAE,iBAAiB,EAAA,CACtB;AAAA,MAEF,gBAAAU,EAACR,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWP,GACzC,UAAAD,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"AddCompensationFormBody.js","sources":["../../../../../src/components/Employee/Compensation/shared/AddCompensationFormBody.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport type { UseJobFormReady } from './useJobForm'\nimport type { UseCompensationFormReady } from './useCompensationForm'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\n\n/**\n * Translation overrides for the shared add-compensation form body. The body\n * reads its copy from the onboarding `Employee.Compensation` namespace by\n * default; management surfaces resolve this dictionary from\n * `Employee.Management.Compensation` and pass it in so management copy renders\n * while the two surfaces stay isolated.\n *\n * @internal\n */\nexport type AddCompensationFormDictionary = ResourceDictionary<'Employee.Compensation'>\n\n/** @internal */\nexport interface AddCompensationFormBodyProps {\n jobForm: UseJobFormReady\n compensationForm: UseCompensationFormReady\n title: string\n submitCtaLabel: string\n isPending: boolean\n onCancel?: () => void\n /** Per-surface translation overrides resolved against the consumer's namespace. */\n dictionary?: AddCompensationFormDictionary\n}\n\n/**\n * Renders the shared field layout used by both `EditCompensation` (onboarding) and\n * `CompensationAddAnotherJobForm` (management). Field visibility is driven entirely by the hook\n * configuration — `JobFields.HireDate` is only defined when `withHireDateField: true`,\n * and `CompFields.EffectiveDate` is only defined when `withEffectiveDateField: true` —\n * so this component renders the correct subset for each use case with no extra props.\n *\n * Copy resolves from the onboarding `Employee.Compensation` namespace by default; management\n * consumers inject a `dictionary` mapped from `Employee.Management.Compensation` to keep\n * onboarding and management strings independently overridable.\n *\n * @internal\n */\nexport function AddCompensationFormBody({\n jobForm,\n compensationForm,\n title,\n submitCtaLabel,\n isPending,\n onCancel,\n dictionary,\n}: AddCompensationFormBodyProps) {\n useI18n('Employee.Compensation')\n useComponentDictionary('Employee.Compensation', dictionary)\n const { t } = useTranslation('Employee.Compensation')\n const Components = useComponentContext()\n const format = useNumberFormatter('currency')\n\n const JobFields = jobForm.form.Fields\n const CompFields = compensationForm.form.Fields\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n {JobFields.Title && (\n <JobFields.Title\n label={t('jobTitle')}\n validationMessages={{ REQUIRED: t('validations.title') }}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.HireDate && (\n <JobFields.HireDate\n label={t('hireDate')}\n validationMessages={{ REQUIRED: t('validations.hireDate') }}\n formHookResult={jobForm}\n />\n )}\n\n {CompFields.FlsaStatus && (\n <>\n <CompFields.FlsaStatus\n label={t('employeeClassification')}\n placeholder={t('flsaStatusPlaceholder')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{ ClassificationLink: <Components.Link /> }}\n />\n }\n validationMessages={{\n REQUIRED: t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n getOptionLabel={(status: FlsaStatusType) => t(`flsaStatusLabels.${status}`)}\n formHookResult={compensationForm}\n />\n {(compensationForm.status.showCommissionFederalMinimumPayAlert ||\n compensationForm.status.showCommissionMinimumWageAlert ||\n compensationForm.status.showOwnerSalaryAlert ||\n compensationForm.status.willDeleteSecondaryJobs) && (\n <Flex flexDirection=\"column\" gap={0}>\n {compensationForm.status.willDeleteSecondaryJobs && (\n <Components.Alert\n label={t('validations.classificationChangeNotification')}\n status=\"warning\"\n >\n {t('validations.classificationChangeRemovesSecondaryJobs')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionFederalMinimumPayAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.federalMinimumPay.label')}\n disableScrollIntoView\n >\n {t('commissionAlerts.federalMinimumPay.body')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionMinimumWageAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.minimumWage.label')}\n disableScrollIntoView\n >\n <Trans\n t={t}\n i18nKey=\"commissionAlerts.minimumWage.body\"\n components={{\n minimumWageLink: (\n <Components.Link\n href=\"https://support.gusto.com/article/112472520100000/manage-tip-wages-distributed-service-charges-and-tip-credits-in-gusto-for-admins\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n </Components.Alert>\n )}\n {compensationForm.status.showOwnerSalaryAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.ownerSalary.label')}\n disableScrollIntoView\n />\n )}\n </Flex>\n )}\n </>\n )}\n\n {CompFields.Rate && (\n <CompFields.Rate\n label={t('wageLabel')}\n validationMessages={{\n REQUIRED: t('validations.rate'),\n RATE_MINIMUM: t('validations.nonZeroRate'),\n RATE_EXEMPT_THRESHOLD: t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.PaymentUnit && (\n <CompFields.PaymentUnit\n label={t('wageFrequencyLabel')}\n placeholder={t('paymentUnitPlaceholder')}\n description={t('paymentUnitDescription')}\n validationMessages={{ REQUIRED: t('validations.paymentUnit') }}\n getOptionLabel={(unit: PaymentUnit) => t(`paymentUnitOptions.${unit}`)}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.AdjustForMinimumWage && (\n <CompFields.AdjustForMinimumWage\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.MinimumWageId && (\n <CompFields.MinimumWageId\n label={t('minimumWageLabel')}\n placeholder={t('minimumWagePlaceholder')}\n description={t('minimumWageDescription')}\n validationMessages={{ REQUIRED: t('validations.minimumWage') }}\n getOptionLabel={(wage: MinimumWage) =>\n `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`\n }\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.EffectiveDate && (\n <CompFields.EffectiveDate\n label={t('effectiveDate')}\n validationMessages={{\n REQUIRED: t('validations.effectiveDate'),\n EFFECTIVE_DATE_BEFORE_HIRE: t('validations.effectiveDateBeforeHire'),\n EFFECTIVE_DATE_BEFORE_MIN: t('validations.effectiveDateBeforeMin'),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {JobFields.TwoPercentShareholder && (\n <JobFields.TwoPercentShareholder\n label={t('twoPercentStakeholderLabel')}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcCovered && (\n <JobFields.StateWcCovered\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n getOptionLabel={(covered: boolean) =>\n covered ? t('stateWcCoveredOptions.yes') : t('stateWcCoveredOptions.no')\n }\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcClassCode && (\n <JobFields.StateWcClassCode\n label={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n placeholder={t('stateWcClassCodeLabel')}\n validationMessages={{ REQUIRED: t('validations.stateWcClassCode') }}\n formHookResult={jobForm}\n />\n )}\n </Flex>\n\n <ActionsLayout>\n {onCancel && (\n <Components.Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelNewJobCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {submitCtaLabel}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["AddCompensationFormBody","jobForm","compensationForm","title","submitCtaLabel","isPending","onCancel","dictionary","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","format","useNumberFormatter","JobFields","CompFields","jsxs","Flex","jsx","Fragment","Trans","FLSA_OVERTIME_SALARY_LIMIT","status","unit","wage","covered","ActionsLayout"],"mappings":";;;;;;;;AAiDO,SAASA,EAAwB;AAAA,EACtC,SAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,GAAiC;AAC/B,EAAAC,EAAQ,uBAAuB,GAC/BC,EAAuB,yBAAyBF,CAAU;AAC1D,QAAM,EAAE,GAAAG,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAAaC,EAAA,GACbC,IAASC,EAAmB,UAAU,GAEtCC,IAAYf,EAAQ,KAAK,QACzBgB,IAAaf,EAAiB,KAAK;AAEzC,SACE,gBAAAgB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC,EAACR,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAT,GAAM;AAAA,IAEnC,gBAAAe,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,MAAAH,EAAU,SACT,gBAAAI;AAAA,QAACJ,EAAU;AAAA,QAAV;AAAA,UACC,OAAON,EAAE,UAAU;AAAA,UACnB,oBAAoB,EAAE,UAAUA,EAAE,mBAAmB,EAAA;AAAA,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A,QAACJ,EAAU;AAAA,QAAV;AAAA,UACC,OAAON,EAAE,qBAAqB;AAAA,UAC9B,aACE,gBAAAU;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,GAAAZ;AAAA,cACA,SAAQ;AAAA,cACR,YAAY;AAAA,gBACV,QACE,gBAAAU;AAAA,kBAACR,EAAW;AAAA,kBAAX;AAAA,oBACC,MAAK;AAAA,oBACL,QAAO;AAAA,oBACP,KAAI;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACN;AAAA,YAEJ;AAAA,UAAA;AAAA,UAGJ,gBAAgB,CAACe,MACLjB,EAAViB,IAAY,8BAAiC,0BAAN;AAAA,UAEzC,gBAAgB1B;AAAA,QAAA;AAAA,MAAA;AAAA,MAInBe,EAAU,oBACT,gBAAAI;AAAA,QAACJ,EAAU;AAAA,QAAV;AAAA,UACC,OAAON,EAAE,uBAAuB;AAAA,UAChC,aAAaA,EAAE,6BAA6B;AAAA,UAC5C,aAAaA,EAAE,uBAAuB;AAAA,UACtC,oBAAoB,EAAE,UAAUA,EAAE,8BAA8B,EAAA;AAAA,UAChE,gBAAgBT;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB,GAEJ;AAAA,sBAEC2B,GAAA,EACE,UAAA;AAAA,MAAAtB,KACC,gBAAAc,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASN,GAAU,YAAYD,GACnE,UAAAK,EAAE,iBAAiB,EAAA,CACtB;AAAA,MAEF,gBAAAU,EAACR,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWP,GACzC,UAAAD,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
@@ -4,17 +4,16 @@ import { useChildSupportGarnishmentForm as b } from "../useChildSupportGarnishme
4
4
  import { Form as g } from "../../../../Common/Form/Form.js";
5
5
  import { Flex as d } from "../../../../Common/Flex/Flex.js";
6
6
  import { ActionsLayout as R } from "../../../../Common/ActionsLayout/ActionsLayout.js";
7
- import { useComponentContext as P } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
8
- import "react";
9
7
  import { BaseLayout as h } from "../../../../Base/Base.js";
10
- import { SDKFormProvider as f } from "../../../../../partner-hook-utils/form/SDKFormProvider.js";
11
- function F({
8
+ import { SDKFormProvider as P } from "../../../../../partner-hook-utils/form/SDKFormProvider.js";
9
+ import { useComponentContext as f } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
10
+ function O({
12
11
  employeeId: n,
13
12
  deduction: a,
14
13
  onSaved: s,
15
14
  onCancel: p
16
15
  }) {
17
- const { t: e } = S("Employee.DeductionsForm"), c = P(), t = b({
16
+ const { t: e } = S("Employee.DeductionsForm"), c = f(), t = b({
18
17
  employeeId: n,
19
18
  garnishmentId: a?.uuid
20
19
  });
@@ -24,7 +23,7 @@ function F({
24
23
  const o = await t.actions.onSubmit();
25
24
  o && s(o.data, o.mode);
26
25
  };
27
- return /* @__PURE__ */ r(h, { error: t.errorHandling.errors, children: /* @__PURE__ */ r(f, { formHookResult: t, children: /* @__PURE__ */ r(g, { onSubmit: y, children: /* @__PURE__ */ l(d, { flexDirection: "column", gap: 32, children: [
26
+ return /* @__PURE__ */ r(h, { error: t.errorHandling.errors, children: /* @__PURE__ */ r(P, { formHookResult: t, children: /* @__PURE__ */ r(g, { onSubmit: y, children: /* @__PURE__ */ l(d, { flexDirection: "column", gap: 32, children: [
28
27
  /* @__PURE__ */ r(c.Heading, { as: "h3", children: e("types.childSupport") }),
29
28
  /* @__PURE__ */ l(d, { flexDirection: "column", gap: 20, children: [
30
29
  /* @__PURE__ */ r(
@@ -142,6 +141,6 @@ function E(n, a) {
142
141
  }
143
142
  }
144
143
  export {
145
- F as ChildSupportFormView
144
+ O as ChildSupportFormView
146
145
  };
147
146
  //# sourceMappingURL=ChildSupportFormView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChildSupportFormView.js","sources":["../../../../../../src/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport type { PaymentPeriod } from '@gusto/embedded-api/models/components/garnishmentchildsupport'\nimport { useChildSupportGarnishmentForm } from '../useChildSupportGarnishmentForm'\nimport type { StateFieldEntry, CountyEntry } from '../useChildSupportGarnishmentForm'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { BaseLayout } from '@/components/Base/Base'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface ChildSupportFormViewProps {\n employeeId: string\n deduction: Garnishment | null\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n onCancel: () => void\n}\n\n/** @internal */\nexport function ChildSupportFormView({\n employeeId,\n deduction,\n onSaved,\n onCancel,\n}: ChildSupportFormViewProps) {\n const { t } = useTranslation('Employee.DeductionsForm')\n const Components = useComponentContext()\n\n const form = useChildSupportGarnishmentForm({\n employeeId,\n garnishmentId: deduction?.uuid,\n })\n\n if (form.isLoading) {\n return <BaseLayout isLoading error={form.errorHandling.errors} />\n }\n\n const { Fields } = form.form\n const hasSelection = form.status.selectedAgency !== null\n\n const handleSubmit = async () => {\n const result = await form.actions.onSubmit()\n if (result) onSaved(result.data, result.mode)\n }\n\n return (\n <BaseLayout error={form.errorHandling.errors}>\n <SDKFormProvider formHookResult={form}>\n <Form onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h3\">{t('types.childSupport')}</Components.Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.State\n label={t('childSupport.agencyLabel')}\n placeholder={t('childSupport.agencyPlaceholder')}\n description={t('childSupport.agencyDescription')}\n getOptionLabel={(entry: StateFieldEntry) => entry.name}\n validationMessages={{ REQUIRED: t('childSupport.agencyRequired') }}\n />\n\n {form.status.isManualPaymentRequired && (\n <Components.Alert\n status=\"warning\"\n label={t('childSupport.manualPaymentRequired')}\n />\n )}\n\n {hasSelection && (\n <Flex flexDirection=\"column\" gap={20}>\n {Fields.FipsCode && (\n <Fields.FipsCode\n label={t('childSupport.countyLabel')}\n placeholder={t('childSupport.countyPlaceholder')}\n description={t('childSupport.countyDescription')}\n getOptionLabel={(entry: CountyEntry) =>\n entry.county ?? t('childSupport.allCounties')\n }\n validationMessages={{ REQUIRED: t('childSupport.countyRequired') }}\n />\n )}\n {Fields.CaseNumber && (\n <Fields.CaseNumber\n label={requiredAttrLabel(form.status.selectedAgency, 'case_number')}\n description={t('childSupport.caseNumberDescription')}\n validationMessages={{ REQUIRED: t('childSupport.caseNumberRequired') }}\n />\n )}\n {Fields.OrderNumber && (\n <Fields.OrderNumber\n label={requiredAttrLabel(form.status.selectedAgency, 'order_number')}\n description={t('childSupport.orderNumberDescription')}\n validationMessages={{ REQUIRED: t('childSupport.orderNumberRequired') }}\n />\n )}\n {Fields.RemittanceNumber && (\n <Fields.RemittanceNumber\n label={requiredAttrLabel(form.status.selectedAgency, 'remittance_number')}\n description={t('childSupport.remittanceNumberDescription')}\n validationMessages={{\n REQUIRED: t('childSupport.remittanceNumberRequired'),\n }}\n />\n )}\n <Fields.PayPeriodMaximum\n label={t('childSupport.totalAmountWithheld')}\n description={t('childSupport.totalAmountWithheldDescription')}\n format=\"currency\"\n min={0}\n validationMessages={{\n REQUIRED: t('childSupport.payPeriodMaximumRequired'),\n NEGATIVE_AMOUNT: t('childSupport.amountNonNegative'),\n }}\n />\n <Fields.Amount\n label={t('childSupport.maxPaycheckPercentage')}\n description={t('childSupport.maxPaycheckPercentageDescription')}\n format=\"percent\"\n min={0}\n max={100}\n validationMessages={{\n REQUIRED: t('childSupport.amountRequired'),\n PERCENT_OUT_OF_RANGE: t('childSupport.percentOutOfRange'),\n }}\n />\n <Fields.PaymentPeriod\n label={t('childSupport.paymentPeriodLabel')}\n placeholder={t('childSupport.paymentPeriodPlaceholder')}\n description={t('childSupport.paymentPeriodDescription')}\n getOptionLabel={(value: PaymentPeriod) => paymentPeriodLabel(t, value)}\n validationMessages={{ REQUIRED: t('childSupport.paymentPeriodRequired') }}\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onCancel}>\n {t('actions.cancel')}\n </Components.Button>\n {hasSelection && (\n <Components.Button type=\"submit\" isLoading={form.status.isPending}>\n {t('actions.save')}\n </Components.Button>\n )}\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n )\n}\n\nfunction requiredAttrLabel(\n selectedAgency: { requiredAttributes?: Array<{ key?: string; label?: string }> } | null,\n key: 'case_number' | 'order_number' | 'remittance_number',\n): string {\n const match = selectedAgency?.requiredAttributes?.find(a => a.key === key)\n return match?.label ?? key\n}\n\nfunction paymentPeriodLabel(\n t: ReturnType<typeof useTranslation<'Employee.DeductionsForm'>>['t'],\n value: PaymentPeriod,\n): string {\n switch (value) {\n case 'Every week':\n return t('childSupport.paymentPeriod.everyWeek')\n case 'Every other week':\n return t('childSupport.paymentPeriod.everyOtherWeek')\n case 'Twice per month':\n return t('childSupport.paymentPeriod.twicePerMonth')\n case 'Monthly':\n return t('childSupport.paymentPeriod.monthly')\n }\n}\n"],"names":["ChildSupportFormView","employeeId","deduction","onSaved","onCancel","t","useTranslation","Components","useComponentContext","form","useChildSupportGarnishmentForm","BaseLayout","Fields","hasSelection","handleSubmit","result","SDKFormProvider","jsx","Form","jsxs","Flex","entry","requiredAttrLabel","value","paymentPeriodLabel","ActionsLayout","selectedAgency","key","a"],"mappings":";;;;;;;;;;AAoBO,SAASA,EAAqB;AAAA,EACnC,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAA8B;AAC5B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChDC,IAAaC,EAAA,GAEbC,IAAOC,EAA+B;AAAA,IA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A,EAAE,2CAA2C;AAAA,IACtD,KAAK;AACH,aAAOA,EAAE,0CAA0C;AAAA,IACrD,KAAK;AACH,aAAOA,EAAE,oCAAoC;AAAA,EAAA;AAEnD;"}
1
+ {"version":3,"file":"ChildSupportFormView.js","sources":["../../../../../../src/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport type { PaymentPeriod } from '@gusto/embedded-api/models/components/garnishmentchildsupport'\nimport { useChildSupportGarnishmentForm } from '../useChildSupportGarnishmentForm'\nimport type { StateFieldEntry, CountyEntry } from '../useChildSupportGarnishmentForm'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { BaseLayout } from '@/components/Base/Base'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface ChildSupportFormViewProps {\n employeeId: string\n deduction: Garnishment | null\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n onCancel: () => void\n}\n\n/** @internal */\nexport function ChildSupportFormView({\n employeeId,\n deduction,\n onSaved,\n onCancel,\n}: ChildSupportFormViewProps) {\n const { t } = useTranslation('Employee.DeductionsForm')\n const Components = useComponentContext()\n\n const form = useChildSupportGarnishmentForm({\n employeeId,\n garnishmentId: deduction?.uuid,\n })\n\n if (form.isLoading) {\n return <BaseLayout isLoading error={form.errorHandling.errors} />\n }\n\n const { Fields } = form.form\n const hasSelection = form.status.selectedAgency !== null\n\n const handleSubmit = async () => {\n const result = await form.actions.onSubmit()\n if (result) onSaved(result.data, result.mode)\n }\n\n return (\n <BaseLayout error={form.errorHandling.errors}>\n <SDKFormProvider formHookResult={form}>\n <Form onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h3\">{t('types.childSupport')}</Components.Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.State\n label={t('childSupport.agencyLabel')}\n placeholder={t('childSupport.agencyPlaceholder')}\n description={t('childSupport.agencyDescription')}\n getOptionLabel={(entry: StateFieldEntry) => entry.name}\n validationMessages={{ REQUIRED: t('childSupport.agencyRequired') }}\n />\n\n {form.status.isManualPaymentRequired && (\n <Components.Alert\n status=\"warning\"\n label={t('childSupport.manualPaymentRequired')}\n />\n )}\n\n {hasSelection && (\n <Flex flexDirection=\"column\" gap={20}>\n {Fields.FipsCode && (\n <Fields.FipsCode\n label={t('childSupport.countyLabel')}\n placeholder={t('childSupport.countyPlaceholder')}\n description={t('childSupport.countyDescription')}\n getOptionLabel={(entry: CountyEntry) =>\n entry.county ?? t('childSupport.allCounties')\n }\n validationMessages={{ REQUIRED: t('childSupport.countyRequired') }}\n />\n )}\n {Fields.CaseNumber && (\n <Fields.CaseNumber\n label={requiredAttrLabel(form.status.selectedAgency, 'case_number')}\n description={t('childSupport.caseNumberDescription')}\n validationMessages={{ REQUIRED: t('childSupport.caseNumberRequired') }}\n />\n )}\n {Fields.OrderNumber && (\n <Fields.OrderNumber\n label={requiredAttrLabel(form.status.selectedAgency, 'order_number')}\n description={t('childSupport.orderNumberDescription')}\n validationMessages={{ REQUIRED: t('childSupport.orderNumberRequired') }}\n />\n )}\n {Fields.RemittanceNumber && (\n <Fields.RemittanceNumber\n label={requiredAttrLabel(form.status.selectedAgency, 'remittance_number')}\n description={t('childSupport.remittanceNumberDescription')}\n validationMessages={{\n REQUIRED: t('childSupport.remittanceNumberRequired'),\n }}\n />\n )}\n <Fields.PayPeriodMaximum\n label={t('childSupport.totalAmountWithheld')}\n description={t('childSupport.totalAmountWithheldDescription')}\n format=\"currency\"\n min={0}\n validationMessages={{\n REQUIRED: t('childSupport.payPeriodMaximumRequired'),\n NEGATIVE_AMOUNT: t('childSupport.amountNonNegative'),\n }}\n />\n <Fields.Amount\n label={t('childSupport.maxPaycheckPercentage')}\n description={t('childSupport.maxPaycheckPercentageDescription')}\n format=\"percent\"\n min={0}\n max={100}\n validationMessages={{\n REQUIRED: t('childSupport.amountRequired'),\n PERCENT_OUT_OF_RANGE: t('childSupport.percentOutOfRange'),\n }}\n />\n <Fields.PaymentPeriod\n label={t('childSupport.paymentPeriodLabel')}\n placeholder={t('childSupport.paymentPeriodPlaceholder')}\n description={t('childSupport.paymentPeriodDescription')}\n getOptionLabel={(value: PaymentPeriod) => paymentPeriodLabel(t, value)}\n validationMessages={{ REQUIRED: t('childSupport.paymentPeriodRequired') }}\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onCancel}>\n {t('actions.cancel')}\n </Components.Button>\n {hasSelection && (\n <Components.Button type=\"submit\" isLoading={form.status.isPending}>\n {t('actions.save')}\n </Components.Button>\n )}\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n )\n}\n\nfunction requiredAttrLabel(\n selectedAgency: { requiredAttributes?: Array<{ key?: string; label?: string }> } | null,\n key: 'case_number' | 'order_number' | 'remittance_number',\n): string {\n const match = selectedAgency?.requiredAttributes?.find(a => a.key === key)\n return match?.label ?? key\n}\n\nfunction paymentPeriodLabel(\n t: ReturnType<typeof useTranslation<'Employee.DeductionsForm'>>['t'],\n value: PaymentPeriod,\n): string {\n switch (value) {\n case 'Every week':\n return t('childSupport.paymentPeriod.everyWeek')\n case 'Every other week':\n return t('childSupport.paymentPeriod.everyOtherWeek')\n case 'Twice per month':\n return t('childSupport.paymentPeriod.twicePerMonth')\n case 'Monthly':\n return t('childSupport.paymentPeriod.monthly')\n }\n}\n"],"names":["ChildSupportFormView","employeeId","deduction","onSaved","onCancel","t","useTranslation","Components","useComponentContext","form","useChildSupportGarnishmentForm","BaseLayout","Fields","hasSelection","handleSubmit","result","SDKFormProvider","jsx","Form","jsxs","Flex","entry","requiredAttrLabel","value","paymentPeriodLabel","ActionsLayout","selectedAgency","key","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ASiB,EACPI,GACAC,GACQ;AAER,SADcD,GAAgB,oBAAoB,KAAK,CAAAE,MAAKA,EAAE,QAAQD,CAAG,GAC3D,SAASA;AACzB;AAEA,SAASH,EACPnB,GACAkB,GACQ;AACR,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,aAAOlB,EAAE,sCAAsC;AAAA,IACjD,KAAK;AACH,aAAOA,EAAE,2CAA2C;AAAA,IACtD,KAAK;AACH,aAAOA,EAAE,0CAA0C;AAAA,IACrD,KAAK;AACH,aAAOA,EAAE,oCAAoC;AAAA,EAAA;AAEnD;"}
@@ -5,20 +5,19 @@ import { useDeductionForm as b } from "../useDeductionForm/useDeductionForm.js";
5
5
  import { Form as h } from "../../../../Common/Form/Form.js";
6
6
  import { Flex as u } from "../../../../Common/Flex/Flex.js";
7
7
  import { ActionsLayout as y } from "../../../../Common/ActionsLayout/ActionsLayout.js";
8
- import { useComponentContext as A } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
9
- import "react";
10
8
  import { BaseLayout as g } from "../../../../Base/Base.js";
11
- import { SDKFormProvider as R } from "../../../../../partner-hook-utils/form/SDKFormProvider.js";
12
- function S({
9
+ import { SDKFormProvider as A } from "../../../../../partner-hook-utils/form/SDKFormProvider.js";
10
+ import { useComponentContext as R } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
11
+ function O({
13
12
  employeeId: t,
14
13
  deduction: a,
15
14
  courtOrdered: o,
16
15
  garnishmentType: n,
17
- title: m,
18
- onSaved: l,
16
+ title: l,
17
+ onSaved: m,
19
18
  onCancel: p
20
19
  }) {
21
- const { t: s } = f("Employee.DeductionsForm"), c = A(), i = b({
20
+ const { t: s } = f("Employee.DeductionsForm"), c = R(), i = b({
22
21
  employeeId: t,
23
22
  garnishmentId: a?.uuid,
24
23
  courtOrdered: o,
@@ -34,8 +33,8 @@ function S({
34
33
  Fields: r,
35
34
  Components: c,
36
35
  t: s,
37
- title: m,
38
- onSaved: l,
36
+ title: l,
37
+ onSaved: m,
39
38
  onCancel: p
40
39
  }
41
40
  );
@@ -45,8 +44,8 @@ function x({
45
44
  Fields: a,
46
45
  Components: o,
47
46
  t: n,
48
- title: m,
49
- onSaved: l,
47
+ title: l,
48
+ onSaved: m,
50
49
  onCancel: p
51
50
  }) {
52
51
  const s = D({
@@ -54,10 +53,10 @@ function x({
54
53
  name: "deductAsPercentage"
55
54
  }), c = s === !0 || s === "true", i = async () => {
56
55
  const r = await t.actions.onSubmit();
57
- r && l(r.data, r.mode);
56
+ r && m(r.data, r.mode);
58
57
  };
59
- return /* @__PURE__ */ e(g, { error: t.errorHandling.errors, children: /* @__PURE__ */ e(R, { formHookResult: t, children: /* @__PURE__ */ e(h, { onSubmit: i, children: /* @__PURE__ */ d(u, { flexDirection: "column", gap: 32, children: [
60
- /* @__PURE__ */ e(o.Heading, { as: "h3", children: m }),
58
+ return /* @__PURE__ */ e(g, { error: t.errorHandling.errors, children: /* @__PURE__ */ e(A, { formHookResult: t, children: /* @__PURE__ */ e(h, { onSubmit: i, children: /* @__PURE__ */ d(u, { flexDirection: "column", gap: 32, children: [
59
+ /* @__PURE__ */ e(o.Heading, { as: "h3", children: l }),
61
60
  /* @__PURE__ */ d(u, { flexDirection: "column", gap: 20, children: [
62
61
  /* @__PURE__ */ d(u, { flexDirection: "column", gap: 20, children: [
63
62
  /* @__PURE__ */ e(
@@ -131,6 +130,6 @@ function x({
131
130
  ] }) }) }) });
132
131
  }
133
132
  export {
134
- S as StandardDeductionForm
133
+ O as StandardDeductionForm
135
134
  };
136
135
  //# sourceMappingURL=StandardDeductionForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StandardDeductionForm.js","sources":["../../../../../../src/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useWatch } from 'react-hook-form'\nimport type {\n Garnishment,\n GarnishmentType,\n} from '@gusto/embedded-api/models/components/garnishment'\nimport type { Control } from 'react-hook-form'\nimport { useDeductionForm } from '../useDeductionForm'\nimport type { DeductionFormData } from '../useDeductionForm'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { BaseLayout } from '@/components/Base/Base'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface StandardDeductionFormProps {\n employeeId: string\n deduction: Garnishment | null\n /** Court-ordered garnishments require `garnishmentType`. Custom deductions don't. */\n courtOrdered: boolean\n /** Only meaningful when `courtOrdered: true`. Selects the garnishment type\n * on create. Ignored in edit mode (the existing type is preserved). */\n garnishmentType?: GarnishmentType\n /** Section heading shown above the form. The parent picker is responsible\n * for translating the garnishment-type label so this component doesn't\n * need to repeat the labels mapping. */\n title: string\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n onCancel: () => void\n}\n\n/** @internal */\nexport function StandardDeductionForm({\n employeeId,\n deduction,\n courtOrdered,\n garnishmentType,\n title,\n onSaved,\n onCancel,\n}: StandardDeductionFormProps) {\n const { t } = useTranslation('Employee.DeductionsForm')\n const Components = useComponentContext()\n\n const form = useDeductionForm({\n employeeId,\n garnishmentId: deduction?.uuid,\n courtOrdered,\n defaultValues: courtOrdered && garnishmentType ? { garnishmentType } : undefined,\n })\n\n if (form.isLoading) {\n return <BaseLayout isLoading error={form.errorHandling.errors} />\n }\n\n const { Fields } = form.form\n return (\n <ReadyForm\n form={form}\n Fields={Fields}\n Components={Components}\n t={t}\n title={title}\n onSaved={onSaved}\n onCancel={onCancel}\n />\n )\n}\n\n// Split into a child component so we can call `useWatch` on the form's control\n// only once the hook is in its ready state (the control reference exists then).\nfunction ReadyForm({\n form,\n Fields,\n Components,\n t,\n title,\n onSaved,\n onCancel,\n}: {\n form: Extract<ReturnType<typeof useDeductionForm>, { isLoading: false }>\n Fields: Extract<ReturnType<typeof useDeductionForm>, { isLoading: false }>['form']['Fields']\n Components: ReturnType<typeof useComponentContext>\n t: ReturnType<typeof useTranslation<'Employee.DeductionsForm'>>['t']\n title: string\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n onCancel: () => void\n}) {\n // useWatch subscribes to changes; getValues only reads once. We need the\n // subscription because `Fields.Amount`'s `format` and `description` props\n // need to re-render when the user toggles Percentage / Fixed amount.\n // The RadioGroup's options carry string values (`'true'`/`'false'`), which\n // round-trip into form state as strings — only `coerceStringBoolean` in the\n // zod preprocessor turns them into actual booleans at validation time. So\n // here we explicitly compare against both shapes; `Boolean('false')` would\n // be truthy and surface the wrong copy under the Amount field.\n const watchedDeductAsPercentageRaw = useWatch({\n control: form.form.hookFormInternals.formMethods.control as Control<DeductionFormData>,\n name: 'deductAsPercentage',\n }) as boolean | 'true' | 'false' | undefined\n const watchedDeductAsPercentage =\n watchedDeductAsPercentageRaw === true || watchedDeductAsPercentageRaw === 'true'\n\n const handleSubmit = async () => {\n const result = await form.actions.onSubmit()\n if (result) onSaved(result.data, result.mode)\n }\n\n return (\n <BaseLayout error={form.errorHandling.errors}>\n <SDKFormProvider formHookResult={form}>\n <Form onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h3\">{title}</Components.Heading>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.Description\n label={t('standard.descriptionLabel')}\n validationMessages={{ REQUIRED: t('standard.descriptionRequired') }}\n />\n <Fields.Recurring\n label={t('standard.frequencyLabel')}\n getOptionLabel={(value: boolean) =>\n value ? t('standard.frequencyRecurring') : t('standard.frequencyOneTime')\n }\n validationMessages={{ REQUIRED: t('standard.frequencyRequired') }}\n />\n <Fields.DeductAsPercentage\n label={t('standard.typeLabel')}\n getOptionLabel={(value: boolean) =>\n value ? t('standard.typePercentage') : t('standard.typeFixed')\n }\n validationMessages={{ REQUIRED: t('standard.typeRequired') }}\n />\n <Fields.Amount\n label={t('standard.amountLabel')}\n format={watchedDeductAsPercentage ? 'percent' : 'currency'}\n description={\n watchedDeductAsPercentage\n ? t('standard.amountPercentDescription')\n : t('standard.amountFixedDescription')\n }\n min={0}\n validationMessages={{\n REQUIRED: t('standard.amountRequired'),\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n </Flex>\n {Fields.TotalAmount && Fields.AnnualMaximum && (\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.TotalAmount\n label={t('standard.totalAmountLabel')}\n description={t('standard.totalAmountDescription')}\n format=\"currency\"\n min={0}\n validationMessages={{\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n <Fields.AnnualMaximum\n label={t('standard.annualMaxLabel')}\n description={t('standard.annualMaxDescription')}\n format=\"currency\"\n min={0}\n validationMessages={{\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onCancel}>\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={form.status.isPending}>\n {t('actions.save')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n )\n}\n"],"names":["StandardDeductionForm","employeeId","deduction","courtOrdered","garnishmentType","title","onSaved","onCancel","t","useTranslation","Components","useComponentContext","form","useDeductionForm","BaseLayout","Fields","jsx","ReadyForm","watchedDeductAsPercentageRaw","useWatch","watchedDeductAsPercentage","handleSubmit","result","SDKFormProvider","Form","jsxs","Flex","value","ActionsLayout"],"mappings":";;;;;;;;;;;AAiCO,SAASA,EAAsB;AAAA,EACpC,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAA+B;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChDC,IAAaC,EAAA,GAEbC,IAAOC,EAAiB;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YACP,KAAK;AAAA,YACL,oBAAoB;AAAA,cAClB,iBAAiBA,EAAE,4BAA4B;AAAA,YAAA;AAAA,UACjD;AAAA,QAAA;AAAA,QAEF,gBAAAQ;AAAA,UAACD,EAAO;AAAA,UAAP;AAAA,YACC,OAAOP,EAAE,yBAAyB;AAAA,YAClC,aAAaA,EAAE,+BAA+B;AAAA,YAC9C,QAAO;AAAA,YACP,KAAK;AAAA,YACL,oBAAoB;AAAA,cAClB,iBAAiBA,EAAE,4BAA4B;AAAA,YAAA;AAAA,UACjD;AAAA,QAAA;AAAA,MACF,EAAA,CACF;AAAA,IAAA,GAEJ;AAAA,sBACCoB,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAZ,EAACN,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASH,GAC3D,UAAAC,EAAE,gBAAgB,EAAA,CACrB;AAAA,MACA,gBAAAQ,EAACN,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWE,EAAK,OAAO,WACrD,UAAAJ,EAAE,cAAc,EAAA,CACnB;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"StandardDeductionForm.js","sources":["../../../../../../src/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useWatch } from 'react-hook-form'\nimport type {\n Garnishment,\n GarnishmentType,\n} from '@gusto/embedded-api/models/components/garnishment'\nimport type { Control } from 'react-hook-form'\nimport { useDeductionForm } from '../useDeductionForm'\nimport type { DeductionFormData } from '../useDeductionForm'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { BaseLayout } from '@/components/Base/Base'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface StandardDeductionFormProps {\n employeeId: string\n deduction: Garnishment | null\n /** Court-ordered garnishments require `garnishmentType`. Custom deductions don't. */\n courtOrdered: boolean\n /** Only meaningful when `courtOrdered: true`. Selects the garnishment type\n * on create. Ignored in edit mode (the existing type is preserved). */\n garnishmentType?: GarnishmentType\n /** Section heading shown above the form. The parent picker is responsible\n * for translating the garnishment-type label so this component doesn't\n * need to repeat the labels mapping. */\n title: string\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n onCancel: () => void\n}\n\n/** @internal */\nexport function StandardDeductionForm({\n employeeId,\n deduction,\n courtOrdered,\n garnishmentType,\n title,\n onSaved,\n onCancel,\n}: StandardDeductionFormProps) {\n const { t } = useTranslation('Employee.DeductionsForm')\n const Components = useComponentContext()\n\n const form = useDeductionForm({\n employeeId,\n garnishmentId: deduction?.uuid,\n courtOrdered,\n defaultValues: courtOrdered && garnishmentType ? { garnishmentType } : undefined,\n })\n\n if (form.isLoading) {\n return <BaseLayout isLoading error={form.errorHandling.errors} />\n }\n\n const { Fields } = form.form\n return (\n <ReadyForm\n form={form}\n Fields={Fields}\n Components={Components}\n t={t}\n title={title}\n onSaved={onSaved}\n onCancel={onCancel}\n />\n )\n}\n\n// Split into a child component so we can call `useWatch` on the form's control\n// only once the hook is in its ready state (the control reference exists then).\nfunction ReadyForm({\n form,\n Fields,\n Components,\n t,\n title,\n onSaved,\n onCancel,\n}: {\n form: Extract<ReturnType<typeof useDeductionForm>, { isLoading: false }>\n Fields: Extract<ReturnType<typeof useDeductionForm>, { isLoading: false }>['form']['Fields']\n Components: ReturnType<typeof useComponentContext>\n t: ReturnType<typeof useTranslation<'Employee.DeductionsForm'>>['t']\n title: string\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n onCancel: () => void\n}) {\n // useWatch subscribes to changes; getValues only reads once. We need the\n // subscription because `Fields.Amount`'s `format` and `description` props\n // need to re-render when the user toggles Percentage / Fixed amount.\n // The RadioGroup's options carry string values (`'true'`/`'false'`), which\n // round-trip into form state as strings — only `coerceStringBoolean` in the\n // zod preprocessor turns them into actual booleans at validation time. So\n // here we explicitly compare against both shapes; `Boolean('false')` would\n // be truthy and surface the wrong copy under the Amount field.\n const watchedDeductAsPercentageRaw = useWatch({\n control: form.form.hookFormInternals.formMethods.control as Control<DeductionFormData>,\n name: 'deductAsPercentage',\n }) as boolean | 'true' | 'false' | undefined\n const watchedDeductAsPercentage =\n watchedDeductAsPercentageRaw === true || watchedDeductAsPercentageRaw === 'true'\n\n const handleSubmit = async () => {\n const result = await form.actions.onSubmit()\n if (result) onSaved(result.data, result.mode)\n }\n\n return (\n <BaseLayout error={form.errorHandling.errors}>\n <SDKFormProvider formHookResult={form}>\n <Form onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h3\">{title}</Components.Heading>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.Description\n label={t('standard.descriptionLabel')}\n validationMessages={{ REQUIRED: t('standard.descriptionRequired') }}\n />\n <Fields.Recurring\n label={t('standard.frequencyLabel')}\n getOptionLabel={(value: boolean) =>\n value ? t('standard.frequencyRecurring') : t('standard.frequencyOneTime')\n }\n validationMessages={{ REQUIRED: t('standard.frequencyRequired') }}\n />\n <Fields.DeductAsPercentage\n label={t('standard.typeLabel')}\n getOptionLabel={(value: boolean) =>\n value ? t('standard.typePercentage') : t('standard.typeFixed')\n }\n validationMessages={{ REQUIRED: t('standard.typeRequired') }}\n />\n <Fields.Amount\n label={t('standard.amountLabel')}\n format={watchedDeductAsPercentage ? 'percent' : 'currency'}\n description={\n watchedDeductAsPercentage\n ? t('standard.amountPercentDescription')\n : t('standard.amountFixedDescription')\n }\n min={0}\n validationMessages={{\n REQUIRED: t('standard.amountRequired'),\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n </Flex>\n {Fields.TotalAmount && Fields.AnnualMaximum && (\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.TotalAmount\n label={t('standard.totalAmountLabel')}\n description={t('standard.totalAmountDescription')}\n format=\"currency\"\n min={0}\n validationMessages={{\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n <Fields.AnnualMaximum\n label={t('standard.annualMaxLabel')}\n description={t('standard.annualMaxDescription')}\n format=\"currency\"\n min={0}\n validationMessages={{\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onCancel}>\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={form.status.isPending}>\n {t('actions.save')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n )\n}\n"],"names":["StandardDeductionForm","employeeId","deduction","courtOrdered","garnishmentType","title","onSaved","onCancel","t","useTranslation","Components","useComponentContext","form","useDeductionForm","BaseLayout","Fields","jsx","ReadyForm","watchedDeductAsPercentageRaw","useWatch","watchedDeductAsPercentage","handleSubmit","result","SDKFormProvider","Form","jsxs","Flex","value","ActionsLayout"],"mappings":";;;;;;;;;;AAiCO,SAASA,EAAsB;AAAA,EACpC,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAA+B;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChDC,IAAaC,EAAA,GAEbC,IAAOC,EAAiB;AAAA,IAC5B,YAAAZ;AAAA,IACA,eAAeC,GAAW;AAAA,IAC1B,cAAAC;AAAA,IACA,eAAeA,KAAgBC,IAAkB,EAAE,iBAAAA,MAAoB;AAAA,EAAA,CACxE;AAED,MAAIQ,EAAK;AACP,6BAAQE,GAAA,EAAW,WAAS,IAAC,OAAOF,EAAK,cAAc,QAAQ;AAGjE,QAAM,EAAE,QAAAG,MAAWH,EAAK;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YACL,oBAAoB;AAAA,cAClB,iBAAiBA,EAAE,4BAA4B;AAAA,YAAA;AAAA,UACjD;AAAA,QAAA;AAAA,MACF,EAAA,CACF;AAAA,IAAA,GAEJ;AAAA,sBACCoB,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAZ,EAACN,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASH,GAC3D,UAAAC,EAAE,gBAAgB,EAAA,CACrB;AAAA,MACA,gBAAAQ,EAACN,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWE,EAAK,OAAO,WACrD,UAAAJ,EAAE,cAAc,EAAA,CACnB;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
@@ -1,17 +1,16 @@
1
1
  import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
- import { useTranslation as s, Trans as p } from "react-i18next";
3
- import { useEmployeeFormsGetSuspense as u } from "@gusto/embedded-api/react-query/employeeFormsGet";
2
+ import { useTranslation as s, Trans as u } from "react-i18next";
3
+ import { useEmployeeFormsGetSuspense as p } from "@gusto/embedded-api/react-query/employeeFormsGet";
4
4
  import { useEmployeeFormsGetPdfSuspense as f } from "@gusto/embedded-api/react-query/employeeFormsGetPdf";
5
5
  import { BaseComponent as d } from "../../../Base/Base.js";
6
6
  import { useBase as C } from "../../../Base/useBase.js";
7
7
  import { Flex as D } from "../../../Common/Flex/Flex.js";
8
8
  import { ActionsLayout as y } from "../../../Common/ActionsLayout/ActionsLayout.js";
9
9
  import { useComponentContext as g } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
10
- import "react";
11
10
  import { useI18n as h } from "../../../../i18n/I18n.js";
12
11
  import { componentEvents as E } from "../../../../shared/constants.js";
13
12
  import { DocumentViewer as x } from "../../../Common/DocumentViewer/DocumentViewer.js";
14
- function P(o) {
13
+ function N(o) {
15
14
  return h("Employee.DocumentManager"), /* @__PURE__ */ e(d, { ...o, componentName: "Employee.DocumentManager", children: /* @__PURE__ */ e(w, { employeeId: o.employeeId, formId: o.formId }) });
16
15
  }
17
16
  function w({
@@ -20,13 +19,13 @@ function w({
20
19
  }) {
21
20
  const { t: r } = s("Employee.DocumentManager"), t = g(), { onEvent: a } = C(), {
22
21
  data: { form: n }
23
- } = u({ employeeId: o, formId: i }), {
22
+ } = p({ employeeId: o, formId: i }), {
24
23
  data: { formPdf: c }
25
24
  } = f({ employeeId: o, formId: i }), m = c?.documentUrl;
26
25
  return n ? /* @__PURE__ */ l(D, { flexDirection: "column", gap: 16, children: [
27
26
  n.title && /* @__PURE__ */ e(t.Heading, { as: "h2", children: n.title }),
28
27
  m && /* @__PURE__ */ e(t.Text, { children: /* @__PURE__ */ e(
29
- p,
28
+ u,
30
29
  {
31
30
  t: r,
32
31
  i18nKey: "downloadDocumentCta",
@@ -57,6 +56,6 @@ function w({
57
56
  ] }) : null;
58
57
  }
59
58
  export {
60
- P as DocumentManager
59
+ N as DocumentManager
61
60
  };
62
61
  //# sourceMappingURL=DocumentManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentManager.js","sources":["../../../../../src/components/Employee/Documents/management/DocumentManager.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { BaseComponentKeys } from '@/components/Base/Base'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { DocumentViewer } from '@/components/Common/DocumentViewer'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * Props for {@link DocumentManager}.\n *\n * @public\n */\nexport interface DocumentManagerProps extends BaseComponentInterface<'Employee.DocumentManager'> {\n /** The associated employee identifier. */\n employeeId: string\n /** The identifier of the form to display. */\n formId: string\n}\n\n/**\n * Read-only document viewer for the admin-facing employee dashboard. Renders the\n * selected form's PDF — including unsigned forms, which are shown as-is.\n * Signing is intentionally not offered here; forms are signed by the employee\n * during onboarding, not by an admin viewing the dashboard.\n *\n * @remarks\n * Emits the following events:\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `CANCEL` | The back button is selected | — |\n *\n * @param props - See {@link DocumentManagerProps}.\n * @public\n */\nexport function DocumentManager(props: DocumentManagerProps) {\n useI18n('Employee.DocumentManager')\n return (\n <BaseComponent {...props} componentName=\"Employee.DocumentManager\">\n <DocumentManagerRoot employeeId={props.employeeId} formId={props.formId} />\n </BaseComponent>\n )\n}\n\nfunction DocumentManagerRoot({\n employeeId,\n formId,\n}: Omit<DocumentManagerProps, BaseComponentKeys>) {\n const { t } = useTranslation('Employee.DocumentManager')\n const Components = useComponentContext()\n const { onEvent } = useBase()\n\n const {\n data: { form },\n } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId })\n\n const pdfUrl = formPdf?.documentUrl\n\n if (!form) return null\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {form.title && <Components.Heading as=\"h2\">{form.title}</Components.Heading>}\n {pdfUrl && (\n <Components.Text>\n <Trans\n t={t}\n i18nKey=\"downloadDocumentCta\"\n components={{\n downloadLink: (\n <Components.Link\n href={pdfUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n download={`${form.title || 'form'}.pdf`}\n />\n ),\n }}\n />\n </Components.Text>\n )}\n <DocumentViewer url={pdfUrl} title={form.title} viewDocumentLabel={t('viewDocumentCta')} />\n\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.CANCEL)\n }}\n >\n {t('backCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["DocumentManager","props","useI18n","jsx","BaseComponent","DocumentManagerRoot","employeeId","formId","t","useTranslation","Components","useComponentContext","onEvent","useBase","form","useEmployeeFormsGetSuspense","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","jsxs","Flex","Trans","DocumentViewer","ActionsLayout","componentEvents"],"mappings":";;;;;;;;;;;;;AAwCO,SAASA,EAAgBC,GAA6B;AAC3D,SAAAC,EAAQ,0BAA0B,GAEhC,gBAAAC,EAACC,GAAA,EAAe,GAAGH,GAAO,eAAc,4BACtC,UAAA,gBAAAE,EAACE,GAAA,EAAoB,YAAYJ,EAAM,YAAY,QAAQA,EAAM,QAAQ,GAC3E;AAEJ;AAEA,SAASI,EAAoB;AAAA,EAC3B,YAAAC;AAAA,EACA,QAAAC;AACF,GAAkD;AAChD,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,0BAA0B,GACjDC,IAAaC,EAAA,GACb,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd;AAAA,IACJ,MAAM,EAAE,MAAAC,EAAA;AAAA,EAAK,IACXC,EAA4B,EAAE,YAAAT,GAAY,QAAAC,GAAQ,GAChD;AAAA,IACJ,MAAM,EAAE,SAAAS,EAAA;AAAA,EAAQ,IACdC,EAA+B,EAAE,YAAAX,GAAY,QAAAC,GAAQ,GAEnDW,IAASF,GAAS;AAExB,SAAKF,IAGH,gBAAAK,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,IAAAN,EAAK,2BAAUJ,EAAW,SAAX,EAAmB,IAAG,MAAM,YAAK,MAAA,CAAM;AAAA,IACtDQ,KACC,gBAAAf,EAACO,EAAW,MAAX,EACC,UAAA,gBAAAP;AAAA,MAACkB;AAAA,MAAA;AAAA,QACC,GAAAb;AAAA,QACA,SAAQ;AAAA,QACR,YAAY;AAAA,UACV,cACE,gBAAAL;AAAA,YAACO,EAAW;AAAA,YAAX;AAAA,cACC,MAAMQ;AAAA,cACN,QAAO;AAAA,cACP,KAAI;AAAA,cACJ,UAAU,GAAGJ,EAAK,SAAS,MAAM;AAAA,YAAA;AAAA,UAAA;AAAA,QACnC;AAAA,MAEJ;AAAA,IAAA,GAEJ;AAAA,IAEF,gBAAAX,EAACmB,GAAA,EAAe,KAAKJ,GAAQ,OAAOJ,EAAK,OAAO,mBAAmBN,EAAE,iBAAiB,EAAA,CAAG;AAAA,sBAExFe,GAAA,EACC,UAAA,gBAAApB;AAAA,MAACO,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAE,EAAQY,EAAgB,MAAM;AAAA,QAChC;AAAA,QAEC,YAAE,SAAS;AAAA,MAAA;AAAA,IAAA,EACd,CACF;AAAA,EAAA,GACF,IAnCgB;AAqCpB;"}
1
+ {"version":3,"file":"DocumentManager.js","sources":["../../../../../src/components/Employee/Documents/management/DocumentManager.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { BaseComponentKeys } from '@/components/Base/Base'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { DocumentViewer } from '@/components/Common/DocumentViewer'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * Props for {@link DocumentManager}.\n *\n * @public\n */\nexport interface DocumentManagerProps extends BaseComponentInterface<'Employee.DocumentManager'> {\n /** The associated employee identifier. */\n employeeId: string\n /** The identifier of the form to display. */\n formId: string\n}\n\n/**\n * Read-only document viewer for the admin-facing employee dashboard. Renders the\n * selected form's PDF — including unsigned forms, which are shown as-is.\n * Signing is intentionally not offered here; forms are signed by the employee\n * during onboarding, not by an admin viewing the dashboard.\n *\n * @remarks\n * Emits the following events:\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `CANCEL` | The back button is selected | — |\n *\n * @param props - See {@link DocumentManagerProps}.\n * @public\n */\nexport function DocumentManager(props: DocumentManagerProps) {\n useI18n('Employee.DocumentManager')\n return (\n <BaseComponent {...props} componentName=\"Employee.DocumentManager\">\n <DocumentManagerRoot employeeId={props.employeeId} formId={props.formId} />\n </BaseComponent>\n )\n}\n\nfunction DocumentManagerRoot({\n employeeId,\n formId,\n}: Omit<DocumentManagerProps, BaseComponentKeys>) {\n const { t } = useTranslation('Employee.DocumentManager')\n const Components = useComponentContext()\n const { onEvent } = useBase()\n\n const {\n data: { form },\n } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId })\n\n const pdfUrl = formPdf?.documentUrl\n\n if (!form) return null\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {form.title && <Components.Heading as=\"h2\">{form.title}</Components.Heading>}\n {pdfUrl && (\n <Components.Text>\n <Trans\n t={t}\n i18nKey=\"downloadDocumentCta\"\n components={{\n downloadLink: (\n <Components.Link\n href={pdfUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n download={`${form.title || 'form'}.pdf`}\n />\n ),\n }}\n />\n </Components.Text>\n )}\n <DocumentViewer url={pdfUrl} title={form.title} viewDocumentLabel={t('viewDocumentCta')} />\n\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.CANCEL)\n }}\n >\n {t('backCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["DocumentManager","props","useI18n","jsx","BaseComponent","DocumentManagerRoot","employeeId","formId","t","useTranslation","Components","useComponentContext","onEvent","useBase","form","useEmployeeFormsGetSuspense","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","jsxs","Flex","Trans","DocumentViewer","ActionsLayout","componentEvents"],"mappings":";;;;;;;;;;;;AAwCO,SAASA,EAAgBC,GAA6B;AAC3D,S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,UAAA,gBAAApB;AAAA,MAACO,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAE,EAAQY,EAAgB,MAAM;AAAA,QAChC;AAAA,QAEC,YAAE,SAAS;AAAA,MAAA;AAAA,IAAA,EACd,CACF;AAAA,EAAA,GACF,IAnCgB;AAqCpB;"}
@@ -2,20 +2,19 @@ import { jsx as e } from "react/jsx-runtime";
2
2
  import { useTranslation as c } from "react-i18next";
3
3
  import { Loading as d } from "../../../../Common/Loading/Loading.js";
4
4
  import { EmptyData as l } from "../../../../Common/EmptyData/EmptyData.js";
5
- import { useComponentContext as p } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- import "react";
7
- import { BaseBoundaries as g, BaseLayout as f } from "../../../../Base/Base.js";
5
+ import { BaseBoundaries as g, BaseLayout as p } from "../../../../Base/Base.js";
6
+ import { useComponentContext as f } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
8
7
  import { useI18n as y } from "../../../../../i18n/I18n.js";
9
8
  import { componentEvents as E } from "../../../../../shared/constants.js";
10
9
  import { useDocumentsList as D } from "../../shared/useDocumentsList/useDocumentsList.js";
11
10
  import { useDataView as S } from "../../../../Common/DataView/useDataView.js";
12
11
  import { DataView as C } from "../../../../Common/DataView/DataView.js";
13
- function A(o) {
12
+ function v(o) {
14
13
  return /* @__PURE__ */ e(g, { componentName: "Employee.Management.Documents", children: /* @__PURE__ */ e(h, { ...o }) });
15
14
  }
16
15
  function h({ employeeId: o, onEvent: s }) {
17
16
  y("Employee.Management.Documents");
18
- const { t } = c("Employee.Management.Documents"), r = p(), i = D({ employeeId: o }), a = i.isLoading ? [] : i.data.forms, m = [
17
+ const { t } = c("Employee.Management.Documents"), r = f(), i = D({ employeeId: o }), a = i.isLoading ? [] : i.data.forms, m = [
19
18
  {
20
19
  key: "title",
21
20
  title: t("columns.title"),
@@ -54,9 +53,9 @@ function h({ employeeId: o, onEvent: s }) {
54
53
  ),
55
54
  emptyState: () => /* @__PURE__ */ e(l, { title: t("emptyState.title"), description: t("emptyState.description") })
56
55
  });
57
- return /* @__PURE__ */ e(f, { error: i.errorHandling.errors, children: /* @__PURE__ */ e(r.Box, { withPadding: !1, header: /* @__PURE__ */ e(r.BoxHeader, { title: t("title") }), children: i.isLoading ? /* @__PURE__ */ e(d, {}) : /* @__PURE__ */ e(C, { label: t("listLabel"), isWithinBox: !0, ...u }) }) });
56
+ return /* @__PURE__ */ e(p, { error: i.errorHandling.errors, children: /* @__PURE__ */ e(r.Box, { withPadding: !1, header: /* @__PURE__ */ e(r.BoxHeader, { title: t("title") }), children: i.isLoading ? /* @__PURE__ */ e(d, {}) : /* @__PURE__ */ e(C, { label: t("listLabel"), isWithinBox: !0, ...u }) }) });
58
57
  }
59
58
  export {
60
- A as DocumentsCard
59
+ v as DocumentsCard
61
60
  };
62
61
  //# sourceMappingURL=DocumentsCard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentsCard.js","sources":["../../../../../../src/components/Employee/Documents/management/DocumentsCard/DocumentsCard.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Form } from '@gusto/embedded-api/models/components/form'\nimport { useDocumentsList } from '../../shared/useDocumentsList'\nimport { DataView, useDataView, EmptyData, Loading } from '@/components/Common'\nimport { BaseBoundaries, BaseLayout } from '@/components/Base/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link DocumentsCard}.\n *\n * @public\n */\nexport interface DocumentsCardProps {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired when a row's View CTA is clicked. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Standalone \"Documents\" (forms) card. Owns its own data fetch via\n * {@link useDocumentsList} and renders the employee's forms in a table with a\n * per-row \"View\" action. Emits\n * `employee/management/documents/card/viewRequested` with\n * `{ employeeId, formId }` when a row's View CTA is clicked. The card is\n * read-only — viewing or signing a form happens in the screen the parent\n * routes to — and renders no alerts: alert rendering is the parent's\n * responsibility.\n *\n * @param props - See {@link DocumentsCardProps}.\n * @returns The documents card.\n * @public\n */\nexport function DocumentsCard(props: DocumentsCardProps) {\n return (\n <BaseBoundaries componentName=\"Employee.Management.Documents\">\n <DocumentsCardContent {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction DocumentsCardContent({ employeeId, onEvent }: DocumentsCardProps) {\n useI18n('Employee.Management.Documents')\n const { t } = useTranslation('Employee.Management.Documents')\n const Components = useComponentContext()\n\n const documentsList = useDocumentsList({ employeeId })\n\n const forms = documentsList.isLoading ? [] : documentsList.data.forms\n\n const formsColumns = [\n {\n key: 'title',\n title: t('columns.title'),\n render: (form: Form) => form.title || '-',\n },\n {\n key: 'year',\n title: t('columns.year'),\n render: (form: Form) => (form.year ? String(form.year) : '-'),\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: (form: Form) => (form.draft ? t('status.draft') : t('status.final')),\n },\n {\n key: 'requiresSigning',\n title: t('columns.requiresSigning'),\n render: (form: Form) =>\n form.requiresSigning ? (\n <Components.Badge status=\"warning\">{t('signingStatus.notSigned')}</Components.Badge>\n ) : (\n <Components.Badge status=\"success\">{t('signingStatus.signed')}</Components.Badge>\n ),\n },\n ]\n\n const formsDataView = useDataView({\n data: forms,\n columns: formsColumns,\n itemMenu: (form: Form) => (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_DOCUMENTS_CARD_VIEW_REQUESTED, {\n employeeId,\n formId: form.uuid,\n })\n }}\n >\n {t('viewCta')}\n </Components.Button>\n ),\n emptyState: () => (\n <EmptyData title={t('emptyState.title')} description={t('emptyState.description')} />\n ),\n })\n\n return (\n <BaseLayout error={documentsList.errorHandling.errors}>\n <Components.Box withPadding={false} header={<Components.BoxHeader title={t('title')} />}>\n {documentsList.isLoading ? (\n <Loading />\n ) : (\n <DataView label={t('listLabel')} isWithinBox {...formsDataView} />\n )}\n </Components.Box>\n </BaseLayout>\n )\n}\n"],"names":["DocumentsCard","props","jsx","BaseBoundaries","DocumentsCardContent","employeeId","onEvent","useI18n","useTranslation","Components","useComponentContext","documentsList","useDocumentsList","forms","formsColumns","form","formsDataView","useDataView","componentEvents","EmptyData","BaseLayout","Loading","DataView"],"mappings":";;;;;;;;;;;;AAoCO,SAASA,EAAcC,GAA2B;AACvD,SACE,gBAAAC,EAACC,KAAe,eAAc,iCAC5B,4BAACC,GAAA,EAAsB,GAAGH,GAAO,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAqB,EAAE,YAAAC,GAAY,SAAAC,KAA+B;AACzE,EAAAC,EAAQ,+BAA+B;AACvC,QAAM,EAAE,EAAA,IAAMC,EAAe,+BAA+B,GACtDC,IAAaC,EAAA,GAEbC,IAAgBC,EAAiB,EAAE,YAAAP,GAAY,GAE/CQ,IAAQF,EAAc,YAAY,CAAA,IAAKA,EAAc,KAAK,OAE1DG,IAAe;AAAA,IACnB;AAAA,MACE,KAAK;AAAA,MACL,OAAO,EAAE,eAAe;AAAA,MACxB,QAAQ,CAACC,MAAeA,EAAK,SAAS;AAAA,IAAA;AAAA,IAExC;AAAA,MACE,KAAK;AAAA,MACL,OAAO,EAAE,cAAc;AAAA,MACvB,QAAQ,CAACA,MAAgBA,EAAK,OAAO,OAAOA,EAAK,IAAI,IAAI;AAAA,IAAA;AAAA,IAE3D;AAAA,MACE,KAAK;AAAA,MACL,OAAO,EAAE,gBAAgB;AAAA,MACzB,QAAQ,CAACA,MAAgBA,EAAK,QAAQ,EAAE,cAAc,IAAI,EAAE,cAAc;AAAA,IAAA;AAAA,IAE5E;AAAA,MACE,KAAK;AAAA,MACL,OAAO,EAAE,yBAAyB;AAAA,MAClC,QAAQ,CAACA,MACPA,EAAK,kBACH,gBAAAb,EAACO,EAAW,OAAX,EAAiB,QAAO,WAAW,YAAE,yBAAyB,GAAE,IAEjE,gBAAAP,EAACO,EAAW,OAAX,EAAiB,QAAO,WAAW,UAAA,EAAE,sBAAsB,EAAA,CAAE;AAAA,IAAA;AAAA,EAEpE,GAGIO,IAAgBC,EAAY;AAAA,IAChC,MAAMJ;AAAA,IACN,SAASC;AAAA,IACT,UAAU,CAACC,MACT,gBAAAb;AAAA,MAACO,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAH,EAAQY,EAAgB,mDAAmD;AAAA,YACzE,YAAAb;AAAA,YACA,QAAQU,EAAK;AAAA,UAAA,CACd;AAAA,QACH;AAAA,QAEC,YAAE,SAAS;AAAA,MAAA;AAAA,IAAA;AAAA,IAGhB,YAAY,MACV,gBAAAb,EAACiB,GAAA,EAAU,OAAO,EAAE,kBAAkB,GAAG,aAAa,EAAE,wBAAwB,EAAA,CAAG;AAAA,EAAA,CAEtF;AAED,2BACGC,GAAA,EAAW,OAAOT,EAAc,cAAc,QAC7C,UAAA,gBAAAT,EAACO,EAAW,KAAX,EAAe,aAAa,IAAO,0BAASA,EAAW,WAAX,EAAqB,OAAO,EAAE,OAAO,GAAG,GAClF,UAAAE,EAAc,YACb,gBAAAT,EAACmB,GAAA,EAAQ,IAET,gBAAAnB,EAACoB,GAAA,EAAS,OAAO,EAAE,WAAW,GAAG,aAAW,IAAE,GAAGN,EAAA,CAAe,GAEpE,GACF;AAEJ;"}
1
+ {"version":3,"file":"DocumentsCard.js","sources":["../../../../../../src/components/Employee/Documents/management/DocumentsCard/DocumentsCard.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Form } from '@gusto/embedded-api/models/components/form'\nimport { useDocumentsList } from '../../shared/useDocumentsList'\nimport { DataView, useDataView, EmptyData, Loading } from '@/components/Common'\nimport { BaseBoundaries, BaseLayout } from '@/components/Base/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link DocumentsCard}.\n *\n * @public\n */\nexport interface DocumentsCardProps {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired when a row's View CTA is clicked. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Standalone \"Documents\" (forms) card. Owns its own data fetch via\n * {@link useDocumentsList} and renders the employee's forms in a table with a\n * per-row \"View\" action. Emits\n * `employee/management/documents/card/viewRequested` with\n * `{ employeeId, formId }` when a row's View CTA is clicked. The card is\n * read-only — viewing or signing a form happens in the screen the parent\n * routes to — and renders no alerts: alert rendering is the parent's\n * responsibility.\n *\n * @param props - See {@link DocumentsCardProps}.\n * @returns The documents card.\n * @public\n */\nexport function DocumentsCard(props: DocumentsCardProps) {\n return (\n <BaseBoundaries componentName=\"Employee.Management.Documents\">\n <DocumentsCardContent {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction DocumentsCardContent({ employeeId, onEvent }: DocumentsCardProps) {\n useI18n('Employee.Management.Documents')\n const { t } = useTranslation('Employee.Management.Documents')\n const Components = useComponentContext()\n\n const documentsList = useDocumentsList({ employeeId })\n\n const forms = documentsList.isLoading ? [] : documentsList.data.forms\n\n const formsColumns = [\n {\n key: 'title',\n title: t('columns.title'),\n render: (form: Form) => form.title || '-',\n },\n {\n key: 'year',\n title: t('columns.year'),\n render: (form: Form) => (form.year ? String(form.year) : '-'),\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: (form: Form) => (form.draft ? t('status.draft') : t('status.final')),\n },\n {\n key: 'requiresSigning',\n title: t('columns.requiresSigning'),\n render: (form: Form) =>\n form.requiresSigning ? (\n <Components.Badge status=\"warning\">{t('signingStatus.notSigned')}</Components.Badge>\n ) : (\n <Components.Badge status=\"success\">{t('signingStatus.signed')}</Components.Badge>\n ),\n },\n ]\n\n const formsDataView = useDataView({\n data: forms,\n columns: formsColumns,\n itemMenu: (form: Form) => (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_DOCUMENTS_CARD_VIEW_REQUESTED, {\n employeeId,\n formId: form.uuid,\n })\n }}\n >\n {t('viewCta')}\n </Components.Button>\n ),\n emptyState: () => (\n <EmptyData title={t('emptyState.title')} description={t('emptyState.description')} />\n ),\n })\n\n return (\n <BaseLayout error={documentsList.errorHandling.errors}>\n <Components.Box withPadding={false} header={<Components.BoxHeader title={t('title')} />}>\n {documentsList.isLoading ? (\n <Loading />\n ) : (\n <DataView label={t('listLabel')} isWithinBox {...formsDataView} />\n )}\n </Components.Box>\n </BaseLayout>\n )\n}\n"],"names":["DocumentsCard","props","jsx","BaseBoundaries","DocumentsCardContent","employeeId","onEvent","useI18n","useTranslation","Components","useComponentContext","documentsList","useDocumentsList","forms","formsColumns","form","formsDataView","useDataView","componentEvents","EmptyData","BaseLayout","Loading","DataView"],"mappings":";;;;;;;;;;;AAoCO,SAASA,EAAcC,GAA2B;AACvD,SACE,gBAAAC,EAACC,KAAe,eAAc,iCAC5B,4BAACC,GAAA,EAAsB,GAAGH,GAAO,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAqB,EAAE,YAAAC,GAAY,SAAAC,KAA+B;AACzE,EAAAC,EAAQ,+BAA+B;AACvC,QAAM,EAAE,EAAA,IAAMC,EAAe,+BAA+B,GACtDC,IAAaC,EAAA,GAEbC,IAAgBC,EAAiB,EAAE,YAAAP,GAAY,GAE/CQ,IAAQF,EAAc,YAAY,CAAA,IAAKA,EAAc,KAAK,OAE1DG,IAAe;AAAA,IACnB;AAAA,MACE,KAAK;AAAA,MACL,OAAO,EAAE,eAAe;AAAA,MACxB,QAAQ,CAACC,MAAeA,EAAK,SAAS;AAAA,IAAA;AAAA,IAExC;AAAA,MACE,KAAK;AAAA,MACL,OAAO,EAAE,cAAc;AAAA,MACvB,QAAQ,CAACA,MAAgBA,EAAK,OAAO,OAAOA,EAAK,IAAI,IAAI;AAAA,IAAA;AAAA,IAE3D;AAAA,MACE,KAAK;AAAA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umentList.js";
4
4
  import { ActionsLayout as m } from "../../../../../Common/ActionsLayout/ActionsLayout.js";
5
5
  import { useComponentContext as c } from "../../../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- import "react";
7
- function C() {
8
- const { t: n } = r("Employee.DocumentSigner"), { handleContinue: t, hasSignedAllForms: i } = s(), e = c();
9
- return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(e.Button, { onClick: t, isLoading: !1, isDisabled: !i, children: n("continueCta") }) });
6
+ function d() {
7
+ const { t: n } = r("Employee.DocumentSigner"), { handleContinue: t, hasSignedAllForms: e } = s(), i = c();
8
+ return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(i.Button, { onClick: t, isLoading: !1, isDisabled: !e, children: n("continueCta") }) });
10
9
  }
11
10
  export {
12
- C as Actions
11
+ d as Actions
13
12
  };
14
13
  //# sourceMappingURL=Actions.js.map